@veltdev/sdk-staging 6.0.9-beta.1 → 6.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/velt-comment.js CHANGED
@@ -1,4 +1,4 @@
1
- import{C as ap}from"./chunk-CFLYO4ZJ.js";import{a as pf}from"./chunk-ID3E7CBZ.js";import{a as bf}from"./chunk-IU25BW6T.js";import{a as tb,b as rb,c as Yg,d as Kg}from"./chunk-IBGPKEZW.js";import{a as Zg}from"./chunk-EQBACTBQ.js";import"./chunk-UKJTOZK4.js";import"./chunk-F36WWKDQ.js";import{b as Yh,c as Kh,d as Zh}from"./chunk-VMY3F7K3.js";import{a as Kr}from"./chunk-JHMDMOHO.js";import{b as hf}from"./chunk-AJXYT2YT.js";import{a as wg,c as vb,d as cb}from"./chunk-F44SU3DK.js";import{a as bn}from"./chunk-SYSCTHS4.js";import{a as ao}from"./chunk-SY46UNW5.js";import{a as Jb,b as no,c as of,d as Gg,e as af,f as lf,g as xr,h as zg,i as df,j as Hg,k as hn,n as Wg,o as vf,p as cf,q as oo,r as mf,s as sf,t as gf}from"./chunk-AOHWVH4J.js";import"./chunk-5R5ZQKPN.js";import{b as _g,c as Sg,g as yg,l as ib,m as lb,r as db,s as gb,w as ub,x as Pt}from"./chunk-XISY42XO.js";import{a as Jg}from"./chunk-WFO2GRDO.js";import{a as Wt}from"./chunk-TW7O56QU.js";import{a as mt,b as qt}from"./chunk-7RRXZUH7.js";import{A as jg,B as N,C as P,a as Vg,b as $g,v as rf,z as nf}from"./chunk-CI2SH5RY.js";import{a as Be,b as Yc}from"./chunk-CQX575C2.js";import{a as tf,b as W,c as Yr,d as Lt}from"./chunk-F6CKB7IS.js";import{a as uf}from"./chunk-FUYX2CTL.js";import{a as Dr}from"./chunk-RLD74EXO.js";import{a as nb}from"./chunk-QTF4Y24I.js";import{A as on,F as Qh,G as gt,H as ht,I as eb,Y as mb,ba as sb,ca as $t,da as D,ea as Et,f as bg,fa as xe,ga as At,j as Wh,m as Vv,n as fg,p as Jh,r as Cg,s as Xh,t as kg,v as qh}from"./chunk-3ORHWUHZ.js";import{$ as rt,$b as nn,$f as xb,$h as zb,A as Ih,Aa as hr,Ab as br,Ah as Ub,Ai as Xb,Bb as fr,Bf as To,Bg as Tb,C as Dh,Ca as vr,Ce as Ur,Cf as ur,Cg as Ob,Ch as oe,D as Hu,Db as ft,De as dt,Df as Mg,Dg as Eb,Dh as np,Di as qb,E as Gt,Ea as vg,Eb as Ct,Ec as zr,Ed as ob,Ee as X,Ef as Gv,Fa as d,Fb as kt,Fc as It,Ff as mr,Fi as ut,G as jr,Ga as Le,Gb as Dn,Gc as ue,Gf as eo,Gi as Qb,Ha as cg,Hb as Uv,Hf as pr,I as Nv,Ia as Ph,Ib as we,If as An,Ig as Mb,J as Jn,Jb as it,Jf as Pn,Jg as Wr,Kb as pe,Ke as Tg,Kf as Ku,Kg as Ab,L as ir,Lc as qe,Lf as Zu,M as In,Ma as mg,Mb as Lv,N as Th,Nb as ie,Nc as Bv,Nf as jc,Ni as ef,O as Oh,Oa as Rv,Ob as Ge,Oc as gn,Od as ab,Oe as Yt,Of as Xu,Pa as G,Pb as fe,Pc as zh,Pe as Mn,Pf as Ag,Pg as Oo,Ph as dn,Pi as ro,Q as ig,Qb as ug,Qe as Nt,Qg as zc,Qh as op,R as Eh,Ra as Fh,Rb as Vh,Re as hb,Rg as Hc,S as Wu,Se as qn,Sf as fb,T as Pe,Ta as Nh,Td as Kn,Tf as un,Ua as T,Ud as Zn,Uf as Cb,Uh as Lg,Va as Rh,Vf as Ht,Vh as Lb,W as Lc,Wa as Uh,Wd as Ju,Wh as Bb,Xc as Hh,Xd as Ze,Xh as Vb,Y as Bc,Ya as M,Yb as $h,Yf as qu,Yh as $b,Zb as pg,Zd as lt,Ze as Qn,Zf as an,Zh as jb,_ as lg,_a as s,_b as U,_f as kb,_h as Gb,a as g,aa as Mh,ac as vt,ae as Ig,ag as _b,ai as Bg,b as f,ba as Ah,bb as sg,bc as ce,bg as Sb,bi as Hv,ca as be,cc as C,da as ge,db as k,dc as Ce,di as Hb,eb as Gr,ec as Ke,ef as Og,eg as Gc,eh as Pb,fb as y,fc as O,fg as Pg,fh as Fb,fi as Eo,g as Ae,gb as w,gc as yt,gg as pn,h as xh,ha as B,hb as Lh,hc as Yn,hg as ln,hh as Rg,i as _h,ia as V,ib as gg,if as bb,ig as Qu,ih as zv,ii as kr,ja as de,jb as et,jc as Tn,jg as yb,ji as sr,k as jt,ka as xt,kb as tt,kc as F,ki as A,l as De,la as dg,lb as v,lc as R,lg as wb,li as Wv,m as Sh,mb as b,mc as Er,mg as Fg,mh as ye,nb as x,nc as jh,nd as xg,o as yh,ob as E,oc as Gh,oe as ke,og as ep,oh as Ug,oi as Wb,p as Wn,pc as je,pd as Cr,pe as Dg,pg as Ng,ph as Nb,pi as Yb,q as yn,qa as Me,qe as En,qg as tp,qh as Jr,r as Ee,rc as Vc,rf as $c,rg as to,sb as u,sc as L,se as Hr,sh as Wc,si as Ne,tb as p,tc as _t,te as $v,ti as ot,ua as nt,ub as Je,uc as or,uf as Eg,ui as Mr,v as Te,va as J,vb as Y,vc as Q,ve as Yu,vh as Jc,vi as Kb,w as dr,wa as me,wb as Bh,wc as On,we as cr,wg as Ib,x as wh,xb as z,xc as ar,xe as jv,xg as Db,xi as Xt,ye as pb,yh as Rb,yi as Zb,z as wn,zb as l,zc as hg,ze as Xn,zh as rp,zi as Qe}from"./chunk-VKGZ33MA.js";function Xg(r){try{let o=r?.organizationId,n=r?.documentId;return!o||!n?null:`${o}::${n}`}catch{return null}}function ff(r){try{if(!r)return{excludeResolved:!1,unlockedDocumentKey:null};let{lazyLoadResolvedComments:o,hasResolvedIntent:n,currentDocumentKey:e}=r;if(!e)return{excludeResolved:!1,unlockedDocumentKey:r.unlockedDocumentKey??null};let t=r.unlockedDocumentKey??null,a=n?e:t===e?t:null;return{excludeResolved:!!o&&!(a===e),unlockedDocumentKey:a}}catch{return{excludeResolved:!1,unlockedDocumentKey:null}}}function Cf(r,o){if(r==null&&o==null)return!0;if(r==null||o==null)return!1;let n=new Set(r),e=new Set(o);if(n.size!==e.size)return!1;for(let t of n)if(!e.has(t))return!1;return!0}function kf(r){try{return r?Object.entries(r).filter(([,o])=>o?.type!=="terminal").map(([o,n])=>n?.id??o).filter(o=>!!o):[]}catch{return[]}}function xf(r){try{return r?Object.entries(r).filter(([,o])=>o?.type==="terminal").map(([o,n])=>n?.id??o).filter(o=>!!o):[]}catch{return[]}}function u2(r){try{if(!r)return 0;let o=0;return r.hasApiKeyClause&&o++,r.hasOrganizationIdClause&&o++,(r.documentIdCount??0)>0&&o++,(r.accessFieldCount??0)>0&&o++,(r.locationIdCount??0)>0&&o++,r.hasFolderClause&&o++,(r.nonTerminalStatusCount??0)>0&&o++,o}catch{return 0}}function _f(r){return{documentIdCount:r?.documentIdCount??0,accessFieldCount:r?.accessFieldCount??0,locationIdCount:r?.locationIdCount??0,nonTerminalStatusCount:r?.nonTerminalStatusCount??0,terminalStatusCount:r?.terminalStatusCount??0,hasApiKeyClause:!0,hasOrganizationIdClause:!0,hasFolderClause:!!r?.hasFolderClause,orderByCount:r?.orderByCount??0}}function Sf(r){let o=r?.maxDocumentBatchSize??0,n=(e,t=0,a=0,i="none")=>({applyStatusClause:!1,documentBatchSize:o,projectedDisjunctions:t,projectedFilterSum:a,boundBy:i,reason:e});try{if(o<1)return n("dropped-no-non-terminal-statuses");let e=r?.clauses;if(!e)return n("dropped-no-non-terminal-statuses");let t=e.nonTerminalStatusCount??0;if(t<=0)return n("dropped-no-non-terminal-statuses");if((e.terminalStatusCount??0)<=0)return n("dropped-no-terminal-statuses");let a=(e.documentIdCount??0)>0?e:f(g({},e),{documentIdCount:o}),i=u2(a),c=Math.max(1,e.accessFieldCount??0),m=Math.max(1,e.locationIdCount??0),h=e.orderByCount??0,_=a.documentIdCount,I=le=>Math.min(le,_),S=le=>I(le)*c*m*t,H=le=>le*i+h+1,$=S(o),j=H($),Z=$>30,re=j>100,se=Z&&re?"both":Z?"disjunctions":re?"filter-sum":"none",_e=r?.minDocumentBatchSize??o;for(let le=o;le>=_e;le--){let he=S(le),Se=H(he);if(he<=30&&Se<=100)return{applyStatusClause:!0,documentBatchSize:le,projectedDisjunctions:he,projectedFilterSum:Se,boundBy:se,reason:le===o?"fits":"fits-after-shrink"}}return n("dropped-over-budget",$,j,se)}catch{return n("dropped-over-budget")}}var yf="Processing\u2026";function Kc(r){try{return r?!!(typeof r.commentText=="string"&&r.commentText.trim().length>0||typeof r.commentHtml=="string"&&r.commentHtml.trim().length>0||typeof r.commentVoiceUrl=="string"&&r.commentVoiceUrl.trim().length>0||Array.isArray(r.attachments)&&r.attachments.length>0||Array.isArray(r.recorders)&&r.recorders.length>0):!1}catch{return!1}}function lp(r){try{return!!r?.progress}catch{return!1}}function p2(r){try{return lp(r)&&!Kc(r)}catch{return!1}}function dp(r){try{let o=r?.comments;if(!Array.isArray(o))return{comments:[],progress:[]};let n=[],e=[];return o.forEach(t=>(p2(t)?e:n).push(t)),{comments:n,progress:e}}catch{return{comments:r?.comments??[],progress:[]}}}function h2(r){try{let o=Number(r);return!Number.isFinite(o)||o<=0?6e5:o}catch{return 6e5}}function ip(r){try{if(r==null)return null;if(typeof r=="number")return Number.isFinite(r)?r:null;if(r instanceof Date)return r.getTime();if(typeof r?.toMillis=="function")return r.toMillis();if(typeof r?.seconds=="number")return r.seconds*1e3;let o=new Date(r).getTime();return Number.isNaN(o)?null:o}catch{return null}}function b2(r,o,n){try{let e=ip(r?.lastUpdated);return e==null?!1:n-e>h2(o)}catch{return!1}}function qg(r,o,n){try{return r?.progress?.state!=="active"?!1:!b2(r,o,n)}catch{return!1}}function wf(r){try{let o=r?.progress?.steps;if(Array.isArray(o)&&o.length>0){let n=o[o.length-1];for(let t=o.length-1;t>=0;t--)if(o[t]?.state==="active"){n=o[t];break}let e=n?.label;if(typeof e=="string"&&e.trim().length>0)return{kind:"literal",text:e}}return{kind:"i18nKey",key:yf}}catch{return{kind:"i18nKey",key:yf}}}function If(r){try{return Array.isArray(r)?r.slice().sort((o,n)=>(ip(o?.createdAt)??0)-(ip(n?.createdAt)??0)):[]}catch{return Array.isArray(r)?r.slice():[]}}var Dt=(()=>{let o=class o{constructor(e){this.loggingService=e,this._customStatusMap=new De(X.CommentAnnotationStatusMap),this._customPriorityMap=new De(X.CommentAnnotationPriorityMap),this._customCategoryMap=new De(X.CommentCategoryMap),this.isLazyLoadResolvedCommentsEnabled=null;try{let t=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP);t&&this._customPriorityMap.next(JSON.parse(t));let a=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP);a&&this._customStatusMap.next(JSON.parse(a));let i=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_CATEGORY_MAP);i&&this._customCategoryMap.next(JSON.parse(i))}catch(t){this.loggingService.catch("Error in CustomFilterService constructor: ",t)}}setCustomStatusFilters(e){try{if(e.length<2){this._customStatusMap.next(X.CommentAnnotationStatusMap),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP,JSON.stringify(X.CommentAnnotationStatusMap)),this.loggingService.catch("Custom status filters must have at least 2 filters");return}let t={};e.forEach(a=>{t[a.id]=a,a.type||(a.type="ongoing")}),this.warnOnDroppedStatusIds(t),this._customStatusMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomStatusFilters: ",t)}}warnOnDroppedStatusIds(e){try{let t=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP);if(!t)return;let a=JSON.parse(t),i=Object.keys(a??{});if(!i.length)return;let c=new Set(Object.keys(e??{})),m=i.filter(h=>!c.has(h));if(!m.length||!this.isLazyLoadResolvedCommentsEnabled?.())return;this.loggingService.catch(`[lazyLoadResolvedComments] status catalog dropped ${m.length} id(s): ${m.join(", ")}. Comments still carrying them will NOT be fetched while lazyLoadResolvedComments is enabled \u2014 migrate those annotations to the new ids, or keep the retired ids in the catalog.`,void 0,void 0,!0)}catch(t){this.loggingService.catch("Error in CustomFilterService warnOnDroppedStatusIds: ",t)}}setLazyLoadResolvedCommentsProvider(e){this.isLazyLoadResolvedCommentsEnabled=e}setCustomPriorityFilters(e){try{if(e.length<2){this._customPriorityMap.next(X.CommentAnnotationPriorityMap),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP,JSON.stringify(X.CommentAnnotationPriorityMap)),this.loggingService.catch("Custom priority filters must have at least 2 filters");return}let t={};e.forEach(a=>{t[a.id]=a}),this._customPriorityMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomPriorityFilters: ",t)}}setCustomCategories(e){try{let t={};e.forEach(a=>{t[a.id]=a}),this._customCategoryMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_CATEGORY_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomCategories: ",t)}}get customStatusMap$(){return this._customStatusMap.asObservable()}get customPriorityMap$(){return this._customPriorityMap.asObservable()}get customCategoryMap$(){return this._customCategoryMap.asObservable()}get defaultStatus(){try{let t=Object.entries(this._customStatusMap.value).find(([a,i])=>i.type==="default");if(t)return t[1]}catch(e){this.loggingService.catch("Error in CustomFilterService defaultStatus: ",e)}return X.CommentAnnotationStatusMap.OPEN}get resolvedStatus(){try{let t=Object.entries(this._customStatusMap.value).find(([a,i])=>i.type==="terminal");if(t)return t[1]}catch(e){this.loggingService.catch("Error in CustomFilterService resolvedStatus: ",e)}return X.CommentAnnotationStatusMap.OPEN}get ongoingStatuses(){try{let t=Object.entries(this._customStatusMap.value).filter(([a,i])=>i.type==="ongoing");if(t)return t.map(a=>a[1])}catch(e){this.loggingService.catch("Error in CustomFilterService ongoingStatuses: ",e)}return[X.CommentAnnotationStatusMap.IN_PROGRESS]}get terminalStatuses(){try{return Object.entries(this._customStatusMap.value).filter(([t,a])=>a.type==="terminal").map(t=>t[1])}catch(e){this.loggingService.catch("Error in CustomFilterService terminalStatuses: ",e)}return[]}convertLegacyAnnotationStatus(e){try{if(typeof e.status=="string"||e.status===void 0){let t=Object.entries(this._customStatusMap.value),a=t.find(([i,c])=>c.type==="default");switch(e.status){case"open":a&&(e.status=a[1]);break;case"inProgress":let i=t.find(([m,h])=>h.type==="ongoing");i&&(e.status=i[1]);break;case"resolved":let c=t.find(([m,h])=>h.type==="terminal");c&&(e.status=c[1]);break;default:a&&(e.status=a[1]);break}}return e}catch(t){return this.loggingService.catch("Error in CustomFilterService convertLegacyAnnotation: ",t),e}}convertLegacyPriority(e){try{typeof e.priority=="string"&&(e.priority=X.CommentAnnotationPriorityMap[e.priority])}catch(t){this.loggingService.catch("Error in CustomFilterService convertLegacyPriority: ",t)}return e}convertLegacyCategory(e){try{if(e.commentCategories===void 0||e.commentCategories===null||!Array.isArray(e.commentCategories)||e.commentCategories.length===0)return e;typeof e.commentCategories[0]=="string"&&(e.commentCategories=e.commentCategories.map(t=>X.CommentCategoryMap[t]))}catch(t){this.loggingService.catch("Error in CustomFilterService convertLegacyCategory: ",t)}return e}};o.\u0275fac=function(t){return new(t||o)(be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Df=(()=>{let o=class o{constructor(e,t){this.domService=e,this.loggingService=t,this.keyEventSubject$=new jt;try{this.loggingService.log("%c[WB] Creating CLASS: HotkeyService","color: blue;"),this.keyEvent$=this.keyEventSubject$.asObservable().pipe(Oh()),this.domService.onWindowKeydown$().subscribe(a=>{this.keyEventSubject$.next(a)})}catch(a){this.loggingService.catch("Error in HotkeyService constructor: ",a)}}getKeyPressEvent(e,t={}){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getKeyPressEvent","color: green;"),this.keyEvent$.pipe(Gt(a=>a?.key===e),Gt(a=>!(!!t?.includeCtrl!==a.ctrlKey||!!t?.includeAlt!==a.altKey||!!t?.includeShift!==a.shiftKey||!!t?.includeMeta!==a.metaKey)),Gt(()=>this.isNoInputFocused()))}catch(a){return this.loggingService.catch("Error in HotkeyService getKeyPressEvent: ",a),new _h}}isNoInputFocused(){try{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;for(;e&&e?.tagName!=="BODY";){if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e?.isContentEditable)return!1;e=e.parentElement??e.getRootNode()?.host??null}return!0}catch(e){return this.loggingService.catch("Error in HotkeyService isNoInputFocused: ",e),!1}}};o.\u0275fac=function(t){return new(t||o)(be(Ne),be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var x2=["access","accessFields"];function _2(r){return r?Object.keys(r).length>0:!1}var ae=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,H,$,j,Z,re,se,_e,le,he,Se,Re,ze,Ye,ct){this.analyticsService=e,this.commonDbService=t,this.configService=a,this.docService=i,this.databaseService=c,this.authService=m,this.domService=h,this.afAuth=_,this.avatarService=I,this.contactService=S,this.storageService=H,this.functions=$,this.dialog=j,this.iamService=Z,this.loggingService=re,this.notificationService=se,this.customFilterService=_e,this.hotkeyService=le,this.serviceBook=he,this.buttonService=Se,this.metadataService=Re,this.commonDbUtilsService=ze,this.attachmentResolverService=Ye,this.userPermissionService=ct,this.endpointsService=ge(Wb),this.customPinsById=new Map,this.commentAdded$=new jt,this.commentUpdated$=new jt,this.commentAccepted$=new jt,this.commentRejected$=new jt,this.commentAnnotationDeleted$=new jt,this.multiThreadCommentAnnotationDeleted$=new jt,this.commentAnnotationById$=new De(null),this.multiThreadCommentAnnotationById$=new De(null),this.ghostCommentAnnotationMap$=new De({}),this.unreadCommentsMap$=new De(null),this.documentPaths=null,this.user=null,this.customCategoryMap=X.CommentCategoryMap,this.allowedElementIds$=new De([]),this.allowedElementClassNames$=new De([]),this.allowedElementQuerySelectors$=new De([]),this.addCommentMode$=new De(!1),this.persistentCommentMode$=new De(!1),this.seenByUsers$=new De(!0),this.deleteReplyConfirmation$=new De(!1),this.persistentModeBanner$=new De(!0),this.commentAddedEmitter=null,this.commentContextProvider=null,this.textCommentMode$=new De(!0),this.sidebarVisible$=new De(!1),this.sidebarOpenedByCustomTrigger$=new De(!1),this.floatingCommentsEnabled$=new De(!0),this.moderatorMode$=new De(!1),this.streamMode$=new De(!1),this.enableSignInButton$=new De(!1),this.enableUpgradeButton$=new De(!1),this.onSignInClick$=new jt,this.onUpgradeClick$=new jt,this.enableAttachment$=new De(!0),this.enableAttachmentDownload$=new De(!0),this.enableReactions$=new De(!0),this.enableAnonymousEmail$=new De(!0),this.enableFormatOptions$=new De(!1),this.formatConfig$=new De({bold:{enable:!0},italic:{enable:!0},underline:{enable:!0},strikethrough:{enable:!0}}),this.allowedRecordings$=new De(["audio","video","screen"]),this.openSidebar$=new jt,this.showScreenSizeInfo$=new De(!1),this.showCommentIndex$=new De(!1),this.popoverMode$=new De(!1),this.popoverTriangleComponent$=new De(!0),this.draftMode$=new De(!0),this.draftConfirmation$=new De(!1),this.draftConfirmationPendingAnnotationIds=new Set,this.enableDialogOnHover$=new De(!0),this.enableDialogOnTargetElementClick$=new De(!1),this.enablePriority$=new De(!1),this.enableStatus$=new De(!0),this.visibilityOptions$=new De(!1),this.enableResolve$=new De(!0),this.enableGhostComments$=new De(!1),this.enableGhostCommentsMessage$=new De(!0),this.inboxMode$=new De(!1),this.enableAutoCategorize$=new De(!1),this.commentContainerDarkMode$=new De(!1),this.suggestionMode$=new De(!1),this.mobileMode$=new De(!0),this.inlineCommentMode$=new De(!1),this.minimap$=new De(!1),this.commentsOnDom$=new De(!0),this.commentToolEnabled$=new De(!0),this.totalMediaLength$=new De(0),this.sidebarUrlNavigationEnabled$=new De(!1),this.detectionStrategy$=new De(Yu.DEFAULT),this.sidebarButtonOnCommentDialogVisible$=new De(!1),this.sidebarButtonOnCommentDialogClick$=new jt,this.commentNavigationButtonClick$=new jt,this.deviceIndicatorOnCommentPins$=new De(!1),this.sidebarCommentClick$=new jt,this.privateCommentMode$=new De(!1),this.privateCommentAllowed$=new De(!1),this.privateModeConfig$=new De(null),this.scrollToComment$=new De(!0),this.userMentions$=new De(!0),this.paginatedContactList$=new De(!1),this.deleteOnBackspace$=new De(!0),this.hotkeyEnabled$=new De(!1),this.recordingSummaryEnabled$=new De(!0),this.unreadIndicatorMode$=new De(jv.MINIMAL),this.composerMode$=new De(pb.DEFAULT),this.enterKeyToSubmit$=new De(!1),this.resolvedCommentsOnDom$=new De(!1),this.lazyLoadResolvedComments$=new De(!1),this.resolvedIntentFromSidebar$=new De(!1),this.resolvedUnlockedDocumentKey=null,this.lastQueryClauseDescriptor=null,this.bubbleOnPinEnabled$=new De(!1),this.bubbleOnPinHoverEnabled$=new De(!0),this.pinDragEnabled$=new De(!0),this.excludeLocationIdsFromSidebar$=new De([]),this.multiThread$=new De(!1),this.groupMatchedComments$=new De(!1),this.restrictTextSearchToAnchor$=new De(!1),this.shortUserName$=new De(!0),this.collapsedComments$=new De(!1),this.collapsedRepliesPreview$=new De(!1),this.fullExpanded$=new De(!1),this.queryParamsComments$=new De(!1),this.resolveStatusAccessAdminOnly$=new De(!1),this.linkCallback$=new De(!1),this.svgAsImg$=new De(!1),this.commentToNearestAllowedElement$=new De(!1),this.filterCommentsOnDom$=new De(!1),this.maxReplyAvatars$=new De(3),this.commentProgressStaleAfter$=new De(6e5),this.progressCommentsByAnnotationId=new Map,this.progressOnlyAnnotationsLogged=new Set,this.progressCommentsVersion$=new De(0),this.replyAvatars$=new De(!1),this.commentplaceholder$=new De(void 0),this.replyplaceholder$=new De(void 0),this.editplaceholder$=new De(void 0),this.editcommentplaceholder$=new De(void 0),this.editreplyplaceholder$=new De(void 0),this.screenshotEnabled$=new De(!1),this.pinShadowDOM$=new De(!0),this.dialogShadowDOM$=new De(!0),this.dialogShadowDOMExplicit$=new De(void 0),this.textCommentToolShadowDOM$=new De(!0),this.pinDarkMode$=new De(null),this.textCommentToolDarkMode$=new De(null),this.textCommentToolbarDarkMode$=new De(null),this.textCommentToolbarShadowDOM$=new De(!0),this.sidebarShadowDOM$=new De(!0),this.changeDetectionInCommentMode$=new De(!1),this.commentSelectionChange$=new jt,this.visibilityOptionClicked$=new jt,this.submitComment$=new jt,this.clearComposer$=new jt,this.composerDataMap=new Map,this.commentsFromSidebarMap$=new De(null),this.sidebarButtonCountType$=new De("default"),this.filterGhostCommentsInSidebar$=new De(!1),this.commentSidebarFilters$=new De(null),this.effectiveSidebarFilters$=new De({}),this.customSidebarDataAnnotationIds$=new De(null),this.commentSidebarSystemFiltersOperator$=new De(Ur.AND),this.bubbleCommentAnnotationIds$=new De([]),this.updateCommentDialogPositionTriggerSubject$=new De(void 0),this.areaCommentEnabled$=new De(!0),this.commentPinCursorImage$=new De(""),this.commentAnnotationsFromCommentsContainer$=new De([]),this.customChipDropdownData$=new De(null),this.originalCommentAnnotationsByDocumentId$=new De({}),this.draftCommentAnnotationsByAnnotationId$=new De(null),this.draftMultiThreadCommentAnnotationsByAnnotationId$=new De({}),this.pendingAddCommentAnnotationData=new Map,this.copyLink$=new De(""),this.addCommentDragMode=!1,this.dragSubscriptions=[],this.hotkeySubscriptions=[],this.sidebarData$=new De(null),this.sidebarCustomActionEventData$=new De(null),this.sidebarCustomActionEventDataAllChanges$=new De(null),this.sidebarCustomActionEventDataOnInit$=new De(null),this.customActions$=new De(!1),this.focusedThreadMode$=new De(!1),this.openAnnotationInFocusMode$=new De(!1),this.customStatusesShown$=new De(!1),this.readOnly$=new De(!1),this.customAutocompleteSearch$=new De(!1),this.deleteThreadWithFirstComment$=new De(!0),this.assignToType$=new De("dropdown"),this.pageModeComposerContext$=new De(null),this.contextInPageModeComposer$=new De(!1),this.focusPageModeComposer$=new jt,this.transformContext$=new De(null),this.expandMentionGroups$=new De(!1),this.showMentionGroupsFirst$=new De(!1),this.showMentionGroupsOnly$=new De(!1),this.fullScreenInSidebar$=new De(!1),this.composerFileAttachments$=new De(null),this.attachmentNameInMessage$=new De(!1),this.allowedFileTypes$=new De([]),this.forceCloseAllOnEsc$=new De(!1),this.autoCompleteScrollConfig$=new De({itemSize:55,minBufferPx:350,maxBufferPx:600,templateCacheSize:350}),this.commentAnnotationContextDraft=null,this.reactionService=null,this.areaService=null,this.viewsService=null,this.getCommentAnnotationForClient=$e=>{try{let bt=["commentCategories","color","resolved","inProgress","positionX","positionY","screenWidth","screenHeight","screenScrollHeight","screenScrollTop","taggedElementPath","taggedElementRect","targetElement","position","documentParamsId","documentParams","ghostComment","areaAnnotationId","iam","commentSource","involvedUserIds","mentionedUserIds","viewedByUserIds","views"],Xe=JSON.parse(JSON.stringify($e)),Tt={};Object.keys(Xe).forEach(Ut=>{bt.includes(Ut)||(Tt[Ut]=Xe[Ut])}),Tt?.comments?.forEach(Ut=>{let We=[];Ut?.reactionAnnotationIds&&Ut?.reactionAnnotationIds?.forEach(Gu=>{let ag=this.reactionService?.getAnnotationById(Gu);if(ag){let Uc=this.reactionService.getReactionAnnotationForClient(ag);We.push(Uc)}}),Ut.reactionAnnotations=We}),Xe?.viewedByUserIds?.forEach(Ut=>{let We=this.contactService.getUserBySnippylyId(Ut);We&&(Tt.viewedBy||(Tt.viewedBy=[]),Tt.viewedBy.push(We))}),this.user?.userSnippylyId&&(Tt.unread=!Xe?.viewedByUserIds?.includes(this.user.userSnippylyId));let Ue=Xe?.targetElement?.anchor?.fXPath||Xe?.targetElement?.fXpath;return Ue&&(Tt.basicAnchorData={xpath:Ue,topPercentage:Xe?.targetElement?.topPercentage||0,leftPercentage:Xe?.targetElement?.leftPercentage||0}),JSON.parse(JSON.stringify(Tt))}catch{return null}},this.loggingService.log("%c[WB] Creating CLASS: CommentService","color: blue;"),this.serviceBook.set(Lg,this),this.serviceBook.observe(Bg).subscribe($e=>{this.reactionService=$e}),this.serviceBook.observe(Hb).subscribe($e=>{this.areaService=$e}),this.serviceBook.observe(Eo).subscribe($e=>{this.viewsService=$e}),this.domService.getSelectedAnnotationsMap$().pipe(Nv(100),In()).subscribe(([$e,bt])=>{try{if(this.draftCommentAnnotationsByAnnotationId$.value){let Xe=Object.keys(this.draftCommentAnnotationsByAnnotationId$.value||{}),Tt=[];Object.keys($e||{}).forEach(Ut=>{if(!bt?.[Ut]&&Xe.includes(Ut)){if(this.draftConfirmationPendingAnnotationIds?.has(Ut))return;Tt.push(Ut)}});let Ue=JSON.parse(JSON.stringify(this.draftCommentAnnotationsByAnnotationId$.value||{}));Tt.forEach(Ut=>{delete Ue[Ut]}),ln(Ue,this.draftCommentAnnotationsByAnnotationId$.value)||this.draftCommentAnnotationsByAnnotationId$.next(Ue)}}catch{}}),this.docService.getDocumentPaths$().pipe(In()).subscribe(([$e,bt])=>{$e?.documentId!==bt?.documentId&&this.unreadCommentsMap$.next(null),bt&&this.shouldEnableReadOnly()},$e=>{this.loggingService.catch("Error in CommentService getDocumentPaths$ subscription: ",$e)}),this.draftCommentAnnotationsByAnnotationId$.pipe(In()).subscribe(([$e,bt])=>{try{if(this.pendingAddCommentAnnotationData.size===0)return;let Xe=Object.keys($e||{});if(Xe.length===0)return;let Tt=new Set(Object.keys(bt||{}));Xe.forEach(Ue=>{!Tt.has(Ue)&&this.pendingAddCommentAnnotationData.has(Ue)&&this.pendingAddCommentAnnotationData.delete(Ue)})}catch(Xe){this.loggingService.catch("Error in CommentService pendingAddCommentAnnotationData reconcile: ",Xe)}}),this.authService.getUser$().subscribe($e=>{$e||this.resetCacheData()},$e=>{this.loggingService.catch("Error in CommentService getUser$ subscription: ",$e)}),this.authService.getUser$().pipe(Pe($e=>$e?dr([this.iamService.isUserAdmin$(),this.contactService.getUserOrganizationContacts$()]).pipe(Te(([bt,Xe])=>{let Tt=!1;return Xe?.find(Ue=>Ue.userId===$e?.userId)&&(Tt=!0),{isUserAdmin:bt,isOrgUser:Tt}})):Ee({isUserAdmin:!1,isOrgUser:!1}))).subscribe(({isUserAdmin:$e,isOrgUser:bt})=>{let Xe=$e||bt;Xe!==this.privateCommentAllowed$.value&&this.privateCommentAllowed$.next(Xe)}),this.databaseService.getDb().pipe(Gt($e=>!!$e),Jn(1)).subscribe($e=>{$e&&this.getDocumentPaths()},$e=>{this.loggingService.catch("Error in CommentService getDb subscription: ",$e)}),this.domService.onWindowPointerMove$().subscribe($e=>{if(this.addCommentMode$.value){let bt=!0;if(this.addCommentDragMode)this.domService.removeClassFromElement(document.body,"show-pin-cursor");else{let Xe=this.domService.getBackgroundElement($e.clientX,$e.clientY,!0,!0);if(Xe&&Ub(Xe,{x:$e.clientX,y:$e.clientY})&&(Xe=Xe?.parentElement),Xe)if(this.isElementInsideAllowedElements(Xe))if(to($e.target))this.domService.removeClassFromElement(document.body,"show-pin-cursor");else{this.domService.addClassToElement(document.body,"show-pin-cursor"),this.hightlightElement&&this.hightlightElement!==Xe&&this.domService.removeHighlightFromElement(this.hightlightElement),this.hightlightElement=Xe;let Tt=this.domService.getSelectedAnnotationsMap("comment")||{},Ue=this.commentPinCursorImage$.value||X.CURSOR.COMMENT_PIN;this.domService.highlightElement(this.hightlightElement,Ue,!!Object.keys(Tt)?.length),bt=!1}else this.domService.removeClassFromElement(document.body,"show-pin-cursor")}this.hightlightElement&&bt&&(this.domService.removeHighlightFromElement(this.hightlightElement),this.hightlightElement=null)}},$e=>{this.loggingService.catch("Error in CommentService onWindowPointerMove$ subscription: ",$e)}),this.domService.onWindowKeyupEsc$().subscribe($e=>{if(this.addCommentMode$.value){let bt=this.domService.getSelectedAnnotationsMap("comment")||{};Object.keys(bt)?.length&&this.domService.resetSelectedAnnotationsMap(),this.disableAddCommentMode()}},$e=>{this.loggingService.catch("Error in CommentService onWindowKeyupEsc$ subscription: ",$e)}),this.domService.onDocumentClick$().subscribe($e=>{if($e&&!Pg($e)){let bt=this.domService.getSelectedAnnotationsMap("comment")||{};if(bt=g(g({},bt),this.domService.getSelectedAnnotationsMap("multiThread")||{}),bt=g(g({},bt),this.domService.getSelectedAnnotationsMap("suggestion")||{}),Object.keys(bt)?.length&&(this.domService.resetSelectedAnnotationsMap(),this.persistentCommentMode$?.value)){this.addCommentMode$.value&&this.detectToAddAreaComment(),$e.preventDefault(),$e.stopPropagation();return}}if($e&&this.addCommentMode$.value&&!to($e.target)){let bt=!1;if(this.addCommentDragMode)$e.preventDefault(),$e.stopPropagation(),this.addCommentDragMode=!1;else if(!this.domService.getDraftCommentAnnotationDialogs()?.length){let Xe=this.domService.getBackgroundElement($e.clientX,$e.clientY);if((this.persistentCommentMode$?.value&&this.domService.getBackgroundVeltElement($e.clientX,$e.clientY)||$e&&Pg($e))&&(Xe=null),Xe&&(this.isElementInsideAllowedElements(Xe)||this.getCommentToNearestAllowedElement()&&this.getNearestAllowedElement(Xe))&&(bt=this.isElementInsideManualCommentContainer(Xe),!bt)){$e.preventDefault(),$e.stopPropagation();let Tt=this.freeStyleCommentContext&&typeof this.freeStyleCommentContext=="object"?JSON.parse(JSON.stringify(this.freeStyleCommentContext)):void 0;this.addComment($e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Tt)}}this.persistentCommentMode$?.value?this.detectToAddAreaComment():bt||this.disableAddCommentMode()}},$e=>{this.loggingService.catch("Error in CommentService onDocumentClick$ subscription: ",$e)}),this.addCommentMode$.subscribe($e=>{this.hightlightElement&&this.domService.removeHighlightFromElement(this.hightlightElement),$e?(this.domService.addClassToElement(document.body,"snippyly-add-comment-mode"),this.detectToAddAreaComment(),this.addIframeContainerStaticAttribute()):(this.removeIframeContainerStaticAttribute(),this.domService.removeClassFromElement(document.body,"snippyly-add-comment-mode"),this.domService.removeClassFromElement(document.body,"show-pin-cursor"),this.dragSubscriptions.forEach(bt=>bt.unsubscribe()),this.clearFreeStyleCommentContext())},$e=>{this.loggingService.catch("Error in CommentService addCommentMode$ subscription: ",$e)}),this.domService.onWindowKeyupBackspace$().subscribe($e=>{this.getDeleteOnBackspace()&&this.deleteCommentPinAnnotations("keyupBackspace")},$e=>{this.loggingService.catch("Error in CommentService onWindowKeyupBackspace$ subscription: ",$e)}),this.domService.onWindowKeyupDelete$().subscribe($e=>{this.deleteCommentPinAnnotations("keyupDelete")},$e=>{this.loggingService.catch("Error in CommentService onWindowKeyupDelete$ subscription: ",$e)}),this.domService.getDeleteCommmentAnnotations$().subscribe($e=>{$e?.length&&($e?.filter(Xe=>!["tag","recorder","rewriter","arrow","area","multiThread"].includes(Xe.type))?.filter(Xe=>!this.getProgressComments(Xe?.annotationId).length)).forEach(Xe=>Ae(this,null,function*(){yield this.deleteCommentPinAnnotation(Xe)}))},$e=>{this.loggingService.catch("Error in CommentService onWindowKeyupDelete$ subscription: ",$e)}),this.getPopoverMode$().subscribe($e=>{$e?document?.body?.setAttribute(X.ATTRIBUTES.VELT_POPOVER_MODE,"true"):document?.body?.removeAttribute(X.ATTRIBUTES.VELT_POPOVER_MODE)},$e=>{this.loggingService.catch("Error in CommentService getPopoverMode subscription: ",$e)}),this.customFilterService.customCategoryMap$.subscribe($e=>{this.customCategoryMap=$e},$e=>{this.loggingService.catch("Error in CommentService customCategoryMap$ subscription: ",$e)}),this.hotkeyEnabled$.subscribe($e=>{$e?this.subscribeHotkeyEvents():this.unsubscribeHotkeyEvents()},$e=>{this.loggingService.catch("Error in CommentService hotkeyEnabled$ subscription: ",$e)}),this.domService.getSelectedAnnotationsMap$().pipe(In()).subscribe(([$e,bt])=>{try{let Xe=Object.values($e||{}).filter(Ue=>!["tag","recorder","rewriter","arrow","area"].includes(Ue.type)),Tt=Object.values(bt||{}).filter(Ue=>!["tag","recorder","rewriter","arrow","area"].includes(Ue.type));Xe?.forEach(Ue=>{Tt?.find(Ut=>Ut.annotationId===Ue.annotationId)||this.commentSelectionChange$.next({annotation:this.getCommentAnnotationForClient(Ue),selected:!1})}),Tt?.forEach(Ue=>{Xe?.find(Ut=>Ut.annotationId===Ue.annotationId)||this.commentSelectionChange$.next({annotation:this.getCommentAnnotationForClient(Ue),selected:!0})})}catch(Xe){this.loggingService.catch("Error in CommentService getSelectedAnnotationsMap$: ",Xe)}},$e=>{this.loggingService.catch("Error in CommentService getSelectedAnnotationsMap$ subscription: ",$e)})}clearCache(){try{this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in CommentService","color: green;"),this.commentAnnotationById$.next(null),this.draftCommentAnnotationsByAnnotationId$.next(null),this.multiThreadCommentAnnotationById$.next({}),this.draftMultiThreadCommentAnnotationsByAnnotationId$.next({}),this.pendingAddCommentAnnotationData.clear(),this.customAutocompleteSearch$.next(!1),this.hightlightElement=null,this.addCommentMode$.next(!1),this.unreadCommentsMap$.next(null),this.documentPaths=null,this.commentsFromSidebarMap$.next(null),this.customSidebarDataAnnotationIds$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearCache: ",e)}}setCommentActionsService(e){try{this.commentActionsService=e}catch(t){this.loggingService.catch("Error in CommentService setCommentActionsService: ",t)}}detectToAddAreaComment(){try{let e=this.areaService?.getAreaEnabled()??!1,t=this.getAreaCommentEnabled();if(e&&t){let a,i,c,m=null,h=null;this.dragSubscriptions.forEach(_=>_.unsubscribe()),this.dragSubscriptions.push(this.domService.onWindowMouseDown$().pipe(Gt(_=>!(_&&Pg(_))),Jn(1)).subscribe(_=>{m=null,h=null,this.dragSubscriptions.push(this.domService.getClickAndDragPointsObservable().subscribe(I=>{if(m===null){let S=I?.startPoint?.event?.target,H=Gc(S),$=to(S),j=this.isElementInsideAllowedElements(S);m=!H&&!$&&j}if(m){this.addCommentDragMode=!0,a=I.startPoint,i=I.curPoint;let S=I?.curPoint?.event?.target,H=Gc(S),$=to(S),j=this.isElementInsideAllowedElements(S);h=!H&&!$&&j,h?c=this.domService.drawRectangle(a,i):c?.remove()}})),this.domService.onWindowPointerUp$().pipe(ig(1),Jn(1)).subscribe(I=>{if(i={x:I.clientX,y:I.clientY},a&&i&&(c?.remove(),m&&h)){let S=[{x:a.x-window.scrollX,y:a.y-window.scrollY},{x:i.x,y:i.y}],H=this.freeStyleCommentContext&&typeof this.freeStyleCommentContext=="object"?JSON.parse(JSON.stringify(this.freeStyleCommentContext)):void 0;this.addComment(I,void 0,S,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,H)}this.dragSubscriptions.forEach(S=>S.unsubscribe())})}))}}catch(e){this.loggingService.catch("Error in CommentService detectToAddAreaComment: ",e)}}resetCacheData(){try{this.loggingService.log("%c[WB] Calling CommentService FUNCTION: resetCacheData","color: green;"),this.commentAnnotationById$.next(null),this.draftCommentAnnotationsByAnnotationId$.next(null),this.multiThreadCommentAnnotationById$.next({}),this.draftMultiThreadCommentAnnotationsByAnnotationId$.next({}),this.pendingAddCommentAnnotationData.clear()}catch(e){this.loggingService.catch("Error in CommentService resetCacheData: ",e)}}addAreaContainerTag(){try{if(!(document.querySelector(X.TAGS.VELT_AREAS)||document.querySelector(X.TAGS.SNIPPYLY_AREAS))){let t=document.createElement(X.TAGS.VELT_AREAS);document.body.appendChild(t)}}catch(e){this.loggingService.catch("Error in CommentService addAreaContainerTag: ",e)}}addIframeContainerStaticAttribute(){try{document.querySelectorAll(`[${X.ATTRIBUTES.VELT_IFRAME_CONTAINER}]`).forEach(t=>{window.getComputedStyle(t).position==="static"&&t.setAttribute(X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC,"true")})}catch(e){this.loggingService.catch("Error in CommentService addIframeContainerStaticAttribute: ",e)}}removeIframeContainerStaticAttribute(){try{document.querySelectorAll(`[${X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC}]`).forEach(t=>{t.removeAttribute(X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC)})}catch(e){this.loggingService.catch("Error in CommentService removeIframeContainerStaticAttribute: ",e)}}subscribeHotkeyEvents(){try{this.loggingService.log("%c[WB] Calling FUNCTION: subscribeHotkeyEvents","color: green;"),this.unsubscribeHotkeyEvents(),this.hotkeySubscriptions.push(this.hotkeyService.getKeyPressEvent("c").subscribe(e=>{e&&!this.addCommentMode$.value&&this.enableAddCommentMode()},e=>{this.loggingService.catch("Error in CommentService hotkeyService.getKeyPressEvent subscription: ",e)}))}catch(e){this.loggingService.catch("Error in CommentService subscribeHotkeyEvents: ",e)}}unsubscribeHotkeyEvents(){try{this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribeHotkeyEvents","color: green;"),this.hotkeySubscriptions.forEach(e=>e?.unsubscribe())}catch(e){this.loggingService.catch("Error in CommentService unsubscribeHotkeyEvents: ",e)}}setCommentAddedEmitter(e){try{this.commentAddedEmitter=e}catch(t){this.loggingService.catch("Error in CommentService setCommentAddedEmitter: ",t)}}setContextProvider(e){try{this.commentContextProvider=e}catch(t){this.loggingService.catch("Error in CommentService setContextProvider: ",t)}}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;"),this.docService.getDocumentPaths$()}getAnonymousAvatarImage(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAnonymousAvatarImage","color: green;"),this.avatarService.generateUserImage()}setAllowedElementIds(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementIds:e}}),this.allowedElementIds$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementIds: ",t)}}getAllowedElementIds(){return this.allowedElementIds$.asObservable()}setAllowedElementClassNames(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementClassNames:e}}),this.allowedElementClassNames$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementClassNames: ",t)}}getAllowedElementClassNames(){return this.allowedElementClassNames$.asObservable()}setAllowedElementQuerySelectors(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementQuerySelectors:e}}),this.allowedElementQuerySelectors$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementQuerySelectors: ",t)}}getAllowedElementQuerySelectors(){return this.allowedElementQuerySelectors$.asObservable()}getAllCommentAnnotations({customClientDocumentId:e,params:t,excludeDomChanges:a,detectGhostComments:i,skipPositionCalculation:c,query:m,fromCommentSidebar:h,analytics:_,addFilterCommentsOnDomCheck:I}){this.loggingService.log("%c[WB] Calling FUNCTION: getAllCommentAnnotations","color: green;");let S,H,$;_?.enabled&&this.analyticsService.trackEvent(_?.eventName||oe.Events.Comments.GET_ALL_COMMENT_ANNOTATIONS_TRIGGERED_INTERNAL,_?.properties);try{if(e&&($=`${To(e)}`),t&&typeof t=="object"){let j=qu(t);H=j?.id,S=To(JSON.stringify(j))}}catch(j){this.loggingService.catch("Error in CommentService getAllCommentAnnotations: ",j)}return this.authService.getAuthState$().pipe(Gt(j=>!!j),Pe(j=>this.isFeatureAllowed({firebaseUser:j,annotations:[],filteredAnnotations:[]})),Pe(j=>j.featureAllowed?this.iamService.isUserAllowed$().pipe(Te(Z=>(j.featureAllowed=Z,j))):Ee(j)),Pe(j=>j.featureAllowed?Ee(j).pipe(Pe(Z=>this.docService.getDocumentPaths$().pipe(Te(re=>(this.documentPaths=re,Z.documentPaths=re,Z)))),Pe(Z=>m?.documentIds?.length||$?this.getDataFromDocumentIds({documentIds:$?[$]:m?.documentIds?.map(re=>`${To(re)}`),organizationId:this.documentPaths?.organizationId,query:m}).pipe(Te(re=>({res:Z,data:re}))):this.docService.getDocumentIds$().pipe(Pe(re=>{let se=re?.length>0?re.map(_e=>_e.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds({documentIds:se.length>0?se:[$??""],organizationId:this.documentPaths?.organizationId,query:m}).pipe(Te(_e=>({res:Z,data:_e})))}))),Pe(Z=>Z?.data?(Z.res.annotations=Z.data||[],Ee(Z.res).pipe(Pe(re=>this.docService.getLocation$().pipe(Te(se=>(re.location=se,re)))),Pe(re=>this.docService.getLocations$().pipe(Te(se=>(re.customLocations=se,re)))),Pe(re=>this.docService.getExcludedLocationIds$().pipe(Te(se=>(re.excludedLocationIds=se,re)))),Te(re=>{if(re.filteredAnnotations=[],m)return re.filteredAnnotations=re.annotations?.slice(),re;if($&&!S||h)return re.filteredAnnotations=re.annotations?.slice(),re?.excludedLocationIds?.length&&(re.filteredAnnotations=re.filteredAnnotations?.filter(se=>se?.location?.id?!re.excludedLocationIds.includes(se.location.id):!0)),re;{let se=[],_e=[];return S?(se.push(S),H&&_e.push(H)):(se.push(re?.location?.locationId),se.push(...Object.values(re?.customLocations||[]).map(le=>le.locationId)),re?.location?.location?.id&&_e.push(re?.location?.location?.id),_e.push(...Object.values(re?.customLocations||{}).map(le=>le.location?.id).filter(le=>!!le))),re.filteredAnnotations=this.filterAnnotationsByLocationIds(re?.annotations,se,_e),re?.excludedLocationIds?.length&&(re.filteredAnnotations=re.filteredAnnotations?.filter(le=>le?.location?.id?!re.excludedLocationIds.includes(le.location.id):!0)),re}}),Pe(re=>this.isPrivateCommentAllowed$().pipe(Te(se=>(se||(re.filteredAnnotations=re.filteredAnnotations?.filter(_e=>!pr(_e))),re)))),Pe(re=>this.draftCommentAnnotationsByAnnotationId$.pipe(Te(se=>(re.filteredAnnotations=re.filteredAnnotations?.filter(_e=>!_e.isDraft),se&&re.filteredAnnotations.push(...Object.values(se)),re)))),Pe(re=>a?Ee(re):re?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onWindowResize$().pipe(Te(()=>re)):Ee(re)),Pe(re=>a?Ee(re):this.addCommentMode$.pipe(Pe(se=>se&&!this.getChangeDetectionInCommentMode()?Ee(re):re?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onDomChange$("CommentService getAllCommentAnnotations").pipe(Te(()=>re)):Ee(re)))),Te(re=>{if(!c){(!this.getPopoverMode()||this.getPopoverTriangleComponent())&&(re.filteredAnnotations=re.filteredAnnotations?.map(_e=>{let le=Object.assign({},_e);return this.calculateCommentAnnotationPosition(le,i),le}));let se={};re.filteredAnnotations?.forEach(_e=>{if(_e?.targetTextRange){let le=this.domService.getElementFromTargetTextRange(_e?.targetTextRange);se[_e.annotationId]=!!le}}),re.textAnnotationsElementMap=se}return re}),Pe(re=>re?.annotations?.length?this.serviceBook.observe(Eo).pipe(Pe(se=>se?se.getCommentFeatureViews$():Ee({})),Te(se=>(this.updateUnreadAnnotationsMap(re?.annotations,se),re))):(_2(this.unreadCommentsMap$.value)&&this.unreadCommentsMap$.next({}),Ee(re))))):Ee(null))):Ee(null)),Te(j=>{try{return typeof j=="object"&&j?JSON.parse(JSON.stringify(j)):j}catch{return j}}),ir((j,Z)=>Jr(j?.filteredAnnotations,Z?.filteredAnnotations)&&Jr(j?.textAnnotationsElementMap,Z?.textAnnotationsElementMap)),Pe(j=>j?j?.filteredAnnotations?Ee(j?.filteredAnnotations||[]):Ee([]):Ee(null)),Pe(j=>I?this.filterCommentsUsingSidebarSettings(j):Ee(j)))}getAllMultiThreadCommentAnnotations(e,t,a,i,c,m){this.loggingService.log("%c[WB] Calling FUNCTION: getAllMultiThreadCommentAnnotations","color: green;");let h,_;try{if(e&&(_=To(e)),t&&typeof t=="object"){let I=qu(t);h=To(JSON.stringify(I))}}catch(I){this.loggingService.catch("Error in CommentService getAllMultiThreadCommentAnnotations: ",I)}return this.authService.getAuthState$().pipe(Gt(I=>!!I),Pe(I=>this.isFeatureAllowed({firebaseUser:I,annotations:[],filteredAnnotations:[]})),Pe(I=>I.featureAllowed?this.iamService.isUserAllowed$().pipe(Te(S=>(I.featureAllowed=S,I))):Ee(I)),Pe(I=>I.featureAllowed?Ee(I).pipe(Pe(S=>this.docService.getDocumentPaths$().pipe(Te(H=>(this.documentPaths=H,S.documentPaths=H,S)))),Pe(S=>_?this.getMultiThreadDataFromDocumentIds([_]).pipe(Te(H=>({res:S,data:H}))):this.docService.getDocumentIds$().pipe(Pe(H=>{let $=H?.length>0?H.map(j=>j.documentId):[this.documentPaths?.documentId??""];return this.getMultiThreadDataFromDocumentIds($.length>0?$:[`${_}`]).pipe(Te(j=>({res:S,data:j})))}))),Pe(({res:S,data:H})=>H?(S.annotations=H||[],Ee(S).pipe(Pe($=>this.docService.getLocation$().pipe(Te(j=>($.location=j,$)))),Pe($=>this.docService.getLocations$().pipe(Te(j=>($.customLocations=j,$)))),Pe($=>this.docService.getExcludedLocationIds$().pipe(Te(j=>($.excludedLocationIds=j,$)))),Te($=>{if($.filteredAnnotations=[],_&&!h)return $.filteredAnnotations=$.annotations?.slice(),$?.excludedLocationIds?.length&&($.filteredAnnotations=$.filteredAnnotations?.filter(j=>j?.location?.id?!$.excludedLocationIds.includes(j.location.id):!0)),$;{let j=[],Z=[];return h?j.push(h):(j.push($?.location?.locationId),j.push(...Object.values($?.customLocations||[]).map(re=>re.locationId)),$?.location?.location?.id&&Z.push($?.location?.location?.id),Z.push(...Object.values($?.customLocations||{}).map(re=>re.location?.id).filter(re=>!!re))),$.filteredAnnotations=this.filterAnnotationsByLocationIds($?.annotations,j,Z),$?.excludedLocationIds?.length&&($.filteredAnnotations=$.filteredAnnotations?.filter(re=>re?.location?.id?!$.excludedLocationIds.includes(re.location.id):!0)),$}}),Pe($=>this.draftMultiThreadCommentAnnotationsByAnnotationId$.pipe(Te(j=>($.filteredAnnotations=$.filteredAnnotations?.filter(Z=>!Z.isDraft),j&&$.filteredAnnotations.push(...Object.values(j)),$)))),Pe($=>a?Ee($):$?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onWindowResize$().pipe(Te(()=>$)):Ee($)),Pe($=>a?Ee($):this.addCommentMode$.pipe(Pe(j=>j&&!this.getChangeDetectionInCommentMode()?Ee($):$?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onDomChange$("CommentService getAllMultiThreadCommentAnnotations").pipe(Te(()=>$)):Ee($)))),Te($=>(c||(!this.getPopoverMode()||this.getPopoverTriangleComponent())&&($.filteredAnnotations=$.filteredAnnotations?.map(j=>{let Z=Object.assign({},j);return this.calculateCommentAnnotationPosition(Z,i),Z})),$)),Pe($=>$?.filteredAnnotations?Ee($?.filteredAnnotations||[]):Ee([])))):Ee(null))):Ee(null)),ir(Jr),Pe(I=>m?this.filterCommentsUsingSidebarSettings(I):Ee(I)))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(Gt(t=>!!t),Te(t=>f(g({},e),{config:t})),Pe(t=>this.authService.getUser$().pipe(Te(a=>(this.user=a,f(g({},t),{user:a}))))),Pe(t=>Cb(t.config,t.user,ke.COMMENT)?Ee(f(g({},t),{featureAllowed:!0})):(this.loggingService.warn("Comment feature is not allowed."),Ee(f(g({},t),{featureAllowed:!1})))),ir((t,a)=>t?.featureAllowed===a?.featureAllowed))}buildVisibilityTokens(e){return Ae(this,null,function*(){try{let a=this.authService.getUser()?.clientOrganizationId,i=a?yield this.isViewerOrgMembershipConfirmed(e,a):!1;return Ku({userId:e,clientOrganizationId:i?a:void 0,fallbackServerOrganizationId:a?void 0:this.documentPaths?.organizationId})}catch(t){this.loggingService.catch("Error in CommentService buildVisibilityTokens: ",t);try{return[X.DEFAULT_VELT_CONTEXT,`${X.VISIBILITY_SELF_PREFIX}${ur(e)}`]}catch{return[X.DEFAULT_VELT_CONTEXT]}}})}isViewerOrgMembershipConfirmed(e,t){return Ae(this,null,function*(){try{let i=(yield this.userPermissionService.getUserPermissionsFromCacheOrFetch({organizationId:t}))?.[e]?.organization?.[t];return!!i&&i.errorCode!==Eg.PERMISSION_DENIED}catch(a){return this.loggingService.catch("Error in CommentService isViewerOrgMembershipConfirmed: ",a),!1}})}buildAllCommentsRawListener$(e){let{isContextEnabled:t,documentIds:a,organizationId:i,accessFields:c,isPrivateCommentsEnabled:m,veltFolderId:h,locationIds:_,statusIds:I,commonProperties:S,includeStatusIds:H,documentBatchSize:$}=e,j=I?.length?[Qe("status.id","in",I)]:H?.length?[Qe("status.id","in",H)]:[],Z;if(t){let re=[];for(let se=0;se<c.length;se+=X.LISTENER_CONTEXT_BATCH_SIZE)re.push(c.slice(se,se+X.LISTENER_CONTEXT_BATCH_SIZE));this.loggingService.logContext("[CONTEXT] getDataFromDocuments called with accessFields:",JSON.parse(JSON.stringify(c??"nil"))),Z=dr(re.map(se=>this.commonDbService.dbListener({feature:"allComments",properties:f(g({},S),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",i??this.documentPaths?.organizationId),Qe("metadata.documentId","in",a),...j,...h?[Qe("metadata.veltFolderId","==",h)]:[],..._?.length?[Qe("location.id","in",_)]:[],...se?.length?[Qe("context.accessFields","array-contains-any",se)]:[]),Xt("lastUpdated","desc"),Xt("createdAt","desc")]})}).pipe(Bc()))).pipe(Te(se=>Wc(JSON.parse(JSON.stringify(se)))))}else{let re=[];for(let se=0;se<(a?.length??0);se+=$)re.push(a?.slice(se,se+$)??[]);Z=dr(re.map(se=>this.commonDbService.dbListener({feature:"allComments",properties:f(g({},S),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",i??this.documentPaths?.organizationId),Qe("metadata.documentId","in",se),...j,...h?[Qe("metadata.veltFolderId","==",h)]:[],..._?.length?[Qe("location.id","in",_)]:[],...c?.length&&m?[Qe("context.accessFields","array-contains-any",c)]:[]),Xt("lastUpdated","desc"),Xt("createdAt","desc")]})}).pipe(Bc()))).pipe(Te(se=>Wc(JSON.parse(JSON.stringify(se)))))}return Z}resolvedStatusExclusion$(e){let t=this.customFilterService.customStatusMap$;return dr([this.lazyLoadResolvedComments$,this.resolvedIntentFromSidebar$,t]).pipe(Te(([a,i,c])=>{let m=X.LISTENER_BATCH_SIZE;if(e.hasExplicitStatusIds)return{includeStatusIds:null,documentBatchSize:m};let h=Xg(this.documentPaths),_=ff({lazyLoadResolvedComments:!!a,hasResolvedIntent:!!i,currentDocumentKey:h,unlockedDocumentKey:this.resolvedUnlockedDocumentKey});if(this.resolvedUnlockedDocumentKey=_.unlockedDocumentKey,!_.excludeResolved)return{includeStatusIds:null,documentBatchSize:m};let I=kf(c),S=xf(c),H=_f({branch:e.isContextEnabled?"context":"default",documentIdCount:e.documentIdCount,accessFieldCount:e.isContextEnabled?Math.min(e.accessFieldCount,X.LISTENER_CONTEXT_BATCH_SIZE):e.accessFieldCount,locationIdCount:e.locationIdCount,nonTerminalStatusCount:I.length,terminalStatusCount:S.length,hasFolderClause:e.hasFolderClause,orderByCount:2});this.lastQueryClauseDescriptor=H;let $=e.documentIdCount,j=Sf({branch:e.isContextEnabled?"context":"default",clauses:H,maxDocumentBatchSize:e.isContextEnabled?$:m,minDocumentBatchSize:e.isContextEnabled?$:2});return j.applyStatusClause?{includeStatusIds:I,documentBatchSize:j.documentBatchSize}:(this.loggingService.catch(`[lazyLoadResolvedComments] status clause dropped \u2014 branch=${e.isContextEnabled?"context":"default"} disjunctions=${j.projectedDisjunctions} filterSum=${j.projectedFilterSum} boundBy=${j.boundBy} reason=${j.reason}`,null,void 0,!0),{includeStatusIds:null,documentBatchSize:m})}),ir((a,i)=>a.documentBatchSize===i.documentBatchSize&&Cf(a.includeStatusIds,i.includeStatusIds)),jr(a=>(this.loggingService.catch("[lazyLoadResolvedComments] status-exclusion stream failed; falling back to today's query: ",a),Ee({includeStatusIds:null,documentBatchSize:X.LISTENER_BATCH_SIZE}))))}getDataFromDocuments(e){let{documentIds:t,organizationId:a,query:i}=e;if(!this.configService?.getApiKey())return Ee(null);if(t?.some(H=>!H)||!this.documentPaths)return Ee(null);let c,m,h=[];if(i)i?.folderId&&(c=mr(i?.folderId)),i?.locationId&&(h=[...h,i?.locationId]),i?.locationIds?.length&&(h=[...h,...i?.locationIds]),m=i?.statusIds;else{c=this.docService.getDocumentPaths()?.veltFolderId;let H=this.docService.getDocumentPaths()?.locationId;H&&(h=[...h,H])}let _={useCollectionGroup:!0,isCollection:!0,useQuery:!0};this.commonDbService.shouldUseFirestore()||(_.documentId=t?.length?t[0]:void 0,_.organizationId=this.documentPaths?.organizationId);let I=this.authService.getUser()?.userId;if(!I)return Ee(null);let S=this.authService.getIsPrivateCommentsEnabled();return wh(()=>yn(this.buildVisibilityTokens(I)).pipe(Pe($=>{let j=S?$:[X.DEFAULT_VELT_CONTEXT],Z=this.userPermissionService?.getIsContextEnabled()?this.docService.getProcessedDocContext():[],re=[...j,...Z],se=this.userPermissionService?.getIsContextEnabled();return this.resolvedStatusExclusion$({isContextEnabled:!!se,documentIdCount:t?.length??0,accessFieldCount:re?.length&&(se||S)?re.length:0,locationIdCount:h?.length??0,hasFolderClause:!!c,hasExplicitStatusIds:!!m}).pipe(Pe(le=>this.buildAllCommentsRawListener$({isContextEnabled:!!se,documentIds:t,organizationId:a,accessFields:re,isPrivateCommentsEnabled:S,veltFolderId:c,locationIds:h,statusIds:m,commonProperties:_,includeStatusIds:le.includeStatusIds,documentBatchSize:le.documentBatchSize}))).pipe(Pe(le=>le?.data?Ee(le).pipe(Pe(he=>this.commonDbUtilsService.mergeLocationMetadataWithData$({data:he,feature:"allComments"}).pipe(Te(Se=>{let Re=Object.values(Se?.data||{}).filter(ze=>typeof ze=="object");return{data:this.applyListenerVisibilityPostFilter(Re,$,I,se?Z:null),operation:Se?.operation}}))),Te(({data:he,operation:Se})=>{let Re=he.reduce((ze,Ye)=>{let ct=Ye.metadata?.documentId;return ct&&(ze[ct]||(ze[ct]=[]),ze[ct].push(Ye)),ze},{});return{data:he,documentMap:Re,operation:Se}}),Te(({data:he,documentMap:Se,operation:Re})=>m?{data:he,documentMap:Se,operation:Re}:(he?.length&&(he?.forEach(ze=>{this.sanitizeCommentAnnotation(ze)}),this.setAnnotationIndex(he),this.updateAnnotationsForSelectAllContentMode(he),he.forEach(ze=>{this.customFilterService.convertLegacyAnnotationStatus(ze),this.customFilterService.convertLegacyPriority(ze),this.customFilterService.convertLegacyCategory(ze)})),{data:he,documentMap:Se,operation:Re})),jr(he=>(this.loggingService.catch("Error in CommentService getDataFromDocuments: ",he),Ee([]))),Lc(({documentMap:he})=>{m||Object.entries(he??{}).forEach(([Se,Re])=>{this.setOriginalCommentAnnotationsByAnnotationId(JSON.parse(JSON.stringify(Re)))})}),Te(({data:he,documentMap:Se,operation:Re})=>({data:this.filterUserDraftComments(he),documentMap:Se,operation:Re})),Te(({data:he,documentMap:Se,operation:Re})=>({data:this.splitProgressCommentsStage(this.removeDraftFlags(he)),documentMap:Se,operation:Re})),Pe(({data:he,documentMap:Se,operation:Re})=>m?Ee({data:he,documentMap:Se,operation:Re}):this.mergeDraftAnnotations(he).pipe(Te(ze=>({data:ze,documentMap:Se,operation:Re})))),Te(({data:he,documentMap:Se,operation:Re})=>{if(!m)if(Re?.type==="removed"){if(Re?.ids?.length){let ze=this.commentAnnotationById$.value??{};Re?.ids?.forEach(Ye=>{delete ze?.[Ye]}),this.evictProgressComments(Re?.ids??[]),this.commentAnnotationById$.next(ze)}}else Object.entries(Se??{}).length?Object.entries(Se??{}).forEach(([Ye,ct])=>{this.setCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:Ye,annotations:ct})}):this.commentAnnotationById$.value||this.commentAnnotationById$.next({});return he})):Ee(null)))})))}fetchCommentAnnotations(e){return Ae(this,null,function*(){try{let t=this.authService.getUser();if(!t)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),{data:[],hasMore:!1};let a=this.configService?.getApiKey(),i=e?.organizationId??t?.clientOrganizationId,c=Gv(i??""),m=[];e?.allDocuments||(m=e?.documentIds?.map(se=>Mg(se??""))??this.docService.getDocumentIds()?.map(se=>se.documentId));let h=[];if(h.push(Qe("metadata.organizationId","==",c)),h.push(Qe("metadata.apiKey","==",a)),e?.folderId){let se=mr(e?.folderId);h.push(Qe("metadata.veltFolderId","==",se))}if(e?.locationId&&h.push(Qe("location.id","==",e?.locationId)),m?.length&&h.push(Qe("metadata.documentId","in",m)),e?.resolvedBy){if(e?.order==="asc")throw new Error("Order by resolvedBy is not supported in ascending order.");h.push(Qe("resolvedByUserId","==",e?.resolvedBy))}if(e?.mentionedUserIds?.length){if(e?.order==="asc")throw new Error("Order by mentionedUserIds is not supported in ascending order.");h.push(Qe("mentionedUserIds","array-contains-any",e?.mentionedUserIds))}if(e?.userIds?.length){if(e?.order==="asc")throw new Error("Order by userIds is not supported in ascending order.");h.push(Qe("from.userId","in",e?.userIds))}if(e?.statusIds?.length){if(e?.order==="asc")throw new Error("Order by status id is not supported in ascending order.");h.push(Qe("status.id","in",e?.statusIds))}let _=new Date().getTime();if(e?.createdAfter&&h.push(Qe("createdAt",">=",e?.createdAfter)),e?.createdBefore&&h.push(Qe("createdAt","<=",e?.createdBefore??_)),e?.updatedAfter&&h.push(Qe("lastUpdated",">=",e?.updatedAfter??_)),e?.updatedBefore&&h.push(Qe("lastUpdated","<=",e?.updatedBefore??_)),h.push(Xt("lastUpdated",e?.order??"desc"),Xt("createdAt",e?.order??"desc")),e?.pageToken){let se=yield _b(e?.pageToken??"","veltencrypttoken","veltencrypttoken");h.push(Zb(parseInt(se,10),"lastUpdated"))}let I=e?.pageSize??100;h.push(Kb(I+1));let S=yield this.commonDbService.queryData({feature:"allComments",properties:{useCollectionGroup:!0,isCollection:!0,useQuery:!0,firestoreQuery:h,apiKey:a??"",organizationId:c}}),H=S.length>I;S=S.slice(0,I);let $=S?.reduce((se,_e)=>(se[_e?.annotationId]=_e,se),{});$=yield this.commonDbUtilsService.formatResponse({feature:"allComments",data:$,shouldAwait:!0}),$=this.commonDbUtilsService.mergeUsersWithData({feature:"allComments",data:$});let j=t.clientOrganizationId?yield this.isViewerOrgMembershipConfirmed(t.userId,t.clientOrganizationId):!1,Z=Ku({userId:t.userId,clientOrganizationId:j?t.clientOrganizationId:void 0,fallbackServerOrganizationId:t.clientOrganizationId?void 0:c});return{data:Zu(Object.values($??{}),{userId:t.userId,tokens:Z}),hasMore:H}}catch(t){throw this.loggingService.catch("Error in CommentService fetchCommentAnnotations:",t),t}})}filterUserDraftComments(e){let t=this.authService.getUser();return e.filter(a=>(a.comments=a?.comments?.filter(i=>i?.from?.userId===t?.userId||!i?.isDraft),!!a?.comments?.length))}removeDraftFlags(e){return e.forEach(t=>delete t.isDraft),e}mergeDraftAnnotations(e){return this.draftCommentAnnotationsByAnnotationId$.pipe(Te(t=>{let a=t||{};return e?.filter(i=>{a?.[i?.annotationId]&&delete a[i?.annotationId]}),a}),Te(t=>{if(t){let a=e.slice();return a.push(...Object.values(t)),a}return e}))}getDataFromDocumentIds({documentIds:e,organizationId:t,query:a}){return this.getDataFromDocuments({documentIds:e,organizationId:t,query:a})}getMultiThreadDataFromDocumentIds(e){return this.getMultiThreadDataFromDocuments({documentIds:e})}getMultiThreadDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:t}=e;if(t?.some(m=>!m)||!this.documentPaths)return Ee(null);let a=this.docService.getDocumentPaths()?.veltFolderId,i=Ee([]),c={useCollectionGroup:!0,isCollection:!0,useQuery:!0};if(this.commonDbService.shouldUseFirestore()||(c.documentId=t?.length?t[0]:void 0,c.organizationId=this.documentPaths?.organizationId),this.userPermissionService?.getIsContextEnabled()){let m=[X.DEFAULT_VELT_CONTEXT,...this.docService.getProcessedDocContext()],h=[];for(let _=0;_<(m?.length??0);_+=X.LISTENER_CONTEXT_BATCH_SIZE)h.push(m?.slice(_,_+X.LISTENER_CONTEXT_BATCH_SIZE)??[]);i=dr(h.map(_=>this.commonDbService.dbListener({feature:"allMultiThreads",properties:f(g({},c),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",this.documentPaths?.organizationId),Qe("metadata.documentId","in",t),...a?[Qe("metadata.veltFolderId","==",a)]:[],..._?.length?[Qe("context.accessFields","array-contains-any",_)]:[])]})}).pipe(Bc()))).pipe(Te(_=>Wc(_)))}else{let m=[];for(let h=0;h<(t?.length??0);h+=X.LISTENER_BATCH_SIZE)m.push(t?.slice(h,h+X.LISTENER_BATCH_SIZE)??[]);i=dr(m.map(h=>this.commonDbService.dbListener({feature:"allMultiThreads",properties:f(g({},c),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",this.documentPaths?.organizationId),Qe("metadata.documentId","in",h),...a?[Qe("metadata.veltFolderId","==",a)]:[])]})}).pipe(Bc()))).pipe(Te(h=>Wc(h)))}return i.pipe(Pe(m=>m?.data?Ee(m).pipe(Te(h=>({data:h?.data,operation:h?.operation})),Te(({data:h,operation:_})=>{let I=[];return h&&(I=Object.values(h??{}).filter(S=>typeof S=="object")),{data:I,operation:_}}),jr(h=>(this.loggingService.catch("Error in CommentService getMultiThreadDataFromDocumentId: ",h),Ee({data:[],operation:null}))),Te(({data:h,operation:_})=>{h.forEach(S=>{delete S.isDraft});let I=h.reduce((S,H)=>{let $=H.metadata?.documentId;return $&&(S[$]||(S[$]=[]),S[$].push(H)),S},{});return{data:h,documentMap:I,operation:_}}),Pe(({data:h,documentMap:_,operation:I})=>{let S=[];return this.commentAnnotationById$.pipe(Pe(()=>this.domService.getSelectedAnnotationsMap$().pipe(Te(H=>({selectedAnnotationsMap:H})))),Te(({selectedAnnotationsMap:H})=>{let $={};return Object.keys(_??{}).forEach(j=>{let Z=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:j});Z&&Z?.forEach(re=>{$[re?.annotationId]=re})}),S=h.filter(j=>{let Z=!1;if(j?.commentAnnotations){for(let re in j?.commentAnnotations)if($?.[re]&&$?.[re]?.status?.id!==this.customFilterService.resolvedStatus.id){Z=!0;break}}return Z}),S.forEach(j=>{Object.keys(j?.commentAnnotations||{}).forEach(Z=>{j.commentAnnotationsMap||(j.commentAnnotationsMap={}),j.commentAnnotationsMap[Z]=$?.[Z]})}),{data:S,operation:I}}))}),Pe(({data:h,operation:_})=>this.draftMultiThreadCommentAnnotationsByAnnotationId$.pipe(Te(I=>{let S=I||{};return h?.filter(H=>{S?.[H?.annotationId]&&delete S[H?.annotationId]}),S}),Te(I=>{if(I){let S=h.slice();return S.push(...Object.values(I)),{data:S,operation:_}}return{data:h,operation:_}}))),Te(({data:h,operation:_})=>{let I=h.reduce((S,H)=>{let $=H.metadata?.documentId;return $&&(S[$]||(S[$]=[]),S[$].push(H)),S},{});if(_?.type==="removed"){if(_?.ids?.length){let S=this.multiThreadCommentAnnotationById$.value;_?.ids?.forEach(H=>{delete S?.[H]}),this.multiThreadCommentAnnotationById$.next(S)}}else Object.keys(I??{}).forEach(S=>{this.setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:S,annotations:I[S]})});return h})):Ee(null)))}else return Ee(null)}updateUnreadAnnotationsMap(e,t){try{let a=new Date(X.UNREAD_COMMENTS_CHECK_FROM_DATE)?.getTime(),i=e.filter(c=>c?.lastUpdated>a);if(t){let c={},m=!1;i.forEach(h=>{let _=0,I=t?.[h?.annotationId];if(I){let S=I?.comments;S&&h?.comments?.forEach(H=>{S?.[H?.commentId]?.views?.[this.user?.userSnippylyId]||_++})}_?_!==c?.[h?.annotationId]&&(c[h?.annotationId]=_,m=!0):c?.[h?.annotationId]&&(delete c[h?.annotationId],m=!0)}),this.unreadCommentsMap$.next(c)}}catch(a){this.loggingService.catch("Error in CommentService updateUnreadAnnotationsMap:",a)}}updateAnnotationsForSelectAllContentMode(e){try{e.forEach(t=>{if(t?.selectAllContent&&t?.targetElementId){let a=Wr(t.targetElementId,["id","data-id"]);if(a){let i=a.textContent;i&&(t.targetTextRange={commonAncestorContainer:this.domService.getXPath(a),text:i,occurrence:1,commonAncestorContainerAnchor:this.domService.generateAnchorRecord(a)??void 0},delete t?.targetElement)}}})}catch(t){this.loggingService.catch("Error in CommentService updateAnnotationsForSelectAllContentMode:",t)}}setCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:a,queryHash:i}){try{if(t){e||(e=X.NO_ORGANIZATION_ID),i||(i=X.DEFAULT_QUERY_HASH);let c={};a?.forEach(h=>{h?.annotationId&&(c[h?.annotationId]=h)});let m=g(g({},this.commentAnnotationById$.value??{}),c);this.commentAnnotationById$.next(m)}}catch(c){this.loggingService.catch("Error in CommentService setCommentAnnotationsByOrganizationIdAndDocumentId:",c)}}getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e,documentId:t}){try{return this.commentAnnotationById$.pipe(Pe(()=>this.draftCommentAnnotationsByAnnotationId$),Te(()=>this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t})))}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByOrganizationIdAndDocumentId$:",a),Ee([])}}getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let a=null;this.commentAnnotationById$.value&&(a={},Object.values(this.commentAnnotationById$.value).forEach(c=>{c?.metadata?.documentId==t&&c?.metadata?.organizationId==e&&(a[c?.annotationId]=c)}));let i=this.draftCommentAnnotationsByAnnotationId$.value;return i&&(a===null&&(a={}),Object.values(i).forEach(c=>{c?.metadata?.documentId===t&&c?.metadata?.organizationId===e&&!a[c?.annotationId]&&(a[c?.annotationId]=c)})),a?Object.values(a):null}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByOrganizationIdAndDocumentId:",a),[]}}getCommentAnnotationsByDocumentId$({clientDocumentId:e,documentId:t}){try{return e&&!t&&(t=this.docService.generateDocumentId(e)),t?this.docService.getDocumentPaths$().pipe(Pe(a=>this.getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:a?.organizationId,documentId:t}))):Ee(null)}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByDocumentId$:",a),Ee(null)}}getCommentAnnotationsOnCurrentOrganizationAndDocument$(){return this.docService.getDocumentPaths$().pipe(Pe(e=>e?.documentId?this.getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e.organizationId,documentId:e.documentId}):Ee([])))}getCommentAnnotationsOnCurrentOrganizationAndDocument(){try{let e=this.docService.getDocumentPaths();return e?.documentId?this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e?.organizationId,documentId:e?.documentId}):[]}catch(e){return this.loggingService.catch("Error in CommentService getCommentAnnotationsOnCurrentOrganizationAndDocument:",e),[]}}setOriginalCommentAnnotationsByAnnotationId(e){try{let t={};e?.forEach(a=>{a?.annotationId&&(t[a?.annotationId]=a)}),this.originalCommentAnnotationsByDocumentId$.next(g(g({},this.originalCommentAnnotationsByDocumentId$.value),t))}catch(t){this.loggingService.catch("Error in CommentService setOriginalCommentAnnotationsByAnnotationId:",t)}}setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:a,queryHash:i}){try{if(t){e||(e=X.NO_ORGANIZATION_ID),i||(i=X.DEFAULT_QUERY_HASH);let c={};a.forEach(h=>{h?.annotationId&&(c[h?.annotationId]=h)});let m=g(g({},this.multiThreadCommentAnnotationById$.value),c);this.multiThreadCommentAnnotationById$.next(m)}}catch(c){this.loggingService.catch("Error in CommentService setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId:",c)}}getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e,documentId:t}){return this.multiThreadCommentAnnotationById$.pipe(Te(()=>this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t})))}getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let a={};Object.values(this.multiThreadCommentAnnotationById$.value??{}).forEach(c=>{c?.metadata?.documentId==t&&c?.metadata?.organizationId==e&&(a[c?.annotationId]=c)});let i=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value;return i&&Object.values(i??{}).forEach(c=>{c?.metadata?.documentId===t&&c?.metadata?.organizationId===e&&!a[c?.annotationId]&&(a[c?.annotationId]=c)}),Object.values(a)}catch(a){return this.loggingService.catch("Error in CommentService getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId:",a),[]}}getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument$(){return this.docService.getDocumentPaths$().pipe(Pe(e=>e?.documentId?this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e.organizationId,documentId:e.documentId}):Ee([])))}getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument(){try{let e=this.docService.getDocumentPaths();return this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e?.organizationId,documentId:e?.documentId})}catch(e){return this.loggingService.catch("Error in CommentService getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument:",e),[]}}getLocations$(){return this.docService.getLocation$().pipe(Pe(e=>this.docService.getLocations$().pipe(Te(t=>({location:e,locations:t})))),Te(e=>{let t=[];return t.push(e?.location?.locationId),t.push(...Object.values(e.locations||[]).map(a=>a.locationId)),t||[]}))}filterAnnotationsByLocationIds(e,t,a){try{return e.filter(i=>t.includes(i.locationId)||a?.includes(i?.location?.id)||t?.find(c=>c==i?.location?.id)||a?.find(c=>c==i?.locationId+""))}catch(i){return this.loggingService.catch("Error in CommentService filterAnnotationsByLocations:",i),[]}}setAnnotationIndex(e){try{e.forEach((t,a)=>{t?.annotationId&&(t.annotationIndex=a+1)})}catch(t){this.loggingService.catch("Error in CommentService setAnnotationIndex:",t)}}calculateCommentAnnotationPosition(e,t){try{if(e.multiThreadAnnotationId)return;if(e.targetElementId){let a=Wr(e.targetElementId,["id","data-id"]);if(a&&this.domService.isElementVisible(a)){let i=a.getAttribute(X.ATTRIBUTES.VELT_COMMENT_TYPE),c=!0;if(i)i==="popover"?c=!0:c=!1;else{let m=document.querySelector(`${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_INLINE_COMMENT_ELEMENT_ID}="${e.targetElementId}"], ${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_COMMENT_ELEMENT_ID}="${e.targetElementId}"], ${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_ELEMENT_ID}="${e.targetElementId}"]`);m&&a?.contains(m)&&(c=!1)}c?e.targetElement={xpath:this.domService.getXPath(a),fXpath:this.domService.getXPath(a,!0),cfXpath:this.domService.getXPath(a,!0,!0),topPercentage:e.targetElement?.topPercentage||50,leftPercentage:e.targetElement?.leftPercentage||90}:e.targetElement=null}else e.targetElement=null}if(e.targetElement){e.position=null,e.ghostComment=null;let a=e.targetElement?.xpath,i=null,c=e?.targetElement?.anchor;if(c){let h=this.domService.resolveAnchorRecord(c);h?.element&&this.domService.isElementVisible(h.element)&&pn(h.element)&&(i=h.element)}else a&&(i=this.domService.getElementFromXPath(a),this.domService.isXpathWithId(a)||((!i||!this.domService.isElementVisible(i))&&e.targetElement?.cfXpath&&(a=e.targetElement?.cfXpath,i=this.domService.getElementFromXPath(a)),this.getDetectionStrategy()===Yu.DYNAMIC_ID&&(!i||!this.domService.isElementVisible(i))&&(a=e.targetElement?.fXpath,a&&(i=this.domService.getElementFromXPath(a)))));(!i||!this.domService.isElementVisible(i))&&t&&(e.ghostComment={},this.setGhostCommentMessage(e),e.ghostComment.targetElement=this.getGhostCommentTargetElement(e),e?.ghostComment?.targetElement?.xpath&&(i=this.domService.getElementFromXPath(e?.ghostComment?.targetElement?.xpath)));let m=!1;if(e?.locationId){let h=this.docService.getLocation();if(!Ug({location:h?.location,locationId:h?.locationId},{location:e?.location,locationId:e?.locationId})){let _=this.docService.getAdditionLocationFromElement(i),I=_?this.docService.genarateLocationId(_):void 0;e?.location?.id&&e?.location?.id===_?.id||I&&I===e?.locationId?m=!1:m=!0}}if(m&&(e.ghostComment=null),!m&&i&&pn(i)&&!i?.closest(".cdk-overlay-container")&&i?.getBoundingClientRect()){let _=this.popoverMode$?.value?0:e.targetElement?.topPercentage,I=this.popoverMode$?.value?100:e.targetElement?.leftPercentage,{height:S,width:H}=Pb(i);e.position={top:S*(_||0)/100,left:H*(I||0)/100};let $=window.getComputedStyle(i).transform;if($&&$!=="none")try{let j=new DOMMatrixReadOnly($),Z=Math.sqrt(j.a*j.a+j.b*j.b)||1,re=Math.sqrt(j.c*j.c+j.d*j.d)||1;(Math.abs(Z-1)>.01||Math.abs(re-1)>.01)&&(e.position.parentScaleX=Z,e.position.parentScaleY=re)}catch{}if(this.transformContext$.value){let{containerSelector:j,transforms:Z}=this.transformContext$.value,re=document.querySelector(j);re&&re.contains(i)&&(e.position.transformContext=Z)}}!m&&t&&!e?.position&&!e?.ghostComment&&(e.ghostComment={},this.setGhostCommentMessage(e),e.ghostComment.targetElement=e.targetElement)}t&&(e.ghostComment?this.addAnnotationToGhostCommentAnnotationMap(e):this.removeAnnotationFromGhostCommentAnnotationMap(e))}catch(a){this.loggingService.catch("Error in CommentService calculateCommentAnnotationPosition:",a)}}addComment($e,bt,Xe,Tt,Ue){return Ae(this,arguments,function*(e,t,a,i,c,m=[],h,_,I,S,H,$,j,Z,re,se,_e,le,he,Se,Re,ze,Ye,ct){this.loggingService.log("%c[WB] Calling FUNCTION: addComment","color: green;");try{let Ut=this.authService.getUser();if(Ut)if(Ut.isReadOnly||Ut.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add comments.");else{yield this.triggerAddCommentAnnotationDraftEvent();let We=new Nt;_e&&(We=g(g({},We),_e)),We.comments=[],_e?.comments?.length&&(We.comments=_e.comments.map(St=>{let Ot=new qn;return Ot=g(g({},Ot),St),Ot.from=Ut,Ot.lastUpdated=new Date,Ot.createdAt=this.timestamp,Ot})),We.from=Ut,We.color=We?.color||X.DEFAULT_ANNOTATION_COLOR,We.lastUpdated=this.timestamp,We.createdAt=this.timestamp,We.sourceId=re,We.assignedTo=_e?.assignedTo||se,We.customList=_e?.customList||[],ze&&(We.targetElementId=ze);let{topPositionX:Gu,topPositionY:ag}=this.domService.getTopLeftPosition();We.positionX=Gu,We.positionY=ag;let Uc=this.domService.getCurrentWindowSizeValue();if(We.screenWidth=Uc.screenWidth,We.screenHeight=Uc.screenHeight,We.screenScrollHeight=Uc.screenScrollHeight,We.taggedElementPath="",e&&(We.targetElement=this.domService.getTargetElementForCursorPosition(e,!0,!0,!0,St=>{if(this.getSvgAsImg()){let Ot=St?.closest(`[${X.ATTRIBUTES.VELT_COMMENT_CONTAINER}]`);Ot&&Ot instanceof HTMLElement&&(St=Ot)}if(this.getPopoverMode()){let Ot=St?.closest(`[${X.ATTRIBUTES.VELT_TARGET_COMMENT_ELEMENT_ID}]`);if(Ot&&Ot instanceof HTMLElement)return Ot}return St}),this.getCommentToNearestAllowedElement()&&We.targetElement?.xpath)){let St=this.domService.getElementFromXPath(We.targetElement.xpath);if(St&&!this.isElementInsideAllowedElements(St)){let Ot=this.getNearestAllowedElement(St);if(Ot)We.targetElement.xpath=this.domService.getXPath(Ot),We.targetElement.fXpath=this.domService.getXPath(Ot,!0),We.targetElement.cfXpath=this.domService.getXPath(Ot,!0,!0),We.targetElement.anchor=this.domService.generateAnchorRecord(Ot);else return}}if(t&&(We.targetTextRange=t),We?.targetElement?.xpath){let St=this.domService.getXPath(We.targetElement.xpath);if(St){let Ot=St.iterateNext();Ot&&(pn(Ot)||(We.targetElement=null))}}this.customFilterService.defaultStatus&&!_e?.status&&(We.status=this.customFilterService.defaultStatus),We.pageInfo=tp(),We.pageInfo&&(We.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth);let c2=this.docService.getClientDocumentId(),m2=this.docService.getLocation()?.location;if(he&&(We.context=this.preserveAccessSentinels(We.context,he&&an(he)),We.contextId=this.generateContextId(We.context)),this.commentContextProvider!==null){let St=this.commentContextProvider(c2,m2),Ot=St instanceof Promise?yield St:St;Ot&&(We.context=this.preserveAccessSentinels(We.context,Ot&&an(Ot)),We.contextId=this.generateContextId(We.context),Ot?.commentType==="manual"&&(We.commentType="manual",delete We.targetElement))}if(i){We.sourceId=i?.sourceId;let St=i?.targetElement,Ot=i?.commentData;if(St?.targetText)We.targetTextRange={commonAncestorContainer:"/html/body",text:St.targetText,occurrence:St?.occurrence||1,commonAncestorContainerAnchor:this.domService.generateAnchorRecord(document.body)??void 0};else if(St?.elementId)if(We.targetElementId=St.elementId,St?.selectAllContent)We.selectAllContent=!!St?.selectAllContent;else{let Rr=Wr(St.elementId,["id","data-id"]);Rr?We.targetElement={xpath:this.domService.getXPath(Rr),fXpath:this.domService.getXPath(Rr,!0),cfXpath:this.domService.getXPath(Rr,!0,!0),anchor:this.domService.generateAnchorRecord(Rr),topPercentage:50,leftPercentage:90}:We.targetElement={xpath:"/html/body",fXpath:"/html/body",cfXpath:"/html/body",anchor:this.domService.generateAnchorRecord(document.body),topPercentage:50,leftPercentage:90}}i?.status&&(We.status=i.status),i?.context&&(We.context=this.preserveAccessSentinels(We.context,i.context?an(i.context):i.context),We.contextId=this.generateContextId(We.context)),We.comments||(We.comments=[]);let zu=this.authService.getUser();Ot?.forEach(Rr=>{let Fv=new qn;Fv.commentText=Rr.commentText,Fv.commentHtml=Rr.commentHtml,Fv.replaceContentHtml=Rr.replaceContentHtml,Fv.replaceContentText=Rr.replaceContentText,Fv.from=zu,We.comments.push(Fv)})}if(c&&(We.isPageAnnotation=!0),m?.length&&(We.comments=m),h&&(We.commentType="chart",We.metadata=h),I?.sourceId&&(We.sourceId=I.sourceId),We?.targetElement?.xpath&&!I){let St=this.domService.getElementFromXPath(We.targetElement.xpath);St&&(I=this.getInlineCommentSectionConfig(St))}I?.targetInlineCommentElementId&&(We.targetInlineCommentElementId=I?.targetInlineCommentElementId,We.targetElementId=I.targetInlineCommentElementId,I?.config?.id&&(We.inlineCommentSectionConfig=I?.config));let s2=!We?.comments?.length,g2=!!(i?.openComment===!1||Se);this.getPrivateCommentMode()&&(We?.iam||(We.iam=new hb),We.iam.accessMode=cr.PRIVATE),S&&(We.context=this.preserveAccessSentinels(We.context,S.context?an(S.context):S.context),We.commentType="manual",delete We.targetElement,We.contextId=this.generateContextId(We.context)),H&&(We.targetElementId=H.targetElementId,We.targetElement=H.targetElement);let kh=this.getPrivateModeConfig();if(kh)try{let St=g({},kh),Ot=this.authService.getUser();if(St.type==="restricted"&&Ot?.userId&&(St=eo(St,Ot.userId)),St.type==="organizationPrivate"&&!St.organizationId&&!St.organizationIds?.length){let Rr=this.docService.getOrganizationConfig();Rr?.clientOrganizationId&&(St.organizationId=Rr.clientOrganizationId)}let zu=An(St,Ot?.userId);We.context||(We.context={}),We.context._setAccessFields=zu,We.visibilityConfig=Pn(St,Ot?.userId)}catch(St){this.loggingService.catch("Error building accessFields from privateModeConfig: ",St)}this.saveCommentToDb(We,a,s2,g2,_,$,j,le,Z,Re,Ye,ct)}}catch(Ut){this.loggingService.catch("Error in CommentService addComment: ",Ut)}})}triggerAddCommentAnnotationDraftEvent(){return Ae(this,null,function*(){try{this.commentAnnotationContextDraft=null;let e={addContext:a=>{this.commentAnnotationContextDraft=a}},t=yield this.commentActionsService?.getAddCommentAnnotationDraftEventFromCommentAddEventData(e);t&&this.commentActionsService?.triggerAddCommentAnnotationDraftEvent(t)}catch(e){this.loggingService.catch("Error in CommentService triggerAddCommentAnnotationDraftEvent: ",e)}})}triggerAddCommentDraftEventOnAbandon(e,t){return Ae(this,null,function*(){try{if(!e||!t)return;let a=this.getAnnotationById(e),i=!!this.getFullComments(a).some(c=>c&&!c.isDraft);a&&i&&(yield this.commentActionsService?.triggerAddCommentDraftEventForAnnotation(a,t))}catch(a){this.loggingService.catch("Error in CommentService triggerAddCommentDraftEventOnAbandon: ",a)}})}willDeleteWholeAnnotation(e,t){try{let a=this.getFullComments(e);if(!a.length)return!1;let i=a.findIndex(c=>c?.commentId===t);return i<0?!1:i===0&&this.deleteThreadWithFirstComment$.value!==!1||a.length===1}catch(a){return this.loggingService.catch("Error in CommentService willDeleteWholeAnnotation: ",a),!1}}confirmDeleteCommentIfRequired(e,t){return Ae(this,null,function*(){try{let a=this.getFullComments(e);if(!a.length||!t)return!0;let i=a.findIndex(_=>_?.commentId===t?.commentId);if(i<0||!(i===0&&this.deleteThreadWithFirstComment$.value!==!1||this.deleteReplyConfirmation$.value))return!0;let m;return this.deleteReplyConfirmation$.value&&(i!==0||this.deleteThreadWithFirstComment$.value===!1)?m={title:"Delete comment?",message:"This selected comment will be deleted.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"reply",type:"reply"}:m={title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"},!!(yield this.dialog.open(Yc,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:m}).afterClosed().toPromise())}catch(a){return this.loggingService.catch("Error in CommentService confirmDeleteCommentIfRequired: ",a),!1}})}releaseDraftConfirmationRetention(e){try{if(!e||!this.draftConfirmationPendingAnnotationIds?.delete(e))return;let t=this.draftCommentAnnotationsByAnnotationId$?.value;if(!t||!(e in t))return;let a=JSON.parse(JSON.stringify(t));delete a[e],this.draftCommentAnnotationsByAnnotationId$.next(a)}catch(t){try{this.loggingService?.catch("Error in CommentService releaseDraftConfirmationRetention: ",t)}catch{}}}confirmDraftIfRequired(e,t){return Ae(this,null,function*(){try{if(!e?.isDraft||!this.draftConfirmation$?.value)return!0;t&&this.draftConfirmationPendingAnnotationIds?.add(t);let a=S2({composerContent:e?.commentText??"",attachmentCount:e?.attachments?.length??0,recordingCount:e?.recorders?.length??0});return!(yield this.confirmDraftDecision?.(a))}catch(a){try{this.loggingService?.catch("Error in CommentService confirmDraftIfRequired: ",a)}catch{}return!0}finally{this.releaseDraftConfirmationRetention(t)}})}confirmDraftDecision(e){return Ae(this,null,function*(){try{let t={title:"Delete Draft?",message:"Your comment will be permanently removed",previewText:e,yesButton:"Delete Draft",noButton:"Keep Draft",darkMode:this.commentContainerDarkMode$.value,variant:"draft",type:"draft"};return!!(yield this.dialog.open(Yc,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],role:"alertdialog",ariaDescribedBy:"velt-confirm-dialog-message",data:t}).afterClosed().toPromise())}catch(t){return this.loggingService.catch("Error in CommentService confirmDraftDecision: ",t),!1}})}setLocationToCommentAnnotation(e){try{let t=this.docService.getLocation();t?(e.locationId=t.locationId,e.location=t.location):(delete e.locationId,delete e.location);try{let a;e.targetElement?a=this.domService.getElementFromTargetElement(e.targetElement):e.targetElementId?a=Wr(e.targetElementId,["id","data-id"]):e.targetTextRange&&(a=this.domService.getElementFromTargetTextRange(e.targetTextRange));let i=this.docService.getAdditionLocationFromElement(a);if(i){let c=this.docService.addLocation({location:i,source:"internal"});c?.[0]&&(e.locationId=c[0].locationId,e.location=c[0].location)}}catch{}}catch(t){this.loggingService.catch("Error in CommentService setLocationToCommentAnnotation:",t)}}getElementForCommentAnnotation(e){try{let t;return e.targetElement?t=this.domService.getElementFromTargetElement(e.targetElement):e.targetElementId?t=Wr(e.targetElementId,["id","data-id"]):e.targetTextRange&&(t=this.domService.getElementFromTargetTextRange(e.targetTextRange)),t}catch(t){return this.loggingService.catch("Error in CommentService getElementForCommentAnnotation: ",t),null}}saveCommentToDb(e,t,a=!1,i=!1,c,m,h,_,I,S,H,$){this.loggingService.log("%c[WB] Calling FUNCTION: saveCommentToDb","color: green;");try{this.authService.getUser()&&this.authService.isFeatureAllowed(ke.COMMENT)&&this.docService.getDocumentPaths$().pipe(Gt(j=>!!j),Jn(1),Pe(j=>(this.documentPaths=j,this.loggingService.log(this.documentPaths),this.databaseService.getDb().pipe(Gt(Z=>!!Z),Jn(1),Pe(Z=>Ae(this,null,function*(){if(this.documentPaths?.comment){e.annotationId=this.commonDbService.generateDocumentId();let re=this.docService.getClientDocumentId(),se=this.docService.getLocation()?.location;if(h)e.multiThreadAnnotationId=h;else if(this.getMultiThread()){let Ye=un();e.targetElementId&&(Ye=un(e.targetElementId),e?.location?.id?Ye=un([e?.location?.id,e.targetElementId]):e?.locationId&&(Ye=un([e?.locationId+"",e.targetElementId]))),e.multiThreadAnnotationId=Ye}let _e={addContext:Ye=>{Ye.access&&(Ye.accessFields=Jc(Ye)),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ADD_CONTEXT_TRIGGERED,{annotationId:e.annotationId,commentType:this.getCommentType(e),commentMode:this.getCommentMode(),context:Ye}),e.context=Ye&&an(Ye),e.contextId=this.generateContextId(e.context),Ye?.commentType==="manual"&&(e.commentType="manual",delete e.targetElement),e?.annotationId&&setTimeout(()=>{this.updateCommentAnnotationContext(e.annotationId,Ye)},200)},documentId:re,location:se,annotation:this.getCommentAnnotationForClient(e),targetAnnotationId:e?.annotationId,targetCommentId:e?.comments?.length?e?.comments[0]?.commentId:void 0};e?.targetElement?.xpath?_e.elementRef={xpath:e.targetElement.xpath}:_e.elementRef=void 0,this.commentAddedEmitter!==null&&"emit"in this.commentAddedEmitter&&this.commentAddedEmitter.emit(_e),this.commentAdded$.next(_e),I&&I(_e),_e?.annotation?.annotationId&&this.pendingAddCommentAnnotationData.set(_e.annotation.annotationId,_e),this.setLocationToCommentAnnotation(e);let le=this.getElementForCommentAnnotation(e),he=this.docService.getBaseMetadata("comment",{element:le,multiThreadAnnotationId:e.multiThreadAnnotationId});if(!he?.apiKey)return;if(e?.metadata||(e.metadata={}),e.metadata=g(g({},e.metadata),he),S&&(e.metadata=g(g({},e.metadata),S)),c&&typeof c=="object"&&(e.locationId=_||this.docService.genarateLocationId(c),e.location=c,$||this.docService.addLocation({location:c})),a)window.localStorage.setItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT,JSON.stringify(e));else{let Ye=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);Ye&&JSON.parse(Ye).annotationId===e.annotationId&&e.comments!==void 0&&e.comments.length>0&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT)}e.pageInfo&&(e.pageInfo.commentUrl=this.generateCommentUrl(e));let Se=e.comments,Re=JSON.parse(JSON.stringify(e));if(this.commentAnnotationContextDraft){let Ye=this.commentAnnotationContextDraft;this.commentAnnotationContextDraft=null,Ye.access&&(Ye.accessFields=Jc(Ye)),Re.context=this.preserveAccessSentinels(Re.context,Ye&&an(Ye))}if(this.applyContextAccessDefaults(Re),Re.visibilityConfig||jc(Re?.context?.accessFields).length===0&&(Re.visibilityConfig={type:"public"}),Re.position=null,t){Re.targetElement=null,Re.targetTextRange=null;let Ye={annotationId:e.multiThreadAnnotationId?e.multiThreadAnnotationId:e.annotationId,type:e.multiThreadAnnotationId?ke.MULTI_THREAD:ke.COMMENT},ct=yield this.areaService?.generateAreaAnnotationId();Re.areaAnnotationId=ct;let $e=this.areaService?.addArea(void 0,t,Ye,ct,{locationId:Re.locationId,location:Re.location},Re.context);$e&&(Re.metadata=g(g({},Re.metadata),$e?.metadata||{}))}!i&&!Re?.targetInlineCommentElementId&&!Re?.isPageAnnotation&&this.domService.toggleAnnotationSelection(Re,m),e.targetTextRange&&sessionStorage.setItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,e?.multiThreadAnnotationId?e?.multiThreadAnnotationId:e.annotationId),Re?.comments?.length?this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ADDED,{annotationId:e.annotationId,commentThreadId:Re?.comments[0]?.commentId,commentThreadIndex:0,commentType:this.getCommentType(Re),commentMode:this.getCommentMode(),source:H??"internal",commentAnnotationCreatedAt:e.createdAt,taggedClientUserIds:Re?.comments[0]?.taggedUserContacts?.map(Ye=>Ye.contact?.userId).filter(Ye=>!!Ye),taggedSnippylyUserIds:Re?.comments[0]?.taggedUserContacts?.filter(Ye=>!!Re?.metadata?.apiKey&&!!Ye.contact?.userId).map(Ye=>Ng(Re.metadata.apiKey,Ye.contact.userId))}):this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_DRAFT_ADDED,{annotationId:e.annotationId,commentType:this.getCommentType(Re),commentMode:this.getCommentMode()});let ze=this.getAnnotationNumber(e);ze&&(Re.annotationNumber=ze),Re?.comments?.length?Re.comments=[]:Re.isDraft=!0,Re?.multiThreadAnnotationId&&this.saveMultiThreadCommentAnnotation(Re),Re?.context&&(Re.contextId=this.generateContextId(Re.context),Re.context?.commentType==="manual"&&(Re.commentType="manual",delete Re.targetElement)),Se?.length?this.saveComment(Re,{type:Ze.NEWLY_ADDED,updatedComment:Se[0]}):this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e.annotationId]:Re}))}})))))).subscribe(()=>{},j=>{this.loggingService.catch("Error in CommentService saveCommentToDb subscription: ",j)})}catch(j){this.loggingService.catch("Error in CommentService saveCommentToDb: ",j)}}saveMultiThreadCommentAnnotation(e){return Ae(this,null,function*(){try{if(e?.multiThreadAnnotationId){let t=this.docService.getDocumentPaths();if(this.databaseService.getDbValue()&&t?.multiThread){let a={annotationId:e.multiThreadAnnotationId,targetElement:e.targetElement,targetElementId:e.targetElementId,targetInlineCommentElementId:e.targetInlineCommentElementId,inlineCommentSectionConfig:e.inlineCommentSectionConfig,areaAnnotationId:e.areaAnnotationId,targetTextRange:e.targetTextRange,from:e.from,locationId:e.locationId,location:e.location,sourceId:e.sourceId,type:"multiThread",metadata:e.metadata,context:e.context};delete e?.targetElement,delete e?.areaAnnotationId,delete e?.targetTextRange;let i=this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:t?.organizationId,documentId:t?.documentId})?.find(c=>c.annotationId===e.multiThreadAnnotationId);if(i||(i=yield this.commonDbService?.getData({feature:"multiThread",properties:{documentId:t?.documentId??"",organizationId:t?.organizationId??"",id:e.multiThreadAnnotationId}})),i&&(i=JSON.parse(JSON.stringify(i)),delete i.from,a=g(g({},i),a)),a?.commentAnnotations||(a.commentAnnotations={}),a.commentAnnotations[e.annotationId]=!0,e?.isDraft)this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(f(g({},this.draftMultiThreadCommentAnnotationsByAnnotationId$.value),{[a.annotationId]:f(g({},a),{isDraft:!0})}));else{let m=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value[a.annotationId];if(m&&(a=g(g({},a),m)),delete a.isDraft,a.commentAnnotationsMap={},!a?.metadata?.documentId){a?.metadata||(a.metadata={});let I=this.docService.getBaseMetadata("multiThread");a.metadata=g(g({},a?.metadata),I)}let{documentId:h,organizationId:_}=a?.metadata||{};yield this.commonDbService.updateData({feature:"multiThread",properties:{id:a.annotationId,documentId:h,organizationId:_},data:JSON.parse(JSON.stringify(a)),callback:()=>{let I=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value;I[e.annotationId]&&(delete I[e.annotationId],this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(I))}})}return a}}return null}catch(t){return this.loggingService.catch("Error in CommentService saveMultiThreadCommentAnnotation: ",t),null}})}setCommentCategory(e){return Ae(this,null,function*(){try{if(e?.comments?.length){let t=e.comments[0].commentText?.trim();if(t){let a=yield this.getCommentCategory(t).toPromise();if(a){let i=this.docService.getDocumentPaths();if(i?.comment&&e?.annotationId){let c=this.getCommentAnnotationsOnCurrentOrganizationAndDocument()?.find(m=>m.annotationId===e.annotationId);if(c||(c=yield this.commonDbService?.getData({feature:"comment",properties:{documentId:i?.documentId??"",organizationId:i?.organizationId??"",id:e.annotationId}})),c?.annotationId){let m=c;m.commentCategories=[a];let{documentId:h,organizationId:_}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(m);yield this.commonDbService.updateData({feature:"comment",properties:{id:e.annotationId,documentId:h,organizationId:_,metadata:{apiKey:this.configService.getApiKey(),organizationId:_,veltFolderId:m?.metadata?.veltFolderId,documentId:h}},data:JSON.parse(JSON.stringify(m))})}}}}}}catch(t){this.loggingService.catch("Error in CommentService setCommentCategory: ",t)}})}getCommentCategory(e){try{let t=np(this.functions,rp({url:this.endpointsService.getCloudFunctionUrl("chatgptCompletion"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:12e5}),i=[{role:"system",content:`Identify category of this sentence from these categories, ${Object.keys(this.customCategoryMap)?.join(", ")}:`},{role:"user",content:e}];return yn(t({messages:i,apiKey:this.configService.getApiKey(),sdkVersion:Ib(),sdkType:this.configService.getSdkType(),numResponse:1})).pipe(Te(c=>{if(c?.data){let m=c.data,h=m?.length?m[0]?.content?.trim():void 0;return h&&Object.keys(this.customCategoryMap).includes(h)?this.customCategoryMap[h]:void 0}else return}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentCategory: ",t),Ee(void 0)}}applyListenerVisibilityPostFilter(e,t,a,i){try{let c=Zu(e,{userId:a,tokens:t});i&&(c=fb(c,i));let m=(e||[]).filter(h=>!c.includes(h));return m.length&&this.evictAnnotationsFromLocalCache(m.map(h=>h?.annotationId).filter(h=>!!h)),c}catch(c){return this.loggingService.catch("Error in CommentService applyListenerVisibilityPostFilter: ",c),e}}evictAnnotationsFromLocalCache(e){try{if(!e?.length)return;let t=this.commentAnnotationById$?.value;if(t&&e.some(a=>a in t)){let a=g({},t);e.forEach(i=>{delete a[i]}),this.commentAnnotationById$.next(a)}}catch(t){this.loggingService.catch("Error in CommentService evictAnnotationsFromLocalCache: ",t)}}preserveAccessSentinels(e,t){try{return e&&typeof e=="object"&&t&&typeof t=="object"&&("_setAccessFields"in e&&!("_setAccessFields"in t)&&(t._setAccessFields=e._setAccessFields),"_replaceAccessFields"in e&&!("_replaceAccessFields"in t)&&(t._replaceAccessFields=e._replaceAccessFields)),t}catch(a){return this.loggingService.catch("Error in CommentService preserveAccessSentinels: ",a),t}}applyContextAccessDefaults(e){try{this.handleDirectAccessFieldsAssignment(e?.context)||(e?.context?.access?e.context.accessFields?.length||(e.context.accessFields=Jc(e.context)):jc(e?.context?.accessFields).length>0||(e?.context||(e.context={}),e.context.access={default:"velt"},e.context.accessFields=[...new Set([...e.context.accessFields||[],X.DEFAULT_VELT_CONTEXT])]))}catch(t){this.loggingService.catch("Error in CommentService applyContextAccessDefaults: ",t)}}buildContextAccessFieldsPreservingVisibility(e,t){try{return Ag(e,jc(t))}catch(a){return this.loggingService.catch("Error in CommentService buildContextAccessFieldsPreservingVisibility: ",a),[...t||[]]}}handleDirectAccessFieldsAssignment(e){try{if(!e||typeof e!="object"||!("_setAccessFields"in e)&&!("_replaceAccessFields"in e))return!1;let t=!("_setAccessFields"in e),a=t?e._replaceAccessFields:e._setAccessFields;delete e._setAccessFields,delete e._replaceAccessFields;let i=Array.isArray(a)?a:[];if(!(!t&&Xu(e.access)))return delete e.access,delete e.accessFields,i.length>0&&(e.accessFields=i),!0;let m=i.length>0&&!i.includes(X.DEFAULT_VELT_CONTEXT),h;return m?h=Ag(e,i):this.userPermissionService?.getIsContextEnabled()?h=Ag(e,i):h=[...new Set([...i,...Jc(e)])],h.length>0?e.accessFields=h:delete e.accessFields,!0}catch(t){return this.loggingService.catch("Error in CommentService handleDirectAccessFieldsAssignment: ",t),!1}}updateCommentAnnotationContext(e,t,a){return Ae(this,null,function*(){try{this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_UPDATE_CONTEXT_TRIGGERED,{annotationId:e,context:t,merge:a?.merge});let i=this.authService.getUser(),c=this.docService.getDocumentPaths();if(i&&c?.comment&&e){let m=this.getAnnotationById(e);if(typeof m=="object"&&(m=JSON.parse(JSON.stringify(m))),m||(m=yield this.commonDbService?.getData({feature:"comment",properties:{documentId:c?.documentId??"",organizationId:c?.organizationId??"",id:e}})),m?.annotationId){let h=t,_=JSON.parse(JSON.stringify(m.context||{}));if(a?.merge&&(h=g(g({},_),t),Xu(_?.access)&&t?.access&&typeof t.access=="object"&&!Array.isArray(t.access))){let $=g(g({},_.access),t.access);Object.keys($).forEach(j=>{($[j]===null||$[j]===void 0)&&delete $[j]}),h.access=Object.keys($).length?$:{default:"velt"}}let I=this.handleDirectAccessFieldsAssignment(h);if(h&&"_setVisibilityConfig"in h&&(m.visibilityConfig=h._setVisibilityConfig,delete h._setVisibilityConfig),h&&typeof h=="object"&&!I)if("access"in t)if(t.access!==null&&t.access!==void 0)h.accessFields=this.buildContextAccessFieldsPreservingVisibility(h,_?.accessFields);else{delete h.access;let $=jc(_?.accessFields);$.length?h.accessFields=$:delete h.accessFields}else{if(!a?.merge)for(let $ of x2)!($ in t)&&_?.[$]!==void 0&&(h[$]=_[$]);h.access!==null&&h.access!==void 0&&(h.accessFields=this.buildContextAccessFieldsPreservingVisibility(h,_?.accessFields))}let S={context:JSON.parse(JSON.stringify(h||{}))},H=!1;if(S?.context?.commentType==="manual"&&(S.commentType="manual",S.targetElement=null,m?.targetElement&&(m.targetElement=null,H=!0)),m.context=S.context?an(S.context):S.context,m.contextId=this.generateContextId(m.context),ln(_,h)&&!H)return Promise.resolve("Comment annotation context is already updated.");if(m?.comments?.length){m.lastUpdated=this.timestamp;let $=this.commentAnnotationById$?.value?.[e]?JSON.parse(JSON.stringify({context:this.commentAnnotationById$.value[e].context??null,contextId:this.commentAnnotationById$.value[e].contextId??null,visibilityConfig:this.commentAnnotationById$.value[e].visibilityConfig})):null;this.patchLocalAnnotationContext(e,m);let j=JSON.stringify({context:m.context??null,visibilityConfig:m.visibilityConfig}),{documentId:Z,organizationId:re}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(m);return this.commonDbService.setData({feature:"comment",properties:{id:e,documentId:Z,organizationId:re,metadata:{apiKey:this.configService.getApiKey(),organizationId:re,veltFolderId:m?.metadata?.veltFolderId,documentId:Z}},data:JSON.parse(JSON.stringify(m)),callback:()=>{this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_UPDATE_CONTEXT_SUCCESS,{annotationId:e,context:S?.context,merge:a?.merge})},errorCallback:()=>{try{let se=this.commentAnnotationById$?.value,_e=se?.[e];if(!se||!_e||!$||JSON.stringify({context:_e.context??null,visibilityConfig:_e.visibilityConfig})!==j)return;let he=f(g({},_e),{context:$.context,contextId:$.contextId});$.visibilityConfig===void 0?delete he.visibilityConfig:he.visibilityConfig=$.visibilityConfig,this.commentAnnotationById$.next(f(g({},se),{[e]:he}))}catch(se){this.loggingService.catch("Error reverting optimistic context patch: ",se)}}})}else return this.draftCommentAnnotationsByAnnotationId$.value?.[e]?(this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e]:m})),Promise.resolve("Draft comment annotation context updated.")):(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_UPDATE_CONTEXT_FAILED,{annotationId:e,context:t,merge:a?.merge,error:"Draft comment annotation not found."}),Promise.resolve("Draft comment annotation not found."))}else return this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_UPDATE_CONTEXT_FAILED,{annotationId:e,context:t,merge:a?.merge,error:"Comment annotation not found in database."}),Promise.resolve("Comment annotation not found in database.")}}catch(i){return this.loggingService.catch("Error in CommentService updateCommentAnnotationContext: ",i),Promise.resolve("Error in CommentService updateCommentAnnotationContext.")}})}patchLocalAnnotationContext(e,t){try{let a=this.commentAnnotationById$?.value,i=a?.[e];if(!a||!i)return;let c=g(f(g({},i),{context:t?.context?JSON.parse(JSON.stringify(t.context)):i.context,contextId:t?.contextId??i.contextId}),t?.visibilityConfig!==void 0?{visibilityConfig:JSON.parse(JSON.stringify(t.visibilityConfig))}:{});this.commentAnnotationById$.next(f(g({},a),{[e]:c}))}catch(a){this.loggingService.catch("Error in CommentService patchLocalAnnotationContext: ",a)}}updateComment(e,t,a,i,c,m){this.loggingService.log("%c[WB] Calling FUNCTION: updateComment","color: green;");try{if(this.authService.getUser()&&this.authService.isFeatureAllowed(ke.COMMENT)){if(t&&this.setLocationToCommentAnnotation(e),e?.targetElement?.xpath){let h=this.domService.getXPath(e.targetElement.xpath);if(h){let _=h.iterateNext();_&&(pn(_)||(e.targetElement=null))}}if(e?.type==="multiThread"){let h=JSON.parse(JSON.stringify(e));if(h.position=null,h.ghostComment=null,h?.context&&this.handleDirectAccessFieldsAssignment(h.context),!h?.metadata?.documentId){h?.metadata||(h.metadata={});let S=this.docService.getBaseMetadata("multiThread");h.metadata=g(g({},h?.metadata),S)}let{documentId:_,organizationId:I}=h?.metadata||{};a?this.commonDbService.updateData({feature:"multiThread",properties:{id:h.annotationId,documentId:_,organizationId:I},data:JSON.parse(JSON.stringify(h))}):this.commonDbService.setData({feature:"multiThread",properties:{id:h.annotationId,documentId:_,organizationId:I},data:JSON.parse(JSON.stringify(h))})}else{this.setSubscribedUsersDataInCommentAnnotation(e);let h=JSON.parse(JSON.stringify(e));if(h.position=null,h.ghostComment=null,h.lastUpdated=this.timestamp,h.status||(h.status=this.customFilterService.defaultStatus),delete h.resolved,delete h.inProgress,this.setLocationFromDocumentParams(h),h?.context&&this.handleDirectAccessFieldsAssignment(h.context),h?.annotationId?.startsWith("TEMP_COMPOSER_"))return;let _=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);if(_&&JSON.parse(_).annotationId===h.annotationId&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT),h?.multiThreadAnnotationId&&!c&&this.saveMultiThreadCommentAnnotation(h).then(I=>{}),h?.comments?.length){if(delete h?.isDraft,h?.multiThreadAnnotationId&&this.draftMultiThreadCommentAnnotationsByAnnotationId$.value[h?.multiThreadAnnotationId]&&this.saveMultiThreadCommentAnnotation(h),!h?.metadata?.documentId){h?.metadata||(h.metadata={});let $=this.docService.getBaseMetadata("comment");h.metadata=g(g({},h?.metadata),$)}let{documentId:I,organizationId:S}=h?.metadata||{},H=i?g({annotationData:i?.commentAnnotation,targetAnnotationData:i?.targetComment,actionType:i?.actionType,notificationSource:"comment"},i?.otherFields||{}):null;this.viewsService?.updateCommentAnnotationViews(h),this.commonDbService.setData({feature:"comment",properties:{id:h.annotationId,documentId:I,targetCommentId:m?.commentId,organizationId:S,metadata:{apiKey:this.configService.getApiKey(),organizationId:S,veltFolderId:h?.metadata?.veltFolderId,documentId:I}},extraData:H,data:JSON.parse(JSON.stringify(h)),callback:$=>Ae(this,null,function*(){if(i&&!$?.firestoreAvailable&&this.updateNotificationsDatabase(i.commentAnnotation,i.targetComment,i.actionType,i.otherFields||{}),this.getScreenshotEnabled()&&i?.actionType===Ze.NEWLY_ADDED&&this.captureScreenshot(e),i?.actionType===Ze.NEWLY_ADDED||i?.actionType===Ze.ADDED)try{let j=yield this.metadataService.getGlobalMetadata(),Z={annotationId:h.annotationId,commentAnnotation:this.getCommentAnnotationForClient(h),metadata:j};this.commentActionsService?.triggerAction(lt.COMMENT_SAVED,Z)}catch(j){this.loggingService.catch("Error triggering commentSaved event: ",j)}})})}else this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e.annotationId]:h}))}}}catch(h){this.loggingService.catch("Error in CommentService updateComment: ",h)}}captureScreenshot(e){return Ae(this,null,function*(){try{if(this.getScreenshotEnabled()){let a=np(this.functions,rp({url:this.endpointsService.getCloudFunctionUrl("screenshot"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:12e5}),i,c={source:"velt",sourceData:{commentAnnotation:e},eventType:"screenshot"};e?.areaAnnotationId&&(i=this.areaService?.getAnnotationById(e?.areaAnnotationId),i&&(c.sourceData||(c.sourceData={}),c.sourceData.areaAnnotation=i));let m=yield Sb(c,this.authService.getUser()?.userId??"");yield a({veltData:m})}}catch(t){this.loggingService.catch("Error in CommentService captureScreenshot: ",t)}})}getDocumentIdAndOrganizationIdFromCommentAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIdAndOrganizationIdFromCommentAnnotation: ",t),{}}}getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation: ",t),{}}}setLocationFromDocumentParams(e){e?.documentParams&&(e.location=e.documentParams,delete e.documentParams),e?.documentParamsId&&(e.locationId=e.documentParamsId,delete e.documentParamsId)}deleteCommentPinAnnotations(e){return new Promise((t,a)=>Ae(this,null,function*(){try{let i=this.domService.getSelectedAnnotationsMap(),c=this.authService.getUser(),m=[];Object.keys(i).forEach(h=>{let _=i[h];["tag","recorder","rewriter","arrow","area","multiThread"].includes(_.type)||c&&_.from&&(c?.isAdmin||_.from.userId===c.userId)&&m.push(_)}),m?.length?(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_DELETE_TRIGGERED,{triggerType:e,annotationId:m.map(h=>h.annotationId).join(),commentMode:this.getCommentMode()}),this.dialog.open(Yc,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:{title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"}}).afterClosed().pipe(Jn(1)).subscribe(h=>{try{h?(m.forEach(_=>Ae(this,null,function*(){yield this.deleteCommentPinAnnotation(_)})),setTimeout(()=>{document.querySelectorAll(`[${X.SNIPPYLY_HIGHLIGHT}]`).forEach(I=>{this.domService.removeHighlightFromElement(I)}),t()},100)):t()}catch(_){a(_)}},h=>{a(h)})):t(),this.domService.resetSelectedAnnotationsMap(!0,"comment")}catch(i){this.loggingService.catch("Error in CommentService deleteCommentPinAnnotations: ",i),a(i)}}))}deleteCommentPinAnnotation(e,t){return Ae(this,null,function*(){try{if(setTimeout(()=>{if(!this.draftConfirmationPendingAnnotationIds?.has(e?.annotationId)&&this.draftCommentAnnotationsByAnnotationId$?.value?.[e.annotationId]){let a=this.draftCommentAnnotationsByAnnotationId$.value;delete a[e.annotationId],this.draftCommentAnnotationsByAnnotationId$.next(a)}},50),e?.annotationId&&this.pendingAddCommentAnnotationData.delete(e.annotationId),this.authService.isFeatureAllowed(ke.COMMENT))if((t||e.comments?.length)&&this.updateNotificationsDatabase(e,null,Ze.DELETED),e.comments?.forEach(a=>{a.reactionAnnotationIds&&a.reactionAnnotationIds.forEach(i=>{this.deleteReaction(i)})}),e?.annotationId){this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_DELETED,{annotationId:e.annotationId,commentType:this.getCommentType(e),commentMode:this.getCommentMode()});let a=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);a&&JSON.parse(a).annotationId===e.annotationId&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT),this.areaService?.onDeleteTargetAnnotation(e?.annotationId,e?.areaAnnotationId);let i={type:"delete",annotation:null,targetAnnotationId:e.annotationId};this.commentUpdated$.next(i),e?.multiThreadAnnotationId&&(yield this.removeCommentAnnotationFromMultiThread(e)),this.commentAnnotationDeleted$.next(e);let{documentId:c,organizationId:m}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(e);if(e?.isDraft)return Promise.resolve();{let h={annotationData:e,targetAnnotationData:null,actionType:Ze.DELETED,notificationSource:"comment",isAnnotationDelete:!0};return this.commonDbService.deleteData({feature:"comment",properties:{id:e.annotationId,documentId:c,organizationId:m,metadata:{apiKey:this.configService.getApiKey(),organizationId:m,veltFolderId:e?.metadata?.veltFolderId,documentId:c}},extraData:h})}}else return Promise.resolve();return Promise.resolve()}catch(a){return this.loggingService.catch("Error in CommentService deleteCommentPinAnnotation: ",a),Promise.resolve()}})}removeCommentAnnotationFromMultiThread(e){return Ae(this,null,function*(){try{let t=e?.multiThreadAnnotationId;if(t){let a=this.docService.getDocumentPaths(),i=this.getMultiThreadAnnotationById(t);if(!i){let _=e?.metadata?.documentId||a?.documentId,I=e?.metadata?.organizationId||a?.organizationId;i=yield this.commonDbService?.getData({feature:"multiThread",properties:{documentId:_,organizationId:I,id:t}})}let c=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value?.[t];i&&delete i?.commentAnnotations?.[e.annotationId],c&&(delete c?.commentAnnotations?.[e.annotationId],Object.keys(c?.commentAnnotations||{}).length===0&&(delete this.draftMultiThreadCommentAnnotationsByAnnotationId$.value?.[t],this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(this.draftMultiThreadCommentAnnotationsByAnnotationId$.value))),delete i.commentAnnotationsMap;let{documentId:m,organizationId:h}=this.getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation(i);return Object.keys(i?.commentAnnotations||{}).length===0?(this.areaService?.onDeleteTargetAnnotation(i?.annotationId,i?.areaAnnotationId),this.multiThreadCommentAnnotationDeleted$.next(i),this.commonDbService.deleteData({feature:"multiThread",properties:{id:i?.annotationId,documentId:m,organizationId:h}})):this.commonDbService.setData({feature:"multiThread",properties:{id:i?.annotationId,documentId:m,organizationId:h},data:JSON.parse(JSON.stringify(i))})}}catch(t){this.loggingService.catch("Error in CommentService removeCommentAnnotationFromMultiThread: ",t)}})}getAnnotationById(e,t){try{let a=this.commentAnnotationById$.value?.[e]||this.draftCommentAnnotationsByAnnotationId$?.value?.[e];if(a){let{documentId:i,organizationId:c}=t||{};if(i&&a.metadata?.documentId!==i||c&&a.metadata?.organizationId!==c)return}return a}catch(a){this.loggingService.catch("Error in CommentService getAnnotationById: ",a);return}}getBaseMetadataFromCommentAnnotationId(e){try{let t=this.commentAnnotationById$.value?.[e];if(t)return t.metadata}catch(t){this.loggingService.catch("Error in CommentService getBaseMetadataFromCommentAnnotationId: ",t)}}isCommentAnnotationCacheLoaded(){try{return this.commentAnnotationById$.value!=null}catch(e){return this.loggingService.catch("Error in CommentService isCommentAnnotationCacheLoaded: ",e),!1}}getMultiThreadAnnotationById(e,t){try{let a=this.multiThreadCommentAnnotationById$.value?.[e]||this.draftMultiThreadCommentAnnotationsByAnnotationId$?.value?.[e];if(a){let{documentId:i,organizationId:c}=t||{};if(i&&a.metadata?.documentId!==i||c&&a.metadata?.organizationId!==c)return}return a}catch(a){this.loggingService.catch("Error in CommentService getAnnotationById: ",a);return}}getBaseMetadataFromMultiThreadCommentAnnotationId(e){try{let t=this.multiThreadCommentAnnotationById$.value?.[e];if(t)return t.metadata}catch(t){this.loggingService.catch("Error in CommentService getBaseMetadataFromMultiThreadCommentAnnotationId: ",t)}}getElementRefByAnnotationId(e){try{let t=this.getAnnotationById(e);if(t){let a=t?.targetElement?.xpath;if(a)return{xpath:a}}return}catch(t){this.loggingService.catch("Error in CommentService getElementRefByAnnotationId: ",t);return}}scrollToCommentByAnnotationId(e){try{let t=this.getAnnotationById(e),a=document.getElementById(`comment-pin-container-${e}`);a||(a=document.querySelector(`[data-velt-id='${e}']`)),a||(a=document.querySelector(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.ANNOTATION_ID}="${e}"]`)),a&&(a.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),t&&(this.domService.getSelectedAnnotationsMap()[e]||this.domService.toggleAnnotationSelection(t)))}catch(t){this.loggingService.catch("Error in CommentService scrollToCommentByAnnotationId: ",t)}}selectCommentByAnnotationId(e,t){try{this.loggingService.log("%c[WB] Calling FUNCTION: selectCommentByAnnotationId","color: green;");let a=e?this.getAnnotationById(e):void 0;a?this.domService.toggleAnnotationSelection(a,void 0,void 0,!0):this.domService.resetSelectedAnnotationsMap()}catch(a){this.loggingService.catch("Error in CommentService selectCommentByAnnotationId: ",a)}}enableAddCommentMode(){try{this.authService.isFeatureAllowed(ke.COMMENT)?!this.authService.isPlanExpired()&&this.iamService.hasRoleAny([$v.ADMIN,$v.COMMENTER])?(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ADD_MODE_ENABLED,{commentMode:this.getCommentMode()}),this.addCommentMode$.next(!0)):this.loggingService.catch("Error in CommentService enableAddCommentMode: ","User is not allowed to add comment."):this.loggingService.catch("Error in CommentService enableAddCommentMode: ","Comment feature is not enabled.")}catch(e){this.loggingService.catch("Error in CommentService enableAddCommentMode: ",e)}}disableAddCommentMode(){this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ADD_MODE_DISABLED,{commentMode:this.getCommentMode()}),this.addCommentMode$.next(!1)}addCommentModeChange(){return this.addCommentMode$.asObservable()}setFreeStyleCommentContext(e){try{this.freeStyleCommentContext=e}catch(t){this.loggingService.catch("Error in CommentService setFreeStyleCommentContext: ",t)}}clearFreeStyleCommentContext(){try{this.freeStyleCommentContext=void 0}catch(e){this.loggingService.catch("Error in CommentService resetFreeStyleCommentContext: ",e)}}enablePersistentCommentMode(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{persistentCommentMode:!0}}),this.persistentCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePersistentCommentMode: ",e)}}enableDeleteReplyConfirmation(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteReplyConfirmation:!0}}),this.deleteReplyConfirmation$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteReplyConfirmation: ",e)}}enableSeenByUsers(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{seenByUsers:!0}}),this.seenByUsers$.value===!0)return;this.seenByUsers$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSeenByUsers: ",e)}}disableSeenByUsers(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{seenByUsers:!1}}),this.seenByUsers$.value===!1)return;this.seenByUsers$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSeenByUsers: ",e)}}getSeenByUsers$(){return this.seenByUsers$.asObservable()}disableDeleteReplyConfirmation(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteReplyConfirmation:!1}}),this.deleteReplyConfirmation$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteReplyConfirmation: ",e)}}disablePersistentCommentMode(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{persistentCommentMode:!1}}),this.persistentCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePersistentCommentMode: ",e)}}persistentCommentModeChange(){return this.persistentCommentMode$.asObservable()}enablePersistentModeBanner(){this.persistentModeBanner$.next(!0)}disablePersistentModeBanner(){this.persistentModeBanner$.next(!1)}persistentModeBannerChange(){return this.persistentModeBanner$.asObservable()}setAssignToType(e){try{this.assignToType$.next(e.type)}catch(t){this.loggingService.catch("Error in CommentService setAssignToType: ",t)}}getAssignToType$(){return this.assignToType$.asObservable()}getAssignToType(){return this.assignToType$.value}setPageModeComposerContext(e){try{this.pageModeComposerContext$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setPageModeComposerContext: ",t)}}clearPageModeComposerContext(){try{this.pageModeComposerContext$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearPageModeComposerContext: ",e)}}getPageModeComposerContext$(){return this.pageModeComposerContext$.asObservable()}getPageModeComposerContext(){return this.pageModeComposerContext$.value}enableContextInPageModeComposer(){try{this.contextInPageModeComposer$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableContextInPageModeComposer: ",e)}}disableContextInPageModeComposer(){try{this.contextInPageModeComposer$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableContextInPageModeComposer: ",e)}}getContextInPageModeComposer$(){return this.contextInPageModeComposer$.asObservable()}getContextInPageModeComposer(){return this.contextInPageModeComposer$.value}focusPageModeComposer(){try{this.focusPageModeComposer$.next()}catch(e){this.loggingService.catch("Error in CommentService focusPageModeComposer: ",e)}}getFocusPageModeComposer$(){return this.focusPageModeComposer$.asObservable()}showCommentIndex(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentIndex:e}}),this.showCommentIndex$.value===e)return;this.showCommentIndex$.next(e)}catch(t){this.loggingService.catch("Error in CommentService showCommentIndex: ",t)}}getShowCommentIndex(){return this.showCommentIndex$.asObservable()}enablePopoverMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverMode:!0}}),this.popoverMode$.value===!0)return;this.popoverMode$.next(!0),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_POPOVER_MODE_ENABLED,{commentMode:this.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentService enablePopoverMode: ",e)}}disablePopoverMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverMode:!1}}),this.popoverMode$.value===!1)return;this.popoverMode$.next(!1),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_POPOVER_MODE_DISABLED,{commentMode:this.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentService disablePopoverMode: ",e)}}getPopoverMode(){try{return this.popoverMode$.value}catch(e){return this.loggingService.catch("Error in CommentService getPopoverMode: ",e),!1}}getPopoverMode$(){return this.popoverMode$.asObservable()}enablePopoverTriangleComponent(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverTriangleComponent:!0}}),this.popoverTriangleComponent$.value===!0)return;this.popoverTriangleComponent$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePopoverTriangleComponent: ",e)}}disablePopoverTriangleComponent(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverTriangleComponent:!1}}),this.popoverTriangleComponent$.value===!1)return;this.popoverTriangleComponent$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePopoverTriangleComponent: ",e)}}getPopoverTriangleComponent(){try{return this.popoverTriangleComponent$.value}catch(e){return this.loggingService.catch("Error in CommentService getPopoverTriangleComponent: ",e),!1}}getPopoverTriangleComponent$(){return this.popoverTriangleComponent$.asObservable()}enableDraftMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftMode:!0}}),this.draftMode$.value===!0)return;this.draftMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDraftMode: ",e)}}disableDraftMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftMode:!1}}),this.draftMode$.value===!1)return;this.draftMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDraftMode: ",e)}}getDraftMode$(){return this.draftMode$.asObservable()}getDraftMode(){return this.draftMode$.value}enableDraftConfirmation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftConfirmation:!0}}),this.draftConfirmation$.value===!0)return;this.draftConfirmation$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDraftConfirmation: ",e)}}disableDraftConfirmation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftConfirmation:!1}}),this.draftConfirmation$.value===!1)return;this.draftConfirmation$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDraftConfirmation: ",e)}}getDraftConfirmation$(){return this.draftConfirmation$.asObservable()}getDraftConfirmation(){return this.draftConfirmation$.value}enableTextComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textMode:!0}}),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_TEXT_MODE_ENABLED,{commentMode:this.getCommentMode()}),this.textCommentMode$.value===!0)return;this.textCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextComments: ",e)}}disableTextComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textMode:!1}}),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_TEXT_MODE_DISABLED,{commentMode:this.getCommentMode()}),this.textCommentMode$.value===!1)return;this.textCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextComments: ",e)}}getTextCommentMode$(){return this.textCommentMode$.asObservable()}isUserGlobalContact$(){return this.contactService.isUserGlobalContact$()}isSidebarOpenedByCustomTrigger(){try{return this.sidebarOpenedByCustomTrigger$.value}catch(e){return this.loggingService.catch("Error in CommentService isSidebarOpenedByCustomTrigger: ",e),!1}}setSidebarVisibility(e,t=!1,a=!1){try{this.domService.resetSelectedAnnotationsMap(),e?(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR_V2)||document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR)?this.sidebarVisible$.next(e):this.loggingService.catch("Error in CommentService setSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> or <${X.TAGS.VELT_COMMENTS_SIDEBAR_V2}> tag is not added.`),t&&this.sidebarOpenedByCustomTrigger$.next(!0)):(!this.sidebarOpenedByCustomTrigger$.value||t||a)&&(this.sidebarVisible$.next(e),this.sidebarOpenedByCustomTrigger$.next(!1),this.clearPageModeComposerContext()),e?this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_SIDEBAR_OPENED,{commentMode:this.getCommentMode()}):this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_SIDEBAR_CLOSED,{commentMode:this.getCommentMode()})}catch{this.loggingService.catch("Error in CommentService setSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> tag is not added.`)}}toggleSidebarVisibility(e=!1,t=!1){try{this.domService.resetSelectedAnnotationsMap(),this.sidebarVisible$.value?(!this.sidebarOpenedByCustomTrigger$.value||e||t)&&(this.sidebarVisible$.next(!this.sidebarVisible$.value),this.sidebarOpenedByCustomTrigger$.next(!1),this.sidebarVisible$.value||this.clearPageModeComposerContext()):(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR_V2)||document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR)?(this.sidebarVisible$.next(!this.sidebarVisible$.value),this.sidebarVisible$.value?this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_SIDEBAR_TOGGLED,{commentMode:this.getCommentMode(),action:"closed"}):this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_SIDEBAR_TOGGLED,{commentMode:this.getCommentMode(),action:"opened"})):this.loggingService.catch("Error in CommentService toggleSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> or <${X.TAGS.VELT_COMMENTS_SIDEBAR_V2}> tag is not added.`),e&&this.sidebarOpenedByCustomTrigger$.next(!0))}catch{this.loggingService.catch("Error in CommentService toggleSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> tag is not added.`)}}getSidebarVisibility$(){return this.sidebarVisible$.asObservable()}disableFloatingComments(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{floatingCommentDialog:!e}}),this.floatingCommentsEnabled$.value===!e)return;this.floatingCommentsEnabled$.next(!e)}catch(t){this.loggingService.catch("Error in CommentService disableFloatingComments: ",t)}}showFloatingComments$(){return this.floatingCommentsEnabled$.asObservable()}showFloatingComments(){return this.floatingCommentsEnabled$.value}setModeratorMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{moderatorMode:e}}),this.moderatorMode$.value===e)return;this.moderatorMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setModeratorMode: ",t)}}getModeratorMode(){return this.moderatorMode$.value}getModeratorMode$(){return this.moderatorMode$.asObservable()}setStreamMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{streamMode:e}}),this.streamMode$.value===e)return;this.streamMode$.next(e),e?this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_STREAM_MODE_ENABLED,{commentMode:this.getCommentMode()}):this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_STREAM_MODE_DISABLED,{commentMode:this.getCommentMode()})}catch(t){this.loggingService.catch("Error in CommentService setStreamMode: ",t)}}getStreamMode(){return this.streamMode$.value}getStreamMode$(){return this.streamMode$.asObservable()}getEnableDialogOnHover(){return this.enableDialogOnHover$.value}getEnableDialogOnHover$(){return this.enableDialogOnHover$.asObservable()}setEnableDialogOnHover(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogOnHover:e}}),this.enableDialogOnHover$.value===e)return;this.enableDialogOnHover$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableDialogOnHover: ",t)}}getEnableDialogOnTargetElementClick(){return this.enableDialogOnTargetElementClick$.value}getEnableDialogOnTargetElementClick$(){return this.enableDialogOnTargetElementClick$.asObservable()}setEnableDialogOnTargetElementClick(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogOnTargetElementClick:e}}),this.enableDialogOnTargetElementClick$.value===e)return;this.enableDialogOnTargetElementClick$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableDialogOnTargetElementClick: ",t)}}getEnablePriority(){return this.enablePriority$.value}getEnablePriority$(){return this.enablePriority$.asObservable()}setEnablePriority(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{priority:e}}),this.enablePriority$.value===e)return;this.enablePriority$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnablePriority: ",t)}}getEnableStatus(){return this.enableStatus$.value}getEnableStatus$(){return this.enableStatus$.asObservable()}setEnableStatus(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{status:e}}),this.getEnableStatus()===e)return;this.enableStatus$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableStatus: ",t)}}getEnableVisibilityOptions(){return this.visibilityOptions$.value}getEnableVisibilityOptions$(){return this.visibilityOptions$.asObservable()}setEnableVisibilityOptions(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{visibilityOptions:e}}),this.visibilityOptions$.value===e)return;this.visibilityOptions$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableVisibilityOptions: ",t)}}getEnableResolve(){return this.enableResolve$.value}getEnableResolve$(){return this.enableResolve$.asObservable()}setEnableResolve(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveButton:e}}),this.getEnableResolve()===e)return;this.enableResolve$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableResolve: ",t)}}getEnableGhostComments(){return this.enableGhostComments$.value}getEnableGhostComments$(){return this.enableGhostComments$.asObservable()}enableGhostComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostComments:!0}}),this.enableGhostComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableGhostComments: ",e)}}disableGhostComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostComments:!1}}),this.enableGhostComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableGhostComments: ",e)}}getEnableGhostCommentsMessage(){return this.enableGhostCommentsMessage$.value}getEnableGhostCommentsMessage$(){return this.enableGhostCommentsMessage$.asObservable()}enableGhostCommentsMessage(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostCommentsIndicator:!0}}),this.enableGhostCommentsMessage$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowGhostCommentsMessage: ",e)}}disableGhostCommentsMessage(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostCommentsIndicator:!1}}),this.enableGhostCommentsMessage$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowGhostCommentsMessage: ",e)}}enableInboxMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inboxMode:!0}}),this.inboxMode$.value===!0)return;this.inboxMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableInboxMode: ",e)}}disableInboxMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inboxMode:!1}}),this.inboxMode$.value===!1)return;this.inboxMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableInboxMode: ",e)}}getInboxMode(){return this.inboxMode$.value}getInboxMode$(){return this.inboxMode$.asObservable()}setEnableAutoCategorize(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{autoCategorize:e}}),this.enableAutoCategorize$.value===e)return;this.enableAutoCategorize$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableAutoCategorize: ",t)}}getEnableAutoCategorize(){return this.enableAutoCategorize$.value}getEnableAutoCategorize$(){return this.enableAutoCategorize$.asObservable()}setCommentContainerDarkMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{darkMode:e}}),this.commentContainerDarkMode$.value===e)return;this.commentContainerDarkMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentContainerDarkMode: ",t)}}getCommentContainerDarkMode(){return this.commentContainerDarkMode$.asObservable()}getSuggestionMode(){return this.suggestionMode$.value}getSuggestionMode$(){return this.suggestionMode$.asObservable()}setSuggestionMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{suggestionMode:e}}),this.getSuggestionMode()===e)return;this.suggestionMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setSuggestionMode: ",t)}}getMobileMode(){return this.mobileMode$.value}getMobileMode$(){return this.mobileMode$.asObservable()}setMobileMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{mobileMode:e}}),this.getMobileMode()===e)return;this.mobileMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setMobileMode: ",t)}}enableInlineCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inlineCommentMode:!0}}),this.inlineCommentMode$.value===!0)return;this.inlineCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableInlineCommentMode: ",e)}}disableInlineCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inlineCommentMode:!1}}),this.inlineCommentMode$.value===!1)return;this.inlineCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableInlineCommentMode: ",e)}}getInlineCommentMode(){return this.inlineCommentMode$.value}getInlineCommentMode$(){return this.inlineCommentMode$.asObservable()}enableMinimap(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{minimap:!0}}),this.minimap$.value===!0)return;this.minimap$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableMinimap: ",e)}}disableMinimap(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{minimap:!1}}),this.minimap$.value===!1)return;this.minimap$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableMinimap: ",e)}}getMinimap(){return this.minimap$.value}getMinimap$(){return this.minimap$.asObservable()}showCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentsOnDom:!0}}),this.commentsOnDom$.value===!0)return;this.commentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService showCommentsOnDom: ",e)}}hideCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentsOnDom:!1}}),this.commentsOnDom$.value===!1)return;this.commentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService hideCommentsOnDom: ",e)}}getCommentsOnDom(){return this.commentsOnDom$.value}getCommentsOnDom$(){return this.commentsOnDom$.asObservable()}enableCommentTool(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentTool:!0}}),this.commentToolEnabled$.value===!0)return;this.commentToolEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCommentTool: ",e)}}disableCommentTool(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentTool:!1}}),this.commentToolEnabled$.value===!1)return;this.commentToolEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCommentTool: ",e)}}getCommentTool(){return this.commentToolEnabled$.value}getCommentTool$(){return this.commentToolEnabled$.asObservable()}setTotalMediaLength(e){try{if(this.totalMediaLength$.value===e)return;this.totalMediaLength$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setTotalMediaLength: ",t)}}getTotalMediaLength(){return this.totalMediaLength$.value}getTotalMediaLength$(){return this.totalMediaLength$.asObservable()}enableSidebarUrlNavigation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarUrlNavigation:!0}}),this.sidebarUrlNavigationEnabled$.value===!0)return;this.sidebarUrlNavigationEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarUrlNavigation: ",e)}}disableSidebarUrlNavigation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarUrlNavigation:!1}}),this.sidebarUrlNavigationEnabled$.value===!1)return;this.sidebarUrlNavigationEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarUrlNavigation: ",e)}}getSidebarUrlNavigation(){return this.sidebarUrlNavigationEnabled$.value}getSidebarUrlNavigation$(){return this.sidebarUrlNavigationEnabled$.asObservable()}setDetectionStrategy(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{detectionStrategy:e}}),this.detectionStrategy$.value===e)return;this.detectionStrategy$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setDetectionStrategy: ",t)}}getDetectionStrategy(){return this.detectionStrategy$.value}getDetectionStrategy$(){return this.detectionStrategy$.asObservable()}enableSidebarButtonOnCommentDialog(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonOnCommentDialog:!0}}),this.sidebarButtonOnCommentDialogVisible$.value===!0)return;this.sidebarButtonOnCommentDialogVisible$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarButtonOnCommentDialog: ",e)}}disableSidebarButtonOnCommentDialog(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonOnCommentDialog:!1}}),this.sidebarButtonOnCommentDialogVisible$.value===!1)return;this.sidebarButtonOnCommentDialogVisible$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarButtonOnCommentDialog: ",e)}}getSidebarButtonOnCommentDialogVisibility(){return this.sidebarButtonOnCommentDialogVisible$.value}getSidebarButtonOnCommentDialogVisibility$(){return this.sidebarButtonOnCommentDialogVisible$.asObservable()}onSidebarButtonOnCommentDialogClick(){this.sidebarButtonOnCommentDialogClick$.next()}getSidebarButtonOnCommentDialogClick$(){return this.sidebarButtonOnCommentDialogClick$.asObservable()}enableDeviceIndicatorOnCommentPins(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceIndicatorOnCommentPins:!0}}),this.deviceIndicatorOnCommentPins$.value===!0)return;this.deviceIndicatorOnCommentPins$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeviceIndicatorOnCommentPins: ",e)}}disableDeviceIndicatorOnCommentPins(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceIndicatorOnCommentPins:!1}}),this.deviceIndicatorOnCommentPins$.value===!1)return;this.deviceIndicatorOnCommentPins$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeviceIndicatorOnCommentPins: ",e)}}getDeviceIndicatorOnCommentPins(){return this.deviceIndicatorOnCommentPins$.value}getDeviceIndicatorOnCommentPins$(){return this.deviceIndicatorOnCommentPins$.asObservable()}onSidebarCommentClick(e){this.sidebarCommentClick$.next(e)}getSidebarCommentClick$(){return this.sidebarCommentClick$.asObservable()}onCommentNavigationButtonClick(e){this.commentNavigationButtonClick$.next(e)}getCommentNavigationButtonClick$(){return this.commentNavigationButtonClick$.asObservable()}addBubbleCommentAnnotationIds(e){try{let a=[...this.bubbleCommentAnnotationIds$.value||[],...e],i=[...new Set(a)];this.bubbleCommentAnnotationIds$.next(i)}catch(t){this.loggingService.catch("Error in CommentService addBubbleCommentAnnotationIds: ",t)}}getBubbleCommentAnnotationIds(){return this.bubbleCommentAnnotationIds$.value}getBubbleCommentAnnotationIds$(){return this.bubbleCommentAnnotationIds$.asObservable()}removeBubbleCommentAnnotationIds(e){try{let a=(this.bubbleCommentAnnotationIds$.value||[]).filter(i=>!e.includes(i));this.bubbleCommentAnnotationIds$.next(a)}catch(t){this.loggingService.catch("Error in CommentService removeBubbleCommentAnnotationIds: ",t)}}enableSignInButton(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{signInButton:e}}),this.enableSignInButton$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableSignInButton: ",t)}}getSignInButton(){return this.enableSignInButton$.value}getSignInButton$(){return this.enableSignInButton$.asObservable()}onSignInClick(){this.onSignInClick$.next()}getSignInButtonClick$(){return this.onSignInClick$.asObservable()}enableUpgradeButton(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{upgradeButton:e}}),this.enableUpgradeButton$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableUpgradeButton: ",t)}}getUpgradeButton(){return this.enableUpgradeButton$.value}getUpgradeButton$(){return this.enableUpgradeButton$.asObservable()}onUpgradeClick(){this.onUpgradeClick$.next()}getUpgradeButtonClick$(){return this.onUpgradeClick$.asObservable()}openSidebar(){this.openSidebar$.next()}getOpenSidebar$(){return this.openSidebar$.asObservable()}enableAttachment(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachments:e}}),this.enableAttachment$.value===e)return;this.enableAttachment$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableAttachment: ",t)}}getEnableAttachment$(){return this.enableAttachment$.asObservable()}enableAttachmentDownload(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentDownload:!0}}),this.enableAttachmentDownload$.value===!0)return;this.enableAttachmentDownload$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAttachmentDownload: ",e)}}disableAttachmentDownload(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentDownload:!1}}),this.enableAttachmentDownload$.value===!1)return;this.enableAttachmentDownload$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAttachmentDownload: ",e)}}getEnableAttachmentDownload$(){return this.enableAttachmentDownload$.asObservable()}getEnableAttachmentDownload(){return this.enableAttachmentDownload$.value}enableFormatOptions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatOptions:!0}}),this.enableFormatOptions$.value===!0)return;this.enableFormatOptions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFormatOptions: ",e)}}disableFormatOptions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatOptions:!1}}),this.enableFormatOptions$.value===!1)return;this.enableFormatOptions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFormatOptions: ",e)}}getEnableFormatOptions$(){return this.enableFormatOptions$.asObservable()}setFormatConfig(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatConfig:e}}),this.formatConfig$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setFormatConfig: ",t)}}getFormatConfig$(){return this.formatConfig$.asObservable()}setAllowedRecordings(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordings:e}}),e?.includes("all")?this.allowedRecordings$.next(["audio","video","screen"]):e?.includes("none")?this.allowedRecordings$.next([]):this.allowedRecordings$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setAllowedRecordings: ",t)}}getAllowedRecordings(){return this.allowedRecordings$.value}getAllowedRecordings$(){return this.allowedRecordings$.asObservable()}enableReactions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{reactions:!0}}),this.enableReactions$.value===!0)return;this.enableReactions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReactions: ",e)}}disableReactions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{reactions:!1}}),this.enableReactions$.value===!1)return;this.enableReactions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReactions: ",e)}}getEnableReactions(){return this.enableReactions$.value}getEnableReactions$(){return this.enableReactions$.asObservable()}enableAnonymousEmail(){try{if(this.enableAnonymousEmail$.value===!0)return;this.enableAnonymousEmail$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAnonymousEmail: ",e)}}disableAnonymousEmail(){try{if(this.enableAnonymousEmail$.value===!1)return;this.enableAnonymousEmail$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAnonymousEmail: ",e)}}getEnableAnonymousEmail(){return this.enableAnonymousEmail$.value}getEnableAnonymousEmail$(){return this.enableAnonymousEmail$.asObservable()}addCommentOnElement(e){this.addComment(void 0,void 0,void 0,e)}enablePrivateCommentMode(){return Ae(this,null,function*(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateCommentMode:!0}}),this.privateCommentMode$.value===!0)return;this.isPrivateCommentAllowed$().pipe(Jn(1)).subscribe(e=>{e?(this.privateCommentMode$.next(!0),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_PRIVATE_COMMENT_MODE_ENABLED)):this.loggingService.logsEnabled&&console.warn("You are not allowed to enable private comment mode.")})}catch(e){this.loggingService.catch("Error in CommentService enablePrivateCommentMode: ",e)}})}disablePrivateCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateCommentMode:!1}}),this.privateCommentMode$.value===!1)return;this.privateCommentMode$.next(!1),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_PRIVATE_COMMENT_MODE_DISABLED)}catch(e){this.loggingService.catch("Error in CommentService disablePrivateCommentMode: ",e)}}getPrivateCommentMode(){return this.privateCommentMode$.value}getPrivateCommentMode$(){return this.privateCommentMode$.asObservable()}isPrivateCommentAllowed(){return this.privateCommentAllowed$.value}isPrivateCommentAllowed$(){return this.privateCommentAllowed$.asObservable()}enablePrivateMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateModeConfig:e}}),!e?.type){this.loggingService.catch("enablePrivateMode: type is required in config");return}this.privateModeConfig$.next(g({},e))}catch(t){this.loggingService.catch("Error in CommentService enablePrivateMode: ",t)}}disablePrivateMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateModeConfig:null}}),this.privateModeConfig$.value===null)return;this.privateModeConfig$.next(null)}catch(e){this.loggingService.catch("Error in CommentService disablePrivateMode: ",e)}}getPrivateModeConfig(){return this.privateModeConfig$.value}getPrivateModeConfig$(){return this.privateModeConfig$.asObservable()}enableScrollToComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{scrollToComment:!0}}),this.scrollToComment$.value===!0)return;this.scrollToComment$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableScrollToComment: ",e)}}disableScrollToComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{scrollToComment:!1}}),this.scrollToComment$.value===!1)return;this.scrollToComment$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableScrollToComment: ",e)}}getScrollToComment(){return this.scrollToComment$.value}getScrollToComment$(){return this.scrollToComment$.asObservable()}showScreenSizeInfo(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceInfo:e}}),this.showScreenSizeInfo$.value===e)return;this.showScreenSizeInfo$.next(e)}catch(t){this.loggingService.catch("Error in CommentService showScreenSizeInfo: ",t)}}getShowScreenSizeInfo$(){return this.showScreenSizeInfo$.asObservable()}enableUserMentions(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableUserMentions","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{userMentions:!0}}),this.userMentions$.value===!0)return;this.userMentions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableUserMentions: ",e)}}disableUserMentions(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableUserMentions","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{userMentions:!1}}),this.userMentions$.value===!1)return;this.userMentions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableUserMentions: ",e)}}getUserMentions(){return this.userMentions$.value}getUserMentions$(){return this.userMentions$.asObservable()}enablePaginatedContactList(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePaginatedContactList","color: green;"),this.paginatedContactList$.value===!0)return;this.paginatedContactList$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePaginatedContactList: ",e)}}disablePaginatedContactList(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePaginatedContactList","color: green;"),this.paginatedContactList$.value===!1)return;this.paginatedContactList$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePaginatedContactList: ",e)}}getPaginatedContactList(){return this.paginatedContactList$.value}getPaginatedContactList$(){return this.paginatedContactList$.asObservable()}enableDeleteOnBackspace(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDeleteOnBackspace","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteOnBackspace:!0}}),this.deleteOnBackspace$.value===!0)return;this.deleteOnBackspace$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteOnBackspace: ",e)}}disableDeleteOnBackspace(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDeleteOnBackspace","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteOnBackspace:!1}}),this.deleteOnBackspace$.value===!1)return;this.deleteOnBackspace$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteOnBackspace: ",e)}}getDeleteOnBackspace(){return this.deleteOnBackspace$.value}getDeleteOnBackspace$(){return this.deleteOnBackspace$.asObservable()}enableHotkey(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableHotkey","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{hotkey:!0}}),this.hotkeyEnabled$.value===!0)return;this.hotkeyEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableHotkey: ",e)}}disableHotkey(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableHotkey","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{hotkey:!1}}),this.hotkeyEnabled$.value===!1)return;this.hotkeyEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableHotkey: ",e)}}enableRecordingSummary(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableRecordingSummary","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingSummary:!0}}),this.recordingSummaryEnabled$.value===!0)return;this.recordingSummaryEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableRecordingSummary: ",e)}}disableRecordingSummary(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableRecordingSummary","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingSummary:!1}}),this.recordingSummaryEnabled$.value===!1)return;this.recordingSummaryEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableRecordingSummary: ",e)}}getRecordingSummaryEnabled(){return this.recordingSummaryEnabled$.value}getRecordingSummaryEnabled$(){return this.recordingSummaryEnabled$.asObservable()}setUnreadIndicatorMode(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: setUnreadIndicatorMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{unreadIndicatorMode:e}}),this.unreadIndicatorMode$.value===e)return;this.unreadIndicatorMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setUnreadIndicatorMode: ",t)}}getUnreadIndicatorMode(){return this.unreadIndicatorMode$.value}getUnreadIndicatorMode$(){return this.unreadIndicatorMode$.asObservable()}setComposerMode(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: setComposerMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{composerMode:e}}),this.composerMode$.value===e)return;this.composerMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setComposerMode: ",t)}}getComposerMode(){return this.composerMode$.value}getComposerMode$(){return this.composerMode$.asObservable()}enableEnterKeyToSubmit(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableEnterKeyToSubmit","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{enterKeyToSubmit:!0}}),this.enterKeyToSubmit$.value===!0)return;this.enterKeyToSubmit$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableEnterKeyToSubmit: ",e)}}disableEnterKeyToSubmit(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableEnterKeyToSubmit","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{enterKeyToSubmit:!1}}),this.enterKeyToSubmit$.value===!1)return;this.enterKeyToSubmit$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableEnterKeyToSubmit: ",e)}}getEnterKeyToSubmit(){return this.enterKeyToSubmit$.value}getEnterKeyToSubmit$(){return this.enterKeyToSubmit$.asObservable()}enablePinShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePinShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinShadowDom:!0}}),this.pinShadowDOM$.value===!0)return;this.pinShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinShadowDOM: ",e)}}disablePinShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePinShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinShadowDom:!1}}),this.pinShadowDOM$.value===!1)return;this.pinShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinShadowDOM: ",e)}}getPinShadowDOM(){return this.pinShadowDOM$.value}getPinDarkMode(){return this.pinDarkMode$.value}getPinDarkMode$(){return this.pinDarkMode$.asObservable()}getTextCommentToolDarkMode(){return this.textCommentToolDarkMode$.value}getTextCommentToolDarkMode$(){return this.textCommentToolDarkMode$.asObservable()}getTextCommentToolbarDarkMode(){return this.textCommentToolbarDarkMode$.value}getTextCommentToolbarDarkMode$(){return this.textCommentToolbarDarkMode$.asObservable()}getPinShadowDOM$(){return this.pinShadowDOM$.asObservable()}getTextCommentToolShadowDOM$(){return this.textCommentToolShadowDOM$.asObservable()}getTextCommentToolbarShadowDOM$(){return this.textCommentToolbarShadowDOM$.asObservable()}enableDialogShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDialogShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogShadowDom:!0}}),this.dialogShadowDOM$.value===!0)return;this.dialogShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDialogShadowDOM: ",e)}}enableTextCommentToolbarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolbarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarShadowDom:!0}}),this.textCommentToolbarShadowDOM$.value===!0)return;this.textCommentToolbarShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolbarShadowDOM: ",e)}}disableTextCommentToolbarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolbarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarShadowDom:!1}}),this.textCommentToolbarShadowDOM$.value===!1)return;this.textCommentToolbarShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolbarShadowDOM: ",e)}}enableTextCommentToolShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolShadowDom:!0}}),this.textCommentToolShadowDOM$.value===!0)return;this.textCommentToolShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolShadowDOM: ",e)}}disableTextCommentToolShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolShadowDom:!1}}),this.textCommentToolShadowDOM$.value===!1)return;this.textCommentToolShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolShadowDOM: ",e)}}enableTextCommentToolDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolDarkMode:!0}}),this.textCommentToolDarkMode$.value===!0)return;this.textCommentToolDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolDarkMode: ",e)}}disableTextCommentToolDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolDarkMode:!1}}),this.textCommentToolDarkMode$.value===!1)return;this.textCommentToolDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolDarkMode: ",e)}}enableTextCommentToolbarDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolbarDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarDarkMode:!0}}),this.textCommentToolbarDarkMode$.value===!0)return;this.textCommentToolbarDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolbarDarkMode: ",e)}}disableTextCommentToolbarDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolbarDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarDarkMode:!1}}),this.textCommentToolbarDarkMode$.value===!1)return;this.textCommentToolbarDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolbarDarkMode: ",e)}}enablePinDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePinDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDarkMode:!0}}),this.pinDarkMode$.value===!0)return;this.pinDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinDarkMode: ",e)}}disablePinDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePinDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDarkMode:!1}}),this.pinDarkMode$.value===!1)return;this.pinDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinDarkMode: ",e)}}disableDialogShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDialogShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogShadowDom:!1}}),this.dialogShadowDOM$.value===!1)return;this.dialogShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDialogShadowDOM: ",e)}}getDialogShadowDOM(){return this.dialogShadowDOM$.value}getDialogShadowDOM$(){return this.dialogShadowDOM$.asObservable()}setDialogShadowDOMExplicit(e){this.dialogShadowDOMExplicit$.next(e)}getDialogShadowDOMExplicit$(){return this.dialogShadowDOMExplicit$.asObservable()}enableSidebarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableSidebarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarShadowDOM:!0}}),this.sidebarShadowDOM$.value===!0)return;this.sidebarShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarShadowDOM: ",e)}}disableSidebarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableSidebarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarShadowDOM:!1}}),this.sidebarShadowDOM$.value===!1)return;this.sidebarShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarShadowDOM: ",e)}}getSidebarShadowDOM(){return this.sidebarShadowDOM$.value}getSidebarShadowDOM$(){return this.sidebarShadowDOM$.asObservable()}enableChangeDetectionInCommentMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableChangeDetectionInCommentMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{changeDetectionInCommentMode:!0}}),this.changeDetectionInCommentMode$.value===!0)return;this.changeDetectionInCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableChangeDetectionInCommentMode: ",e)}}disableChangeDetectionInCommentMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableChangeDetectionInCommentMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{changeDetectionInCommentMode:!1}}),this.changeDetectionInCommentMode$.value===!1)return;this.changeDetectionInCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableChangeDetectionInCommentMode: ",e)}}getChangeDetectionInCommentMode(){return this.changeDetectionInCommentMode$.value}getChangeDetectionInCommentMode$(){return this.changeDetectionInCommentMode$.asObservable()}showResolvedCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolvedCommentsOnDom:!0}}),this.resolvedCommentsOnDom$.value===!0)return;this.resolvedCommentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService showResolvedCommentsOnDom: ",e)}}hideResolvedCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolvedCommentsOnDom:!1}}),this.resolvedCommentsOnDom$.value===!1)return;this.resolvedCommentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService hideResolvedCommentsOnDom: ",e)}}getResolvedCommentsOnDom(){return this.resolvedCommentsOnDom$.value}enableLazyLoadResolvedComments(){try{this.installLazyLoadResolvedCommentsProvider();let e=Xg(this.documentPaths);if(e&&this.resolvedUnlockedDocumentKey===e){this.loggingService.catch("[lazyLoadResolvedComments] enabled, but resolved comments were already unlocked this session; takes effect on the next page load.",null,void 0,!0),this.lazyLoadResolvedComments$.next(!0);return}if(this.lazyLoadResolvedComments$.value===!0)return;this.lazyLoadResolvedComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableLazyLoadResolvedComments: ",e)}}disableLazyLoadResolvedComments(){try{if(this.lazyLoadResolvedComments$.value===!1)return;this.lazyLoadResolvedComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableLazyLoadResolvedComments: ",e)}}isResolvedUnlockedForCurrentDocument(){try{let e=Xg(this.documentPaths);return!!e&&this.resolvedUnlockedDocumentKey===e}catch(e){return this.loggingService.catch("Error in CommentService isResolvedUnlockedForCurrentDocument: ",e),!0}}getLazyLoadResolvedComments(){return this.lazyLoadResolvedComments$.value}installLazyLoadResolvedCommentsProvider(){try{this.customFilterService?.setLazyLoadResolvedCommentsProvider?.(()=>this.lazyLoadResolvedComments$.value)}catch(e){this.loggingService.catch("Error in CommentService installLazyLoadResolvedCommentsProvider: ",e)}}publishResolvedIntent(e){try{this.resolvedIntentFromSidebar$.next(!!e)}catch(t){this.loggingService.catch("Error in CommentService publishResolvedIntent: ",t)}}getResolvedCommentsOnDom$(){return this.resolvedCommentsOnDom$.asObservable()}enableBubbleOnPin(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPin:!0}}),this.bubbleOnPinEnabled$.value===!0)return;this.bubbleOnPinEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableBubbleOnPin: ",e)}}disableBubbleOnPin(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPin:!1}}),this.bubbleOnPinEnabled$.value===!1)return;this.bubbleOnPinEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableBubbleOnPin: ",e)}}getBubbleOnPin(){return this.bubbleOnPinEnabled$.value}getBubbleOnPin$(){return this.bubbleOnPinEnabled$.asObservable()}enableBubbleOnPinHover(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPinHover:!0}}),this.bubbleOnPinHoverEnabled$.value===!0)return;this.bubbleOnPinHoverEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableBubbleOnPinHover: ",e)}}disableBubbleOnPinHover(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPinHover:!1}}),this.bubbleOnPinHoverEnabled$.value===!1)return;this.bubbleOnPinHoverEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableBubbleOnPinHover: ",e)}}getBubbleOnPinHover(){return this.bubbleOnPinHoverEnabled$.value}getBubbleOnPinHover$(){return this.bubbleOnPinHoverEnabled$.asObservable()}enablePinDrag(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDrag:!0}}),this.pinDragEnabled$.value===!0)return;this.pinDragEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinDrag: ",e)}}disablePinDrag(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDrag:!1}}),this.pinDragEnabled$.value===!1)return;this.pinDragEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinDrag: ",e)}}getPinDrag(){return this.pinDragEnabled$.value}getPinDrag$(){return this.pinDragEnabled$.asObservable()}setExcludeLocationIdsFromSidebar(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{excludeLocationIdsFromSidebar:e}}),this.excludeLocationIdsFromSidebar$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setExcludeLocationIdsFromSidebar: ",t)}}getExcludeLocationIdsFromSidebar(){return this.excludeLocationIdsFromSidebar$.value}getExcludeLocationIdsFromSidebar$(){return this.excludeLocationIdsFromSidebar$.asObservable()}enableMultiThread(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{multiThread:!0}}),this.multiThread$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableMultiThread: ",e)}}disableMultiThread(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{multiThread:!1}}),this.multiThread$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableMultiThread: ",e)}}getMultiThread(){return this.multiThread$.value}getMultiThread$(){return this.multiThread$.asObservable()}enableGroupMatchedComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{groupMatchedComments:!0}}),this.groupMatchedComments$.value===!0)return;this.groupMatchedComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableGroupMatchedComments: ",e)}}disableGroupMatchedComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{groupMatchedComments:!1}}),this.groupMatchedComments$.value===!1)return;this.groupMatchedComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableGroupMatchedComments: ",e)}}getGroupMatchedComments(){return this.groupMatchedComments$.value}getGroupMatchedComments$(){return this.groupMatchedComments$.asObservable()}enableRestrictTextSearchToAnchor(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{restrictTextSearchToAnchor:!0}}),this.restrictTextSearchToAnchor$.value===!0)return;this.restrictTextSearchToAnchor$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableRestrictTextSearchToAnchor: ",e)}}disableRestrictTextSearchToAnchor(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{restrictTextSearchToAnchor:!1}}),this.restrictTextSearchToAnchor$.value===!1)return;this.restrictTextSearchToAnchor$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableRestrictTextSearchToAnchor: ",e)}}getRestrictTextSearchToAnchor(){return this.restrictTextSearchToAnchor$.value}getRestrictTextSearchToAnchor$(){return this.restrictTextSearchToAnchor$.asObservable()}enableShortUserName(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableShortUserName","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{shortUserName:!0}}),this.shortUserName$.value===!0)return;this.shortUserName$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShortUserName: ",e)}}disableShortUserName(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableShortUserName","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{shortUserName:!1}}),this.shortUserName$.value===!1)return;this.shortUserName$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShortUserName: ",e)}}getShortUserName(){return this.shortUserName$.value}getShortUserName$(){return this.shortUserName$.asObservable()}enableRecordingCountdown(){try{this.loggingService.log("%c[WB] Calling FUNCTION: enableRecordingCountdown","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingCountdown:!0}}),this.serviceBook.get(dn)?.enableRecordingCountdown()}catch(e){this.loggingService.catch("Error in CommentService enableRecordingCountdown: ",e)}}disableRecordingCountdown(){try{this.loggingService.log("%c[WB] Calling FUNCTION: disableRecordingCountdown","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingCountdown:!1}}),this.serviceBook.get(dn)?.disableRecordingCountdown()}catch(e){this.loggingService.catch("Error in CommentService disableRecordingCountdown: ",e)}}setCommentSidebarFilters(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommentSidebarFilters","color: green;"),this.commentSidebarFilters$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentSidebarFilters: ",t)}}getCommentSidebarFilters(){return this.commentSidebarFilters$.value??{}}getCommentSidebarFilters$(){return this.commentSidebarFilters$.asObservable()}setEffectiveSidebarFilters(e){try{this.effectiveSidebarFilters$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEffectiveSidebarFilters: ",t)}}getEffectiveSidebarFilters$(){return this.effectiveSidebarFilters$.asObservable()}setCommentSidebarSystemFiltersOperator(e){try{this.commentSidebarSystemFiltersOperator$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentSidebarSystemFiltersOperator: ",t)}}getCommentSidebarSystemFiltersOperator(){return this.commentSidebarSystemFiltersOperator$.value}getCommentSidebarSystemFiltersOperator$(){return this.commentSidebarSystemFiltersOperator$.asObservable()}enableCommentPinHighlighter(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentPinHighlighter:!0}}),this.domService.enableCommentPinHighlighter()}catch(e){this.loggingService.catch("Error in CommentService enableCommentPinHighlighter: ",e)}}disableCommentPinHighlighter(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentPinHighlighter:!1}}),this.domService.disableCommentPinHighlighter()}catch(e){this.loggingService.catch("Error in CommentService disableCommentPinHighlighter: ",e)}}setCustomReactions(e){try{this.reactionService?.setCustomReactions(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomReactions: ",t)}}onCommentSelectionChange$(){return this.commentSelectionChange$.asObservable()}onVisibilityOptionClicked$(){return this.visibilityOptionClicked$.asObservable()}emitVisibilityOptionClicked(e){this.visibilityOptionClicked$.next(e)}onCommentAdd$(){return this.commentAdded$.asObservable()}onCommentUpdate$(){return this.commentUpdated$.asObservable()}onCommentAnnotationDelete$(){return this.commentAnnotationDeleted$.asObservable()}onMultiThreadCommentAnnotationDelete$(){return this.multiThreadCommentAnnotationDeleted$.asObservable()}getCommentMode(){try{let e="freestyle";return this.getStreamMode()?e="stream":this.getPopoverMode()&&(e="popover"),e}catch(e){return this.loggingService.catch("Error in CommentService getCommentMode: ",e),"freestyle"}}getCommentType(e){try{return e.targetElement?"element":e.targetTextRange?"text":e.areaAnnotationId?"area":""}catch(t){return this.loggingService.catch("Error in CommentService getCommentType: ",t),""}}getCommentAnnotationAvailableOnXPath(e,t,a){try{return this.commentAnnotationById$.pipe(Pe(()=>this.draftCommentAnnotationsByAnnotationId$),Pe(i=>(!a&&t&&(a=Wr(t,["id","data-id"])),Ee(f(g({},i),{element:a})))),Pe(i=>this.getLocations$().pipe(Te(c=>f(g({},i),{locationIds:c})))),Te(({locationIds:i,element:c})=>{let m=[],h=this.docService.getDocumentPaths();if(h?.documentId){let _=this.docService.getAdditionalDocumentIdFromElement(c),I=_?this.docService.generateDocumentId(_):h?.documentId,S=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:h?.organizationId,documentId:I||""});if(S)for(let H of S)(t&&H?.targetElementId===t||H?.targetElement?.xpath===e)&&i?.includes(H?.locationId)&&m.push(H)}return m.length?m:null}))}catch(i){return this.loggingService.catch("Error in CommentService isCommentAnnotationAvailableOnXPath: ",i),Ee(null)}}getCommentAnnotationsByContext({context:e,contextOptions:t,element:a,clientDocumentId:i}){try{return this.commentAnnotationById$.pipe(Pe(()=>this.draftCommentAnnotationsByAnnotationId$),Pe(()=>this.docService.getDocumentPaths$()),Te(()=>{let c=null,m=this.docService.getDocumentPaths(),h=an(e),_=this.generateContextId(h);if(m?.documentId){let I=i||this.docService.getAdditionalDocumentIdFromElement(a??null),S=I?this.docService.generateDocumentId(I):m?.documentId,H=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:m?.organizationId,documentId:S||""});if(H){c=[];for(let $ of H)t?.partialMatch?kb($?.context,h)&&c.push($):_&&$?.contextId===_&&c.push($)}}return c}))}catch(c){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByContext: ",c),Ee(null)}}getCommentAnnotationByAnnotationId(e){try{return this.commentAnnotationById$.pipe(Te(()=>this.getAnnotationById(e)),Pe(t=>t?t?.iam?.accessMode===cr.PRIVATE?this.isPrivateCommentAllowed$().pipe(Te(a=>{if(a)return t})):Ee(t):Ee(t)),Pe(t=>t?this.filterCommentsUsingSidebarSettings(t).pipe(Te(a=>{if(a)return a})):Ee(t)))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationByAnnotationId: ",t),Ee(void 0)}}getMultiThreadCommentAnnotationByAnnotationId(e){return this.multiThreadCommentAnnotationById$.pipe(Te(()=>this.getMultiThreadAnnotationById(e)))}getCommentBubbleElement(e){try{let t=document.querySelector(`${X.TAGS.VELT_COMMENT_BUBBLE}[${X.ATTRIBUTES.VELT_ANNOTATION_IDS}*="${e?.annotationId}"]`);return t||(t=document.querySelector(`${X.TAGS.SNIPPYLY_COMMENT_BUBBLE}[${X.ATTRIBUTES.VELT_ANNOTATION_IDS}*="${e?.annotationId}"]`)),t}catch(t){return this.loggingService.catch("Error in CommentService getCommentBubbleElement: ",t),null}}getCommentAnnotationsBySectionId(e){try{return this.commentAnnotationById$.pipe(Pe(()=>this.docService.getDocumentPaths$().pipe(Te(t=>({documentPaths:t,sectionId:e})))),Pe(t=>{let a=Wr(e,["id","data-id"]);if(a){let i=this.docService.getAdditionLocationFromElement(a);if(i){let c=this.docService.genarateLocationId(i);return this.docService.getLocations$().pipe(Te(m=>{let _=Object.values(m||{}).find(I=>I.locationId===c||i?.id&&I.location.id===i.id);return f(g({},t),{additionalLocation:_,locationOnElement:!!i})}))}}return Ee(f(g({},t),{additionalLocation:null,element:a}))}),Pe(t=>t?.locationOnElement?Ee(t):this.docService.getLocation$().pipe(Te(a=>f(g({},t),{location:a})))),Te(({documentPaths:t,location:a,additionalLocation:i,locationOnElement:c,element:m})=>{let h=null;if(this.authService.getUser()&&t?.documentId){let I=this.docService.getAdditionalDocumentIdFromElement(m),S=I?this.docService.generateDocumentId(I):t?.documentId,H=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:t?.organizationId,documentId:S||""});if(H){h=[];let $=un(e);c?i?.location?.id?$=un([i?.location?.id,e]):i?.locationId&&($=un([i?.locationId+"",e])):a&&(a?.location?.id?$=un([a?.location?.id,e]):a?.locationId&&($=un([a?.locationId+"",e])));for(let j of H)j?.multiThreadAnnotationId===$?h.push(j):(j?.targetInlineCommentElementId===e||j?.targetElementId===e)&&(c?i&&Ug({location:i?.location,locationId:i?.locationId},{location:j.location,locationId:j.locationId})&&h.push(j):a?Ug({location:a?.location,locationId:a?.locationId},{location:j.location,locationId:j.locationId})&&h.push(j):j?.locationId||h.push(j))}}return h}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsBySectionId: ",t),Ee(null)}}getCommentAnnotationsByMultiThreadAnnotationId(e){try{return this.commentAnnotationById$.pipe(Pe(()=>this.multiThreadCommentAnnotationById$),Pe(()=>this.docService.getDocumentPaths$().pipe(Te(t=>({documentPaths:t,multiThreadAnnotationId:e})))),Te(({documentPaths:t,location:a,additionalLocation:i,locationOnElement:c})=>{let m=null;if(t?.documentId){let h=this.getMultiThreadAnnotationById(e),{documentId:_,organizationId:I}=h?.metadata||{documentId:t?.documentId,organizationId:t?.organizationId},S=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:I,documentId:_||""});if(S){m=[];for(let H of S)H?.multiThreadAnnotationId===e&&h?.commentAnnotations?.[H?.annotationId]&&m.push(H)}}return m}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsBySectionId: ",t),Ee(null)}}getCommentAnnotationsByAnnotationIds(e){try{return this.commentAnnotationById$.pipe(Pe(()=>this.draftCommentAnnotationsByAnnotationId$),Pe(()=>this.docService.getDocumentPaths$().pipe(Te(t=>({documentPaths:t,annotationIds:e})))),Te(({documentPaths:t})=>{let a=null;if(t?.documentId){let i=this.commentAnnotationById$.value?Object.values(this.commentAnnotationById$.value):[],c=this.draftCommentAnnotationsByAnnotationId$.value?Object.values(this.draftCommentAnnotationsByAnnotationId$.value):[];if(i=[...i,...c],i){a=[];for(let m of i)e.includes(m?.annotationId)&&a.push(m)}}return a}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByAnnotationIds: ",t),Ee(null)}}getCommentAnnotationsByFolderId({folderId:e,veltFolderId:t}){try{return this.commentAnnotationById$.pipe(Pe(()=>this.draftCommentAnnotationsByAnnotationId$),Pe(()=>this.docService.getDocumentPaths$()),Te(()=>{e&&!t&&(t=mr(e));let a=this.authService.getUser(),i=this.docService.getDocumentPaths(),c=null;if(a&&i?.documentId){this.commentAnnotationById$.value&&(c={},Object.values(this.commentAnnotationById$.value).forEach(h=>{h?.metadata?.folderId==e&&h?.metadata?.veltFolderId==t&&(c[h?.annotationId]=h)}));let m=this.draftCommentAnnotationsByAnnotationId$.value;m&&(c===null&&(c={}),Object.values(m).forEach(h=>{h?.metadata?.folderId==e&&h?.metadata?.veltFolderId==t&&!c[h?.annotationId]&&(c[h?.annotationId]=h)}))}return c?Object.values(c):null}))}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByFolderId: ",a),Ee(null)}}getCommentAnnotationsForCommentComponent(e){try{let{annotationId:t,folderId:a,veltFolderId:i,targetElementId:c,clientDocumentId:m,documentId:h,context:_,contextOptions:I,element:S,type:H,sectionId:$,locationId:j}=e||{};if(m&&!h&&(h=this.docService.generateDocumentId(m)),a&&!i&&(i=mr(a)),t)return this.getCommentAnnotationByAnnotationId(t).pipe(Te(re=>re?[re]:null));let Z=[];if(c&&(H==="pin"||H==="tool"||H==="bubble")){let re=Wr(c,["id","data-id"]);if(re){let se=re,_e=this.domService.getXPath(re);Z.push(this.getCommentAnnotationAvailableOnXPath(_e,c,se))}}return $&&Z.push(this.getCommentAnnotationsBySectionId($)),_&&Z.push(this.getCommentAnnotationsByContext({context:_,contextOptions:I,element:S,clientDocumentId:m})),h&&Z.push(this.getCommentAnnotationsByDocumentId$({documentId:h})),a&&Z.push(this.getCommentAnnotationsByFolderId({folderId:a,veltFolderId:i})),Z.length===0?Ee(null):dr(Z).pipe(Te(re=>{let se=re.filter(le=>le!==null&&Array.isArray(le));if(se.length===0)return null;if(se.length===1){let le=se[0];return j&&le?.length?le.filter(Se=>Se?.location?.id===j):le}let _e=se[0];for(let le=1;le<se.length;le++){let he=se[le];_e=_e.filter(Se=>he.some(ze=>ze.annotationId===Se.annotationId))}return j&&_e?.length&&(_e=_e.filter(le=>le?.location?.id===j)),_e}),ir(Jr))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsForCommentComponent: ",t),Ee(null)}}get timestamp(){return this.commonDbService.getServerTimestamp()}isElementInsideAllowedElements(e){try{return this.allowedElementIds$.value?.length||this.allowedElementClassNames$.value?.length||this.allowedElementQuerySelectors$.value?.length?!!(this.allowedElementIds$.value?.length&&this.domService.isElementInsideListedElementIds(e,this.allowedElementIds$.value)||this.allowedElementClassNames$.value?.length&&this.domService.isElementInsideListedElementClassNames(e,this.allowedElementClassNames$.value)||this.allowedElementQuerySelectors$.value?.length&&this.domService.isElementInsideListedElementQuerySelectors(e,this.allowedElementQuerySelectors$.value)):!0}catch(t){return this.loggingService.catch("Error in CommentService isElementInsideAllowedElements: ",t),!1}}getNearestAllowedElement(e){try{let t=this.domService.getListedElements({elementIds:this.allowedElementIds$.value,elementClassNames:this.allowedElementClassNames$.value,elementQuerySelectors:this.allowedElementQuerySelectors$.value});if(t?.length){for(let a=0;a<t.length;a++){let i=t[a];if(e.contains(i))return i}return null}return null}catch(t){return this.loggingService.catch("Error in CommentService getNearestAllowedElement: ",t),null}}isElementInsideManualCommentContainer(e){try{return this.domService.isElementInsideParentWithAttribute(e,X.ATTRIBUTES.VELT_MANUAL_COMMENT_CONTAINER,"true")}catch(t){return this.loggingService.catch("Error in CommentService isElementInsideManualCommentContainer: ",t),!1}}saveComment(e,t){return Ae(this,null,function*(){try{if(t?.updatedComment?.isDraft&&this.draftConfirmation$?.value&&!(yield this.confirmDraftIfRequired(t.updatedComment,e?.annotationId)))return;t?.annotation&&(e=t.annotation),e&&(e=JSON.parse(JSON.stringify(e)));let a=this.originalCommentAnnotationsByDocumentId$.value[e.annotationId];if(a?.comments?.length){let I=JSON.parse(JSON.stringify(e.comments||[]));e.comments=[],a.comments?.forEach(S=>{let H=I.find($=>$.commentId===S.commentId);H?e.comments.push(H):e.comments.push(S)})}e.comments||(e.comments=[]);let i=!1,c=!1,m;switch(t.type){case Ze.NEWLY_ADDED:case Ze.ADDED:if(!t.updatedComment)break;e?.comments?.length||(c=!0),e.comments.push(t.updatedComment);let I=t?.assigned||void 0;m={commentAnnotation:e,targetComment:t.updatedComment,actionType:t.type,otherFields:{assigned:I}};break;case Ze.APPROVED:e.approved=!0,m={commentAnnotation:e,targetComment:null,actionType:Ze.APPROVED};break;case Ze.ASSIGNED:{let se=a?.assignedTo;e.assignedTo=t.assignedTo,m={commentAnnotation:e,targetComment:null,actionType:Ze.ASSIGNED,otherFields:{oldAssignedTo:se,newAssignedTo:t.assignedTo}};break}case Ze.UPDATED:if(!t.updatedComment)break;let S=e.comments.findIndex(se=>se.commentId===t.updatedComment.commentId);if(S>=0){let se=e.comments[S]?.commentText;e.comments[S]=t.updatedComment,e.comments[S].status=Ze.UPDATED;let _e=t?.assigned||void 0;m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ze.UPDATED,otherFields:{assigned:_e,oldCommentText:se}}}break;case Ze.REACTION_ADDED:if(!t.updatedComment)break;let H=e.comments.findIndex(se=>se.commentId===t.updatedComment.commentId);H>=0&&(e.comments[H]=t.updatedComment,e.comments[H].status=Ze.UPDATED,m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ze.REACTION_ADDED});break;case Ze.REACTION_DELETED:if(!t.updatedComment)break;let $=e.comments.findIndex(se=>se.commentId===t.updatedComment.commentId);$>=0&&(e.comments[$]=t.updatedComment,e.comments[$].status=Ze.UPDATED,m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ze.REACTION_DELETED});break;case Ze.STATUS_CHANGED:if(e.status.type==="terminal"){this.domService.resetSelectedAnnotationsMap(!1,"comment");let se=this.authService.getUser();e.resolvedByUserId=se?.userId,e.resolvedByUser=se}m={commentAnnotation:e,targetComment:null,actionType:Ze.STATUS_CHANGED,otherFields:{oldStatus:t.oldStatus,newStatus:t.newStatus}};break;case Ze.PRIORITY_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ze.PRIORITY_CHANGED,otherFields:{oldPriority:t.oldPriority,newPriority:t.newPriority}};break;case Ze.ACCESS_MODE_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ze.ACCESS_MODE_CHANGED,otherFields:{oldAccessMode:t.oldAccessMode,newAccessMode:t.newAccessMode}};break;case Ze.CUSTOM_LIST_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ze.CUSTOM_LIST_CHANGED,otherFields:{oldCustomList:t.oldCustomList,newCustomList:t.newCustomList}};break;case Ze.SUBSCRIBED:m={commentAnnotation:e,targetComment:null,actionType:Ze.SUBSCRIBED};break;case Ze.UNSUBSCRIBED:m={commentAnnotation:e,targetComment:null,actionType:Ze.UNSUBSCRIBED};break;case Ze.DELETED:if(!t.updatedComment)break;let j=e.comments.findIndex(se=>se.commentId===t.updatedComment.commentId);if(j>=0){if((j===0&&this.deleteThreadWithFirstComment$.value!==!1||this.deleteReplyConfirmation$.value)&&!t.skipDeleteThreadConfirmation){let le={};if(this.deleteReplyConfirmation$.value&&(j!==0||this.deleteThreadWithFirstComment$.value===!1)?le={title:"Delete comment?",message:"This selected comment will be deleted.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"reply",type:"reply"}:le={title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"},!(yield this.dialog.open(Yc,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:le}).afterClosed().toPromise()))return}let se=e.comments.splice(j,1),_e=e.metadata;se?.length&&se.forEach(le=>{le?.attachments&&le.attachments.forEach(he=>{let Se={attachmentId:he.attachmentId,organizationId:_e?.clientOrganizationId??_e?.organizationId??null,documentId:_e?.clientDocumentId??_e?.documentId??null,folderId:_e?.folderId??null,commentAnnotationId:e.annotationId,apiKey:_e?.apiKey??null};this.deleteAttachment({attachment:he,metadata:Se})}),le?.reactionAnnotationIds&&le.reactionAnnotationIds.forEach(he=>{this.deleteReaction(he)})})}e?.status?.type==="terminal"&&(e.status=this.customFilterService.defaultStatus),j===0&&this.deleteThreadWithFirstComment$.value!==!1||e.comments?.length===0?i=!0:(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_THREAD_DELETED,{annotationId:e.annotationId,commentThreadId:t.updatedComment.commentId,commentMode:this.getCommentMode()}),m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ze.DELETED});break;case Ze.ACCEPTED:let Z={annotationId:e.annotationId,actionUser:this.authService.getUser(),actionType:Ze.ACCEPTED,replaceContentHtml:e?.comments?.length?e?.comments[0]?.replaceContentHtml:void 0,replaceContentText:e?.comments?.length?e?.comments[0]?.replaceContentText:void 0,annotation:this.getCommentAnnotationForClient(e)};this.commentAccepted$.next(Z),m={commentAnnotation:e,targetComment:null,actionType:Ze.ACCEPTED};break;case Ze.REJECTED:let re={annotationId:e.annotationId,actionUser:this.authService.getUser(),actionType:Ze.REJECTED,replaceContentHtml:e?.comments?.length?e?.comments[0]?.replaceContentHtml:void 0,replaceContentText:e?.comments?.length?e?.comments[0]?.replaceContentText:void 0,annotation:this.getCommentAnnotationForClient(e)};this.commentRejected$.next(re),this.domService.resetSelectedAnnotationsMap(),m={commentAnnotation:e,targetComment:null,actionType:Ze.REJECTED};break;case Ze.SUGGESTION_ACCEPTED:m={commentAnnotation:e,targetComment:null,actionType:Ze.SUGGESTION_ACCEPTED,otherFields:{resolvedBy:e?.suggestion?.resolvedBy,resolvedAt:e?.suggestion?.resolvedAt}};break;case Ze.SUGGESTION_REJECTED:m={commentAnnotation:e,targetComment:null,actionType:Ze.SUGGESTION_REJECTED,otherFields:{rejectReason:e?.suggestion?.rejectReason,resolvedBy:e?.suggestion?.resolvedBy,resolvedAt:e?.suggestion?.resolvedAt}};break;default:break}if(e.resolvedByUserId&&e.status.type!=="terminal"&&(e.resolvedByUserId=null,e.resolvedByUser=null),t.visibility)try{let I=g({},t.visibility);if(I.type==="organizationPrivate"&&!I.organizationId&&!I.organizationIds?.length){let $=this.docService.getOrganizationConfig();$?.clientOrganizationId&&(I.organizationId=$.clientOrganizationId)}let S=e.from?.userId||this.authService.getUser()?.userId,H=An(I,S);H.length>0&&(e.context||(e.context={}),e.context._setAccessFields=H,e.visibilityConfig=Pn(I,S))}catch(I){this.loggingService.catch("Error building accessFields from visibility in saveComment:",I)}if(t?.updatedComment?.isDraft&&(m=void 0),i)this.deleteCommentPinAnnotation(e,!0),this.domService.resetSelectedAnnotationsMap(!1,"comment");else{c&&e.comments?.length&&this.enableAutoCategorize$?.value&&this.setCommentCategory(e);let I=this.authService.getUser()?.userId;if(!this.iamService.isUserAdmin()&&e.context?.access&&e.context?.accessFields&&t.updatedComment?.from?.userId&&I&&!this.userPermissionService?.hasUserContextAccess({userId:I,accessFields:e.context.accessFields})){this.loggingService.catch("User does not have context access to update comment annotation.",void 0,void 0,!0);return}this.updateComment(e,!1,!1,m,!0,t.updatedComment),e?.multiThreadAnnotationId&&(t.type===Ze.ADDED||t.type===Ze.NEWLY_ADDED)&&e.comments?.length===1?setTimeout(()=>{this.domService.resetSelectedAnnotationsMap(!1,"comment")},100):this.domService.updateSelectedAnnotationInMap([e])}let h=this.getCustomPinById(e.annotationId),_={type:t.type,annotation:this.getCommentAnnotationForClient(e),targetAnnotationId:e.annotationId,targetCommentId:t.updatedComment?.commentId,updateContext:(I,S)=>{this.updateCommentAnnotationContext(e.annotationId,I,S)}};if(h!==void 0&&(_.element=h),delete _?.annotation?.pageInfo,delete _?.annotation?.targetElement,delete _?.annotation?.targetTextRange,_?.type===Ze.DELETED&&(e.comments?.length||(_.annotation=null)),i||this.commentUpdated$.next(_),t.type===Ze.NEWLY_ADDED&&!i&&e?.annotationId){let I=this.pendingAddCommentAnnotationData.get(e.annotationId);if(I){this.pendingAddCommentAnnotationData.delete(e.annotationId);let S=f(g({},I),{annotation:this.getCommentAnnotationForClient(e),targetCommentId:t.updatedComment?.commentId}),H=yield this.commentActionsService?.getAddCommentAnnotationEventFromCommentAddEventData(S);H&&this.commentActionsService?.triggerAddCommentAnnotationEvent(H),t.updatedComment&&(yield this.commentActionsService?.triggerAddCommentEvent({annotation:e,newComment:t.updatedComment}))}}t.type===Ze.ADDED&&t._dispatchAddCommentEvent&&!i&&e?.annotationId&&t.updatedComment&&(yield this.commentActionsService?.triggerAddCommentEvent({annotation:e,newComment:t.updatedComment}))}catch(a){this.loggingService.catch("Error in CommentService saveComment: ",a)}})}attachComment(e,t=[],a,i,c,m,h,_){try{this.loggingService.log("%c[WB] Calling FUNCTION: attachComment","color: green;");let I;if(e){let S=Wr(e,t);S&&(I={targetElement:{xpath:this.domService.getXPath(S),topPercentage:50,leftPercentage:90},targetElementId:e})}(I||a||c)&&this.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,m,void 0,void 0,I,_,void 0,void 0,i,void 0,void 0,void 0,a,void 0,c,void 0,void 0,h)}catch(I){this.loggingService.catch("Error in CommentService attachComment: ",I)}}generateComponentIdFromObject(e){try{let t=an(e||{});return ur(JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CommentService generateComponentIdFromObject: ",t);return}}updateNotificationsDatabase(e,t,a,i={}){try{let c=g({annotationData:e,targetAnnotationData:t,actionType:a,notificationSource:"comment"},i);this.notificationService.updateNotificationDatabase(c)}catch(c){this.loggingService.catch("Error in CommentService updateNotificationsDatabase: ",c)}}getUserContacts$(){return this.contactService.getUserContacts$()}addUserContact(e){this.contactService.addUserContact(e)}getCustomUserContacts(){try{return this.contactService.getCustomUserContacts()}catch(e){return this.loggingService.catch("Error in CommentService getCustomUserContacts:",e),null}}getCustomUserContactsConfig(){try{return this.contactService.getCustomUserContactsConfig()}catch(e){this.loggingService.catch("Error in CommentService getCustomUserContactsConfig:",e);return}}getElementFromComment(e){try{let t=null;if(e?.ghostComment)!t&&e.ghostComment?.targetElement?.fXpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.fXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e.ghostComment?.targetElement?.cfXpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.cfXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e.ghostComment?.targetElement?.xpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.xpath),t&&!this.domService.isElementVisible(t)&&(t=null));else{let a=!1,i=e?.targetElement?.anchor;if(!t&&i){let c=this.domService.resolveAnchorRecord(i);c?.element&&this.domService.isElementVisible(c.element)&&pn(c.element)&&(t=c.element)}!t&&e?.targetElement?.xpath&&(a=this.domService.isXpathWithId(e?.targetElement?.xpath),t=this.domService.getElementFromXPath(e?.targetElement?.xpath),t&&!this.domService.isElementVisible(t)&&(t=null)),a||(!t&&e?.targetElement?.cfXpath&&(t=this.domService.getElementFromXPath(e?.targetElement?.cfXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e?.targetElement?.fXpath&&(t=this.domService.getElementFromXPath(e?.targetElement?.fXpath),t&&!this.domService.isElementVisible(t)&&(t=null)))}return t&&!pn(t)&&(t=null),t}catch(t){return this.loggingService.catch("Error in CommentService getElementFromComment: ",t),null}}getElementFromComments(e){try{let t=[],a=null;if(e?.ghostComment)!a&&e.ghostComment?.targetElement?.fXpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.fXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e.ghostComment?.targetElement?.cfXpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.cfXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e.ghostComment?.targetElement?.xpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.xpath),a&&!this.domService.isElementVisible(a)&&(a=null));else{let i=!1,c=e?.targetElement?.anchor;if(!a&&c){let m=this.domService.resolveAnchorRecord(c);m?.element&&this.domService.isElementVisible(m.element)&&pn(m.element)&&(a=m.element)}!a&&e?.targetElement?.xpath&&(i=this.domService.isXpathWithId(e?.targetElement?.xpath),a=this.domService.getElementFromXPath(e?.targetElement?.xpath),a&&!this.domService.isElementVisible(a)&&(a=null)),i||(!a&&e?.targetElement?.cfXpath&&(a=this.domService.getElementFromXPath(e?.targetElement?.cfXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e?.targetElement?.fXpath&&(a=this.domService.getElementFromXPath(e?.targetElement?.fXpath),a&&!this.domService.isElementVisible(a)&&(a=null)))}return a&&!pn(a)&&(a=null),e?.targetElementId&&(t=Array.from(Ab(e.targetElementId,["id","data-id"]))),a&&!t.includes(a)&&t.push(a),t}catch(t){return this.loggingService.catch("Error in CommentService getElementFromComment: ",t),[]}}getGhostCommentTargetElement(e){try{let t=e.targetElement?.fXpath||e.targetElement?.xpath,a=null;if(t)for(;!a&&t;)a=this.domService.getElementFromXPath(t),a&&(!this.domService.isElementVisible(a)||!pn(a))&&(a=null),a||(t=t.substring(0,t.lastIndexOf("/")));return t==="/"&&(t=""),t?{xpath:t,topPercentage:e?.targetElement?.topPercentage||0,leftPercentage:e?.targetElement?.leftPercentage||0}:null}catch(t){return this.loggingService.catch("Error in CommentService getGhostCommentTargetElement: ",t),null}}setGhostCommentMessage(e){try{if(e?.ghostComment){e.ghostComment.message="Original content not found.",e.ghostComment.type=Hr.ELEMENT_DELETED;let t=e?.pageInfo?.deviceInfo?.deviceType,a=new Tg().getDeviceType();t&&t!==a&&(e.ghostComment.type=Hr.DIFFERENT_DEVICE,e.ghostComment.message=`Original comment was added on ${t}.`,[En.MOBILE,En.TABLET].includes(t)&&[En.MOBILE,En.TABLET].includes(a)||[En.DESKTOP,En.MONITOR].includes(t)&&[En.DESKTOP,En.MONITOR].includes(a)?e.ghostComment.isSameGroup=!0:e.ghostComment.isSameGroup=!1)}}catch(t){this.loggingService.catch("Error in CommentService setGhostCommentMessage: ",t)}}addAnnotationToGhostCommentAnnotationMap(e){try{let t=this.ghostCommentAnnotationMap$.value||{},a=t[e?.annotationId]||{};ln(e.ghostComment,a)||(t[e?.annotationId]=e.ghostComment,this.ghostCommentAnnotationMap$.next(t))}catch(t){this.loggingService.catch("Error in CommentService addAnnotationToGhostCommentAnnotationMap: ",t)}}removeAnnotationFromGhostCommentAnnotationMap(e){try{let t=this.ghostCommentAnnotationMap$.value||{};t[e?.annotationId]&&(delete t[e?.annotationId],this.ghostCommentAnnotationMap$.next(t))}catch(t){this.loggingService.catch("Error in CommentService removeAnnotationFromGhostCommentAnnotationMap: ",t)}}getGhostCommentAnnotationMap$(){return this.ghostCommentAnnotationMap$.asObservable()}getGhostCommentAnnotationMap(){return this.ghostCommentAnnotationMap$.value||{}}getUnreadCommentsMap$(){return this.unreadCommentsMap$.asObservable().pipe(ir(Jr))}getUnreadCommentsMap(){return this.unreadCommentsMap$.value}getUnreadCommentCountByAnnotationId$(e){return this.getUnreadCommentsMap$().pipe(Te(t=>t?{count:t[e]||0}:null))}getUnreadCommentAnnotationCountOnCurrentDocument$(){return this.getUnreadCommentsMap$().pipe(Te(e=>e?{count:Object.keys(e??{}).length||0}:null))}getUnreadCommentCountOnCurrentDocument$(){return this.getUnreadCommentsMap$().pipe(Te(e=>e?{count:Object.values(e).reduce((a,i)=>a+i,0)}:null))}getUnreadCommentCountByLocationId$(e){return this.getUnreadCommentsMap$().pipe(Te(t=>{if(t){let a=this.docService.getDocumentPaths(),i=[],c=0;return a?.documentId&&(i=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:a?.organizationId,documentId:a?.documentId}),i&&Object.keys(t).forEach(m=>{i?.find(_=>_.annotationId===m)?.location?.id===e&&(c+=t[m])})),{count:c}}else return null}))}getUnreadCommentAnnotationCountByLocationId$(e){return this.getUnreadCommentsMap$().pipe(Te(t=>{if(t){let a=this.docService.getDocumentPaths(),i=[],c=0;return a?.documentId&&(i=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:a?.organizationId,documentId:a?.documentId}),Object.keys(t).forEach(m=>{t[m]&&i?.find(_=>_.annotationId===m)?.location?.id===e&&(c+=1)})),{count:c}}else return null}))}setCommentAnnotationsAsRead(e){try{for(let t of e)this.withProgressCommentsSpliced(t,()=>this.viewsService?.setCommentAnnotationAsRead(t))}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsAsRead: ",t)}}setCommentAnnotationsAsResolved(e){try{let t=this.customFilterService.resolvedStatus,a=this.authService.getUser();if(t){for(let i of e)if(t?.id!==i?.status?.id){let c=JSON.parse(JSON.stringify(i||{}));i.status=this.customFilterService.resolvedStatus,i.statusUpdatedByUserId=a?.userId;let m={annotation:i,type:Ze.STATUS_CHANGED,oldStatus:c.status,newStatus:this.customFilterService.resolvedStatus};this.saveComment(i,m)}}}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsAsResolved: ",t)}}isCommentAnnotationUnread(e){try{let t=this.authService.getUser();return!(t?.userSnippylyId&&e?.viewedByUserIds?.length&&e?.viewedByUserIds?.includes(t?.userSnippylyId))}catch(t){return this.loggingService.catch("Error in CommentService isCommentAnnotationUnread: ",t),!1}}updateCommentDialogPosition(){try{this.updateCommentDialogPositionTriggerSubject$.next()}catch(e){this.loggingService.catch("Error in CommentService updateCommentDialogPosition: ",e)}}updateCommentDialogPositionTrigger$(){return this.updateCommentDialogPositionTriggerSubject$.asObservable()}enableAreaComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{areaComment:!0}}),this.areaCommentEnabled$.value===!0)return;this.areaCommentEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAreaComment: ",e)}}disableAreaComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{areaComment:!1}}),this.areaCommentEnabled$.value===!1)return;this.areaCommentEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAreaComment: ",e)}}getAreaCommentEnabled$(){return this.areaCommentEnabled$.asObservable()}getAreaCommentEnabled(){return this.areaCommentEnabled$.value}setPinCursorImage(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setPinCursorImage","color: green;"),e&&(e=`url(${e}) 0 31, auto`),this.commentPinCursorImage$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setPinCursorImage: ",t)}}getPinCursorImage$(){return this.commentPinCursorImage$.asObservable()}getPinCursorImage(){return this.commentPinCursorImage$.value}setCommentAnnotationsFromCommentsContainer(e){try{this.commentAnnotationsFromCommentsContainer$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsFromCommentsContainer: ",t)}}getCommentAnnotationsFromCommentsContainer$(){return this.commentAnnotationsFromCommentsContainer$.asObservable()}getCommentAnnotationsFromCommentsContainer(){return this.commentAnnotationsFromCommentsContainer$.value}addManualComment(e){return Ae(this,null,function*(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: addManualComment","color: green;"),new Promise((t,a)=>{let i=this.domService.getLastDocumentClick()?.target,c=e?.location||this.docService.getAdditionLocationFromElement(i);if(c?.id){let m=this.docService.getLocationByClientLocationId(c.id);m&&(c=m)}this.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,c,void 0,e,void 0,void 0,void 0,m=>{t(m)}),this.addCommentMode$?.value&&!this.persistentCommentMode$?.value&&this.disableAddCommentMode()})}catch(t){return this.loggingService.catch("Error in CommentService addManualComment: ",t),null}})}getCommentUrl(e){try{return e?.pageInfo?.commentUrl?e.pageInfo.commentUrl:(e?.pageInfo||(e.pageInfo=tp(),e.pageInfo&&(e.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth)),e.pageInfo.commentUrl=this.generateCommentUrl(e),this.updateComment(e),e.pageInfo?.commentUrl)}catch(t){this.loggingService.catch("Error in CommentService getCommentUrl: ",t);return}}uploadFile(e,t){let a=`${X.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${X.FIREBASE_PARTIAL_PATH_COMMENT}/${t.annotationId}`;this.documentPaths?.organizationId&&(a=`${X.FIREBASE_PARTIAL_PATH_ORGANIZATIONS}/${this.documentPaths.organizationId}/${X.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${X.FIREBASE_PARTIAL_PATH_COMMENT}/${t.annotationId}`);let i={organizationId:t.metadata?.clientOrganizationId??this.documentPaths?.clientOrganizationId??null,documentId:t.metadata?.clientDocumentId??this.documentPaths?.clientDocumentId??null,commentAnnotationId:t.annotationId,apiKey:t.metadata?.apiKey??this.configService?.getApiKey()??null,folderId:t.metadata?.folderId??this.documentPaths?.folderId??null,attachmentId:null};return this.storageService.uploadFile({path:a,file:e,metadata:i,useAttachmentResolver:this.attachmentResolverService.attachmentDataProviderAvailable()})}downloadAttachment(e){this.storageService.downloadAttachment(e)}deleteAttachment({attachment:e,metadata:t}){return this.storageService.deleteAttachment({attachment:e,metadata:t,useAttachmentResolver:this.attachmentResolverService.attachmentDataProviderAvailable()})}deleteReaction(e){try{this.reactionService?.deleteReactionPinAnnotation(e)}catch(t){this.loggingService.catch("Error in CommentService deleteReaction: ",t)}}generateCommentUrl(e){let t;try{t=new URL(e?.pageInfo?.url||window.location.href)}catch(a){this.loggingService.catch("Error in CommentService generateCommentUrl: ",a),t=new URL(window.location.href)}return t.searchParams.delete(X.URL_PARAMS.COMMENT_ID),t.searchParams.append(X.URL_PARAMS.COMMENT_ID,e.annotationId),t.href}getCustomPinById(e){if(this.customPinsById.has(e))return this.customPinsById.get(e)}setCustomStatuses(e){try{if(e===void 0)return;this.customStatusesShown$.next(!0),this.customFilterService.setCustomStatusFilters(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomStatuses: ",t)}}getCustomStatusesShown$(){return this.customStatusesShown$.asObservable()}getCustomStatusesShown(){return this.customStatusesShown$.value}setCustomPriorities(e){try{if(e===void 0)return;this.customFilterService.setCustomPriorityFilters(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomPriorities: ",t)}}setCustomCategories(e){try{if(e===void 0)return;this.customFilterService.setCustomCategories(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomCategories: ",t)}}addCommentOnSelectedText(){try{let e=this.authService.getUser();if(this.textCommentMode$.value&&e&&!(e?.isReadOnly||e?.isAnonymous)&&this.authService.isFeatureAllowed(ke.COMMENT)){let t=this.domService.getRange();if(window.getSelection()?.toString()&&!Hc()&&t?.commonAncestorContainer&&this.isElementInsideAllowedElements(t.commonAncestorContainer)&&!to(t.commonAncestorContainer)){let a=t?this.domService.getTargetTextRangeFromSelectionRange(t):void 0;this.domService.clearTextSelection(),setTimeout(()=>{this.addComment(void 0,a)},100)}}}catch(e){this.loggingService.catch("Error in CommentService addCommentOnSelectedText: ",e)}}getInlineCommentSectionConfig(e){try{let t;if(e){let a=e?.closest(`[${X.ATTRIBUTES.VELT_TARGET_INLINE_COMMENT_ELEMENT_ID}]`);if(a){let i=a.getAttribute(X.ATTRIBUTES.VELT_TARGET_INLINE_COMMENT_ELEMENT_ID);i&&(t={},t.targetInlineCommentElementId=i,a.getAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_SECTION_CONFIG)&&(t.config=JSON.parse(a.getAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_SECTION_CONFIG)||"{}")))}}return t}catch(t){this.loggingService.catch("Error in CommentService getInlineCommentSectionConfig: ",t)}}createCustomListDataOnAnnotation(e){try{if(e===void 0)return;this.customChipDropdownData$.next(e)}catch(t){this.loggingService.catch("Error in CommentService createCustomListDataOnAnnotation: ",t)}}getCustomChipDropdownData$(){return this.customChipDropdownData$.asObservable()}getCustomChipDropdownData(){return this.customChipDropdownData$.value}setSubscribedUsersDataInCommentAnnotation(e){try{let t={},a=e?.unsubscribedUsers||{},i={};if(e?.subscribedUsers&&Object.keys(e.subscribedUsers||{}).forEach(c=>{let m=e.subscribedUsers?.[c];m?.type==="manual"&&(t[c]=m)}),e?.assignedTo?.userId){let c=ur(e?.assignedTo?.userId);a[c]||t[c]?.type!=="manual"&&(t[c]={user:e?.assignedTo,type:"auto"})}e?.comments?.filter(c=>!c?.isDraft)?.forEach(c=>{if(c?.from?.userId){let m=ur(c?.from?.userId);a[m]||t[m]?.type!=="manual"&&(t[m]={user:c?.from,type:"auto"})}c?.to?.forEach(m=>{if(m?.userId){let h=ur(m.userId);a[h]||t[h]?.type!=="manual"&&(t[h]={user:m,type:"auto"})}}),c?.toOrganizationUserGroup?.forEach(m=>{if(m?.groupId)i[m?.groupId]={type:"auto"};else if(m?.clientGroupId){let h=ur(m.clientGroupId);i[h]={type:"auto"}}})}),e.subscribedUsers=t,e.unsubscribedUsers=a,e.subscribedGroups=i}catch(t){this.loggingService.catch("Error in CommentService setSubscribeUsersDataInCommentAnnotation: ",t)}}getCopyLink$(){return this.copyLink$.asObservable()}setCopyLink(e){try{this.copyLink$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCopyLink: ",t)}}getCommentAnnotationById(e){return this.commentAnnotationById$.pipe(Pe(()=>{let{annotationId:t,documentId:a}=e;if(a){let i=To(a).toString();return this.getDataCommentAnnotationsFromDocumentId(i).pipe(Te(c=>c.find(h=>h.annotationId===t)||null))}else{let i=this.docService.getDocumentPaths();if(i?.documentId){let c=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:i?.organizationId,documentId:i?.documentId});if(c){let m=c.find(h=>h.annotationId===t);return Ee(m||null)}}}return Ee(null)}),jr(t=>(this.loggingService.catch("Error in CommentService getCommentAnnotationById: ",t),Ee(null))))}getCommentAnnotationByIdSync(e){try{return this.commentAnnotationById$.value?.[e]}catch(t){this.loggingService.catch("Error in CommentService getCommentAnnotationByIdSync: ",t);return}}getDataCommentAnnotationsFromDocumentId(e){return this.configService?.getApiKey()?this.commonDbService.dbListener({feature:"allComments",properties:{documentId:e||this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,isCollection:!0}}).pipe(Te(t=>t?.data),Te(t=>{let a=[];return t&&(a=Object.values(t??{}).filter(i=>typeof i=="object")),a})):Ee([])}enableCollapsedComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedComments:!0}}),this.collapsedComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCollapsedComments: ",e)}}disableCollapsedComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedComments:!1}}),this.collapsedComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCollapsedComments: ",e)}}getCollapsedComments$(){return this.collapsedComments$.asObservable()}enableCollapsedRepliesPreview(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedRepliesPreview:!0}}),this.collapsedRepliesPreview$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCollapsedRepliesPreview: ",e)}}disableCollapsedRepliesPreview(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedRepliesPreview:!1}}),this.collapsedRepliesPreview$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCollapsedRepliesPreview: ",e)}}getCollapsedRepliesPreview$(){return this.collapsedRepliesPreview$.asObservable()}enableFullExpanded(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullExpanded:!0}}),this.fullExpanded$.value===!0)return;this.fullExpanded$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFullExpanded: ",e)}}disableFullExpanded(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullExpanded:!1}}),this.fullExpanded$.value===!1)return;this.fullExpanded$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFullExpanded: ",e)}}getFullExpanded$(){return this.fullExpanded$.asObservable()}getFullExpanded(){return this.fullExpanded$.value}setSidebarCustomActionEventData(e,t,a,i,c){try{this.sidebarCustomActionEventData$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c})}catch(m){this.loggingService.catch("Error in CommentService emitOnSidebarCustomAction: ",m)}}getSidebarCustomActionEventData(){return this.sidebarCustomActionEventData$.asObservable()}setCommentSidebarData(e,t){try{let a=new Set;(e||[]).forEach(c=>{(c?.annotations||[]).forEach(m=>{m?.annotationId&&a.add(m.annotationId)})});let i=this.customSidebarDataAnnotationIds$.value;this.areAnnotationIdSetsEqual(i,a)||this.customSidebarDataAnnotationIds$.next(a),this.sidebarData$.next({data:e,options:t})}catch(a){this.loggingService.catch("Error in CommentService setCommentSidebarData: ",a)}}areAnnotationIdSetsEqual(e,t){if(e===t)return!0;if(e===null||t===null||e.size!==t.size)return!1;for(let a of e)if(!t.has(a))return!1;return!0}getSidebarCustomData(){return this.sidebarData$.asObservable()}getCustomSidebarDataAnnotationIds$(){return this.customSidebarDataAnnotationIds$.asObservable()}getCustomSidebarDataAnnotationIds(){return this.customSidebarDataAnnotationIds$.value}setSidebarCustomActionEventDataAllChanges(e,t,a,i,c){return Ae(this,null,function*(){try{this.sidebarCustomActionEventDataAllChanges$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c});let m=yield this.metadataService.getGlobalMetadata(),h={buttonContext:{selections:this.buttonService.buttonToggleMapValue()},unreadCommentAnnotationsMap:a,commentAnnotations:t,systemFilteredAnnotations:i,metadata:m,customFilters:c};this.commentActionsService?.triggerAction(lt.COMMENT_SIDEBAR_DATA_UPDATE,h)}catch(m){this.loggingService.catch("Error in CommentService setSidebarCustomActionEventDataAllChanges: ",m)}})}setSidebarCustomActionEventDataOnInit(e,t,a,i,c){return Ae(this,null,function*(){try{this.sidebarCustomActionEventDataOnInit$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c});let h={metadata:yield this.metadataService.getGlobalMetadata(),unreadCommentAnnotationsMap:a,commentAnnotations:t,systemFilteredAnnotations:i,buttonContext:{selections:this.buttonService.buttonToggleMapValue()},customFilters:c};this.commentActionsService?.triggerAction(lt.COMMENT_SIDEBAR_DATA_INIT,h)}catch(m){this.loggingService.catch("Error in CommentService setSidebarCustomActionEventDataOnInit: ",m)}})}getSidebarCustomActionEventDataAllChanges(){return this.sidebarCustomActionEventDataAllChanges$.asObservable()}getSidebarCustomActionEventDataOnInit(){return this.sidebarCustomActionEventDataOnInit$.asObservable()}getSidebarCustomActionEventDataOnInitValue(){return this.sidebarCustomActionEventDataOnInit$.getValue()}setTransformContext(e){try{e?ln(this.transformContext$.value,e)||this.transformContext$.next(e):this.transformContext$.next(null)}catch(t){this.loggingService.catch("Error in CommentService setTransformContext: ",t)}}getTransformContext$(){return this.transformContext$.asObservable()}getTransformContext(){return this.transformContext$.value}enableSidebarCustomActions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customActions:!0}}),this.customActions$.value===!0)return;this.customActions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarCustomActions: ",e)}}disableSidebarCustomActions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customActions:!1}}),this.customActions$.value===!1)return;this.customActions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarCustomActions: ",e)}}getSidebarCustomActionsValue(){return this.customActions$.getValue()}enableQueryParamsComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{queryParamsComments:!0}}),this.queryParamsComments$.value===!0)return;this.queryParamsComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableQueryParamsComments: ",e)}}disableQueryParamsComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{queryParamsComments:!1}}),this.queryParamsComments$.value===!1)return;this.queryParamsComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableQueryParamsComments: ",e)}}getQueryParamsComments$(){return this.queryParamsComments$.asObservable()}getQueryParamsComments(){return this.queryParamsComments$.value}enableResolveStatusAccessAdminOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveStatusAccessAdminOnly:!0}}),this.resolveStatusAccessAdminOnly$.value===!0)return;this.resolveStatusAccessAdminOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableResolveStatusAccessAdminOnly: ",e)}}disableResolveStatusAccessAdminOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveStatusAccessAdminOnly:!1}}),this.resolveStatusAccessAdminOnly$.value===!1)return;this.resolveStatusAccessAdminOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableResolveStatusAccessAdminOnly: ",e)}}enableLinkCallback(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{linkCallback:!0}}),this.linkCallback$.value===!0)return;this.linkCallback$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableLinkCallback: ",e)}}disableLinkCallback(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{linkCallback:!1}}),this.linkCallback$.value===!1)return;this.linkCallback$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableLinkCallback: ",e)}}getResolveStatusAccessAdminOnly$(){return this.resolveStatusAccessAdminOnly$.asObservable()}getLinkCallback$(){return this.linkCallback$.asObservable()}getResolveStatusAccessAdminOnly(){return this.resolveStatusAccessAdminOnly$.value}getLinkCallback(){return this.linkCallback$.value}enableSvgAsImg(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{svgAsImg:!0}}),this.svgAsImg$.value===!0)return;this.svgAsImg$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSvgAsImg: ",e)}}disableSvgAsImg(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{svgAsImg:!1}}),this.svgAsImg$.value===!1)return;this.svgAsImg$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSvgAsImg: ",e)}}getSvgAsImg$(){return this.svgAsImg$.asObservable()}getSvgAsImg(){return this.svgAsImg$.value}enableCommentToNearestAllowedElement(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentToNearestAllowedElement:!0}}),this.commentToNearestAllowedElement$.value===!0)return;this.commentToNearestAllowedElement$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCommentToNearestAllowedElement: ",e)}}disableCommentToNearestAllowedElement(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentToNearestAllowedElement:!1}}),this.commentToNearestAllowedElement$.value===!1)return;this.commentToNearestAllowedElement$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCommentToNearestAllowedElement: ",e)}}getCommentToNearestAllowedElement$(){return this.commentToNearestAllowedElement$.asObservable()}getCommentToNearestAllowedElement(){return this.commentToNearestAllowedElement$.value}enableFilterCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterCommentsOnDom:!0}}),this.filterCommentsOnDom$.value===!0)return;this.filterCommentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFilterCommentsOnDom: ",e)}}disableFilterCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterCommentsOnDom:!1}}),this.filterCommentsOnDom$.value===!1)return;this.filterCommentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFilterCommentsOnDom: ",e)}}getFilterCommentsOnDom$(){return this.filterCommentsOnDom$.asObservable()}getFilterCommentsOnDom(){return this.filterCommentsOnDom$.value}setCommentsFromSidebarMap(e){try{let{comments:t,sidebarVisible:a}=e||{},i=null;t&&(i={},t.forEach(m=>{m?.annotationId&&i&&(i[m.annotationId]=m)}));let c={};t===void 0?c.data=this.commentsFromSidebarMap$.value?.data:c.data=i,a===void 0?c.sidebarVisible=this.commentsFromSidebarMap$.value?.sidebarVisible:c.sidebarVisible=a,ln(this.commentsFromSidebarMap$.value,c)||this.commentsFromSidebarMap$.next(c)}catch(t){this.loggingService.catch("Error in CommentService setCommentsFromSidebarMap: ",t)}}getCommentsFromSidebarMap$(){return this.commentsFromSidebarMap$.asObservable()}getCommentsFromSidebarMap(){return this.commentsFromSidebarMap$.value}hasActiveFilters(e){try{return e?!!(e.people?.length||e.assigned?.length||e.tagged?.length||e.involved?.length||e.priority?.length||e.status?.length||e.category?.length||e.location?.length||e.document?.length||e.version?.length||e.accessModes?.length||this.hasCustomContextFilters(e)):!1}catch(t){return this.loggingService.catch("Error in CommentService hasActiveFilters: ",t),!1}}hasCustomContextFilters(e){try{if(!e)return!1;let t=new Set(["people","assigned","tagged","involved","priority","status","category","version","document","location","accessModes"]);return Object.keys(e).some(a=>!t.has(a)&&Array.isArray(e[a])&&e[a]?.length>0)}catch(t){return this.loggingService.catch("Error in CommentService hasCustomContextFilters: ",t),!1}}applyDirectFilters(e,t){try{let a=this.commentSidebarSystemFiltersOperator$.value,i,c=!1,m=new Set;a===Ur.AND?i=e.slice():i=[];let h=_=>{a===Ur.AND?i=i.filter(I=>_.some(S=>S.annotationId===I.annotationId)):_.forEach(I=>m.add(I.annotationId)),c=!0};if(t.people?.length){let _=[];t.people.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByPeople({id:S,name:I.name},e)])}),h(_)}if(t.assigned?.length){let _=[];t.assigned.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByAssigned({id:S,name:I.name},e)])}),h(_)}if(t.tagged?.length){let _=[];t.tagged.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByTagged({id:S,name:I.name},e)])}),h(_)}if(t.involved?.length){let _=[];t.involved.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByInvolved({id:S,name:I.name},e)])}),h(_)}if(t.priority?.length){let _=[];t.priority.forEach(I=>_=[..._,...this.filterAnnotationsByPriority({id:I},e)]),h(_)}if(t.status?.length){let _=[];t.status.forEach(I=>_=[..._,...this.filterAnnotationsByStatus({id:I},e)]),h(_)}if(t.category?.length){let _=[];t.category.forEach(I=>_=[..._,...this.filterAnnotationsByCommentCategory({id:I},e)]),h(_)}if(t.version?.length){let _=[];t.version.forEach(I=>_=[..._,...this.filterAnnotationsByVersion(I,e)]),h(_)}if(t.document?.length){let _=[];t.document.forEach(I=>_=[..._,...this.filterAnnotationsByDocument(I,e)]),h(_)}if(t.location?.length){let _=[];t.location.forEach(I=>{I.id&&(_=[..._,...e.filter(S=>S.location?.id===I.id||S.documentParams?.id===I.id)])}),h(_)}if(t.accessModes?.length){let _=[];t.accessModes.forEach(I=>{I===cr.PRIVATE?_=[..._,...e.filter(S=>pr(S))]:I===cr.PUBLIC&&(_=[..._,...e.filter(S=>!pr(S))])}),h(_)}return this.getCustomContextFilterEntries(t).forEach(({key:_,values:I})=>{let S=this.matchAnnotationsByContext(e,_,I);h(S)}),a!==Ur.AND&&(c?i=e.filter(_=>m.has(_.annotationId)):i=e),i}catch(a){return this.loggingService.catch("Error in CommentService applyDirectFilters: ",a),e}}applyCommentSidebarClientFilters(e,t){return this.applyDirectFilters(e,t)}getCustomContextFilterEntries(e){try{if(!e)return[];let t=new Set(["people","assigned","tagged","involved","priority","status","category","version","document","location","accessModes"]),a=[];return Object.keys(e).forEach(i=>{if(t.has(i))return;let c=e[i];!Array.isArray(c)||!c.length||a.push({key:i,values:c})}),a}catch(t){return this.loggingService.catch("Error in CommentService getCustomContextFilterEntries: ",t),[]}}matchAnnotationsByContext(e,t,a){try{return e.filter(i=>{let c=i.context?.[t];return c==null?!1:a.some(m=>{let h=typeof m=="string"?m:m?.id;return c===h||c?.toString()===h})})}catch(i){return this.loggingService.catch("Error in CommentService matchAnnotationsByContext: ",i),[]}}filterAnnotationsByPeople(e,t){try{return e.id?t.filter(a=>a?.from?.userId===e.id||a?.from?.email===e.id):t}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByPeople: ",a),[]}}filterAnnotationsByTagged(e,t){try{return t.filter(a=>a?.comments?.some(i=>i.taggedUserContacts?.some(c=>c?.contact?.userId===e.id)))}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByTagged: ",a),[]}}filterAnnotationsByAssigned(e,t){try{return t.filter(a=>a?.assignedTo?.userId===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByAssigned: ",a),[]}}filterAnnotationsByInvolved(e,t){try{return t.filter(a=>{let i=a?.from?.userId===e.id||a?.from?.email===e.id,c=a?.assignedTo?.userId===e.id,m=a?.comments?.some(h=>h.taggedUserContacts?.some(_=>_?.contact?.userId===e.id));return i||c||m})}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByInvolved: ",a),[]}}filterAnnotationsByPriority(e,t){try{return e.id==="unset"?t.filter(a=>!a?.priority):t.filter(a=>a?.priority?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByPriority: ",a),[]}}filterAnnotationsByStatus(e,t){try{return t.filter(a=>a?.status?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByStatus: ",a),[]}}filterAnnotationsByCommentCategory(e,t){try{return e.id==="other"?t.filter(a=>!a?.commentCategories?.length||a?.commentCategories?.some(i=>i.id===e.id)):t.filter(a=>(a?.commentCategories||[]).some(i=>i.id===e.id))}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByCommentCategory: ",a),[]}}filterAnnotationsByVersion(e,t){try{return e.id==="unset"?t.filter(a=>!a?.location?.version):t.filter(a=>a?.location?.version?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByVersion: ",a),[]}}filterAnnotationsByDocument(e,t){try{return e?.id&&e.id!=="other"?t.filter(a=>a?.metadata?.clientDocumentId?.toString()===e.id):t.filter(a=>!a?.metadata?.clientDocumentId)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByDocument: ",a),[]}}setSidebarButtonCountType(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonCountType:e}}),this.sidebarButtonCountType$.value===e)return;this.sidebarButtonCountType$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setSidebarButtonCountType: ",t)}}getSidebarButtonCountType$(){return this.sidebarButtonCountType$.asObservable()}getSidebarButtonCountType(){return this.sidebarButtonCountType$.value}enableFilterGhostCommentsInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterGhostCommentsInSidebar:!0}}),this.filterGhostCommentsInSidebar$.value===!0)return;this.filterGhostCommentsInSidebar$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFilterGhostCommentsInSidebar: ",e)}}disableFilterGhostCommentsInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterGhostCommentsInSidebar:!1}}),this.filterGhostCommentsInSidebar$.value===!1)return;this.filterGhostCommentsInSidebar$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFilterGhostCommentsInSidebar: ",e)}}getFilterGhostCommentsInSidebar$(){return this.filterGhostCommentsInSidebar$.asObservable()}getFilterGhostCommentsInSidebar(){return this.filterGhostCommentsInSidebar$.value}filterCommentsUsingSidebarSettings(e){try{let t=Array.isArray(e),a;return t?a=e||[]:e?a=[e]:a=[],this.getFilterCommentsOnDom$().pipe(Pe(i=>i?a.length===0?Ee(e):dr([this.effectiveSidebarFilters$,this.customSidebarDataAnnotationIds$]).pipe(Te(([c,m])=>{let h=a,_=!1;if(this.hasActiveFilters(c)){let I=this.applyDirectFilters(a,c),S=new Set(I.map(H=>H.annotationId));h=h.filter(H=>H?.isDraft||S.has(H.annotationId)),_=!0}return m&&(h=h.filter(I=>I?.isDraft||I?.annotationId&&m.has(I.annotationId)),_=!0),_?t?h:h.length>0?h[0]:null:e})):Ee(e)))}catch{return Ee(e)}}enableFocusedThreadMode(){try{if(this.focusedThreadMode$.value===!0)return;this.focusedThreadMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFocusedThreadMode: ",e)}}disableFocusedThreadMode(){try{if(this.focusedThreadMode$.value===!1)return;this.focusedThreadMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFocusedThreadMode: ",e)}}getFocusedThreadMode$(){return this.focusedThreadMode$.asObservable()}enableOpenAnnotationInFocusMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{openAnnotationInFocusMode:!0}}),this.openAnnotationInFocusMode$.value===!0)return;this.openAnnotationInFocusMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableOpenAnnotationInFocusMode: ",e)}}disableOpenAnnotationInFocusMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{openAnnotationInFocusMode:!1}}),this.openAnnotationInFocusMode$.value===!1)return;this.openAnnotationInFocusMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableOpenAnnotationInFocusMode: ",e)}}getOpenAnnotationInFocusMode$(){return this.openAnnotationInFocusMode$.asObservable()}getOpenAnnotationInFocusMode(){return this.openAnnotationInFocusMode$.value}enableReadOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{readOnly:!0}}),this.readOnly$.value===!0)return;this.readOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReadOnly: ",e)}}disableReadOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{readOnly:!1}}),this.readOnly$.value===!1)return;this.readOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReadOnly: ",e)}}getReadOnly$(){return this.readOnly$.asObservable()}getReadOnly(){return this.readOnly$.value}shouldEnableReadOnly(){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentService FUNCTION: shouldEnableReadOnly","color: green;");let e=this.authService.getUser(),t=this.docService.getDocumentPaths()?.folderId,a=this.docService.getDocumentIds().map(i=>i.clientDocumentId);if(e){let i=this.userPermissionService.getCurrentUserPermissions();i?.[e.userId]?t&&i[e.userId]?.folders?.[t]?.accessRole==="viewer"?this.enableReadOnly():a.forEach(c=>{i[e.userId]?.documents?.[c]?.accessRole==="viewer"&&this.enableReadOnly()}):this.getReadOnly()||this.disableReadOnly()}}catch(e){this.loggingService.catch("Error in CommentService shouldEnableReadOnly:",e)}})}sanitizeCommentAnnotation(e){try{return e?.comments?.length&&e.comments.forEach(t=>{t?.commentHtml&&(t.commentHtml=this.domService.sanitizeHtml(t.commentHtml))}),e}catch(t){return this.loggingService.catch("Error in CommentService sanitizeCommentAnnotation: ",t),e}}enableCustomAutocompleteSearch(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customAutocompleteSearch:!0}}),this.customAutocompleteSearch$.value===!0)return;this.customAutocompleteSearch$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCustomAutocompleteSearch: ",e)}}disableCustomAutocompleteSearch(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customAutocompleteSearch:!1}}),this.customAutocompleteSearch$.value===!1)return;this.customAutocompleteSearch$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCustomAutocompleteSearch: ",e)}}getCustomAutocompleteSearch$(){return this.customAutocompleteSearch$.asObservable()}getCustomAutocompleteSearch(){return this.customAutocompleteSearch$.value}enableDeleteThreadWithFirstComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteThreadWithFirstComment:!0}}),this.deleteThreadWithFirstComment$.value===!0)return;this.deleteThreadWithFirstComment$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteThreadWithFirstComment: ",e)}}disableDeleteThreadWithFirstComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteThreadWithFirstComment:!1}}),this.deleteThreadWithFirstComment$.value===!1)return;this.deleteThreadWithFirstComment$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteThreadWithFirstComment: ",e)}}getDeleteThreadWithFirstComment$(){return this.deleteThreadWithFirstComment$.asObservable()}enableExpandMentionGroups(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{expandMentionGroups:!0}}),this.expandMentionGroups$.value===!0)return;this.expandMentionGroups$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableExpandMentionGroups: ",e)}}disableExpandMentionGroups(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{expandMentionGroups:!1}}),this.expandMentionGroups$.value===!1)return;this.expandMentionGroups$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableExpandMentionGroups: ",e)}}getExpandMentionGroups$(){return this.expandMentionGroups$.asObservable()}getExpandMentionGroups(){return this.expandMentionGroups$.value}enableShowMentionGroupsFirst(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsFirst:!0}}),this.showMentionGroupsFirst$.value===!0)return;this.showMentionGroupsFirst$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowMentionGroupsFirst: ",e)}}disableShowMentionGroupsFirst(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsFirst:!1}}),this.showMentionGroupsFirst$.value===!1)return;this.showMentionGroupsFirst$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowMentionGroupsFirst: ",e)}}getShowMentionGroupsFirst$(){return this.showMentionGroupsFirst$.asObservable()}getShowMentionGroupsFirst(){return this.showMentionGroupsFirst$.value}enableShowMentionGroupsOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsOnly:!0}}),this.showMentionGroupsOnly$.value===!0)return;this.showMentionGroupsOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowMentionGroupsOnly: ",e)}}disableShowMentionGroupsOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsOnly:!1}}),this.showMentionGroupsOnly$.value===!1)return;this.showMentionGroupsOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowMentionGroupsOnly: ",e)}}getShowMentionGroupsOnly$(){return this.showMentionGroupsOnly$.asObservable()}getShowMentionGroupsOnly(){return this.showMentionGroupsOnly$.value}setAnalyticsFeatureConfig({config:e,feature:t}){try{this.analyticsService.setFeatureConfig({feature:t||ke.COMMENT,config:e})}catch(a){this.loggingService.catch("Error in CommentService setAnalyticsFeatureConfig: ",a)}}generateContextId(e){try{let t;if(e&&typeof e=="object"){let a=JSON.parse(JSON.stringify(e));if(delete a.accessFields,delete a.access,Object.keys(a).length){let i=an(a),c=JSON.stringify(i);t=ur(c)}}return t}catch{return}}splitProgressCommentsStage(e){try{if(!Array.isArray(e))return e;let t=!1;return e.forEach(a=>{let i=a?.annotationId;if(typeof i!="string"||!i)return;let{comments:c,progress:m}=dp(a);!m.length&&!this.progressCommentsByAnnotationId.has(i)||(a.comments=c,m.length?(this.progressCommentsByAnnotationId.set(i,m),t=!0):(this.progressCommentsByAnnotationId.delete(i)&&(t=!0),this.progressOnlyAnnotationsLogged.delete(i)),!c.length&&m.length&&!this.progressOnlyAnnotationsLogged.has(i)&&(this.progressOnlyAnnotationsLogged.add(i),this.loggingService.log("[velt] progress: annotation currently has only content-less progress comments: "+i)))}),t&&this.progressCommentsVersion$.next(this.progressCommentsVersion$.value+1),e}catch(t){return this.loggingService.catch("Error in CommentService splitProgressCommentsStage:",t),e}}getProgressCommentsVersion$(){return this.progressCommentsVersion$.asObservable()}getFullComments(e){try{let t=Array.isArray(e?.comments)?e.comments:[],a=this.getProgressComments(e?.annotationId);return a.length?[...t,...a].sort((i,c)=>{let m=i?.createdAt instanceof Date?i.createdAt.getTime():Number(i?.createdAt??0),h=c?.createdAt instanceof Date?c.createdAt.getTime():Number(c?.createdAt??0);return m-h}):t}catch{return e?.comments??[]}}spliceProgressCommentsIn(e){try{if(!e?.annotationId||!this.getProgressComments(e.annotationId).length)return;e.comments=this.getFullComments(e)}catch(t){this.loggingService.catch("Error in CommentService spliceProgressCommentsIn:",t)}}withProgressCommentsSpliced(e,t){return Ae(this,null,function*(){try{this.spliceProgressCommentsIn(e);try{return yield t()}finally{this.restoreProgressCommentSplit(e)}}catch(a){this.loggingService.catch("Error in CommentService withProgressCommentsSpliced:",a);return}})}restoreProgressCommentSplit(e){try{if(!e?.annotationId||!this.getProgressComments(e.annotationId).length)return;let{comments:t}=dp(e);e.comments=t}catch(t){this.loggingService.catch("Error in CommentService restoreProgressCommentSplit:",t)}}hasRenderableContent(e){try{if(!e)return!1;if(e.comments?.length)return!0;let t=e.annotationId;if(typeof t!="string"||!t)return!1;let a=Date.now(),i=this.getCommentProgressStaleAfter();return this.getProgressComments(t).some(c=>qg(c,i,a))}catch{return!!e?.comments?.length}}getProgressComments(e){try{return this.progressCommentsByAnnotationId.get(e)??[]}catch{return[]}}evictProgressComments(e){try{e?.forEach(t=>{this.progressCommentsByAnnotationId.delete(t),this.progressOnlyAnnotationsLogged.delete(t)})}catch(t){this.loggingService.catch("Error in CommentService evictProgressComments:",t)}}setCommentProgressStaleAfter(e){try{let t=Number(e);if(!Number.isFinite(t)||t<=0||this.commentProgressStaleAfter$.value===t)return;this.commentProgressStaleAfter$.next(t)}catch(t){this.loggingService.catch("Error in CommentService setCommentProgressStaleAfter:",t)}}getCommentProgressStaleAfter$(){return this.commentProgressStaleAfter$.asObservable()}getCommentProgressStaleAfter(){return this.commentProgressStaleAfter$.value}setMaxReplyAvatars(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{maxReplyAvatars:e}}),this.maxReplyAvatars$.value===e)return;this.maxReplyAvatars$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setMaxReplyAvatars: ",t)}}getMaxReplyAvatars$(){return this.maxReplyAvatars$.asObservable()}getMaxReplyAvatars(){return this.maxReplyAvatars$.value}enableReplyAvatars(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyAvatars:!0}}),this.replyAvatars$.value===!0)return;this.replyAvatars$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReplyAvatars: ",e)}}disableReplyAvatars(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyAvatars:!1}}),this.replyAvatars$.value===!1)return;this.replyAvatars$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReplyAvatars: ",e)}}getReplyAvatars$(){return this.replyAvatars$.asObservable()}getReplyAvatars(){return this.replyAvatars$.value}setCommentplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentplaceholder:e}}),this.commentplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentplaceholder: ",t)}}getCommentplaceholder$(){return this.commentplaceholder$.asObservable()}getCommentplaceholder(){return this.commentplaceholder$.value}setReplyplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyplaceholder:e}}),this.replyplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setReplyplaceholder: ",t)}}getReplyplaceholder$(){return this.replyplaceholder$.asObservable()}getReplyplaceholder(){return this.replyplaceholder$.value}setEditplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editplaceholder:e}}),this.editplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditplaceholder: ",t)}}getEditplaceholder$(){return this.editplaceholder$.asObservable()}getEditplaceholder(){return this.editplaceholder$.value}setEditcommentplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editcommentplaceholder:e}}),this.editcommentplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditcommentplaceholder: ",t)}}getEditcommentplaceholder$(){return this.editcommentplaceholder$.asObservable()}getEditcommentplaceholder(){return this.editcommentplaceholder$.value}setEditreplyplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editreplyplaceholder:e}}),this.editreplyplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditreplyplaceholder: ",t)}}getEditreplyplaceholder$(){return this.editreplyplaceholder$.asObservable()}getEditreplyplaceholder(){return this.editreplyplaceholder$.value}enableScreenshot(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{screenshotEnabled:!0}}),this.screenshotEnabled$.value===!0)return;this.screenshotEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableScreenshot: ",e)}}disableScreenshot(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{screenshotEnabled:!1}}),this.screenshotEnabled$.value===!1)return;this.screenshotEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableScreenshot: ",e)}}getScreenshotEnabled$(){return this.screenshotEnabled$.asObservable()}getScreenshotEnabled(){return this.screenshotEnabled$.value}getAnnotationNumber(e){try{let t=this.commentAnnotationById$.value||{},a=-1,i=Object.values(t).filter(c=>{let m=c.metadata?.documentId===e.metadata?.documentId;return m&&c.annotationNumber&&(a=Math.max(a,c.annotationNumber)),m});return a===-1?i.length+1:a+1}catch(t){return this.loggingService.catch("Error in CommentService getAnnotationNumber: ",t),null}}enableFullScreenInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullScreen:!0}}),this.fullScreenInSidebar$.value===!0)return;this.fullScreenInSidebar$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFullScreenInSidebar: ",e)}}disableFullScreenInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullScreen:!1}}),this.fullScreenInSidebar$.value===!1)return;this.fullScreenInSidebar$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFullScreenInSidebar: ",e)}}getFullScreenInSidebar$(){return this.fullScreenInSidebar$.asObservable()}getFullScreenInSidebar(){return this.fullScreenInSidebar$.value}setComposerFileAttachments(e){try{this.composerFileAttachments$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setComposerFileAttachments: ",t)}}getComposerFileAttachments$(){return this.composerFileAttachments$.asObservable()}getComposerFileAttachments(){return this.composerFileAttachments$.value}clearComposerFileAttachments(){try{this.composerFileAttachments$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearComposerFileAttachments: ",e)}}enableAttachmentNameInMessage(){try{if(this.attachmentNameInMessage$.value===!0)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentNameInMessage:!0}}),this.attachmentNameInMessage$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAttachmentNameInMessage: ",e)}}disableAttachmentNameInMessage(){try{if(this.attachmentNameInMessage$.value===!1)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentNameInMessage:!1}}),this.attachmentNameInMessage$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAttachmentNameInMessage: ",e)}}getAttachmentNameInMessage$(){return this.attachmentNameInMessage$.asObservable()}getAttachmentNameInMessage(){return this.attachmentNameInMessage$.value}setAllowedFileTypes(e){try{this.allowedFileTypes$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setAllowedFileTypes: ",t)}}getAllowedFileTypes$(){return this.allowedFileTypes$.asObservable()}getAllowedFileTypes(){return this.allowedFileTypes$.value}enableForceCloseAllOnEsc(){try{if(this.forceCloseAllOnEsc$.value===!0)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{forceCloseAllOnEsc:!0}}),this.forceCloseAllOnEsc$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableForceCloseAllOnEsc: ",e)}}disableForceCloseAllOnEsc(){try{if(this.forceCloseAllOnEsc$.value===!1)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{forceCloseAllOnEsc:!1}}),this.forceCloseAllOnEsc$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableForceCloseAllOnEsc: ",e)}}getForceCloseAllOnEsc$(){return this.forceCloseAllOnEsc$.asObservable()}getForceCloseAllOnEsc(){return this.forceCloseAllOnEsc$.value}markAsRead(e){return Ae(this,null,function*(){try{let t;e&&(t=this.getAnnotationById(e)),t&&(yield this.withProgressCommentsSpliced(t,()=>this.viewsService?.setCommentAnnotationAsRead(t)))}catch(t){this.loggingService.catch("Error in ViewsService markAsRead:",t)}})}markAsUnread(e){return Ae(this,null,function*(){try{let t;e&&(t=this.getAnnotationById(e)),t&&(yield this.withProgressCommentsSpliced(t,()=>this.viewsService?.setCommentAnnotationAsUnread(t)))}catch(t){this.loggingService.catch("Error in ViewsService markAsUnread:",t)}})}setAutoCompleteScrollConfig(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{autoCompleteScrollConfig:e}});let t=this.autoCompleteScrollConfig$.value,a={itemSize:e.itemSize??t.itemSize,minBufferPx:e.minBufferPx??t.minBufferPx,maxBufferPx:e.maxBufferPx??t.maxBufferPx,templateCacheSize:e.templateCacheSize??t.templateCacheSize};this.autoCompleteScrollConfig$.next(a)}catch(t){this.loggingService.catch("Error in CommentService setAutoCompleteScrollConfig: ",t)}}getAutoCompleteScrollConfig(){return this.autoCompleteScrollConfig$.value}getAutoCompleteScrollConfig$(){return this.autoCompleteScrollConfig$.asObservable()}submitComment(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: submitComment","color: green;"),this.submitComment$.next(e.targetComposerElementId)}catch(t){this.loggingService.catch("Error in CommentService submitComment: ",t)}}onSubmitComment$(){return this.submitComment$.asObservable()}clearComposer(e){try{this.clearComposer$.next(e.targetComposerElementId),this.composerDataMap.delete(e.targetComposerElementId)}catch(t){this.loggingService.catch("Error in CommentService clearComposer: ",t)}}onClearComposer$(){return this.clearComposer$.asObservable()}emitComposerTextChange(e,t,a){try{this.commentActionsService?.onComposerTextChange({text:e,annotation:t,targetComposerElementId:a})}catch(i){this.loggingService.catch("Error in CommentService emitComposerTextChange: ",i)}}setComposerData(e,t){try{this.composerDataMap.set(e,t)}catch(a){this.loggingService.catch("Error in CommentService setComposerData: ",a)}}clearComposerData(e){try{this.composerDataMap.delete(e)}catch(t){this.loggingService.catch("Error in CommentService clearComposerData: ",t)}}getComposerData(e){try{return this.composerDataMap.get(e.targetComposerElementId)||null}catch(t){return this.loggingService.catch("Error in CommentService getComposerData: ",t),null}}};o.\u0275fac=function(t){return new(t||o)(be(sr),be(ro),be(Wv),be(ut),be(Xb),be(ot),be(Ne),be(ob),be(Yb),be($t),be(pf),be(ab),be(mb),be(Dr),be(A),be(hf),be(Dt),be(Df),be(kr),be(rf),be($g),be(ef),be(qb),be(Jg))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function S2(r){try{let o=(r?.composerContent??"").replace(/\s+/g," ").trim();if(o)return o;let n=r?.recordingCount??0;if(n>0)return`${n} ${n===1?"recording":"recordings"}`;let e=r?.attachmentCount??0;return e>0?`${e} ${e===1?"attachment":"attachments"}`:""}catch{return""}}var eu=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_){this.authService=e,this.iamService=t,this.docService=a,this.configService=i,this.commonDbService=c,this.loggingService=m,this.commentService=h,this.userPermissionService=_,this.documentPaths=null,this.LISTENER_BATCH_SIZE=5}getAnnotationsCount(e){try{return this.authService.getUser$().pipe(Gt(t=>!!t),Pe(t=>this.docService.getOrganizationConfig$().pipe(Gt(a=>!!a),Te(()=>t))),Pe(t=>this.commentService.isFeatureAllowed({firebaseUser:t,annotations:[],filteredAnnotations:[]})),Pe(t=>t.featureAllowed?this.iamService.isUserAllowed$().pipe(Te(a=>(t.featureAllowed=a,t))):Ee(t)),Pe(t=>t.featureAllowed?this.processRequest(t,e):Ee(null)),Te(t=>t??{data:null}),ir(Jr))}catch(t){return this.loggingService.catch("Error in CommentService getAnnotationsCount: ",t),Ee({data:null})}}processRequest(e,t){try{return Ee(e).pipe(Pe(()=>this.initializeDocumentPaths(t,e)),Pe(()=>this.getDocumentIds$(t)),Pe(a=>{let i=this.authService.getUser()?.userSnippylyId,c=this.buildRequestContext(t,a);if(!this.validateRequestContext(c,t))return Ee({data:null,mode:c.mode,serverDocumentIds:c.serverDocumentIds});if(!c.organizationId)return Ee({data:null,mode:c.mode,serverDocumentIds:c.serverDocumentIds});let m=this.setupTriggers$(c.mode,c.organizationId,c.clientOrganizationId,c.veltFolderId,c.serverDocumentIds);if(this.shouldUseAggregateMode(c.mode))return this.handleAggregateCounts$({triggers$:m,serverDocumentIds:c.serverDocumentIds,request:t,userId:i,organizationId:c.organizationId,clientOrganizationId:c.clientOrganizationId,veltFolderId:c.veltFolderId,folderId:c.folderId,mode:c.mode}).pipe(Te(h=>({data:h,mode:c.mode,serverDocumentIds:c.serverDocumentIds})));if(c.mode.isBatchedGroupedMode){let h=t?.debounceMs??5e3;return this.handleBatchedGroupedCounts$({triggers$:m,documentIds:a,request:t,userId:i,organizationId:c.organizationId,veltFolderId:c.veltFolderId,debounceMs:h}).pipe(Te(_=>({data:_,mode:c.mode,serverDocumentIds:c.serverDocumentIds})))}else return this.handleGroupedCounts$(m,a,t,i,c.organizationId,c.veltFolderId).pipe(Te(h=>({data:h,mode:c.mode,serverDocumentIds:c.serverDocumentIds})))}),Pe(a=>{if(!a?.data)return Ee(null);let{data:i,mode:c,serverDocumentIds:m}=a;return t?.filterGhostComments?this.filterGhostComments$(i,c,m):Ee(i)}),jr(a=>(this.loggingService.catch("Error processing request: ",a),Ee(null))))}catch(a){return this.loggingService.catch("Error in CommentService getAnnotationsCount: ",a),Ee(null)}}initializeDocumentPaths(e,t){try{return e?Ee(t):this.docService.getDocumentPaths$().pipe(Gt(a=>!!a),Lc(a=>{this.documentPaths=a,t.documentPaths=a}),Te(()=>{}))}catch(a){return this.loggingService.catch("Error in CommentService initializeDocumentPaths: ",a),Ee(t)}}buildRequestContext(e,t){try{let a=this.docService.getOrganizationConfig(),i=this.documentPaths?.organizationId??a?.organizationId,c=this.documentPaths?.clientOrganizationId??a?.clientOrganizationId,m,h,_;if(e?.allDocuments||e?.documentIds||e?.folderId||e?.organizationId||e?.locationIds){if(e.organizationId&&(i=Gv(e.organizationId),c=e.organizationId),!i)throw new Error("organizationId is required for this request type");e.folderId&&(m=mr(e.folderId),h=e.folderId),e.allDocuments&&(_=!0)}else m=this.documentPaths?.veltFolderId,h=this.documentPaths?.folderId,_=this.documentPaths?.allDocuments;let I=this.determineMode(e,m,_,t),S=I.isOrgMode?[]:t.length>0?t.map(H=>H.documentId):[this.documentPaths?.documentId??""];return{organizationId:i,clientOrganizationId:c,veltFolderId:m,folderId:h,allDocuments:_,mode:I,serverDocumentIds:S}}catch(a){return this.loggingService.catch("Error in CommentService buildRequestContext: ",a),{organizationId:void 0,clientOrganizationId:void 0,veltFolderId:void 0,folderId:void 0,allDocuments:void 0,mode:{isOrgMode:!1,isFolderMode:!1,isBatchMode:!1,isBatchedGroupedMode:!1},serverDocumentIds:[]}}}validateRequestContext(e,t){try{if(t?.aggregateDocuments&&!e.serverDocumentIds.length)throw this.loggingService.catch("Error in CommentService getAnnotationsCount: documentIds is required when aggregateDocuments is true"),new Error("documentIds is required when aggregateDocuments is true");return!(!e.organizationId||!(e.mode.isOrgMode||e.mode.isFolderMode)&&e.serverDocumentIds.some(a=>!a))}catch(a){return this.loggingService.catch("Error in CommentService validateRequestContext: ",a),!1}}shouldUseAggregateMode(e){try{return e.isFolderMode||e.isOrgMode||e.isBatchMode}catch(t){return this.loggingService.catch("Error in CommentService shouldUseAggregateMode: ",t),!1}}getDocumentIds$(e){try{return e?.documentIds?.length?Ee(e.documentIds.map(t=>({clientDocumentId:t,documentId:Mg(t)}))):this.docService.getDocumentIds$().pipe(Te(t=>t.length>0?t:[{documentId:this.documentPaths?.documentId??"",clientDocumentId:this.documentPaths?.clientDocumentId||""}]))}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIds: ",t),Ee([])}}determineMode(e,t,a,i){try{let c=!!e?.organizationId&&!e?.documentIds?.length&&!t&&!a,m=!!t&&!!a,h=!!e?.aggregateDocuments&&!a&&!!i?.length,_=(!!e?.batchedPerDocument||i.length>1)&&!!i?.length&&!e?.aggregateDocuments&&!a;return{isOrgMode:c,isFolderMode:m,isBatchMode:h,isBatchedGroupedMode:_}}catch(c){return this.loggingService.catch("Error in CommentService determineMode: ",c),{isOrgMode:!1,isFolderMode:!1,isBatchMode:!1,isBatchedGroupedMode:!1}}}setupTriggers$(e,t,a,i,c){try{if(e.isOrgMode){let m=this.authService.getUser()?.userId??"";return[yn(this.userPermissionService?.getUserPermissionsFromCacheOrFetch({organizationId:a})??Promise.resolve({})).pipe(Pe(_=>m&&_?.[m]?.organization?.[a]?.errorCode===Eg.PERMISSION_DENIED?(this.loggingService.log(`%c[WB] commentViews org listener skipped \u2014 user does not have access to organization: ${a}`,"color: orange;"),Wn):this.commonDbService.dbListener({feature:"organizationMetadata",properties:{useCollectionGroup:!1,isCollection:!1,organizationId:t}}))).pipe(Te(_=>_?.data?.commentViewsUpdatedAt??null),Gt(_=>!!_),ir(Jr))]}else{if(e.isFolderMode)return[this.commonDbService.dbListener({feature:"folder",properties:{useCollectionGroup:!1,isCollection:!1,folderId:i,organizationId:t}}).pipe(Te(h=>h?.data?.commentViewsUpdatedAt??null),Gt(h=>!!h),ir(Jr))];if(e.isBatchMode||e.isBatchedGroupedMode){let m=[];for(let h=0;h<c.length;h+=this.LISTENER_BATCH_SIZE)m.push(c.slice(h,h+this.LISTENER_BATCH_SIZE));return m.map(h=>this.commonDbService.dbListener({feature:"allDocuments",properties:{useCollectionGroup:!0,isCollection:!0,useQuery:!0,firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",t),Qe("metadata.documentId","in",h))]}}).pipe(Te(I=>Object.values(I?.data||{}).map(H=>H?.commentViewsUpdatedAt??null).sort().join(",")),ir(Jr)))}else return c.map(m=>this.commonDbService.dbListener({feature:"documentMetadata",properties:{useCollectionGroup:!1,isCollection:!1,documentId:m,organizationId:t}}).pipe(Te(_=>_?.data?.commentViewsUpdatedAt??null),Gt(_=>!!_),ir(Jr)))}}catch(m){return this.loggingService.catch("Error in CommentService setupTriggers: ",m),[]}}handleGroupedCounts$(e,t,a,i,c,m){try{let h=t.map((_,I)=>e[I].pipe(Wu(void 0),Pe(()=>yn(this.getCountsForDocument$(_.documentId,_.clientDocumentId,a,i,c,m)))));return dr(h).pipe(Te(_=>{let I={};return _.forEach(S=>{S&&(I[S.clientDocumentId]={total:S.total,unread:S.unread})}),{data:I}}),jr(_=>(this.loggingService.catch("Error in grouped counts: ",_),Ee(null))))}catch(h){return this.loggingService.catch("Error in CommentService handleGroupedCounts: ",h),Ee(null)}}handleBatchedGroupedCounts$(e){try{let{triggers$:t,documentIds:a,request:i,userId:c,organizationId:m,veltFolderId:h,debounceMs:_}=e,I=this.LISTENER_BATCH_SIZE,S=new Sh(1),H=t.map((re,se)=>re.pipe(Eh(S),Te(()=>se))),$=Hu(...H).pipe(Nv(_)),j=Ee(-1).pipe(Pe(()=>yn(this.fetchAllDocumentCounts$(a,i,c,m,h))),Te(re=>({batchIndex:-1,data:re?.data||{}})),Lc(()=>{S.next()})),Z=$.pipe(Pe(re=>{let se=re*I,_e=Math.min(se+I,a.length),le=a.slice(se,_e);return yn(this.fetchAllDocumentCounts$(le,i,c,m,h)).pipe(Te(he=>({batchIndex:re,data:he?.data||{}})))}));return Hu(j,Z).pipe(Th((re,se)=>({data:g(g({},re.data),se.data)}),{data:{}}),jr(re=>(this.loggingService.catch("Error in batched grouped counts: ",re),Ee(null))))}catch(t){return this.loggingService.catch("Error in CommentService handleBatchedGroupedCounts: ",t),Ee(null)}}fetchAllDocumentCounts$(e,t,a,i,c){return Ae(this,null,function*(){try{let m=e.map(I=>this.getCountsForDocument$(I.documentId,I.clientDocumentId,t,a,i,c)),h=yield Promise.allSettled(m),_={};return h.forEach(I=>{if(I.status==="fulfilled"&&I.value){let{clientDocumentId:S,total:H,unread:$}=I.value;_[S]={total:H,unread:$}}}),{data:_}}catch(m){return this.loggingService.catch("Error in CommentService fetchAllDocumentCounts: ",m),null}})}handleAggregateCounts$(e){try{let{triggers$:t,serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}=e;return dr(t).pipe(Te(()=>{})).pipe(Wu(void 0),Pe(()=>yn(this.getAggregateCounts({serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}))),jr($=>(this.loggingService.catch("Error in aggregate counts: ",$),Ee(null))))}catch(t){return this.loggingService.catch("Error in CommentService handleAggregateCounts: ",t),Ee(null)}}getCountsForDocument$(e,t,a,i,c,m){return Ae(this,null,function*(){try{let h=this.configService?.getApiKey(),_={useCollectionGroup:!0,isCollection:!0,useQuery:!0,getCount:!0},I=[Qe("metadata.apiKey","==",h),Qe("metadata.organizationId","==",c),Qe("metadata.documentId","in",[e]),...m?[Qe("metadata.veltFolderId","==",m)]:[],...a?.statusIds?.length?[Qe("status.id","in",a.statusIds)]:[],...a?.locationIds?.length?[Qe("location.id","in",a.locationIds)]:[],...a?.agentFields?.length?[Qe("agent.agentFields","array-contains-any",a.agentFields)]:[]],S=[Mr(...I),Xt("lastUpdated","desc"),Xt("createdAt","desc")],H=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},_),{firestoreQuery:S})}),$=0;if(!a?.agentFields?.length){let j=[...I,Qe("viewedByUserIds","array-contains",i)],Z=[Mr(...j),Xt("lastUpdated","desc"),Xt("createdAt","desc")];$=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},_),{firestoreQuery:Z})})}return{clientDocumentId:t,total:H,unread:H-$}}catch(h){return this.loggingService.catch("Error in CommentService getCountsForDocument: ",h),null}})}getAggregateCounts(e){return Ae(this,null,function*(){try{let t="",{serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}=e,H=this.configService?.getApiKey(),$={useCollectionGroup:!0,isCollection:!0,useQuery:!0,getCount:!0},j=[Qe("metadata.apiKey","==",H),Qe("metadata.organizationId","==",m),...i?.statusIds?.length?[Qe("status.id","in",i.statusIds)]:[],...i?.locationIds?.length?[Qe("location.id","in",i.locationIds)]:[],...i?.agentFields?.length?[Qe("agent.agentFields","array-contains-any",i.agentFields)]:[]],Z,re=0;if(S.isFolderMode){t=I??"",j.push(Qe("metadata.veltFolderId","==",_));let se=[Mr(...j),Xt("lastUpdated","desc"),Xt("createdAt","desc")];if(Z=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:se})}),!i?.agentFields?.length){let _e=[...j,Qe("viewedByUserIds","array-contains",c)],le=[Mr(..._e),Xt("lastUpdated","desc"),Xt("createdAt","desc")];re=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:le})})}}else if(S.isOrgMode){t=h??"";let se=[Mr(...j),Xt("lastUpdated","desc"),Xt("createdAt","desc")];if(Z=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:se})}),!i?.agentFields?.length){let _e=[...j,Qe("viewedByUserIds","array-contains",c)],le=[Mr(..._e),Xt("lastUpdated","desc"),Xt("createdAt","desc")];re=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:le})})}}else{t="result";let se=[];for(let he=0;he<a.length;he+=this.LISTENER_BATCH_SIZE)se.push(a.slice(he,he+this.LISTENER_BATCH_SIZE));let _e=se.map(he=>Ae(this,null,function*(){let Se=[...j,Qe("metadata.documentId","in",he),..._?[Qe("metadata.veltFolderId","==",_)]:[]],Re=[Mr(...Se),Xt("lastUpdated","desc"),Xt("createdAt","desc")];return this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:Re})})}));if(Z=(yield Promise.allSettled(_e)).reduce((he,Se)=>he+(Se.status==="fulfilled"&&Se.value||0),0),!i?.agentFields?.length){let he=se.map(Re=>Ae(this,null,function*(){let ze=[...j,Qe("metadata.documentId","in",Re),..._?[Qe("metadata.veltFolderId","==",_)]:[],Qe("viewedByUserIds","array-contains",c)],Ye=[Mr(...ze),Xt("lastUpdated","desc"),Xt("createdAt","desc")];return this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:Ye})})}));re=(yield Promise.allSettled(he)).reduce((Re,ze)=>Re+(ze.status==="fulfilled"&&ze.value||0),0)}}return{data:{[t]:{total:Z,unread:Z-re}}}}catch(t){return this.loggingService.catch("Error in CommentService getAggregateCounts: ",t),null}})}filterGhostComments$(e,t,a){try{return e?this.commentService.getGhostCommentAnnotationMap$().pipe(Te(i=>{if(!i)return e;let c=this.buildGhostCommentAnnotationMap(i),m=this.groupGhostCommentsByModeId(c,t,a);return this.adjustCountsForGhostComments(e,m),e})):Ee(null)}catch(i){return this.loggingService.catch("Error in CommentService filterGhostComments: ",i),Ee(null)}}buildGhostCommentAnnotationMap(e){let t={};return Object.keys(e).forEach(a=>{let i=this.commentService.getAnnotationById(a);i&&(t[a]=i)}),t}groupGhostCommentsByModeId(e,t,a){try{let i={};return Object.values(e).forEach(c=>{let m=this.getModeIdForAnnotation(c,t,a);m&&(i[m]||(i[m]=[]),i[m].push(c))}),i}catch(i){return this.loggingService.catch("Error in CommentService groupGhostCommentsByModeId: ",i),{}}}getModeIdForAnnotation(e,t,a){try{return t.isOrgMode?e?.metadata?.clientOrganizationId||null:t.isFolderMode?e?.metadata?.folderId||null:t.isBatchMode?a.includes(e?.metadata?.documentId??"")?"result":null:e?.metadata?.clientDocumentId||null}catch(i){return this.loggingService.catch("Error in CommentService getModeIdForAnnotation: ",i),null}}adjustCountsForGhostComments(e,t){try{if(typeof e?.data!="object")return;let i=this.authService.getUser()?.userSnippylyId;Object.keys(e.data||{}).forEach(c=>{let m=t[c];if(!(!m||!e?.data?.[c]?.total)&&(e.data[c].total=Math.max(0,e.data[c].total-m.length),i)){let h=m.filter(_=>_?.viewedByUserIds&&!_?.viewedByUserIds?.includes(i));h.length>0&&(e.data[c].unread=Math.max(0,e.data[c].unread-h.length))}})}catch(a){this.loggingService.catch("Error in CommentService adjustCountsForGhostComments: ",a)}}};o.\u0275fac=function(t){return new(t||o)(be(ot),be(Dr),be(ut),be(Wv),be(ro),be(A),be(ae),be(Jg))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var at=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,H,$,j,Z){this.analyticsService=e,this.authService=t,this.commentService=a,this.commentViewsService=i,this.contactService=c,this.customFilterService=m,this.docService=h,this.iamService=_,this.loggingService=I,this.metadataService=S,this.commonDbService=H,this.serviceBook=$,this.suggestionActions=j,this.targetRegistry=Z,this.actionSubjects=new Map,this.defaultSource="internal",this.isUserAdmin=!1,this.subscriptions=[],this.reactionService=null,this.loggingService.log("%c[WB] Creating CLASS: CommentActionsService","color: blue;");try{this.commentService.setCommentActionsService(this),this.iamService.isUserAdmin$().subscribe(re=>{this.isUserAdmin=re}),this.serviceBook.observe(Bg).subscribe(re=>{this.reactionService=re})}catch(re){this.loggingService.catch("Error in CommentActionsService constructor: ",re)}}addCommentAnnotation(c,m){return Ae(this,arguments,function*({annotation:e,options:t,visibility:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addCommentAnnotation","color: green;"),a){if(a.type==="restricted"){let I=this.authService.getUser();I?.userId&&(a=eo(a,I.userId))}if(a.type==="organizationPrivate"&&!a.organizationId&&!a.organizationIds?.length){let I=this.authService.getUser()?.clientOrganizationId;I&&(a=f(g({},a),{organizationId:I}))}let h=this.authService.getUser()?.userId,_=An(a,h);_.length>0&&(e.context||(e.context={}),e.context._setAccessFields=_,e.visibilityConfig=Pn(a,h))}return new Promise(h=>{this.commentService.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,_=>Ae(this,null,function*(){let I=yield this.getAddCommentAnnotationEventFromCommentAddEventData(_);h(I)}),void 0,void 0,e,void 0,void 0,void 0,void 0,void 0,i)})}catch(h){return this.loggingService.catch("Error in CommentActionsService addCommentAnnotation: ",h),null}})}getAddCommentAnnotationEventFromCommentAddEventData(e){return Ae(this,null,function*(){try{let t=yield this.metadataService.getGlobalMetadata();return{commentAnnotation:this.commentService.getCommentAnnotationForClient(e?.annotation),annotationId:e?.annotation?.annotationId,metadata:t,addContext:e?.addContext,elementRef:e?.elementRef}}catch(t){return this.loggingService.catch("Error in CommentActionsService getAddCommentAnnotationEventFromData: ",t),null}})}triggerAddCommentAnnotationEvent(e){try{this.triggerAction(lt.ADD_COMMENT_ANNOTATION,e)}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAddCommentAnnotationEvent: ",t)}}getAddCommentAnnotationDraftEventFromCommentAddEventData(e){return Ae(this,null,function*(){try{return{metadata:yield this.metadataService.getGlobalMetadata(),addContext:e?.addContext}}catch(t){return this.loggingService.catch("Error in CommentActionsService getAddCommentAnnotationEventFromData: ",t),null}})}triggerAddCommentAnnotationDraftEvent(e){try{this.triggerAction(lt.ADD_COMMENT_ANNOTATION_DRAFT,e)}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAddCommentAnnotationDraftEvent: ",t)}}triggerAddCommentDraftEventForAnnotation(e,t){return Ae(this,null,function*(){try{if(!e?.annotationId||!t)return;let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),comment:t,metadata:a};this.triggerAction(lt.ADD_COMMENT_DRAFT,i)}catch(a){this.loggingService.catch("Error in CommentActionsService triggerAddCommentDraftEventForAnnotation: ",a)}})}triggerAnnotationNotFoundError(e){try{this.loggingService.catch("Annotation not found:","The annotation with the given id was not found.")}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAnnotationNotFoundError: ",t)}}deleteCommentAnnotation(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteCommentAnnotation","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let h=this.commentService.getAnnotationById(e,t);if(h){let _=this.authService.getUser();if(this.isUserAdmin||_?.userId===h?.from?.userId){this.commentService.deleteCommentPinAnnotation(h);let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:h.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:I};return this.triggerAction(lt.DELETE_COMMENT_ANNOTATION,S),S}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete it.")}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteCommentAnnotation: ",m),null}})}updatePriority(c,m){return Ae(this,arguments,function*({annotationId:e,priority:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updatePriority","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_=JSON.parse(JSON.stringify(_));let I=_.priority?JSON.parse(JSON.stringify(_.priority)):null;I&&t&&I?.id===t?.id?_.priority=void 0:_.priority=t,this.commentService.saveComment(_,{type:Ze.PRIORITY_CHANGED,newPriority:t,oldPriority:I});let S=yield this.metadataService.getGlobalMetadata(),H={newPriority:t,oldPriority:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};return this.triggerAction(lt.UPDATE_PRIORITY,H),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_PRIORITY_CHANGED,{annotationId:e,commentType:this.commentService.getCommentType(_),oldPriority:_.priority,newPriority:t,commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource}),H}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updatePriority: ",h),null}})}updateStatus(c,m){return Ae(this,arguments,function*({annotationId:e,status:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateStatus","color: green;");let h=this.authService.getUser();if(!h)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_=JSON.parse(JSON.stringify(_));let I=_.status?JSON.parse(JSON.stringify(_.status)):null;_.status=t,_.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(_,{type:Ze.STATUS_CHANGED,newStatus:t,oldStatus:I});let S=yield this.metadataService.getGlobalMetadata(),H={newStatus:t,oldStatus:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};return this.triggerAction(lt.UPDATE_STATUS,H),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_STATUS_CHANGED,{annotationId:e,commentType:this.commentService.getCommentType(_),oldStatus:I,newStatus:t,commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource,commentAnnotationCreatedAt:_.createdAt}),H}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updateStatus: ",h),null}})}updateAccess(c,m){return Ae(this,arguments,function*({annotationId:e,accessMode:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateAccess","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_)if(this.commentService.isPrivateCommentAllowed()){_=JSON.parse(JSON.stringify(_));let I=_.iam?.accessMode;_.iam.accessMode=t,this.commentService.saveComment(_,{type:Ze.ACCESS_MODE_CHANGED,newAccessMode:t,oldAccessMode:I});let S=yield this.metadataService.getGlobalMetadata(),H={newAccessMode:t,oldAccessMode:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};switch(this.triggerAction(lt.UPDATE_ACCESS,H),t){case cr.PRIVATE:this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCESS_MODE_CHANGED,{type:cr.PRIVATE,source:i??this.defaultSource});break;case cr.PUBLIC:this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCESS_MODE_CHANGED,{type:cr.PUBLIC,source:i??this.defaultSource});break;default:break}return H}else this.loggingService.catch("Access Denied","You must be an admin to update the access mode of the comment.");else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updateAccess: ",h),null}})}resolveCommentAnnotation(a){return Ae(this,arguments,function*({annotationId:e,options:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: resolveCommentAnnotation","color: green;");let i=this.authService.getUser();if(!i)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let c=this.commentService.getAnnotationById(e,t);if(c){c=JSON.parse(JSON.stringify(c));let m=this.customFilterService.resolvedStatus,h=c.status?JSON.parse(JSON.stringify(c.status)):null;m&&(c.status=m,c.statusUpdatedByUserId=i?.userId,this.commentService.saveComment(c,{type:Ze.STATUS_CHANGED,newStatus:m,oldStatus:h}));let _=yield this.metadataService.getGlobalMetadata(),I={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(c),metadata:_};return this.triggerAction(lt.RESOLVE_COMMENT,I),I}else this.triggerAnnotationNotFoundError(e);return null}catch(i){return this.loggingService.catch("Error in CommentActionsService resolveCommentAnnotation: ",i),null}})}getLink(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getLink","color: green;");let m=this.commentService.getAnnotationById(e,t);if(m){let h=this.commentService.getCommentUrl(m)??null,_=yield this.metadataService.getGlobalMetadata();return{link:h,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:_}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService getLink: ",m),null}})}copyLink(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: copyLink","color: green;");let m=yield this.getLink({annotationId:e,options:t},a);if(m?.link){Db(m.link),this.commentService.setCopyLink(m.link),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_LINK_COPIED,{annotationId:e,commentType:this.commentService.getCommentType(m.commentAnnotation),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource,link:m.link});let h=yield this.metadataService.getGlobalMetadata(),_={link:m.link,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m.commentAnnotation),metadata:h};return this.triggerAction(lt.COPY_LINK,_),_}return null}catch(m){return this.loggingService.catch("Error in CommentActionsService copyLink: ",m),null}})}addComment(_,I){return Ae(this,arguments,function*({annotationId:e,comment:t,assignedTo:a,assigned:i,options:c,visibility:m},h){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addComment","color: green;");let S=this.authService.getUser();if(!S)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;if(S){let H=this.commentService.getAnnotationById(e,c),$=H?.comments?.length?Ze.ADDED:Ze.NEWLY_ADDED;if(H){H.status.type==="terminal"&&(H.status=this.customFilterService.defaultStatus);let j=new qn;j=g(g({},j),t),j.lastUpdated=new Date,j.attachments||(j.attachments=[]),j.attachments=j.attachments.filter(le=>le?.attachmentId),j.createdAt=this.timestamp,j.from=S,a&&(H.assignedTo=a),this.commentService.saveComment(H,{type:$,updatedComment:j,assigned:i,visibility:m,_dispatchAddCommentEvent:!0});let Z=f(g({},H),{comments:[...H.comments||[],j]}),re=yield this.buildAddCommentEvent({annotation:Z,newComment:j});if(!re)return null;let se=t?.commentId,_e=this.calculateCommentThreadIndex(t,H);return this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ADDED,{annotationId:e,commentThreadId:se,commentThreadIndex:_e,commentType:this.commentService.getCommentType(H),commentMode:this.commentService.getCommentMode(),source:h??this.defaultSource,commentAnnotationCreatedAt:H.createdAt,taggedClientUserIds:j.taggedUserContacts?.map(le=>le.contact?.userId).filter(le=>!!le),taggedSnippylyUserIds:j.taggedUserContacts?.filter(le=>!!H?.metadata?.apiKey&&!!le.contact?.userId).map(le=>Ng(H.metadata.apiKey,le.contact.userId))}),re}else this.triggerAnnotationNotFoundError(e)}return null}catch(S){return this.loggingService.catch("Error in CommentActionsService addComment: ",S),null}})}buildAddCommentEvent(a){return Ae(this,arguments,function*({annotation:e,newComment:t}){try{let i=yield this.metadataService.getGlobalMetadata();return{annotationId:e.annotationId,commentId:t?.commentId,comment:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:i}}catch(i){return this.loggingService.catch("Error in CommentActionsService buildAddCommentEvent: ",i),null}})}triggerAddCommentEvent(a){return Ae(this,arguments,function*({annotation:e,newComment:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: triggerAddCommentEvent","color: green;");let i=yield this.buildAddCommentEvent({annotation:e,newComment:t});return i&&this.triggerAction(lt.ADD_COMMENT,i),i}catch(i){return this.loggingService.catch("Error in CommentActionsService triggerAddCommentEvent: ",i),null}})}approveCommentAnnotation(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: approveCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t);if(m){m.approved=!0,this.commentService.saveComment(m,{type:Ze.APPROVED}),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_APPROVED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource});let h=yield this.metadataService.getGlobalMetadata(),_={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:h};return this.triggerAction(lt.APPROVE_COMMENT_ANNOTATION,_),_}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService approveComment: ",m),null}})}acceptCommentAnnotation(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: acceptCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=m.status?JSON.parse(JSON.stringify(m.status)):null;m.status=X.CommentAcceptStatus,m.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(m,{type:Ze.ACCEPTED,oldStatus:_,newStatus:X.CommentAcceptStatus});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:I,actionUser:h,replaceContentHtml:m?.comments?.length?m?.comments[0]?.replaceContentHtml:void 0,replaceContentText:m?.comments?.length?m?.comments[0]?.replaceContentText:void 0};return this.triggerAction(lt.ACCEPT_COMMENT_ANNOTATION,S),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCEPTED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService acceptCommentAnnotation: ",m),null}})}rejectCommentAnnotation(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: rejectCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=m.status?JSON.parse(JSON.stringify(m.status)):null;m.status=X.CommentRejectStatus,m.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(m,{type:Ze.REJECTED,oldStatus:_,newStatus:X.CommentRejectStatus});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:I,actionUser:h,replaceContentHtml:m?.comments?.length?m?.comments[0]?.replaceContentHtml:void 0,replaceContentText:m?.comments?.length?m?.comments[0]?.replaceContentText:void 0};return this.triggerAction(lt.REJECT_COMMENT_ANNOTATION,S),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_REJECTED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService rejectCommentAnnotation: ",m),null}})}ensureSuggestionObject(e){try{if(!e||e?.suggestion||!(e?.type==="suggestion"||e?.commentType==="suggestion"))return;e.suggestion={status:"pending",targetId:"",targetType:"custom",oldValue:null,newValue:null,summary:null,driftDetected:!1,rejectReason:null,resolvedBy:null,resolvedAt:null}}catch(t){this.loggingService.catch("Error in CommentActionsService ensureSuggestionObject: ",t)}}acceptSuggestion(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: acceptSuggestion","color: green;");let m=this.authService.getUser();if(!m)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let h=this.commentService.getAnnotationById(e,t);if(!h)return this.triggerAnnotationNotFoundError(e),null;if(this.ensureSuggestionObject(h),!(h.type==="suggestion"||h.commentType==="suggestion")||!h.suggestion||h.suggestion.status!=="pending")return null;let _=h.suggestion.targetId;if(_){if(!this.targetRegistry.getNode(_)){h.suggestion.status="stale",h.suggestion.resolvedBy=m,h.suggestion.resolvedAt=this.timestamp,h.statusUpdatedByUserId=m?.userId,this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"stale",targetId:_}),this.commentService.updateComment(h),this.suggestionActions.projectAndTrigger(Ig.SUGGESTION_STALE,h);let Z=yield this.metadataService.getGlobalMetadata(),re={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:Z,actionUser:m};return this.triggerAction(lt.SUGGESTION_ACCEPTED,re),re}let $=this.targetRegistry.getGetter(_),j=!1;if($)try{let Z=$();j=!ln(Z,h.suggestion.oldValue)}catch{j=!1}h.suggestion.driftDetected=j}h.suggestion.status="accepted",h.suggestion.resolvedBy=m,h.suggestion.resolvedAt=this.timestamp,h.statusUpdatedByUserId=m?.userId,h.type="comment",h?.agent?.agentFields&&typeof h.agent.agentFields=="object"&&Array.isArray(h.agent.agentFields)&&(h.agent.agentFields=h.agent.agentFields.filter(H=>H!=="status:suggestion"),h.agent.agentFields.includes("status:accepted")||h.agent.agentFields.push("status:accepted")),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"accepted",targetId:_,driftDetected:h.suggestion?.driftDetected}),this.commentService.saveComment(h,{type:Ze.SUGGESTION_ACCEPTED}),this.suggestionActions.projectAndTrigger(Ig.SUGGESTION_APPROVED,h),this.analyticsService.trackEvent(oe.Events.Comments.SUGGESTION_ACCEPTED,{annotationId:e});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:I,actionUser:m};return this.triggerAction(lt.SUGGESTION_ACCEPTED,S),S}catch(m){return this.loggingService.catch("Error in CommentActionsService acceptSuggestion: ",m),null}})}rejectSuggestion(c,m){return Ae(this,arguments,function*({annotationId:e,reason:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: rejectSuggestion","color: green;");let h=this.authService.getUser();if(!h)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(!_)return this.triggerAnnotationNotFoundError(e),null;if(this.ensureSuggestionObject(_),!(_.type==="suggestion"||_.commentType==="suggestion")||!_.suggestion||_.suggestion.status!=="pending")return null;_.suggestion.status="rejected",_.suggestion.rejectReason=t??null,_.suggestion.resolvedBy=h,_.suggestion.resolvedAt=this.timestamp,_.statusUpdatedByUserId=h?.userId,_.type="comment",_?.agent?.agentFields&&typeof _.agent.agentFields=="object"&&Array.isArray(_.agent.agentFields)&&(_.agent.agentFields=_.agent.agentFields.filter(H=>H!=="status:suggestion"),_.agent.agentFields.includes("status:rejected")||_.agent.agentFields.push("status:rejected")),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_REJECT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"rejected",targetId:_.suggestion.targetId}),this.commentService.saveComment(_,{type:Ze.SUGGESTION_REJECTED}),this.suggestionActions.projectAndTrigger(Ig.SUGGESTION_REJECTED,_),this.analyticsService.trackEvent(oe.Events.Comments.SUGGESTION_REJECTED,{annotationId:e});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:I,actionUser:h,rejectReason:t??null};return this.triggerAction(lt.SUGGESTION_REJECTED,S),S}catch(h){return this.loggingService.catch("Error in CommentActionsService rejectSuggestion: ",h),null}})}toggleNotificationSubscription(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: toggleNotificationSubscription","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=ur(h.userId);if(_){m.subscribedUsers||(m.subscribedUsers={}),m.unsubscribedUsers||(m.unsubscribedUsers={});let I,S=!1;if(m?.unsubscribedUsers?.[_])S=!1;else if(m?.subscribedUsers?.[_])S=!0;else{let j=this.contactService.getCurrentOrganizationUserIAM();if(j){let Z=j.groups||{};Object.keys(Z).forEach(re=>{m?.subscribedGroups?.[re]&&(S=!0)})}}if(a==="subscribe"||!a&&!S)delete m.unsubscribedUsers[_],m.subscribedUsers[_]={user:h,type:"manual"},I=Ze.SUBSCRIBED;else if(a==="unsubscribe"||!a&&S)delete m.subscribedUsers[_],m.unsubscribedUsers[_]={user:h,type:"manual"},I=Ze.UNSUBSCRIBED;else return null;this.commentService.saveComment(m,{type:I});let H=yield this.metadataService.getGlobalMetadata(),$={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:H};return I===Ze.SUBSCRIBED?this.triggerAction(lt.SUBSCRIBE_COMMENT_ANNOTATION,$):this.triggerAction(lt.UNSUBSCRIBE_COMMENT_ANNOTATION,$),$}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService toggleNotificationSubscription: ",m),null}})}assignUser(c,m){return Ae(this,arguments,function*({annotationId:e,assignedTo:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: assignUser","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_.assignedTo=t,this.commentService.saveComment(_,{type:Ze.ASSIGNED,assignedTo:t});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,assignedTo:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:I};return this.triggerAction(lt.ASSIGN_USER,S),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ASSIGNED,{annotationId:e,commentType:this.commentService.getCommentType(_),commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource,assignedToUserId:t?.userId}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService assignUser: ",h),null}})}getComment(a){return Ae(this,arguments,function*({annotationId:e,options:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getComment","color: green;");let i=this.commentService.getAnnotationById(e,t);return i?i.comments||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(i){return this.loggingService.catch("Error in CommentActionsService getComment: ",i),[]}})}updateOrDeleteComment(e,t,a,i,c,m){return Ae(this,null,function*(){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateOrDeleteComment","color: green;"),t?.commentText?.trim()||t?.attachments?.length||t?.recorders?.length||lp(t)){let h=this.authService.getUser();if(this.isUserAdmin||h?.userId===t?.from?.userId){t.lastUpdated=new Date,t.status=Ze.UPDATED,!t.isEdited&&Kc(m)&&(t.isEdited=!0,t.editedAt=new Date),this.commentService.saveComment(e,{type:Ze.UPDATED,updatedComment:t});let _=yield this.metadataService.getGlobalMetadata(),I={annotationId:e?.annotationId,commentId:t?.commentId,comment:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:_};return this.triggerAction(lt.UPDATE_COMMENT,I),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_EDITED,{annotationId:e?.annotationId,commentThreadId:t?.commentId,commentType:this.commentService.getCommentType(e),commentMode:this.commentService.getCommentMode(),source:c??this.defaultSource}),I}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to update it.")}else yield this.deleteComment({annotationId:e?.annotationId,commentId:t.commentId,skipDeleteThreadConfirmation:a,options:i});return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updateOrDeleteComment: ",h),null}})}updateComment(h,_){return Ae(this,arguments,function*({annotationId:e,comment:t,skipDeleteThreadConfirmation:a,merge:i,options:c},m){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateComment","color: green;");let I=this.commentService.getAnnotationById(e,c),S=this.authService.getUser();if(!S)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;if(I&&S){this.commentService.spliceProgressCommentsIn(I);try{let H=t,$=I.comments?.find(j=>j.commentId===t.commentId);if($){if(this.isUserAdmin||S?.userId===$?.from?.userId)return I?.status.type==="terminal"&&(I.status=this.customFilterService.defaultStatus),i&&(H=g(g({},$),t)),H.from=$.from,H.createdAt=$.createdAt,H.lastUpdated=new Date,yield this.updateOrDeleteComment(I,H,a,c,m,$);this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to update it.")}}finally{this.commentService.restoreProgressCommentSplit(I)}}else this.triggerAnnotationNotFoundError(e);return null}catch(I){return this.loggingService.catch("Error in CommentActionsService updateComment: ",I),null}})}deleteComment(m,h){return Ae(this,arguments,function*({annotationId:e,commentId:t,skipDeleteThreadConfirmation:a,options:i},c){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteComment","color: green;");let _=this.commentService.getAnnotationById(e,i),I=this.authService.getUser();if(!_)return this.triggerAnnotationNotFoundError(e),null;this.commentService.spliceProgressCommentsIn(_);try{let S=_.comments?.find(re=>re?.commentId===t);if(!S)return null;if(!(this.isUserAdmin||I?.userId===S?.from?.userId))return this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete it."),null;let H=this.commentService.willDeleteWholeAnnotation(_,t),$=this.commentService.getCommentAnnotationForClient(_);if(!a&&!(yield this.commentService.confirmDeleteCommentIfRequired(_,S)))return null;this.commentService.saveComment(_,{type:Ze.DELETED,updatedComment:S,skipDeleteThreadConfirmation:!0});let j=yield this.metadataService.getGlobalMetadata(),Z={annotationId:e,commentId:t,commentAnnotation:$,comment:S,metadata:j};if(H){let re={annotationId:e,commentAnnotation:$,metadata:j};this.triggerAction(lt.DELETE_COMMENT_ANNOTATION,re)}else this.triggerAction(lt.DELETE_COMMENT,Z);return Z}finally{this.commentService.restoreProgressCommentSplit(_)}}catch(_){return this.loggingService.catch("Error in CommentActionsService deleteComment: ",_),null}})}addAttachment(c,m){return Ae(this,arguments,function*({annotationId:e,files:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addAttachment","color: green;");let h=[],_=this.commentService.getAnnotationById(e,a);if(_||i==="internal"){let H=[];t.forEach($=>{let{valid:j,file:Z,maxAllowedSize:re,error:se}=this.validateFile($);j&&Z?H.push(this.uploadFile(Z,_||{}).then(_e=>({valid:j,file:Z,maxAllowedSize:re,error:se,attachment:_e||void 0}))):H.push(Promise.resolve({valid:j,file:Z,maxAllowedSize:re,error:se,attachment:void 0}))}),h=yield Promise.all(H)}else this.triggerAnnotationNotFoundError(e);let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:_?this.commentService.getCommentAnnotationForClient(_):void 0,attachments:h,metadata:I};return this.triggerAction(lt.ADD_ATTACHMENT,S),h}catch(h){return this.loggingService.catch("Error in CommentActionsService addAttachment: ",h),[]}})}validateFile(e){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: validateFile","color: green;");let t=100*1024*1024;(e?.type?.includes("image")||e?.type?.includes("pdf"))&&(t=15*1024*1024);let a=e.size<=t;return{valid:a,file:e,maxAllowedSize:t,maxAllowedSizeInMB:t/1024/1024,error:a?void 0:`File size should be less than ${t/1024/1024} MB`}}catch(t){return this.loggingService.catch("Error in CommentActionsService validateFile: ",t),{valid:!1,maxAllowedSize:0,maxAllowedSizeInMB:0,error:"Error in validating file"}}}deleteAttachment(c){return Ae(this,arguments,function*({annotationId:e,commentId:t,attachmentId:a,options:i}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteAttachment","color: green;");let m=this.commentService.getAnnotationById(e,i);if(m){let h=m.comments?.find(I=>I?.commentId===t),_=m.metadata;if(h){let I=this.authService.getUser();if(this.isUserAdmin||I?.userId===h?.from?.userId){let S=h.attachments?.find(H=>H?.attachmentId===a);if(S){h.attachments=h.attachments?.filter(Z=>Z?.attachmentId!==a);let H={attachmentId:S.attachmentId,organizationId:_?.clientOrganizationId??_?.organizationId??null,documentId:_?.clientDocumentId??_?.documentId??null,folderId:_?.folderId??null,commentAnnotationId:m.annotationId,apiKey:_?.apiKey??null};yield this.commentService.deleteAttachment({attachment:S,metadata:H});let $=yield this.metadataService.getGlobalMetadata(),j={attachment:S,annotationId:e,commentId:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:$};return this.triggerAction(lt.DELETE_ATTACHMENT,j),this.updateComment({annotationId:e,comment:h,options:i}),j}}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete the attachment.")}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteAttachment: ",m),null}})}getAttachment(i){return Ae(this,arguments,function*({annotationId:e,commentId:t,options:a}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getAttachment","color: green;");let c=this.commentService.getAnnotationById(e,a);return c?c.comments?.find(h=>h?.commentId===t)?.attachments||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(c){return this.loggingService.catch("Error in CommentActionsService getAttachment: ",c),[]}})}uploadFile(e,t){return Ae(this,null,function*(){try{return this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: uploadFile","color: green;"),this.commentService.uploadFile(e,t)}catch(a){return this.loggingService.catch("Error in CommentActionsService uploadFile: ",a),null}})}getRecording(i){return Ae(this,arguments,function*({annotationId:e,commentId:t,options:a}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getRecording","color: green;");let c=this.commentService.getAnnotationById(e,a);return c?c.comments?.find(h=>h?.commentId===t)?.recorders||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(c){return this.loggingService.catch("Error in CommentActionsService getRecording: ",c),[]}})}deleteRecording(c){return Ae(this,arguments,function*({annotationId:e,commentId:t,recorderId:a,options:i}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteRecording","color: green;");let m=this.commentService.getAnnotationById(e,i);if(m){let h=m.comments?.find(_=>_?.commentId===t);if(h){let _=this.authService.getUser();if(this.isUserAdmin||_?.userId===h?.from?.userId){let I=h.recorders?.find(S=>S?.id===a);if(I){h.recorders=h.recorders?.filter($=>$?.id!==a);let S=yield this.metadataService.getGlobalMetadata(),H={annotationId:e,commentId:t,recording:I,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:S};return this.triggerAction(lt.DELETE_RECORDING,H),this.updateComment({annotationId:e,comment:h,skipDeleteThreadConfirmation:!0,options:i}),H}}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete the recording.")}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteRecording: ",m),null}})}fetchCommentAnnotations(e){return Ae(this,null,function*(){try{let t=yield this.commentService.fetchCommentAnnotations(e),a;if(t?.hasMore){let c=t?.data[t?.data?.length-1];a=yield xb(c?.lastUpdated?.toString()??"","veltencrypttoken","veltencrypttoken")}let i=t?.data?.reduce((c,m)=>(c[m.metadata.clientDocumentId??m.metadata.documentId]=c[m.metadata.clientDocumentId??m.metadata.documentId]||[],c[m.metadata.clientDocumentId??m.metadata.documentId].push(this.commentService.getCommentAnnotationForClient(m)),c),{});return g({data:i},t?.hasMore?{nextPageToken:a}:{})}catch(t){return this.loggingService.catch("Error in CommentActionsService fetchCommentAnnotations: ",t),{data:null}}})}toggleReaction(m,h){return Ae(this,arguments,function*({annotationId:e,commentId:t,reaction:a,options:i},c){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: toggleReaction","color: green;");let _=this.commentService.getAnnotationById(e,i),I=this.authService.getUser();if(_&&I){this.commentService.spliceProgressCommentsIn(_);try{let S=_.comments?.find(H=>H?.commentId===t);if(S){let H=yield this.reactionService?.addOrUpdateReaction(a.reactionId,S?.reactionAnnotationIds||[],void 0,void 0,_?.annotationId,a.customReaction,c),$=Ze.REACTION_ADDED;if(H){H?.reactions?.find(re=>re.from?.userId===I?.userId)||($=Ze.REACTION_DELETED),S.reactionAnnotationIds||(S.reactionAnnotationIds=[]),S.reactionAnnotationIds.includes(H.annotationId)||S.reactionAnnotationIds.push(H.annotationId),H?.reactions?.length||(S.reactionAnnotationIds=S.reactionAnnotationIds.filter(re=>re!==H.annotationId)),this.commentService.saveComment(_,{type:$,updatedComment:S});let j=yield this.metadataService.getGlobalMetadata(),Z={annotationId:e,commentId:t,reaction:H,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:j};return c==="add"?this.triggerAction(lt.ADD_REACTION,Z):c==="delete"?this.triggerAction(lt.DELETE_REACTION,Z):this.triggerAction(lt.TOGGLE_REACTION,Z),$===Ze.REACTION_ADDED?this.analyticsService.trackEvent(oe.Events.Comments.REACTION_ADDED,{annotationId:e,commentId:t,reactionId:a.reactionId,commentMode:this.commentService.getCommentMode()}):$===Ze.REACTION_DELETED&&this.analyticsService.trackEvent(oe.Events.Comments.REACTION_DELETED,{annotationId:e,commentId:t,reactionId:a.reactionId,commentMode:this.commentService.getCommentMode()}),Z}}}finally{this.commentService.restoreProgressCommentSplit(_)}}else this.triggerAnnotationNotFoundError(e);return null}catch(_){return this.loggingService.catch("Error in CommentActionsService toggleReaction: ",_),null}})}onComposerClick(t){return Ae(this,arguments,function*({commentAnnotation:e}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onComposerClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={commentAnnotation:e?.annotationId?this.commentService.getCommentAnnotationForClient(e):void 0,metadata:a};this.triggerAction(lt.COMPOSER_CLICKED,i)}catch(a){this.loggingService.catch("Error in CommentActionsService onComposerClick: ",a)}})}onComposerTextChange(e){return Ae(this,null,function*(){try{let t=yield this.metadataService.getGlobalMetadata(),a={text:e.text,annotation:e.annotation,targetComposerElementId:e.targetComposerElementId,metadata:t};this.commentService.setComposerData(e.targetComposerElementId,a),this.triggerAction(lt.COMPOSER_TEXT_CHANGE,a)}catch(t){this.loggingService.catch("Error in CommentActionsService onComposerTextChange: ",t)}})}autocompleteSearch(e){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: autocompleteSearch","color: green;");let t=yield this.metadataService.getGlobalMetadata();e.metadata=t,this.triggerAction(lt.AUTOCOMPLETE_SEARCH,e)}catch(t){this.loggingService.catch("Error in CommentActionsService autocompleteSearch: ",t)}})}onCommentPinClick(e){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentPinClick","color: green;");let t=yield this.metadataService.getGlobalMetadata(),a={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:t};return this.triggerAction(lt.COMMENT_PIN_CLICKED,a),a}catch(t){return this.loggingService.catch("Error in CommentActionsService onCommentPinClick: ",t),null}})}onCommentBubbleClick(e){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentBubbleClick","color: green;");let t=yield this.metadataService.getGlobalMetadata(),a={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:t};return this.triggerAction(lt.COMMENT_BUBBLE_CLICKED,a),a}catch(t){return this.loggingService.catch("Error in CommentActionsService onCommentBubbleClick: ",t),null}})}onCommentToolClick(e,t){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentToolClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={context:e,targetElementId:t,metadata:a},c={context:e,targetElementId:t,metadata:a};return this.triggerAction(lt.COMMENT_TOOL_CLICK,i),this.triggerAction(lt.COMMENT_TOOL_CLICKED,c),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onCommentToolClick: ",a),null}})}onSidebarButtonClick(){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onSidebarButtonClick","color: green;");let e=yield this.metadataService.getGlobalMetadata(),t={metadata:e},a={metadata:e};return this.triggerAction(lt.SIDEBAR_BUTTON_CLICK,t),this.triggerAction(lt.SIDEBAR_BUTTON_CLICKED,a),t}catch(e){return this.loggingService.catch("Error in CommentActionsService onSidebarButtonClick: ",e),null}})}onAttachmentDownloadClick(e,t){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onAttachmentDownloadClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),attachment:t,metadata:a};return this.triggerAction(lt.ATTACHMENT_DOWNLOAD_CLICKED,i),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onAttachmentDownloadClick: ",a),null}})}onCommentSaveTriggered(e,t){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentSaveTriggered","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(t),metadata:a};return this.triggerAction(lt.COMMENT_SAVE_TRIGGERED,i),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onCommentSaveTriggered: ",a),null}})}onVisibilityOptionClick(e,t,a){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onVisibilityOptionClick","color: green;");let i=yield this.metadataService.getGlobalMetadata(),c={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),visibility:t,users:a?.map(m=>Rb(m)).filter(Boolean),metadata:i};return this.triggerAction(lt.VISIBILITY_OPTION_CLICKED,c),c}catch(i){return this.loggingService.catch("Error in CommentActionsService onVisibilityOptionClick: ",i),null}})}convert(e){try{if(e?.options){let{documentId:t,organizationId:a}=this.docService.getServerId(e?.options);e.options=f(g({},e?.options),{documentId:t,organizationId:a})}return this}catch(t){return this.loggingService.catch("Error in CommentActionsService convert: ",t),this}}emitCommentActionClicked(e){return Ae(this,null,function*(){try{let t=yield this.metadataService.getGlobalMetadata(),a=f(g(g({action:e.action,actionId:e.action?.id,scope:e.scope,annotationId:e.annotationId},e.commentId!==void 0?{commentId:e.commentId}:{}),e.comment!==void 0?{comment:e.comment}:{}),{commentAnnotation:this.commentService.getCommentAnnotationForClient(e.annotation),actionUser:this.authService.getUser(),metadata:t});return this.triggerAction(lt.COMMENT_ACTION_CLICKED,a),a}catch(t){return this.loggingService.catch("Error in CommentActionsService emitCommentActionClicked: ",t),null}})}triggerAction(e,t){try{this.actionSubjects.has(e)||this.actionSubjects.set(e,new jt),this.actionSubjects.get(e)?.next(t)}catch(a){this.loggingService.catch("Error in CommentActionsService triggerAction: ",a)}}onAction(e){try{return this.actionSubjects.has(e)||this.actionSubjects.set(e,new jt),this.actionSubjects.get(e)?.asObservable()}catch(t){return this.loggingService.catch("Error in CommentActionsService onAction: ",t),Ee(null)}}get timestamp(){return this.commonDbService.getServerTimestamp()}getCommentAnnotations(e){try{if(e){if(e?.allDocuments&&!e?.folderId)return this.loggingService.catch("folderId is required when allDocuments is true."),Ee({data:null});if(!e?.allDocuments&&!e?.documentIds?.length)return this.loggingService.catch("documentIds is required."),Ee({data:null})}return this.commentService.getAllCommentAnnotations({excludeDomChanges:!0,skipPositionCalculation:!0,query:e,addFilterCommentsOnDomCheck:!0}).pipe(Te(t=>t?t.reduce((a,i)=>{let c=i.metadata?.clientDocumentId;return!c||e?.documentIds&&!e?.documentIds?.includes(c)||(a[c]||(a[c]=[]),a[c].push(i)),a},{}):null),Te(t=>({data:t})))}catch(t){return this.loggingService.catch("Error in CommentActionsService getCommentAnnotation: ",t),Ee({data:null})}}getCommentAnnotationsCount$(e){try{return this.commentViewsService.getAnnotationsCount(e).pipe(Te(t=>t||{data:null}))}catch(t){return this.loggingService.catch("Error in CommentActionsService getCommentAnnotation: ",t),Ee({data:null})}}updateVisibility(e){this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateVisibility","color: green;");try{let t=e.annotationId;if(!t)throw new Error("annotationId is required in visibility config");if(e.type==="restricted"){let h=this.authService.getUser();if(!h?.userId)throw new Error("Current user not found. Cannot set restricted visibility without userIds.");e=eo(e,h.userId)}if(e.type==="organizationPrivate"&&!e.organizationId&&!e.organizationIds?.length){let h=this.authService.getUser()?.clientOrganizationId;if(!h)throw new Error("No organizationId found. Cannot set organizationPrivate visibility without organizationId.");e=f(g({},e),{organizationId:h})}this.analyticsService.trackEvent(oe.Events.Comments.UPDATE_VISIBILITY_TRIGGERED,{payload:{annotationId:t,visibility:e}});let a=this.commentService.getCommentAnnotationByIdSync(t)?.from?.userId,i=a??this.authService.getUser()?.userId;a||this.loggingService.warn(`updateVisibility: annotation ${t} not in local cache \u2014 falling back to current user for the author access token`);let c=An(e,i),m=Pn(e,i);return this.commentService.updateCommentAnnotationContext(t,{_setAccessFields:c,_setVisibilityConfig:m},{merge:!0})}catch(t){return this.loggingService.catch("Error in updateVisibility: ",t),Promise.resolve()}}calculateCommentThreadIndex(e,t){try{let a=e?.commentId,i;return a&&(i=t?.comments?.findIndex(c=>c.commentId===a)),i===-1&&(i=t?.comments?.length),i}catch(a){this.loggingService.catch("Error in calculateCommentThreadIndex: ",a);return}}};o.\u0275fac=function(t){return new(t||o)(be(sr),be(ot),be(ae),be(eu),be($t),be(Dt),be(ut),be(Dr),be(A),be($g),be(ro),be(kr),be(Kg),be(Yg))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var tu=(()=>{let o=class o{constructor(e){this.loggingService=e,this.commentTextData$=new De({});try{this.loggingService.log("%c[WB] Creating CLASS: CommentTextService","color: blue;")}catch(t){this.loggingService.catch("Error in CommentTextService constructor: ",t)}}setCommentTextData(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: setCommentTextData","color: green;");let t=e.annotationId||e.multiThreadAnnotationId;if(t){let a=e.componentId,i=this.commentTextData$.getValue();i[t]||(i[t]={}),i[t][a]=e,this.commentTextData$.next(i),this.updateLastPositionInDataByAnnotationId(t)}}catch(t){this.loggingService.catch("Error in CommentTextService setCommentTextData: ",t)}}removeCommentTextData(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: removeCommentTextData","color: green;");let t=e.annotationId||e.multiThreadAnnotationId;if(t){let a=e.componentId,i=this.commentTextData$.getValue();delete i[t][a],this.commentTextData$.next(i),this.updateLastPositionInDataByAnnotationId(t)}}catch(t){this.loggingService.catch("Error in CommentTextService removeCommentTextData: ",t)}}updateLastPositionInDataByAnnotationId(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: updateLastPositionInDataByAnnotationId","color: green;");let t=this.commentTextData$.getValue();Object.values(t[e]).forEach(a=>{a.last=this.checkIfLast(a)}),this.commentTextData$.next(t)}catch(t){this.loggingService.catch("Error in CommentTextService updateLastPositionInDataByAnnotationId: ",t)}}checkIfLast(e){try{if(this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: checkIfLast","color: green;"),e?.elementRef?.nativeElement){let t=e.elementRef.nativeElement.getRootNode(),a=t instanceof Document||t instanceof ShadowRoot?t:document,i=[];if(e.annotationId?i=Array.from(a.querySelectorAll(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.ANNOTATION_ID}="${e.annotationId}"]`)):e.multiThreadAnnotationId&&(i=Array.from(a.querySelectorAll(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.MULTI_THREAD_ANNOTATION_ID}="${e.multiThreadAnnotationId}"]`))),i.length&&i[i.length-1]===e.elementRef.nativeElement)return!0}return!1}catch(t){return this.loggingService.catch("Error in CommentTextService checkIfLast: ",t),!1}}getCommentTextDataByAnnotationIdAndComponentId(e,t){try{return this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: getCommentTextDataByAnnotationIdAndComponentId","color: green;"),this.commentTextData$.pipe(Te(a=>a&&e&&t&&a[e]?a[e][t]:null))}catch(a){return this.loggingService.catch("Error in CommentTextService getCommentTextDataByAnnotationIdAndComponentId: ",a),Ee(null)}}};o.\u0275fac=function(t){return new(t||o)(be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function ru(r,o){return r?{commentPinSelected:!0,textClicked:!!o}:{commentPinSelected:!1,textClicked:!1}}function nu(r,o,n){return r!=null&&r===o&&!!n}function Of(r){return r instanceof Document||r instanceof ShadowRoot?r:document}function Ef(r,o){let n=e=>{if(!e)return null;let t=null;return(e instanceof Document||e instanceof DocumentFragment)&&(t=e.getElementById(`comment-pin-container-${o}`)),t||e.querySelector(`[data-velt-id='${o}']`)||null};return n(r)||(r!==document?n(document):null)}var T2=["overlay"],O2=()=>["snippyly-overlay-panel","velt-overlay-panel"];function E2(r,o){if(r&1&&E(0,"span",8),r&2){let n,e=l().ngIf;pe("index-3-digit",(e.commentPinAnnotation==null||e.commentPinAnnotation.annotationNumber==null||(n=e.commentPinAnnotation.annotationNumber.toString())==null?null:n.length)===3),k("data-comment-annotation-number","#"+(e.commentPinAnnotation==null?null:e.commentPinAnnotation.annotationNumber))}}function M2(r,o){if(r&1){let n=Y();u(0),b(1,"velt-multi-thread-comment-dialog-internal",10),z("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))})("pointerUp",function(t){B(n);let a=l(3);return V(a.togglePinSelection(t))}),x(),p()}if(r&2){let n=l(2).ngIf;d(),v("multiThreadAnnotationId",n.commentPinAnnotation.annotationId)("annotation",n.commentPinAnnotation)("user",n.user)("commentPinSelected",n.commentPinSelected)}}function A2(r,o){if(r&1){let n=Y();b(0,"velt-comment-dialog-internal",11),z("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))}),x()}if(r&2){let n=l(2).ngIf;v("annotation",n.commentPinAnnotation)("user",n.user)("commentPinSelected",n.commentPinSelected)("inlineCommentMode",n.inlineCommentMode)("isInsidePdfViewer",n.isInsidePdfViewer)}}function P2(r,o){if(r&1&&s(0,M2,2,4,"ng-container",9)(1,A2,1,5,"ng-template",null,2,je),r&2){let n=we(2),e=l().ngIf;v("ngIf",(e==null||e.commentPinAnnotation==null?null:e.commentPinAnnotation.type)==="multiThread")("ngIfElse",n)}}function F2(r,o){if(r&1){let n=Y();b(0,"snippyly-comment-bottom-sheet",12),z("saveComment",function(t){B(n);let a=l(2);return V(a.saveComment(t))}),x()}if(r&2){let n=l().ngIf;v("annotation",n.commentPinAnnotation)("user",n.user)("isInsidePdfViewer",n.isInsidePdfViewer)}}function N2(r,o){if(r&1){let n=Y();u(0),b(1,"snippyly-comment-text",4,0),z("pointerover",function(t){return B(n),l().onPointerOver(t),V(t.stopPropagation())})("pointerout",function(){B(n);let t=l();return V(t.onPointerOut())})("pointerdown",function(t){return B(n),V(t.stopPropagation())})("pointerup",function(t){return B(n),l().togglePinSelection(),V(t.stopPropagation())})("touchend",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())})("click",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())}),x(),s(3,E2,1,3,"span",5)(4,P2,3,2,"ng-template",6,1,je)(6,F2,1,3,"snippyly-comment-bottom-sheet",7),p()}if(r&2){let n=o.ngIf,e=we(2),t=l();d(),pe("inline-comment-mode",n.inlineCommentMode&&!n.isInsidePdfViewer)("agent-comment",(n.commentPinAnnotation==null?null:n.commentPinAnnotation.sourceType)==="agent")("selected",n.commentPinHover||n.commentPinSelected),d(2),v("ngIf",n.last&&n.showCommentIndex&&(n.commentPinAnnotation==null?null:n.commentPinAnnotation.annotationNumber)),d(),v("cdkConnectedOverlayOrigin",e)("cdkConnectedOverlayOpen",(!n.mobileMode||!n.isPhone)&&!n.inboxMode&&!n.streamMode&&(!n.inlineCommentMode||n.isInsidePdfViewer)&&n.floatingCommentsEnabled&&(n.textClicked&&n.commentPinSelected||n.commentPinHover&&!n.commentPinSelected))("cdkConnectedOverlayOffsetY",n.overlayOriginY==="top"?-8:2)("cdkConnectedOverlayPanelClass",vt(17,O2))("cdkConnectedOverlayBackdropClass","snippyly-overlay-backdrop")("cdkConnectedOverlayLockPosition",!1)("cdkConnectedOverlayPositions",t.positions)("cdkConnectedOverlayGrowAfterOpen",!0)("cdkConnectedOverlayDisableClose",!0),d(2),v("ngIf",(n==null?null:n.user)&&n.mobileMode&&n.isPhone&&!n.sidebarVisible&&(!n.inlineCommentMode||n.isInsidePdfViewer)&&!n.inboxMode&&!n.streamMode&&n.floatingCommentsEnabled&&n.textClicked&&n.commentPinSelected)}}var ou=(()=>{let o=class o{onEnter(e){this.onKeyupEnter&&this.onKeyupEnter()}constructor(e,t,a,i,c,m,h,_){this.analyticsService=e,this.authService=t,this.breakpointObserver=a,this.domService=i,this.commentService=c,this.loggingService=m,this.serviceBook=h,this.elementRef=_,this.subscriptions=[],this.selectedAnnotationsMap={},this.customScrollableParentEventsListenersSubscriptions=[],this.isDialogOnHoverEnabled=!1,this.componentConfigSignal=Me({inlineCommentMode:!1,isInsidePdfViewer:!1,commentPinHover:!1,commentPinSelected:!1,first:!1,last:!1,showCommentIndex:!1,commentPinAnnotation:null,isPhone:!1,mobileMode:!1,streamMode:!1,inboxMode:!1,textClicked:!1,floatingCommentsEnabled:!0,sidebarVisible:!1,user:null,overlayOriginX:"start",overlayOriginY:"top"}),this.positions=X.OVERLAY_POSITIONS.map(I=>new on({originX:I.originX,originY:I.originY},{overlayX:I.overlayX,overlayY:I.overlayY})),this.veltElement=!0,this.componentId="velt-comment-text-portal",this.subscriptions.push(this.authService.getUser$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{user:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getUser$ subscription: ",I)})),this.subscriptions.push(this.commentService.getSidebarVisibility$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{sidebarVisible:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getSidebarVisibility$ subscription: ",I)})),this.subscriptions.push(this.commentService.showFloatingComments$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{floatingCommentsEnabled:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent showFloatingComments$ subscription: ",I)})),this.subscriptions.push(this.commentService.getShowCommentIndex().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{showCommentIndex:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getShowCommentIndex subscription: ",I)})),this.subscriptions.push(this.commentService.getEnableDialogOnHover$().subscribe(I=>{this.isDialogOnHoverEnabled=I},I=>{this.catchError("Error in CommentPinComponent getEnableDialogOnHover subscription: ",I)})),this.subscriptions.push(this.breakpointObserver.observe(Zn.XSmall).subscribe(I=>{let S=!1;I.matches?S=!0:S=!1,this.componentConfigSignal.update(H=>(H=f(g({},H),{isPhone:S}),H))},I=>{this.catchError("Error in CommentTextPortalComponent breakpointObserver subscription: ",I)}))}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentTextPortalComponent ngOnInit:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentTextPortalComponent setupA11yAttributes:",e)}}ngAfterViewInit(){try{let e=this.element.childNodes[0];this.element.childNodes[1].childNodes[0].appendChild(e),this.componentConfigSignal.update(a=>{let i=zv(this.element,X.ATTRIBUTES.VELT_PDF_VIEWER);return a=f(g({},a),{isInsidePdfViewer:i}),a}),this.subscriptions.push(this.overlay?.positionChange?.subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{overlayOriginX:a.connectionPair.originX,overlayOriginY:a.connectionPair.originY}),i))},a=>{this.catchError("Error in CommentTextPortalComponent positionChange subscription: ",a)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(a=>{this.selectedAnnotationsMap=a,this.checkPinSelection()},a=>{this.catchError("Error in CommentTextPortalComponent getSelectedAnnotationsMap$ subscription: ",a)})),this.subscriptions.push(this.commentService.getStreamMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{streamMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getStreamMode$ subscription: ",a)})),this.subscriptions.push(this.commentService.getInboxMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{inboxMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getInboxMode subscription: ",a)})),this.subscriptions.push(this.commentService.getMobileMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{mobileMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getMobileMode$ subscription: ",a)})),this.subscriptions.push(this.commentService.getInlineCommentMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{inlineCommentMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getInlineCommentMode$ subscription: ",a)})),this.subscriptions.push(this.serviceBook.observe(dn).pipe(Pe(a=>a?.onInitRecording()??Wn)).subscribe(a=>{this.recorderInitConfig=a},a=>{this.catchError("Error in CommentTextPortalComponent onInitRecording subscription: ",a)}))}catch(e){this.catchError("Error in CommentTextPortalComponent AfterViewInit: ",e)}}setFirst(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{first:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setFirst: ",t)}}setLast(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{last:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setLast: ",t)}}setCommentPinAnnotation(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinAnnotation:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setCommentPinAnnotation: ",t)}}setElement(e){try{this.element=e,this.element?this.customScrollableParents=Fg(this.element):this.customScrollableParents=[],this.addCustomScrollableParentsEventListeners()}catch(t){this.catchError("Error in CommentTextPortalComponent setElement: ",t)}}checkPinSelection(){try{let e=!!this.selectedAnnotationsMap[this.componentConfigSignal().commentPinAnnotation?.annotationId];this.componentConfigSignal.update(t=>{let a=ru(e,t.last);return g(g({},t),a)}),nu(sessionStorage.getItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID),this.componentConfigSignal().commentPinAnnotation.annotationId,this.componentConfigSignal().last)&&(this.componentConfigSignal.update(t=>(t=f(g({},t),{textClicked:!0}),t)),sessionStorage.removeItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID))}catch(e){this.catchError("Error in CommentTextPortalComponent checkPinSelection: ",e)}}onPointerOver(e){try{if(this.componentConfigSignal().commentPinHover)return;e.buttons?this.componentConfigSignal().commentPinHover&&this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinHover:!1}),t)):!this.componentConfigSignal().commentPinHover&&this.isDialogOnHoverEnabled&&this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinHover:!0}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent onPointerOver: ",t)}}onPointerOut(){this.componentConfigSignal.update(e=>(e=f(g({},e),{commentPinHover:!1}),e))}togglePinSelection(e){try{if(this.recorderInitConfig?.isCommentRecording||this.componentConfigSignal().textClicked&&!e)return;let t=e||this.componentConfigSignal().commentPinAnnotation;if(this.selectedAnnotationsMap[t.annotationId])e||(document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}="${t?.annotationId}"]`)?this.domService.resetSelectedAnnotationsMap(!0,"comments"):(this.componentConfigSignal.update(i=>(i=f(g({},i),{textClicked:!0}),i)),this.domService.toggleAnnotationSelection(t)));else{let a=document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);if(a||(a=(this.domService.getDraftCommentAnnotationDialogs()||[])[0]),a){let i=a.getAttribute(X.ATTRIBUTES.VELT_ANNOTATION_DRAFT);if(i){let c=document.getElementById(`comment-pin-container-${i}`)||document.querySelector(`[data-velt-id='${i}']`);c&&(c.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),this.domService.resetSelectedAnnotationsMap(!0,"comments"))}}else this.domService.resetSelectedAnnotationsMap(!0,"comments"),this.componentConfigSignal.update(i=>(i=f(g({},i),{textClicked:!0}),i)),this.domService.toggleAnnotationSelection(t)}}catch(t){this.catchError("Error in CommentTextPortalComponent togglePinSelection: ",t)}}saveComment(e){try{this.commentService.saveComment(this.componentConfigSignal().commentPinAnnotation,e)}catch(t){this.catchError("Error in CommentTextPortalComponent saveComment: ",t)}}updateOverlayPosition(){try{this.loggingService.log("updateOverlayPosition",this.componentConfigSignal().commentPinAnnotation?.annotationId),this.overlay&&this.overlay?.overlayRef?.updatePosition()}catch(e){this.catchError("Error in CommentTextPortalComponent updateOverlayPosition: ",e)}}addCustomScrollableParentsEventListeners(){try{this.removeCustomScrollableParentsEventListeners(),this.customScrollableParents?.length&&this.customScrollableParents?.forEach(e=>{this.customScrollableParentEventsListenersSubscriptions.push(wn(e,"scroll").subscribe(t=>{this.updateOverlayPosition()},t=>{this.catchError("Error in CommentTextPortalComponent addCustomScrollableParentsEventListeners scroll subscription: ",t)}))})}catch(e){this.catchError("Error in CommentTextPortalComponent addCustomScrollableParentsEventListeners: ",e)}}removeCustomScrollableParentsEventListeners(){try{this.customScrollableParentEventsListenersSubscriptions.map(e=>{e.unsubscribe()}),this.customScrollableParentEventsListenersSubscriptions=[]}catch(e){this.catchError("Error in CommentTextPortalComponent removeCustomScrollableParentsEventListeners: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.removeCustomScrollableParentsEventListeners(),this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.catchError("Error in CommentTextPortalComponent unsubscribe: ",e)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.componentConfigSignal()?.commentPinAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(G(sr),G(ot),G(Kn),G(Ne),G(ae),G(A),G(kr),G(me))},o.\u0275cmp=T({type:o,selectors:[["snippyly-comment-text-portal"]],viewQuery:function(t,a){if(t&1&&ft(T2,5),t&2){let i;Ct(i=kt())&&(a.overlay=i.first)}},hostVars:1,hostBindings:function(t,a){t&1&&z("keyup.enter",function(c){return a.onEnter(c)},vg),t&2&&k("data-velt-element",a.veltElement)},standalone:!1,decls:1,vars:1,consts:[["trigger","cdkOverlayOrigin"],["overlay","cdkConnectedOverlay"],["commentDialogRef",""],[4,"ngIf"],["cdkOverlayOrigin","","data-velt-comment-disabled","true",1,"comment-text-highlight",3,"pointerover","pointerout","pointerdown","pointerup","touchend","click"],["class","comment-annotation-number",3,"index-3-digit",4,"ngIf"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayOffsetY","cdkConnectedOverlayPanelClass","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayLockPosition","cdkConnectedOverlayPositions","cdkConnectedOverlayGrowAfterOpen","cdkConnectedOverlayDisableClose"],[3,"annotation","user","isInsidePdfViewer","saveComment",4,"ngIf"],[1,"comment-annotation-number"],[4,"ngIf","ngIfElse"],[3,"saveComment","pointerUp","multiThreadAnnotationId","annotation","user","commentPinSelected"],[3,"saveComment","annotation","user","commentPinSelected","inlineCommentMode","isInsidePdfViewer"],[3,"saveComment","annotation","user","isInsidePdfViewer"]],template:function(t,a){t&1&&s(0,N2,7,18,"ng-container",3),t&2&&v("ngIf",a.componentConfigSignal())},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;margin:0;padding:0;height:inherit;width:inherit;text-align:inherit;line-height:inherit;font-size:inherit;text-transform:inherit;float:inherit;-webkit-text-fill-color:initial}*[_ngcontent-%COMP%]:empty{display:revert}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);font-family:inherit}.comment-text-highlight[_ngcontent-%COMP%]{cursor:pointer} snippyly-text-highlight.snippyly-text-highlight{color:var(--velt-black)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight{color:var(--velt-warning-hover);background-color:var(--velt-warning-transparent);border-bottom:1px solid var(--velt-warning-hover)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.selected{color:var(--velt-black);background-color:var(--velt-warning)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.agent-comment{color:var(--velt-agent-accent);background-color:var(--velt-agent-accent-transparent);border-bottom-color:var(--velt-agent-accent)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.agent-comment.selected{color:var(--velt-agent-accent);background-color:var(--velt-agent-accent-transparent)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.inline-comment-mode{background-color:inherit} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.inline-comment-mode.selected{background-color:inherit}.comment-annotation-number[_ngcontent-%COMP%]{border-radius:50%;border:1px solid var(--velt-gray);width:20px;height:20px;font-size:calc((.7rem + 0px) * var(--velt-base-rem-unit));display:inline-flex;justify-content:center;align-items:center;box-sizing:content-box;background:var(--velt-white);color:var(--velt-black);position:relative}.comment-annotation-number.index-3-digit[_ngcontent-%COMP%]{width:32px;height:32px}.comment-annotation-number[_ngcontent-%COMP%]:after{content:attr(data-comment-annotation-number);position:absolute;font-weight:400;letter-spacing:normal;word-spacing:normal}"],changeDetection:0});let r=o;return r})();var Yv=(()=>{let o=class o{constructor(e,t,a,i,c,m,h){this.docService=e,this.domService=t,this.commentService=a,this.componentFactoryResolver=i,this.injector=c,this.appRef=m,this.loggingService=h,this.commentsTextById={},this.commonAncestorElementObservers=new Map,this.commonAncestorElementObserverCounts=new Map,this.inlineCommentMode=!1,this.restrictTextSearchToAnchor=!1;try{this.commentService.getInlineCommentMode$().subscribe(_=>{this.inlineCommentMode=_}),this.commentService.getRestrictTextSearchToAnchor$().subscribe(_=>{this.restrictTextSearchToAnchor=_})}catch(_){this.loggingService.catch("Error in CommentPinPortalService constructor: ",_)}}updateTextCommentAnnotations(e){try{this.checkToRemoveTextCommentAnnotations(e),e.forEach(t=>{this.updateTextCommentAnnotation(t)})}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateTextCommentAnnotations: ",t)}}updateTextCommentAnnotation(e){let t=this.commentsTextById[e.annotationId];if(t)if(ln(t?.annotation?.targetTextRange,e?.targetTextRange)){let a=!1;t?.texts?.length?t.texts.forEach(i=>{document.body.contains(i?.textNode)||(a=!0)}):a=!0,a?(this.removeTextCommentAnnotation(e),this.getCommonAncestorContainer(e)):(t.texts.forEach(i=>{i.portalRef&&i.portalRef.instance.setCommentPinAnnotation(e)}),t.annotation=e)}else this.removeTextCommentAnnotation(e),this.getCommonAncestorContainer(e);else this.getCommonAncestorContainer(e)}getCommonAncestorContainer(e){try{let t=this.domService.getElementFromTargetTextRange(e?.targetTextRange);if(t&&this.domService.isElementVisible(t)){let a=t?.nodeType===Node.ELEMENT_NODE?t:t?.parentElement;this.commentsTextById[e.annotationId]={texts:[],annotation:e,commonAncestorContainer:t,commonAncestorElement:a,commonAncestorText:a?.textContent},this.setTextCommentPortal(e),this.observeCommonAncestorElementChanges(e)}else this.setGhostComment(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService getCommonAncestorContainer: ",t)}}setTextCommentPortal(e){try{let t=this.commentsTextById[e.annotationId];if(t){let a=this.domService.getElementFromTargetTextRange(e?.targetTextRange),i=document.body;if(e?.locationId&&this.docService.getLocation()?.locationId!==e?.locationId){let h=this.docService.getElementMapWithLocation();h[e?.locationId]&&(a=h[e?.locationId]?.element,i=a)}let c=this.resolveHighlightRange(e,a,i);if(c){let m=c.commonAncestorContainer?.nodeType===Node.ELEMENT_NODE?c.commonAncestorContainer:c.commonAncestorContainer?.parentElement??null;m&&t.commonAncestorElement&&!t.commonAncestorElement.contains(m)&&(t.commonAncestorElement=m,t.commonAncestorContainer=m,t.commonAncestorText=m.textContent);let h=bf(c),_=[],I=h?.find(S=>!S?.textContent);if(I&&I?.remove(),h=h?.filter(S=>S?.textContent),h&&h.length){let S=-1,H=-1;if(h.forEach(($,j)=>{this.textHighlighterClass?this.domService.addClassToElement($,this.textHighlighterClass):this.domService.addClassToElement($,$.tagName?.toLowerCase()),$.setAttribute(X.ATTRIBUTES.VELT_ID,e.annotationId);let Z=$.childNodes[0],re=new Cg(ou),se=new kg($,this.appRef,this.injector),_e=se.attach(re);_e.instance.setCommentPinAnnotation(e),_e.instance.setElement($),_e.instance.onKeyupEnter=()=>{this.onCommonAncestorElementChange(e)},S<0&&(S=j),H=j,_.push({host:se,portal:re,portalRef:_e,element:$,textNode:Z})}),S>=0&&_[S]?.portalRef&&_[S].portalRef.instance.setFirst(!0),H>=0&&_[H]?.portalRef&&_[H].portalRef.instance.setLast(!0),t.texts=_,this.inlineCommentMode&&!document.querySelector(`${X.TAGS.VELT_INLINE_COMMENT}[${X.ATTRIBUTES.VELT_INLINE_COMMENT_ID}="${e.annotationId}"]`)){let j=t.texts?.filter(re=>!!re?.element)?.map(re=>re?.element),Z=j?.length?j[j.length-1]:null;if(Z&&!zv(Z,X.ATTRIBUTES.VELT_PDF_VIEWER)){let se=Z?.parentElement;if(se){let _e=document.createElement(X.TAGS.VELT_INLINE_COMMENT);_e.setAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_ID,e.annotationId),se.insertAdjacentElement("afterend",_e),t.inlineCommentElement=_e}}}}this.removeGhostComment(e)}else this.setGhostComment(e)}else this.setGhostComment(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService setTextCommentPortal: ",t)}}resolveHighlightRange(e,t,a=document.body){try{let i=e.targetTextRange?.text,c=e.targetTextRange?.occurrence,m=t?this.buildValidRange(Qu(i,t,c),i):null;return!m&&!this.restrictTextSearchToAnchor&&a&&t!==a&&(m=this.buildValidRange(Qu(i,a,c),i)),m}catch(i){return this.loggingService.catch("Error in CommentPinPortalService resolveHighlightRange: ",i),null}}buildValidRange(e,t){try{if(!e?.length||e.some(c=>c?.textNode?.parentElement?.closest("script")))return null;let i=new Range;try{i.setStart(e[0].textNode,e[0].startOffset||0),i.setEnd(e[e.length-1].textNode,e[e.length-1].endOffset||0)}catch{return null}return i.toString()===t?i:null}catch(a){return this.loggingService.catch("Error in CommentPinPortalService buildValidRange: ",a),null}}checkToRemoveTextCommentAnnotations(e){try{let t=e.map(i=>i.annotationId),a=!1;if(Object.keys(this.commentsTextById).forEach(i=>{t.includes(i)||(this.commentsTextById[i]?.annotation?.targetTextRange&&(a=!0),this.removeTextCommentAnnotation(this.commentsTextById[i].annotation))}),a){let i=[];Object.keys(this.commentsTextById).forEach(c=>{this.commentsTextById[c]?.annotation?.targetTextRange&&(i.push(this.commentsTextById[c]?.annotation),this.removeTextCommentAnnotation(this.commentsTextById[c]?.annotation))}),i?.length&&i.forEach(c=>{this.updateTextCommentAnnotation(c)})}}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkToRemoveTextCommentAnnotations: ",t)}}removeTextCommentAnnotation(e){try{let t=this.commentsTextById[e.annotationId];if(t.texts.forEach(a=>{a?.host&&a.host.detach(),a?.element&&a?.textNode&&a.element.replaceWith(a.textNode),a.textNode&&a.textNode.parentNode?.normalize()}),t.texts?.length){let a=document.querySelectorAll(`${X.TAGS.SNIPPYLY_TEXT_HIGHLIGHT}[data-velt-id="${e?.annotationId}"]`);a?.length&&a.forEach(i=>{let c=i?.parentNode;if(i?.textContent){let m=document.createTextNode(i.textContent);i.replaceWith(m)}c&&c.normalize()})}t?.inlineCommentElement&&t?.inlineCommentElement?.remove(),this.checkToUnsubscribeCommonAncestorElementChanges(e),delete this.commentsTextById[e.annotationId]}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeTextCommentAnnotation: ",t)}}observeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];if(t.commonAncestorElement){let a=this.commonAncestorElementObservers.get(t.commonAncestorElement);if(a)a.annotations.find(i=>i.annotationId===e.annotationId)||a.annotations.push(e);else{let i=new MutationObserver(c=>{let m="";if(Tb(t?.commonAncestorElement).forEach(_=>{_?.parentElement?.closest(".comment-annotation-number")||(m+=_.textContent)}),t?.commonAncestorText!==m&&c.filter(_=>[Node.ELEMENT_NODE,Node.TEXT_NODE].includes(_.target.nodeType)).filter(_=>_.target?.parentElement&&(_?.target?.parentElement?.classList?.contains("comment-text-highlight")||!Gc(_.target?.parentElement))).length){this.commonAncestorElementObservers.get(t.commonAncestorElement)?.annotations?.forEach($=>{this.onCommonAncestorElementChange($)});let{count:I,lastUpdated:S}=this.commonAncestorElementObserverCounts.get(t.commonAncestorElement)||{count:0,lastUpdated:0},H=Date.now();this.commonAncestorElementObserverCounts.set(t.commonAncestorElement,{count:H-S<100?I+1:1,lastUpdated:Date.now()}),I>5&&(i.disconnect(),this.loggingService.catch("Failed to detect text changes."))}});i.observe(t.commonAncestorElement,{characterData:!0,subtree:!0}),a={observer:i,annotations:[e]}}this.commonAncestorElementObservers.set(t.commonAncestorElement,a)}}catch(t){this.loggingService.catch("Error in CommentPinPortalService observeCommonAncestorElementChanges: ",t)}}onCommonAncestorElementChange(e){try{let t=this.commentsTextById[e.annotationId];if(t.texts?.length){let a="";t.texts.forEach(I=>a+=I.textNode?.textContent);let i=t.texts[0].textNode,c=[];document.querySelectorAll(`${X.TAGS.SNIPPYLY_TEXT_HIGHLIGHT}[data-velt-id="${e?.annotationId}"]`)?.forEach(I=>{c.push(I)});let m=!1;if(c?.length!==t?.texts?.length&&(m=!0),c?.length){let I="";c.forEach(S=>{I+=S?.textContent||""}),I&&(a=I,m&&this.removeTextCommentAnnotation(e))}let h=yb(t.commonAncestorContainer,0,i,0,a)+1,_={};_.commonAncestorContainer=e.targetTextRange?.commonAncestorContainer,_.text=a,_.occurrence=h,ln(e.targetTextRange,_)||(t.annotation.targetTextRange=_,this.updateAnnotationToFirebase(t.annotation))}else this.setTextCommentPortal(t.annotation)}catch(t){this.loggingService.catch("Error in CommentPinPortalService onCommonAncestorElementChange: ",t)}}updateAnnotationToFirebase(e){try{this.commentService.updateComment(e,!1,!0)}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateAnnotationToFirebase: ",t)}}checkToUnsubscribeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];if(t.commonAncestorElement){let a=this.commonAncestorElementObservers.get(t.commonAncestorElement);a&&(a.annotations=a?.annotations.filter(i=>i.annotationId!==e.annotationId),a.annotations.length||this.unsubscribeCommonAncestorElementChanges(e))}}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkToUnsubscribeCommonAncestorElementChanges: ",t)}}setGhostComment(e){try{e.ghostComment={},this.commentService.setGhostCommentMessage(e),this.commentService.addAnnotationToGhostCommentAnnotationMap(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService setGhostComment: ",t)}}removeGhostComment(e){try{delete e.ghostComment,this.commentService.removeAnnotationFromGhostCommentAnnotationMap(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeGhostComment: ",t)}}onAcceptComment(e){try{let t=this.commentsTextById[e.annotationId];if(t?.texts?.length){let a=t.texts.length-1,i=t.texts[a].textNode;if(i&&i.parentNode){let c=e.comments?.length?e.comments[0]:null,m=Rg(c?.replaceContentHtml)?null:c?.replaceContentHtml,h=c?.replaceContentText||c?.commentText||"";if(Rg(m)&&!c?.replaceContentText&&(m=c?.commentHtml||""),e?.selectAllContent&&e?.targetElementId){let _=Wr(e.targetElementId,["id","data-id"]);_&&(_.innerHTML=this.domService.sanitizeHtml(Rg(m)?h||"":m||""))}else{if(m&&m!==h){let _=document.createElement("span");_.innerHTML=this.domService.sanitizeHtml(m||h||""),i.parentNode.replaceChild(_,i),t.texts[a].textNode=_}else t.texts[a].textNode.textContent=h||"";for(let _=0;_<a;_++){let I=t.texts[_].textNode;I&&(I.textContent="")}}this.removeTextCommentAnnotation(e),this.domService.resetSelectedAnnotationsMap()}}}catch(t){this.loggingService.catch("Error in CommentPinPortalService onAcceptComment: ",t)}}unsubscribeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];this.commonAncestorElementObservers.get(t.commonAncestorElement)?.observer?.disconnect(),this.commonAncestorElementObservers.delete(t.commonAncestorElement)}catch(t){this.loggingService.catch("Error in CommentPinPortalService unsubscribeCommonAncestorElementChanges: ",t)}}};o.\u0275fac=function(t){return new(t||o)(be(ut),be(Ne),be(ae),be(mg),be(dg),be(sg),be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function R2(r,o){if(r&1){let n=Y();b(0,"div",4),z("pointerup",function(t){return B(n),l(2).togglePinSelection(),V(t.stopPropagation())})("click",function(t){return B(n),V(t.stopPropagation())})("cdkDragStarted",function(){B(n);let t=l(2);return V(t.onPinDragStart())}),b(1,"snippyly-comment-pin",5),z("saveComment",function(t){B(n);let a=l(2);return V(a.saveComment(t))})("commentTargetElementClicked",function(){B(n);let t=l(2);return V(t.togglePinSelection())})("togglePinSelection",function(t){B(n);let a=l(2);return V(a.togglePinSelection(t))}),x()()}if(r&2){let n=l().ngIf,e=l();it("top",(n.commentPinAnnotation==null||n.commentPinAnnotation.position==null?null:n.commentPinAnnotation.position.top)-0+n.offsetTop,"px")("left",(n.commentPinAnnotation==null||n.commentPinAnnotation.position==null?null:n.commentPinAnnotation.position.left)-10+n.offsetLeft,"px"),v("id","comment-pin-container-"+(n.commentPinAnnotation==null?null:n.commentPinAnnotation.annotationId)),k("data-testid",e.componentId+"-popover")("role","button")("aria-expanded",n.commentPinSelected),d(),v("annotation",n.commentPinAnnotation)("containerComponentId",n.componentId)("commentPinSelected",n.commentPinSelected&&!n.annotationDragging)("multipleCommentPinSelected",n.commentPinSelected&&e.objectKeys(n.selectedAnnotationsMap).length>1)("targetElement",n.targetElement)("user",n.user)}}function U2(r,o){if(r&1){let n=Y();b(0,"div",7),z("pointerup",function(t){return B(n),l(3).togglePinSelection(),V(t.stopPropagation())})("touchend",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())})("mousedown",function(t){return B(n),V(t.stopPropagation())})("touchstart",function(t){return B(n),V(t.stopPropagation())})("pointerdown",function(t){return B(n),V(t.stopPropagation())})("click",function(t){return B(n),V(t.stopPropagation())})("cdkDragStarted",function(){B(n);let t=l(3);return V(t.onPinDragStart())})("cdkDragMoved",function(t){B(n);let a=l(3);return V(a.onPinMove(t))})("cdkDragReleased",function(){B(n);let t=l(3);return V(t.onPinRelease())}),b(1,"snippyly-comment-pin",8,1),z("togglePinSelection",function(t){B(n);let a=l(3);return V(a.togglePinSelection(t))})("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))}),x()()}if(r&2){let n=we(2),e=l(2).ngIf,t=l();it("top",e.annotationDragging?(e.dragPosition==null?null:e.dragPosition.top)-((n==null?null:n.COMMENT_PIN_SIZE)||40):(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.top)-((n==null?null:n.COMMENT_PIN_SIZE)||40)+e.offsetTop,"px")("left",e.annotationDragging?e.dragPosition==null?null:e.dragPosition.left:(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.left)+e.offsetLeft,"px")("--velt-comment-pin-transform",e.annotationDragging?"none":e.pinTransform??"none")("transform",!e.annotationDragging&&(!(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null)&&e.commentPinAnnotation.position.parentScaleX)?"scale("+1/((e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.parentScaleX)||1)+", "+1/((e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.parentScaleY)||1)+")":""),pe("pin-dragging",e.annotationDragging),v("id","comment-pin-container-"+(e.commentPinAnnotation==null?null:e.commentPinAnnotation.annotationId))("cdkDragDisabled",!e.pinDragEnabled||(e.commentPinAnnotation==null||e.commentPinAnnotation.from==null?null:e.commentPinAnnotation.from.userId)!==(e.user==null?null:e.user.userId)),k("data-testid",t.componentId+"-default")("role","button")("aria-expanded",e.commentPinSelected)("aria-grabbed",e.annotationDragging)("data-transform-inside",e.transformContext?"true":"false"),d(),v("annotation",e.commentPinAnnotation)("annotationDragging",e.annotationDragging)("containerComponentId",e.componentId)("commentPinSelected",e.commentPinSelected&&!e.annotationDragging)("multipleCommentPinSelected",e.commentPinSelected&&t.objectKeys(e.selectedAnnotationsMap).length>1)("targetElement",e.targetElement)("user",e.user)}}function L2(r,o){if(r&1&&s(0,U2,3,24,"div",6),r&2){let n=l().ngIf;v("ngIf",n.commentPinAnnotation==null?null:n.commentPinAnnotation.position)}}function B2(r,o){if(r&1&&(u(0),s(1,R2,2,14,"div",3)(2,L2,1,1,"ng-template",null,0,je),p()),r&2){let n=o.ngIf,e=we(3);d(),v("ngIf",n.popoverMode)("ngIfElse",e)}}var au=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_){this.analyticsService=e,this.authService=t,this.docService=a,this.domService=i,this.commentService=c,this.commentActionsService=m,this.loggingService=h,this.elementRef=_,this.multipleCommentPinsSelected=!1,this.avatarErrorImage="",this.objectKeys=Object.keys,this.selectedAnnotationsLocationMap={},this.subscriptions=[],this.componentConfigSignal=Me({popoverMode:!1,commentPinAnnotation:void 0,commentPinSelected:!1,offsetLeft:0,offsetTop:0,selectedAnnotationsMap:{},annotationDragging:!1,dragPosition:null,targetElement:void 0,user:void 0,componentId:`comment-pin-portal-${Ht()}`,pinDragEnabled:!0}),this.veltElement=!0,this.componentId="velt-comment-pin-portal",this.subscriptions.push(this.authService.getUser$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{user:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getUser$ subscription: ",I)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{selectedAnnotationsMap:I}),S)),this.checkCommentPinSelected()},I=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsMap$ subscription: ",I)})),this.subscriptions.push(this.domService.getSelectedAnnotationsLocationMap$().subscribe(I=>{this.selectedAnnotationsLocationMap=I||{},this.checkCommentPinSelected()},I=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsLocationMap$ subscription: ",I)})),this.subscriptions.push(this.commentService.getPinDrag$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{pinDragEnabled:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getPinDrag$ subscription: ",I)})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{popoverMode:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getPopoverMode subscription: ",I)}))}ngOnInit(){try{this.setupA11yAttributes(),this.subscriptions.push(this.commentService.getTransformContext$().subscribe(e=>{this.componentConfigSignal.update(t=>{if(t=f(g({},t),{transformContext:e}),e&&this.isElementInsideTransformContainer(this.elementRef?.nativeElement,e.containerSelector)){let a=e.transforms.scale?1/e.transforms.scale:1;t.pinTransform=`scale(${a})`}else t.pinTransform=void 0;return t})}))}catch(e){this.loggingService.catch("Error in CommentPinPortalComponent ngOnInit:",e)}}isElementInsideTransformContainer(e,t){try{return document.querySelector(t)?.contains(e)??!1}catch(a){return this.loggingService.catch("Error in CommentPinPortalComponent isElementInsideTransformContainer:",a),!1}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentPinPortalComponent setupA11yAttributes:",e)}}setCommentPinAnnotation(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinAnnotation:e}),t)),this.id=this.componentConfigSignal().commentPinAnnotation?.annotationId,this.checkCommentPinSelected()}catch(t){this.catchError("Error in CommentPinPortalComponent setCommentPinAnnotation: ",t)}}setSourceId(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{sourceId:e}),t)),this.checkCommentPinSelected()}catch(t){this.catchError("Error in CommentPinPortalComponent setSourceId: ",t)}}getMultiThreadCommentAnnotations(){}checkCommentPinSelected(){try{let e=this.componentConfigSignal().selectedAnnotationsMap,t=this.componentConfigSignal().commentPinAnnotation,a=this.componentConfigSignal().sourceId;if(t){let i=!!e[t.annotationId];if(i)if(t?.isDraft)t?.sourceId&&(i=t?.sourceId===a,i&&this.domService.setSelectedAnnotationLocation(t.annotationId,this.componentConfigSignal().componentId));else{let c=this.selectedAnnotationsLocationMap?.[t.annotationId];c&&(i=c===this.componentConfigSignal().componentId)}i!==this.componentConfigSignal().commentPinSelected&&this.componentConfigSignal.update(c=>(c=f(g({},c),{commentPinSelected:i}),c))}}catch(e){this.catchError("Error in CommentPinPortalComponent checkCommentPinSelected: ",e)}}setTargetElement(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{targetElement:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setTargetElement: ",t)}}setOffsetLeft(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{offsetLeft:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setOffsetLeft: ",t)}}setOffsetTop(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{offsetTop:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setOffsetTop: ",t)}}togglePinSelection(e){try{let t=e||this.componentConfigSignal().commentPinAnnotation;if(t&&this.commentActionsService.onCommentPinClick(t).catch(i=>{this.catchError("Error in CommentPinPortalComponent togglePinSelection onCommentPinClick: ",i)}),this.componentConfigSignal().selectedAnnotationsMap[t?.annotationId]&&this.selectedAnnotationsLocationMap?.[t?.annotationId]===this.componentConfigSignal().componentId)t?.ghostComment?.type!==Hr.DIFFERENT_DEVICE&&document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}="${t?.annotationId}"]`)&&this.domService.resetSelectedAnnotationsMap(!0,"comments");else{let i=document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);if(i||(i=(this.domService.getDraftCommentAnnotationDialogs()||[])[0]),i){let c=i.getAttribute(X.ATTRIBUTES.VELT_ANNOTATION_DRAFT);if(c){let m=document.getElementById(`comment-pin-container-${c}`)||document.querySelector(`[data-velt-id='${c}']`);m&&(m.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),this.domService.resetSelectedAnnotationsMap(!0,"comments"))}}else this.domService.resetSelectedAnnotationsMap(!0,"comments"),this.componentConfigSignal().targetElement&&this.domService.isElementVisibleOnScreen(this.componentConfigSignal().targetElement)&&(this.componentConfigSignal().annotationDragging||this.domService.toggleAnnotationSelection(t,this.componentConfigSignal().componentId,void 0,!0))}}catch(t){this.catchError("Error in CommentPinPortalComponent togglePinSelection: ",t)}}onPinDragStart(){try{this.componentConfigSignal().selectedAnnotationsMap[this.componentConfigSignal().commentPinAnnotation.annotationId]&&this.componentConfigSignal().commentPinAnnotation?.ghostComment?.type!==Hr.DIFFERENT_DEVICE&&this.domService.toggleAnnotationSelection(this.componentConfigSignal().commentPinAnnotation,this.componentConfigSignal().componentId);let e=document.getElementById(this.componentConfigSignal().commentPinAnnotation.annotationId);if(!e)return;this.parentElement=e.parentElement;let t=this.componentConfigSignal().commentPinAnnotation.position,a=this.componentConfigSignal().transformContext,i=this.parentElement.getBoundingClientRect(),c=i.left+t.left,m=i.top+t.top,h=a&&this.isElementInsideTransformContainer(e,a.containerSelector);this.componentConfigSignal.update(_=>(_=f(g({},_),{elementInTransformedContainer:h}),_)),e.style.width="20px",e.style.height="20px",e.style.margin="0",e.style.padding="0",e.style.display="block",e.style.visibility="visible",e.style.opacity="1",e.style.backgroundColor="var(--velt-comment-pin-background-color, #2d62ff)",e.style.borderRadius="50%",e.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",e.style.pointerEvents="auto",e.offsetWidth,document.body.appendChild(e),e.style.position="fixed",e.style.top=`${m}px`,e.style.left=`${c}px`,e.style.zIndex="10000",e.style.transform="none",e.offsetWidth,document.body.classList.add(X.BODY_CLASSES.VELT_PIN_DRAGGING),this.componentConfigSignal.update(_=>(_=f(g({},_),{annotationDragging:!0}),_))}catch(e){this.catchError("Error in CommentPinPortalComponent onPinDragStart: ",e)}}onPinMove(e){try{this.updateCurrentPinPosition(e)}catch(t){this.catchError("Error in CommentPinPortalComponent onPinMove: ",t)}}updateCurrentPinPosition(e){try{this.domService.removeHighlightFromElement(this.componentConfigSignal().targetElement);let t=e.event,a=t?.touches?.length?t.touches[0]?.clientX:t.clientX,i=t?.touches?.length?t.touches[0]?.clientY:t.clientY,c=this.componentConfigSignal().transformContext,m=this.domService.getBackgroundElement(a,i);m&&this.commentService.isElementInsideAllowedElements(m)&&(this.componentConfigSignal.update(h=>(h=f(g({},h),{targetElement:m}),h)),this.domService.highlightElement(this.componentConfigSignal().targetElement),this.pointerMoveEvent=e.event,this.componentConfigSignal.update(h=>(h=f(g({},h),{dragPosition:{top:i,left:a}}),h)))}catch(t){this.catchError("Error in CommentPinPortalComponent updateCurrentPinPosition: ",t)}}onPinRelease(){try{document.body.classList.remove(X.BODY_CLASSES.VELT_PIN_DRAGGING);let e=document.getElementById(this.componentConfigSignal().commentPinAnnotation.annotationId);if(!e||!this.parentElement)return;this.domService.removeHighlightFromElement(this.componentConfigSignal().targetElement);let t=this.domService.getElementFromXPath(this.componentConfigSignal().commentPinAnnotation.targetElement?.xpath),a=this.componentConfigSignal().commentPinAnnotation?.targetElement;if(this.pointerMoveEvent){let re=this.domService.getTargetElementForCursorPosition(this.pointerMoveEvent,!0,!0,!0,se=>{if(this.commentService.getSvgAsImg()){let _e=se?.closest(`[${X.ATTRIBUTES.VELT_COMMENT_CONTAINER}]`);_e&&_e instanceof HTMLElement&&(se=_e)}return se});re&&(a=re)}let i=this.domService.getElementFromXPath(a?.xpath),c=this.componentConfigSignal().commentPinAnnotation.targetElement?.xpath,m=a?.xpath,h=c===m;if(!i)return;let _=this.componentConfigSignal().dragPosition,I=i.getBoundingClientRect(),S=50,H=50;if(_){let re=_.left-I.left,se=_.top-I.top;S=re/I.width*100,H=se/I.height*100,S=Math.max(0,Math.min(100,S)),H=Math.max(0,Math.min(100,H))}let $=g({},this.componentConfigSignal().commentPinAnnotation);$.targetElement=g({},a),$.targetElement.leftPercentage=S,$.targetElement.topPercentage=H,this.commentService.calculateCommentAnnotationPosition($),this.componentConfigSignal.update(re=>(re=f(g({},re),{commentPinAnnotation:$,targetElement:i}),re));let j=this.domService.isElementInsideAdditionalLocationContainer(t)||this.domService.isElementInsideAdditionalLocationContainer(i),Z=this.docService.getAdditionalDocumentIdFromElement(i)||this.docService.getDocumentPaths()?.clientDocumentId;if(!this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId||this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId==Z?(this.componentConfigSignal.update(re=>(re=f(g({},re),{commentPinAnnotation:f(g({},re.commentPinAnnotation),{targetElement:a})}),re)),this.commentService.updateComment(this.componentConfigSignal().commentPinAnnotation,j)):this.componentConfigSignal.update(re=>(re=f(g({},re),{targetElement:t}),re)),h){let re=this.componentConfigSignal().transformContext,se=this.componentConfigSignal().elementInTransformedContainer,_e=re&&this.isElementInsideTransformContainer(i,re.containerSelector);this.componentConfigSignal.update(he=>(he=f(g({},he),{elementInTransformedContainer:_e}),he));let le=e.getBoundingClientRect();if(!se&&_e){e.style.transition="none";let he=le.top,Se=le.left;this.parentElement.appendChild(e),e.style.position="fixed",e.style.top=`${he}px`,e.style.left=`${Se}px`,e.offsetWidth,requestAnimationFrame(()=>{e.style.position="absolute",_e&&$.position.transformContext?(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`,$.position.transformContext.scale!==1&&(e.style.transform=`scale(${1/$.position.transformContext.scale})`)):(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`)})}else e.style.transition="none",this.parentElement.appendChild(e),e.style.position="absolute",e.style.width="20px",e.style.height="20px",e.style.backgroundColor="var(--velt-comment-pin-background-color, #2d62ff)",e.style.borderRadius="50%",e.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",e.style.visibility="visible",e.style.display="block",e.offsetWidth,_e&&$.position.transformContext?(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`):(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`);e.offsetWidth,this.componentConfigSignal.update(he=>(he=f(g({},he),{annotationDragging:!1,dragPosition:null}),he))}this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_PIN_DRAGGED,{annotationId:this.componentConfigSignal().commentPinAnnotation.annotationId,commentMode:this.commentService.getCommentMode()})}catch(e){this.catchError("Error in CommentPinPortalComponent onPinRelease: ",e)}}saveComment(e){try{this.commentService.saveComment(this.componentConfigSignal().commentPinAnnotation,e)}catch(t){this.catchError("Error in CommentPinPortalComponent saveComment: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe(),this.componentConfigSignal()?.annotationDragging&&document.body.classList.remove(X.BODY_CLASSES.VELT_PIN_DRAGGING)}catch(e){this.catchError("Error in CommentPinPortalComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.catchError("Error in CommentPinPortalComponent unsubscribe: ",e)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.componentConfigSignal()?.commentPinAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(G(sr),G(ot),G(ut),G(Ne),G(ae),G(at),G(A),G(me))},o.\u0275cmp=T({type:o,selectors:[["snippyly-comment-pin-portal"]],hostVars:2,hostBindings:function(t,a){t&2&&(Bh("id",a.id),k("data-velt-element",a.veltElement))},inputs:{multipleCommentPinsSelected:"multipleCommentPinsSelected",avatarErrorImage:"avatarErrorImage"},standalone:!1,decls:1,vars:1,consts:[["defaultPinPortalRef",""],["commentPinRef",""],[4,"ngIf"],["class","comment-pin-portal",3,"id","top","left","pointerup","click","cdkDragStarted",4,"ngIf","ngIfElse"],[1,"comment-pin-portal",3,"pointerup","click","cdkDragStarted","id"],[3,"saveComment","commentTargetElementClicked","togglePinSelection","annotation","containerComponentId","commentPinSelected","multipleCommentPinSelected","targetElement","user"],["class","comment-pin-portal","cdkDrag","","cdkDragHandle","",3,"id","pin-dragging","top","left","--velt-comment-pin-transform","transform","cdkDragDisabled","pointerup","touchend","mousedown","touchstart","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased",4,"ngIf"],["cdkDrag","","cdkDragHandle","",1,"comment-pin-portal",3,"pointerup","touchend","mousedown","touchstart","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased","id","cdkDragDisabled"],[3,"togglePinSelection","saveComment","annotation","annotationDragging","containerComponentId","commentPinSelected","multipleCommentPinSelected","targetElement","user"]],template:function(t,a){t&1&&s(0,B2,4,2,"ng-container",2),t&2&&v("ngIf",a.componentConfigSignal())},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{position:absolute!important;top:0!important;left:0!important;box-sizing:border-box!important;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset!important;width:unset!important;text-align:left!important;z-index:var(--velt-comment-pin-z-index)!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit));-webkit-text-fill-color:initial!important}*[_ngcontent-%COMP%]:empty{display:revert!important}.comment-pin-portal[_ngcontent-%COMP%]{position:absolute;transform:var(--velt-comment-pin-transform, none)!important;transform-origin:0 100%!important;transform-box:fill-box!important;top:0;left:0}.comment-pin-portal.pin-dragging[_ngcontent-%COMP%]{position:fixed;z-index:var(--velt-comment-pin-z-index)!important}"],changeDetection:0});let r=o;return r})();var vo=(()=>{let o=class o{constructor(e,t,a,i,c,m){this.commentService=e,this.domService=t,this.componentFactoryResolver=a,this.injector=i,this.appRef=c,this.loggingService=m,this.commentsPinById={},this.commentPinTemplate$=new De(null),this.customPinEvents$=new jt}setCommentPin(e){try{if(!this.commentsPinById[e.annotationId])this.setPinPortal(e);else{let t=!1;if(e?.ghostComment?t=e?.ghostComment?.targetElement?.xpath!==this.commentsPinById[e.annotationId]?.[0]?.annotation?.ghostComment?.targetElement?.xpath:this.commentsPinById[e.annotationId]?.[0]?.annotation?.ghostComment?t=!0:t=e.targetElement?.xpath!==this.commentsPinById[e.annotationId]?.[0]?.annotation?.targetElement?.xpath,!t)this.commentsPinById[e.annotationId]?.forEach(a=>{let i=a.portalRef,c=a.userTargetElement,m=a.pinHostElement;if(document.body.contains(c)&&document.body.contains(m))i&&(i.instance.setCommentPinAnnotation(e),this.updateElementOffset(e));else{let h=a.pinHostDomPortalOutlet;h&&(this.removeCommentPinHostAttributes(e.annotationId,a.pinHostElement),this.removeCommentDisabledAttribute(m),h.detach(),delete this.commentsPinById[e.annotationId],e.ghostComment&&this.unselectCommentAnnotation(e),this.setPinPortal(e))}});else{let a=this.commentsPinById[e.annotationId]?.[0]?.pinHostDomPortalOutlet;a&&(this.removeCommentPinHostAttributes(e.annotationId,this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),this.removeCommentDisabledAttribute(this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),a.detach(),delete this.commentsPinById[e.annotationId],e.ghostComment&&this.unselectCommentAnnotation(e),this.setPinPortal(e))}}}catch(t){this.loggingService.catch("Error in CommentPinPortalService setCommentPin: ",t)}}unselectCommentAnnotation(e){try{this.loggingService.log("%c[WB] Calling CommentPinPortalService FUNCTION: unselectCommentAnnotation","color: green;"),this.domService.getSelectedAnnotationsMap()?.[e?.annotationId]&&this.domService.toggleAnnotationSelection(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService unselectCommentAnnotation: ",t)}}setPinPortal(e){try{let t=this.commentService.getElementFromComments(e);t.length>0&&(this.commentsPinById[e.annotationId]=[],t.forEach(a=>{if(a){let i=this.domService.getHostElement(a),c=new Cg(au),m=new kg(i,this.appRef,this.injector),h=m.attach(c);h.instance.setCommentPinAnnotation(e),h.instance.setTargetElement(a);let _=a?.getAttribute(X.ATTRIBUTES.VELT_SOURCE_ID);_&&h.instance.setSourceId(_),this.commentsPinById[e.annotationId].push({pinHostDomPortalOutlet:m,pinPortal:c,portalRef:h,annotation:JSON.parse(JSON.stringify(e)),userTargetElement:a,pinHostElement:i}),this.setCommentPinHostAttributes(e.annotationId,i),this.setCommentDisabledAttribute(i),this.updateElementOffset(e)}}))}catch(t){this.loggingService.catch("Error in CommentPinPortalService setPinPortal: ",t)}}setCommentPinHostAttributes(e,t){try{let a=t.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(a){let i=a.split(",");i.includes(e)||(i.push(e),t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,i.join(",")))}else t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,e);this.domService.isElementOriginallyStatic(t)&&t.offsetHeight>0&&(Fb(t)||t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC,"true"))}catch(a){this.loggingService.catch("Error in CommentPinPortalService setCommentPinHostAttributes: ",a)}}removeCommentPinHostAttributes(e,t){try{let a=t.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(a){let i=a.split(","),c=i.indexOf(e);c>-1&&(i.splice(c,1),i.length>0?t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,i.join(",")):t.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST))}t?.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST)||t.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC)}catch(a){this.loggingService.catch("Error in CommentPinPortalService removeCommentPinHostAttributes: ",a)}}setCommentDisabledAttribute(e){try{this.commentService.getPopoverMode()&&e.setAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED,"auto")}catch(t){this.loggingService.catch("Error in CommentPinPortalService setCommentDisabledAttribute: ",t)}}removeCommentDisabledAttribute(e){try{e?.getAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED)==="auto"&&e.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED)}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeCommentDisabledAttribute: ",t)}}updateElementOffset(e){try{for(let t of this.commentsPinById[e.annotationId]){let{portalRef:a,userTargetElement:i,pinHostElement:c}=t,m=this.domService.getElementOffset(i,c);a.instance.setOffsetLeft(m.offsetLeft),a.instance.setOffsetTop(m.offsetTop)}}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateElementOffset: ",t)}}checkPinsToRemove(e){try{let t=e.map(a=>a.annotationId);Object.keys(this.commentsPinById).forEach(a=>{t.includes(a)||(this.commentService.customPinsById.has(a)&&this.commentService.customPinsById.delete(a),this.commentsPinById[a].forEach(c=>{c.pinHostDomPortalOutlet.detach(),this.removeCommentPinHostAttributes(a,c.pinHostElement),this.removeCommentDisabledAttribute(c.pinHostElement),this.domService.removeHighlightFromElement(c.pinHostElement),c.userTargetElement&&this.domService.removeHighlightFromElement(c.userTargetElement)}),delete this.commentsPinById[a])})}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkPinsToRemove: ",t)}}getAnnotationIdsByUserTargetElement(e){try{let t=[];return Object.keys(this.commentsPinById||{}).forEach(a=>{this.commentsPinById[a]?.forEach(c=>{c.userTargetElement===e&&t.push(a)})}),t?.length>0?Array.from(new Set(t)):[]}catch(t){return this.loggingService.catch("Error in CommentPinPortalService getAnnotationIdsByUserTargetElement: ",t),[]}}setCommentPinOverrideTemplate(e){this.commentPinTemplate$.next(e)}getCommentPinTemplate$(){return this.commentPinTemplate$}emitCustomPinEvent(e){try{let{element:t,annotation:a}=e;a&&this.commentService.customPinsById.set(a.annotationId,t),this.customPinEvents$.next(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService emitCustomPinEvent",t)}}getCustomPinEvents$(){return this.customPinEvents$}};o.\u0275fac=function(t){return new(t||o)(be(ae),be(Ne),be(mg),be(dg),be(sg),be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function mp(){return{sidebarMode:!1,inboxMode:!1,dialogMode:!0,inlineCommentMode:!1,inlineCommentSectionMode:!1,focusedThreadMode:!1,isFocusedThreadEnabled:!1,pageModeComposer:!1,darkMode:!1,variant:"dialog",disabled:!1,commentPinSelected:!1,fullExpanded:!1,commentDialogSelected:!1,readOnly:!1,dialogShadowDOM:!0,locationVersion:"",composerPosition:"bottom",dialogOpenedInSidebar:!1,expandOnSelection:!0,commentPinType:"pin",containerComponentId:"",dialogInstanceId:Ht(),editComment:null,editCommentIndex:null,composerInOpenState:!1,assignToMenuOpened:!1,composerContent:"",composerContentHTML:"",selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],localRecordedData:[],attachmentsToDelete:[],selectedVisibility:"public",selectedVisibilityUsers:[]}}var iu=new Ah("LocalUIStateSignal"),fn=class{constructor(){this.appState={user:new Qn,isUserAdmin:!1,isKnownUser:!1,repliesUniqueUsers:[]},this.featureState={inlineCommentMode:!1,inlineCommentSectionMode:!1,sidebarMode:!1,dialogMode:!0,focusedThreadMode:!1,isFocusedThreadEnabled:!1,pageModeComposer:!1,inboxMode:!1,fullExpanded:!1,canResolveAnnotation:!1,canUnresolveAnnotation:!1,dialogSelectedByKnownUser:!1,resolveStatusAccessAdminOnly:!1,enableResolve:!1,isPlanExpired:!1,moderatorMode:!1,enableAutoCategorize:!1,suggestionMode:!1,commentAcceptedStatus:X.CommentAcceptStatus,commentRejectedStatus:X.CommentRejectStatus,enableSignInButton:!1,enableUpgradeButton:!1,enableGhostCommentsMessage:!1,replyAvatars:!1,userMentions:!0,anonymousEmail:!0,recordingSummaryEnabled:!1,enableAttachment:!0,enableAttachmentDownload:!0,allowedFileTypes:[],allowedRecordings:["audio","video","screen"],screenSharingSupported:!0,enterKeyToSubmit:!0,deleteOnBackspace:!0,enableReactions:!0,isInsidePdfViewer:!1,sidebarButtonOnCommentDialogVisible:!1,enableAssignment:!0,enableNotifications:!0,enableEdit:!0,enableDelete:!0,enablePrivateMode:!1,deleteThreadWithFirstComment:!0,seenByUsers:!0,enableStatus:!0,enablePriority:!1,visibilityOptions:!1,isPrivateCommentsEnabled:!1,privateModeEnabled:!1,privateModeType:null,privateModeUserIds:null,dialogSelection:!0,multiThread:!1,assignToType:"dropdown"},this.data={annotation:new Nt,ghostComment:null,assignTo:void 0,isAssignedCheckbox:!1,selectedUserContacts:[],currentDialogView:{}},this.uiState={darkMode:!1,variant:"dialog",disabled:!1,commentDialogSelected:!1,commentPinSelected:!1,readOnly:!1,dialogShadowDOM:!0,composerPosition:"bottom",dialogOpenedInSidebar:!1,containerComponentId:void 0,locationVersion:void 0,isPrivateComment:!1,sidebarButtonOnCommentDialogVisible:!1,showGhostCommentMessage:!1,showReplies:!1,collapsedComments:!1,collapsedRepliesPreview:!1,showAllComments:!0,multiThreadAnnotationId:void 0,maxReplyAvatars:3,showSuggestionModeActions:!1,uploadingAttachments:!1,playVideoInFullScreen:!0,commentDialogUniqueId:void 0,reactionToolOpenIndex:-1,openDropdownIndexValue:-1,hasReactionsByCommentId:{}},this.unreadCommentsMap=null,this.unreadIndicatorMode=jv.MINIMAL,this.context={},this.trackById=o=>{try{return o?.commentId?.toString()||""}catch{return""}},this.trackByAttachmentId=o=>{try{return o?.attachmentId?.toString()||""}catch{return""}},this.trackByRecorderId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByStatusId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByPriorityId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByCustomChipId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByViewUserId=o=>{try{return o?.user?.userId?.toString()||""}catch{return""}},this.scrollToBottom=new Le,this.messageScrollOffset=0,this.setMessageScrollOffset=o=>{try{let n=o?.target;n&&(this.messageScrollOffset=n.scrollTop)}catch{}}}};function Pf(){return{composerContent:"",composerContentHTML:"",localRecordedData:[],selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[]}}function lu(r){return r?!r.composerContent&&!r.selectedFiles?.length&&!r.invalidSelectedFiles?.length&&!r.selectedAttachments?.length&&!r.localRecordedData?.length:!0}var co=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,H){this.commentService=e,this.authService=t,this.iamService=a,this.usersService=i,this.loggingService=c,this.serviceBook=m,this.customFilterService=h,this.contactService=_,this.themeService=I,this.docService=S,this.domService=H,this.contextMap=new Map,this.annotationSubscriptions=new Map,this.registryMap=new Map,this.localUIStateRegistry=new Map,this.selectedDialogInstancesByAnnotation=new Map,this.composerDraftMap=new Map,this.standaloneComposerOwners=new Set,this.localAnonymousEmailOverrides=new Map,this.serviceSubscriptions=[],this.currentUser=new Qn,this.currentIsUserAdmin=!1,this.currentResolveStatusAccessAdminOnly=!1,this.currentEnableResolve=!0,this.currentIsPlanExpired=!1,this.currentSidebarButtonOnCommentDialogVisible=!1,this.currentModeratorMode=!1,this.currentEnableSignInButton=!1,this.currentEnableUpgradeButton=!1,this.currentSuggestionMode=!1,this.currentEnableAutoCategorize=!1,this.currentEnableGhostCommentsMessage=!1,this.currentReadOnly=!1,this.currentMaxReplyAvatars=3,this.currentReplyAvatars=!1,this.currentEnableAttachment=!0,this.currentEnableAttachmentDownload=!0,this.currentEnableFormatOptions=!1,this.currentFormatConfig=null,this.currentAllowedFileTypes=[],this.currentAllowedRecordings=["audio","video","screen"],this.currentScreenSharingSupported=!!navigator?.mediaDevices?.getDisplayMedia,this.currentUserMentions=!0,this.currentAnonymousEmail=!0,this.currentDeleteOnBackspace=!0,this.currentEnterKeyToSubmit=!0,this.currentDialogShadowDOM=!0,this.currentRecordingSummaryEnabled=!1,this.currentEnableReactions=!0,this.currentEnableStatus=!1,this.currentCustomStatusesShown=!1,this.currentStatusOptions=[],this.currentEnablePriority=!0,this.currentPriorityOptions=[],this.currentEnableVisibilityOptions=!1,this.currentIsPrivateCommentsEnabled=!1,this.currentPrivateModeEnabled=!1,this.currentPrivateModeType=null,this.currentPrivateModeUserIds=null,this.currentDeleteThreadWithFirstComment=!0,this.currentCustomChipData=null,this.currentUnreadCommentsMap=null,this.currentUnreadIndicatorMode=void 0,this.currentSeenByUsers=!0,this.currentCommentViews=null,this.viewsService=null,this.currentUserContactsBySnippylyId=null,this.currentDarkMode=!1,this.ghostCommentSubscription=null,this.currentGhostCommentAnnotationMap=null,this.currentCommentplaceholder=void 0,this.currentReplyplaceholder=void 0,this.currentEditplaceholder=void 0,this.currentEditcommentplaceholder=void 0,this.currentEditreplyplaceholder=void 0,this.currentAtHereLabel=void 0,this.currentShortUserName=!1,this.currentAttachmentNameInMessage=!1,this.currentShowAllComments=!0,this.currentCollapsedRepliesPreview=!1,this.currentPlayVideoInFullScreen=void 0,this.currentShowScreenSizeInfo=!1,this.currentInlineCommentMode=!1,this.currentFullExpanded=!1,this.currentShowCommentIndex=!1,this.currentIsPrivateCommentAllowed=!1,this.currentLinkCallback=!1,this.currentDialogOpenedInSidebar=!1,this.currentAddCommentMode=!1,this.currentAssignToType="dropdown",this.editDraftsMap=Me(new Map),this.serviceSubscriptions.push(this.usersService.getUserById$().subscribe(()=>{this.contextMap.forEach($=>{this.updateComputedProperties($)})})),this.serviceSubscriptions.push(this.authService.getUser$().subscribe($=>{$&&(this.currentUser=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{appState:f(g({},Z.appState),{user:$})})),this.updateComputedProperties(j)}))})),this.serviceSubscriptions.push(this.iamService.isUserAdmin$().subscribe($=>{this.currentIsUserAdmin=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{appState:f(g({},Z.appState),{isUserAdmin:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getResolveStatusAccessAdminOnly$().subscribe($=>{this.currentResolveStatusAccessAdminOnly=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{resolveStatusAccessAdminOnly:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableResolve$().subscribe($=>{this.currentEnableResolve=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableResolve:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.authService.isPlanExpired$().subscribe($=>{this.currentIsPlanExpired=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPlanExpired:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getSidebarButtonOnCommentDialogVisibility$().subscribe($=>{this.currentSidebarButtonOnCommentDialogVisible=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{sidebarButtonOnCommentDialogVisible:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.themeService.getDarkMode$().subscribe($=>{this.currentDarkMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{darkMode:$})}))})})),this.serviceSubscriptions.push(this.commentService.getModeratorMode$().subscribe($=>{this.currentModeratorMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{moderatorMode:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getSignInButton$().subscribe($=>{this.currentEnableSignInButton=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableSignInButton:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getUpgradeButton$().subscribe($=>{this.currentEnableUpgradeButton=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableUpgradeButton:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getSuggestionMode$().subscribe($=>{this.currentSuggestionMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{suggestionMode:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableAutoCategorize$().subscribe($=>{this.currentEnableAutoCategorize=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAutoCategorize:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableGhostCommentsMessage$().subscribe($=>{this.currentEnableGhostCommentsMessage=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableGhostCommentsMessage:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getReadOnly$().subscribe($=>{this.currentReadOnly=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{readOnly:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getMaxReplyAvatars$().subscribe($=>{this.currentMaxReplyAvatars=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{maxReplyAvatars:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getReplyAvatars$().subscribe($=>{this.currentReplyAvatars=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{replyAvatars:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableAttachment$().subscribe($=>{this.currentEnableAttachment=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAttachment:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableAttachmentDownload$().subscribe($=>{this.currentEnableAttachmentDownload=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAttachmentDownload:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableFormatOptions$().subscribe($=>{this.currentEnableFormatOptions=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableFormatOptions:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getFormatConfig$().subscribe($=>{this.currentFormatConfig=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{formatConfig:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableReactions$().subscribe($=>{this.currentEnableReactions=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableReactions:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableStatus$().subscribe($=>{this.currentEnableStatus=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableStatus:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getCustomStatusesShown$().subscribe($=>{this.currentCustomStatusesShown=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{customStatusesShown:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.customFilterService.customStatusMap$.subscribe($=>{let j=$?Object.values($):[];this.currentStatusOptions=j,this.contextMap.forEach(Z=>{let re=Z();Z.set(f(g({},re),{featureState:f(g({},re.featureState),{statusOptions:j})})),this.updateComputedProperties(Z)})})),this.serviceSubscriptions.push(this.commentService.getEnablePriority$().subscribe($=>{this.currentEnablePriority=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enablePriority:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableVisibilityOptions$().subscribe($=>{this.currentEnableVisibilityOptions=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{visibilityOptions:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.authService.getIsPrivateCommentsEnabled$().subscribe($=>{this.currentIsPrivateCommentsEnabled=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPrivateCommentsEnabled:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getPrivateModeConfig$().subscribe($=>{let j=$!==null,Z=$?.type??null,re=$?.userIds??null;this.currentPrivateModeType=Z,this.currentPrivateModeUserIds=re,this.currentPrivateModeEnabled!==j&&(this.currentPrivateModeEnabled=j),this.updatePrivateModeEnabledInAllContexts()})),this.serviceSubscriptions.push(this.commentService.getPrivateCommentMode$().subscribe($=>{$&&!this.currentPrivateModeEnabled?(this.currentPrivateModeEnabled=!0,this.currentPrivateModeType="organizationPrivate",this.updatePrivateModeEnabledInAllContexts()):!$&&!this.commentService.getPrivateModeConfig()&&(this.currentPrivateModeEnabled=!1,this.currentPrivateModeType=null,this.updatePrivateModeEnabledInAllContexts())})),this.serviceSubscriptions.push(this.customFilterService.customPriorityMap$.subscribe($=>{let j=$?Object.values($):[];this.currentPriorityOptions=j,this.contextMap.forEach(Z=>{let re=Z();Z.set(f(g({},re),{featureState:f(g({},re.featureState),{priorityOptions:j})})),this.updateComputedProperties(Z)})})),this.serviceSubscriptions.push(this.commentService.getDeleteThreadWithFirstComment$().subscribe($=>{this.currentDeleteThreadWithFirstComment=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{deleteThreadWithFirstComment:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getCustomChipDropdownData$().subscribe($=>{this.currentCustomChipData=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{data:f(g({},Z.data),{customChipData:$,selectedCustomChipSet:Z.data.selectedCustomChipSet||new Set})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getAllowedFileTypes$().subscribe($=>{this.currentAllowedFileTypes=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{allowedFileTypes:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getAllowedRecordings$().subscribe($=>{this.currentAllowedRecordings=$||[],this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{allowedRecordings:$||[]})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getUserMentions$().subscribe($=>{this.currentUserMentions=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{userMentions:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableAnonymousEmail$().subscribe($=>{this.currentAnonymousEmail=$,this.contextMap.forEach((j,Z)=>{if(this.localAnonymousEmailOverrides.has(Z))return;let re=j();j.set(f(g({},re),{featureState:f(g({},re.featureState),{anonymousEmail:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getAssignToType$().subscribe($=>{this.currentAssignToType=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{assignToType:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getDeleteOnBackspace$().subscribe($=>{this.currentDeleteOnBackspace=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{deleteOnBackspace:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnterKeyToSubmit$().subscribe($=>{this.currentEnterKeyToSubmit=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enterKeyToSubmit:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getDialogShadowDOM$().subscribe($=>{this.currentDialogShadowDOM=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{dialogShadowDOM:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getComposerMode$().subscribe($=>{this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{composerMode:$||"default"})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getRecordingSummaryEnabled$().subscribe($=>{this.currentRecordingSummaryEnabled=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{recordingSummaryEnabled:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe($=>{this.currentUnreadCommentsMap=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{unreadCommentsMap:$})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getUnreadIndicatorMode$().subscribe($=>{this.currentUnreadIndicatorMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{unreadIndicatorMode:$})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.serviceBook.observe(dn).pipe(Pe($=>$?.onInitRecording()??Wn)).subscribe($=>{this.contextMap.forEach((j,Z)=>{let re=j();($?.panelId===re.uiState?.commentDialogUniqueId||$?.commentAnnotationId===Z||!$)&&(j.set(f(g({},re),{uiState:f(g({},re.uiState),{recorderInitConfig:$})})),this.updateComputedProperties(j),$?.commentAnnotationId&&$?.commentAnnotationId===Z&&!re.featureState?.sidebarMode&&this.domService.setRecordingInProgress($.commentAnnotationId,!0))})})),this.ghostCommentSubscription=this.commentService.getGhostCommentAnnotationMap$().subscribe($=>{this.currentGhostCommentAnnotationMap=$||null,this.contextMap.forEach((j,Z)=>{let re=j(),se=$?$[Z]:null;j.set(f(g({},re),{data:f(g({},re.data),{ghostComment:se||null})})),this.updateComputedProperties(j)})}),this.ghostCommentSubscription&&this.serviceSubscriptions.push(this.ghostCommentSubscription),this.serviceSubscriptions.push(this.commentService.getSeenByUsers$().subscribe($=>{this.currentSeenByUsers=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{seenByUsers:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.serviceBook.observe(Eo).pipe(Pe($=>(this.viewsService=$??null,$?$.getCommentFeatureViews$():Ee({})))).subscribe($=>{this.currentCommentViews=$,this.contextMap.forEach(j=>{this.computeCurrentDialogView(j)})})),this.serviceSubscriptions.push(this.contactService.getUserContactsBySnippylyId$().subscribe($=>{this.currentUserContactsBySnippylyId=$,this.contextMap.forEach(j=>{this.computeCurrentDialogView(j)})})),this.serviceSubscriptions.push(this.commentService.getCommentplaceholder$().subscribe($=>{this.currentCommentplaceholder=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{commentplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getReplyplaceholder$().subscribe($=>{this.currentReplyplaceholder=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{replyplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditplaceholder$().subscribe($=>{this.currentEditplaceholder=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{editplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditcommentplaceholder$().subscribe($=>{this.currentEditcommentplaceholder=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{editcommentplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditreplyplaceholder$().subscribe($=>{this.currentEditreplyplaceholder=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{editreplyplaceholder:$}))})})),this.serviceSubscriptions.push(this.contactService.getAtHereLabel().subscribe($=>{this.currentAtHereLabel=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{atHereLabel:$})}))})})),this.serviceSubscriptions.push(this.commentService.getShortUserName$().subscribe($=>{this.currentShortUserName=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{shortUserName:$})}))})})),this.serviceSubscriptions.push(this.commentService.getAttachmentNameInMessage$().subscribe($=>{this.currentAttachmentNameInMessage=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{attachmentNameInMessage:$})}))})})),this.serviceSubscriptions.push(this.commentService.getCollapsedComments$().subscribe($=>{this.currentShowAllComments=!$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showAllComments:!$,collapsedComments:$})}))})})),this.serviceSubscriptions.push(this.commentService.getCollapsedRepliesPreview$().subscribe($=>{this.currentCollapsedRepliesPreview=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{collapsedRepliesPreview:$})}))})})),this.serviceSubscriptions.push(this.serviceBook.observe(dn).pipe(Pe($=>$?.getPlayVideoInFullScreen$()??Wn)).subscribe($=>{this.currentPlayVideoInFullScreen=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{playVideoInFullScreen:$})}))})})),this.serviceSubscriptions.push(this.commentService.getShowScreenSizeInfo$().subscribe($=>{this.currentShowScreenSizeInfo=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showScreenSizeInfo:$})}))})})),this.serviceSubscriptions.push(this.commentService.getInlineCommentMode$().subscribe($=>{this.currentInlineCommentMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{inlineCommentMode:$})}))})})),this.serviceSubscriptions.push(this.commentService.getFullExpanded$().subscribe($=>{this.currentFullExpanded=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{fullExpanded:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getShowCommentIndex().subscribe($=>{this.currentShowCommentIndex=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showCommentIndex:$})}))})})),this.serviceSubscriptions.push(this.commentService.isPrivateCommentAllowed$().subscribe($=>{this.currentIsPrivateCommentAllowed=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPrivateCommentAllowed:$})}))})})),this.serviceSubscriptions.push(this.commentService.getLinkCallback$().subscribe($=>{this.currentLinkCallback=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{linkCallback:$})}))})})),this.serviceSubscriptions.push(this.commentService.addCommentModeChange().subscribe($=>{this.currentAddCommentMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{addCommentMode:$})}))})})),this.serviceSubscriptions.push(this.domService.getDialogOpenedInSidebar().subscribe($=>{this.currentDialogOpenedInSidebar=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{dialogOpenedInSidebar:$})}))})})),this.serviceSubscriptions.push(this.serviceBook.observe(dn).pipe(Pe($=>$?.onRecordingAttributeRemovedFromBody$()??Wn)).subscribe(()=>{this.contextMap.forEach($=>{let j=$();$.set(f(g({},j),{uiState:f(g({},j.uiState),{recordingAttributeRemovedTimestamp:Date.now()})}))})}))}setRegistry(e,t){try{this.registryMap.set(e,t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setRegistry:",a)}}getRegistry(e){try{return this.registryMap.get(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService getRegistry:",t);return}}clearRegistry(e){try{this.registryMap.delete(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearRegistry:",t)}}createDefaultComponentConfig(){try{let e=new fn,t=new Nt;return e.appState={user:this.currentUser,isUserAdmin:this.currentIsUserAdmin,isKnownUser:!1},e.data={annotation:t,customChipData:this.currentCustomChipData,selectedCustomChipSet:new Set,customList:t.customList||[],currentDialogView:{}},e.featureState={inlineCommentMode:this.currentInlineCommentMode,inlineCommentSectionMode:!1,canResolveAnnotation:!1,resolveStatusAccessAdminOnly:this.currentResolveStatusAccessAdminOnly,sidebarMode:!1,enableResolve:this.currentEnableResolve,dialogSelectedByKnownUser:!1,isPlanExpired:this.currentIsPlanExpired,dialogMode:!0,moderatorMode:this.currentModeratorMode,enableAutoCategorize:this.currentEnableAutoCategorize,suggestionMode:this.currentSuggestionMode,commentAcceptedStatus:X.CommentAcceptStatus,commentRejectedStatus:X.CommentRejectStatus,enableSignInButton:this.currentEnableSignInButton,enableUpgradeButton:this.currentEnableUpgradeButton,enableGhostCommentsMessage:this.currentEnableGhostCommentsMessage,replyAvatars:this.currentReplyAvatars,userMentions:this.currentUserMentions,anonymousEmail:this.currentAnonymousEmail,recordingSummaryEnabled:this.currentRecordingSummaryEnabled,enableAttachment:this.currentEnableAttachment,enableAttachmentDownload:this.currentEnableAttachmentDownload,enableFormatOptions:this.currentEnableFormatOptions,formatConfig:this.currentFormatConfig??void 0,allowedFileTypes:this.currentAllowedFileTypes,allowedRecordings:this.currentAllowedRecordings,screenSharingSupported:this.currentScreenSharingSupported,enterKeyToSubmit:this.currentEnterKeyToSubmit,deleteOnBackspace:this.currentDeleteOnBackspace,enableReactions:this.currentEnableReactions,enableStatus:this.currentEnableStatus,customStatusesShown:this.currentCustomStatusesShown,statusOptions:this.currentStatusOptions,enablePriority:this.currentEnablePriority,priorityOptions:this.currentPriorityOptions,visibilityOptions:this.currentEnableVisibilityOptions,isPrivateCommentsEnabled:this.currentIsPrivateCommentsEnabled,privateModeEnabled:this.currentPrivateModeEnabled,privateModeType:this.currentPrivateModeType,privateModeUserIds:this.currentPrivateModeUserIds,deleteThreadWithFirstComment:this.currentDeleteThreadWithFirstComment,fullExpanded:this.currentFullExpanded,seenByUsers:this.currentSeenByUsers,isPrivateCommentAllowed:this.currentIsPrivateCommentAllowed,linkCallback:this.currentLinkCallback,assignToType:this.currentAssignToType,messageTruncation:!1,messageTruncationLines:4},e.uiState={darkMode:this.currentDarkMode,variant:"dialog",disabled:!1,isPrivateComment:!1,commentDialogSelected:!1,commentPinSelected:!1,sidebarButtonOnCommentDialogVisible:this.currentSidebarButtonOnCommentDialogVisible,readOnly:this.currentReadOnly,maxReplyAvatars:this.currentMaxReplyAvatars,uploadingAttachments:!1,dialogShadowDOM:this.currentDialogShadowDOM,commentDialogUniqueId:Ht(),composerMode:"default",showReplies:!1,collapsedComments:!1,collapsedRepliesPreview:this.currentCollapsedRepliesPreview,showAllComments:this.currentShowAllComments,shortUserName:this.currentShortUserName,attachmentNameInMessage:this.currentAttachmentNameInMessage,showScreenSizeInfo:this.currentShowScreenSizeInfo,showCommentIndex:this.currentShowCommentIndex,playVideoInFullScreen:this.currentPlayVideoInFullScreen,addCommentMode:this.currentAddCommentMode,dialogOpenedInSidebar:this.currentDialogOpenedInSidebar,atHereLabel:this.currentAtHereLabel},e.unreadCommentsMap=this.currentUnreadCommentsMap,e.unreadIndicatorMode=this.currentUnreadIndicatorMode,e.commentplaceholder=this.currentCommentplaceholder,e.replyplaceholder=this.currentReplyplaceholder,e.editplaceholder=this.currentEditplaceholder,e.editcommentplaceholder=this.currentEditcommentplaceholder,e.editreplyplaceholder=this.currentEditreplyplaceholder,e}catch(e){return this.loggingService.catch("Error in CommentDialogCoreService createDefaultComponentConfig:",e),new fn}}getDefaultBase(){try{let e=this.createDefaultComponentConfig();return{appState:{user:e.appState.user,isUserAdmin:e.appState.isUserAdmin,isKnownUser:e.appState.isKnownUser,repliesUniqueUsers:e.appState.repliesUniqueUsers},data:{annotation:e.data.annotation,customChipData:e.data.customChipData,selectedCustomChipSet:e.data.selectedCustomChipSet,customList:e.data.customList},featureState:{inlineCommentMode:e.featureState.inlineCommentMode,inlineCommentSectionMode:e.featureState.inlineCommentSectionMode,canResolveAnnotation:e.featureState.canResolveAnnotation,canUnresolveAnnotation:e.featureState.canUnresolveAnnotation,resolveStatusAccessAdminOnly:e.featureState.resolveStatusAccessAdminOnly,sidebarMode:e.featureState.sidebarMode,enableResolve:e.featureState.enableResolve,dialogSelectedByKnownUser:e.featureState.dialogSelectedByKnownUser,isPlanExpired:e.featureState.isPlanExpired,moderatorMode:e.featureState.moderatorMode,enableAutoCategorize:e.featureState.enableAutoCategorize,suggestionMode:e.featureState.suggestionMode,commentAcceptedStatus:e.featureState.commentAcceptedStatus,commentRejectedStatus:e.featureState.commentRejectedStatus,enableSignInButton:e.featureState.enableSignInButton,enableUpgradeButton:e.featureState.enableUpgradeButton,enableGhostCommentsMessage:e.featureState.enableGhostCommentsMessage,replyAvatars:e.featureState.replyAvatars,userMentions:e.featureState.userMentions,anonymousEmail:e.featureState.anonymousEmail,recordingSummaryEnabled:e.featureState.recordingSummaryEnabled,enableAttachment:e.featureState.enableAttachment,enableFormatOptions:e.featureState.enableFormatOptions,formatConfig:e.featureState.formatConfig,allowedFileTypes:e.featureState.allowedFileTypes,allowedRecordings:e.featureState.allowedRecordings,screenSharingSupported:e.featureState.screenSharingSupported,enterKeyToSubmit:e.featureState.enterKeyToSubmit,deleteOnBackspace:e.featureState.deleteOnBackspace,enableReactions:e.featureState.enableReactions,enableStatus:e.featureState.enableStatus,customStatusesShown:e.featureState.customStatusesShown,statusOptions:e.featureState.statusOptions,enablePriority:e.featureState.enablePriority,priorityOptions:e.featureState.priorityOptions,deleteThreadWithFirstComment:e.featureState.deleteThreadWithFirstComment,seenByUsers:e.featureState.seenByUsers,fullExpanded:e.featureState.fullExpanded,isPrivateCommentAllowed:e.featureState.isPrivateCommentAllowed,linkCallback:e.featureState.linkCallback,assignToType:e.featureState.assignToType,visibilityOptions:e.featureState.visibilityOptions,isPrivateCommentsEnabled:e.featureState.isPrivateCommentsEnabled,messageTruncation:e.featureState.messageTruncation,messageTruncationLines:e.featureState.messageTruncationLines},uiState:{darkMode:e.uiState?.darkMode,variant:e.uiState?.variant,disabled:e.uiState?.disabled,isPrivateComment:e.uiState?.isPrivateComment,dialogShadowDOM:e.uiState?.dialogShadowDOM,composerMode:e.uiState?.composerMode??"default",showAllComments:e.uiState?.showAllComments,collapsedComments:e.uiState?.collapsedComments,collapsedRepliesPreview:e.uiState?.collapsedRepliesPreview,shortUserName:e.uiState?.shortUserName,attachmentNameInMessage:e.uiState?.attachmentNameInMessage,showScreenSizeInfo:e.uiState?.showScreenSizeInfo,showCommentIndex:e.uiState?.showCommentIndex,playVideoInFullScreen:e.uiState?.playVideoInFullScreen,addCommentMode:e.uiState?.addCommentMode,dialogOpenedInSidebar:e.uiState?.dialogOpenedInSidebar,atHereLabel:e.uiState?.atHereLabel},unreadCommentsMap:e.unreadCommentsMap,unreadIndicatorMode:e.unreadIndicatorMode,commentplaceholder:e.commentplaceholder,replyplaceholder:e.replyplaceholder}}catch(e){return this.loggingService.catch("Error in CommentDialogCoreService getDefaultBase:",e),{}}}getOrCreateContextConfig(e){try{if(!this.contextMap.has(e)){let t=this.createDefaultComponentConfig();this.currentGhostCommentAnnotationMap&&this.currentGhostCommentAnnotationMap[e]&&(t.data=f(g({},t.data),{ghostComment:this.currentGhostCommentAnnotationMap[e]}));let a=Me(t);this.contextMap.set(e,a),this.updateComputedProperties(a),this.fetchAndUpdateAnnotation(e)}return this.contextMap.get(e)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService getOrCreateContextConfig:",t),Me(new fn)}}getContextConfig(e){try{return this.contextMap.get(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService getContextConfig:",t);return}}setLocalAnonymousEmail(e,t){try{this.localAnonymousEmailOverrides.set(e,t);let a=this.contextMap.get(e);if(a){let i=a();a.set(f(g({},i),{featureState:f(g({},i.featureState),{anonymousEmail:t})})),this.updateComputedProperties(a)}}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setLocalAnonymousEmail:",a)}}clearLocalAnonymousEmail(e){try{this.localAnonymousEmailOverrides.delete(e);let t=this.contextMap.get(e);if(t){let a=t();t.set(f(g({},a),{featureState:f(g({},a.featureState),{anonymousEmail:this.currentAnonymousEmail})})),this.updateComputedProperties(t)}}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearLocalAnonymousEmail:",t)}}registerLocalUIState(e,t){this.localUIStateRegistry.set(e,t)}unregisterLocalUIState(e){this.localUIStateRegistry.delete(e)}getLocalUIState(e){return this.localUIStateRegistry.get(e)}getOrCreateComposerDraft(e){let t=this.composerDraftMap.get(e);return t||(t=Me(g({},Pf())),this.composerDraftMap.set(e,t)),t}clearComposerDraft(e){let t=this.composerDraftMap.get(e);t&&t.set(g({},Pf()))}appendComposerDraftRecording(e,t){this.getOrCreateComposerDraft(e).update(i=>{let c=i.localRecordedData||[];return c.some(m=>m?.id&&m.id===t?.id)?i:f(g({},i),{localRecordedData:[...c,t]})})}removeComposerDraftRecording(e,t){if(!t)return;this.getOrCreateComposerDraft(e).update(i=>f(g({},i),{localRecordedData:(i.localRecordedData||[]).filter(c=>c?.id!==t)}))}setComposerDraftAttachments(e,t){this.getOrCreateComposerDraft(e).update(i=>g(g(g(g({},i),t.selectedFiles!==void 0?{selectedFiles:t.selectedFiles}:{}),t.invalidSelectedFiles!==void 0?{invalidSelectedFiles:t.invalidSelectedFiles}:{}),t.selectedAttachments!==void 0?{selectedAttachments:t.selectedAttachments}:{}))}markStandaloneComposerOwner(e){this.standaloneComposerOwners.add(e)}unmarkStandaloneComposerOwner(e){this.standaloneComposerOwners.delete(e)}isStandaloneComposerOwner(e){return!!e&&this.standaloneComposerOwners.has(e)}getStandaloneRecorderPanelId(e){return`velt-standalone-composer-recorder-${e}`}editDraftKey(e,t){return`${e}:${t}`}getEditDraft(e,t){try{return!e||t===void 0||t===null?null:this.editDraftsMap().get(this.editDraftKey(e,t))??null}catch(a){return this.loggingService.catch("Error in getEditDraft:",a),null}}setEditDraft(e,t,a){try{let i=this.editDraftKey(e,t);this.editDraftsMap.update(c=>{let m=c.get(i);if(m&&m.composerContent===a.composerContent&&m.composerContentHTML===a.composerContentHTML)return c;let h=new Map(c);return h.set(i,a),h})}catch(i){this.loggingService.catch("Error in setEditDraft:",i)}}clearEditDraft(e,t){try{let a=this.editDraftKey(e,t);this.editDraftsMap.update(i=>{if(!i.has(a))return i;let c=new Map(i);return c.delete(a),c})}catch(a){this.loggingService.catch("Error in clearEditDraft:",a)}}setContextConfig(e,t){try{this.contextMap.set(e,t);let a=t(),i=this.getDefaultBase(),c=g(g({},i),a);this.localAnonymousEmailOverrides.has(e)&&(c.featureState=f(g({},c.featureState),{anonymousEmail:this.localAnonymousEmailOverrides.get(e)})),t.set(c),this.updateComputedProperties(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setContextConfig:",a)}}clearContext(e){try{this.contextMap.delete(e),this.localAnonymousEmailOverrides.delete(e),this.selectedDialogInstancesByAnnotation.delete(e);let t=this.annotationSubscriptions.get(e);t&&(t.unsubscribe(),this.annotationSubscriptions.delete(e))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearContext:",t)}}generateTempAnnotationId(e){try{let t=e||Ht();return`${o.TEMP_ID_PREFIX}${t}`}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService generateTempAnnotationId:",t),"TEMP_ANNOTATION_ID"}}isTempAnnotationId(e){try{return e?.startsWith(o.TEMP_ID_PREFIX)||!1}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService isTempAnnotationId:",t),!1}}registerTempContext(e,t){try{if(!this.isTempAnnotationId(e)){this.loggingService.warn(`[registerTempContext] ID "${e}" is not a valid temp ID`);return}this.contextMap.set(e,t);let a=t(),i=this.getDefaultBase(),c=f(g(g({},i),a),{data:f(g(g({},i.data),a.data),{annotation:a.data?.annotation||i.data?.annotation}),appState:g(g({},i.appState),a.appState),featureState:f(g(g({},i.featureState),a.featureState),{allowedRecordings:i.featureState?.allowedRecordings,enableAttachment:i.featureState?.enableAttachment,enableReactions:i.featureState?.enableReactions,allowedFileTypes:i.featureState?.allowedFileTypes,screenSharingSupported:i.featureState?.screenSharingSupported,userMentions:i.featureState?.userMentions,anonymousEmail:i.featureState?.anonymousEmail,enterKeyToSubmit:i.featureState?.enterKeyToSubmit,deleteOnBackspace:i.featureState?.deleteOnBackspace,recordingSummaryEnabled:i.featureState?.recordingSummaryEnabled,enableResolve:i.featureState?.enableResolve,enableStatus:i.featureState?.enableStatus,enablePriority:i.featureState?.enablePriority,statusOptions:i.featureState?.statusOptions,priorityOptions:i.featureState?.priorityOptions,assignToType:i.featureState?.assignToType,visibilityOptions:i.featureState?.visibilityOptions,isPrivateCommentsEnabled:i.featureState?.isPrivateCommentsEnabled}),uiState:g(g({},i.uiState),a.uiState)});t.set(c),this.updateComputedProperties(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService registerTempContext:",a)}}clearTempContext(e){try{this.isTempAnnotationId(e)&&this.contextMap.has(e)&&(this.contextMap.delete(e),this.registryMap.delete(e),this.selectedDialogInstancesByAnnotation.delete(e))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearTempContext:",t)}}computeNewCommentPlaceholder(e,t,a,i){try{if(t)return t;if(e?.placeholder)return e.placeholder;let c=e?.featureState?.userMentions===!0,m=(e?.data?.annotation?.comments?.length||0)>0,h=a||e?.replyplaceholder,_=i||e?.commentplaceholder;return m&&h?h:!m&&_?_:c?m?"Reply or add others with @":"Comment or add others with @":m?"Write a reply...":"Write a comment..."}catch(c){return this.loggingService.catch("Error in CommentDialogCoreService computeNewCommentPlaceholder:",c),"Write a comment..."}}computeEditCommentPlaceholder(e,t,a,i=!1,c,m,h){try{if(t)return t;if(e?.placeholder)return e.placeholder;let _=c||e?.editcommentplaceholder,I=m||e?.editreplyplaceholder,S;if(typeof h=="number"?S=h>0:S=(e?.data?.annotation?.comments?.length||0)>0,S&&I)return I;if(!S&&_)return _;let H=a||e?.editplaceholder;return H||(i?S?"Edit your reply...":"Edit your comment...":"Edit comment...")}catch(_){return this.loggingService.catch("Error in CommentDialogCoreService computeEditCommentPlaceholder:",_),"Edit comment..."}}recomputeDerivedProperties(e){try{let t=this.getContextConfig(e);t&&this.updateComputedProperties(t)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService recomputeDerivedProperties:",t)}}markDialogSelected(e,t){try{if(!e||!t)return;let a=this.selectedDialogInstancesByAnnotation.get(e);a||(a=new Set,this.selectedDialogInstancesByAnnotation.set(e,a)),a.add(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService markDialogSelected:",a)}}markDialogDeselected(e,t){try{if(!e||!t)return;let a=this.selectedDialogInstancesByAnnotation.get(e);if(!a)return;a.delete(t),a.size===0&&this.selectedDialogInstancesByAnnotation.delete(e)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService markDialogDeselected:",a)}}hasOtherSelectedDialogInstance(e,t){try{let a=this.selectedDialogInstancesByAnnotation.get(e);return!a||a.size===0?!1:t?!(a.size===1&&a.has(t)):a.size>0}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService hasOtherSelectedDialogInstance:",a),!1}}resetCollapsedCommentsToDefault(e,t){try{if(this.hasOtherSelectedDialogInstance(e,t))return;let a=this.getContextConfig(e);if(!a)return;let i=a();if(i.uiState?.showAllComments===this.currentShowAllComments&&i.uiState?.collapsedComments===!this.currentShowAllComments&&!i.uiState?.showReplies&&!i.uiState?.showReplyComposer)return;a.set(f(g({},i),{uiState:f(g({},i.uiState),{showAllComments:this.currentShowAllComments,collapsedComments:!this.currentShowAllComments,showReplies:!1,showReplyComposer:!1})}))}catch(a){this.loggingService.catch("Error in CommentDialogCoreService resetCollapsedCommentsToDefault:",a)}}ngOnDestroy(){try{this.serviceSubscriptions.forEach(e=>{e&&!e.closed&&e.unsubscribe()}),this.serviceSubscriptions=[],this.ghostCommentSubscription=null,this.annotationSubscriptions.forEach(e=>{e&&!e.closed&&e.unsubscribe()}),this.annotationSubscriptions.clear()}catch(e){this.loggingService.catch("Error in CommentDialogCoreService ngOnDestroy:",e)}}fetchAndUpdateAnnotation(e,t){try{if(this.annotationSubscriptions.has(e))t&&t();else{let a=this.commentService.getCommentAnnotationByAnnotationId(e).subscribe({next:i=>{if(i){let c=this.getContextConfig(e);if(c){let m=c(),h=f(g({},i),{annotationId:e});c.update(_=>f(g({},_),{data:f(g({},_.data),{annotation:h})})),this.updateComputedProperties(c),this.computeCurrentDialogView(c)}t&&t()}},error:i=>{},complete:()=>{}});this.annotationSubscriptions.set(e,a)}}catch{}}updateContextConfig(e,t){try{let a=this.getContextConfig(e);if(a){let i=a();a.set(g(g({},i),t))}}catch(a){this.loggingService.catch("Error in CommentDialogCoreService updateContextConfig:",a)}}updatePrivateModeEnabledInAllContexts(){this.contextMap.forEach(e=>{let t=e();e.set(f(g({},t),{featureState:f(g({},t.featureState),{privateModeEnabled:this.currentPrivateModeEnabled,privateModeType:this.currentPrivateModeType,privateModeUserIds:this.currentPrivateModeUserIds})})),this.updateComputedProperties(e)})}updateComputedProperties(e){try{let t=e(),a=this.computeIsKnownUser(t),i=this.computeDialogSelectedByKnownUser(t,a),c=this.computeIsPrivateComment(t),m=this.computeCanResolveAnnotation(t,i),h=this.computeCanUnresolveAnnotation(t,i),_=this.computeShowGhostCommentMessage(t),I=this.computeRepliesUniqueUsers(t),S=this.computeShowSuggestionModeActions(t,i),H=this.computeHasReactionsByCommentId(t),$=this.computeUnreadStatus(t),j=!1,Z={};t.appState.isKnownUser!==a&&(j=!0,Z.appState=f(g({},t.appState),{isKnownUser:a})),t.featureState.dialogSelectedByKnownUser!==i&&(j=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{dialogSelectedByKnownUser:i})),t.featureState.canResolveAnnotation!==m&&(j=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{canResolveAnnotation:m})),t.featureState.canUnresolveAnnotation!==h&&(j=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{canUnresolveAnnotation:h})),t.uiState.isPrivateComment!==c&&(j=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{isPrivateComment:c})),t.uiState.showGhostCommentMessage!==_&&(j=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{showGhostCommentMessage:_}));let re=(t.appState.repliesUniqueUsers||[]).map(ct=>ct?.userId).sort().join(","),se=(I||[]).map(ct=>ct?.userId).sort().join(",");re!==se&&(j=!0,Z.appState=f(g(g({},t.appState),Z.appState),{repliesUniqueUsers:I})),t.uiState.showSuggestionModeActions!==S&&(j=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{showSuggestionModeActions:S}));let _e=JSON.stringify(t.uiState.hasReactionsByCommentId||{}),le=JSON.stringify(H||{});_e!==le&&(j=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{hasReactionsByCommentId:H})),t.uiState.unread!==$&&(j=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{unread:$}));let Se=(t.data?.annotation?.customList||[]).map(ct=>ct?.id).filter(Boolean),Re=t.data?.selectedCustomChipSet;(Re instanceof Set?Array.from(Re):[]).slice().sort().join("\0")!==Se.slice().sort().join("\0")&&(j=!0,Z.data=f(g(g({},t.data),Z.data),{selectedCustomChipSet:new Set(Se)})),j&&e.update(ct=>f(g(g({},ct),Z),{appState:g(g({},ct.appState),Z.appState),featureState:g(g({},ct.featureState),Z.featureState),uiState:g(g({},ct.uiState),Z.uiState),data:g(g({},ct.data),Z.data)}))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService updateComputedProperties:",t)}}computeIsKnownUser(e){try{let t=e.appState?.user;return!!(t&&!t.isReadOnly&&!t.isAnonymous)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeIsKnownUser:",t),!1}}computeDialogSelectedByKnownUser(e,t){try{return t&&!!e.appState?.user}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeDialogSelectedByKnownUser:",a),!1}}computeCanResolveAnnotation(e,t){try{let a=e.data?.annotation,i=e.featureState,c=e.uiState;return!!(a&&!c?.disabled&&i?.enableResolve&&t&&a?.status?.type!=="terminal"&&!i?.isPlanExpired)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeCanResolveAnnotation:",a),!1}}computeCanUnresolveAnnotation(e,t){try{let a=e.data?.annotation,i=e.featureState,c=e.uiState;return!!(a&&!c?.disabled&&i?.enableResolve&&t&&a?.status?.type==="terminal"&&!i?.isPlanExpired)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeCanUnresolveAnnotation:",a),!1}}computeIsPrivateComment(e){try{return pr(e.data?.annotation)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeIsPrivateComment:",t),!1}}computeShowGhostCommentMessage(e){try{let t=e.data?.ghostComment,a=e.featureState?.enableGhostCommentsMessage,i=e.data?.annotation,c=e.featureState?.commentAcceptedStatus,m=e.featureState?.commentRejectedStatus;return!!(t&&a&&![c?.id,m?.id].includes(i?.status?.id))}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeShowGhostCommentMessage:",t),!1}}computeRepliesUniqueUsers(e){try{let t=e.data?.annotation;if(!t?.comments||t.comments.length<=1)return[];let a=t.comments.slice(1).map(m=>m?.from).filter(m=>m);return this.getUniqueUsers(a).map(m=>m?.userId&&this.usersService.getUserById(m.userId)||m).filter(m=>m)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeRepliesUniqueUsers:",t),[]}}getUniqueUsers(e){try{let t=new Map;return e.forEach(a=>{a?.userId&&!t.has(a.userId)&&t.set(a.userId,a)}),Array.from(t.values())}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService getUniqueUsers:",t),[]}}computeShowSuggestionModeActions(e,t){try{let a=e.data?.annotation;if(a?.type==="suggestion"&&!!a?.suggestion&&a.suggestion.status==="pending"&&t)return!0;let c=e.featureState?.suggestionMode,m=!!a?.comments?.length,h=a?.status?.type!=="terminal";return!!(c&&t&&h&&m)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeShowSuggestionModeActions:",a),!1}}computeHasReactionsByCommentId(e){try{let t={},a=e.data?.annotation;return a?.comments&&Array.isArray(a.comments)&&a.comments.forEach(i=>{i?.commentId&&(t[i.commentId]=i?.reactionAnnotationIds?.length>0)}),t}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeHasReactionsByCommentId:",t),{}}}computeUnreadStatus(e){try{let t=e.data?.annotation,a=e.appState?.user;return!t||!a?.userSnippylyId?void 0:!t?.viewedByUserIds?.includes(a.userSnippylyId)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService computeUnreadStatus:",t);return}}computeCurrentDialogView(e){try{let t=e(),a=t.data?.annotation,i=a?.annotationId,c=t.appState?.user?.userId,m=a?.from?.userId,h={};if(i&&this.currentCommentViews){let S=this.currentCommentViews?.[i]?.comments;Object.keys(S||{}).forEach(H=>{let $=[],j=0;Object.keys(S[H]?.views||{}).forEach(Z=>{let re={};re.user=this.currentUserContactsBySnippylyId?.[Z],re.viewedAt=S[H]?.views?.[Z]?.timestamp,re.user?.userId!==c&&re.user?.userId!==m&&($.push(re),(re.user?.email||re.user?.name)&&j++)}),h[H]={count:j,views:$}})}let _=JSON.stringify(t.data?.currentDialogView||{}),I=JSON.stringify(h);_!==I&&e.update(S=>f(g({},S),{data:f(g({},S.data),{currentDialogView:h})}))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService computeCurrentDialogView:",t)}}findParentAnnotationId(e,t=20){try{let a=e.nativeElement.parentElement,i=0;for(;a&&i<t;){if(a.tagName?.toLowerCase()==="velt-comment-dialog-context-wrapper"){let m=a.getAttribute("annotation-id");if(m)return m;let h=a.__veltContext;if(h?.annotationId)return h.annotationId;let _=a.__ngContext__;if(_&&Array.isArray(_))for(let I=0;I<_.length;I++){let S=_[I];if(S&&typeof S=="object"&&S.annotationId)return S.annotationId}}a=a.parentElement,i++}return""}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService findParentAnnotationId:",a),""}}};o.TEMP_ID_PREFIX="TEMP_COMPOSER_",o.\u0275fac=function(t){return new(t||o)(be(ae),be(ot),be(Dr),be(Qb),be(A),be(kr),be(Dt),be($t),be(Et),be(ut),be(Ne))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Cn=(()=>{let o=class o{constructor(e){this.loggingService=e,this.subscribers=new Set}register(e){try{if(this.subscribers.add(e),this.lastPayload)try{e(this.lastPayload)}catch(t){this.loggingService.catch("[REGISTRY] Error initializing subscriber:",t)}}catch(t){this.loggingService.catch("[REGISTRY] Error in register:",t)}}unregister(e){try{this.subscribers.delete(e)}catch(t){this.loggingService.catch("[REGISTRY] Error in unregister:",t)}}broadcast(e){try{this.lastPayload=e;let t=0,a=0;this.subscribers.forEach((i,c)=>{try{i(e),t++}catch(m){a++,this.loggingService.catch(`[REGISTRY] Error in subscriber #${t+a}:`,m)}})}catch(t){this.loggingService.catch("[REGISTRY] Error in broadcast:",t)}}getLastPayload(){try{return this.lastPayload}catch(e){this.loggingService.catch("[REGISTRY] Error in getLastPayload:",e);return}}};o.\u0275fac=function(t){return new(t||o)(be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac});let r=o;return r})();var du=new WeakMap;function Kv(r){try{if(!r)return;let o=du.get(r);o&&o()}catch{}}function Nf(r,o,n){if(r)return r;if(o)return o;try{return n()||void 0}catch{return}}function $2(r,o){return r&&r!==o?{nextCachedId:r,annotationChanged:!0}:{nextCachedId:o,annotationChanged:!1}}var te=(()=>{let o=class o extends At{getCachedAnnotationId(){return this._annotationId}setCachedAnnotationId(e){this._annotationId=e}set parentLocalUIState(e){e&&(this.localUIStateSignal=e,this.isLocalUIStateOwner=!1)}get elementRef(){return this.hostElementRef}flushChangeDetection(){this.runScopedFlush();try{(typeof requestAnimationFrame<"u"?requestAnimationFrame:t=>setTimeout(()=>t(0),16))(()=>this.runScopedFlush())}catch{}}runScopedFlush(){try{let e=this.localUIStateSignal?du.get(this.localUIStateSignal):void 0;e?e():this.cd.detectChanges()}catch{try{this.cd.markForCheck()}catch{}}}constructor(){let e=ge(me),t=ge(Et),a=ge(ar),i=ge(ae,{optional:!0}),c=ge(D),m=ge(A),h=new De(null);super(e,t,a,i??void 0,h,c,m),this.annotationId=Q(),this.inlineCommentSectionMode=Q(!1,{transform:_=>{try{return typeof _=="string"?_==="true"||_==="":_}catch{return!1}}}),this.defaultCondition=Q(!0,{transform:_=>{try{return typeof _=="string"?_==="true"||_==="":_}catch{return!0}}}),this._contextData={},this.isLocalUIStateOwner=!1,this.isContextInitialized=!1,this.registryCheckAttempts=0,this.MAX_REGISTRY_CHECK_ATTEMPTS=50,this.lastFollowedDarkMode=void 0,this.globalDarkMode=Me(!1),this.composerDraft=L(()=>{try{let _=this.componentConfigSignal()?.data?.annotation?.annotationId||this._annotationId;if(!_)return null;let I=this.coreService.getOrCreateComposerDraft(_)();return lu(I)?null:I}catch{return null}}),this.onContextPayload=_=>{try{this.isContextInitialized||(this.isContextInitialized=!0),this._annotationId=_.annotationId,this._contextData=_.contextData||{};let I=this.coreService.getContextConfig(_.annotationId);if(I){if(this.componentConfigSignal.update(S=>g({},S)),this.componentConfigSignal=I,this.isLocalUIStateOwner){let S=this._contextData["comment-pin-selected"],H=S==="true"||S==="",$=this._contextData["full-expanded"],j=$==="true"||$==="",Z=H||j,re=this._contextData["inline-comment-section-mode"],se=re==="true"||re==="";this.localUIStateSignal.update(_e=>f(g({},_e),{commentPinSelected:H,fullExpanded:j,commentDialogSelected:Z})),I.update(_e=>f(g({},_e),{featureState:f(g({},_e.featureState),{inlineCommentSectionMode:se||_e.featureState.inlineCommentSectionMode,fullExpanded:j})}))}this.coreService.recomputeDerivedProperties(_.annotationId),this.cd.markForCheck()}}catch(I){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent onContextPayload:",I)}},this.darkModeFollow$=h,this.globalDarkModeSubscription=t.getDarkMode$().subscribe(_=>{this.globalDarkMode.set(!!_)}),this.hostElementRef=e,this.themeService=t,this.dynamicDataService=c,this.loggingService=m,this.coreService=ge(co),this.actionService=ge(Zv),this.cd=a,this.commentService=i??void 0,this.registry=ge(Cn,{optional:!0})??void 0,this.initializeLocalUIState(),_t(()=>{try{let _=this.componentConfigSignal?.()?.uiState?.darkMode;this.globalDarkMode(),this.applyFollowedDarkMode(_)}catch(_){this.loggingService?.catch("Error in CommentDialogPrimitiveThemedComponent darkMode follow effect:",_)}})}applyFollowedDarkMode(e){try{if(this.isLocalUIStateOwner)return;let a=typeof e=="boolean"&&e!==this.globalDarkMode()?e:null;if(this.lastFollowedDarkMode===a)return;this.lastFollowedDarkMode=a,this.darkModeFollow$?.next(a)}catch(t){this.loggingService?.catch("Error in CommentDialogPrimitiveThemedComponent applyFollowedDarkMode:",t)}}initializeLocalUIState(){try{let e=ge(iu,{optional:!0,skipSelf:!0});e?(this.localUIStateSignal=e,this.isLocalUIStateOwner=!1):(this.localUIStateSignal=Me(mp()),this.isLocalUIStateOwner=!0)}catch{this.localUIStateSignal=Me(mp()),this.isLocalUIStateOwner=!0}}ngOnInit(){try{super.ngOnInit(),this.isLocalUIStateOwner&&this.localUIStateSignal&&du.set(this.localUIStateSignal,()=>{try{this.cd.detectChanges()}catch{}});let e=this.annotationId();if(!e){let a=this.hostElementRef?.nativeElement?.getAttribute?.("annotation-id");a&&(e=a)}if(this.componentConfigSignal&&this.componentConfigSignal()&&Object.keys(this.componentConfigSignal()).length>0){this.initializeFromConfigSignal(this.componentConfigSignal),this.setupA11yAttributes(),this.setupDarkModeSync();return}if(e){this._annotationId=e,this.initializeFromAnnotationId(e),this.setupA11yAttributes(),this.setupDarkModeSync();return}let t=this.findNearestParentWrapperRegistry();if(t){this.registry=t,this.registry.register(this.onContextPayload);let a=this.registry.getLastPayload?.();a&&this.onContextPayload(a),this.setupA11yAttributes(),this.setupDarkModeSync();return}if(this.registry){this.registry.register(this.onContextPayload);let a=this.registry.getLastPayload?.();a&&this.onContextPayload(a),this.setupA11yAttributes(),this.setupDarkModeSync();return}this.tryRegisterWithContext(),this.setupA11yAttributes(),this.setupDarkModeSync()}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnInit:",e)}}ngOnChanges(e){try{super.ngOnChanges(e);let t=e.componentConfigSignal;t&&!t.firstChange&&this.refreshAnnotationContextFromSignal()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnChanges:",t)}}refreshAnnotationContextFromSignal(){try{let e=Vc(()=>this.componentConfigSignal?.()?.data?.annotation?.annotationId),{nextCachedId:t,annotationChanged:a}=$2(e,this._annotationId);if(a){let i=this._annotationId;this._annotationId=t,this.onAnnotationContextChanged(i,t),this.cd?.markForCheck()}}catch(e){this.loggingService?.catch("Error in CommentDialogPrimitiveThemedComponent refreshAnnotationContextFromSignal:",e)}}onAnnotationContextChanged(e,t){}ngOnDestroy(){try{this.registryCheckTimer&&(clearTimeout(this.registryCheckTimer),this.registryCheckTimer=void 0),this.registry&&this.registry.unregister(this.onContextPayload),this.globalDarkModeSubscription&&this.globalDarkModeSubscription.unsubscribe(),this.darkModeConfigSyncSubscription&&this.darkModeConfigSyncSubscription.unsubscribe(),this.isLocalUIStateOwner&&this.localUIStateSignal&&du.delete(this.localUIStateSignal),super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnDestroy:",e)}}setupA11yAttributes(){}setupDarkModeSync(){try{if(!this.isLocalUIStateOwner)return;let e=!1;this.darkModeConfigSyncSubscription=this.onDarkModeChange().subscribe(t=>{try{let a=!e;if(e=!0,this.componentConfigSignal&&typeof this.componentConfigSignal=="function"){let i=this.componentConfigSignal();i&&i.uiState&&i.uiState.darkMode!==t&&this.componentConfigSignal.update(c=>f(g({},c),{uiState:f(g({},c.uiState),{darkMode:t})}))}a||Kv(this.localUIStateSignal)}catch(a){this.loggingService.catch("Error in darkMode sync subscription:",a)}})}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent setupDarkModeSync:",e)}}findNearestParentWrapperRegistry(){try{let e=this.hostElementRef?.nativeElement;if(!e)return;let t=e.parentElement;for(;t;){if(t.tagName?.toLowerCase()==="velt-comment-dialog-context-wrapper"){let a=t.__veltContext;if(a?.registry instanceof Cn)return a.contextData&&(this._contextData=a.contextData),a.registry;let i=window.ng;if(i?.getComponent){let m=i.getComponent(t);if(m?.registry)return m.registry}let c=t.__ngContext__;if(c&&Array.isArray(c))for(let m=0;m<c.length;m++){let h=c[m];if(h&&typeof h=="object"&&h.registry instanceof Cn)return h.registry}}t=t.parentElement}}catch(e){this.loggingService.catch("[PRIMITIVE BASE] Error finding parent wrapper registry:",e)}}tryRegisterWithContext(){try{let e=this.coreService.findParentAnnotationId(this.hostElementRef);if(!e){this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS&&(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10));return}this.registry=this.coreService.getRegistry(e),this.registry?this.registry.register(this.onContextPayload):this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS?(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10)):this.initializeFromDOM(e)}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent tryRegisterWithContext:",e)}}getContextValue(e){try{let t=this._contextData[e];if(t!=null)return t;let a=this.hostElementRef?.nativeElement?.getAttribute(e);return a!==null?a:void 0}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getContextValue:",t);return}}getContextCommentId(){try{let e=this.getContextValue("comment-id");if(e==null)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getContextCommentId:",e);return}}getAnnotationId(){try{return this.resolveAnnotationIdUntracked()}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getAnnotationId:",e);return}}resolveAnnotationIdUntracked(){return Nf(Vc(()=>this.componentConfigSignal()?.data?.annotation?.annotationId),this._annotationId,()=>this.coreService.findParentAnnotationId(this.hostElementRef))}getAnnotationIdReactive(){try{return Nf(this.componentConfigSignal()?.data?.annotation?.annotationId,this._annotationId,()=>this.coreService.findParentAnnotationId(this.hostElementRef))}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getAnnotationIdReactive:",e);return}}initializeFromDOM(e){try{this._annotationId=e;let t=this.coreService.getContextConfig(e);t&&(this.componentConfigSignal.update(a=>g({},a)),this.componentConfigSignal=t,this.isContextInitialized=!0,this.cd.markForCheck())}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromDOM:",t)}}initializeFromAnnotationId(e){try{this._annotationId=e;let t=this.coreService.getOrCreateContextConfig(e);this.componentConfigSignal.update(S=>g({},S)),this.componentConfigSignal=t,this.isContextInitialized=!0;let a=!1,i=!1,c=this.hostElementRef?.nativeElement?.getAttribute?.("comment-pin-selected");(c==="true"||c==="")&&(a=!0);let m=this.hostElementRef?.nativeElement?.getAttribute?.("full-expanded");(m==="true"||m==="")&&(i=!0);let h=a||i,_=t(),I=this.inlineCommentSectionMode();t.set(f(g({},_),{featureState:f(g({},_.featureState),{inlineCommentSectionMode:I!==!1?I:_.featureState.inlineCommentSectionMode,fullExpanded:i})})),this.isLocalUIStateOwner&&this.localUIStateSignal.update(S=>f(g({},S),{commentPinSelected:a,fullExpanded:i,commentDialogSelected:h})),this.coreService.recomputeDerivedProperties(e),this.cd.markForCheck()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromAnnotationId:",t)}}initializeFromConfigSignal(e){try{let a=e().data?.annotation?.annotationId;a&&(this._annotationId=a),this.isContextInitialized=!0,this.cd.markForCheck()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromConfigSignal:",t)}}veltEmit(e){return typeof CustomEvent<"u"&&e instanceof CustomEvent?e.detail:e}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["app-comment-dialog-primitive-themed-base"]],inputs:{annotationId:[1,"annotationId"],inlineCommentSectionMode:[1,"inlineCommentSectionMode"],defaultCondition:[1,"defaultCondition"],parentLocalUIState:"parentLocalUIState"},standalone:!1,features:[M,nt],decls:0,vars:0,template:function(t,a){},encapsulation:2});let r=o;return r})();function Rf(r,o){try{let n=r??[];if(n.some(a=>a.startsWith("organizationPrivate:")))return dt.ORGANIZATION_PRIVATE;let e=X.VISIBILITY_SELF_PREFIX,t=n.filter(a=>a.startsWith(e));if(t.length>0){if(t.length===1&&o?.userId){let a=new Set(t.map(c=>c.substring(e.length))),i=ur(o.userId).toString();if(a.has(i))return dt.RESTRICTED_SELF}return dt.RESTRICTED_SELECTED_PEOPLE}return dt.PUBLIC}catch{return dt.PUBLIC}}function sp(r,o){try{let n=r??[],e=X.VISIBILITY_SELF_PREFIX,t=n.filter(m=>m.startsWith(e));if(t.length===0)return[];let a=new Set(t.map(m=>m.substring(e.length))),i=o??[],c=[];for(let m of i)if(m?.userId){let h=ur(m.userId).toString();a.has(h)&&c.push(m)}return c}catch{return[]}}function j2(r,o,n){try{let e=r?.visibilityConfig?.type==="restricted"?r?.visibilityConfig?.userIds:void 0;return e&&e.length>0?Lf(e,n):sp(o,n)}catch{return[]}}function mo(r,o){try{let n=r??[],e="organizationPrivate:",t=n.filter(i=>i.startsWith(e));if(t.length===0)return[];let a=new Set(t.map(i=>i.substring(e.length)));return(o??[]).filter(i=>i?.id&&a.has(Gv(i.id)))}catch{return[]}}function Uf(r){try{let o=r?.privateModeEnabled,n=r?.privateModeType;if(!o||!n)return dt.PUBLIC;switch(n){case"organizationPrivate":return dt.ORGANIZATION_PRIVATE;case"restricted":{let e=r?.privateModeUserIds;return e&&e.length>0?dt.RESTRICTED_SELECTED_PEOPLE:dt.RESTRICTED_SELF}default:return dt.PUBLIC}}catch{return dt.PUBLIC}}function Lf(r,o){try{let n=r??[];if(n.length===0)return[];let e=o??[],t=new Set(n),a=e.filter(c=>t.has(c?.userId)),i=new Set(a.map(c=>c.userId));for(let c of n)i.has(c)||a.push({userId:c});return a}catch{return[]}}function Tr(r){try{let n=r?.data?.annotation?.context?.accessFields??[];return n.length>0?Rf(n,r?.appState?.user):Uf(r?.featureState)}catch{return dt.PUBLIC}}function kn(r,o,n){try{return r&&r.length>0?r:Zc(o,n).users}catch{return[]}}function Zc(r,o){try{let n=r?.data?.annotation,e=n?.context?.accessFields??[];if(e.length>0){let i=Rf(e,r?.appState?.user),c=i===dt.RESTRICTED_SELECTED_PEOPLE?j2(n,e,o):[];return{visibility:i,users:c}}let t=Uf(r?.featureState),a=t===dt.RESTRICTED_SELECTED_PEOPLE?Lf(r?.featureState?.privateModeUserIds,o):[];return{visibility:t,users:a}}catch{return{visibility:dt.PUBLIC,users:[]}}}var Zv=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,H,$,j,Z,re,se){this.commentActionsService=e,this.commentService=t,this.domService=a,this.coreService=i,this.customFilterService=c,this.loggingService=m,this.analyticsService=h,this.commentTextPortalService=_,this.serviceBook=I,this.domSanitizer=S,this.contactService=H,this.authService=$,this.docService=j,this.targetRegistry=Z,this.suggestionActions=re,this.commonDbService=se,this.viewsService=null,this.inFlightSubmits=new Set,this.serviceBook.observe(Eo).subscribe(_e=>{this.viewsService=_e??null})}isSubmitInFlight(e){return!!e&&this.inFlightSubmits.has(e)}get timestamp(){return this.commonDbService.getServerTimestamp()}deleteComment(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=i(),m=t;t||(m=c.data?.annotation?.comments?.length?c.data?.annotation?.comments[0]:null),this.commentActionsService.deleteComment({annotationId:e,commentId:m?.commentId,skipDeleteThreadConfirmation:a}),m?.commentId&&this.clearEditDraftFromSession(e,m.commentId)}catch(i){this.loggingService.catch("Error in CommentDialogActionService deleteComment:",i)}}changeCommentStatus(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:t.status})}catch(a){this.loggingService.catch("Error in CommentDialogActionService changeCommentStatus:",a)}}changeStatus(e,t){try{this.changeCommentStatus(e,t)}catch(a){this.loggingService.catch("Error in CommentDialogActionService changeStatus:",a)}}openAllComments(e){try{if(!this.coreService.getContextConfig(e))return;this.commentService.onSidebarButtonOnCommentDialogClick(),this.commentService.setSidebarVisibility(!0),(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR))?.hasAttribute(X.ATTRIBUTES.EMBED_MODE)&&this.commentService.openSidebar()}catch(t){this.loggingService.catch("Error in CommentDialogActionService openAllComments:",t)}}copyLink(e){return Ae(this,null,function*(){try{return this.coreService.getContextConfig(e)?!!(yield this.commentActionsService.copyLink({annotationId:e})):!1}catch(t){return this.loggingService.catch("Error in CommentDialogActionService copyLink:",t),!1}})}approveComment(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t().data?.annotation&&this.commentActionsService.approveCommentAnnotation({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService approveComment:",t)}}closeAssignToMenu(e,t){try{let a=t?this.coreService.getLocalUIState(t):void 0;a&&a.update(i=>f(g({},i),{assignToMenuOpened:!1}))}catch(a){this.loggingService.catch("Error in CommentDialogActionService closeAssignToMenu:",a)}}assignCommentToUser(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;i().data?.annotation&&(this.commentActionsService.assignUser({annotationId:e,assignedTo:t}),this.closeAssignToMenu(e,a))}catch(i){this.loggingService.catch("Error in CommentDialogActionService assignCommentToUser:",i)}}closeDialog(){try{this.domService.resetSelectedAnnotationsMap()}catch(e){this.loggingService.catch("Error in CommentDialogActionService closeDialog:",e)}}toggleHideReply(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(t.update(c=>(c.uiState.showReplies=!1,c.uiState.collapsedComments=!0,c.uiState.showAllComments=!1,c)),this.coreService.recomputeDerivedProperties(e),i)if(a.featureState?.sidebarMode)this.domService.toggleAnnotationSelection(i,a.uiState?.containerComponentId,"sidebarShowReplies");else{let c=i.multiThreadAnnotationId||a.uiState?.multiThreadAnnotationId;this.domService.toggleAnnotationSelection(i,a.uiState?.containerComponentId,void 0,void 0,c)}}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleHideReply:",t)}}toggleFormatToolbar(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{formatToolbarOpen:!a.uiState?.formatToolbarOpen})}))}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleFormatToolbar:",t)}}showReplyComposer(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{showReplyComposer:!0})})),setTimeout(()=>this.focusOnComposerInput(e),100)}catch(t){this.loggingService.catch("Error in CommentDialogActionService showReplyComposer:",t)}}onMoreRepliesClick(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t();this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_MORE_REPLY_OPTION_CLICKED,{annotationId:e,commentType:this.commentService.getCommentType(a.data?.annotation),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),t.update(i=>{let c=!i.uiState.showAllComments;return i.uiState.showAllComments=c,i.uiState.collapsedComments=!c,i})}catch(t){this.loggingService.catch("Error in CommentDialogActionService onMoreRepliesClick:",t)}}navigateToComment(e){try{let t=this.coreService.getContextConfig(e);if(!t)return null;let i=t().data?.annotation;return i?(this.commentService.onCommentNavigationButtonClick(i),i):null}catch(t){return this.loggingService.catch("Error in CommentDialogActionService navigateToComment:",t),null}}onInboxModeChange(e,t){try{if(t){let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>f(g({},i),{uiState:f(g({},i.uiState),{showAllComments:!0,collapsedComments:!1})}))}}catch(a){this.loggingService.catch("Error in CommentDialogActionService onInboxModeChange:",a)}}onSignInClick(){try{this.commentService.onSignInClick()}catch(e){this.loggingService.catch("Error in CommentDialogActionService onSignInClick:",e)}}onUpgradeClick(){try{this.commentService.onUpgradeClick()}catch(e){this.loggingService.catch("Error in CommentDialogActionService onUpgradeClick:",e)}}resolveComment(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: resolveComment","color: green;");try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:this.customFilterService.resolvedStatus})}catch(a){this.loggingService.catch("Error in CommentDialogActionService resolveComment:",a)}}unresolveComment(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: unresolveComment","color: green;");try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:this.customFilterService.defaultStatus})}catch(a){this.loggingService.catch("Error in CommentDialogActionService unresolveComment:",a)}}toggleShowReplies(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return{openFocusedThread:!1,annotation:null};let i=a(),c=i.data?.annotation;if(c){if(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_MORE_REPLY_OPTION_CLICKED,{annotationId:c.annotationId,commentType:this.commentService.getCommentType(c),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),i.featureState?.isFocusedThreadEnabled&&i.featureState?.openAnnotationInFocusMode)return{openFocusedThread:!0,annotation:c};if(a.update(m=>{let h=t!==void 0?t:!m.uiState.showReplies;return f(g({},m),{uiState:f(g({},m.uiState),{showReplies:h,collapsedComments:!1,showAllComments:!0,commentDialogSelected:h})})}),this.coreService.recomputeDerivedProperties(e),!i.uiState?.commentPinSelected)if(i.featureState?.sidebarMode)this.domService.toggleAnnotationSelection(c,i.uiState?.containerComponentId,"sidebarShowReplies");else{let m=c.multiThreadAnnotationId||i.uiState?.multiThreadAnnotationId;this.domService.toggleAnnotationSelection(c,i.uiState?.containerComponentId,void 0,void 0,m)}}return{openFocusedThread:!1,annotation:null}}catch(a){return this.loggingService.catch("Error in CommentDialogActionService toggleShowReplies:",a),{openFocusedThread:!1,annotation:null}}}acceptCommentAnnotation(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(!i)return;this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:i.annotationId,commentType:this.commentService.getCommentType(i),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),this.commentTextPortalService.onAcceptComment(i),this.commentActionsService.acceptCommentAnnotation({annotationId:i.annotationId})}catch(t){this.loggingService.catch("Error in CommentDialogActionService acceptCommentAnnotation:",t)}}emitCommentActionClicked(e){try{let t=this.commentService.getCommentAnnotationByIdSync(e.annotationId);if(!t)return;this.commentActionsService.emitCommentActionClicked(f(g({},e),{annotation:t}))}catch(t){this.loggingService.catch("Error in CommentDialogActionService emitCommentActionClicked:",t)}}acceptSuggestion(e){return Ae(this,null,function*(){try{this.commentActionsService.acceptSuggestion({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService acceptSuggestion:",t)}})}rejectSuggestion(e,t){return Ae(this,null,function*(){try{this.commentActionsService.rejectSuggestion({annotationId:e,reason:t})}catch(a){this.loggingService.catch("Error in CommentDialogActionService rejectSuggestion:",a)}})}deleteSuggestionThread(e){return Ae(this,null,function*(){try{if(!e)return;yield this.commentActionsService.deleteCommentAnnotation({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService deleteSuggestionThread:",t)}})}openSuggestionComment(e){try{if(!e)return;this.commentService.scrollToCommentByAnnotationId(e),this.commentService.selectCommentByAnnotationId(e)}catch(t){this.loggingService.catch("Error in CommentDialogActionService openSuggestionComment:",t)}}rejectCommentAnnotation(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(!i)return;this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_REJECT_BUTTON_CLICKED,{annotationId:i.annotationId,commentType:this.commentService.getCommentType(i),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),this.commentActionsService.rejectCommentAnnotation({annotationId:i.annotationId})}catch(t){this.loggingService.catch("Error in CommentDialogActionService rejectCommentAnnotation:",t)}}deleteAttachment(e,t,a,i){try{let c=this.coreService.getContextConfig(e);if(!c)return;let m=c(),h=i?this.coreService.getLocalUIState(i):void 0,_=h?.()?.editComment,I=null;if(a?I=_?.attachments?.[t]:I=h?.()?.selectedAttachments?.[t],I?.attachmentId){let S=_?m.uiState?.editCommentTextArea?.nativeElement:m.uiState?.newCommentTextArea?.nativeElement;S&&this.removeAttachmentTag(e,I.attachmentId,S,i)}if(a&&h){let S=h()?.editComment;if(S?.attachments){let H=[...S.attachments],$=H.splice(t,1);h.update(j=>f(g({},j),{editComment:f(g({},j.editComment),{attachments:H}),attachmentsToDelete:[...j.attachmentsToDelete||[],...$]}))}}else if(h){let H=h()?.selectedFiles?.[t];if(H?.url)try{URL.revokeObjectURL(H.url)}catch{}h.update($=>{let j=$.selectedFiles?[...$.selectedFiles.slice(0,t),...$.selectedFiles.slice(t+1)]:[],Z=$.selectedAttachments?[...$.selectedAttachments.slice(0,t),...$.selectedAttachments.slice(t+1)]:[];return f(g({},$),{selectedFiles:j,selectedAttachments:Z})})}if(!a){let H=this.coreService.getOrCreateComposerDraft(e)();if(H.selectedFiles?.length||H.selectedAttachments?.length){let $=H.selectedFiles?.[t];if($?.url)try{URL.revokeObjectURL($.url)}catch{}this.coreService.setComposerDraftAttachments(e,{selectedFiles:(H.selectedFiles||[]).filter((j,Z)=>Z!==t),selectedAttachments:(H.selectedAttachments||[]).filter((j,Z)=>Z!==t)}),Kv(h)}}!a&&I&&this.deleteAttachments(e,[I]),this.checkGetAnnotationDraftAttribute(e,i)}catch(c){this.loggingService.catch("Error in CommentDialogActionService deleteAttachment:",c)}}removeInvalidFile(e,t,a){try{let c=this.coreService.getOrCreateComposerDraft(e)(),m=!1;if(c.invalidSelectedFiles?.length&&t>=0&&t<c.invalidSelectedFiles.length){let I=c.invalidSelectedFiles[t];if(I?.url)try{URL.revokeObjectURL(I.url)}catch{}this.coreService.setComposerDraftAttachments(e,{invalidSelectedFiles:c.invalidSelectedFiles.filter((S,H)=>H!==t)}),m=!0}let h=a?this.coreService.getLocalUIState(a):void 0;if(!h)return;let _=h();if(_?.invalidSelectedFiles&&_.invalidSelectedFiles.length>t){let I=[..._.invalidSelectedFiles.slice(0,t),..._.invalidSelectedFiles.slice(t+1)];this.loggingService.log(`Invalid file removed at index ${t} for annotation ${e}. Remaining: ${I.length}`),h.update(S=>f(g({},S),{invalidSelectedFiles:I}))}else m||this.loggingService.catch(`Cannot remove invalid file: Index ${t} out of bounds for annotation ${e}`,new Error("Index out of bounds"))}catch(i){this.loggingService.catch("Error in CommentDialogActionService removeInvalidFile:",i)}}setAssignTo(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>{let c=i.featureState?.assignToType==="checkbox"?!0:i.data?.isAssignedCheckbox;return f(g({},i),{data:f(g({},i.data),{assignTo:t,isAssignedCheckbox:c})})})}catch(a){this.loggingService.catch("Error in CommentDialogActionService setAssignTo:",a)}}toggleAssignToCheckbox(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{data:f(g({},a.data),{isAssignedCheckbox:!a.data?.isAssignedCheckbox})}))}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleAssignToCheckbox:",t)}}onDeleteRecorderAnnotation(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=a?this.coreService.getLocalUIState(a):void 0;c&&c.update(I=>f(g({},I),{localRecordedData:(I.localRecordedData||[]).filter(S=>S.id!==t.annotationId)}));let m=c?.()?.editComment,_=i().data?.annotation;m?.commentId&&_?.annotationId&&this.commentActionsService.deleteRecording({annotationId:_.annotationId,commentId:m.commentId,recorderId:t.annotationId})}catch(i){this.loggingService.catch("Error in CommentDialogActionService onDeleteRecorderAnnotation:",i)}}onRecordedData(e,t,a){try{let i=a?this.coreService.getLocalUIState(a):void 0;i&&(i.update(c=>f(g({},c),{localRecordedData:[...c.localRecordedData||[],t]})),Kv(i)),this.domService.setRecordingInProgress(e,!1),this.checkGetAnnotationDraftAttribute(e,a)}catch(i){this.loggingService.catch("Error in CommentDialogActionService onRecordedData:",i)}}addFiles(e,t,a){return Ae(this,null,function*(){try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot add files: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation;if(!m){this.loggingService.catch(`Cannot add files: No annotation found for ${e}`,new Error("Annotation not found"));return}this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_BUTTON_CLICKED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()});let h=a?this.coreService.getLocalUIState(a):void 0,_=[],I=[];if(t.length)for(let H=0;H<t.length;H++){let $=t[H],j=URL.createObjectURL($),Z=this.domSanitizer.bypassSecurityTrustUrl(j),re=this.commentActionsService.validateFile($);if(re.valid){let se=$?.type,_e={file:$,url:$?.type?.includes("svg")?Z:j,fileType:se};_.push(_e),h&&h.update(le=>f(g({},le),{selectedFiles:[...le.selectedFiles||[],_e]}))}else{let se={file:$,url:j,errorMessage:re?.maxAllowedSizeInMB?`Size > ${re?.maxAllowedSizeInMB}MB`:"Size > 15MB"};I.push(se),h&&h.update(_e=>f(g({},_e),{invalidSelectedFiles:[..._e.invalidSelectedFiles||[],se]})),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_SIZE_EXCEEDED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentSize:$.size,attachmentType:$.type})}}if(i.update(H=>f(g({},H),{uiState:f(g({},H.uiState),{uploadingAttachments:!0})})),Kv(h),this.coreService.isStandaloneComposerOwner(a)){let H=this.coreService.getOrCreateComposerDraft(e)();this.coreService.setComposerDraftAttachments(e,{selectedFiles:[...H.selectedFiles||[],..._],invalidSelectedFiles:[...H.invalidSelectedFiles||[],...I]})}let S=yield this.uploadFiles(e,a);if(h&&h.update(H=>f(g({},H),{selectedAttachments:[...H.selectedAttachments||[],...S]})),i.update(H=>f(g({},H),{uiState:f(g({},H.uiState),{uploadingAttachments:!1})})),Kv(h),this.coreService.isStandaloneComposerOwner(a)){let H=this.coreService.getOrCreateComposerDraft(e)();this.coreService.setComposerDraftAttachments(e,{selectedAttachments:[...H.selectedAttachments||[],...S||[]]})}this.checkGetAnnotationDraftAttribute(e,a)}catch(i){this.loggingService.catch("Error in CommentDialogActionService addFiles:",i);let c=this.coreService.getContextConfig(e);c&&c.update(m=>f(g({},m),{uiState:f(g({},m.uiState),{uploadingAttachments:!1})}))}})}uploadFiles(e,t){return Ae(this,null,function*(){try{let a=this.coreService.getContextConfig(e);if(!a)return[];let i=a(),c=i.data?.annotation,m=t?this.coreService.getLocalUIState(t):void 0,h=m?.()?.selectedFiles||[];if(!c||!h.length)return[];let _=[],I=(S,H)=>{m&&m.update($=>f(g({},$),{selectedFiles:$.selectedFiles?.map((j,Z)=>Z===S?g(g({},j),H):j)}))};for(let S=0;S<h.length;S++){let H=h[S];if(!H.uploaded&&!H.uploading){I(S,{uploading:!0});let $=H.file;try{let[j]=yield this.commentActionsService.addAttachment({annotationId:c.annotationId,files:[$]},"internal"),Z=j?.attachment;if(Z){this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_ADDED,{annotationId:c.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(c),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentId:Z.attachmentId,attachmentSize:Z.size,attachmentType:Z.type}),_.push(Z);let re=a(),se=re.uiState?.editCommentTextArea?.nativeElement||re.uiState?.newCommentTextArea?.nativeElement;se&&re.uiState?.attachmentNameInMessage&&setTimeout(()=>{this.focusOnComposerInput(e,!0),this.insertAttachmentTag(e,se,Z,t)},100)}I(S,{uploaded:!0,uploading:!1})}catch(j){this.loggingService.catch("Error uploading individual file:",j),I(S,{uploading:!1})}}}return _}catch(a){return this.loggingService.catch("Error in CommentDialogActionService uploadFiles:",a),[]}})}startRecording(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot start recording: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation;if(!m){this.loggingService.catch(`Cannot start recording: No annotation found for ${e}`,new Error("Annotation not found"));return}this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_RECORDING_TOOL_CLICKED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),recorderType:t});let h=m?.metadata?.clientDocumentId,_=c.uiState?.commentDialogUniqueId,I=c.uiState?.darkMode,S=c.uiState?.dialogShadowDOM;this.serviceBook.get(dn)?.initRecording(t,a??_,!0,I,S,m.annotationId,h),setTimeout(()=>{this.checkGetAnnotationDraftAttribute(e,a)},100)}catch(i){this.loggingService.catch("Error in CommentDialogActionService startRecording:",i)}}checkGetAnnotationDraftAttribute(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;let i=a(),m=(t?this.coreService.getLocalUIState(t):void 0)?.(),h=m?.composerContent,_=h&&h!==`
1
+ import{C as ap}from"./chunk-F7SQEW6P.js";import{a as pf}from"./chunk-ID3E7CBZ.js";import{a as bf}from"./chunk-IU25BW6T.js";import{a as tb,b as rb,c as Yg,d as Kg}from"./chunk-IBGPKEZW.js";import{a as Zg}from"./chunk-EQBACTBQ.js";import"./chunk-UKJTOZK4.js";import"./chunk-F36WWKDQ.js";import{b as Yh,c as Kh,d as Zh}from"./chunk-VMY3F7K3.js";import{a as Kr}from"./chunk-JHMDMOHO.js";import{b as hf}from"./chunk-FVDWCK7Z.js";import{a as wg,c as vb,d as cb}from"./chunk-F44SU3DK.js";import{a as bn}from"./chunk-SYSCTHS4.js";import{a as ao}from"./chunk-SY46UNW5.js";import{a as Jb,b as no,c as of,d as Gg,e as af,f as lf,g as xr,h as zg,i as df,j as Hg,k as hn,n as Wg,o as vf,p as cf,q as oo,r as mf,s as sf,t as gf}from"./chunk-AOHWVH4J.js";import"./chunk-5R5ZQKPN.js";import{b as _g,c as Sg,g as yg,l as ib,m as lb,r as db,s as gb,w as ub,x as Pt}from"./chunk-XISY42XO.js";import{a as Jg}from"./chunk-WFO2GRDO.js";import{a as Wt}from"./chunk-TW7O56QU.js";import{a as mt,b as qt}from"./chunk-7RRXZUH7.js";import{A as jg,B as N,C as P,a as Vg,b as $g,v as rf,z as nf}from"./chunk-CI2SH5RY.js";import{a as Be,b as Yc}from"./chunk-CQX575C2.js";import{a as tf,b as W,c as Yr,d as Lt}from"./chunk-F6CKB7IS.js";import{a as uf}from"./chunk-FUYX2CTL.js";import{a as Dr}from"./chunk-RLD74EXO.js";import{a as nb}from"./chunk-QTF4Y24I.js";import{A as on,F as Qh,G as gt,H as ht,I as eb,Y as mb,ba as sb,ca as $t,da as D,ea as Et,f as bg,fa as xe,ga as At,j as Wh,m as Vv,n as fg,p as Jh,r as Cg,s as Xh,t as kg,v as qh}from"./chunk-3ORHWUHZ.js";import{$ as rt,$b as nn,$f as xb,$h as zb,A as Ih,Aa as hr,Ab as br,Ah as Ub,Ai as Xb,Bb as fr,Bf as To,Bg as Tb,C as Dh,Ca as vr,Ce as Ur,Cf as ur,Cg as Ob,Ch as oe,D as Hu,Db as ft,De as dt,Df as Mg,Dg as Eb,Dh as np,Di as qb,E as Gt,Ea as vg,Eb as Ct,Ec as zr,Ed as ob,Ee as X,Ef as Gv,Fa as d,Fb as kt,Fc as It,Ff as mr,Fi as ut,G as jr,Ga as Le,Gb as Dn,Gc as ue,Gf as eo,Gi as Qb,Ha as cg,Hb as Uv,Hf as pr,I as Nv,Ia as Ph,Ib as we,If as An,Ig as Mb,J as Jn,Jb as it,Jf as Pn,Jg as Wr,Kb as pe,Ke as Tg,Kf as Ku,Kg as Ab,L as ir,Lc as qe,Lf as Zu,M as In,Ma as mg,Mb as Lv,N as Th,Nb as ie,Nc as Bv,Nf as jc,Ni as ef,O as Oh,Oa as Rv,Ob as Ge,Oc as gn,Od as ab,Oe as Yt,Of as Xu,Pa as G,Pb as fe,Pc as zh,Pe as Mn,Pf as Ag,Pg as Oo,Ph as dn,Pi as ro,Q as ig,Qb as ug,Qe as Nt,Qg as zc,Qh as op,R as Eh,Ra as Fh,Rb as Vh,Re as hb,Rg as Hc,S as Wu,Se as qn,Sf as fb,T as Pe,Ta as Nh,Td as Kn,Tf as un,Ua as T,Ud as Zn,Uf as Cb,Uh as Lg,Va as Rh,Vf as Ht,Vh as Lb,W as Lc,Wa as Uh,Wd as Ju,Wh as Bb,Xc as Hh,Xd as Ze,Xh as Vb,Y as Bc,Ya as M,Yb as $h,Yf as qu,Yh as $b,Zb as pg,Zd as lt,Ze as Qn,Zf as an,Zh as jb,_ as lg,_a as s,_b as U,_f as kb,_h as Gb,a as g,aa as Mh,ac as vt,ae as Ig,ag as _b,ai as Bg,b as f,ba as Ah,bb as sg,bc as ce,bg as Sb,bi as Hv,ca as be,cc as C,da as ge,db as k,dc as Ce,di as Hb,eb as Gr,ec as Ke,ef as Og,eg as Gc,eh as Pb,fb as y,fc as O,fg as Pg,fh as Fb,fi as Eo,g as Ae,gb as w,gc as yt,gg as pn,h as xh,ha as B,hb as Lh,hc as Yn,hg as ln,hh as Rg,i as _h,ia as V,ib as gg,if as bb,ig as Qu,ih as zv,ii as kr,ja as de,jb as et,jc as Tn,jg as yb,ji as sr,k as jt,ka as xt,kb as tt,kc as F,ki as A,l as De,la as dg,lb as v,lc as R,lg as wb,li as Wv,m as Sh,mb as b,mc as Er,mg as Fg,mh as ye,nb as x,nc as jh,nd as xg,o as yh,ob as E,oc as Gh,oe as ke,og as ep,oh as Ug,oi as Wb,p as Wn,pc as je,pd as Cr,pe as Dg,pg as Ng,ph as Nb,pi as Yb,q as yn,qa as Me,qe as En,qg as tp,qh as Jr,r as Ee,rc as Vc,rf as $c,rg as to,sb as u,sc as L,se as Hr,sh as Wc,si as Ne,tb as p,tc as _t,te as $v,ti as ot,ua as nt,ub as Je,uc as or,uf as Eg,ui as Mr,v as Te,va as J,vb as Y,vc as Q,ve as Yu,vh as Jc,vi as Kb,w as dr,wa as me,wb as Bh,wc as On,we as cr,wg as Ib,x as wh,xb as z,xc as ar,xe as jv,xg as Db,xi as Xt,ye as pb,yh as Rb,yi as Zb,z as wn,zb as l,zc as hg,ze as Xn,zh as rp,zi as Qe}from"./chunk-VKGZ33MA.js";function Xg(r){try{let o=r?.organizationId,n=r?.documentId;return!o||!n?null:`${o}::${n}`}catch{return null}}function ff(r){try{if(!r)return{excludeResolved:!1,unlockedDocumentKey:null};let{lazyLoadResolvedComments:o,hasResolvedIntent:n,currentDocumentKey:e}=r;if(!e)return{excludeResolved:!1,unlockedDocumentKey:r.unlockedDocumentKey??null};let t=r.unlockedDocumentKey??null,a=n?e:t===e?t:null;return{excludeResolved:!!o&&!(a===e),unlockedDocumentKey:a}}catch{return{excludeResolved:!1,unlockedDocumentKey:null}}}function Cf(r,o){if(r==null&&o==null)return!0;if(r==null||o==null)return!1;let n=new Set(r),e=new Set(o);if(n.size!==e.size)return!1;for(let t of n)if(!e.has(t))return!1;return!0}function kf(r){try{return r?Object.entries(r).filter(([,o])=>o?.type!=="terminal").map(([o,n])=>n?.id??o).filter(o=>!!o):[]}catch{return[]}}function xf(r){try{return r?Object.entries(r).filter(([,o])=>o?.type==="terminal").map(([o,n])=>n?.id??o).filter(o=>!!o):[]}catch{return[]}}function u2(r){try{if(!r)return 0;let o=0;return r.hasApiKeyClause&&o++,r.hasOrganizationIdClause&&o++,(r.documentIdCount??0)>0&&o++,(r.accessFieldCount??0)>0&&o++,(r.locationIdCount??0)>0&&o++,r.hasFolderClause&&o++,(r.nonTerminalStatusCount??0)>0&&o++,o}catch{return 0}}function _f(r){return{documentIdCount:r?.documentIdCount??0,accessFieldCount:r?.accessFieldCount??0,locationIdCount:r?.locationIdCount??0,nonTerminalStatusCount:r?.nonTerminalStatusCount??0,terminalStatusCount:r?.terminalStatusCount??0,hasApiKeyClause:!0,hasOrganizationIdClause:!0,hasFolderClause:!!r?.hasFolderClause,orderByCount:r?.orderByCount??0}}function Sf(r){let o=r?.maxDocumentBatchSize??0,n=(e,t=0,a=0,i="none")=>({applyStatusClause:!1,documentBatchSize:o,projectedDisjunctions:t,projectedFilterSum:a,boundBy:i,reason:e});try{if(o<1)return n("dropped-no-non-terminal-statuses");let e=r?.clauses;if(!e)return n("dropped-no-non-terminal-statuses");let t=e.nonTerminalStatusCount??0;if(t<=0)return n("dropped-no-non-terminal-statuses");if((e.terminalStatusCount??0)<=0)return n("dropped-no-terminal-statuses");let a=(e.documentIdCount??0)>0?e:f(g({},e),{documentIdCount:o}),i=u2(a),c=Math.max(1,e.accessFieldCount??0),m=Math.max(1,e.locationIdCount??0),h=e.orderByCount??0,_=a.documentIdCount,I=le=>Math.min(le,_),S=le=>I(le)*c*m*t,H=le=>le*i+h+1,$=S(o),j=H($),Z=$>30,re=j>100,se=Z&&re?"both":Z?"disjunctions":re?"filter-sum":"none",_e=r?.minDocumentBatchSize??o;for(let le=o;le>=_e;le--){let he=S(le),Se=H(he);if(he<=30&&Se<=100)return{applyStatusClause:!0,documentBatchSize:le,projectedDisjunctions:he,projectedFilterSum:Se,boundBy:se,reason:le===o?"fits":"fits-after-shrink"}}return n("dropped-over-budget",$,j,se)}catch{return n("dropped-over-budget")}}var yf="Processing\u2026";function Kc(r){try{return r?!!(typeof r.commentText=="string"&&r.commentText.trim().length>0||typeof r.commentHtml=="string"&&r.commentHtml.trim().length>0||typeof r.commentVoiceUrl=="string"&&r.commentVoiceUrl.trim().length>0||Array.isArray(r.attachments)&&r.attachments.length>0||Array.isArray(r.recorders)&&r.recorders.length>0):!1}catch{return!1}}function lp(r){try{return!!r?.progress}catch{return!1}}function p2(r){try{return lp(r)&&!Kc(r)}catch{return!1}}function dp(r){try{let o=r?.comments;if(!Array.isArray(o))return{comments:[],progress:[]};let n=[],e=[];return o.forEach(t=>(p2(t)?e:n).push(t)),{comments:n,progress:e}}catch{return{comments:r?.comments??[],progress:[]}}}function h2(r){try{let o=Number(r);return!Number.isFinite(o)||o<=0?6e5:o}catch{return 6e5}}function ip(r){try{if(r==null)return null;if(typeof r=="number")return Number.isFinite(r)?r:null;if(r instanceof Date)return r.getTime();if(typeof r?.toMillis=="function")return r.toMillis();if(typeof r?.seconds=="number")return r.seconds*1e3;let o=new Date(r).getTime();return Number.isNaN(o)?null:o}catch{return null}}function b2(r,o,n){try{let e=ip(r?.lastUpdated);return e==null?!1:n-e>h2(o)}catch{return!1}}function qg(r,o,n){try{return r?.progress?.state!=="active"?!1:!b2(r,o,n)}catch{return!1}}function wf(r){try{let o=r?.progress?.steps;if(Array.isArray(o)&&o.length>0){let n=o[o.length-1];for(let t=o.length-1;t>=0;t--)if(o[t]?.state==="active"){n=o[t];break}let e=n?.label;if(typeof e=="string"&&e.trim().length>0)return{kind:"literal",text:e}}return{kind:"i18nKey",key:yf}}catch{return{kind:"i18nKey",key:yf}}}function If(r){try{return Array.isArray(r)?r.slice().sort((o,n)=>(ip(o?.createdAt)??0)-(ip(n?.createdAt)??0)):[]}catch{return Array.isArray(r)?r.slice():[]}}var Dt=(()=>{let o=class o{constructor(e){this.loggingService=e,this._customStatusMap=new De(X.CommentAnnotationStatusMap),this._customPriorityMap=new De(X.CommentAnnotationPriorityMap),this._customCategoryMap=new De(X.CommentCategoryMap),this.isLazyLoadResolvedCommentsEnabled=null;try{let t=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP);t&&this._customPriorityMap.next(JSON.parse(t));let a=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP);a&&this._customStatusMap.next(JSON.parse(a));let i=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_CATEGORY_MAP);i&&this._customCategoryMap.next(JSON.parse(i))}catch(t){this.loggingService.catch("Error in CustomFilterService constructor: ",t)}}setCustomStatusFilters(e){try{if(e.length<2){this._customStatusMap.next(X.CommentAnnotationStatusMap),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP,JSON.stringify(X.CommentAnnotationStatusMap)),this.loggingService.catch("Custom status filters must have at least 2 filters");return}let t={};e.forEach(a=>{t[a.id]=a,a.type||(a.type="ongoing")}),this.warnOnDroppedStatusIds(t),this._customStatusMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomStatusFilters: ",t)}}warnOnDroppedStatusIds(e){try{let t=sessionStorage.getItem(X.SESSION_STORAGE.VELT_CUSTOM_STATUS_MAP);if(!t)return;let a=JSON.parse(t),i=Object.keys(a??{});if(!i.length)return;let c=new Set(Object.keys(e??{})),m=i.filter(h=>!c.has(h));if(!m.length||!this.isLazyLoadResolvedCommentsEnabled?.())return;this.loggingService.catch(`[lazyLoadResolvedComments] status catalog dropped ${m.length} id(s): ${m.join(", ")}. Comments still carrying them will NOT be fetched while lazyLoadResolvedComments is enabled \u2014 migrate those annotations to the new ids, or keep the retired ids in the catalog.`,void 0,void 0,!0)}catch(t){this.loggingService.catch("Error in CustomFilterService warnOnDroppedStatusIds: ",t)}}setLazyLoadResolvedCommentsProvider(e){this.isLazyLoadResolvedCommentsEnabled=e}setCustomPriorityFilters(e){try{if(e.length<2){this._customPriorityMap.next(X.CommentAnnotationPriorityMap),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP,JSON.stringify(X.CommentAnnotationPriorityMap)),this.loggingService.catch("Custom priority filters must have at least 2 filters");return}let t={};e.forEach(a=>{t[a.id]=a}),this._customPriorityMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_PRIORITY_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomPriorityFilters: ",t)}}setCustomCategories(e){try{let t={};e.forEach(a=>{t[a.id]=a}),this._customCategoryMap.next(t),sessionStorage.setItem(X.SESSION_STORAGE.VELT_CUSTOM_CATEGORY_MAP,JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CustomFilterService setCustomCategories: ",t)}}get customStatusMap$(){return this._customStatusMap.asObservable()}get customPriorityMap$(){return this._customPriorityMap.asObservable()}get customCategoryMap$(){return this._customCategoryMap.asObservable()}get defaultStatus(){try{let t=Object.entries(this._customStatusMap.value).find(([a,i])=>i.type==="default");if(t)return t[1]}catch(e){this.loggingService.catch("Error in CustomFilterService defaultStatus: ",e)}return X.CommentAnnotationStatusMap.OPEN}get resolvedStatus(){try{let t=Object.entries(this._customStatusMap.value).find(([a,i])=>i.type==="terminal");if(t)return t[1]}catch(e){this.loggingService.catch("Error in CustomFilterService resolvedStatus: ",e)}return X.CommentAnnotationStatusMap.OPEN}get ongoingStatuses(){try{let t=Object.entries(this._customStatusMap.value).filter(([a,i])=>i.type==="ongoing");if(t)return t.map(a=>a[1])}catch(e){this.loggingService.catch("Error in CustomFilterService ongoingStatuses: ",e)}return[X.CommentAnnotationStatusMap.IN_PROGRESS]}get terminalStatuses(){try{return Object.entries(this._customStatusMap.value).filter(([t,a])=>a.type==="terminal").map(t=>t[1])}catch(e){this.loggingService.catch("Error in CustomFilterService terminalStatuses: ",e)}return[]}convertLegacyAnnotationStatus(e){try{if(typeof e.status=="string"||e.status===void 0){let t=Object.entries(this._customStatusMap.value),a=t.find(([i,c])=>c.type==="default");switch(e.status){case"open":a&&(e.status=a[1]);break;case"inProgress":let i=t.find(([m,h])=>h.type==="ongoing");i&&(e.status=i[1]);break;case"resolved":let c=t.find(([m,h])=>h.type==="terminal");c&&(e.status=c[1]);break;default:a&&(e.status=a[1]);break}}return e}catch(t){return this.loggingService.catch("Error in CustomFilterService convertLegacyAnnotation: ",t),e}}convertLegacyPriority(e){try{typeof e.priority=="string"&&(e.priority=X.CommentAnnotationPriorityMap[e.priority])}catch(t){this.loggingService.catch("Error in CustomFilterService convertLegacyPriority: ",t)}return e}convertLegacyCategory(e){try{if(e.commentCategories===void 0||e.commentCategories===null||!Array.isArray(e.commentCategories)||e.commentCategories.length===0)return e;typeof e.commentCategories[0]=="string"&&(e.commentCategories=e.commentCategories.map(t=>X.CommentCategoryMap[t]))}catch(t){this.loggingService.catch("Error in CustomFilterService convertLegacyCategory: ",t)}return e}};o.\u0275fac=function(t){return new(t||o)(be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Df=(()=>{let o=class o{constructor(e,t){this.domService=e,this.loggingService=t,this.keyEventSubject$=new jt;try{this.loggingService.log("%c[WB] Creating CLASS: HotkeyService","color: blue;"),this.keyEvent$=this.keyEventSubject$.asObservable().pipe(Oh()),this.domService.onWindowKeydown$().subscribe(a=>{this.keyEventSubject$.next(a)})}catch(a){this.loggingService.catch("Error in HotkeyService constructor: ",a)}}getKeyPressEvent(e,t={}){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getKeyPressEvent","color: green;"),this.keyEvent$.pipe(Gt(a=>a?.key===e),Gt(a=>!(!!t?.includeCtrl!==a.ctrlKey||!!t?.includeAlt!==a.altKey||!!t?.includeShift!==a.shiftKey||!!t?.includeMeta!==a.metaKey)),Gt(()=>this.isNoInputFocused()))}catch(a){return this.loggingService.catch("Error in HotkeyService getKeyPressEvent: ",a),new _h}}isNoInputFocused(){try{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;for(;e&&e?.tagName!=="BODY";){if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e?.isContentEditable)return!1;e=e.parentElement??e.getRootNode()?.host??null}return!0}catch(e){return this.loggingService.catch("Error in HotkeyService isNoInputFocused: ",e),!1}}};o.\u0275fac=function(t){return new(t||o)(be(Ne),be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var x2=["access","accessFields"];function _2(r){return r?Object.keys(r).length>0:!1}var ae=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,H,$,j,Z,re,se,_e,le,he,Se,Re,ze,Ye,ct){this.analyticsService=e,this.commonDbService=t,this.configService=a,this.docService=i,this.databaseService=c,this.authService=m,this.domService=h,this.afAuth=_,this.avatarService=I,this.contactService=S,this.storageService=H,this.functions=$,this.dialog=j,this.iamService=Z,this.loggingService=re,this.notificationService=se,this.customFilterService=_e,this.hotkeyService=le,this.serviceBook=he,this.buttonService=Se,this.metadataService=Re,this.commonDbUtilsService=ze,this.attachmentResolverService=Ye,this.userPermissionService=ct,this.endpointsService=ge(Wb),this.customPinsById=new Map,this.commentAdded$=new jt,this.commentUpdated$=new jt,this.commentAccepted$=new jt,this.commentRejected$=new jt,this.commentAnnotationDeleted$=new jt,this.multiThreadCommentAnnotationDeleted$=new jt,this.commentAnnotationById$=new De(null),this.multiThreadCommentAnnotationById$=new De(null),this.ghostCommentAnnotationMap$=new De({}),this.unreadCommentsMap$=new De(null),this.documentPaths=null,this.user=null,this.customCategoryMap=X.CommentCategoryMap,this.allowedElementIds$=new De([]),this.allowedElementClassNames$=new De([]),this.allowedElementQuerySelectors$=new De([]),this.addCommentMode$=new De(!1),this.persistentCommentMode$=new De(!1),this.seenByUsers$=new De(!0),this.deleteReplyConfirmation$=new De(!1),this.persistentModeBanner$=new De(!0),this.commentAddedEmitter=null,this.commentContextProvider=null,this.textCommentMode$=new De(!0),this.sidebarVisible$=new De(!1),this.sidebarOpenedByCustomTrigger$=new De(!1),this.floatingCommentsEnabled$=new De(!0),this.moderatorMode$=new De(!1),this.streamMode$=new De(!1),this.enableSignInButton$=new De(!1),this.enableUpgradeButton$=new De(!1),this.onSignInClick$=new jt,this.onUpgradeClick$=new jt,this.enableAttachment$=new De(!0),this.enableAttachmentDownload$=new De(!0),this.enableReactions$=new De(!0),this.enableAnonymousEmail$=new De(!0),this.enableFormatOptions$=new De(!1),this.formatConfig$=new De({bold:{enable:!0},italic:{enable:!0},underline:{enable:!0},strikethrough:{enable:!0}}),this.allowedRecordings$=new De(["audio","video","screen"]),this.openSidebar$=new jt,this.showScreenSizeInfo$=new De(!1),this.showCommentIndex$=new De(!1),this.popoverMode$=new De(!1),this.popoverTriangleComponent$=new De(!0),this.draftMode$=new De(!0),this.draftConfirmation$=new De(!1),this.draftConfirmationPendingAnnotationIds=new Set,this.enableDialogOnHover$=new De(!0),this.enableDialogOnTargetElementClick$=new De(!1),this.enablePriority$=new De(!1),this.enableStatus$=new De(!0),this.visibilityOptions$=new De(!1),this.enableResolve$=new De(!0),this.enableGhostComments$=new De(!1),this.enableGhostCommentsMessage$=new De(!0),this.inboxMode$=new De(!1),this.enableAutoCategorize$=new De(!1),this.commentContainerDarkMode$=new De(!1),this.suggestionMode$=new De(!1),this.mobileMode$=new De(!0),this.inlineCommentMode$=new De(!1),this.minimap$=new De(!1),this.commentsOnDom$=new De(!0),this.commentToolEnabled$=new De(!0),this.totalMediaLength$=new De(0),this.sidebarUrlNavigationEnabled$=new De(!1),this.detectionStrategy$=new De(Yu.DEFAULT),this.sidebarButtonOnCommentDialogVisible$=new De(!1),this.sidebarButtonOnCommentDialogClick$=new jt,this.commentNavigationButtonClick$=new jt,this.deviceIndicatorOnCommentPins$=new De(!1),this.sidebarCommentClick$=new jt,this.privateCommentMode$=new De(!1),this.privateCommentAllowed$=new De(!1),this.privateModeConfig$=new De(null),this.scrollToComment$=new De(!0),this.userMentions$=new De(!0),this.paginatedContactList$=new De(!1),this.deleteOnBackspace$=new De(!0),this.hotkeyEnabled$=new De(!1),this.recordingSummaryEnabled$=new De(!0),this.unreadIndicatorMode$=new De(jv.MINIMAL),this.composerMode$=new De(pb.DEFAULT),this.enterKeyToSubmit$=new De(!1),this.resolvedCommentsOnDom$=new De(!1),this.lazyLoadResolvedComments$=new De(!1),this.resolvedIntentFromSidebar$=new De(!1),this.resolvedUnlockedDocumentKey=null,this.lastQueryClauseDescriptor=null,this.bubbleOnPinEnabled$=new De(!1),this.bubbleOnPinHoverEnabled$=new De(!0),this.pinDragEnabled$=new De(!0),this.excludeLocationIdsFromSidebar$=new De([]),this.multiThread$=new De(!1),this.groupMatchedComments$=new De(!1),this.restrictTextSearchToAnchor$=new De(!1),this.shortUserName$=new De(!0),this.collapsedComments$=new De(!1),this.collapsedRepliesPreview$=new De(!1),this.fullExpanded$=new De(!1),this.queryParamsComments$=new De(!1),this.resolveStatusAccessAdminOnly$=new De(!1),this.linkCallback$=new De(!1),this.svgAsImg$=new De(!1),this.commentToNearestAllowedElement$=new De(!1),this.filterCommentsOnDom$=new De(!1),this.maxReplyAvatars$=new De(3),this.commentProgressStaleAfter$=new De(6e5),this.progressCommentsByAnnotationId=new Map,this.progressOnlyAnnotationsLogged=new Set,this.progressCommentsVersion$=new De(0),this.replyAvatars$=new De(!1),this.commentplaceholder$=new De(void 0),this.replyplaceholder$=new De(void 0),this.editplaceholder$=new De(void 0),this.editcommentplaceholder$=new De(void 0),this.editreplyplaceholder$=new De(void 0),this.screenshotEnabled$=new De(!1),this.pinShadowDOM$=new De(!0),this.dialogShadowDOM$=new De(!0),this.dialogShadowDOMExplicit$=new De(void 0),this.textCommentToolShadowDOM$=new De(!0),this.pinDarkMode$=new De(null),this.textCommentToolDarkMode$=new De(null),this.textCommentToolbarDarkMode$=new De(null),this.textCommentToolbarShadowDOM$=new De(!0),this.sidebarShadowDOM$=new De(!0),this.changeDetectionInCommentMode$=new De(!1),this.commentSelectionChange$=new jt,this.visibilityOptionClicked$=new jt,this.submitComment$=new jt,this.clearComposer$=new jt,this.composerDataMap=new Map,this.commentsFromSidebarMap$=new De(null),this.sidebarButtonCountType$=new De("default"),this.filterGhostCommentsInSidebar$=new De(!1),this.commentSidebarFilters$=new De(null),this.effectiveSidebarFilters$=new De({}),this.customSidebarDataAnnotationIds$=new De(null),this.commentSidebarSystemFiltersOperator$=new De(Ur.AND),this.bubbleCommentAnnotationIds$=new De([]),this.updateCommentDialogPositionTriggerSubject$=new De(void 0),this.areaCommentEnabled$=new De(!0),this.commentPinCursorImage$=new De(""),this.commentAnnotationsFromCommentsContainer$=new De([]),this.customChipDropdownData$=new De(null),this.originalCommentAnnotationsByDocumentId$=new De({}),this.draftCommentAnnotationsByAnnotationId$=new De(null),this.draftMultiThreadCommentAnnotationsByAnnotationId$=new De({}),this.pendingAddCommentAnnotationData=new Map,this.copyLink$=new De(""),this.addCommentDragMode=!1,this.dragSubscriptions=[],this.hotkeySubscriptions=[],this.sidebarData$=new De(null),this.sidebarCustomActionEventData$=new De(null),this.sidebarCustomActionEventDataAllChanges$=new De(null),this.sidebarCustomActionEventDataOnInit$=new De(null),this.customActions$=new De(!1),this.focusedThreadMode$=new De(!1),this.openAnnotationInFocusMode$=new De(!1),this.customStatusesShown$=new De(!1),this.readOnly$=new De(!1),this.customAutocompleteSearch$=new De(!1),this.deleteThreadWithFirstComment$=new De(!0),this.assignToType$=new De("dropdown"),this.pageModeComposerContext$=new De(null),this.contextInPageModeComposer$=new De(!1),this.focusPageModeComposer$=new jt,this.transformContext$=new De(null),this.expandMentionGroups$=new De(!1),this.showMentionGroupsFirst$=new De(!1),this.showMentionGroupsOnly$=new De(!1),this.fullScreenInSidebar$=new De(!1),this.composerFileAttachments$=new De(null),this.attachmentNameInMessage$=new De(!1),this.allowedFileTypes$=new De([]),this.forceCloseAllOnEsc$=new De(!1),this.autoCompleteScrollConfig$=new De({itemSize:55,minBufferPx:350,maxBufferPx:600,templateCacheSize:350}),this.commentAnnotationContextDraft=null,this.reactionService=null,this.areaService=null,this.viewsService=null,this.getCommentAnnotationForClient=$e=>{try{let bt=["commentCategories","color","resolved","inProgress","positionX","positionY","screenWidth","screenHeight","screenScrollHeight","screenScrollTop","taggedElementPath","taggedElementRect","targetElement","position","documentParamsId","documentParams","ghostComment","areaAnnotationId","iam","commentSource","involvedUserIds","mentionedUserIds","viewedByUserIds","views"],Xe=JSON.parse(JSON.stringify($e)),Tt={};Object.keys(Xe).forEach(Ut=>{bt.includes(Ut)||(Tt[Ut]=Xe[Ut])}),Tt?.comments?.forEach(Ut=>{let We=[];Ut?.reactionAnnotationIds&&Ut?.reactionAnnotationIds?.forEach(Gu=>{let ag=this.reactionService?.getAnnotationById(Gu);if(ag){let Uc=this.reactionService.getReactionAnnotationForClient(ag);We.push(Uc)}}),Ut.reactionAnnotations=We}),Xe?.viewedByUserIds?.forEach(Ut=>{let We=this.contactService.getUserBySnippylyId(Ut);We&&(Tt.viewedBy||(Tt.viewedBy=[]),Tt.viewedBy.push(We))}),this.user?.userSnippylyId&&(Tt.unread=!Xe?.viewedByUserIds?.includes(this.user.userSnippylyId));let Ue=Xe?.targetElement?.anchor?.fXPath||Xe?.targetElement?.fXpath;return Ue&&(Tt.basicAnchorData={xpath:Ue,topPercentage:Xe?.targetElement?.topPercentage||0,leftPercentage:Xe?.targetElement?.leftPercentage||0}),JSON.parse(JSON.stringify(Tt))}catch{return null}},this.loggingService.log("%c[WB] Creating CLASS: CommentService","color: blue;"),this.serviceBook.set(Lg,this),this.serviceBook.observe(Bg).subscribe($e=>{this.reactionService=$e}),this.serviceBook.observe(Hb).subscribe($e=>{this.areaService=$e}),this.serviceBook.observe(Eo).subscribe($e=>{this.viewsService=$e}),this.domService.getSelectedAnnotationsMap$().pipe(Nv(100),In()).subscribe(([$e,bt])=>{try{if(this.draftCommentAnnotationsByAnnotationId$.value){let Xe=Object.keys(this.draftCommentAnnotationsByAnnotationId$.value||{}),Tt=[];Object.keys($e||{}).forEach(Ut=>{if(!bt?.[Ut]&&Xe.includes(Ut)){if(this.draftConfirmationPendingAnnotationIds?.has(Ut))return;Tt.push(Ut)}});let Ue=JSON.parse(JSON.stringify(this.draftCommentAnnotationsByAnnotationId$.value||{}));Tt.forEach(Ut=>{delete Ue[Ut]}),ln(Ue,this.draftCommentAnnotationsByAnnotationId$.value)||this.draftCommentAnnotationsByAnnotationId$.next(Ue)}}catch{}}),this.docService.getDocumentPaths$().pipe(In()).subscribe(([$e,bt])=>{$e?.documentId!==bt?.documentId&&this.unreadCommentsMap$.next(null),bt&&this.shouldEnableReadOnly()},$e=>{this.loggingService.catch("Error in CommentService getDocumentPaths$ subscription: ",$e)}),this.draftCommentAnnotationsByAnnotationId$.pipe(In()).subscribe(([$e,bt])=>{try{if(this.pendingAddCommentAnnotationData.size===0)return;let Xe=Object.keys($e||{});if(Xe.length===0)return;let Tt=new Set(Object.keys(bt||{}));Xe.forEach(Ue=>{!Tt.has(Ue)&&this.pendingAddCommentAnnotationData.has(Ue)&&this.pendingAddCommentAnnotationData.delete(Ue)})}catch(Xe){this.loggingService.catch("Error in CommentService pendingAddCommentAnnotationData reconcile: ",Xe)}}),this.authService.getUser$().subscribe($e=>{$e||this.resetCacheData()},$e=>{this.loggingService.catch("Error in CommentService getUser$ subscription: ",$e)}),this.authService.getUser$().pipe(Pe($e=>$e?dr([this.iamService.isUserAdmin$(),this.contactService.getUserOrganizationContacts$()]).pipe(Te(([bt,Xe])=>{let Tt=!1;return Xe?.find(Ue=>Ue.userId===$e?.userId)&&(Tt=!0),{isUserAdmin:bt,isOrgUser:Tt}})):Ee({isUserAdmin:!1,isOrgUser:!1}))).subscribe(({isUserAdmin:$e,isOrgUser:bt})=>{let Xe=$e||bt;Xe!==this.privateCommentAllowed$.value&&this.privateCommentAllowed$.next(Xe)}),this.databaseService.getDb().pipe(Gt($e=>!!$e),Jn(1)).subscribe($e=>{$e&&this.getDocumentPaths()},$e=>{this.loggingService.catch("Error in CommentService getDb subscription: ",$e)}),this.domService.onWindowPointerMove$().subscribe($e=>{if(this.addCommentMode$.value){let bt=!0;if(this.addCommentDragMode)this.domService.removeClassFromElement(document.body,"show-pin-cursor");else{let Xe=this.domService.getBackgroundElement($e.clientX,$e.clientY,!0,!0);if(Xe&&Ub(Xe,{x:$e.clientX,y:$e.clientY})&&(Xe=Xe?.parentElement),Xe)if(this.isElementInsideAllowedElements(Xe))if(to($e.target))this.domService.removeClassFromElement(document.body,"show-pin-cursor");else{this.domService.addClassToElement(document.body,"show-pin-cursor"),this.hightlightElement&&this.hightlightElement!==Xe&&this.domService.removeHighlightFromElement(this.hightlightElement),this.hightlightElement=Xe;let Tt=this.domService.getSelectedAnnotationsMap("comment")||{},Ue=this.commentPinCursorImage$.value||X.CURSOR.COMMENT_PIN;this.domService.highlightElement(this.hightlightElement,Ue,!!Object.keys(Tt)?.length),bt=!1}else this.domService.removeClassFromElement(document.body,"show-pin-cursor")}this.hightlightElement&&bt&&(this.domService.removeHighlightFromElement(this.hightlightElement),this.hightlightElement=null)}},$e=>{this.loggingService.catch("Error in CommentService onWindowPointerMove$ subscription: ",$e)}),this.domService.onWindowKeyupEsc$().subscribe($e=>{if(this.addCommentMode$.value){let bt=this.domService.getSelectedAnnotationsMap("comment")||{};Object.keys(bt)?.length&&this.domService.resetSelectedAnnotationsMap(),this.disableAddCommentMode()}},$e=>{this.loggingService.catch("Error in CommentService onWindowKeyupEsc$ subscription: ",$e)}),this.domService.onDocumentClick$().subscribe($e=>{if($e&&!Pg($e)){let bt=this.domService.getSelectedAnnotationsMap("comment")||{};if(bt=g(g({},bt),this.domService.getSelectedAnnotationsMap("multiThread")||{}),bt=g(g({},bt),this.domService.getSelectedAnnotationsMap("suggestion")||{}),Object.keys(bt)?.length&&(this.domService.resetSelectedAnnotationsMap(),this.persistentCommentMode$?.value)){this.addCommentMode$.value&&this.detectToAddAreaComment(),$e.preventDefault(),$e.stopPropagation();return}}if($e&&this.addCommentMode$.value&&!to($e.target)){let bt=!1;if(this.addCommentDragMode)$e.preventDefault(),$e.stopPropagation(),this.addCommentDragMode=!1;else if(!this.domService.getDraftCommentAnnotationDialogs()?.length){let Xe=this.domService.getBackgroundElement($e.clientX,$e.clientY);if((this.persistentCommentMode$?.value&&this.domService.getBackgroundVeltElement($e.clientX,$e.clientY)||$e&&Pg($e))&&(Xe=null),Xe&&(this.isElementInsideAllowedElements(Xe)||this.getCommentToNearestAllowedElement()&&this.getNearestAllowedElement(Xe))&&(bt=this.isElementInsideManualCommentContainer(Xe),!bt)){$e.preventDefault(),$e.stopPropagation();let Tt=this.freeStyleCommentContext&&typeof this.freeStyleCommentContext=="object"?JSON.parse(JSON.stringify(this.freeStyleCommentContext)):void 0;this.addComment($e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Tt)}}this.persistentCommentMode$?.value?this.detectToAddAreaComment():bt||this.disableAddCommentMode()}},$e=>{this.loggingService.catch("Error in CommentService onDocumentClick$ subscription: ",$e)}),this.addCommentMode$.subscribe($e=>{this.hightlightElement&&this.domService.removeHighlightFromElement(this.hightlightElement),$e?(this.domService.addClassToElement(document.body,"snippyly-add-comment-mode"),this.detectToAddAreaComment(),this.addIframeContainerStaticAttribute()):(this.removeIframeContainerStaticAttribute(),this.domService.removeClassFromElement(document.body,"snippyly-add-comment-mode"),this.domService.removeClassFromElement(document.body,"show-pin-cursor"),this.dragSubscriptions.forEach(bt=>bt.unsubscribe()),this.clearFreeStyleCommentContext())},$e=>{this.loggingService.catch("Error in CommentService addCommentMode$ subscription: ",$e)}),this.domService.onWindowKeyupBackspace$().subscribe($e=>{this.getDeleteOnBackspace()&&this.deleteCommentPinAnnotations("keyupBackspace")},$e=>{this.loggingService.catch("Error in CommentService onWindowKeyupBackspace$ subscription: ",$e)}),this.domService.onWindowKeyupDelete$().subscribe($e=>{this.deleteCommentPinAnnotations("keyupDelete")},$e=>{this.loggingService.catch("Error in CommentService onWindowKeyupDelete$ subscription: ",$e)}),this.domService.getDeleteCommmentAnnotations$().subscribe($e=>{$e?.length&&($e?.filter(Xe=>!["tag","recorder","rewriter","arrow","area","multiThread"].includes(Xe.type))?.filter(Xe=>!this.getProgressComments(Xe?.annotationId).length)).forEach(Xe=>Ae(this,null,function*(){yield this.deleteCommentPinAnnotation(Xe)}))},$e=>{this.loggingService.catch("Error in CommentService onWindowKeyupDelete$ subscription: ",$e)}),this.getPopoverMode$().subscribe($e=>{$e?document?.body?.setAttribute(X.ATTRIBUTES.VELT_POPOVER_MODE,"true"):document?.body?.removeAttribute(X.ATTRIBUTES.VELT_POPOVER_MODE)},$e=>{this.loggingService.catch("Error in CommentService getPopoverMode subscription: ",$e)}),this.customFilterService.customCategoryMap$.subscribe($e=>{this.customCategoryMap=$e},$e=>{this.loggingService.catch("Error in CommentService customCategoryMap$ subscription: ",$e)}),this.hotkeyEnabled$.subscribe($e=>{$e?this.subscribeHotkeyEvents():this.unsubscribeHotkeyEvents()},$e=>{this.loggingService.catch("Error in CommentService hotkeyEnabled$ subscription: ",$e)}),this.domService.getSelectedAnnotationsMap$().pipe(In()).subscribe(([$e,bt])=>{try{let Xe=Object.values($e||{}).filter(Ue=>!["tag","recorder","rewriter","arrow","area"].includes(Ue.type)),Tt=Object.values(bt||{}).filter(Ue=>!["tag","recorder","rewriter","arrow","area"].includes(Ue.type));Xe?.forEach(Ue=>{Tt?.find(Ut=>Ut.annotationId===Ue.annotationId)||this.commentSelectionChange$.next({annotation:this.getCommentAnnotationForClient(Ue),selected:!1})}),Tt?.forEach(Ue=>{Xe?.find(Ut=>Ut.annotationId===Ue.annotationId)||this.commentSelectionChange$.next({annotation:this.getCommentAnnotationForClient(Ue),selected:!0})})}catch(Xe){this.loggingService.catch("Error in CommentService getSelectedAnnotationsMap$: ",Xe)}},$e=>{this.loggingService.catch("Error in CommentService getSelectedAnnotationsMap$ subscription: ",$e)})}clearCache(){try{this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in CommentService","color: green;"),this.commentAnnotationById$.next(null),this.draftCommentAnnotationsByAnnotationId$.next(null),this.multiThreadCommentAnnotationById$.next({}),this.draftMultiThreadCommentAnnotationsByAnnotationId$.next({}),this.pendingAddCommentAnnotationData.clear(),this.customAutocompleteSearch$.next(!1),this.hightlightElement=null,this.addCommentMode$.next(!1),this.unreadCommentsMap$.next(null),this.documentPaths=null,this.commentsFromSidebarMap$.next(null),this.customSidebarDataAnnotationIds$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearCache: ",e)}}setCommentActionsService(e){try{this.commentActionsService=e}catch(t){this.loggingService.catch("Error in CommentService setCommentActionsService: ",t)}}detectToAddAreaComment(){try{let e=this.areaService?.getAreaEnabled()??!1,t=this.getAreaCommentEnabled();if(e&&t){let a,i,c,m=null,h=null;this.dragSubscriptions.forEach(_=>_.unsubscribe()),this.dragSubscriptions.push(this.domService.onWindowMouseDown$().pipe(Gt(_=>!(_&&Pg(_))),Jn(1)).subscribe(_=>{m=null,h=null,this.dragSubscriptions.push(this.domService.getClickAndDragPointsObservable().subscribe(I=>{if(m===null){let S=I?.startPoint?.event?.target,H=Gc(S),$=to(S),j=this.isElementInsideAllowedElements(S);m=!H&&!$&&j}if(m){this.addCommentDragMode=!0,a=I.startPoint,i=I.curPoint;let S=I?.curPoint?.event?.target,H=Gc(S),$=to(S),j=this.isElementInsideAllowedElements(S);h=!H&&!$&&j,h?c=this.domService.drawRectangle(a,i):c?.remove()}})),this.domService.onWindowPointerUp$().pipe(ig(1),Jn(1)).subscribe(I=>{if(i={x:I.clientX,y:I.clientY},a&&i&&(c?.remove(),m&&h)){let S=[{x:a.x-window.scrollX,y:a.y-window.scrollY},{x:i.x,y:i.y}],H=this.freeStyleCommentContext&&typeof this.freeStyleCommentContext=="object"?JSON.parse(JSON.stringify(this.freeStyleCommentContext)):void 0;this.addComment(I,void 0,S,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,H)}this.dragSubscriptions.forEach(S=>S.unsubscribe())})}))}}catch(e){this.loggingService.catch("Error in CommentService detectToAddAreaComment: ",e)}}resetCacheData(){try{this.loggingService.log("%c[WB] Calling CommentService FUNCTION: resetCacheData","color: green;"),this.commentAnnotationById$.next(null),this.draftCommentAnnotationsByAnnotationId$.next(null),this.multiThreadCommentAnnotationById$.next({}),this.draftMultiThreadCommentAnnotationsByAnnotationId$.next({}),this.pendingAddCommentAnnotationData.clear()}catch(e){this.loggingService.catch("Error in CommentService resetCacheData: ",e)}}addAreaContainerTag(){try{if(!(document.querySelector(X.TAGS.VELT_AREAS)||document.querySelector(X.TAGS.SNIPPYLY_AREAS))){let t=document.createElement(X.TAGS.VELT_AREAS);document.body.appendChild(t)}}catch(e){this.loggingService.catch("Error in CommentService addAreaContainerTag: ",e)}}addIframeContainerStaticAttribute(){try{document.querySelectorAll(`[${X.ATTRIBUTES.VELT_IFRAME_CONTAINER}]`).forEach(t=>{window.getComputedStyle(t).position==="static"&&t.setAttribute(X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC,"true")})}catch(e){this.loggingService.catch("Error in CommentService addIframeContainerStaticAttribute: ",e)}}removeIframeContainerStaticAttribute(){try{document.querySelectorAll(`[${X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC}]`).forEach(t=>{t.removeAttribute(X.ATTRIBUTES.VELT_IFRAME_CONTAINER_STATIC)})}catch(e){this.loggingService.catch("Error in CommentService removeIframeContainerStaticAttribute: ",e)}}subscribeHotkeyEvents(){try{this.loggingService.log("%c[WB] Calling FUNCTION: subscribeHotkeyEvents","color: green;"),this.unsubscribeHotkeyEvents(),this.hotkeySubscriptions.push(this.hotkeyService.getKeyPressEvent("c").subscribe(e=>{e&&!this.addCommentMode$.value&&this.enableAddCommentMode()},e=>{this.loggingService.catch("Error in CommentService hotkeyService.getKeyPressEvent subscription: ",e)}))}catch(e){this.loggingService.catch("Error in CommentService subscribeHotkeyEvents: ",e)}}unsubscribeHotkeyEvents(){try{this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribeHotkeyEvents","color: green;"),this.hotkeySubscriptions.forEach(e=>e?.unsubscribe())}catch(e){this.loggingService.catch("Error in CommentService unsubscribeHotkeyEvents: ",e)}}setCommentAddedEmitter(e){try{this.commentAddedEmitter=e}catch(t){this.loggingService.catch("Error in CommentService setCommentAddedEmitter: ",t)}}setContextProvider(e){try{this.commentContextProvider=e}catch(t){this.loggingService.catch("Error in CommentService setContextProvider: ",t)}}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;"),this.docService.getDocumentPaths$()}getAnonymousAvatarImage(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAnonymousAvatarImage","color: green;"),this.avatarService.generateUserImage()}setAllowedElementIds(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementIds:e}}),this.allowedElementIds$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementIds: ",t)}}getAllowedElementIds(){return this.allowedElementIds$.asObservable()}setAllowedElementClassNames(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementClassNames:e}}),this.allowedElementClassNames$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementClassNames: ",t)}}getAllowedElementClassNames(){return this.allowedElementClassNames$.asObservable()}setAllowedElementQuerySelectors(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{allowedElementQuerySelectors:e}}),this.allowedElementQuerySelectors$.next(e||[])}catch(t){this.loggingService.catch("Error in CommentService setAllowedElementQuerySelectors: ",t)}}getAllowedElementQuerySelectors(){return this.allowedElementQuerySelectors$.asObservable()}getAllCommentAnnotations({customClientDocumentId:e,params:t,excludeDomChanges:a,detectGhostComments:i,skipPositionCalculation:c,query:m,fromCommentSidebar:h,analytics:_,addFilterCommentsOnDomCheck:I}){this.loggingService.log("%c[WB] Calling FUNCTION: getAllCommentAnnotations","color: green;");let S,H,$;_?.enabled&&this.analyticsService.trackEvent(_?.eventName||oe.Events.Comments.GET_ALL_COMMENT_ANNOTATIONS_TRIGGERED_INTERNAL,_?.properties);try{if(e&&($=`${To(e)}`),t&&typeof t=="object"){let j=qu(t);H=j?.id,S=To(JSON.stringify(j))}}catch(j){this.loggingService.catch("Error in CommentService getAllCommentAnnotations: ",j)}return this.authService.getAuthState$().pipe(Gt(j=>!!j),Pe(j=>this.isFeatureAllowed({firebaseUser:j,annotations:[],filteredAnnotations:[]})),Pe(j=>j.featureAllowed?this.iamService.isUserAllowed$().pipe(Te(Z=>(j.featureAllowed=Z,j))):Ee(j)),Pe(j=>j.featureAllowed?Ee(j).pipe(Pe(Z=>this.docService.getDocumentPaths$().pipe(Te(re=>(this.documentPaths=re,Z.documentPaths=re,Z)))),Pe(Z=>m?.documentIds?.length||$?this.getDataFromDocumentIds({documentIds:$?[$]:m?.documentIds?.map(re=>`${To(re)}`),organizationId:this.documentPaths?.organizationId,query:m}).pipe(Te(re=>({res:Z,data:re}))):this.docService.getDocumentIds$().pipe(Pe(re=>{let se=re?.length>0?re.map(_e=>_e.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds({documentIds:se.length>0?se:[$??""],organizationId:this.documentPaths?.organizationId,query:m}).pipe(Te(_e=>({res:Z,data:_e})))}))),Pe(Z=>Z?.data?(Z.res.annotations=Z.data||[],Ee(Z.res).pipe(Pe(re=>this.docService.getLocation$().pipe(Te(se=>(re.location=se,re)))),Pe(re=>this.docService.getLocations$().pipe(Te(se=>(re.customLocations=se,re)))),Pe(re=>this.docService.getExcludedLocationIds$().pipe(Te(se=>(re.excludedLocationIds=se,re)))),Te(re=>{if(re.filteredAnnotations=[],m)return re.filteredAnnotations=re.annotations?.slice(),re;if($&&!S||h)return re.filteredAnnotations=re.annotations?.slice(),re?.excludedLocationIds?.length&&(re.filteredAnnotations=re.filteredAnnotations?.filter(se=>se?.location?.id?!re.excludedLocationIds.includes(se.location.id):!0)),re;{let se=[],_e=[];return S?(se.push(S),H&&_e.push(H)):(se.push(re?.location?.locationId),se.push(...Object.values(re?.customLocations||[]).map(le=>le.locationId)),re?.location?.location?.id&&_e.push(re?.location?.location?.id),_e.push(...Object.values(re?.customLocations||{}).map(le=>le.location?.id).filter(le=>!!le))),re.filteredAnnotations=this.filterAnnotationsByLocationIds(re?.annotations,se,_e),re?.excludedLocationIds?.length&&(re.filteredAnnotations=re.filteredAnnotations?.filter(le=>le?.location?.id?!re.excludedLocationIds.includes(le.location.id):!0)),re}}),Pe(re=>this.isPrivateCommentAllowed$().pipe(Te(se=>(se||(re.filteredAnnotations=re.filteredAnnotations?.filter(_e=>!pr(_e))),re)))),Pe(re=>this.draftCommentAnnotationsByAnnotationId$.pipe(Te(se=>(re.filteredAnnotations=re.filteredAnnotations?.filter(_e=>!_e.isDraft),se&&re.filteredAnnotations.push(...Object.values(se)),re)))),Pe(re=>a?Ee(re):re?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onWindowResize$().pipe(Te(()=>re)):Ee(re)),Pe(re=>a?Ee(re):this.addCommentMode$.pipe(Pe(se=>se&&!this.getChangeDetectionInCommentMode()?Ee(re):re?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onDomChange$("CommentService getAllCommentAnnotations").pipe(Te(()=>re)):Ee(re)))),Te(re=>{if(!c){(!this.getPopoverMode()||this.getPopoverTriangleComponent())&&(re.filteredAnnotations=re.filteredAnnotations?.map(_e=>{let le=Object.assign({},_e);return this.calculateCommentAnnotationPosition(le,i),le}));let se={};re.filteredAnnotations?.forEach(_e=>{if(_e?.targetTextRange){let le=this.domService.getElementFromTargetTextRange(_e?.targetTextRange);se[_e.annotationId]=!!le}}),re.textAnnotationsElementMap=se}return re}),Pe(re=>re?.annotations?.length?this.serviceBook.observe(Eo).pipe(Pe(se=>se?se.getCommentFeatureViews$():Ee({})),Te(se=>(this.updateUnreadAnnotationsMap(re?.annotations,se),re))):(_2(this.unreadCommentsMap$.value)&&this.unreadCommentsMap$.next({}),Ee(re))))):Ee(null))):Ee(null)),Te(j=>{try{return typeof j=="object"&&j?JSON.parse(JSON.stringify(j)):j}catch{return j}}),ir((j,Z)=>Jr(j?.filteredAnnotations,Z?.filteredAnnotations)&&Jr(j?.textAnnotationsElementMap,Z?.textAnnotationsElementMap)),Pe(j=>j?j?.filteredAnnotations?Ee(j?.filteredAnnotations||[]):Ee([]):Ee(null)),Pe(j=>I?this.filterCommentsUsingSidebarSettings(j):Ee(j)))}getAllMultiThreadCommentAnnotations(e,t,a,i,c,m){this.loggingService.log("%c[WB] Calling FUNCTION: getAllMultiThreadCommentAnnotations","color: green;");let h,_;try{if(e&&(_=To(e)),t&&typeof t=="object"){let I=qu(t);h=To(JSON.stringify(I))}}catch(I){this.loggingService.catch("Error in CommentService getAllMultiThreadCommentAnnotations: ",I)}return this.authService.getAuthState$().pipe(Gt(I=>!!I),Pe(I=>this.isFeatureAllowed({firebaseUser:I,annotations:[],filteredAnnotations:[]})),Pe(I=>I.featureAllowed?this.iamService.isUserAllowed$().pipe(Te(S=>(I.featureAllowed=S,I))):Ee(I)),Pe(I=>I.featureAllowed?Ee(I).pipe(Pe(S=>this.docService.getDocumentPaths$().pipe(Te(H=>(this.documentPaths=H,S.documentPaths=H,S)))),Pe(S=>_?this.getMultiThreadDataFromDocumentIds([_]).pipe(Te(H=>({res:S,data:H}))):this.docService.getDocumentIds$().pipe(Pe(H=>{let $=H?.length>0?H.map(j=>j.documentId):[this.documentPaths?.documentId??""];return this.getMultiThreadDataFromDocumentIds($.length>0?$:[`${_}`]).pipe(Te(j=>({res:S,data:j})))}))),Pe(({res:S,data:H})=>H?(S.annotations=H||[],Ee(S).pipe(Pe($=>this.docService.getLocation$().pipe(Te(j=>($.location=j,$)))),Pe($=>this.docService.getLocations$().pipe(Te(j=>($.customLocations=j,$)))),Pe($=>this.docService.getExcludedLocationIds$().pipe(Te(j=>($.excludedLocationIds=j,$)))),Te($=>{if($.filteredAnnotations=[],_&&!h)return $.filteredAnnotations=$.annotations?.slice(),$?.excludedLocationIds?.length&&($.filteredAnnotations=$.filteredAnnotations?.filter(j=>j?.location?.id?!$.excludedLocationIds.includes(j.location.id):!0)),$;{let j=[],Z=[];return h?j.push(h):(j.push($?.location?.locationId),j.push(...Object.values($?.customLocations||[]).map(re=>re.locationId)),$?.location?.location?.id&&Z.push($?.location?.location?.id),Z.push(...Object.values($?.customLocations||{}).map(re=>re.location?.id).filter(re=>!!re))),$.filteredAnnotations=this.filterAnnotationsByLocationIds($?.annotations,j,Z),$?.excludedLocationIds?.length&&($.filteredAnnotations=$.filteredAnnotations?.filter(re=>re?.location?.id?!$.excludedLocationIds.includes(re.location.id):!0)),$}}),Pe($=>this.draftMultiThreadCommentAnnotationsByAnnotationId$.pipe(Te(j=>($.filteredAnnotations=$.filteredAnnotations?.filter(Z=>!Z.isDraft),j&&$.filteredAnnotations.push(...Object.values(j)),$)))),Pe($=>a?Ee($):$?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onWindowResize$().pipe(Te(()=>$)):Ee($)),Pe($=>a?Ee($):this.addCommentMode$.pipe(Pe(j=>j&&!this.getChangeDetectionInCommentMode()?Ee($):$?.annotations?.length&&(!this.getPopoverMode()||this.getPopoverTriangleComponent())?this.domService.onDomChange$("CommentService getAllMultiThreadCommentAnnotations").pipe(Te(()=>$)):Ee($)))),Te($=>(c||(!this.getPopoverMode()||this.getPopoverTriangleComponent())&&($.filteredAnnotations=$.filteredAnnotations?.map(j=>{let Z=Object.assign({},j);return this.calculateCommentAnnotationPosition(Z,i),Z})),$)),Pe($=>$?.filteredAnnotations?Ee($?.filteredAnnotations||[]):Ee([])))):Ee(null))):Ee(null)),ir(Jr),Pe(I=>m?this.filterCommentsUsingSidebarSettings(I):Ee(I)))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(Gt(t=>!!t),Te(t=>f(g({},e),{config:t})),Pe(t=>this.authService.getUser$().pipe(Te(a=>(this.user=a,f(g({},t),{user:a}))))),Pe(t=>Cb(t.config,t.user,ke.COMMENT)?Ee(f(g({},t),{featureAllowed:!0})):(this.loggingService.warn("Comment feature is not allowed."),Ee(f(g({},t),{featureAllowed:!1})))),ir((t,a)=>t?.featureAllowed===a?.featureAllowed))}buildVisibilityTokens(e){return Ae(this,null,function*(){try{let a=this.authService.getUser()?.clientOrganizationId,i=a?yield this.isViewerOrgMembershipConfirmed(e,a):!1;return Ku({userId:e,clientOrganizationId:i?a:void 0,fallbackServerOrganizationId:a?void 0:this.documentPaths?.organizationId})}catch(t){this.loggingService.catch("Error in CommentService buildVisibilityTokens: ",t);try{return[X.DEFAULT_VELT_CONTEXT,`${X.VISIBILITY_SELF_PREFIX}${ur(e)}`]}catch{return[X.DEFAULT_VELT_CONTEXT]}}})}isViewerOrgMembershipConfirmed(e,t){return Ae(this,null,function*(){try{let i=(yield this.userPermissionService.getUserPermissionsFromCacheOrFetch({organizationId:t}))?.[e]?.organization?.[t];return!!i&&i.errorCode!==Eg.PERMISSION_DENIED}catch(a){return this.loggingService.catch("Error in CommentService isViewerOrgMembershipConfirmed: ",a),!1}})}buildAllCommentsRawListener$(e){let{isContextEnabled:t,documentIds:a,organizationId:i,accessFields:c,isPrivateCommentsEnabled:m,veltFolderId:h,locationIds:_,statusIds:I,commonProperties:S,includeStatusIds:H,documentBatchSize:$}=e,j=I?.length?[Qe("status.id","in",I)]:H?.length?[Qe("status.id","in",H)]:[],Z;if(t){let re=[];for(let se=0;se<c.length;se+=X.LISTENER_CONTEXT_BATCH_SIZE)re.push(c.slice(se,se+X.LISTENER_CONTEXT_BATCH_SIZE));this.loggingService.logContext("[CONTEXT] getDataFromDocuments called with accessFields:",JSON.parse(JSON.stringify(c??"nil"))),Z=dr(re.map(se=>this.commonDbService.dbListener({feature:"allComments",properties:f(g({},S),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",i??this.documentPaths?.organizationId),Qe("metadata.documentId","in",a),...j,...h?[Qe("metadata.veltFolderId","==",h)]:[],..._?.length?[Qe("location.id","in",_)]:[],...se?.length?[Qe("context.accessFields","array-contains-any",se)]:[]),Xt("lastUpdated","desc"),Xt("createdAt","desc")]})}).pipe(Bc()))).pipe(Te(se=>Wc(JSON.parse(JSON.stringify(se)))))}else{let re=[];for(let se=0;se<(a?.length??0);se+=$)re.push(a?.slice(se,se+$)??[]);Z=dr(re.map(se=>this.commonDbService.dbListener({feature:"allComments",properties:f(g({},S),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",i??this.documentPaths?.organizationId),Qe("metadata.documentId","in",se),...j,...h?[Qe("metadata.veltFolderId","==",h)]:[],..._?.length?[Qe("location.id","in",_)]:[],...c?.length&&m?[Qe("context.accessFields","array-contains-any",c)]:[]),Xt("lastUpdated","desc"),Xt("createdAt","desc")]})}).pipe(Bc()))).pipe(Te(se=>Wc(JSON.parse(JSON.stringify(se)))))}return Z}resolvedStatusExclusion$(e){let t=this.customFilterService.customStatusMap$;return dr([this.lazyLoadResolvedComments$,this.resolvedIntentFromSidebar$,t]).pipe(Te(([a,i,c])=>{let m=X.LISTENER_BATCH_SIZE;if(e.hasExplicitStatusIds)return{includeStatusIds:null,documentBatchSize:m};let h=Xg(this.documentPaths),_=ff({lazyLoadResolvedComments:!!a,hasResolvedIntent:!!i,currentDocumentKey:h,unlockedDocumentKey:this.resolvedUnlockedDocumentKey});if(this.resolvedUnlockedDocumentKey=_.unlockedDocumentKey,!_.excludeResolved)return{includeStatusIds:null,documentBatchSize:m};let I=kf(c),S=xf(c),H=_f({branch:e.isContextEnabled?"context":"default",documentIdCount:e.documentIdCount,accessFieldCount:e.isContextEnabled?Math.min(e.accessFieldCount,X.LISTENER_CONTEXT_BATCH_SIZE):e.accessFieldCount,locationIdCount:e.locationIdCount,nonTerminalStatusCount:I.length,terminalStatusCount:S.length,hasFolderClause:e.hasFolderClause,orderByCount:2});this.lastQueryClauseDescriptor=H;let $=e.documentIdCount,j=Sf({branch:e.isContextEnabled?"context":"default",clauses:H,maxDocumentBatchSize:e.isContextEnabled?$:m,minDocumentBatchSize:e.isContextEnabled?$:2});return j.applyStatusClause?{includeStatusIds:I,documentBatchSize:j.documentBatchSize}:(this.loggingService.catch(`[lazyLoadResolvedComments] status clause dropped \u2014 branch=${e.isContextEnabled?"context":"default"} disjunctions=${j.projectedDisjunctions} filterSum=${j.projectedFilterSum} boundBy=${j.boundBy} reason=${j.reason}`,null,void 0,!0),{includeStatusIds:null,documentBatchSize:m})}),ir((a,i)=>a.documentBatchSize===i.documentBatchSize&&Cf(a.includeStatusIds,i.includeStatusIds)),jr(a=>(this.loggingService.catch("[lazyLoadResolvedComments] status-exclusion stream failed; falling back to today's query: ",a),Ee({includeStatusIds:null,documentBatchSize:X.LISTENER_BATCH_SIZE}))))}getDataFromDocuments(e){let{documentIds:t,organizationId:a,query:i}=e;if(!this.configService?.getApiKey())return Ee(null);if(t?.some(H=>!H)||!this.documentPaths)return Ee(null);let c,m,h=[];if(i)i?.folderId&&(c=mr(i?.folderId)),i?.locationId&&(h=[...h,i?.locationId]),i?.locationIds?.length&&(h=[...h,...i?.locationIds]),m=i?.statusIds;else{c=this.docService.getDocumentPaths()?.veltFolderId;let H=this.docService.getDocumentPaths()?.locationId;H&&(h=[...h,H])}let _={useCollectionGroup:!0,isCollection:!0,useQuery:!0};this.commonDbService.shouldUseFirestore()||(_.documentId=t?.length?t[0]:void 0,_.organizationId=this.documentPaths?.organizationId);let I=this.authService.getUser()?.userId;if(!I)return Ee(null);let S=this.authService.getIsPrivateCommentsEnabled();return wh(()=>yn(this.buildVisibilityTokens(I)).pipe(Pe($=>{let j=S?$:[X.DEFAULT_VELT_CONTEXT],Z=this.userPermissionService?.getIsContextEnabled()?this.docService.getProcessedDocContext():[],re=[...j,...Z],se=this.userPermissionService?.getIsContextEnabled();return this.resolvedStatusExclusion$({isContextEnabled:!!se,documentIdCount:t?.length??0,accessFieldCount:re?.length&&(se||S)?re.length:0,locationIdCount:h?.length??0,hasFolderClause:!!c,hasExplicitStatusIds:!!m}).pipe(Pe(le=>this.buildAllCommentsRawListener$({isContextEnabled:!!se,documentIds:t,organizationId:a,accessFields:re,isPrivateCommentsEnabled:S,veltFolderId:c,locationIds:h,statusIds:m,commonProperties:_,includeStatusIds:le.includeStatusIds,documentBatchSize:le.documentBatchSize}))).pipe(Pe(le=>le?.data?Ee(le).pipe(Pe(he=>this.commonDbUtilsService.mergeLocationMetadataWithData$({data:he,feature:"allComments"}).pipe(Te(Se=>{let Re=Object.values(Se?.data||{}).filter(ze=>typeof ze=="object");return{data:this.applyListenerVisibilityPostFilter(Re,$,I,se?Z:null),operation:Se?.operation}}))),Te(({data:he,operation:Se})=>{let Re=he.reduce((ze,Ye)=>{let ct=Ye.metadata?.documentId;return ct&&(ze[ct]||(ze[ct]=[]),ze[ct].push(Ye)),ze},{});return{data:he,documentMap:Re,operation:Se}}),Te(({data:he,documentMap:Se,operation:Re})=>m?{data:he,documentMap:Se,operation:Re}:(he?.length&&(he?.forEach(ze=>{this.sanitizeCommentAnnotation(ze)}),this.setAnnotationIndex(he),this.updateAnnotationsForSelectAllContentMode(he),he.forEach(ze=>{this.customFilterService.convertLegacyAnnotationStatus(ze),this.customFilterService.convertLegacyPriority(ze),this.customFilterService.convertLegacyCategory(ze)})),{data:he,documentMap:Se,operation:Re})),jr(he=>(this.loggingService.catch("Error in CommentService getDataFromDocuments: ",he),Ee([]))),Lc(({documentMap:he})=>{m||Object.entries(he??{}).forEach(([Se,Re])=>{this.setOriginalCommentAnnotationsByAnnotationId(JSON.parse(JSON.stringify(Re)))})}),Te(({data:he,documentMap:Se,operation:Re})=>({data:this.filterUserDraftComments(he),documentMap:Se,operation:Re})),Te(({data:he,documentMap:Se,operation:Re})=>({data:this.splitProgressCommentsStage(this.removeDraftFlags(he)),documentMap:Se,operation:Re})),Pe(({data:he,documentMap:Se,operation:Re})=>m?Ee({data:he,documentMap:Se,operation:Re}):this.mergeDraftAnnotations(he).pipe(Te(ze=>({data:ze,documentMap:Se,operation:Re})))),Te(({data:he,documentMap:Se,operation:Re})=>{if(!m)if(Re?.type==="removed"){if(Re?.ids?.length){let ze=this.commentAnnotationById$.value??{};Re?.ids?.forEach(Ye=>{delete ze?.[Ye]}),this.evictProgressComments(Re?.ids??[]),this.commentAnnotationById$.next(ze)}}else Object.entries(Se??{}).length?Object.entries(Se??{}).forEach(([Ye,ct])=>{this.setCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:Ye,annotations:ct})}):this.commentAnnotationById$.value||this.commentAnnotationById$.next({});return he})):Ee(null)))})))}fetchCommentAnnotations(e){return Ae(this,null,function*(){try{let t=this.authService.getUser();if(!t)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),{data:[],hasMore:!1};let a=this.configService?.getApiKey(),i=e?.organizationId??t?.clientOrganizationId,c=Gv(i??""),m=[];e?.allDocuments||(m=e?.documentIds?.map(se=>Mg(se??""))??this.docService.getDocumentIds()?.map(se=>se.documentId));let h=[];if(h.push(Qe("metadata.organizationId","==",c)),h.push(Qe("metadata.apiKey","==",a)),e?.folderId){let se=mr(e?.folderId);h.push(Qe("metadata.veltFolderId","==",se))}if(e?.locationId&&h.push(Qe("location.id","==",e?.locationId)),m?.length&&h.push(Qe("metadata.documentId","in",m)),e?.resolvedBy){if(e?.order==="asc")throw new Error("Order by resolvedBy is not supported in ascending order.");h.push(Qe("resolvedByUserId","==",e?.resolvedBy))}if(e?.mentionedUserIds?.length){if(e?.order==="asc")throw new Error("Order by mentionedUserIds is not supported in ascending order.");h.push(Qe("mentionedUserIds","array-contains-any",e?.mentionedUserIds))}if(e?.userIds?.length){if(e?.order==="asc")throw new Error("Order by userIds is not supported in ascending order.");h.push(Qe("from.userId","in",e?.userIds))}if(e?.statusIds?.length){if(e?.order==="asc")throw new Error("Order by status id is not supported in ascending order.");h.push(Qe("status.id","in",e?.statusIds))}let _=new Date().getTime();if(e?.createdAfter&&h.push(Qe("createdAt",">=",e?.createdAfter)),e?.createdBefore&&h.push(Qe("createdAt","<=",e?.createdBefore??_)),e?.updatedAfter&&h.push(Qe("lastUpdated",">=",e?.updatedAfter??_)),e?.updatedBefore&&h.push(Qe("lastUpdated","<=",e?.updatedBefore??_)),h.push(Xt("lastUpdated",e?.order??"desc"),Xt("createdAt",e?.order??"desc")),e?.pageToken){let se=yield _b(e?.pageToken??"","veltencrypttoken","veltencrypttoken");h.push(Zb(parseInt(se,10),"lastUpdated"))}let I=e?.pageSize??100;h.push(Kb(I+1));let S=yield this.commonDbService.queryData({feature:"allComments",properties:{useCollectionGroup:!0,isCollection:!0,useQuery:!0,firestoreQuery:h,apiKey:a??"",organizationId:c}}),H=S.length>I;S=S.slice(0,I);let $=S?.reduce((se,_e)=>(se[_e?.annotationId]=_e,se),{});$=yield this.commonDbUtilsService.formatResponse({feature:"allComments",data:$,shouldAwait:!0}),$=this.commonDbUtilsService.mergeUsersWithData({feature:"allComments",data:$});let j=t.clientOrganizationId?yield this.isViewerOrgMembershipConfirmed(t.userId,t.clientOrganizationId):!1,Z=Ku({userId:t.userId,clientOrganizationId:j?t.clientOrganizationId:void 0,fallbackServerOrganizationId:t.clientOrganizationId?void 0:c});return{data:Zu(Object.values($??{}),{userId:t.userId,tokens:Z}),hasMore:H}}catch(t){throw this.loggingService.catch("Error in CommentService fetchCommentAnnotations:",t),t}})}filterUserDraftComments(e){let t=this.authService.getUser();return e.filter(a=>(a.comments=a?.comments?.filter(i=>i?.from?.userId===t?.userId||!i?.isDraft),!!a?.comments?.length))}removeDraftFlags(e){return e.forEach(t=>delete t.isDraft),e}mergeDraftAnnotations(e){return this.draftCommentAnnotationsByAnnotationId$.pipe(Te(t=>{let a=t||{};return e?.filter(i=>{a?.[i?.annotationId]&&delete a[i?.annotationId]}),a}),Te(t=>{if(t){let a=e.slice();return a.push(...Object.values(t)),a}return e}))}getDataFromDocumentIds({documentIds:e,organizationId:t,query:a}){return this.getDataFromDocuments({documentIds:e,organizationId:t,query:a})}getMultiThreadDataFromDocumentIds(e){return this.getMultiThreadDataFromDocuments({documentIds:e})}getMultiThreadDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:t}=e;if(t?.some(m=>!m)||!this.documentPaths)return Ee(null);let a=this.docService.getDocumentPaths()?.veltFolderId,i=Ee([]),c={useCollectionGroup:!0,isCollection:!0,useQuery:!0};if(this.commonDbService.shouldUseFirestore()||(c.documentId=t?.length?t[0]:void 0,c.organizationId=this.documentPaths?.organizationId),this.userPermissionService?.getIsContextEnabled()){let m=[X.DEFAULT_VELT_CONTEXT,...this.docService.getProcessedDocContext()],h=[];for(let _=0;_<(m?.length??0);_+=X.LISTENER_CONTEXT_BATCH_SIZE)h.push(m?.slice(_,_+X.LISTENER_CONTEXT_BATCH_SIZE)??[]);i=dr(h.map(_=>this.commonDbService.dbListener({feature:"allMultiThreads",properties:f(g({},c),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",this.documentPaths?.organizationId),Qe("metadata.documentId","in",t),...a?[Qe("metadata.veltFolderId","==",a)]:[],..._?.length?[Qe("context.accessFields","array-contains-any",_)]:[])]})}).pipe(Bc()))).pipe(Te(_=>Wc(_)))}else{let m=[];for(let h=0;h<(t?.length??0);h+=X.LISTENER_BATCH_SIZE)m.push(t?.slice(h,h+X.LISTENER_BATCH_SIZE)??[]);i=dr(m.map(h=>this.commonDbService.dbListener({feature:"allMultiThreads",properties:f(g({},c),{firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",this.documentPaths?.organizationId),Qe("metadata.documentId","in",h),...a?[Qe("metadata.veltFolderId","==",a)]:[])]})}).pipe(Bc()))).pipe(Te(h=>Wc(h)))}return i.pipe(Pe(m=>m?.data?Ee(m).pipe(Te(h=>({data:h?.data,operation:h?.operation})),Te(({data:h,operation:_})=>{let I=[];return h&&(I=Object.values(h??{}).filter(S=>typeof S=="object")),{data:I,operation:_}}),jr(h=>(this.loggingService.catch("Error in CommentService getMultiThreadDataFromDocumentId: ",h),Ee({data:[],operation:null}))),Te(({data:h,operation:_})=>{h.forEach(S=>{delete S.isDraft});let I=h.reduce((S,H)=>{let $=H.metadata?.documentId;return $&&(S[$]||(S[$]=[]),S[$].push(H)),S},{});return{data:h,documentMap:I,operation:_}}),Pe(({data:h,documentMap:_,operation:I})=>{let S=[];return this.commentAnnotationById$.pipe(Pe(()=>this.domService.getSelectedAnnotationsMap$().pipe(Te(H=>({selectedAnnotationsMap:H})))),Te(({selectedAnnotationsMap:H})=>{let $={};return Object.keys(_??{}).forEach(j=>{let Z=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:j});Z&&Z?.forEach(re=>{$[re?.annotationId]=re})}),S=h.filter(j=>{let Z=!1;if(j?.commentAnnotations){for(let re in j?.commentAnnotations)if($?.[re]&&$?.[re]?.status?.id!==this.customFilterService.resolvedStatus.id){Z=!0;break}}return Z}),S.forEach(j=>{Object.keys(j?.commentAnnotations||{}).forEach(Z=>{j.commentAnnotationsMap||(j.commentAnnotationsMap={}),j.commentAnnotationsMap[Z]=$?.[Z]})}),{data:S,operation:I}}))}),Pe(({data:h,operation:_})=>this.draftMultiThreadCommentAnnotationsByAnnotationId$.pipe(Te(I=>{let S=I||{};return h?.filter(H=>{S?.[H?.annotationId]&&delete S[H?.annotationId]}),S}),Te(I=>{if(I){let S=h.slice();return S.push(...Object.values(I)),{data:S,operation:_}}return{data:h,operation:_}}))),Te(({data:h,operation:_})=>{let I=h.reduce((S,H)=>{let $=H.metadata?.documentId;return $&&(S[$]||(S[$]=[]),S[$].push(H)),S},{});if(_?.type==="removed"){if(_?.ids?.length){let S=this.multiThreadCommentAnnotationById$.value;_?.ids?.forEach(H=>{delete S?.[H]}),this.multiThreadCommentAnnotationById$.next(S)}}else Object.keys(I??{}).forEach(S=>{this.setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:S,annotations:I[S]})});return h})):Ee(null)))}else return Ee(null)}updateUnreadAnnotationsMap(e,t){try{let a=new Date(X.UNREAD_COMMENTS_CHECK_FROM_DATE)?.getTime(),i=e.filter(c=>c?.lastUpdated>a);if(t){let c={},m=!1;i.forEach(h=>{let _=0,I=t?.[h?.annotationId];if(I){let S=I?.comments;S&&h?.comments?.forEach(H=>{S?.[H?.commentId]?.views?.[this.user?.userSnippylyId]||_++})}_?_!==c?.[h?.annotationId]&&(c[h?.annotationId]=_,m=!0):c?.[h?.annotationId]&&(delete c[h?.annotationId],m=!0)}),this.unreadCommentsMap$.next(c)}}catch(a){this.loggingService.catch("Error in CommentService updateUnreadAnnotationsMap:",a)}}updateAnnotationsForSelectAllContentMode(e){try{e.forEach(t=>{if(t?.selectAllContent&&t?.targetElementId){let a=Wr(t.targetElementId,["id","data-id"]);if(a){let i=a.textContent;i&&(t.targetTextRange={commonAncestorContainer:this.domService.getXPath(a),text:i,occurrence:1,commonAncestorContainerAnchor:this.domService.generateAnchorRecord(a)??void 0},delete t?.targetElement)}}})}catch(t){this.loggingService.catch("Error in CommentService updateAnnotationsForSelectAllContentMode:",t)}}setCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:a,queryHash:i}){try{if(t){e||(e=X.NO_ORGANIZATION_ID),i||(i=X.DEFAULT_QUERY_HASH);let c={};a?.forEach(h=>{h?.annotationId&&(c[h?.annotationId]=h)});let m=g(g({},this.commentAnnotationById$.value??{}),c);this.commentAnnotationById$.next(m)}}catch(c){this.loggingService.catch("Error in CommentService setCommentAnnotationsByOrganizationIdAndDocumentId:",c)}}getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e,documentId:t}){try{return this.commentAnnotationById$.pipe(Pe(()=>this.draftCommentAnnotationsByAnnotationId$),Te(()=>this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t})))}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByOrganizationIdAndDocumentId$:",a),Ee([])}}getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let a=null;this.commentAnnotationById$.value&&(a={},Object.values(this.commentAnnotationById$.value).forEach(c=>{c?.metadata?.documentId==t&&c?.metadata?.organizationId==e&&(a[c?.annotationId]=c)}));let i=this.draftCommentAnnotationsByAnnotationId$.value;return i&&(a===null&&(a={}),Object.values(i).forEach(c=>{c?.metadata?.documentId===t&&c?.metadata?.organizationId===e&&!a[c?.annotationId]&&(a[c?.annotationId]=c)})),a?Object.values(a):null}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByOrganizationIdAndDocumentId:",a),[]}}getCommentAnnotationsByDocumentId$({clientDocumentId:e,documentId:t}){try{return e&&!t&&(t=this.docService.generateDocumentId(e)),t?this.docService.getDocumentPaths$().pipe(Pe(a=>this.getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:a?.organizationId,documentId:t}))):Ee(null)}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByDocumentId$:",a),Ee(null)}}getCommentAnnotationsOnCurrentOrganizationAndDocument$(){return this.docService.getDocumentPaths$().pipe(Pe(e=>e?.documentId?this.getCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e.organizationId,documentId:e.documentId}):Ee([])))}getCommentAnnotationsOnCurrentOrganizationAndDocument(){try{let e=this.docService.getDocumentPaths();return e?.documentId?this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e?.organizationId,documentId:e?.documentId}):[]}catch(e){return this.loggingService.catch("Error in CommentService getCommentAnnotationsOnCurrentOrganizationAndDocument:",e),[]}}setOriginalCommentAnnotationsByAnnotationId(e){try{let t={};e?.forEach(a=>{a?.annotationId&&(t[a?.annotationId]=a)}),this.originalCommentAnnotationsByDocumentId$.next(g(g({},this.originalCommentAnnotationsByDocumentId$.value),t))}catch(t){this.loggingService.catch("Error in CommentService setOriginalCommentAnnotationsByAnnotationId:",t)}}setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:a,queryHash:i}){try{if(t){e||(e=X.NO_ORGANIZATION_ID),i||(i=X.DEFAULT_QUERY_HASH);let c={};a.forEach(h=>{h?.annotationId&&(c[h?.annotationId]=h)});let m=g(g({},this.multiThreadCommentAnnotationById$.value),c);this.multiThreadCommentAnnotationById$.next(m)}}catch(c){this.loggingService.catch("Error in CommentService setMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId:",c)}}getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e,documentId:t}){return this.multiThreadCommentAnnotationById$.pipe(Te(()=>this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t})))}getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let a={};Object.values(this.multiThreadCommentAnnotationById$.value??{}).forEach(c=>{c?.metadata?.documentId==t&&c?.metadata?.organizationId==e&&(a[c?.annotationId]=c)});let i=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value;return i&&Object.values(i??{}).forEach(c=>{c?.metadata?.documentId===t&&c?.metadata?.organizationId===e&&!a[c?.annotationId]&&(a[c?.annotationId]=c)}),Object.values(a)}catch(a){return this.loggingService.catch("Error in CommentService getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId:",a),[]}}getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument$(){return this.docService.getDocumentPaths$().pipe(Pe(e=>e?.documentId?this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId$({organizationId:e.organizationId,documentId:e.documentId}):Ee([])))}getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument(){try{let e=this.docService.getDocumentPaths();return this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:e?.organizationId,documentId:e?.documentId})}catch(e){return this.loggingService.catch("Error in CommentService getMultiThreadCommentAnnotationsOnCurrentOrganizationAndDocument:",e),[]}}getLocations$(){return this.docService.getLocation$().pipe(Pe(e=>this.docService.getLocations$().pipe(Te(t=>({location:e,locations:t})))),Te(e=>{let t=[];return t.push(e?.location?.locationId),t.push(...Object.values(e.locations||[]).map(a=>a.locationId)),t||[]}))}filterAnnotationsByLocationIds(e,t,a){try{return e.filter(i=>t.includes(i.locationId)||a?.includes(i?.location?.id)||t?.find(c=>c==i?.location?.id)||a?.find(c=>c==i?.locationId+""))}catch(i){return this.loggingService.catch("Error in CommentService filterAnnotationsByLocations:",i),[]}}setAnnotationIndex(e){try{e.forEach((t,a)=>{t?.annotationId&&(t.annotationIndex=a+1)})}catch(t){this.loggingService.catch("Error in CommentService setAnnotationIndex:",t)}}calculateCommentAnnotationPosition(e,t){try{if(e.multiThreadAnnotationId)return;if(e.targetElementId){let a=Wr(e.targetElementId,["id","data-id"]);if(a&&this.domService.isElementVisible(a)){let i=a.getAttribute(X.ATTRIBUTES.VELT_COMMENT_TYPE),c=!0;if(i)i==="popover"?c=!0:c=!1;else{let m=document.querySelector(`${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_INLINE_COMMENT_ELEMENT_ID}="${e.targetElementId}"], ${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_COMMENT_ELEMENT_ID}="${e.targetElementId}"], ${X.TAGS.VELT_INLINE_COMMENTS_SECTION}[${X.ATTRIBUTES.TARGET_ELEMENT_ID}="${e.targetElementId}"]`);m&&a?.contains(m)&&(c=!1)}c?e.targetElement={xpath:this.domService.getXPath(a),fXpath:this.domService.getXPath(a,!0),cfXpath:this.domService.getXPath(a,!0,!0),topPercentage:e.targetElement?.topPercentage||50,leftPercentage:e.targetElement?.leftPercentage||90}:e.targetElement=null}else e.targetElement=null}if(e.targetElement){e.position=null,e.ghostComment=null;let a=e.targetElement?.xpath,i=null,c=e?.targetElement?.anchor;if(c){let h=this.domService.resolveAnchorRecord(c);h?.element&&this.domService.isElementVisible(h.element)&&pn(h.element)&&(i=h.element)}else a&&(i=this.domService.getElementFromXPath(a),this.domService.isXpathWithId(a)||((!i||!this.domService.isElementVisible(i))&&e.targetElement?.cfXpath&&(a=e.targetElement?.cfXpath,i=this.domService.getElementFromXPath(a)),this.getDetectionStrategy()===Yu.DYNAMIC_ID&&(!i||!this.domService.isElementVisible(i))&&(a=e.targetElement?.fXpath,a&&(i=this.domService.getElementFromXPath(a)))));(!i||!this.domService.isElementVisible(i))&&t&&(e.ghostComment={},this.setGhostCommentMessage(e),e.ghostComment.targetElement=this.getGhostCommentTargetElement(e),e?.ghostComment?.targetElement?.xpath&&(i=this.domService.getElementFromXPath(e?.ghostComment?.targetElement?.xpath)));let m=!1;if(e?.locationId){let h=this.docService.getLocation();if(!Ug({location:h?.location,locationId:h?.locationId},{location:e?.location,locationId:e?.locationId})){let _=this.docService.getAdditionLocationFromElement(i),I=_?this.docService.genarateLocationId(_):void 0;e?.location?.id&&e?.location?.id===_?.id||I&&I===e?.locationId?m=!1:m=!0}}if(m&&(e.ghostComment=null),!m&&i&&pn(i)&&!i?.closest(".cdk-overlay-container")&&i?.getBoundingClientRect()){let _=this.popoverMode$?.value?0:e.targetElement?.topPercentage,I=this.popoverMode$?.value?100:e.targetElement?.leftPercentage,{height:S,width:H}=Pb(i);e.position={top:S*(_||0)/100,left:H*(I||0)/100};let $=window.getComputedStyle(i).transform;if($&&$!=="none")try{let j=new DOMMatrixReadOnly($),Z=Math.sqrt(j.a*j.a+j.b*j.b)||1,re=Math.sqrt(j.c*j.c+j.d*j.d)||1;(Math.abs(Z-1)>.01||Math.abs(re-1)>.01)&&(e.position.parentScaleX=Z,e.position.parentScaleY=re)}catch{}if(this.transformContext$.value){let{containerSelector:j,transforms:Z}=this.transformContext$.value,re=document.querySelector(j);re&&re.contains(i)&&(e.position.transformContext=Z)}}!m&&t&&!e?.position&&!e?.ghostComment&&(e.ghostComment={},this.setGhostCommentMessage(e),e.ghostComment.targetElement=e.targetElement)}t&&(e.ghostComment?this.addAnnotationToGhostCommentAnnotationMap(e):this.removeAnnotationFromGhostCommentAnnotationMap(e))}catch(a){this.loggingService.catch("Error in CommentService calculateCommentAnnotationPosition:",a)}}addComment($e,bt,Xe,Tt,Ue){return Ae(this,arguments,function*(e,t,a,i,c,m=[],h,_,I,S,H,$,j,Z,re,se,_e,le,he,Se,Re,ze,Ye,ct){this.loggingService.log("%c[WB] Calling FUNCTION: addComment","color: green;");try{let Ut=this.authService.getUser();if(Ut)if(Ut.isReadOnly||Ut.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add comments.");else{yield this.triggerAddCommentAnnotationDraftEvent();let We=new Nt;_e&&(We=g(g({},We),_e)),We.comments=[],_e?.comments?.length&&(We.comments=_e.comments.map(St=>{let Ot=new qn;return Ot=g(g({},Ot),St),Ot.from=Ut,Ot.lastUpdated=new Date,Ot.createdAt=this.timestamp,Ot})),We.from=Ut,We.color=We?.color||X.DEFAULT_ANNOTATION_COLOR,We.lastUpdated=this.timestamp,We.createdAt=this.timestamp,We.sourceId=re,We.assignedTo=_e?.assignedTo||se,We.customList=_e?.customList||[],ze&&(We.targetElementId=ze);let{topPositionX:Gu,topPositionY:ag}=this.domService.getTopLeftPosition();We.positionX=Gu,We.positionY=ag;let Uc=this.domService.getCurrentWindowSizeValue();if(We.screenWidth=Uc.screenWidth,We.screenHeight=Uc.screenHeight,We.screenScrollHeight=Uc.screenScrollHeight,We.taggedElementPath="",e&&(We.targetElement=this.domService.getTargetElementForCursorPosition(e,!0,!0,!0,St=>{if(this.getSvgAsImg()){let Ot=St?.closest(`[${X.ATTRIBUTES.VELT_COMMENT_CONTAINER}]`);Ot&&Ot instanceof HTMLElement&&(St=Ot)}if(this.getPopoverMode()){let Ot=St?.closest(`[${X.ATTRIBUTES.VELT_TARGET_COMMENT_ELEMENT_ID}]`);if(Ot&&Ot instanceof HTMLElement)return Ot}return St}),this.getCommentToNearestAllowedElement()&&We.targetElement?.xpath)){let St=this.domService.getElementFromXPath(We.targetElement.xpath);if(St&&!this.isElementInsideAllowedElements(St)){let Ot=this.getNearestAllowedElement(St);if(Ot)We.targetElement.xpath=this.domService.getXPath(Ot),We.targetElement.fXpath=this.domService.getXPath(Ot,!0),We.targetElement.cfXpath=this.domService.getXPath(Ot,!0,!0),We.targetElement.anchor=this.domService.generateAnchorRecord(Ot);else return}}if(t&&(We.targetTextRange=t),We?.targetElement?.xpath){let St=this.domService.getXPath(We.targetElement.xpath);if(St){let Ot=St.iterateNext();Ot&&(pn(Ot)||(We.targetElement=null))}}this.customFilterService.defaultStatus&&!_e?.status&&(We.status=this.customFilterService.defaultStatus),We.pageInfo=tp(),We.pageInfo&&(We.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth);let c2=this.docService.getClientDocumentId(),m2=this.docService.getLocation()?.location;if(he&&(We.context=this.preserveAccessSentinels(We.context,he&&an(he)),We.contextId=this.generateContextId(We.context)),this.commentContextProvider!==null){let St=this.commentContextProvider(c2,m2),Ot=St instanceof Promise?yield St:St;Ot&&(We.context=this.preserveAccessSentinels(We.context,Ot&&an(Ot)),We.contextId=this.generateContextId(We.context),Ot?.commentType==="manual"&&(We.commentType="manual",delete We.targetElement))}if(i){We.sourceId=i?.sourceId;let St=i?.targetElement,Ot=i?.commentData;if(St?.targetText)We.targetTextRange={commonAncestorContainer:"/html/body",text:St.targetText,occurrence:St?.occurrence||1,commonAncestorContainerAnchor:this.domService.generateAnchorRecord(document.body)??void 0};else if(St?.elementId)if(We.targetElementId=St.elementId,St?.selectAllContent)We.selectAllContent=!!St?.selectAllContent;else{let Rr=Wr(St.elementId,["id","data-id"]);Rr?We.targetElement={xpath:this.domService.getXPath(Rr),fXpath:this.domService.getXPath(Rr,!0),cfXpath:this.domService.getXPath(Rr,!0,!0),anchor:this.domService.generateAnchorRecord(Rr),topPercentage:50,leftPercentage:90}:We.targetElement={xpath:"/html/body",fXpath:"/html/body",cfXpath:"/html/body",anchor:this.domService.generateAnchorRecord(document.body),topPercentage:50,leftPercentage:90}}i?.status&&(We.status=i.status),i?.context&&(We.context=this.preserveAccessSentinels(We.context,i.context?an(i.context):i.context),We.contextId=this.generateContextId(We.context)),We.comments||(We.comments=[]);let zu=this.authService.getUser();Ot?.forEach(Rr=>{let Fv=new qn;Fv.commentText=Rr.commentText,Fv.commentHtml=Rr.commentHtml,Fv.replaceContentHtml=Rr.replaceContentHtml,Fv.replaceContentText=Rr.replaceContentText,Fv.from=zu,We.comments.push(Fv)})}if(c&&(We.isPageAnnotation=!0),m?.length&&(We.comments=m),h&&(We.commentType="chart",We.metadata=h),I?.sourceId&&(We.sourceId=I.sourceId),We?.targetElement?.xpath&&!I){let St=this.domService.getElementFromXPath(We.targetElement.xpath);St&&(I=this.getInlineCommentSectionConfig(St))}I?.targetInlineCommentElementId&&(We.targetInlineCommentElementId=I?.targetInlineCommentElementId,We.targetElementId=I.targetInlineCommentElementId,I?.config?.id&&(We.inlineCommentSectionConfig=I?.config));let s2=!We?.comments?.length,g2=!!(i?.openComment===!1||Se);this.getPrivateCommentMode()&&(We?.iam||(We.iam=new hb),We.iam.accessMode=cr.PRIVATE),S&&(We.context=this.preserveAccessSentinels(We.context,S.context?an(S.context):S.context),We.commentType="manual",delete We.targetElement,We.contextId=this.generateContextId(We.context)),H&&(We.targetElementId=H.targetElementId,We.targetElement=H.targetElement);let kh=this.getPrivateModeConfig();if(kh)try{let St=g({},kh),Ot=this.authService.getUser();if(St.type==="restricted"&&Ot?.userId&&(St=eo(St,Ot.userId)),St.type==="organizationPrivate"&&!St.organizationId&&!St.organizationIds?.length){let Rr=this.docService.getOrganizationConfig();Rr?.clientOrganizationId&&(St.organizationId=Rr.clientOrganizationId)}let zu=An(St,Ot?.userId);We.context||(We.context={}),We.context._setAccessFields=zu,We.visibilityConfig=Pn(St,Ot?.userId)}catch(St){this.loggingService.catch("Error building accessFields from privateModeConfig: ",St)}this.saveCommentToDb(We,a,s2,g2,_,$,j,le,Z,Re,Ye,ct)}}catch(Ut){this.loggingService.catch("Error in CommentService addComment: ",Ut)}})}triggerAddCommentAnnotationDraftEvent(){return Ae(this,null,function*(){try{this.commentAnnotationContextDraft=null;let e={addContext:a=>{this.commentAnnotationContextDraft=a}},t=yield this.commentActionsService?.getAddCommentAnnotationDraftEventFromCommentAddEventData(e);t&&this.commentActionsService?.triggerAddCommentAnnotationDraftEvent(t)}catch(e){this.loggingService.catch("Error in CommentService triggerAddCommentAnnotationDraftEvent: ",e)}})}triggerAddCommentDraftEventOnAbandon(e,t){return Ae(this,null,function*(){try{if(!e||!t)return;let a=this.getAnnotationById(e),i=!!this.getFullComments(a).some(c=>c&&!c.isDraft);a&&i&&(yield this.commentActionsService?.triggerAddCommentDraftEventForAnnotation(a,t))}catch(a){this.loggingService.catch("Error in CommentService triggerAddCommentDraftEventOnAbandon: ",a)}})}willDeleteWholeAnnotation(e,t){try{let a=this.getFullComments(e);if(!a.length)return!1;let i=a.findIndex(c=>c?.commentId===t);return i<0?!1:i===0&&this.deleteThreadWithFirstComment$.value!==!1||a.length===1}catch(a){return this.loggingService.catch("Error in CommentService willDeleteWholeAnnotation: ",a),!1}}confirmDeleteCommentIfRequired(e,t){return Ae(this,null,function*(){try{let a=this.getFullComments(e);if(!a.length||!t)return!0;let i=a.findIndex(_=>_?.commentId===t?.commentId);if(i<0||!(i===0&&this.deleteThreadWithFirstComment$.value!==!1||this.deleteReplyConfirmation$.value))return!0;let m;return this.deleteReplyConfirmation$.value&&(i!==0||this.deleteThreadWithFirstComment$.value===!1)?m={title:"Delete comment?",message:"This selected comment will be deleted.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"reply",type:"reply"}:m={title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"},!!(yield this.dialog.open(Yc,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:m}).afterClosed().toPromise())}catch(a){return this.loggingService.catch("Error in CommentService confirmDeleteCommentIfRequired: ",a),!1}})}releaseDraftConfirmationRetention(e){try{if(!e||!this.draftConfirmationPendingAnnotationIds?.delete(e))return;let t=this.draftCommentAnnotationsByAnnotationId$?.value;if(!t||!(e in t))return;let a=JSON.parse(JSON.stringify(t));delete a[e],this.draftCommentAnnotationsByAnnotationId$.next(a)}catch(t){try{this.loggingService?.catch("Error in CommentService releaseDraftConfirmationRetention: ",t)}catch{}}}confirmDraftIfRequired(e,t){return Ae(this,null,function*(){try{if(!e?.isDraft||!this.draftConfirmation$?.value)return!0;t&&this.draftConfirmationPendingAnnotationIds?.add(t);let a=S2({composerContent:e?.commentText??"",attachmentCount:e?.attachments?.length??0,recordingCount:e?.recorders?.length??0});return!(yield this.confirmDraftDecision?.(a))}catch(a){try{this.loggingService?.catch("Error in CommentService confirmDraftIfRequired: ",a)}catch{}return!0}finally{this.releaseDraftConfirmationRetention(t)}})}confirmDraftDecision(e){return Ae(this,null,function*(){try{let t={title:"Delete Draft?",message:"Your comment will be permanently removed",previewText:e,yesButton:"Delete Draft",noButton:"Keep Draft",darkMode:this.commentContainerDarkMode$.value,variant:"draft",type:"draft"};return!!(yield this.dialog.open(Yc,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],role:"alertdialog",ariaDescribedBy:"velt-confirm-dialog-message",data:t}).afterClosed().toPromise())}catch(t){return this.loggingService.catch("Error in CommentService confirmDraftDecision: ",t),!1}})}setLocationToCommentAnnotation(e){try{let t=this.docService.getLocation();t?(e.locationId=t.locationId,e.location=t.location):(delete e.locationId,delete e.location);try{let a;e.targetElement?a=this.domService.getElementFromTargetElement(e.targetElement):e.targetElementId?a=Wr(e.targetElementId,["id","data-id"]):e.targetTextRange&&(a=this.domService.getElementFromTargetTextRange(e.targetTextRange));let i=this.docService.getAdditionLocationFromElement(a);if(i){let c=this.docService.addLocation({location:i,source:"internal"});c?.[0]&&(e.locationId=c[0].locationId,e.location=c[0].location)}}catch{}}catch(t){this.loggingService.catch("Error in CommentService setLocationToCommentAnnotation:",t)}}getElementForCommentAnnotation(e){try{let t;return e.targetElement?t=this.domService.getElementFromTargetElement(e.targetElement):e.targetElementId?t=Wr(e.targetElementId,["id","data-id"]):e.targetTextRange&&(t=this.domService.getElementFromTargetTextRange(e.targetTextRange)),t}catch(t){return this.loggingService.catch("Error in CommentService getElementForCommentAnnotation: ",t),null}}saveCommentToDb(e,t,a=!1,i=!1,c,m,h,_,I,S,H,$){this.loggingService.log("%c[WB] Calling FUNCTION: saveCommentToDb","color: green;");try{this.authService.getUser()&&this.authService.isFeatureAllowed(ke.COMMENT)&&this.docService.getDocumentPaths$().pipe(Gt(j=>!!j),Jn(1),Pe(j=>(this.documentPaths=j,this.loggingService.log(this.documentPaths),this.databaseService.getDb().pipe(Gt(Z=>!!Z),Jn(1),Pe(Z=>Ae(this,null,function*(){if(this.documentPaths?.comment){e.annotationId=this.commonDbService.generateDocumentId();let re=this.docService.getClientDocumentId(),se=this.docService.getLocation()?.location;if(h)e.multiThreadAnnotationId=h;else if(this.getMultiThread()){let Ye=un();e.targetElementId&&(Ye=un(e.targetElementId),e?.location?.id?Ye=un([e?.location?.id,e.targetElementId]):e?.locationId&&(Ye=un([e?.locationId+"",e.targetElementId]))),e.multiThreadAnnotationId=Ye}let _e={addContext:Ye=>{Ye.access&&(Ye.accessFields=Jc(Ye)),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ADD_CONTEXT_TRIGGERED,{annotationId:e.annotationId,commentType:this.getCommentType(e),commentMode:this.getCommentMode(),context:Ye}),e.context=Ye&&an(Ye),e.contextId=this.generateContextId(e.context),Ye?.commentType==="manual"&&(e.commentType="manual",delete e.targetElement),e?.annotationId&&setTimeout(()=>{this.updateCommentAnnotationContext(e.annotationId,Ye)},200)},documentId:re,location:se,annotation:this.getCommentAnnotationForClient(e),targetAnnotationId:e?.annotationId,targetCommentId:e?.comments?.length?e?.comments[0]?.commentId:void 0};e?.targetElement?.xpath?_e.elementRef={xpath:e.targetElement.xpath}:_e.elementRef=void 0,this.commentAddedEmitter!==null&&"emit"in this.commentAddedEmitter&&this.commentAddedEmitter.emit(_e),this.commentAdded$.next(_e),I&&I(_e),_e?.annotation?.annotationId&&this.pendingAddCommentAnnotationData.set(_e.annotation.annotationId,_e),this.setLocationToCommentAnnotation(e);let le=this.getElementForCommentAnnotation(e),he=this.docService.getBaseMetadata("comment",{element:le,multiThreadAnnotationId:e.multiThreadAnnotationId});if(!he?.apiKey)return;if(e?.metadata||(e.metadata={}),e.metadata=g(g({},e.metadata),he),S&&(e.metadata=g(g({},e.metadata),S)),c&&typeof c=="object"&&(e.locationId=_||this.docService.genarateLocationId(c),e.location=c,$||this.docService.addLocation({location:c})),a)window.localStorage.setItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT,JSON.stringify(e));else{let Ye=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);Ye&&JSON.parse(Ye).annotationId===e.annotationId&&e.comments!==void 0&&e.comments.length>0&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT)}e.pageInfo&&(e.pageInfo.commentUrl=this.generateCommentUrl(e));let Se=e.comments,Re=JSON.parse(JSON.stringify(e));if(this.commentAnnotationContextDraft){let Ye=this.commentAnnotationContextDraft;this.commentAnnotationContextDraft=null,Ye.access&&(Ye.accessFields=Jc(Ye)),Re.context=this.preserveAccessSentinels(Re.context,Ye&&an(Ye))}if(this.applyContextAccessDefaults(Re),Re.visibilityConfig||jc(Re?.context?.accessFields).length===0&&(Re.visibilityConfig={type:"public"}),Re.position=null,t){Re.targetElement=null,Re.targetTextRange=null;let Ye={annotationId:e.multiThreadAnnotationId?e.multiThreadAnnotationId:e.annotationId,type:e.multiThreadAnnotationId?ke.MULTI_THREAD:ke.COMMENT},ct=yield this.areaService?.generateAreaAnnotationId();Re.areaAnnotationId=ct;let $e=this.areaService?.addArea(void 0,t,Ye,ct,{locationId:Re.locationId,location:Re.location},Re.context);$e&&(Re.metadata=g(g({},Re.metadata),$e?.metadata||{}))}!i&&!Re?.targetInlineCommentElementId&&!Re?.isPageAnnotation&&this.domService.toggleAnnotationSelection(Re,m),e.targetTextRange&&sessionStorage.setItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,e?.multiThreadAnnotationId?e?.multiThreadAnnotationId:e.annotationId),Re?.comments?.length?this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ADDED,{annotationId:e.annotationId,commentThreadId:Re?.comments[0]?.commentId,commentThreadIndex:0,commentType:this.getCommentType(Re),commentMode:this.getCommentMode(),source:H??"internal",commentAnnotationCreatedAt:e.createdAt,taggedClientUserIds:Re?.comments[0]?.taggedUserContacts?.map(Ye=>Ye.contact?.userId).filter(Ye=>!!Ye),taggedSnippylyUserIds:Re?.comments[0]?.taggedUserContacts?.filter(Ye=>!!Re?.metadata?.apiKey&&!!Ye.contact?.userId).map(Ye=>Ng(Re.metadata.apiKey,Ye.contact.userId))}):this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_DRAFT_ADDED,{annotationId:e.annotationId,commentType:this.getCommentType(Re),commentMode:this.getCommentMode()});let ze=this.getAnnotationNumber(e);ze&&(Re.annotationNumber=ze),Re?.comments?.length?Re.comments=[]:Re.isDraft=!0,Re?.multiThreadAnnotationId&&this.saveMultiThreadCommentAnnotation(Re),Re?.context&&(Re.contextId=this.generateContextId(Re.context),Re.context?.commentType==="manual"&&(Re.commentType="manual",delete Re.targetElement)),Se?.length?this.saveComment(Re,{type:Ze.NEWLY_ADDED,updatedComment:Se[0]}):this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e.annotationId]:Re}))}})))))).subscribe(()=>{},j=>{this.loggingService.catch("Error in CommentService saveCommentToDb subscription: ",j)})}catch(j){this.loggingService.catch("Error in CommentService saveCommentToDb: ",j)}}saveMultiThreadCommentAnnotation(e){return Ae(this,null,function*(){try{if(e?.multiThreadAnnotationId){let t=this.docService.getDocumentPaths();if(this.databaseService.getDbValue()&&t?.multiThread){let a={annotationId:e.multiThreadAnnotationId,targetElement:e.targetElement,targetElementId:e.targetElementId,targetInlineCommentElementId:e.targetInlineCommentElementId,inlineCommentSectionConfig:e.inlineCommentSectionConfig,areaAnnotationId:e.areaAnnotationId,targetTextRange:e.targetTextRange,from:e.from,locationId:e.locationId,location:e.location,sourceId:e.sourceId,type:"multiThread",metadata:e.metadata,context:e.context};delete e?.targetElement,delete e?.areaAnnotationId,delete e?.targetTextRange;let i=this.getMultiThreadCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:t?.organizationId,documentId:t?.documentId})?.find(c=>c.annotationId===e.multiThreadAnnotationId);if(i||(i=yield this.commonDbService?.getData({feature:"multiThread",properties:{documentId:t?.documentId??"",organizationId:t?.organizationId??"",id:e.multiThreadAnnotationId}})),i&&(i=JSON.parse(JSON.stringify(i)),delete i.from,a=g(g({},i),a)),a?.commentAnnotations||(a.commentAnnotations={}),a.commentAnnotations[e.annotationId]=!0,e?.isDraft)this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(f(g({},this.draftMultiThreadCommentAnnotationsByAnnotationId$.value),{[a.annotationId]:f(g({},a),{isDraft:!0})}));else{let m=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value[a.annotationId];if(m&&(a=g(g({},a),m)),delete a.isDraft,a.commentAnnotationsMap={},!a?.metadata?.documentId){a?.metadata||(a.metadata={});let I=this.docService.getBaseMetadata("multiThread");a.metadata=g(g({},a?.metadata),I)}let{documentId:h,organizationId:_}=a?.metadata||{};yield this.commonDbService.updateData({feature:"multiThread",properties:{id:a.annotationId,documentId:h,organizationId:_},data:JSON.parse(JSON.stringify(a)),callback:()=>{let I=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value;I[e.annotationId]&&(delete I[e.annotationId],this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(I))}})}return a}}return null}catch(t){return this.loggingService.catch("Error in CommentService saveMultiThreadCommentAnnotation: ",t),null}})}setCommentCategory(e){return Ae(this,null,function*(){try{if(e?.comments?.length){let t=e.comments[0].commentText?.trim();if(t){let a=yield this.getCommentCategory(t).toPromise();if(a){let i=this.docService.getDocumentPaths();if(i?.comment&&e?.annotationId){let c=this.getCommentAnnotationsOnCurrentOrganizationAndDocument()?.find(m=>m.annotationId===e.annotationId);if(c||(c=yield this.commonDbService?.getData({feature:"comment",properties:{documentId:i?.documentId??"",organizationId:i?.organizationId??"",id:e.annotationId}})),c?.annotationId){let m=c;m.commentCategories=[a];let{documentId:h,organizationId:_}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(m);yield this.commonDbService.updateData({feature:"comment",properties:{id:e.annotationId,documentId:h,organizationId:_,metadata:{apiKey:this.configService.getApiKey(),organizationId:_,veltFolderId:m?.metadata?.veltFolderId,documentId:h}},data:JSON.parse(JSON.stringify(m))})}}}}}}catch(t){this.loggingService.catch("Error in CommentService setCommentCategory: ",t)}})}getCommentCategory(e){try{let t=np(this.functions,rp({url:this.endpointsService.getCloudFunctionUrl("chatgptCompletion"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:12e5}),i=[{role:"system",content:`Identify category of this sentence from these categories, ${Object.keys(this.customCategoryMap)?.join(", ")}:`},{role:"user",content:e}];return yn(t({messages:i,apiKey:this.configService.getApiKey(),sdkVersion:Ib(),sdkType:this.configService.getSdkType(),numResponse:1})).pipe(Te(c=>{if(c?.data){let m=c.data,h=m?.length?m[0]?.content?.trim():void 0;return h&&Object.keys(this.customCategoryMap).includes(h)?this.customCategoryMap[h]:void 0}else return}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentCategory: ",t),Ee(void 0)}}applyListenerVisibilityPostFilter(e,t,a,i){try{let c=Zu(e,{userId:a,tokens:t});i&&(c=fb(c,i));let m=(e||[]).filter(h=>!c.includes(h));return m.length&&this.evictAnnotationsFromLocalCache(m.map(h=>h?.annotationId).filter(h=>!!h)),c}catch(c){return this.loggingService.catch("Error in CommentService applyListenerVisibilityPostFilter: ",c),e}}evictAnnotationsFromLocalCache(e){try{if(!e?.length)return;let t=this.commentAnnotationById$?.value;if(t&&e.some(a=>a in t)){let a=g({},t);e.forEach(i=>{delete a[i]}),this.commentAnnotationById$.next(a)}}catch(t){this.loggingService.catch("Error in CommentService evictAnnotationsFromLocalCache: ",t)}}preserveAccessSentinels(e,t){try{return e&&typeof e=="object"&&t&&typeof t=="object"&&("_setAccessFields"in e&&!("_setAccessFields"in t)&&(t._setAccessFields=e._setAccessFields),"_replaceAccessFields"in e&&!("_replaceAccessFields"in t)&&(t._replaceAccessFields=e._replaceAccessFields)),t}catch(a){return this.loggingService.catch("Error in CommentService preserveAccessSentinels: ",a),t}}applyContextAccessDefaults(e){try{this.handleDirectAccessFieldsAssignment(e?.context)||(e?.context?.access?e.context.accessFields?.length||(e.context.accessFields=Jc(e.context)):jc(e?.context?.accessFields).length>0||(e?.context||(e.context={}),e.context.access={default:"velt"},e.context.accessFields=[...new Set([...e.context.accessFields||[],X.DEFAULT_VELT_CONTEXT])]))}catch(t){this.loggingService.catch("Error in CommentService applyContextAccessDefaults: ",t)}}buildContextAccessFieldsPreservingVisibility(e,t){try{return Ag(e,jc(t))}catch(a){return this.loggingService.catch("Error in CommentService buildContextAccessFieldsPreservingVisibility: ",a),[...t||[]]}}handleDirectAccessFieldsAssignment(e){try{if(!e||typeof e!="object"||!("_setAccessFields"in e)&&!("_replaceAccessFields"in e))return!1;let t=!("_setAccessFields"in e),a=t?e._replaceAccessFields:e._setAccessFields;delete e._setAccessFields,delete e._replaceAccessFields;let i=Array.isArray(a)?a:[];if(!(!t&&Xu(e.access)))return delete e.access,delete e.accessFields,i.length>0&&(e.accessFields=i),!0;let m=i.length>0&&!i.includes(X.DEFAULT_VELT_CONTEXT),h;return m?h=Ag(e,i):this.userPermissionService?.getIsContextEnabled()?h=Ag(e,i):h=[...new Set([...i,...Jc(e)])],h.length>0?e.accessFields=h:delete e.accessFields,!0}catch(t){return this.loggingService.catch("Error in CommentService handleDirectAccessFieldsAssignment: ",t),!1}}updateCommentAnnotationContext(e,t,a){return Ae(this,null,function*(){try{this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_UPDATE_CONTEXT_TRIGGERED,{annotationId:e,context:t,merge:a?.merge});let i=this.authService.getUser(),c=this.docService.getDocumentPaths();if(i&&c?.comment&&e){let m=this.getAnnotationById(e);if(typeof m=="object"&&(m=JSON.parse(JSON.stringify(m))),m||(m=yield this.commonDbService?.getData({feature:"comment",properties:{documentId:c?.documentId??"",organizationId:c?.organizationId??"",id:e}})),m?.annotationId){let h=t,_=JSON.parse(JSON.stringify(m.context||{}));if(a?.merge&&(h=g(g({},_),t),Xu(_?.access)&&t?.access&&typeof t.access=="object"&&!Array.isArray(t.access))){let $=g(g({},_.access),t.access);Object.keys($).forEach(j=>{($[j]===null||$[j]===void 0)&&delete $[j]}),h.access=Object.keys($).length?$:{default:"velt"}}let I=this.handleDirectAccessFieldsAssignment(h);if(h&&"_setVisibilityConfig"in h&&(m.visibilityConfig=h._setVisibilityConfig,delete h._setVisibilityConfig),h&&typeof h=="object"&&!I)if("access"in t)if(t.access!==null&&t.access!==void 0)h.accessFields=this.buildContextAccessFieldsPreservingVisibility(h,_?.accessFields);else{delete h.access;let $=jc(_?.accessFields);$.length?h.accessFields=$:delete h.accessFields}else{if(!a?.merge)for(let $ of x2)!($ in t)&&_?.[$]!==void 0&&(h[$]=_[$]);h.access!==null&&h.access!==void 0&&(h.accessFields=this.buildContextAccessFieldsPreservingVisibility(h,_?.accessFields))}let S={context:JSON.parse(JSON.stringify(h||{}))},H=!1;if(S?.context?.commentType==="manual"&&(S.commentType="manual",S.targetElement=null,m?.targetElement&&(m.targetElement=null,H=!0)),m.context=S.context?an(S.context):S.context,m.contextId=this.generateContextId(m.context),ln(_,h)&&!H)return Promise.resolve("Comment annotation context is already updated.");if(m?.comments?.length){m.lastUpdated=this.timestamp;let $=this.commentAnnotationById$?.value?.[e]?JSON.parse(JSON.stringify({context:this.commentAnnotationById$.value[e].context??null,contextId:this.commentAnnotationById$.value[e].contextId??null,visibilityConfig:this.commentAnnotationById$.value[e].visibilityConfig})):null;this.patchLocalAnnotationContext(e,m);let j=JSON.stringify({context:m.context??null,visibilityConfig:m.visibilityConfig}),{documentId:Z,organizationId:re}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(m);return this.commonDbService.setData({feature:"comment",properties:{id:e,documentId:Z,organizationId:re,metadata:{apiKey:this.configService.getApiKey(),organizationId:re,veltFolderId:m?.metadata?.veltFolderId,documentId:Z}},data:JSON.parse(JSON.stringify(m)),callback:()=>{this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_UPDATE_CONTEXT_SUCCESS,{annotationId:e,context:S?.context,merge:a?.merge})},errorCallback:()=>{try{let se=this.commentAnnotationById$?.value,_e=se?.[e];if(!se||!_e||!$||JSON.stringify({context:_e.context??null,visibilityConfig:_e.visibilityConfig})!==j)return;let he=f(g({},_e),{context:$.context,contextId:$.contextId});$.visibilityConfig===void 0?delete he.visibilityConfig:he.visibilityConfig=$.visibilityConfig,this.commentAnnotationById$.next(f(g({},se),{[e]:he}))}catch(se){this.loggingService.catch("Error reverting optimistic context patch: ",se)}}})}else return this.draftCommentAnnotationsByAnnotationId$.value?.[e]?(this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e]:m})),Promise.resolve("Draft comment annotation context updated.")):(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_UPDATE_CONTEXT_FAILED,{annotationId:e,context:t,merge:a?.merge,error:"Draft comment annotation not found."}),Promise.resolve("Draft comment annotation not found."))}else return this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_UPDATE_CONTEXT_FAILED,{annotationId:e,context:t,merge:a?.merge,error:"Comment annotation not found in database."}),Promise.resolve("Comment annotation not found in database.")}}catch(i){return this.loggingService.catch("Error in CommentService updateCommentAnnotationContext: ",i),Promise.resolve("Error in CommentService updateCommentAnnotationContext.")}})}patchLocalAnnotationContext(e,t){try{let a=this.commentAnnotationById$?.value,i=a?.[e];if(!a||!i)return;let c=g(f(g({},i),{context:t?.context?JSON.parse(JSON.stringify(t.context)):i.context,contextId:t?.contextId??i.contextId}),t?.visibilityConfig!==void 0?{visibilityConfig:JSON.parse(JSON.stringify(t.visibilityConfig))}:{});this.commentAnnotationById$.next(f(g({},a),{[e]:c}))}catch(a){this.loggingService.catch("Error in CommentService patchLocalAnnotationContext: ",a)}}updateComment(e,t,a,i,c,m){this.loggingService.log("%c[WB] Calling FUNCTION: updateComment","color: green;");try{if(this.authService.getUser()&&this.authService.isFeatureAllowed(ke.COMMENT)){if(t&&this.setLocationToCommentAnnotation(e),e?.targetElement?.xpath){let h=this.domService.getXPath(e.targetElement.xpath);if(h){let _=h.iterateNext();_&&(pn(_)||(e.targetElement=null))}}if(e?.type==="multiThread"){let h=JSON.parse(JSON.stringify(e));if(h.position=null,h.ghostComment=null,h?.context&&this.handleDirectAccessFieldsAssignment(h.context),!h?.metadata?.documentId){h?.metadata||(h.metadata={});let S=this.docService.getBaseMetadata("multiThread");h.metadata=g(g({},h?.metadata),S)}let{documentId:_,organizationId:I}=h?.metadata||{};a?this.commonDbService.updateData({feature:"multiThread",properties:{id:h.annotationId,documentId:_,organizationId:I},data:JSON.parse(JSON.stringify(h))}):this.commonDbService.setData({feature:"multiThread",properties:{id:h.annotationId,documentId:_,organizationId:I},data:JSON.parse(JSON.stringify(h))})}else{this.setSubscribedUsersDataInCommentAnnotation(e);let h=JSON.parse(JSON.stringify(e));if(h.position=null,h.ghostComment=null,h.lastUpdated=this.timestamp,h.status||(h.status=this.customFilterService.defaultStatus),delete h.resolved,delete h.inProgress,this.setLocationFromDocumentParams(h),h?.context&&this.handleDirectAccessFieldsAssignment(h.context),h?.annotationId?.startsWith("TEMP_COMPOSER_"))return;let _=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);if(_&&JSON.parse(_).annotationId===h.annotationId&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT),h?.multiThreadAnnotationId&&!c&&this.saveMultiThreadCommentAnnotation(h).then(I=>{}),h?.comments?.length){if(delete h?.isDraft,h?.multiThreadAnnotationId&&this.draftMultiThreadCommentAnnotationsByAnnotationId$.value[h?.multiThreadAnnotationId]&&this.saveMultiThreadCommentAnnotation(h),!h?.metadata?.documentId){h?.metadata||(h.metadata={});let $=this.docService.getBaseMetadata("comment");h.metadata=g(g({},h?.metadata),$)}let{documentId:I,organizationId:S}=h?.metadata||{},H=i?g({annotationData:i?.commentAnnotation,targetAnnotationData:i?.targetComment,actionType:i?.actionType,notificationSource:"comment"},i?.otherFields||{}):null;this.viewsService?.updateCommentAnnotationViews(h),this.commonDbService.setData({feature:"comment",properties:{id:h.annotationId,documentId:I,targetCommentId:m?.commentId,organizationId:S,metadata:{apiKey:this.configService.getApiKey(),organizationId:S,veltFolderId:h?.metadata?.veltFolderId,documentId:I}},extraData:H,data:JSON.parse(JSON.stringify(h)),callback:$=>Ae(this,null,function*(){if(i&&!$?.firestoreAvailable&&this.updateNotificationsDatabase(i.commentAnnotation,i.targetComment,i.actionType,i.otherFields||{}),this.getScreenshotEnabled()&&i?.actionType===Ze.NEWLY_ADDED&&this.captureScreenshot(e),i?.actionType===Ze.NEWLY_ADDED||i?.actionType===Ze.ADDED)try{let j=yield this.metadataService.getGlobalMetadata(),Z={annotationId:h.annotationId,commentAnnotation:this.getCommentAnnotationForClient(h),metadata:j};this.commentActionsService?.triggerAction(lt.COMMENT_SAVED,Z)}catch(j){this.loggingService.catch("Error triggering commentSaved event: ",j)}})})}else this.draftCommentAnnotationsByAnnotationId$.next(f(g({},this.draftCommentAnnotationsByAnnotationId$.value),{[e.annotationId]:h}))}}}catch(h){this.loggingService.catch("Error in CommentService updateComment: ",h)}}captureScreenshot(e){return Ae(this,null,function*(){try{if(this.getScreenshotEnabled()){let a=np(this.functions,rp({url:this.endpointsService.getCloudFunctionUrl("screenshot"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:12e5}),i,c={source:"velt",sourceData:{commentAnnotation:e},eventType:"screenshot"};e?.areaAnnotationId&&(i=this.areaService?.getAnnotationById(e?.areaAnnotationId),i&&(c.sourceData||(c.sourceData={}),c.sourceData.areaAnnotation=i));let m=yield Sb(c,this.authService.getUser()?.userId??"");yield a({veltData:m})}}catch(t){this.loggingService.catch("Error in CommentService captureScreenshot: ",t)}})}getDocumentIdAndOrganizationIdFromCommentAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIdAndOrganizationIdFromCommentAnnotation: ",t),{}}}getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation: ",t),{}}}setLocationFromDocumentParams(e){e?.documentParams&&(e.location=e.documentParams,delete e.documentParams),e?.documentParamsId&&(e.locationId=e.documentParamsId,delete e.documentParamsId)}deleteCommentPinAnnotations(e){return new Promise((t,a)=>Ae(this,null,function*(){try{let i=this.domService.getSelectedAnnotationsMap(),c=this.authService.getUser(),m=[];Object.keys(i).forEach(h=>{let _=i[h];["tag","recorder","rewriter","arrow","area","multiThread"].includes(_.type)||c&&_.from&&(c?.isAdmin||_.from.userId===c.userId)&&m.push(_)}),m?.length?(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_DELETE_TRIGGERED,{triggerType:e,annotationId:m.map(h=>h.annotationId).join(),commentMode:this.getCommentMode()}),this.dialog.open(Yc,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:{title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"}}).afterClosed().pipe(Jn(1)).subscribe(h=>{try{h?(m.forEach(_=>Ae(this,null,function*(){yield this.deleteCommentPinAnnotation(_)})),setTimeout(()=>{document.querySelectorAll(`[${X.SNIPPYLY_HIGHLIGHT}]`).forEach(I=>{this.domService.removeHighlightFromElement(I)}),t()},100)):t()}catch(_){a(_)}},h=>{a(h)})):t(),this.domService.resetSelectedAnnotationsMap(!0,"comment")}catch(i){this.loggingService.catch("Error in CommentService deleteCommentPinAnnotations: ",i),a(i)}}))}deleteCommentPinAnnotation(e,t){return Ae(this,null,function*(){try{if(setTimeout(()=>{if(!this.draftConfirmationPendingAnnotationIds?.has(e?.annotationId)&&this.draftCommentAnnotationsByAnnotationId$?.value?.[e.annotationId]){let a=this.draftCommentAnnotationsByAnnotationId$.value;delete a[e.annotationId],this.draftCommentAnnotationsByAnnotationId$.next(a)}},50),e?.annotationId&&this.pendingAddCommentAnnotationData.delete(e.annotationId),this.authService.isFeatureAllowed(ke.COMMENT))if((t||e.comments?.length)&&this.updateNotificationsDatabase(e,null,Ze.DELETED),e.comments?.forEach(a=>{a.reactionAnnotationIds&&a.reactionAnnotationIds.forEach(i=>{this.deleteReaction(i)})}),e?.annotationId){this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_DELETED,{annotationId:e.annotationId,commentType:this.getCommentType(e),commentMode:this.getCommentMode()});let a=window.localStorage.getItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT);a&&JSON.parse(a).annotationId===e.annotationId&&window.localStorage.removeItem(X.LOCAL_STORAGE.SNIPPYLY_QUEUED_COMMENT),this.areaService?.onDeleteTargetAnnotation(e?.annotationId,e?.areaAnnotationId);let i={type:"delete",annotation:null,targetAnnotationId:e.annotationId};this.commentUpdated$.next(i),e?.multiThreadAnnotationId&&(yield this.removeCommentAnnotationFromMultiThread(e)),this.commentAnnotationDeleted$.next(e);let{documentId:c,organizationId:m}=this.getDocumentIdAndOrganizationIdFromCommentAnnotation(e);if(e?.isDraft)return Promise.resolve();{let h={annotationData:e,targetAnnotationData:null,actionType:Ze.DELETED,notificationSource:"comment",isAnnotationDelete:!0};return this.commonDbService.deleteData({feature:"comment",properties:{id:e.annotationId,documentId:c,organizationId:m,metadata:{apiKey:this.configService.getApiKey(),organizationId:m,veltFolderId:e?.metadata?.veltFolderId,documentId:c}},extraData:h})}}else return Promise.resolve();return Promise.resolve()}catch(a){return this.loggingService.catch("Error in CommentService deleteCommentPinAnnotation: ",a),Promise.resolve()}})}removeCommentAnnotationFromMultiThread(e){return Ae(this,null,function*(){try{let t=e?.multiThreadAnnotationId;if(t){let a=this.docService.getDocumentPaths(),i=this.getMultiThreadAnnotationById(t);if(!i){let _=e?.metadata?.documentId||a?.documentId,I=e?.metadata?.organizationId||a?.organizationId;i=yield this.commonDbService?.getData({feature:"multiThread",properties:{documentId:_,organizationId:I,id:t}})}let c=this.draftMultiThreadCommentAnnotationsByAnnotationId$.value?.[t];i&&delete i?.commentAnnotations?.[e.annotationId],c&&(delete c?.commentAnnotations?.[e.annotationId],Object.keys(c?.commentAnnotations||{}).length===0&&(delete this.draftMultiThreadCommentAnnotationsByAnnotationId$.value?.[t],this.draftMultiThreadCommentAnnotationsByAnnotationId$.next(this.draftMultiThreadCommentAnnotationsByAnnotationId$.value))),delete i.commentAnnotationsMap;let{documentId:m,organizationId:h}=this.getDocumentIdAndOrganizationIdFromMultiThreadCommentAnnotation(i);return Object.keys(i?.commentAnnotations||{}).length===0?(this.areaService?.onDeleteTargetAnnotation(i?.annotationId,i?.areaAnnotationId),this.multiThreadCommentAnnotationDeleted$.next(i),this.commonDbService.deleteData({feature:"multiThread",properties:{id:i?.annotationId,documentId:m,organizationId:h}})):this.commonDbService.setData({feature:"multiThread",properties:{id:i?.annotationId,documentId:m,organizationId:h},data:JSON.parse(JSON.stringify(i))})}}catch(t){this.loggingService.catch("Error in CommentService removeCommentAnnotationFromMultiThread: ",t)}})}getAnnotationById(e,t){try{let a=this.commentAnnotationById$.value?.[e]||this.draftCommentAnnotationsByAnnotationId$?.value?.[e];if(a){let{documentId:i,organizationId:c}=t||{};if(i&&a.metadata?.documentId!==i||c&&a.metadata?.organizationId!==c)return}return a}catch(a){this.loggingService.catch("Error in CommentService getAnnotationById: ",a);return}}getBaseMetadataFromCommentAnnotationId(e){try{let t=this.commentAnnotationById$.value?.[e];if(t)return t.metadata}catch(t){this.loggingService.catch("Error in CommentService getBaseMetadataFromCommentAnnotationId: ",t)}}isCommentAnnotationCacheLoaded(){try{return this.commentAnnotationById$.value!=null}catch(e){return this.loggingService.catch("Error in CommentService isCommentAnnotationCacheLoaded: ",e),!1}}getMultiThreadAnnotationById(e,t){try{let a=this.multiThreadCommentAnnotationById$.value?.[e]||this.draftMultiThreadCommentAnnotationsByAnnotationId$?.value?.[e];if(a){let{documentId:i,organizationId:c}=t||{};if(i&&a.metadata?.documentId!==i||c&&a.metadata?.organizationId!==c)return}return a}catch(a){this.loggingService.catch("Error in CommentService getAnnotationById: ",a);return}}getBaseMetadataFromMultiThreadCommentAnnotationId(e){try{let t=this.multiThreadCommentAnnotationById$.value?.[e];if(t)return t.metadata}catch(t){this.loggingService.catch("Error in CommentService getBaseMetadataFromMultiThreadCommentAnnotationId: ",t)}}getElementRefByAnnotationId(e){try{let t=this.getAnnotationById(e);if(t){let a=t?.targetElement?.xpath;if(a)return{xpath:a}}return}catch(t){this.loggingService.catch("Error in CommentService getElementRefByAnnotationId: ",t);return}}scrollToCommentByAnnotationId(e){try{let t=this.getAnnotationById(e),a=document.getElementById(`comment-pin-container-${e}`);a||(a=document.querySelector(`[data-velt-id='${e}']`)),a||(a=document.querySelector(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.ANNOTATION_ID}="${e}"]`)),a&&(a.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),t&&(this.domService.getSelectedAnnotationsMap()[e]||this.domService.toggleAnnotationSelection(t)))}catch(t){this.loggingService.catch("Error in CommentService scrollToCommentByAnnotationId: ",t)}}selectCommentByAnnotationId(e,t){try{this.loggingService.log("%c[WB] Calling FUNCTION: selectCommentByAnnotationId","color: green;");let a=e?this.getAnnotationById(e):void 0;a?this.domService.toggleAnnotationSelection(a,void 0,void 0,!0):this.domService.resetSelectedAnnotationsMap()}catch(a){this.loggingService.catch("Error in CommentService selectCommentByAnnotationId: ",a)}}enableAddCommentMode(){try{this.authService.isFeatureAllowed(ke.COMMENT)?!this.authService.isPlanExpired()&&this.iamService.hasRoleAny([$v.ADMIN,$v.COMMENTER])?(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ADD_MODE_ENABLED,{commentMode:this.getCommentMode()}),this.addCommentMode$.next(!0)):this.loggingService.catch("Error in CommentService enableAddCommentMode: ","User is not allowed to add comment."):this.loggingService.catch("Error in CommentService enableAddCommentMode: ","Comment feature is not enabled.")}catch(e){this.loggingService.catch("Error in CommentService enableAddCommentMode: ",e)}}disableAddCommentMode(){this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ADD_MODE_DISABLED,{commentMode:this.getCommentMode()}),this.addCommentMode$.next(!1)}addCommentModeChange(){return this.addCommentMode$.asObservable()}setFreeStyleCommentContext(e){try{this.freeStyleCommentContext=e}catch(t){this.loggingService.catch("Error in CommentService setFreeStyleCommentContext: ",t)}}clearFreeStyleCommentContext(){try{this.freeStyleCommentContext=void 0}catch(e){this.loggingService.catch("Error in CommentService resetFreeStyleCommentContext: ",e)}}enablePersistentCommentMode(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{persistentCommentMode:!0}}),this.persistentCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePersistentCommentMode: ",e)}}enableDeleteReplyConfirmation(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteReplyConfirmation:!0}}),this.deleteReplyConfirmation$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteReplyConfirmation: ",e)}}enableSeenByUsers(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{seenByUsers:!0}}),this.seenByUsers$.value===!0)return;this.seenByUsers$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSeenByUsers: ",e)}}disableSeenByUsers(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{seenByUsers:!1}}),this.seenByUsers$.value===!1)return;this.seenByUsers$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSeenByUsers: ",e)}}getSeenByUsers$(){return this.seenByUsers$.asObservable()}disableDeleteReplyConfirmation(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteReplyConfirmation:!1}}),this.deleteReplyConfirmation$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteReplyConfirmation: ",e)}}disablePersistentCommentMode(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{persistentCommentMode:!1}}),this.persistentCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePersistentCommentMode: ",e)}}persistentCommentModeChange(){return this.persistentCommentMode$.asObservable()}enablePersistentModeBanner(){this.persistentModeBanner$.next(!0)}disablePersistentModeBanner(){this.persistentModeBanner$.next(!1)}persistentModeBannerChange(){return this.persistentModeBanner$.asObservable()}setAssignToType(e){try{this.assignToType$.next(e.type)}catch(t){this.loggingService.catch("Error in CommentService setAssignToType: ",t)}}getAssignToType$(){return this.assignToType$.asObservable()}getAssignToType(){return this.assignToType$.value}setPageModeComposerContext(e){try{this.pageModeComposerContext$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setPageModeComposerContext: ",t)}}clearPageModeComposerContext(){try{this.pageModeComposerContext$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearPageModeComposerContext: ",e)}}getPageModeComposerContext$(){return this.pageModeComposerContext$.asObservable()}getPageModeComposerContext(){return this.pageModeComposerContext$.value}enableContextInPageModeComposer(){try{this.contextInPageModeComposer$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableContextInPageModeComposer: ",e)}}disableContextInPageModeComposer(){try{this.contextInPageModeComposer$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableContextInPageModeComposer: ",e)}}getContextInPageModeComposer$(){return this.contextInPageModeComposer$.asObservable()}getContextInPageModeComposer(){return this.contextInPageModeComposer$.value}focusPageModeComposer(){try{this.focusPageModeComposer$.next()}catch(e){this.loggingService.catch("Error in CommentService focusPageModeComposer: ",e)}}getFocusPageModeComposer$(){return this.focusPageModeComposer$.asObservable()}showCommentIndex(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentIndex:e}}),this.showCommentIndex$.value===e)return;this.showCommentIndex$.next(e)}catch(t){this.loggingService.catch("Error in CommentService showCommentIndex: ",t)}}getShowCommentIndex(){return this.showCommentIndex$.asObservable()}enablePopoverMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverMode:!0}}),this.popoverMode$.value===!0)return;this.popoverMode$.next(!0),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_POPOVER_MODE_ENABLED,{commentMode:this.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentService enablePopoverMode: ",e)}}disablePopoverMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverMode:!1}}),this.popoverMode$.value===!1)return;this.popoverMode$.next(!1),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_POPOVER_MODE_DISABLED,{commentMode:this.getCommentMode()})}catch(e){this.loggingService.catch("Error in CommentService disablePopoverMode: ",e)}}getPopoverMode(){try{return this.popoverMode$.value}catch(e){return this.loggingService.catch("Error in CommentService getPopoverMode: ",e),!1}}getPopoverMode$(){return this.popoverMode$.asObservable()}enablePopoverTriangleComponent(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverTriangleComponent:!0}}),this.popoverTriangleComponent$.value===!0)return;this.popoverTriangleComponent$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePopoverTriangleComponent: ",e)}}disablePopoverTriangleComponent(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{popoverTriangleComponent:!1}}),this.popoverTriangleComponent$.value===!1)return;this.popoverTriangleComponent$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePopoverTriangleComponent: ",e)}}getPopoverTriangleComponent(){try{return this.popoverTriangleComponent$.value}catch(e){return this.loggingService.catch("Error in CommentService getPopoverTriangleComponent: ",e),!1}}getPopoverTriangleComponent$(){return this.popoverTriangleComponent$.asObservable()}enableDraftMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftMode:!0}}),this.draftMode$.value===!0)return;this.draftMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDraftMode: ",e)}}disableDraftMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftMode:!1}}),this.draftMode$.value===!1)return;this.draftMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDraftMode: ",e)}}getDraftMode$(){return this.draftMode$.asObservable()}getDraftMode(){return this.draftMode$.value}enableDraftConfirmation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftConfirmation:!0}}),this.draftConfirmation$.value===!0)return;this.draftConfirmation$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDraftConfirmation: ",e)}}disableDraftConfirmation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{draftConfirmation:!1}}),this.draftConfirmation$.value===!1)return;this.draftConfirmation$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDraftConfirmation: ",e)}}getDraftConfirmation$(){return this.draftConfirmation$.asObservable()}getDraftConfirmation(){return this.draftConfirmation$.value}enableTextComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textMode:!0}}),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_TEXT_MODE_ENABLED,{commentMode:this.getCommentMode()}),this.textCommentMode$.value===!0)return;this.textCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextComments: ",e)}}disableTextComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textMode:!1}}),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_TEXT_MODE_DISABLED,{commentMode:this.getCommentMode()}),this.textCommentMode$.value===!1)return;this.textCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextComments: ",e)}}getTextCommentMode$(){return this.textCommentMode$.asObservable()}isUserGlobalContact$(){return this.contactService.isUserGlobalContact$()}isSidebarOpenedByCustomTrigger(){try{return this.sidebarOpenedByCustomTrigger$.value}catch(e){return this.loggingService.catch("Error in CommentService isSidebarOpenedByCustomTrigger: ",e),!1}}setSidebarVisibility(e,t=!1,a=!1){try{this.domService.resetSelectedAnnotationsMap(),e?(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR_V2)||document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR)?this.sidebarVisible$.next(e):this.loggingService.catch("Error in CommentService setSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> or <${X.TAGS.VELT_COMMENTS_SIDEBAR_V2}> tag is not added.`),t&&this.sidebarOpenedByCustomTrigger$.next(!0)):(!this.sidebarOpenedByCustomTrigger$.value||t||a)&&(this.sidebarVisible$.next(e),this.sidebarOpenedByCustomTrigger$.next(!1),this.clearPageModeComposerContext()),e?this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_SIDEBAR_OPENED,{commentMode:this.getCommentMode()}):this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_SIDEBAR_CLOSED,{commentMode:this.getCommentMode()})}catch{this.loggingService.catch("Error in CommentService setSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> tag is not added.`)}}toggleSidebarVisibility(e=!1,t=!1){try{this.domService.resetSelectedAnnotationsMap(),this.sidebarVisible$.value?(!this.sidebarOpenedByCustomTrigger$.value||e||t)&&(this.sidebarVisible$.next(!this.sidebarVisible$.value),this.sidebarOpenedByCustomTrigger$.next(!1),this.sidebarVisible$.value||this.clearPageModeComposerContext()):(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR_V2)||document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR)?(this.sidebarVisible$.next(!this.sidebarVisible$.value),this.sidebarVisible$.value?this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_SIDEBAR_TOGGLED,{commentMode:this.getCommentMode(),action:"closed"}):this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_SIDEBAR_TOGGLED,{commentMode:this.getCommentMode(),action:"opened"})):this.loggingService.catch("Error in CommentService toggleSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> or <${X.TAGS.VELT_COMMENTS_SIDEBAR_V2}> tag is not added.`),e&&this.sidebarOpenedByCustomTrigger$.next(!0))}catch{this.loggingService.catch("Error in CommentService toggleSidebarVisibility: ",`<${X.TAGS.VELT_COMMENTS_SIDEBAR}> tag is not added.`)}}getSidebarVisibility$(){return this.sidebarVisible$.asObservable()}disableFloatingComments(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{floatingCommentDialog:!e}}),this.floatingCommentsEnabled$.value===!e)return;this.floatingCommentsEnabled$.next(!e)}catch(t){this.loggingService.catch("Error in CommentService disableFloatingComments: ",t)}}showFloatingComments$(){return this.floatingCommentsEnabled$.asObservable()}showFloatingComments(){return this.floatingCommentsEnabled$.value}setModeratorMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{moderatorMode:e}}),this.moderatorMode$.value===e)return;this.moderatorMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setModeratorMode: ",t)}}getModeratorMode(){return this.moderatorMode$.value}getModeratorMode$(){return this.moderatorMode$.asObservable()}setStreamMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{streamMode:e}}),this.streamMode$.value===e)return;this.streamMode$.next(e),e?this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_STREAM_MODE_ENABLED,{commentMode:this.getCommentMode()}):this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_STREAM_MODE_DISABLED,{commentMode:this.getCommentMode()})}catch(t){this.loggingService.catch("Error in CommentService setStreamMode: ",t)}}getStreamMode(){return this.streamMode$.value}getStreamMode$(){return this.streamMode$.asObservable()}getEnableDialogOnHover(){return this.enableDialogOnHover$.value}getEnableDialogOnHover$(){return this.enableDialogOnHover$.asObservable()}setEnableDialogOnHover(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogOnHover:e}}),this.enableDialogOnHover$.value===e)return;this.enableDialogOnHover$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableDialogOnHover: ",t)}}getEnableDialogOnTargetElementClick(){return this.enableDialogOnTargetElementClick$.value}getEnableDialogOnTargetElementClick$(){return this.enableDialogOnTargetElementClick$.asObservable()}setEnableDialogOnTargetElementClick(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogOnTargetElementClick:e}}),this.enableDialogOnTargetElementClick$.value===e)return;this.enableDialogOnTargetElementClick$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableDialogOnTargetElementClick: ",t)}}getEnablePriority(){return this.enablePriority$.value}getEnablePriority$(){return this.enablePriority$.asObservable()}setEnablePriority(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{priority:e}}),this.enablePriority$.value===e)return;this.enablePriority$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnablePriority: ",t)}}getEnableStatus(){return this.enableStatus$.value}getEnableStatus$(){return this.enableStatus$.asObservable()}setEnableStatus(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{status:e}}),this.getEnableStatus()===e)return;this.enableStatus$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableStatus: ",t)}}getEnableVisibilityOptions(){return this.visibilityOptions$.value}getEnableVisibilityOptions$(){return this.visibilityOptions$.asObservable()}setEnableVisibilityOptions(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{visibilityOptions:e}}),this.visibilityOptions$.value===e)return;this.visibilityOptions$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableVisibilityOptions: ",t)}}getEnableResolve(){return this.enableResolve$.value}getEnableResolve$(){return this.enableResolve$.asObservable()}setEnableResolve(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveButton:e}}),this.getEnableResolve()===e)return;this.enableResolve$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableResolve: ",t)}}getEnableGhostComments(){return this.enableGhostComments$.value}getEnableGhostComments$(){return this.enableGhostComments$.asObservable()}enableGhostComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostComments:!0}}),this.enableGhostComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableGhostComments: ",e)}}disableGhostComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostComments:!1}}),this.enableGhostComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableGhostComments: ",e)}}getEnableGhostCommentsMessage(){return this.enableGhostCommentsMessage$.value}getEnableGhostCommentsMessage$(){return this.enableGhostCommentsMessage$.asObservable()}enableGhostCommentsMessage(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostCommentsIndicator:!0}}),this.enableGhostCommentsMessage$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowGhostCommentsMessage: ",e)}}disableGhostCommentsMessage(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{ghostCommentsIndicator:!1}}),this.enableGhostCommentsMessage$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowGhostCommentsMessage: ",e)}}enableInboxMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inboxMode:!0}}),this.inboxMode$.value===!0)return;this.inboxMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableInboxMode: ",e)}}disableInboxMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inboxMode:!1}}),this.inboxMode$.value===!1)return;this.inboxMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableInboxMode: ",e)}}getInboxMode(){return this.inboxMode$.value}getInboxMode$(){return this.inboxMode$.asObservable()}setEnableAutoCategorize(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{autoCategorize:e}}),this.enableAutoCategorize$.value===e)return;this.enableAutoCategorize$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEnableAutoCategorize: ",t)}}getEnableAutoCategorize(){return this.enableAutoCategorize$.value}getEnableAutoCategorize$(){return this.enableAutoCategorize$.asObservable()}setCommentContainerDarkMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{darkMode:e}}),this.commentContainerDarkMode$.value===e)return;this.commentContainerDarkMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentContainerDarkMode: ",t)}}getCommentContainerDarkMode(){return this.commentContainerDarkMode$.asObservable()}getSuggestionMode(){return this.suggestionMode$.value}getSuggestionMode$(){return this.suggestionMode$.asObservable()}setSuggestionMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{suggestionMode:e}}),this.getSuggestionMode()===e)return;this.suggestionMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setSuggestionMode: ",t)}}getMobileMode(){return this.mobileMode$.value}getMobileMode$(){return this.mobileMode$.asObservable()}setMobileMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{mobileMode:e}}),this.getMobileMode()===e)return;this.mobileMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setMobileMode: ",t)}}enableInlineCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inlineCommentMode:!0}}),this.inlineCommentMode$.value===!0)return;this.inlineCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableInlineCommentMode: ",e)}}disableInlineCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{inlineCommentMode:!1}}),this.inlineCommentMode$.value===!1)return;this.inlineCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableInlineCommentMode: ",e)}}getInlineCommentMode(){return this.inlineCommentMode$.value}getInlineCommentMode$(){return this.inlineCommentMode$.asObservable()}enableMinimap(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{minimap:!0}}),this.minimap$.value===!0)return;this.minimap$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableMinimap: ",e)}}disableMinimap(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{minimap:!1}}),this.minimap$.value===!1)return;this.minimap$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableMinimap: ",e)}}getMinimap(){return this.minimap$.value}getMinimap$(){return this.minimap$.asObservable()}showCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentsOnDom:!0}}),this.commentsOnDom$.value===!0)return;this.commentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService showCommentsOnDom: ",e)}}hideCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentsOnDom:!1}}),this.commentsOnDom$.value===!1)return;this.commentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService hideCommentsOnDom: ",e)}}getCommentsOnDom(){return this.commentsOnDom$.value}getCommentsOnDom$(){return this.commentsOnDom$.asObservable()}enableCommentTool(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentTool:!0}}),this.commentToolEnabled$.value===!0)return;this.commentToolEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCommentTool: ",e)}}disableCommentTool(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentTool:!1}}),this.commentToolEnabled$.value===!1)return;this.commentToolEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCommentTool: ",e)}}getCommentTool(){return this.commentToolEnabled$.value}getCommentTool$(){return this.commentToolEnabled$.asObservable()}setTotalMediaLength(e){try{if(this.totalMediaLength$.value===e)return;this.totalMediaLength$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setTotalMediaLength: ",t)}}getTotalMediaLength(){return this.totalMediaLength$.value}getTotalMediaLength$(){return this.totalMediaLength$.asObservable()}enableSidebarUrlNavigation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarUrlNavigation:!0}}),this.sidebarUrlNavigationEnabled$.value===!0)return;this.sidebarUrlNavigationEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarUrlNavigation: ",e)}}disableSidebarUrlNavigation(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarUrlNavigation:!1}}),this.sidebarUrlNavigationEnabled$.value===!1)return;this.sidebarUrlNavigationEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarUrlNavigation: ",e)}}getSidebarUrlNavigation(){return this.sidebarUrlNavigationEnabled$.value}getSidebarUrlNavigation$(){return this.sidebarUrlNavigationEnabled$.asObservable()}setDetectionStrategy(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{detectionStrategy:e}}),this.detectionStrategy$.value===e)return;this.detectionStrategy$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setDetectionStrategy: ",t)}}getDetectionStrategy(){return this.detectionStrategy$.value}getDetectionStrategy$(){return this.detectionStrategy$.asObservable()}enableSidebarButtonOnCommentDialog(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonOnCommentDialog:!0}}),this.sidebarButtonOnCommentDialogVisible$.value===!0)return;this.sidebarButtonOnCommentDialogVisible$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarButtonOnCommentDialog: ",e)}}disableSidebarButtonOnCommentDialog(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonOnCommentDialog:!1}}),this.sidebarButtonOnCommentDialogVisible$.value===!1)return;this.sidebarButtonOnCommentDialogVisible$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarButtonOnCommentDialog: ",e)}}getSidebarButtonOnCommentDialogVisibility(){return this.sidebarButtonOnCommentDialogVisible$.value}getSidebarButtonOnCommentDialogVisibility$(){return this.sidebarButtonOnCommentDialogVisible$.asObservable()}onSidebarButtonOnCommentDialogClick(){this.sidebarButtonOnCommentDialogClick$.next()}getSidebarButtonOnCommentDialogClick$(){return this.sidebarButtonOnCommentDialogClick$.asObservable()}enableDeviceIndicatorOnCommentPins(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceIndicatorOnCommentPins:!0}}),this.deviceIndicatorOnCommentPins$.value===!0)return;this.deviceIndicatorOnCommentPins$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeviceIndicatorOnCommentPins: ",e)}}disableDeviceIndicatorOnCommentPins(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceIndicatorOnCommentPins:!1}}),this.deviceIndicatorOnCommentPins$.value===!1)return;this.deviceIndicatorOnCommentPins$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeviceIndicatorOnCommentPins: ",e)}}getDeviceIndicatorOnCommentPins(){return this.deviceIndicatorOnCommentPins$.value}getDeviceIndicatorOnCommentPins$(){return this.deviceIndicatorOnCommentPins$.asObservable()}onSidebarCommentClick(e){this.sidebarCommentClick$.next(e)}getSidebarCommentClick$(){return this.sidebarCommentClick$.asObservable()}onCommentNavigationButtonClick(e){this.commentNavigationButtonClick$.next(e)}getCommentNavigationButtonClick$(){return this.commentNavigationButtonClick$.asObservable()}addBubbleCommentAnnotationIds(e){try{let a=[...this.bubbleCommentAnnotationIds$.value||[],...e],i=[...new Set(a)];this.bubbleCommentAnnotationIds$.next(i)}catch(t){this.loggingService.catch("Error in CommentService addBubbleCommentAnnotationIds: ",t)}}getBubbleCommentAnnotationIds(){return this.bubbleCommentAnnotationIds$.value}getBubbleCommentAnnotationIds$(){return this.bubbleCommentAnnotationIds$.asObservable()}removeBubbleCommentAnnotationIds(e){try{let a=(this.bubbleCommentAnnotationIds$.value||[]).filter(i=>!e.includes(i));this.bubbleCommentAnnotationIds$.next(a)}catch(t){this.loggingService.catch("Error in CommentService removeBubbleCommentAnnotationIds: ",t)}}enableSignInButton(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{signInButton:e}}),this.enableSignInButton$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableSignInButton: ",t)}}getSignInButton(){return this.enableSignInButton$.value}getSignInButton$(){return this.enableSignInButton$.asObservable()}onSignInClick(){this.onSignInClick$.next()}getSignInButtonClick$(){return this.onSignInClick$.asObservable()}enableUpgradeButton(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{upgradeButton:e}}),this.enableUpgradeButton$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableUpgradeButton: ",t)}}getUpgradeButton(){return this.enableUpgradeButton$.value}getUpgradeButton$(){return this.enableUpgradeButton$.asObservable()}onUpgradeClick(){this.onUpgradeClick$.next()}getUpgradeButtonClick$(){return this.onUpgradeClick$.asObservable()}openSidebar(){this.openSidebar$.next()}getOpenSidebar$(){return this.openSidebar$.asObservable()}enableAttachment(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachments:e}}),this.enableAttachment$.value===e)return;this.enableAttachment$.next(e)}catch(t){this.loggingService.catch("Error in CommentService enableAttachment: ",t)}}getEnableAttachment$(){return this.enableAttachment$.asObservable()}enableAttachmentDownload(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentDownload:!0}}),this.enableAttachmentDownload$.value===!0)return;this.enableAttachmentDownload$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAttachmentDownload: ",e)}}disableAttachmentDownload(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentDownload:!1}}),this.enableAttachmentDownload$.value===!1)return;this.enableAttachmentDownload$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAttachmentDownload: ",e)}}getEnableAttachmentDownload$(){return this.enableAttachmentDownload$.asObservable()}getEnableAttachmentDownload(){return this.enableAttachmentDownload$.value}enableFormatOptions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatOptions:!0}}),this.enableFormatOptions$.value===!0)return;this.enableFormatOptions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFormatOptions: ",e)}}disableFormatOptions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatOptions:!1}}),this.enableFormatOptions$.value===!1)return;this.enableFormatOptions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFormatOptions: ",e)}}getEnableFormatOptions$(){return this.enableFormatOptions$.asObservable()}setFormatConfig(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{formatConfig:e}}),this.formatConfig$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setFormatConfig: ",t)}}getFormatConfig$(){return this.formatConfig$.asObservable()}setAllowedRecordings(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordings:e}}),e?.includes("all")?this.allowedRecordings$.next(["audio","video","screen"]):e?.includes("none")?this.allowedRecordings$.next([]):this.allowedRecordings$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setAllowedRecordings: ",t)}}getAllowedRecordings(){return this.allowedRecordings$.value}getAllowedRecordings$(){return this.allowedRecordings$.asObservable()}enableReactions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{reactions:!0}}),this.enableReactions$.value===!0)return;this.enableReactions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReactions: ",e)}}disableReactions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{reactions:!1}}),this.enableReactions$.value===!1)return;this.enableReactions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReactions: ",e)}}getEnableReactions(){return this.enableReactions$.value}getEnableReactions$(){return this.enableReactions$.asObservable()}enableAnonymousEmail(){try{if(this.enableAnonymousEmail$.value===!0)return;this.enableAnonymousEmail$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAnonymousEmail: ",e)}}disableAnonymousEmail(){try{if(this.enableAnonymousEmail$.value===!1)return;this.enableAnonymousEmail$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAnonymousEmail: ",e)}}getEnableAnonymousEmail(){return this.enableAnonymousEmail$.value}getEnableAnonymousEmail$(){return this.enableAnonymousEmail$.asObservable()}addCommentOnElement(e){this.addComment(void 0,void 0,void 0,e)}enablePrivateCommentMode(){return Ae(this,null,function*(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateCommentMode:!0}}),this.privateCommentMode$.value===!0)return;this.isPrivateCommentAllowed$().pipe(Jn(1)).subscribe(e=>{e?(this.privateCommentMode$.next(!0),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_PRIVATE_COMMENT_MODE_ENABLED)):this.loggingService.logsEnabled&&console.warn("You are not allowed to enable private comment mode.")})}catch(e){this.loggingService.catch("Error in CommentService enablePrivateCommentMode: ",e)}})}disablePrivateCommentMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateCommentMode:!1}}),this.privateCommentMode$.value===!1)return;this.privateCommentMode$.next(!1),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_PRIVATE_COMMENT_MODE_DISABLED)}catch(e){this.loggingService.catch("Error in CommentService disablePrivateCommentMode: ",e)}}getPrivateCommentMode(){return this.privateCommentMode$.value}getPrivateCommentMode$(){return this.privateCommentMode$.asObservable()}isPrivateCommentAllowed(){return this.privateCommentAllowed$.value}isPrivateCommentAllowed$(){return this.privateCommentAllowed$.asObservable()}enablePrivateMode(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateModeConfig:e}}),!e?.type){this.loggingService.catch("enablePrivateMode: type is required in config");return}this.privateModeConfig$.next(g({},e))}catch(t){this.loggingService.catch("Error in CommentService enablePrivateMode: ",t)}}disablePrivateMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{privateModeConfig:null}}),this.privateModeConfig$.value===null)return;this.privateModeConfig$.next(null)}catch(e){this.loggingService.catch("Error in CommentService disablePrivateMode: ",e)}}getPrivateModeConfig(){return this.privateModeConfig$.value}getPrivateModeConfig$(){return this.privateModeConfig$.asObservable()}enableScrollToComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{scrollToComment:!0}}),this.scrollToComment$.value===!0)return;this.scrollToComment$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableScrollToComment: ",e)}}disableScrollToComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{scrollToComment:!1}}),this.scrollToComment$.value===!1)return;this.scrollToComment$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableScrollToComment: ",e)}}getScrollToComment(){return this.scrollToComment$.value}getScrollToComment$(){return this.scrollToComment$.asObservable()}showScreenSizeInfo(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deviceInfo:e}}),this.showScreenSizeInfo$.value===e)return;this.showScreenSizeInfo$.next(e)}catch(t){this.loggingService.catch("Error in CommentService showScreenSizeInfo: ",t)}}getShowScreenSizeInfo$(){return this.showScreenSizeInfo$.asObservable()}enableUserMentions(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableUserMentions","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{userMentions:!0}}),this.userMentions$.value===!0)return;this.userMentions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableUserMentions: ",e)}}disableUserMentions(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableUserMentions","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{userMentions:!1}}),this.userMentions$.value===!1)return;this.userMentions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableUserMentions: ",e)}}getUserMentions(){return this.userMentions$.value}getUserMentions$(){return this.userMentions$.asObservable()}enablePaginatedContactList(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePaginatedContactList","color: green;"),this.paginatedContactList$.value===!0)return;this.paginatedContactList$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePaginatedContactList: ",e)}}disablePaginatedContactList(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePaginatedContactList","color: green;"),this.paginatedContactList$.value===!1)return;this.paginatedContactList$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePaginatedContactList: ",e)}}getPaginatedContactList(){return this.paginatedContactList$.value}getPaginatedContactList$(){return this.paginatedContactList$.asObservable()}enableDeleteOnBackspace(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDeleteOnBackspace","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteOnBackspace:!0}}),this.deleteOnBackspace$.value===!0)return;this.deleteOnBackspace$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteOnBackspace: ",e)}}disableDeleteOnBackspace(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDeleteOnBackspace","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteOnBackspace:!1}}),this.deleteOnBackspace$.value===!1)return;this.deleteOnBackspace$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteOnBackspace: ",e)}}getDeleteOnBackspace(){return this.deleteOnBackspace$.value}getDeleteOnBackspace$(){return this.deleteOnBackspace$.asObservable()}enableHotkey(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableHotkey","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{hotkey:!0}}),this.hotkeyEnabled$.value===!0)return;this.hotkeyEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableHotkey: ",e)}}disableHotkey(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableHotkey","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{hotkey:!1}}),this.hotkeyEnabled$.value===!1)return;this.hotkeyEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableHotkey: ",e)}}enableRecordingSummary(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableRecordingSummary","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingSummary:!0}}),this.recordingSummaryEnabled$.value===!0)return;this.recordingSummaryEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableRecordingSummary: ",e)}}disableRecordingSummary(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableRecordingSummary","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingSummary:!1}}),this.recordingSummaryEnabled$.value===!1)return;this.recordingSummaryEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableRecordingSummary: ",e)}}getRecordingSummaryEnabled(){return this.recordingSummaryEnabled$.value}getRecordingSummaryEnabled$(){return this.recordingSummaryEnabled$.asObservable()}setUnreadIndicatorMode(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: setUnreadIndicatorMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{unreadIndicatorMode:e}}),this.unreadIndicatorMode$.value===e)return;this.unreadIndicatorMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setUnreadIndicatorMode: ",t)}}getUnreadIndicatorMode(){return this.unreadIndicatorMode$.value}getUnreadIndicatorMode$(){return this.unreadIndicatorMode$.asObservable()}setComposerMode(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: setComposerMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{composerMode:e}}),this.composerMode$.value===e)return;this.composerMode$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setComposerMode: ",t)}}getComposerMode(){return this.composerMode$.value}getComposerMode$(){return this.composerMode$.asObservable()}enableEnterKeyToSubmit(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableEnterKeyToSubmit","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{enterKeyToSubmit:!0}}),this.enterKeyToSubmit$.value===!0)return;this.enterKeyToSubmit$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableEnterKeyToSubmit: ",e)}}disableEnterKeyToSubmit(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableEnterKeyToSubmit","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{enterKeyToSubmit:!1}}),this.enterKeyToSubmit$.value===!1)return;this.enterKeyToSubmit$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableEnterKeyToSubmit: ",e)}}getEnterKeyToSubmit(){return this.enterKeyToSubmit$.value}getEnterKeyToSubmit$(){return this.enterKeyToSubmit$.asObservable()}enablePinShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePinShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinShadowDom:!0}}),this.pinShadowDOM$.value===!0)return;this.pinShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinShadowDOM: ",e)}}disablePinShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePinShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinShadowDom:!1}}),this.pinShadowDOM$.value===!1)return;this.pinShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinShadowDOM: ",e)}}getPinShadowDOM(){return this.pinShadowDOM$.value}getPinDarkMode(){return this.pinDarkMode$.value}getPinDarkMode$(){return this.pinDarkMode$.asObservable()}getTextCommentToolDarkMode(){return this.textCommentToolDarkMode$.value}getTextCommentToolDarkMode$(){return this.textCommentToolDarkMode$.asObservable()}getTextCommentToolbarDarkMode(){return this.textCommentToolbarDarkMode$.value}getTextCommentToolbarDarkMode$(){return this.textCommentToolbarDarkMode$.asObservable()}getPinShadowDOM$(){return this.pinShadowDOM$.asObservable()}getTextCommentToolShadowDOM$(){return this.textCommentToolShadowDOM$.asObservable()}getTextCommentToolbarShadowDOM$(){return this.textCommentToolbarShadowDOM$.asObservable()}enableDialogShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDialogShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogShadowDom:!0}}),this.dialogShadowDOM$.value===!0)return;this.dialogShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDialogShadowDOM: ",e)}}enableTextCommentToolbarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolbarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarShadowDom:!0}}),this.textCommentToolbarShadowDOM$.value===!0)return;this.textCommentToolbarShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolbarShadowDOM: ",e)}}disableTextCommentToolbarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolbarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarShadowDom:!1}}),this.textCommentToolbarShadowDOM$.value===!1)return;this.textCommentToolbarShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolbarShadowDOM: ",e)}}enableTextCommentToolShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolShadowDom:!0}}),this.textCommentToolShadowDOM$.value===!0)return;this.textCommentToolShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolShadowDOM: ",e)}}disableTextCommentToolShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolShadowDom:!1}}),this.textCommentToolShadowDOM$.value===!1)return;this.textCommentToolShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolShadowDOM: ",e)}}enableTextCommentToolDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolDarkMode:!0}}),this.textCommentToolDarkMode$.value===!0)return;this.textCommentToolDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolDarkMode: ",e)}}disableTextCommentToolDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolDarkMode:!1}}),this.textCommentToolDarkMode$.value===!1)return;this.textCommentToolDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolDarkMode: ",e)}}enableTextCommentToolbarDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableTextCommentToolbarDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarDarkMode:!0}}),this.textCommentToolbarDarkMode$.value===!0)return;this.textCommentToolbarDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableTextCommentToolbarDarkMode: ",e)}}disableTextCommentToolbarDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableTextCommentToolbarDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{textCommentToolbarDarkMode:!1}}),this.textCommentToolbarDarkMode$.value===!1)return;this.textCommentToolbarDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableTextCommentToolbarDarkMode: ",e)}}enablePinDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enablePinDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDarkMode:!0}}),this.pinDarkMode$.value===!0)return;this.pinDarkMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinDarkMode: ",e)}}disablePinDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disablePinDarkMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDarkMode:!1}}),this.pinDarkMode$.value===!1)return;this.pinDarkMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinDarkMode: ",e)}}disableDialogShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDialogShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{dialogShadowDom:!1}}),this.dialogShadowDOM$.value===!1)return;this.dialogShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDialogShadowDOM: ",e)}}getDialogShadowDOM(){return this.dialogShadowDOM$.value}getDialogShadowDOM$(){return this.dialogShadowDOM$.asObservable()}setDialogShadowDOMExplicit(e){this.dialogShadowDOMExplicit$.next(e)}getDialogShadowDOMExplicit$(){return this.dialogShadowDOMExplicit$.asObservable()}enableSidebarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableSidebarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarShadowDOM:!0}}),this.sidebarShadowDOM$.value===!0)return;this.sidebarShadowDOM$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarShadowDOM: ",e)}}disableSidebarShadowDOM(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableSidebarShadowDOM","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarShadowDOM:!1}}),this.sidebarShadowDOM$.value===!1)return;this.sidebarShadowDOM$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarShadowDOM: ",e)}}getSidebarShadowDOM(){return this.sidebarShadowDOM$.value}getSidebarShadowDOM$(){return this.sidebarShadowDOM$.asObservable()}enableChangeDetectionInCommentMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableChangeDetectionInCommentMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{changeDetectionInCommentMode:!0}}),this.changeDetectionInCommentMode$.value===!0)return;this.changeDetectionInCommentMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableChangeDetectionInCommentMode: ",e)}}disableChangeDetectionInCommentMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableChangeDetectionInCommentMode","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{changeDetectionInCommentMode:!1}}),this.changeDetectionInCommentMode$.value===!1)return;this.changeDetectionInCommentMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableChangeDetectionInCommentMode: ",e)}}getChangeDetectionInCommentMode(){return this.changeDetectionInCommentMode$.value}getChangeDetectionInCommentMode$(){return this.changeDetectionInCommentMode$.asObservable()}showResolvedCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolvedCommentsOnDom:!0}}),this.resolvedCommentsOnDom$.value===!0)return;this.resolvedCommentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService showResolvedCommentsOnDom: ",e)}}hideResolvedCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolvedCommentsOnDom:!1}}),this.resolvedCommentsOnDom$.value===!1)return;this.resolvedCommentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService hideResolvedCommentsOnDom: ",e)}}getResolvedCommentsOnDom(){return this.resolvedCommentsOnDom$.value}enableLazyLoadResolvedComments(){try{this.installLazyLoadResolvedCommentsProvider();let e=Xg(this.documentPaths);if(e&&this.resolvedUnlockedDocumentKey===e){this.loggingService.catch("[lazyLoadResolvedComments] enabled, but resolved comments were already unlocked this session; takes effect on the next page load.",null,void 0,!0),this.lazyLoadResolvedComments$.next(!0);return}if(this.lazyLoadResolvedComments$.value===!0)return;this.lazyLoadResolvedComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableLazyLoadResolvedComments: ",e)}}disableLazyLoadResolvedComments(){try{if(this.lazyLoadResolvedComments$.value===!1)return;this.lazyLoadResolvedComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableLazyLoadResolvedComments: ",e)}}isResolvedUnlockedForCurrentDocument(){try{let e=Xg(this.documentPaths);return!!e&&this.resolvedUnlockedDocumentKey===e}catch(e){return this.loggingService.catch("Error in CommentService isResolvedUnlockedForCurrentDocument: ",e),!0}}getLazyLoadResolvedComments(){return this.lazyLoadResolvedComments$.value}installLazyLoadResolvedCommentsProvider(){try{this.customFilterService?.setLazyLoadResolvedCommentsProvider?.(()=>this.lazyLoadResolvedComments$.value)}catch(e){this.loggingService.catch("Error in CommentService installLazyLoadResolvedCommentsProvider: ",e)}}publishResolvedIntent(e){try{this.resolvedIntentFromSidebar$.next(!!e)}catch(t){this.loggingService.catch("Error in CommentService publishResolvedIntent: ",t)}}getResolvedCommentsOnDom$(){return this.resolvedCommentsOnDom$.asObservable()}enableBubbleOnPin(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPin:!0}}),this.bubbleOnPinEnabled$.value===!0)return;this.bubbleOnPinEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableBubbleOnPin: ",e)}}disableBubbleOnPin(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPin:!1}}),this.bubbleOnPinEnabled$.value===!1)return;this.bubbleOnPinEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableBubbleOnPin: ",e)}}getBubbleOnPin(){return this.bubbleOnPinEnabled$.value}getBubbleOnPin$(){return this.bubbleOnPinEnabled$.asObservable()}enableBubbleOnPinHover(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPinHover:!0}}),this.bubbleOnPinHoverEnabled$.value===!0)return;this.bubbleOnPinHoverEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableBubbleOnPinHover: ",e)}}disableBubbleOnPinHover(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{bubbleOnPinHover:!1}}),this.bubbleOnPinHoverEnabled$.value===!1)return;this.bubbleOnPinHoverEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableBubbleOnPinHover: ",e)}}getBubbleOnPinHover(){return this.bubbleOnPinHoverEnabled$.value}getBubbleOnPinHover$(){return this.bubbleOnPinHoverEnabled$.asObservable()}enablePinDrag(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDrag:!0}}),this.pinDragEnabled$.value===!0)return;this.pinDragEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enablePinDrag: ",e)}}disablePinDrag(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{pinDrag:!1}}),this.pinDragEnabled$.value===!1)return;this.pinDragEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disablePinDrag: ",e)}}getPinDrag(){return this.pinDragEnabled$.value}getPinDrag$(){return this.pinDragEnabled$.asObservable()}setExcludeLocationIdsFromSidebar(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{excludeLocationIdsFromSidebar:e}}),this.excludeLocationIdsFromSidebar$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setExcludeLocationIdsFromSidebar: ",t)}}getExcludeLocationIdsFromSidebar(){return this.excludeLocationIdsFromSidebar$.value}getExcludeLocationIdsFromSidebar$(){return this.excludeLocationIdsFromSidebar$.asObservable()}enableMultiThread(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{multiThread:!0}}),this.multiThread$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableMultiThread: ",e)}}disableMultiThread(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{multiThread:!1}}),this.multiThread$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableMultiThread: ",e)}}getMultiThread(){return this.multiThread$.value}getMultiThread$(){return this.multiThread$.asObservable()}enableGroupMatchedComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{groupMatchedComments:!0}}),this.groupMatchedComments$.value===!0)return;this.groupMatchedComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableGroupMatchedComments: ",e)}}disableGroupMatchedComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{groupMatchedComments:!1}}),this.groupMatchedComments$.value===!1)return;this.groupMatchedComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableGroupMatchedComments: ",e)}}getGroupMatchedComments(){return this.groupMatchedComments$.value}getGroupMatchedComments$(){return this.groupMatchedComments$.asObservable()}enableRestrictTextSearchToAnchor(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{restrictTextSearchToAnchor:!0}}),this.restrictTextSearchToAnchor$.value===!0)return;this.restrictTextSearchToAnchor$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableRestrictTextSearchToAnchor: ",e)}}disableRestrictTextSearchToAnchor(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{restrictTextSearchToAnchor:!1}}),this.restrictTextSearchToAnchor$.value===!1)return;this.restrictTextSearchToAnchor$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableRestrictTextSearchToAnchor: ",e)}}getRestrictTextSearchToAnchor(){return this.restrictTextSearchToAnchor$.value}getRestrictTextSearchToAnchor$(){return this.restrictTextSearchToAnchor$.asObservable()}enableShortUserName(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableShortUserName","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{shortUserName:!0}}),this.shortUserName$.value===!0)return;this.shortUserName$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShortUserName: ",e)}}disableShortUserName(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableShortUserName","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{shortUserName:!1}}),this.shortUserName$.value===!1)return;this.shortUserName$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShortUserName: ",e)}}getShortUserName(){return this.shortUserName$.value}getShortUserName$(){return this.shortUserName$.asObservable()}enableRecordingCountdown(){try{this.loggingService.log("%c[WB] Calling FUNCTION: enableRecordingCountdown","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingCountdown:!0}}),this.serviceBook.get(dn)?.enableRecordingCountdown()}catch(e){this.loggingService.catch("Error in CommentService enableRecordingCountdown: ",e)}}disableRecordingCountdown(){try{this.loggingService.log("%c[WB] Calling FUNCTION: disableRecordingCountdown","color: green;"),this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{recordingCountdown:!1}}),this.serviceBook.get(dn)?.disableRecordingCountdown()}catch(e){this.loggingService.catch("Error in CommentService disableRecordingCountdown: ",e)}}setCommentSidebarFilters(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommentSidebarFilters","color: green;"),this.commentSidebarFilters$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentSidebarFilters: ",t)}}getCommentSidebarFilters(){return this.commentSidebarFilters$.value??{}}getCommentSidebarFilters$(){return this.commentSidebarFilters$.asObservable()}setEffectiveSidebarFilters(e){try{this.effectiveSidebarFilters$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEffectiveSidebarFilters: ",t)}}getEffectiveSidebarFilters$(){return this.effectiveSidebarFilters$.asObservable()}setCommentSidebarSystemFiltersOperator(e){try{this.commentSidebarSystemFiltersOperator$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentSidebarSystemFiltersOperator: ",t)}}getCommentSidebarSystemFiltersOperator(){return this.commentSidebarSystemFiltersOperator$.value}getCommentSidebarSystemFiltersOperator$(){return this.commentSidebarSystemFiltersOperator$.asObservable()}enableCommentPinHighlighter(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentPinHighlighter:!0}}),this.domService.enableCommentPinHighlighter()}catch(e){this.loggingService.catch("Error in CommentService enableCommentPinHighlighter: ",e)}}disableCommentPinHighlighter(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentPinHighlighter:!1}}),this.domService.disableCommentPinHighlighter()}catch(e){this.loggingService.catch("Error in CommentService disableCommentPinHighlighter: ",e)}}setCustomReactions(e){try{this.reactionService?.setCustomReactions(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomReactions: ",t)}}onCommentSelectionChange$(){return this.commentSelectionChange$.asObservable()}onVisibilityOptionClicked$(){return this.visibilityOptionClicked$.asObservable()}emitVisibilityOptionClicked(e){this.visibilityOptionClicked$.next(e)}onCommentAdd$(){return this.commentAdded$.asObservable()}onCommentUpdate$(){return this.commentUpdated$.asObservable()}onCommentAnnotationDelete$(){return this.commentAnnotationDeleted$.asObservable()}onMultiThreadCommentAnnotationDelete$(){return this.multiThreadCommentAnnotationDeleted$.asObservable()}getCommentMode(){try{let e="freestyle";return this.getStreamMode()?e="stream":this.getPopoverMode()&&(e="popover"),e}catch(e){return this.loggingService.catch("Error in CommentService getCommentMode: ",e),"freestyle"}}getCommentType(e){try{return e.targetElement?"element":e.targetTextRange?"text":e.areaAnnotationId?"area":""}catch(t){return this.loggingService.catch("Error in CommentService getCommentType: ",t),""}}getCommentAnnotationAvailableOnXPath(e,t,a){try{return this.commentAnnotationById$.pipe(Pe(()=>this.draftCommentAnnotationsByAnnotationId$),Pe(i=>(!a&&t&&(a=Wr(t,["id","data-id"])),Ee(f(g({},i),{element:a})))),Pe(i=>this.getLocations$().pipe(Te(c=>f(g({},i),{locationIds:c})))),Te(({locationIds:i,element:c})=>{let m=[],h=this.docService.getDocumentPaths();if(h?.documentId){let _=this.docService.getAdditionalDocumentIdFromElement(c),I=_?this.docService.generateDocumentId(_):h?.documentId,S=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:h?.organizationId,documentId:I||""});if(S)for(let H of S)(t&&H?.targetElementId===t||H?.targetElement?.xpath===e)&&i?.includes(H?.locationId)&&m.push(H)}return m.length?m:null}))}catch(i){return this.loggingService.catch("Error in CommentService isCommentAnnotationAvailableOnXPath: ",i),Ee(null)}}getCommentAnnotationsByContext({context:e,contextOptions:t,element:a,clientDocumentId:i}){try{return this.commentAnnotationById$.pipe(Pe(()=>this.draftCommentAnnotationsByAnnotationId$),Pe(()=>this.docService.getDocumentPaths$()),Te(()=>{let c=null,m=this.docService.getDocumentPaths(),h=an(e),_=this.generateContextId(h);if(m?.documentId){let I=i||this.docService.getAdditionalDocumentIdFromElement(a??null),S=I?this.docService.generateDocumentId(I):m?.documentId,H=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:m?.organizationId,documentId:S||""});if(H){c=[];for(let $ of H)t?.partialMatch?kb($?.context,h)&&c.push($):_&&$?.contextId===_&&c.push($)}}return c}))}catch(c){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByContext: ",c),Ee(null)}}getCommentAnnotationByAnnotationId(e){try{return this.commentAnnotationById$.pipe(Te(()=>this.getAnnotationById(e)),Pe(t=>t?t?.iam?.accessMode===cr.PRIVATE?this.isPrivateCommentAllowed$().pipe(Te(a=>{if(a)return t})):Ee(t):Ee(t)),Pe(t=>t?this.filterCommentsUsingSidebarSettings(t).pipe(Te(a=>{if(a)return a})):Ee(t)))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationByAnnotationId: ",t),Ee(void 0)}}getMultiThreadCommentAnnotationByAnnotationId(e){return this.multiThreadCommentAnnotationById$.pipe(Te(()=>this.getMultiThreadAnnotationById(e)))}getCommentBubbleElement(e){try{let t=document.querySelector(`${X.TAGS.VELT_COMMENT_BUBBLE}[${X.ATTRIBUTES.VELT_ANNOTATION_IDS}*="${e?.annotationId}"]`);return t||(t=document.querySelector(`${X.TAGS.SNIPPYLY_COMMENT_BUBBLE}[${X.ATTRIBUTES.VELT_ANNOTATION_IDS}*="${e?.annotationId}"]`)),t}catch(t){return this.loggingService.catch("Error in CommentService getCommentBubbleElement: ",t),null}}getCommentAnnotationsBySectionId(e){try{return this.commentAnnotationById$.pipe(Pe(()=>this.docService.getDocumentPaths$().pipe(Te(t=>({documentPaths:t,sectionId:e})))),Pe(t=>{let a=Wr(e,["id","data-id"]);if(a){let i=this.docService.getAdditionLocationFromElement(a);if(i){let c=this.docService.genarateLocationId(i);return this.docService.getLocations$().pipe(Te(m=>{let _=Object.values(m||{}).find(I=>I.locationId===c||i?.id&&I.location.id===i.id);return f(g({},t),{additionalLocation:_,locationOnElement:!!i})}))}}return Ee(f(g({},t),{additionalLocation:null,element:a}))}),Pe(t=>t?.locationOnElement?Ee(t):this.docService.getLocation$().pipe(Te(a=>f(g({},t),{location:a})))),Te(({documentPaths:t,location:a,additionalLocation:i,locationOnElement:c,element:m})=>{let h=null;if(this.authService.getUser()&&t?.documentId){let I=this.docService.getAdditionalDocumentIdFromElement(m),S=I?this.docService.generateDocumentId(I):t?.documentId,H=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:t?.organizationId,documentId:S||""});if(H){h=[];let $=un(e);c?i?.location?.id?$=un([i?.location?.id,e]):i?.locationId&&($=un([i?.locationId+"",e])):a&&(a?.location?.id?$=un([a?.location?.id,e]):a?.locationId&&($=un([a?.locationId+"",e])));for(let j of H)j?.multiThreadAnnotationId===$?h.push(j):(j?.targetInlineCommentElementId===e||j?.targetElementId===e)&&(c?i&&Ug({location:i?.location,locationId:i?.locationId},{location:j.location,locationId:j.locationId})&&h.push(j):a?Ug({location:a?.location,locationId:a?.locationId},{location:j.location,locationId:j.locationId})&&h.push(j):j?.locationId||h.push(j))}}return h}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsBySectionId: ",t),Ee(null)}}getCommentAnnotationsByMultiThreadAnnotationId(e){try{return this.commentAnnotationById$.pipe(Pe(()=>this.multiThreadCommentAnnotationById$),Pe(()=>this.docService.getDocumentPaths$().pipe(Te(t=>({documentPaths:t,multiThreadAnnotationId:e})))),Te(({documentPaths:t,location:a,additionalLocation:i,locationOnElement:c})=>{let m=null;if(t?.documentId){let h=this.getMultiThreadAnnotationById(e),{documentId:_,organizationId:I}=h?.metadata||{documentId:t?.documentId,organizationId:t?.organizationId},S=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:I,documentId:_||""});if(S){m=[];for(let H of S)H?.multiThreadAnnotationId===e&&h?.commentAnnotations?.[H?.annotationId]&&m.push(H)}}return m}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsBySectionId: ",t),Ee(null)}}getCommentAnnotationsByAnnotationIds(e){try{return this.commentAnnotationById$.pipe(Pe(()=>this.draftCommentAnnotationsByAnnotationId$),Pe(()=>this.docService.getDocumentPaths$().pipe(Te(t=>({documentPaths:t,annotationIds:e})))),Te(({documentPaths:t})=>{let a=null;if(t?.documentId){let i=this.commentAnnotationById$.value?Object.values(this.commentAnnotationById$.value):[],c=this.draftCommentAnnotationsByAnnotationId$.value?Object.values(this.draftCommentAnnotationsByAnnotationId$.value):[];if(i=[...i,...c],i){a=[];for(let m of i)e.includes(m?.annotationId)&&a.push(m)}}return a}))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByAnnotationIds: ",t),Ee(null)}}getCommentAnnotationsByFolderId({folderId:e,veltFolderId:t}){try{return this.commentAnnotationById$.pipe(Pe(()=>this.draftCommentAnnotationsByAnnotationId$),Pe(()=>this.docService.getDocumentPaths$()),Te(()=>{e&&!t&&(t=mr(e));let a=this.authService.getUser(),i=this.docService.getDocumentPaths(),c=null;if(a&&i?.documentId){this.commentAnnotationById$.value&&(c={},Object.values(this.commentAnnotationById$.value).forEach(h=>{h?.metadata?.folderId==e&&h?.metadata?.veltFolderId==t&&(c[h?.annotationId]=h)}));let m=this.draftCommentAnnotationsByAnnotationId$.value;m&&(c===null&&(c={}),Object.values(m).forEach(h=>{h?.metadata?.folderId==e&&h?.metadata?.veltFolderId==t&&!c[h?.annotationId]&&(c[h?.annotationId]=h)}))}return c?Object.values(c):null}))}catch(a){return this.loggingService.catch("Error in CommentService getCommentAnnotationsByFolderId: ",a),Ee(null)}}getCommentAnnotationsForCommentComponent(e){try{let{annotationId:t,folderId:a,veltFolderId:i,targetElementId:c,clientDocumentId:m,documentId:h,context:_,contextOptions:I,element:S,type:H,sectionId:$,locationId:j}=e||{};if(m&&!h&&(h=this.docService.generateDocumentId(m)),a&&!i&&(i=mr(a)),t)return this.getCommentAnnotationByAnnotationId(t).pipe(Te(re=>re?[re]:null));let Z=[];if(c&&(H==="pin"||H==="tool"||H==="bubble")){let re=Wr(c,["id","data-id"]);if(re){let se=re,_e=this.domService.getXPath(re);Z.push(this.getCommentAnnotationAvailableOnXPath(_e,c,se))}}return $&&Z.push(this.getCommentAnnotationsBySectionId($)),_&&Z.push(this.getCommentAnnotationsByContext({context:_,contextOptions:I,element:S,clientDocumentId:m})),h&&Z.push(this.getCommentAnnotationsByDocumentId$({documentId:h})),a&&Z.push(this.getCommentAnnotationsByFolderId({folderId:a,veltFolderId:i})),Z.length===0?Ee(null):dr(Z).pipe(Te(re=>{let se=re.filter(le=>le!==null&&Array.isArray(le));if(se.length===0)return null;if(se.length===1){let le=se[0];return j&&le?.length?le.filter(Se=>Se?.location?.id===j):le}let _e=se[0];for(let le=1;le<se.length;le++){let he=se[le];_e=_e.filter(Se=>he.some(ze=>ze.annotationId===Se.annotationId))}return j&&_e?.length&&(_e=_e.filter(le=>le?.location?.id===j)),_e}),ir(Jr))}catch(t){return this.loggingService.catch("Error in CommentService getCommentAnnotationsForCommentComponent: ",t),Ee(null)}}get timestamp(){return this.commonDbService.getServerTimestamp()}isElementInsideAllowedElements(e){try{return this.allowedElementIds$.value?.length||this.allowedElementClassNames$.value?.length||this.allowedElementQuerySelectors$.value?.length?!!(this.allowedElementIds$.value?.length&&this.domService.isElementInsideListedElementIds(e,this.allowedElementIds$.value)||this.allowedElementClassNames$.value?.length&&this.domService.isElementInsideListedElementClassNames(e,this.allowedElementClassNames$.value)||this.allowedElementQuerySelectors$.value?.length&&this.domService.isElementInsideListedElementQuerySelectors(e,this.allowedElementQuerySelectors$.value)):!0}catch(t){return this.loggingService.catch("Error in CommentService isElementInsideAllowedElements: ",t),!1}}getNearestAllowedElement(e){try{let t=this.domService.getListedElements({elementIds:this.allowedElementIds$.value,elementClassNames:this.allowedElementClassNames$.value,elementQuerySelectors:this.allowedElementQuerySelectors$.value});if(t?.length){for(let a=0;a<t.length;a++){let i=t[a];if(e.contains(i))return i}return null}return null}catch(t){return this.loggingService.catch("Error in CommentService getNearestAllowedElement: ",t),null}}isElementInsideManualCommentContainer(e){try{return this.domService.isElementInsideParentWithAttribute(e,X.ATTRIBUTES.VELT_MANUAL_COMMENT_CONTAINER,"true")}catch(t){return this.loggingService.catch("Error in CommentService isElementInsideManualCommentContainer: ",t),!1}}saveComment(e,t){return Ae(this,null,function*(){try{if(t?.updatedComment?.isDraft&&this.draftConfirmation$?.value&&!(yield this.confirmDraftIfRequired(t.updatedComment,e?.annotationId)))return;t?.annotation&&(e=t.annotation),e&&(e=JSON.parse(JSON.stringify(e)));let a=this.originalCommentAnnotationsByDocumentId$.value[e.annotationId];if(a?.comments?.length){let I=JSON.parse(JSON.stringify(e.comments||[]));e.comments=[],a.comments?.forEach(S=>{let H=I.find($=>$.commentId===S.commentId);H?e.comments.push(H):e.comments.push(S)})}e.comments||(e.comments=[]);let i=!1,c=!1,m;switch(t.type){case Ze.NEWLY_ADDED:case Ze.ADDED:if(!t.updatedComment)break;e?.comments?.length||(c=!0),e.comments.push(t.updatedComment);let I=t?.assigned||void 0;m={commentAnnotation:e,targetComment:t.updatedComment,actionType:t.type,otherFields:{assigned:I}};break;case Ze.APPROVED:e.approved=!0,m={commentAnnotation:e,targetComment:null,actionType:Ze.APPROVED};break;case Ze.ASSIGNED:{let se=a?.assignedTo;e.assignedTo=t.assignedTo,m={commentAnnotation:e,targetComment:null,actionType:Ze.ASSIGNED,otherFields:{oldAssignedTo:se,newAssignedTo:t.assignedTo}};break}case Ze.UPDATED:if(!t.updatedComment)break;let S=e.comments.findIndex(se=>se.commentId===t.updatedComment.commentId);if(S>=0){let se=e.comments[S]?.commentText;e.comments[S]=t.updatedComment,e.comments[S].status=Ze.UPDATED;let _e=t?.assigned||void 0;m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ze.UPDATED,otherFields:{assigned:_e,oldCommentText:se}}}break;case Ze.REACTION_ADDED:if(!t.updatedComment)break;let H=e.comments.findIndex(se=>se.commentId===t.updatedComment.commentId);H>=0&&(e.comments[H]=t.updatedComment,e.comments[H].status=Ze.UPDATED,m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ze.REACTION_ADDED});break;case Ze.REACTION_DELETED:if(!t.updatedComment)break;let $=e.comments.findIndex(se=>se.commentId===t.updatedComment.commentId);$>=0&&(e.comments[$]=t.updatedComment,e.comments[$].status=Ze.UPDATED,m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ze.REACTION_DELETED});break;case Ze.STATUS_CHANGED:if(e.status.type==="terminal"){this.domService.resetSelectedAnnotationsMap(!1,"comment");let se=this.authService.getUser();e.resolvedByUserId=se?.userId,e.resolvedByUser=se}m={commentAnnotation:e,targetComment:null,actionType:Ze.STATUS_CHANGED,otherFields:{oldStatus:t.oldStatus,newStatus:t.newStatus}};break;case Ze.PRIORITY_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ze.PRIORITY_CHANGED,otherFields:{oldPriority:t.oldPriority,newPriority:t.newPriority}};break;case Ze.ACCESS_MODE_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ze.ACCESS_MODE_CHANGED,otherFields:{oldAccessMode:t.oldAccessMode,newAccessMode:t.newAccessMode}};break;case Ze.CUSTOM_LIST_CHANGED:m={commentAnnotation:e,targetComment:null,actionType:Ze.CUSTOM_LIST_CHANGED,otherFields:{oldCustomList:t.oldCustomList,newCustomList:t.newCustomList}};break;case Ze.SUBSCRIBED:m={commentAnnotation:e,targetComment:null,actionType:Ze.SUBSCRIBED};break;case Ze.UNSUBSCRIBED:m={commentAnnotation:e,targetComment:null,actionType:Ze.UNSUBSCRIBED};break;case Ze.DELETED:if(!t.updatedComment)break;let j=e.comments.findIndex(se=>se.commentId===t.updatedComment.commentId);if(j>=0){if((j===0&&this.deleteThreadWithFirstComment$.value!==!1||this.deleteReplyConfirmation$.value)&&!t.skipDeleteThreadConfirmation){let le={};if(this.deleteReplyConfirmation$.value&&(j!==0||this.deleteThreadWithFirstComment$.value===!1)?le={title:"Delete comment?",message:"This selected comment will be deleted.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"reply",type:"reply"}:le={title:"Delete thread?",message:"All replies to this thread will be lost.",yesButton:"Delete",noButton:"Cancel",darkMode:this.commentContainerDarkMode$.value,variant:"comment",type:"comment"},!(yield this.dialog.open(Yc,{panelClass:["velt-confirm-dialog-overlay-pane","velt-mat-dialog-container"],data:le}).afterClosed().toPromise()))return}let se=e.comments.splice(j,1),_e=e.metadata;se?.length&&se.forEach(le=>{le?.attachments&&le.attachments.forEach(he=>{let Se={attachmentId:he.attachmentId,organizationId:_e?.clientOrganizationId??_e?.organizationId??null,documentId:_e?.clientDocumentId??_e?.documentId??null,folderId:_e?.folderId??null,commentAnnotationId:e.annotationId,apiKey:_e?.apiKey??null};this.deleteAttachment({attachment:he,metadata:Se})}),le?.reactionAnnotationIds&&le.reactionAnnotationIds.forEach(he=>{this.deleteReaction(he)})})}e?.status?.type==="terminal"&&(e.status=this.customFilterService.defaultStatus),j===0&&this.deleteThreadWithFirstComment$.value!==!1||e.comments?.length===0?i=!0:(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_THREAD_DELETED,{annotationId:e.annotationId,commentThreadId:t.updatedComment.commentId,commentMode:this.getCommentMode()}),m={commentAnnotation:e,targetComment:t.updatedComment,actionType:Ze.DELETED});break;case Ze.ACCEPTED:let Z={annotationId:e.annotationId,actionUser:this.authService.getUser(),actionType:Ze.ACCEPTED,replaceContentHtml:e?.comments?.length?e?.comments[0]?.replaceContentHtml:void 0,replaceContentText:e?.comments?.length?e?.comments[0]?.replaceContentText:void 0,annotation:this.getCommentAnnotationForClient(e)};this.commentAccepted$.next(Z),m={commentAnnotation:e,targetComment:null,actionType:Ze.ACCEPTED};break;case Ze.REJECTED:let re={annotationId:e.annotationId,actionUser:this.authService.getUser(),actionType:Ze.REJECTED,replaceContentHtml:e?.comments?.length?e?.comments[0]?.replaceContentHtml:void 0,replaceContentText:e?.comments?.length?e?.comments[0]?.replaceContentText:void 0,annotation:this.getCommentAnnotationForClient(e)};this.commentRejected$.next(re),this.domService.resetSelectedAnnotationsMap(),m={commentAnnotation:e,targetComment:null,actionType:Ze.REJECTED};break;case Ze.SUGGESTION_ACCEPTED:m={commentAnnotation:e,targetComment:null,actionType:Ze.SUGGESTION_ACCEPTED,otherFields:{resolvedBy:e?.suggestion?.resolvedBy,resolvedAt:e?.suggestion?.resolvedAt}};break;case Ze.SUGGESTION_REJECTED:m={commentAnnotation:e,targetComment:null,actionType:Ze.SUGGESTION_REJECTED,otherFields:{rejectReason:e?.suggestion?.rejectReason,resolvedBy:e?.suggestion?.resolvedBy,resolvedAt:e?.suggestion?.resolvedAt}};break;default:break}if(e.resolvedByUserId&&e.status.type!=="terminal"&&(e.resolvedByUserId=null,e.resolvedByUser=null),t.visibility)try{let I=g({},t.visibility);if(I.type==="organizationPrivate"&&!I.organizationId&&!I.organizationIds?.length){let $=this.docService.getOrganizationConfig();$?.clientOrganizationId&&(I.organizationId=$.clientOrganizationId)}let S=e.from?.userId||this.authService.getUser()?.userId,H=An(I,S);H.length>0&&(e.context||(e.context={}),e.context._setAccessFields=H,e.visibilityConfig=Pn(I,S))}catch(I){this.loggingService.catch("Error building accessFields from visibility in saveComment:",I)}if(t?.updatedComment?.isDraft&&(m=void 0),i)this.deleteCommentPinAnnotation(e,!0),this.domService.resetSelectedAnnotationsMap(!1,"comment");else{c&&e.comments?.length&&this.enableAutoCategorize$?.value&&this.setCommentCategory(e);let I=this.authService.getUser()?.userId;if(!this.iamService.isUserAdmin()&&e.context?.access&&e.context?.accessFields&&t.updatedComment?.from?.userId&&I&&!this.userPermissionService?.hasUserContextAccess({userId:I,accessFields:e.context.accessFields})){this.loggingService.catch("User does not have context access to update comment annotation.",void 0,void 0,!0);return}this.updateComment(e,!1,!1,m,!0,t.updatedComment),e?.multiThreadAnnotationId&&(t.type===Ze.ADDED||t.type===Ze.NEWLY_ADDED)&&e.comments?.length===1?setTimeout(()=>{this.domService.resetSelectedAnnotationsMap(!1,"comment")},100):this.domService.updateSelectedAnnotationInMap([e])}let h=this.getCustomPinById(e.annotationId),_={type:t.type,annotation:this.getCommentAnnotationForClient(e),targetAnnotationId:e.annotationId,targetCommentId:t.updatedComment?.commentId,updateContext:(I,S)=>{this.updateCommentAnnotationContext(e.annotationId,I,S)}};if(h!==void 0&&(_.element=h),delete _?.annotation?.pageInfo,delete _?.annotation?.targetElement,delete _?.annotation?.targetTextRange,_?.type===Ze.DELETED&&(e.comments?.length||(_.annotation=null)),i||this.commentUpdated$.next(_),t.type===Ze.NEWLY_ADDED&&!i&&e?.annotationId){let I=this.pendingAddCommentAnnotationData.get(e.annotationId);if(I){this.pendingAddCommentAnnotationData.delete(e.annotationId);let S=f(g({},I),{annotation:this.getCommentAnnotationForClient(e),targetCommentId:t.updatedComment?.commentId}),H=yield this.commentActionsService?.getAddCommentAnnotationEventFromCommentAddEventData(S);H&&this.commentActionsService?.triggerAddCommentAnnotationEvent(H),t.updatedComment&&(yield this.commentActionsService?.triggerAddCommentEvent({annotation:e,newComment:t.updatedComment}))}}t.type===Ze.ADDED&&t._dispatchAddCommentEvent&&!i&&e?.annotationId&&t.updatedComment&&(yield this.commentActionsService?.triggerAddCommentEvent({annotation:e,newComment:t.updatedComment}))}catch(a){this.loggingService.catch("Error in CommentService saveComment: ",a)}})}attachComment(e,t=[],a,i,c,m,h,_){try{this.loggingService.log("%c[WB] Calling FUNCTION: attachComment","color: green;");let I;if(e){let S=Wr(e,t);S&&(I={targetElement:{xpath:this.domService.getXPath(S),topPercentage:50,leftPercentage:90},targetElementId:e})}(I||a||c)&&this.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,m,void 0,void 0,I,_,void 0,void 0,i,void 0,void 0,void 0,a,void 0,c,void 0,void 0,h)}catch(I){this.loggingService.catch("Error in CommentService attachComment: ",I)}}generateComponentIdFromObject(e){try{let t=an(e||{});return ur(JSON.stringify(t))}catch(t){this.loggingService.catch("Error in CommentService generateComponentIdFromObject: ",t);return}}updateNotificationsDatabase(e,t,a,i={}){try{let c=g({annotationData:e,targetAnnotationData:t,actionType:a,notificationSource:"comment"},i);this.notificationService.updateNotificationDatabase(c)}catch(c){this.loggingService.catch("Error in CommentService updateNotificationsDatabase: ",c)}}getUserContacts$(){return this.contactService.getUserContacts$()}addUserContact(e){this.contactService.addUserContact(e)}getCustomUserContacts(){try{return this.contactService.getCustomUserContacts()}catch(e){return this.loggingService.catch("Error in CommentService getCustomUserContacts:",e),null}}getCustomUserContactsConfig(){try{return this.contactService.getCustomUserContactsConfig()}catch(e){this.loggingService.catch("Error in CommentService getCustomUserContactsConfig:",e);return}}getElementFromComment(e){try{let t=null;if(e?.ghostComment)!t&&e.ghostComment?.targetElement?.fXpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.fXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e.ghostComment?.targetElement?.cfXpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.cfXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e.ghostComment?.targetElement?.xpath&&(t=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.xpath),t&&!this.domService.isElementVisible(t)&&(t=null));else{let a=!1,i=e?.targetElement?.anchor;if(!t&&i){let c=this.domService.resolveAnchorRecord(i);c?.element&&this.domService.isElementVisible(c.element)&&pn(c.element)&&(t=c.element)}!t&&e?.targetElement?.xpath&&(a=this.domService.isXpathWithId(e?.targetElement?.xpath),t=this.domService.getElementFromXPath(e?.targetElement?.xpath),t&&!this.domService.isElementVisible(t)&&(t=null)),a||(!t&&e?.targetElement?.cfXpath&&(t=this.domService.getElementFromXPath(e?.targetElement?.cfXpath),t&&!this.domService.isElementVisible(t)&&(t=null)),!t&&e?.targetElement?.fXpath&&(t=this.domService.getElementFromXPath(e?.targetElement?.fXpath),t&&!this.domService.isElementVisible(t)&&(t=null)))}return t&&!pn(t)&&(t=null),t}catch(t){return this.loggingService.catch("Error in CommentService getElementFromComment: ",t),null}}getElementFromComments(e){try{let t=[],a=null;if(e?.ghostComment)!a&&e.ghostComment?.targetElement?.fXpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.fXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e.ghostComment?.targetElement?.cfXpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.cfXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e.ghostComment?.targetElement?.xpath&&(a=this.domService.getElementFromXPath(e.ghostComment?.targetElement?.xpath),a&&!this.domService.isElementVisible(a)&&(a=null));else{let i=!1,c=e?.targetElement?.anchor;if(!a&&c){let m=this.domService.resolveAnchorRecord(c);m?.element&&this.domService.isElementVisible(m.element)&&pn(m.element)&&(a=m.element)}!a&&e?.targetElement?.xpath&&(i=this.domService.isXpathWithId(e?.targetElement?.xpath),a=this.domService.getElementFromXPath(e?.targetElement?.xpath),a&&!this.domService.isElementVisible(a)&&(a=null)),i||(!a&&e?.targetElement?.cfXpath&&(a=this.domService.getElementFromXPath(e?.targetElement?.cfXpath),a&&!this.domService.isElementVisible(a)&&(a=null)),!a&&e?.targetElement?.fXpath&&(a=this.domService.getElementFromXPath(e?.targetElement?.fXpath),a&&!this.domService.isElementVisible(a)&&(a=null)))}return a&&!pn(a)&&(a=null),e?.targetElementId&&(t=Array.from(Ab(e.targetElementId,["id","data-id"]))),a&&!t.includes(a)&&t.push(a),t}catch(t){return this.loggingService.catch("Error in CommentService getElementFromComment: ",t),[]}}getGhostCommentTargetElement(e){try{let t=e.targetElement?.fXpath||e.targetElement?.xpath,a=null;if(t)for(;!a&&t;)a=this.domService.getElementFromXPath(t),a&&(!this.domService.isElementVisible(a)||!pn(a))&&(a=null),a||(t=t.substring(0,t.lastIndexOf("/")));return t==="/"&&(t=""),t?{xpath:t,topPercentage:e?.targetElement?.topPercentage||0,leftPercentage:e?.targetElement?.leftPercentage||0}:null}catch(t){return this.loggingService.catch("Error in CommentService getGhostCommentTargetElement: ",t),null}}setGhostCommentMessage(e){try{if(e?.ghostComment){e.ghostComment.message="Original content not found.",e.ghostComment.type=Hr.ELEMENT_DELETED;let t=e?.pageInfo?.deviceInfo?.deviceType,a=new Tg().getDeviceType();t&&t!==a&&(e.ghostComment.type=Hr.DIFFERENT_DEVICE,e.ghostComment.message=`Original comment was added on ${t}.`,[En.MOBILE,En.TABLET].includes(t)&&[En.MOBILE,En.TABLET].includes(a)||[En.DESKTOP,En.MONITOR].includes(t)&&[En.DESKTOP,En.MONITOR].includes(a)?e.ghostComment.isSameGroup=!0:e.ghostComment.isSameGroup=!1)}}catch(t){this.loggingService.catch("Error in CommentService setGhostCommentMessage: ",t)}}addAnnotationToGhostCommentAnnotationMap(e){try{let t=this.ghostCommentAnnotationMap$.value||{},a=t[e?.annotationId]||{};ln(e.ghostComment,a)||(t[e?.annotationId]=e.ghostComment,this.ghostCommentAnnotationMap$.next(t))}catch(t){this.loggingService.catch("Error in CommentService addAnnotationToGhostCommentAnnotationMap: ",t)}}removeAnnotationFromGhostCommentAnnotationMap(e){try{let t=this.ghostCommentAnnotationMap$.value||{};t[e?.annotationId]&&(delete t[e?.annotationId],this.ghostCommentAnnotationMap$.next(t))}catch(t){this.loggingService.catch("Error in CommentService removeAnnotationFromGhostCommentAnnotationMap: ",t)}}getGhostCommentAnnotationMap$(){return this.ghostCommentAnnotationMap$.asObservable()}getGhostCommentAnnotationMap(){return this.ghostCommentAnnotationMap$.value||{}}getUnreadCommentsMap$(){return this.unreadCommentsMap$.asObservable().pipe(ir(Jr))}getUnreadCommentsMap(){return this.unreadCommentsMap$.value}getUnreadCommentCountByAnnotationId$(e){return this.getUnreadCommentsMap$().pipe(Te(t=>t?{count:t[e]||0}:null))}getUnreadCommentAnnotationCountOnCurrentDocument$(){return this.getUnreadCommentsMap$().pipe(Te(e=>e?{count:Object.keys(e??{}).length||0}:null))}getUnreadCommentCountOnCurrentDocument$(){return this.getUnreadCommentsMap$().pipe(Te(e=>e?{count:Object.values(e).reduce((a,i)=>a+i,0)}:null))}getUnreadCommentCountByLocationId$(e){return this.getUnreadCommentsMap$().pipe(Te(t=>{if(t){let a=this.docService.getDocumentPaths(),i=[],c=0;return a?.documentId&&(i=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:a?.organizationId,documentId:a?.documentId}),i&&Object.keys(t).forEach(m=>{i?.find(_=>_.annotationId===m)?.location?.id===e&&(c+=t[m])})),{count:c}}else return null}))}getUnreadCommentAnnotationCountByLocationId$(e){return this.getUnreadCommentsMap$().pipe(Te(t=>{if(t){let a=this.docService.getDocumentPaths(),i=[],c=0;return a?.documentId&&(i=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:a?.organizationId,documentId:a?.documentId}),Object.keys(t).forEach(m=>{t[m]&&i?.find(_=>_.annotationId===m)?.location?.id===e&&(c+=1)})),{count:c}}else return null}))}setCommentAnnotationsAsRead(e){try{for(let t of e)this.withProgressCommentsSpliced(t,()=>this.viewsService?.setCommentAnnotationAsRead(t))}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsAsRead: ",t)}}setCommentAnnotationsAsResolved(e){try{let t=this.customFilterService.resolvedStatus,a=this.authService.getUser();if(t){for(let i of e)if(t?.id!==i?.status?.id){let c=JSON.parse(JSON.stringify(i||{}));i.status=this.customFilterService.resolvedStatus,i.statusUpdatedByUserId=a?.userId;let m={annotation:i,type:Ze.STATUS_CHANGED,oldStatus:c.status,newStatus:this.customFilterService.resolvedStatus};this.saveComment(i,m)}}}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsAsResolved: ",t)}}isCommentAnnotationUnread(e){try{let t=this.authService.getUser();return!(t?.userSnippylyId&&e?.viewedByUserIds?.length&&e?.viewedByUserIds?.includes(t?.userSnippylyId))}catch(t){return this.loggingService.catch("Error in CommentService isCommentAnnotationUnread: ",t),!1}}updateCommentDialogPosition(){try{this.updateCommentDialogPositionTriggerSubject$.next()}catch(e){this.loggingService.catch("Error in CommentService updateCommentDialogPosition: ",e)}}updateCommentDialogPositionTrigger$(){return this.updateCommentDialogPositionTriggerSubject$.asObservable()}enableAreaComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{areaComment:!0}}),this.areaCommentEnabled$.value===!0)return;this.areaCommentEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAreaComment: ",e)}}disableAreaComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{areaComment:!1}}),this.areaCommentEnabled$.value===!1)return;this.areaCommentEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAreaComment: ",e)}}getAreaCommentEnabled$(){return this.areaCommentEnabled$.asObservable()}getAreaCommentEnabled(){return this.areaCommentEnabled$.value}setPinCursorImage(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setPinCursorImage","color: green;"),e&&(e=`url(${e}) 0 31, auto`),this.commentPinCursorImage$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setPinCursorImage: ",t)}}getPinCursorImage$(){return this.commentPinCursorImage$.asObservable()}getPinCursorImage(){return this.commentPinCursorImage$.value}setCommentAnnotationsFromCommentsContainer(e){try{this.commentAnnotationsFromCommentsContainer$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentAnnotationsFromCommentsContainer: ",t)}}getCommentAnnotationsFromCommentsContainer$(){return this.commentAnnotationsFromCommentsContainer$.asObservable()}getCommentAnnotationsFromCommentsContainer(){return this.commentAnnotationsFromCommentsContainer$.value}addManualComment(e){return Ae(this,null,function*(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: addManualComment","color: green;"),new Promise((t,a)=>{let i=this.domService.getLastDocumentClick()?.target,c=e?.location||this.docService.getAdditionLocationFromElement(i);if(c?.id){let m=this.docService.getLocationByClientLocationId(c.id);m&&(c=m)}this.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,c,void 0,e,void 0,void 0,void 0,m=>{t(m)}),this.addCommentMode$?.value&&!this.persistentCommentMode$?.value&&this.disableAddCommentMode()})}catch(t){return this.loggingService.catch("Error in CommentService addManualComment: ",t),null}})}getCommentUrl(e){try{return e?.pageInfo?.commentUrl?e.pageInfo.commentUrl:(e?.pageInfo||(e.pageInfo=tp(),e.pageInfo&&(e.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth)),e.pageInfo.commentUrl=this.generateCommentUrl(e),this.updateComment(e),e.pageInfo?.commentUrl)}catch(t){this.loggingService.catch("Error in CommentService getCommentUrl: ",t);return}}uploadFile(e,t){let a=`${X.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${X.FIREBASE_PARTIAL_PATH_COMMENT}/${t.annotationId}`;this.documentPaths?.organizationId&&(a=`${X.FIREBASE_PARTIAL_PATH_ORGANIZATIONS}/${this.documentPaths.organizationId}/${X.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${X.FIREBASE_PARTIAL_PATH_COMMENT}/${t.annotationId}`);let i={organizationId:t.metadata?.clientOrganizationId??this.documentPaths?.clientOrganizationId??null,documentId:t.metadata?.clientDocumentId??this.documentPaths?.clientDocumentId??null,commentAnnotationId:t.annotationId,apiKey:t.metadata?.apiKey??this.configService?.getApiKey()??null,folderId:t.metadata?.folderId??this.documentPaths?.folderId??null,attachmentId:null};return this.storageService.uploadFile({path:a,file:e,metadata:i,useAttachmentResolver:this.attachmentResolverService.attachmentDataProviderAvailable()})}downloadAttachment(e){this.storageService.downloadAttachment(e)}deleteAttachment({attachment:e,metadata:t}){return this.storageService.deleteAttachment({attachment:e,metadata:t,useAttachmentResolver:this.attachmentResolverService.attachmentDataProviderAvailable()})}deleteReaction(e){try{this.reactionService?.deleteReactionPinAnnotation(e)}catch(t){this.loggingService.catch("Error in CommentService deleteReaction: ",t)}}generateCommentUrl(e){let t;try{t=new URL(e?.pageInfo?.url||window.location.href)}catch(a){this.loggingService.catch("Error in CommentService generateCommentUrl: ",a),t=new URL(window.location.href)}return t.searchParams.delete(X.URL_PARAMS.COMMENT_ID),t.searchParams.append(X.URL_PARAMS.COMMENT_ID,e.annotationId),t.href}getCustomPinById(e){if(this.customPinsById.has(e))return this.customPinsById.get(e)}setCustomStatuses(e){try{if(e===void 0)return;this.customStatusesShown$.next(!0),this.customFilterService.setCustomStatusFilters(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomStatuses: ",t)}}getCustomStatusesShown$(){return this.customStatusesShown$.asObservable()}getCustomStatusesShown(){return this.customStatusesShown$.value}setCustomPriorities(e){try{if(e===void 0)return;this.customFilterService.setCustomPriorityFilters(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomPriorities: ",t)}}setCustomCategories(e){try{if(e===void 0)return;this.customFilterService.setCustomCategories(e)}catch(t){this.loggingService.catch("Error in CommentService setCustomCategories: ",t)}}addCommentOnSelectedText(){try{let e=this.authService.getUser();if(this.textCommentMode$.value&&e&&!(e?.isReadOnly||e?.isAnonymous)&&this.authService.isFeatureAllowed(ke.COMMENT)){let t=this.domService.getRange();if(window.getSelection()?.toString()&&!Hc()&&t?.commonAncestorContainer&&this.isElementInsideAllowedElements(t.commonAncestorContainer)&&!to(t.commonAncestorContainer)){let a=t?this.domService.getTargetTextRangeFromSelectionRange(t):void 0;this.domService.clearTextSelection(),setTimeout(()=>{this.addComment(void 0,a)},100)}}}catch(e){this.loggingService.catch("Error in CommentService addCommentOnSelectedText: ",e)}}getInlineCommentSectionConfig(e){try{let t;if(e){let a=e?.closest(`[${X.ATTRIBUTES.VELT_TARGET_INLINE_COMMENT_ELEMENT_ID}]`);if(a){let i=a.getAttribute(X.ATTRIBUTES.VELT_TARGET_INLINE_COMMENT_ELEMENT_ID);i&&(t={},t.targetInlineCommentElementId=i,a.getAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_SECTION_CONFIG)&&(t.config=JSON.parse(a.getAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_SECTION_CONFIG)||"{}")))}}return t}catch(t){this.loggingService.catch("Error in CommentService getInlineCommentSectionConfig: ",t)}}createCustomListDataOnAnnotation(e){try{if(e===void 0)return;this.customChipDropdownData$.next(e)}catch(t){this.loggingService.catch("Error in CommentService createCustomListDataOnAnnotation: ",t)}}getCustomChipDropdownData$(){return this.customChipDropdownData$.asObservable()}getCustomChipDropdownData(){return this.customChipDropdownData$.value}setSubscribedUsersDataInCommentAnnotation(e){try{let t={},a=e?.unsubscribedUsers||{},i={};if(e?.subscribedUsers&&Object.keys(e.subscribedUsers||{}).forEach(c=>{let m=e.subscribedUsers?.[c];m?.type==="manual"&&(t[c]=m)}),e?.assignedTo?.userId){let c=ur(e?.assignedTo?.userId);a[c]||t[c]?.type!=="manual"&&(t[c]={user:e?.assignedTo,type:"auto"})}e?.comments?.filter(c=>!c?.isDraft)?.forEach(c=>{if(c?.from?.userId){let m=ur(c?.from?.userId);a[m]||t[m]?.type!=="manual"&&(t[m]={user:c?.from,type:"auto"})}c?.to?.forEach(m=>{if(m?.userId){let h=ur(m.userId);a[h]||t[h]?.type!=="manual"&&(t[h]={user:m,type:"auto"})}}),c?.toOrganizationUserGroup?.forEach(m=>{if(m?.groupId)i[m?.groupId]={type:"auto"};else if(m?.clientGroupId){let h=ur(m.clientGroupId);i[h]={type:"auto"}}})}),e.subscribedUsers=t,e.unsubscribedUsers=a,e.subscribedGroups=i}catch(t){this.loggingService.catch("Error in CommentService setSubscribeUsersDataInCommentAnnotation: ",t)}}getCopyLink$(){return this.copyLink$.asObservable()}setCopyLink(e){try{this.copyLink$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCopyLink: ",t)}}getCommentAnnotationById(e){return this.commentAnnotationById$.pipe(Pe(()=>{let{annotationId:t,documentId:a}=e;if(a){let i=To(a).toString();return this.getDataCommentAnnotationsFromDocumentId(i).pipe(Te(c=>c.find(h=>h.annotationId===t)||null))}else{let i=this.docService.getDocumentPaths();if(i?.documentId){let c=this.getCommentAnnotationsByOrganizationIdAndDocumentId({organizationId:i?.organizationId,documentId:i?.documentId});if(c){let m=c.find(h=>h.annotationId===t);return Ee(m||null)}}}return Ee(null)}),jr(t=>(this.loggingService.catch("Error in CommentService getCommentAnnotationById: ",t),Ee(null))))}getCommentAnnotationByIdSync(e){try{return this.commentAnnotationById$.value?.[e]}catch(t){this.loggingService.catch("Error in CommentService getCommentAnnotationByIdSync: ",t);return}}getDataCommentAnnotationsFromDocumentId(e){return this.configService?.getApiKey()?this.commonDbService.dbListener({feature:"allComments",properties:{documentId:e||this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,isCollection:!0}}).pipe(Te(t=>t?.data),Te(t=>{let a=[];return t&&(a=Object.values(t??{}).filter(i=>typeof i=="object")),a})):Ee([])}enableCollapsedComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedComments:!0}}),this.collapsedComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCollapsedComments: ",e)}}disableCollapsedComments(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedComments:!1}}),this.collapsedComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCollapsedComments: ",e)}}getCollapsedComments$(){return this.collapsedComments$.asObservable()}enableCollapsedRepliesPreview(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedRepliesPreview:!0}}),this.collapsedRepliesPreview$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCollapsedRepliesPreview: ",e)}}disableCollapsedRepliesPreview(){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{collapsedRepliesPreview:!1}}),this.collapsedRepliesPreview$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCollapsedRepliesPreview: ",e)}}getCollapsedRepliesPreview$(){return this.collapsedRepliesPreview$.asObservable()}enableFullExpanded(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullExpanded:!0}}),this.fullExpanded$.value===!0)return;this.fullExpanded$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFullExpanded: ",e)}}disableFullExpanded(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullExpanded:!1}}),this.fullExpanded$.value===!1)return;this.fullExpanded$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFullExpanded: ",e)}}getFullExpanded$(){return this.fullExpanded$.asObservable()}getFullExpanded(){return this.fullExpanded$.value}setSidebarCustomActionEventData(e,t,a,i,c){try{this.sidebarCustomActionEventData$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c})}catch(m){this.loggingService.catch("Error in CommentService emitOnSidebarCustomAction: ",m)}}getSidebarCustomActionEventData(){return this.sidebarCustomActionEventData$.asObservable()}setCommentSidebarData(e,t){try{let a=new Set;(e||[]).forEach(c=>{(c?.annotations||[]).forEach(m=>{m?.annotationId&&a.add(m.annotationId)})});let i=this.customSidebarDataAnnotationIds$.value;this.areAnnotationIdSetsEqual(i,a)||this.customSidebarDataAnnotationIds$.next(a),this.sidebarData$.next({data:e,options:t})}catch(a){this.loggingService.catch("Error in CommentService setCommentSidebarData: ",a)}}areAnnotationIdSetsEqual(e,t){if(e===t)return!0;if(e===null||t===null||e.size!==t.size)return!1;for(let a of e)if(!t.has(a))return!1;return!0}getSidebarCustomData(){return this.sidebarData$.asObservable()}getCustomSidebarDataAnnotationIds$(){return this.customSidebarDataAnnotationIds$.asObservable()}getCustomSidebarDataAnnotationIds(){return this.customSidebarDataAnnotationIds$.value}setSidebarCustomActionEventDataAllChanges(e,t,a,i,c){return Ae(this,null,function*(){try{this.sidebarCustomActionEventDataAllChanges$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c});let m=yield this.metadataService.getGlobalMetadata(),h={buttonContext:{selections:this.buttonService.buttonToggleMapValue()},unreadCommentAnnotationsMap:a,commentAnnotations:t,systemFilteredAnnotations:i,metadata:m,customFilters:c};this.commentActionsService?.triggerAction(lt.COMMENT_SIDEBAR_DATA_UPDATE,h)}catch(m){this.loggingService.catch("Error in CommentService setSidebarCustomActionEventDataAllChanges: ",m)}})}setSidebarCustomActionEventDataOnInit(e,t,a,i,c){return Ae(this,null,function*(){try{this.sidebarCustomActionEventDataOnInit$.next({actions:e,data:t,unreadDataMap:a,systemFilteredData:i,customFilters:c});let h={metadata:yield this.metadataService.getGlobalMetadata(),unreadCommentAnnotationsMap:a,commentAnnotations:t,systemFilteredAnnotations:i,buttonContext:{selections:this.buttonService.buttonToggleMapValue()},customFilters:c};this.commentActionsService?.triggerAction(lt.COMMENT_SIDEBAR_DATA_INIT,h)}catch(m){this.loggingService.catch("Error in CommentService setSidebarCustomActionEventDataOnInit: ",m)}})}getSidebarCustomActionEventDataAllChanges(){return this.sidebarCustomActionEventDataAllChanges$.asObservable()}getSidebarCustomActionEventDataOnInit(){return this.sidebarCustomActionEventDataOnInit$.asObservable()}getSidebarCustomActionEventDataOnInitValue(){return this.sidebarCustomActionEventDataOnInit$.getValue()}setTransformContext(e){try{e?ln(this.transformContext$.value,e)||this.transformContext$.next(e):this.transformContext$.next(null)}catch(t){this.loggingService.catch("Error in CommentService setTransformContext: ",t)}}getTransformContext$(){return this.transformContext$.asObservable()}getTransformContext(){return this.transformContext$.value}enableSidebarCustomActions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customActions:!0}}),this.customActions$.value===!0)return;this.customActions$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSidebarCustomActions: ",e)}}disableSidebarCustomActions(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customActions:!1}}),this.customActions$.value===!1)return;this.customActions$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSidebarCustomActions: ",e)}}getSidebarCustomActionsValue(){return this.customActions$.getValue()}enableQueryParamsComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{queryParamsComments:!0}}),this.queryParamsComments$.value===!0)return;this.queryParamsComments$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableQueryParamsComments: ",e)}}disableQueryParamsComments(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{queryParamsComments:!1}}),this.queryParamsComments$.value===!1)return;this.queryParamsComments$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableQueryParamsComments: ",e)}}getQueryParamsComments$(){return this.queryParamsComments$.asObservable()}getQueryParamsComments(){return this.queryParamsComments$.value}enableResolveStatusAccessAdminOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveStatusAccessAdminOnly:!0}}),this.resolveStatusAccessAdminOnly$.value===!0)return;this.resolveStatusAccessAdminOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableResolveStatusAccessAdminOnly: ",e)}}disableResolveStatusAccessAdminOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{resolveStatusAccessAdminOnly:!1}}),this.resolveStatusAccessAdminOnly$.value===!1)return;this.resolveStatusAccessAdminOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableResolveStatusAccessAdminOnly: ",e)}}enableLinkCallback(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{linkCallback:!0}}),this.linkCallback$.value===!0)return;this.linkCallback$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableLinkCallback: ",e)}}disableLinkCallback(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{linkCallback:!1}}),this.linkCallback$.value===!1)return;this.linkCallback$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableLinkCallback: ",e)}}getResolveStatusAccessAdminOnly$(){return this.resolveStatusAccessAdminOnly$.asObservable()}getLinkCallback$(){return this.linkCallback$.asObservable()}getResolveStatusAccessAdminOnly(){return this.resolveStatusAccessAdminOnly$.value}getLinkCallback(){return this.linkCallback$.value}enableSvgAsImg(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{svgAsImg:!0}}),this.svgAsImg$.value===!0)return;this.svgAsImg$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableSvgAsImg: ",e)}}disableSvgAsImg(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{svgAsImg:!1}}),this.svgAsImg$.value===!1)return;this.svgAsImg$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableSvgAsImg: ",e)}}getSvgAsImg$(){return this.svgAsImg$.asObservable()}getSvgAsImg(){return this.svgAsImg$.value}enableCommentToNearestAllowedElement(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentToNearestAllowedElement:!0}}),this.commentToNearestAllowedElement$.value===!0)return;this.commentToNearestAllowedElement$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCommentToNearestAllowedElement: ",e)}}disableCommentToNearestAllowedElement(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentToNearestAllowedElement:!1}}),this.commentToNearestAllowedElement$.value===!1)return;this.commentToNearestAllowedElement$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCommentToNearestAllowedElement: ",e)}}getCommentToNearestAllowedElement$(){return this.commentToNearestAllowedElement$.asObservable()}getCommentToNearestAllowedElement(){return this.commentToNearestAllowedElement$.value}enableFilterCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterCommentsOnDom:!0}}),this.filterCommentsOnDom$.value===!0)return;this.filterCommentsOnDom$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFilterCommentsOnDom: ",e)}}disableFilterCommentsOnDom(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterCommentsOnDom:!1}}),this.filterCommentsOnDom$.value===!1)return;this.filterCommentsOnDom$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFilterCommentsOnDom: ",e)}}getFilterCommentsOnDom$(){return this.filterCommentsOnDom$.asObservable()}getFilterCommentsOnDom(){return this.filterCommentsOnDom$.value}setCommentsFromSidebarMap(e){try{let{comments:t,sidebarVisible:a}=e||{},i=null;t&&(i={},t.forEach(m=>{m?.annotationId&&i&&(i[m.annotationId]=m)}));let c={};t===void 0?c.data=this.commentsFromSidebarMap$.value?.data:c.data=i,a===void 0?c.sidebarVisible=this.commentsFromSidebarMap$.value?.sidebarVisible:c.sidebarVisible=a,ln(this.commentsFromSidebarMap$.value,c)||this.commentsFromSidebarMap$.next(c)}catch(t){this.loggingService.catch("Error in CommentService setCommentsFromSidebarMap: ",t)}}getCommentsFromSidebarMap$(){return this.commentsFromSidebarMap$.asObservable()}getCommentsFromSidebarMap(){return this.commentsFromSidebarMap$.value}hasActiveFilters(e){try{return e?!!(e.people?.length||e.assigned?.length||e.tagged?.length||e.involved?.length||e.priority?.length||e.status?.length||e.category?.length||e.location?.length||e.document?.length||e.version?.length||e.accessModes?.length||this.hasCustomContextFilters(e)):!1}catch(t){return this.loggingService.catch("Error in CommentService hasActiveFilters: ",t),!1}}hasCustomContextFilters(e){try{if(!e)return!1;let t=new Set(["people","assigned","tagged","involved","priority","status","category","version","document","location","accessModes"]);return Object.keys(e).some(a=>!t.has(a)&&Array.isArray(e[a])&&e[a]?.length>0)}catch(t){return this.loggingService.catch("Error in CommentService hasCustomContextFilters: ",t),!1}}applyDirectFilters(e,t){try{let a=this.commentSidebarSystemFiltersOperator$.value,i,c=!1,m=new Set;a===Ur.AND?i=e.slice():i=[];let h=_=>{a===Ur.AND?i=i.filter(I=>_.some(S=>S.annotationId===I.annotationId)):_.forEach(I=>m.add(I.annotationId)),c=!0};if(t.people?.length){let _=[];t.people.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByPeople({id:S,name:I.name},e)])}),h(_)}if(t.assigned?.length){let _=[];t.assigned.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByAssigned({id:S,name:I.name},e)])}),h(_)}if(t.tagged?.length){let _=[];t.tagged.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByTagged({id:S,name:I.name},e)])}),h(_)}if(t.involved?.length){let _=[];t.involved.forEach(I=>{let S=I.userId||I.email;S&&(_=[..._,...this.filterAnnotationsByInvolved({id:S,name:I.name},e)])}),h(_)}if(t.priority?.length){let _=[];t.priority.forEach(I=>_=[..._,...this.filterAnnotationsByPriority({id:I},e)]),h(_)}if(t.status?.length){let _=[];t.status.forEach(I=>_=[..._,...this.filterAnnotationsByStatus({id:I},e)]),h(_)}if(t.category?.length){let _=[];t.category.forEach(I=>_=[..._,...this.filterAnnotationsByCommentCategory({id:I},e)]),h(_)}if(t.version?.length){let _=[];t.version.forEach(I=>_=[..._,...this.filterAnnotationsByVersion(I,e)]),h(_)}if(t.document?.length){let _=[];t.document.forEach(I=>_=[..._,...this.filterAnnotationsByDocument(I,e)]),h(_)}if(t.location?.length){let _=[];t.location.forEach(I=>{I.id&&(_=[..._,...e.filter(S=>S.location?.id===I.id||S.documentParams?.id===I.id)])}),h(_)}if(t.accessModes?.length){let _=[];t.accessModes.forEach(I=>{I===cr.PRIVATE?_=[..._,...e.filter(S=>pr(S))]:I===cr.PUBLIC&&(_=[..._,...e.filter(S=>!pr(S))])}),h(_)}return this.getCustomContextFilterEntries(t).forEach(({key:_,values:I})=>{let S=this.matchAnnotationsByContext(e,_,I);h(S)}),a!==Ur.AND&&(c?i=e.filter(_=>m.has(_.annotationId)):i=e),i}catch(a){return this.loggingService.catch("Error in CommentService applyDirectFilters: ",a),e}}applyCommentSidebarClientFilters(e,t){return this.applyDirectFilters(e,t)}getCustomContextFilterEntries(e){try{if(!e)return[];let t=new Set(["people","assigned","tagged","involved","priority","status","category","version","document","location","accessModes"]),a=[];return Object.keys(e).forEach(i=>{if(t.has(i))return;let c=e[i];!Array.isArray(c)||!c.length||a.push({key:i,values:c})}),a}catch(t){return this.loggingService.catch("Error in CommentService getCustomContextFilterEntries: ",t),[]}}matchAnnotationsByContext(e,t,a){try{return e.filter(i=>{let c=i.context?.[t];return c==null?!1:a.some(m=>{let h=typeof m=="string"?m:m?.id;return c===h||c?.toString()===h})})}catch(i){return this.loggingService.catch("Error in CommentService matchAnnotationsByContext: ",i),[]}}filterAnnotationsByPeople(e,t){try{return e.id?t.filter(a=>a?.from?.userId===e.id||a?.from?.email===e.id):t}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByPeople: ",a),[]}}filterAnnotationsByTagged(e,t){try{return t.filter(a=>a?.comments?.some(i=>i.taggedUserContacts?.some(c=>c?.contact?.userId===e.id)))}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByTagged: ",a),[]}}filterAnnotationsByAssigned(e,t){try{return t.filter(a=>a?.assignedTo?.userId===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByAssigned: ",a),[]}}filterAnnotationsByInvolved(e,t){try{return t.filter(a=>{let i=a?.from?.userId===e.id||a?.from?.email===e.id,c=a?.assignedTo?.userId===e.id,m=a?.comments?.some(h=>h.taggedUserContacts?.some(_=>_?.contact?.userId===e.id));return i||c||m})}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByInvolved: ",a),[]}}filterAnnotationsByPriority(e,t){try{return e.id==="unset"?t.filter(a=>!a?.priority):t.filter(a=>a?.priority?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByPriority: ",a),[]}}filterAnnotationsByStatus(e,t){try{return t.filter(a=>a?.status?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByStatus: ",a),[]}}filterAnnotationsByCommentCategory(e,t){try{return e.id==="other"?t.filter(a=>!a?.commentCategories?.length||a?.commentCategories?.some(i=>i.id===e.id)):t.filter(a=>(a?.commentCategories||[]).some(i=>i.id===e.id))}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByCommentCategory: ",a),[]}}filterAnnotationsByVersion(e,t){try{return e.id==="unset"?t.filter(a=>!a?.location?.version):t.filter(a=>a?.location?.version?.id===e.id)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByVersion: ",a),[]}}filterAnnotationsByDocument(e,t){try{return e?.id&&e.id!=="other"?t.filter(a=>a?.metadata?.clientDocumentId?.toString()===e.id):t.filter(a=>!a?.metadata?.clientDocumentId)}catch(a){return this.loggingService.catch("Error in CommentService filterAnnotationsByDocument: ",a),[]}}setSidebarButtonCountType(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{sidebarButtonCountType:e}}),this.sidebarButtonCountType$.value===e)return;this.sidebarButtonCountType$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setSidebarButtonCountType: ",t)}}getSidebarButtonCountType$(){return this.sidebarButtonCountType$.asObservable()}getSidebarButtonCountType(){return this.sidebarButtonCountType$.value}enableFilterGhostCommentsInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterGhostCommentsInSidebar:!0}}),this.filterGhostCommentsInSidebar$.value===!0)return;this.filterGhostCommentsInSidebar$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFilterGhostCommentsInSidebar: ",e)}}disableFilterGhostCommentsInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{filterGhostCommentsInSidebar:!1}}),this.filterGhostCommentsInSidebar$.value===!1)return;this.filterGhostCommentsInSidebar$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFilterGhostCommentsInSidebar: ",e)}}getFilterGhostCommentsInSidebar$(){return this.filterGhostCommentsInSidebar$.asObservable()}getFilterGhostCommentsInSidebar(){return this.filterGhostCommentsInSidebar$.value}filterCommentsUsingSidebarSettings(e){try{let t=Array.isArray(e),a;return t?a=e||[]:e?a=[e]:a=[],this.getFilterCommentsOnDom$().pipe(Pe(i=>i?a.length===0?Ee(e):dr([this.effectiveSidebarFilters$,this.customSidebarDataAnnotationIds$]).pipe(Te(([c,m])=>{let h=a,_=!1;if(this.hasActiveFilters(c)){let I=this.applyDirectFilters(a,c),S=new Set(I.map(H=>H.annotationId));h=h.filter(H=>H?.isDraft||S.has(H.annotationId)),_=!0}return m&&(h=h.filter(I=>I?.isDraft||I?.annotationId&&m.has(I.annotationId)),_=!0),_?t?h:h.length>0?h[0]:null:e})):Ee(e)))}catch{return Ee(e)}}enableFocusedThreadMode(){try{if(this.focusedThreadMode$.value===!0)return;this.focusedThreadMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFocusedThreadMode: ",e)}}disableFocusedThreadMode(){try{if(this.focusedThreadMode$.value===!1)return;this.focusedThreadMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFocusedThreadMode: ",e)}}getFocusedThreadMode$(){return this.focusedThreadMode$.asObservable()}enableOpenAnnotationInFocusMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{openAnnotationInFocusMode:!0}}),this.openAnnotationInFocusMode$.value===!0)return;this.openAnnotationInFocusMode$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableOpenAnnotationInFocusMode: ",e)}}disableOpenAnnotationInFocusMode(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{openAnnotationInFocusMode:!1}}),this.openAnnotationInFocusMode$.value===!1)return;this.openAnnotationInFocusMode$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableOpenAnnotationInFocusMode: ",e)}}getOpenAnnotationInFocusMode$(){return this.openAnnotationInFocusMode$.asObservable()}getOpenAnnotationInFocusMode(){return this.openAnnotationInFocusMode$.value}enableReadOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{readOnly:!0}}),this.readOnly$.value===!0)return;this.readOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReadOnly: ",e)}}disableReadOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{readOnly:!1}}),this.readOnly$.value===!1)return;this.readOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReadOnly: ",e)}}getReadOnly$(){return this.readOnly$.asObservable()}getReadOnly(){return this.readOnly$.value}shouldEnableReadOnly(){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentService FUNCTION: shouldEnableReadOnly","color: green;");let e=this.authService.getUser(),t=this.docService.getDocumentPaths()?.folderId,a=this.docService.getDocumentIds().map(i=>i.clientDocumentId);if(e){let i=this.userPermissionService.getCurrentUserPermissions();i?.[e.userId]?t&&i[e.userId]?.folders?.[t]?.accessRole==="viewer"?this.enableReadOnly():a.forEach(c=>{i[e.userId]?.documents?.[c]?.accessRole==="viewer"&&this.enableReadOnly()}):this.getReadOnly()||this.disableReadOnly()}}catch(e){this.loggingService.catch("Error in CommentService shouldEnableReadOnly:",e)}})}sanitizeCommentAnnotation(e){try{return e?.comments?.length&&e.comments.forEach(t=>{t?.commentHtml&&(t.commentHtml=this.domService.sanitizeHtml(t.commentHtml))}),e}catch(t){return this.loggingService.catch("Error in CommentService sanitizeCommentAnnotation: ",t),e}}enableCustomAutocompleteSearch(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customAutocompleteSearch:!0}}),this.customAutocompleteSearch$.value===!0)return;this.customAutocompleteSearch$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableCustomAutocompleteSearch: ",e)}}disableCustomAutocompleteSearch(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{customAutocompleteSearch:!1}}),this.customAutocompleteSearch$.value===!1)return;this.customAutocompleteSearch$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableCustomAutocompleteSearch: ",e)}}getCustomAutocompleteSearch$(){return this.customAutocompleteSearch$.asObservable()}getCustomAutocompleteSearch(){return this.customAutocompleteSearch$.value}enableDeleteThreadWithFirstComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteThreadWithFirstComment:!0}}),this.deleteThreadWithFirstComment$.value===!0)return;this.deleteThreadWithFirstComment$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableDeleteThreadWithFirstComment: ",e)}}disableDeleteThreadWithFirstComment(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{deleteThreadWithFirstComment:!1}}),this.deleteThreadWithFirstComment$.value===!1)return;this.deleteThreadWithFirstComment$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableDeleteThreadWithFirstComment: ",e)}}getDeleteThreadWithFirstComment$(){return this.deleteThreadWithFirstComment$.asObservable()}enableExpandMentionGroups(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{expandMentionGroups:!0}}),this.expandMentionGroups$.value===!0)return;this.expandMentionGroups$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableExpandMentionGroups: ",e)}}disableExpandMentionGroups(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{expandMentionGroups:!1}}),this.expandMentionGroups$.value===!1)return;this.expandMentionGroups$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableExpandMentionGroups: ",e)}}getExpandMentionGroups$(){return this.expandMentionGroups$.asObservable()}getExpandMentionGroups(){return this.expandMentionGroups$.value}enableShowMentionGroupsFirst(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsFirst:!0}}),this.showMentionGroupsFirst$.value===!0)return;this.showMentionGroupsFirst$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowMentionGroupsFirst: ",e)}}disableShowMentionGroupsFirst(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsFirst:!1}}),this.showMentionGroupsFirst$.value===!1)return;this.showMentionGroupsFirst$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowMentionGroupsFirst: ",e)}}getShowMentionGroupsFirst$(){return this.showMentionGroupsFirst$.asObservable()}getShowMentionGroupsFirst(){return this.showMentionGroupsFirst$.value}enableShowMentionGroupsOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsOnly:!0}}),this.showMentionGroupsOnly$.value===!0)return;this.showMentionGroupsOnly$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableShowMentionGroupsOnly: ",e)}}disableShowMentionGroupsOnly(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{showMentionGroupsOnly:!1}}),this.showMentionGroupsOnly$.value===!1)return;this.showMentionGroupsOnly$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableShowMentionGroupsOnly: ",e)}}getShowMentionGroupsOnly$(){return this.showMentionGroupsOnly$.asObservable()}getShowMentionGroupsOnly(){return this.showMentionGroupsOnly$.value}setAnalyticsFeatureConfig({config:e,feature:t}){try{this.analyticsService.setFeatureConfig({feature:t||ke.COMMENT,config:e})}catch(a){this.loggingService.catch("Error in CommentService setAnalyticsFeatureConfig: ",a)}}generateContextId(e){try{let t;if(e&&typeof e=="object"){let a=JSON.parse(JSON.stringify(e));if(delete a.accessFields,delete a.access,Object.keys(a).length){let i=an(a),c=JSON.stringify(i);t=ur(c)}}return t}catch{return}}splitProgressCommentsStage(e){try{if(!Array.isArray(e))return e;let t=!1;return e.forEach(a=>{let i=a?.annotationId;if(typeof i!="string"||!i)return;let{comments:c,progress:m}=dp(a);!m.length&&!this.progressCommentsByAnnotationId.has(i)||(a.comments=c,m.length?(this.progressCommentsByAnnotationId.set(i,m),t=!0):(this.progressCommentsByAnnotationId.delete(i)&&(t=!0),this.progressOnlyAnnotationsLogged.delete(i)),!c.length&&m.length&&!this.progressOnlyAnnotationsLogged.has(i)&&(this.progressOnlyAnnotationsLogged.add(i),this.loggingService.log("[velt] progress: annotation currently has only content-less progress comments: "+i)))}),t&&this.progressCommentsVersion$.next(this.progressCommentsVersion$.value+1),e}catch(t){return this.loggingService.catch("Error in CommentService splitProgressCommentsStage:",t),e}}getProgressCommentsVersion$(){return this.progressCommentsVersion$.asObservable()}getFullComments(e){try{let t=Array.isArray(e?.comments)?e.comments:[],a=this.getProgressComments(e?.annotationId);return a.length?[...t,...a].sort((i,c)=>{let m=i?.createdAt instanceof Date?i.createdAt.getTime():Number(i?.createdAt??0),h=c?.createdAt instanceof Date?c.createdAt.getTime():Number(c?.createdAt??0);return m-h}):t}catch{return e?.comments??[]}}spliceProgressCommentsIn(e){try{if(!e?.annotationId||!this.getProgressComments(e.annotationId).length)return;e.comments=this.getFullComments(e)}catch(t){this.loggingService.catch("Error in CommentService spliceProgressCommentsIn:",t)}}withProgressCommentsSpliced(e,t){return Ae(this,null,function*(){try{this.spliceProgressCommentsIn(e);try{return yield t()}finally{this.restoreProgressCommentSplit(e)}}catch(a){this.loggingService.catch("Error in CommentService withProgressCommentsSpliced:",a);return}})}restoreProgressCommentSplit(e){try{if(!e?.annotationId||!this.getProgressComments(e.annotationId).length)return;let{comments:t}=dp(e);e.comments=t}catch(t){this.loggingService.catch("Error in CommentService restoreProgressCommentSplit:",t)}}hasRenderableContent(e){try{if(!e)return!1;if(e.comments?.length)return!0;let t=e.annotationId;if(typeof t!="string"||!t)return!1;let a=Date.now(),i=this.getCommentProgressStaleAfter();return this.getProgressComments(t).some(c=>qg(c,i,a))}catch{return!!e?.comments?.length}}getProgressComments(e){try{return this.progressCommentsByAnnotationId.get(e)??[]}catch{return[]}}evictProgressComments(e){try{e?.forEach(t=>{this.progressCommentsByAnnotationId.delete(t),this.progressOnlyAnnotationsLogged.delete(t)})}catch(t){this.loggingService.catch("Error in CommentService evictProgressComments:",t)}}setCommentProgressStaleAfter(e){try{let t=Number(e);if(!Number.isFinite(t)||t<=0||this.commentProgressStaleAfter$.value===t)return;this.commentProgressStaleAfter$.next(t)}catch(t){this.loggingService.catch("Error in CommentService setCommentProgressStaleAfter:",t)}}getCommentProgressStaleAfter$(){return this.commentProgressStaleAfter$.asObservable()}getCommentProgressStaleAfter(){return this.commentProgressStaleAfter$.value}setMaxReplyAvatars(e){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{maxReplyAvatars:e}}),this.maxReplyAvatars$.value===e)return;this.maxReplyAvatars$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setMaxReplyAvatars: ",t)}}getMaxReplyAvatars$(){return this.maxReplyAvatars$.asObservable()}getMaxReplyAvatars(){return this.maxReplyAvatars$.value}enableReplyAvatars(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyAvatars:!0}}),this.replyAvatars$.value===!0)return;this.replyAvatars$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableReplyAvatars: ",e)}}disableReplyAvatars(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyAvatars:!1}}),this.replyAvatars$.value===!1)return;this.replyAvatars$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableReplyAvatars: ",e)}}getReplyAvatars$(){return this.replyAvatars$.asObservable()}getReplyAvatars(){return this.replyAvatars$.value}setCommentplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{commentplaceholder:e}}),this.commentplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setCommentplaceholder: ",t)}}getCommentplaceholder$(){return this.commentplaceholder$.asObservable()}getCommentplaceholder(){return this.commentplaceholder$.value}setReplyplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{replyplaceholder:e}}),this.replyplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setReplyplaceholder: ",t)}}getReplyplaceholder$(){return this.replyplaceholder$.asObservable()}getReplyplaceholder(){return this.replyplaceholder$.value}setEditplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editplaceholder:e}}),this.editplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditplaceholder: ",t)}}getEditplaceholder$(){return this.editplaceholder$.asObservable()}getEditplaceholder(){return this.editplaceholder$.value}setEditcommentplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editcommentplaceholder:e}}),this.editcommentplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditcommentplaceholder: ",t)}}getEditcommentplaceholder$(){return this.editcommentplaceholder$.asObservable()}getEditcommentplaceholder(){return this.editcommentplaceholder$.value}setEditreplyplaceholder(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{editreplyplaceholder:e}}),this.editreplyplaceholder$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setEditreplyplaceholder: ",t)}}getEditreplyplaceholder$(){return this.editreplyplaceholder$.asObservable()}getEditreplyplaceholder(){return this.editreplyplaceholder$.value}enableScreenshot(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{screenshotEnabled:!0}}),this.screenshotEnabled$.value===!0)return;this.screenshotEnabled$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableScreenshot: ",e)}}disableScreenshot(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{screenshotEnabled:!1}}),this.screenshotEnabled$.value===!1)return;this.screenshotEnabled$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableScreenshot: ",e)}}getScreenshotEnabled$(){return this.screenshotEnabled$.asObservable()}getScreenshotEnabled(){return this.screenshotEnabled$.value}getAnnotationNumber(e){try{let t=this.commentAnnotationById$.value||{},a=-1,i=Object.values(t).filter(c=>{let m=c.metadata?.documentId===e.metadata?.documentId;return m&&c.annotationNumber&&(a=Math.max(a,c.annotationNumber)),m});return a===-1?i.length+1:a+1}catch(t){return this.loggingService.catch("Error in CommentService getAnnotationNumber: ",t),null}}enableFullScreenInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullScreen:!0}}),this.fullScreenInSidebar$.value===!0)return;this.fullScreenInSidebar$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableFullScreenInSidebar: ",e)}}disableFullScreenInSidebar(){try{if(this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{fullScreen:!1}}),this.fullScreenInSidebar$.value===!1)return;this.fullScreenInSidebar$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableFullScreenInSidebar: ",e)}}getFullScreenInSidebar$(){return this.fullScreenInSidebar$.asObservable()}getFullScreenInSidebar(){return this.fullScreenInSidebar$.value}setComposerFileAttachments(e){try{this.composerFileAttachments$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setComposerFileAttachments: ",t)}}getComposerFileAttachments$(){return this.composerFileAttachments$.asObservable()}getComposerFileAttachments(){return this.composerFileAttachments$.value}clearComposerFileAttachments(){try{this.composerFileAttachments$.next(null)}catch(e){this.loggingService.catch("Error in CommentService clearComposerFileAttachments: ",e)}}enableAttachmentNameInMessage(){try{if(this.attachmentNameInMessage$.value===!0)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentNameInMessage:!0}}),this.attachmentNameInMessage$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableAttachmentNameInMessage: ",e)}}disableAttachmentNameInMessage(){try{if(this.attachmentNameInMessage$.value===!1)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{attachmentNameInMessage:!1}}),this.attachmentNameInMessage$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableAttachmentNameInMessage: ",e)}}getAttachmentNameInMessage$(){return this.attachmentNameInMessage$.asObservable()}getAttachmentNameInMessage(){return this.attachmentNameInMessage$.value}setAllowedFileTypes(e){try{this.allowedFileTypes$.next(e)}catch(t){this.loggingService.catch("Error in CommentService setAllowedFileTypes: ",t)}}getAllowedFileTypes$(){return this.allowedFileTypes$.asObservable()}getAllowedFileTypes(){return this.allowedFileTypes$.value}enableForceCloseAllOnEsc(){try{if(this.forceCloseAllOnEsc$.value===!0)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{forceCloseAllOnEsc:!0}}),this.forceCloseAllOnEsc$.next(!0)}catch(e){this.loggingService.catch("Error in CommentService enableForceCloseAllOnEsc: ",e)}}disableForceCloseAllOnEsc(){try{if(this.forceCloseAllOnEsc$.value===!1)return;this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{forceCloseAllOnEsc:!1}}),this.forceCloseAllOnEsc$.next(!1)}catch(e){this.loggingService.catch("Error in CommentService disableForceCloseAllOnEsc: ",e)}}getForceCloseAllOnEsc$(){return this.forceCloseAllOnEsc$.asObservable()}getForceCloseAllOnEsc(){return this.forceCloseAllOnEsc$.value}markAsRead(e){return Ae(this,null,function*(){try{let t;e&&(t=this.getAnnotationById(e)),t&&(yield this.withProgressCommentsSpliced(t,()=>this.viewsService?.setCommentAnnotationAsRead(t)))}catch(t){this.loggingService.catch("Error in ViewsService markAsRead:",t)}})}markAsUnread(e){return Ae(this,null,function*(){try{let t;e&&(t=this.getAnnotationById(e)),t&&(yield this.withProgressCommentsSpliced(t,()=>this.viewsService?.setCommentAnnotationAsUnread(t)))}catch(t){this.loggingService.catch("Error in ViewsService markAsUnread:",t)}})}setAutoCompleteScrollConfig(e){try{this.analyticsService.setFeatureConfig({feature:ke.COMMENT,config:{autoCompleteScrollConfig:e}});let t=this.autoCompleteScrollConfig$.value,a={itemSize:e.itemSize??t.itemSize,minBufferPx:e.minBufferPx??t.minBufferPx,maxBufferPx:e.maxBufferPx??t.maxBufferPx,templateCacheSize:e.templateCacheSize??t.templateCacheSize};this.autoCompleteScrollConfig$.next(a)}catch(t){this.loggingService.catch("Error in CommentService setAutoCompleteScrollConfig: ",t)}}getAutoCompleteScrollConfig(){return this.autoCompleteScrollConfig$.value}getAutoCompleteScrollConfig$(){return this.autoCompleteScrollConfig$.asObservable()}submitComment(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: submitComment","color: green;"),this.submitComment$.next(e.targetComposerElementId)}catch(t){this.loggingService.catch("Error in CommentService submitComment: ",t)}}onSubmitComment$(){return this.submitComment$.asObservable()}clearComposer(e){try{this.clearComposer$.next(e.targetComposerElementId),this.composerDataMap.delete(e.targetComposerElementId)}catch(t){this.loggingService.catch("Error in CommentService clearComposer: ",t)}}onClearComposer$(){return this.clearComposer$.asObservable()}emitComposerTextChange(e,t,a){try{this.commentActionsService?.onComposerTextChange({text:e,annotation:t,targetComposerElementId:a})}catch(i){this.loggingService.catch("Error in CommentService emitComposerTextChange: ",i)}}setComposerData(e,t){try{this.composerDataMap.set(e,t)}catch(a){this.loggingService.catch("Error in CommentService setComposerData: ",a)}}clearComposerData(e){try{this.composerDataMap.delete(e)}catch(t){this.loggingService.catch("Error in CommentService clearComposerData: ",t)}}getComposerData(e){try{return this.composerDataMap.get(e.targetComposerElementId)||null}catch(t){return this.loggingService.catch("Error in CommentService getComposerData: ",t),null}}};o.\u0275fac=function(t){return new(t||o)(be(sr),be(ro),be(Wv),be(ut),be(Xb),be(ot),be(Ne),be(ob),be(Yb),be($t),be(pf),be(ab),be(mb),be(Dr),be(A),be(hf),be(Dt),be(Df),be(kr),be(rf),be($g),be(ef),be(qb),be(Jg))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function S2(r){try{let o=(r?.composerContent??"").replace(/\s+/g," ").trim();if(o)return o;let n=r?.recordingCount??0;if(n>0)return`${n} ${n===1?"recording":"recordings"}`;let e=r?.attachmentCount??0;return e>0?`${e} ${e===1?"attachment":"attachments"}`:""}catch{return""}}var eu=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_){this.authService=e,this.iamService=t,this.docService=a,this.configService=i,this.commonDbService=c,this.loggingService=m,this.commentService=h,this.userPermissionService=_,this.documentPaths=null,this.LISTENER_BATCH_SIZE=5}getAnnotationsCount(e){try{return this.authService.getUser$().pipe(Gt(t=>!!t),Pe(t=>this.docService.getOrganizationConfig$().pipe(Gt(a=>!!a),Te(()=>t))),Pe(t=>this.commentService.isFeatureAllowed({firebaseUser:t,annotations:[],filteredAnnotations:[]})),Pe(t=>t.featureAllowed?this.iamService.isUserAllowed$().pipe(Te(a=>(t.featureAllowed=a,t))):Ee(t)),Pe(t=>t.featureAllowed?this.processRequest(t,e):Ee(null)),Te(t=>t??{data:null}),ir(Jr))}catch(t){return this.loggingService.catch("Error in CommentService getAnnotationsCount: ",t),Ee({data:null})}}processRequest(e,t){try{return Ee(e).pipe(Pe(()=>this.initializeDocumentPaths(t,e)),Pe(()=>this.getDocumentIds$(t)),Pe(a=>{let i=this.authService.getUser()?.userSnippylyId,c=this.buildRequestContext(t,a);if(!this.validateRequestContext(c,t))return Ee({data:null,mode:c.mode,serverDocumentIds:c.serverDocumentIds});if(!c.organizationId)return Ee({data:null,mode:c.mode,serverDocumentIds:c.serverDocumentIds});let m=this.setupTriggers$(c.mode,c.organizationId,c.clientOrganizationId,c.veltFolderId,c.serverDocumentIds);if(this.shouldUseAggregateMode(c.mode))return this.handleAggregateCounts$({triggers$:m,serverDocumentIds:c.serverDocumentIds,request:t,userId:i,organizationId:c.organizationId,clientOrganizationId:c.clientOrganizationId,veltFolderId:c.veltFolderId,folderId:c.folderId,mode:c.mode}).pipe(Te(h=>({data:h,mode:c.mode,serverDocumentIds:c.serverDocumentIds})));if(c.mode.isBatchedGroupedMode){let h=t?.debounceMs??5e3;return this.handleBatchedGroupedCounts$({triggers$:m,documentIds:a,request:t,userId:i,organizationId:c.organizationId,veltFolderId:c.veltFolderId,debounceMs:h}).pipe(Te(_=>({data:_,mode:c.mode,serverDocumentIds:c.serverDocumentIds})))}else return this.handleGroupedCounts$(m,a,t,i,c.organizationId,c.veltFolderId).pipe(Te(h=>({data:h,mode:c.mode,serverDocumentIds:c.serverDocumentIds})))}),Pe(a=>{if(!a?.data)return Ee(null);let{data:i,mode:c,serverDocumentIds:m}=a;return t?.filterGhostComments?this.filterGhostComments$(i,c,m):Ee(i)}),jr(a=>(this.loggingService.catch("Error processing request: ",a),Ee(null))))}catch(a){return this.loggingService.catch("Error in CommentService getAnnotationsCount: ",a),Ee(null)}}initializeDocumentPaths(e,t){try{return e?Ee(t):this.docService.getDocumentPaths$().pipe(Gt(a=>!!a),Lc(a=>{this.documentPaths=a,t.documentPaths=a}),Te(()=>{}))}catch(a){return this.loggingService.catch("Error in CommentService initializeDocumentPaths: ",a),Ee(t)}}buildRequestContext(e,t){try{let a=this.docService.getOrganizationConfig(),i=this.documentPaths?.organizationId??a?.organizationId,c=this.documentPaths?.clientOrganizationId??a?.clientOrganizationId,m,h,_;if(e?.allDocuments||e?.documentIds||e?.folderId||e?.organizationId||e?.locationIds){if(e.organizationId&&(i=Gv(e.organizationId),c=e.organizationId),!i)throw new Error("organizationId is required for this request type");e.folderId&&(m=mr(e.folderId),h=e.folderId),e.allDocuments&&(_=!0)}else m=this.documentPaths?.veltFolderId,h=this.documentPaths?.folderId,_=this.documentPaths?.allDocuments;let I=this.determineMode(e,m,_,t),S=I.isOrgMode?[]:t.length>0?t.map(H=>H.documentId):[this.documentPaths?.documentId??""];return{organizationId:i,clientOrganizationId:c,veltFolderId:m,folderId:h,allDocuments:_,mode:I,serverDocumentIds:S}}catch(a){return this.loggingService.catch("Error in CommentService buildRequestContext: ",a),{organizationId:void 0,clientOrganizationId:void 0,veltFolderId:void 0,folderId:void 0,allDocuments:void 0,mode:{isOrgMode:!1,isFolderMode:!1,isBatchMode:!1,isBatchedGroupedMode:!1},serverDocumentIds:[]}}}validateRequestContext(e,t){try{if(t?.aggregateDocuments&&!e.serverDocumentIds.length)throw this.loggingService.catch("Error in CommentService getAnnotationsCount: documentIds is required when aggregateDocuments is true"),new Error("documentIds is required when aggregateDocuments is true");return!(!e.organizationId||!(e.mode.isOrgMode||e.mode.isFolderMode)&&e.serverDocumentIds.some(a=>!a))}catch(a){return this.loggingService.catch("Error in CommentService validateRequestContext: ",a),!1}}shouldUseAggregateMode(e){try{return e.isFolderMode||e.isOrgMode||e.isBatchMode}catch(t){return this.loggingService.catch("Error in CommentService shouldUseAggregateMode: ",t),!1}}getDocumentIds$(e){try{return e?.documentIds?.length?Ee(e.documentIds.map(t=>({clientDocumentId:t,documentId:Mg(t)}))):this.docService.getDocumentIds$().pipe(Te(t=>t.length>0?t:[{documentId:this.documentPaths?.documentId??"",clientDocumentId:this.documentPaths?.clientDocumentId||""}]))}catch(t){return this.loggingService.catch("Error in CommentService getDocumentIds: ",t),Ee([])}}determineMode(e,t,a,i){try{let c=!!e?.organizationId&&!e?.documentIds?.length&&!t&&!a,m=!!t&&!!a,h=!!e?.aggregateDocuments&&!a&&!!i?.length,_=(!!e?.batchedPerDocument||i.length>1)&&!!i?.length&&!e?.aggregateDocuments&&!a;return{isOrgMode:c,isFolderMode:m,isBatchMode:h,isBatchedGroupedMode:_}}catch(c){return this.loggingService.catch("Error in CommentService determineMode: ",c),{isOrgMode:!1,isFolderMode:!1,isBatchMode:!1,isBatchedGroupedMode:!1}}}setupTriggers$(e,t,a,i,c){try{if(e.isOrgMode){let m=this.authService.getUser()?.userId??"";return[yn(this.userPermissionService?.getUserPermissionsFromCacheOrFetch({organizationId:a})??Promise.resolve({})).pipe(Pe(_=>m&&_?.[m]?.organization?.[a]?.errorCode===Eg.PERMISSION_DENIED?(this.loggingService.log(`%c[WB] commentViews org listener skipped \u2014 user does not have access to organization: ${a}`,"color: orange;"),Wn):this.commonDbService.dbListener({feature:"organizationMetadata",properties:{useCollectionGroup:!1,isCollection:!1,organizationId:t}}))).pipe(Te(_=>_?.data?.commentViewsUpdatedAt??null),Gt(_=>!!_),ir(Jr))]}else{if(e.isFolderMode)return[this.commonDbService.dbListener({feature:"folder",properties:{useCollectionGroup:!1,isCollection:!1,folderId:i,organizationId:t}}).pipe(Te(h=>h?.data?.commentViewsUpdatedAt??null),Gt(h=>!!h),ir(Jr))];if(e.isBatchMode||e.isBatchedGroupedMode){let m=[];for(let h=0;h<c.length;h+=this.LISTENER_BATCH_SIZE)m.push(c.slice(h,h+this.LISTENER_BATCH_SIZE));return m.map(h=>this.commonDbService.dbListener({feature:"allDocuments",properties:{useCollectionGroup:!0,isCollection:!0,useQuery:!0,firestoreQuery:[Mr(Qe("metadata.apiKey","==",this.configService?.getApiKey()),Qe("metadata.organizationId","==",t),Qe("metadata.documentId","in",h))]}}).pipe(Te(I=>Object.values(I?.data||{}).map(H=>H?.commentViewsUpdatedAt??null).sort().join(",")),ir(Jr)))}else return c.map(m=>this.commonDbService.dbListener({feature:"documentMetadata",properties:{useCollectionGroup:!1,isCollection:!1,documentId:m,organizationId:t}}).pipe(Te(_=>_?.data?.commentViewsUpdatedAt??null),Gt(_=>!!_),ir(Jr)))}}catch(m){return this.loggingService.catch("Error in CommentService setupTriggers: ",m),[]}}handleGroupedCounts$(e,t,a,i,c,m){try{let h=t.map((_,I)=>e[I].pipe(Wu(void 0),Pe(()=>yn(this.getCountsForDocument$(_.documentId,_.clientDocumentId,a,i,c,m)))));return dr(h).pipe(Te(_=>{let I={};return _.forEach(S=>{S&&(I[S.clientDocumentId]={total:S.total,unread:S.unread})}),{data:I}}),jr(_=>(this.loggingService.catch("Error in grouped counts: ",_),Ee(null))))}catch(h){return this.loggingService.catch("Error in CommentService handleGroupedCounts: ",h),Ee(null)}}handleBatchedGroupedCounts$(e){try{let{triggers$:t,documentIds:a,request:i,userId:c,organizationId:m,veltFolderId:h,debounceMs:_}=e,I=this.LISTENER_BATCH_SIZE,S=new Sh(1),H=t.map((re,se)=>re.pipe(Eh(S),Te(()=>se))),$=Hu(...H).pipe(Nv(_)),j=Ee(-1).pipe(Pe(()=>yn(this.fetchAllDocumentCounts$(a,i,c,m,h))),Te(re=>({batchIndex:-1,data:re?.data||{}})),Lc(()=>{S.next()})),Z=$.pipe(Pe(re=>{let se=re*I,_e=Math.min(se+I,a.length),le=a.slice(se,_e);return yn(this.fetchAllDocumentCounts$(le,i,c,m,h)).pipe(Te(he=>({batchIndex:re,data:he?.data||{}})))}));return Hu(j,Z).pipe(Th((re,se)=>({data:g(g({},re.data),se.data)}),{data:{}}),jr(re=>(this.loggingService.catch("Error in batched grouped counts: ",re),Ee(null))))}catch(t){return this.loggingService.catch("Error in CommentService handleBatchedGroupedCounts: ",t),Ee(null)}}fetchAllDocumentCounts$(e,t,a,i,c){return Ae(this,null,function*(){try{let m=e.map(I=>this.getCountsForDocument$(I.documentId,I.clientDocumentId,t,a,i,c)),h=yield Promise.allSettled(m),_={};return h.forEach(I=>{if(I.status==="fulfilled"&&I.value){let{clientDocumentId:S,total:H,unread:$}=I.value;_[S]={total:H,unread:$}}}),{data:_}}catch(m){return this.loggingService.catch("Error in CommentService fetchAllDocumentCounts: ",m),null}})}handleAggregateCounts$(e){try{let{triggers$:t,serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}=e;return dr(t).pipe(Te(()=>{})).pipe(Wu(void 0),Pe(()=>yn(this.getAggregateCounts({serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}))),jr($=>(this.loggingService.catch("Error in aggregate counts: ",$),Ee(null))))}catch(t){return this.loggingService.catch("Error in CommentService handleAggregateCounts: ",t),Ee(null)}}getCountsForDocument$(e,t,a,i,c,m){return Ae(this,null,function*(){try{let h=this.configService?.getApiKey(),_={useCollectionGroup:!0,isCollection:!0,useQuery:!0,getCount:!0},I=[Qe("metadata.apiKey","==",h),Qe("metadata.organizationId","==",c),Qe("metadata.documentId","in",[e]),...m?[Qe("metadata.veltFolderId","==",m)]:[],...a?.statusIds?.length?[Qe("status.id","in",a.statusIds)]:[],...a?.locationIds?.length?[Qe("location.id","in",a.locationIds)]:[],...a?.agentFields?.length?[Qe("agent.agentFields","array-contains-any",a.agentFields)]:[]],S=[Mr(...I),Xt("lastUpdated","desc"),Xt("createdAt","desc")],H=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},_),{firestoreQuery:S})}),$=0;if(!a?.agentFields?.length){let j=[...I,Qe("viewedByUserIds","array-contains",i)],Z=[Mr(...j),Xt("lastUpdated","desc"),Xt("createdAt","desc")];$=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},_),{firestoreQuery:Z})})}return{clientDocumentId:t,total:H,unread:H-$}}catch(h){return this.loggingService.catch("Error in CommentService getCountsForDocument: ",h),null}})}getAggregateCounts(e){return Ae(this,null,function*(){try{let t="",{serverDocumentIds:a,request:i,userId:c,organizationId:m,clientOrganizationId:h,veltFolderId:_,folderId:I,mode:S}=e,H=this.configService?.getApiKey(),$={useCollectionGroup:!0,isCollection:!0,useQuery:!0,getCount:!0},j=[Qe("metadata.apiKey","==",H),Qe("metadata.organizationId","==",m),...i?.statusIds?.length?[Qe("status.id","in",i.statusIds)]:[],...i?.locationIds?.length?[Qe("location.id","in",i.locationIds)]:[],...i?.agentFields?.length?[Qe("agent.agentFields","array-contains-any",i.agentFields)]:[]],Z,re=0;if(S.isFolderMode){t=I??"",j.push(Qe("metadata.veltFolderId","==",_));let se=[Mr(...j),Xt("lastUpdated","desc"),Xt("createdAt","desc")];if(Z=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:se})}),!i?.agentFields?.length){let _e=[...j,Qe("viewedByUserIds","array-contains",c)],le=[Mr(..._e),Xt("lastUpdated","desc"),Xt("createdAt","desc")];re=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:le})})}}else if(S.isOrgMode){t=h??"";let se=[Mr(...j),Xt("lastUpdated","desc"),Xt("createdAt","desc")];if(Z=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:se})}),!i?.agentFields?.length){let _e=[...j,Qe("viewedByUserIds","array-contains",c)],le=[Mr(..._e),Xt("lastUpdated","desc"),Xt("createdAt","desc")];re=yield this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:le})})}}else{t="result";let se=[];for(let he=0;he<a.length;he+=this.LISTENER_BATCH_SIZE)se.push(a.slice(he,he+this.LISTENER_BATCH_SIZE));let _e=se.map(he=>Ae(this,null,function*(){let Se=[...j,Qe("metadata.documentId","in",he),..._?[Qe("metadata.veltFolderId","==",_)]:[]],Re=[Mr(...Se),Xt("lastUpdated","desc"),Xt("createdAt","desc")];return this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:Re})})}));if(Z=(yield Promise.allSettled(_e)).reduce((he,Se)=>he+(Se.status==="fulfilled"&&Se.value||0),0),!i?.agentFields?.length){let he=se.map(Re=>Ae(this,null,function*(){let ze=[...j,Qe("metadata.documentId","in",Re),..._?[Qe("metadata.veltFolderId","==",_)]:[],Qe("viewedByUserIds","array-contains",c)],Ye=[Mr(...ze),Xt("lastUpdated","desc"),Xt("createdAt","desc")];return this.commonDbService.queryData({feature:"allComments",properties:f(g({},$),{firestoreQuery:Ye})})}));re=(yield Promise.allSettled(he)).reduce((Re,ze)=>Re+(ze.status==="fulfilled"&&ze.value||0),0)}}return{data:{[t]:{total:Z,unread:Z-re}}}}catch(t){return this.loggingService.catch("Error in CommentService getAggregateCounts: ",t),null}})}filterGhostComments$(e,t,a){try{return e?this.commentService.getGhostCommentAnnotationMap$().pipe(Te(i=>{if(!i)return e;let c=this.buildGhostCommentAnnotationMap(i),m=this.groupGhostCommentsByModeId(c,t,a);return this.adjustCountsForGhostComments(e,m),e})):Ee(null)}catch(i){return this.loggingService.catch("Error in CommentService filterGhostComments: ",i),Ee(null)}}buildGhostCommentAnnotationMap(e){let t={};return Object.keys(e).forEach(a=>{let i=this.commentService.getAnnotationById(a);i&&(t[a]=i)}),t}groupGhostCommentsByModeId(e,t,a){try{let i={};return Object.values(e).forEach(c=>{let m=this.getModeIdForAnnotation(c,t,a);m&&(i[m]||(i[m]=[]),i[m].push(c))}),i}catch(i){return this.loggingService.catch("Error in CommentService groupGhostCommentsByModeId: ",i),{}}}getModeIdForAnnotation(e,t,a){try{return t.isOrgMode?e?.metadata?.clientOrganizationId||null:t.isFolderMode?e?.metadata?.folderId||null:t.isBatchMode?a.includes(e?.metadata?.documentId??"")?"result":null:e?.metadata?.clientDocumentId||null}catch(i){return this.loggingService.catch("Error in CommentService getModeIdForAnnotation: ",i),null}}adjustCountsForGhostComments(e,t){try{if(typeof e?.data!="object")return;let i=this.authService.getUser()?.userSnippylyId;Object.keys(e.data||{}).forEach(c=>{let m=t[c];if(!(!m||!e?.data?.[c]?.total)&&(e.data[c].total=Math.max(0,e.data[c].total-m.length),i)){let h=m.filter(_=>_?.viewedByUserIds&&!_?.viewedByUserIds?.includes(i));h.length>0&&(e.data[c].unread=Math.max(0,e.data[c].unread-h.length))}})}catch(a){this.loggingService.catch("Error in CommentService adjustCountsForGhostComments: ",a)}}};o.\u0275fac=function(t){return new(t||o)(be(ot),be(Dr),be(ut),be(Wv),be(ro),be(A),be(ae),be(Jg))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var at=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,H,$,j,Z){this.analyticsService=e,this.authService=t,this.commentService=a,this.commentViewsService=i,this.contactService=c,this.customFilterService=m,this.docService=h,this.iamService=_,this.loggingService=I,this.metadataService=S,this.commonDbService=H,this.serviceBook=$,this.suggestionActions=j,this.targetRegistry=Z,this.actionSubjects=new Map,this.defaultSource="internal",this.isUserAdmin=!1,this.subscriptions=[],this.reactionService=null,this.loggingService.log("%c[WB] Creating CLASS: CommentActionsService","color: blue;");try{this.commentService.setCommentActionsService(this),this.iamService.isUserAdmin$().subscribe(re=>{this.isUserAdmin=re}),this.serviceBook.observe(Bg).subscribe(re=>{this.reactionService=re})}catch(re){this.loggingService.catch("Error in CommentActionsService constructor: ",re)}}addCommentAnnotation(c,m){return Ae(this,arguments,function*({annotation:e,options:t,visibility:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addCommentAnnotation","color: green;"),a){if(a.type==="restricted"){let I=this.authService.getUser();I?.userId&&(a=eo(a,I.userId))}if(a.type==="organizationPrivate"&&!a.organizationId&&!a.organizationIds?.length){let I=this.authService.getUser()?.clientOrganizationId;I&&(a=f(g({},a),{organizationId:I}))}let h=this.authService.getUser()?.userId,_=An(a,h);_.length>0&&(e.context||(e.context={}),e.context._setAccessFields=_,e.visibilityConfig=Pn(a,h))}return new Promise(h=>{this.commentService.addComment(void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,_=>Ae(this,null,function*(){let I=yield this.getAddCommentAnnotationEventFromCommentAddEventData(_);h(I)}),void 0,void 0,e,void 0,void 0,void 0,void 0,void 0,i)})}catch(h){return this.loggingService.catch("Error in CommentActionsService addCommentAnnotation: ",h),null}})}getAddCommentAnnotationEventFromCommentAddEventData(e){return Ae(this,null,function*(){try{let t=yield this.metadataService.getGlobalMetadata();return{commentAnnotation:this.commentService.getCommentAnnotationForClient(e?.annotation),annotationId:e?.annotation?.annotationId,metadata:t,addContext:e?.addContext,elementRef:e?.elementRef}}catch(t){return this.loggingService.catch("Error in CommentActionsService getAddCommentAnnotationEventFromData: ",t),null}})}triggerAddCommentAnnotationEvent(e){try{this.triggerAction(lt.ADD_COMMENT_ANNOTATION,e)}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAddCommentAnnotationEvent: ",t)}}getAddCommentAnnotationDraftEventFromCommentAddEventData(e){return Ae(this,null,function*(){try{return{metadata:yield this.metadataService.getGlobalMetadata(),addContext:e?.addContext}}catch(t){return this.loggingService.catch("Error in CommentActionsService getAddCommentAnnotationEventFromData: ",t),null}})}triggerAddCommentAnnotationDraftEvent(e){try{this.triggerAction(lt.ADD_COMMENT_ANNOTATION_DRAFT,e)}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAddCommentAnnotationDraftEvent: ",t)}}triggerAddCommentDraftEventForAnnotation(e,t){return Ae(this,null,function*(){try{if(!e?.annotationId||!t)return;let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),comment:t,metadata:a};this.triggerAction(lt.ADD_COMMENT_DRAFT,i)}catch(a){this.loggingService.catch("Error in CommentActionsService triggerAddCommentDraftEventForAnnotation: ",a)}})}triggerAnnotationNotFoundError(e){try{this.loggingService.catch("Annotation not found:","The annotation with the given id was not found.")}catch(t){this.loggingService.catch("Error in CommentActionsService triggerAnnotationNotFoundError: ",t)}}deleteCommentAnnotation(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteCommentAnnotation","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let h=this.commentService.getAnnotationById(e,t);if(h){let _=this.authService.getUser();if(this.isUserAdmin||_?.userId===h?.from?.userId){this.commentService.deleteCommentPinAnnotation(h);let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:h.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:I};return this.triggerAction(lt.DELETE_COMMENT_ANNOTATION,S),S}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete it.")}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteCommentAnnotation: ",m),null}})}updatePriority(c,m){return Ae(this,arguments,function*({annotationId:e,priority:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updatePriority","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_=JSON.parse(JSON.stringify(_));let I=_.priority?JSON.parse(JSON.stringify(_.priority)):null;I&&t&&I?.id===t?.id?_.priority=void 0:_.priority=t,this.commentService.saveComment(_,{type:Ze.PRIORITY_CHANGED,newPriority:t,oldPriority:I});let S=yield this.metadataService.getGlobalMetadata(),H={newPriority:t,oldPriority:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};return this.triggerAction(lt.UPDATE_PRIORITY,H),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_PRIORITY_CHANGED,{annotationId:e,commentType:this.commentService.getCommentType(_),oldPriority:_.priority,newPriority:t,commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource}),H}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updatePriority: ",h),null}})}updateStatus(c,m){return Ae(this,arguments,function*({annotationId:e,status:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateStatus","color: green;");let h=this.authService.getUser();if(!h)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_=JSON.parse(JSON.stringify(_));let I=_.status?JSON.parse(JSON.stringify(_.status)):null;_.status=t,_.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(_,{type:Ze.STATUS_CHANGED,newStatus:t,oldStatus:I});let S=yield this.metadataService.getGlobalMetadata(),H={newStatus:t,oldStatus:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};return this.triggerAction(lt.UPDATE_STATUS,H),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_STATUS_CHANGED,{annotationId:e,commentType:this.commentService.getCommentType(_),oldStatus:I,newStatus:t,commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource,commentAnnotationCreatedAt:_.createdAt}),H}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updateStatus: ",h),null}})}updateAccess(c,m){return Ae(this,arguments,function*({annotationId:e,accessMode:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateAccess","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_)if(this.commentService.isPrivateCommentAllowed()){_=JSON.parse(JSON.stringify(_));let I=_.iam?.accessMode;_.iam.accessMode=t,this.commentService.saveComment(_,{type:Ze.ACCESS_MODE_CHANGED,newAccessMode:t,oldAccessMode:I});let S=yield this.metadataService.getGlobalMetadata(),H={newAccessMode:t,oldAccessMode:I,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:S};switch(this.triggerAction(lt.UPDATE_ACCESS,H),t){case cr.PRIVATE:this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCESS_MODE_CHANGED,{type:cr.PRIVATE,source:i??this.defaultSource});break;case cr.PUBLIC:this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCESS_MODE_CHANGED,{type:cr.PUBLIC,source:i??this.defaultSource});break;default:break}return H}else this.loggingService.catch("Access Denied","You must be an admin to update the access mode of the comment.");else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updateAccess: ",h),null}})}resolveCommentAnnotation(a){return Ae(this,arguments,function*({annotationId:e,options:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: resolveCommentAnnotation","color: green;");let i=this.authService.getUser();if(!i)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let c=this.commentService.getAnnotationById(e,t);if(c){c=JSON.parse(JSON.stringify(c));let m=this.customFilterService.resolvedStatus,h=c.status?JSON.parse(JSON.stringify(c.status)):null;m&&(c.status=m,c.statusUpdatedByUserId=i?.userId,this.commentService.saveComment(c,{type:Ze.STATUS_CHANGED,newStatus:m,oldStatus:h}));let _=yield this.metadataService.getGlobalMetadata(),I={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(c),metadata:_};return this.triggerAction(lt.RESOLVE_COMMENT,I),I}else this.triggerAnnotationNotFoundError(e);return null}catch(i){return this.loggingService.catch("Error in CommentActionsService resolveCommentAnnotation: ",i),null}})}getLink(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getLink","color: green;");let m=this.commentService.getAnnotationById(e,t);if(m){let h=this.commentService.getCommentUrl(m)??null,_=yield this.metadataService.getGlobalMetadata();return{link:h,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:_}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService getLink: ",m),null}})}copyLink(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: copyLink","color: green;");let m=yield this.getLink({annotationId:e,options:t},a);if(m?.link){Db(m.link),this.commentService.setCopyLink(m.link),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_LINK_COPIED,{annotationId:e,commentType:this.commentService.getCommentType(m.commentAnnotation),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource,link:m.link});let h=yield this.metadataService.getGlobalMetadata(),_={link:m.link,annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m.commentAnnotation),metadata:h};return this.triggerAction(lt.COPY_LINK,_),_}return null}catch(m){return this.loggingService.catch("Error in CommentActionsService copyLink: ",m),null}})}addComment(_,I){return Ae(this,arguments,function*({annotationId:e,comment:t,assignedTo:a,assigned:i,options:c,visibility:m},h){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addComment","color: green;");let S=this.authService.getUser();if(!S)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;if(S){let H=this.commentService.getAnnotationById(e,c),$=H?.comments?.length?Ze.ADDED:Ze.NEWLY_ADDED;if(H){H.status.type==="terminal"&&(H.status=this.customFilterService.defaultStatus);let j=new qn;j=g(g({},j),t),j.lastUpdated=new Date,j.attachments||(j.attachments=[]),j.attachments=j.attachments.filter(le=>le?.attachmentId),j.createdAt=this.timestamp,j.from=S,a&&(H.assignedTo=a),this.commentService.saveComment(H,{type:$,updatedComment:j,assigned:i,visibility:m,_dispatchAddCommentEvent:!0});let Z=f(g({},H),{comments:[...H.comments||[],j]}),re=yield this.buildAddCommentEvent({annotation:Z,newComment:j});if(!re)return null;let se=t?.commentId,_e=this.calculateCommentThreadIndex(t,H);return this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ADDED,{annotationId:e,commentThreadId:se,commentThreadIndex:_e,commentType:this.commentService.getCommentType(H),commentMode:this.commentService.getCommentMode(),source:h??this.defaultSource,commentAnnotationCreatedAt:H.createdAt,taggedClientUserIds:j.taggedUserContacts?.map(le=>le.contact?.userId).filter(le=>!!le),taggedSnippylyUserIds:j.taggedUserContacts?.filter(le=>!!H?.metadata?.apiKey&&!!le.contact?.userId).map(le=>Ng(H.metadata.apiKey,le.contact.userId))}),re}else this.triggerAnnotationNotFoundError(e)}return null}catch(S){return this.loggingService.catch("Error in CommentActionsService addComment: ",S),null}})}buildAddCommentEvent(a){return Ae(this,arguments,function*({annotation:e,newComment:t}){try{let i=yield this.metadataService.getGlobalMetadata();return{annotationId:e.annotationId,commentId:t?.commentId,comment:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:i}}catch(i){return this.loggingService.catch("Error in CommentActionsService buildAddCommentEvent: ",i),null}})}triggerAddCommentEvent(a){return Ae(this,arguments,function*({annotation:e,newComment:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: triggerAddCommentEvent","color: green;");let i=yield this.buildAddCommentEvent({annotation:e,newComment:t});return i&&this.triggerAction(lt.ADD_COMMENT,i),i}catch(i){return this.loggingService.catch("Error in CommentActionsService triggerAddCommentEvent: ",i),null}})}approveCommentAnnotation(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: approveCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t);if(m){m.approved=!0,this.commentService.saveComment(m,{type:Ze.APPROVED}),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_APPROVED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource});let h=yield this.metadataService.getGlobalMetadata(),_={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:h};return this.triggerAction(lt.APPROVE_COMMENT_ANNOTATION,_),_}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService approveComment: ",m),null}})}acceptCommentAnnotation(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: acceptCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=m.status?JSON.parse(JSON.stringify(m.status)):null;m.status=X.CommentAcceptStatus,m.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(m,{type:Ze.ACCEPTED,oldStatus:_,newStatus:X.CommentAcceptStatus});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:I,actionUser:h,replaceContentHtml:m?.comments?.length?m?.comments[0]?.replaceContentHtml:void 0,replaceContentText:m?.comments?.length?m?.comments[0]?.replaceContentText:void 0};return this.triggerAction(lt.ACCEPT_COMMENT_ANNOTATION,S),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCEPTED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService acceptCommentAnnotation: ",m),null}})}rejectCommentAnnotation(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: rejectCommentAnnotation","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=m.status?JSON.parse(JSON.stringify(m.status)):null;m.status=X.CommentRejectStatus,m.statusUpdatedByUserId=h?.userId,this.commentService.saveComment(m,{type:Ze.REJECTED,oldStatus:_,newStatus:X.CommentRejectStatus});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:I,actionUser:h,replaceContentHtml:m?.comments?.length?m?.comments[0]?.replaceContentHtml:void 0,replaceContentText:m?.comments?.length?m?.comments[0]?.replaceContentText:void 0};return this.triggerAction(lt.REJECT_COMMENT_ANNOTATION,S),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_REJECTED,{annotationId:e,commentType:this.commentService.getCommentType(m),commentMode:this.commentService.getCommentMode(),source:a??this.defaultSource}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService rejectCommentAnnotation: ",m),null}})}ensureSuggestionObject(e){try{if(!e||e?.suggestion||!(e?.type==="suggestion"||e?.commentType==="suggestion"))return;e.suggestion={status:"pending",targetId:"",targetType:"custom",oldValue:null,newValue:null,summary:null,driftDetected:!1,rejectReason:null,resolvedBy:null,resolvedAt:null}}catch(t){this.loggingService.catch("Error in CommentActionsService ensureSuggestionObject: ",t)}}acceptSuggestion(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: acceptSuggestion","color: green;");let m=this.authService.getUser();if(!m)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let h=this.commentService.getAnnotationById(e,t);if(!h)return this.triggerAnnotationNotFoundError(e),null;if(this.ensureSuggestionObject(h),!(h.type==="suggestion"||h.commentType==="suggestion")||!h.suggestion||h.suggestion.status!=="pending")return null;let _=h.suggestion.targetId;if(_){if(!this.targetRegistry.getNode(_)){h.suggestion.status="stale",h.suggestion.resolvedBy=m,h.suggestion.resolvedAt=this.timestamp,h.statusUpdatedByUserId=m?.userId,this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"stale",targetId:_}),this.commentService.updateComment(h),this.suggestionActions.projectAndTrigger(Ig.SUGGESTION_STALE,h);let Z=yield this.metadataService.getGlobalMetadata(),re={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:Z,actionUser:m};return this.triggerAction(lt.SUGGESTION_ACCEPTED,re),re}let $=this.targetRegistry.getGetter(_),j=!1;if($)try{let Z=$();j=!ln(Z,h.suggestion.oldValue)}catch{j=!1}h.suggestion.driftDetected=j}h.suggestion.status="accepted",h.suggestion.resolvedBy=m,h.suggestion.resolvedAt=this.timestamp,h.statusUpdatedByUserId=m?.userId,h.type="comment",h?.agent?.agentFields&&typeof h.agent.agentFields=="object"&&Array.isArray(h.agent.agentFields)&&(h.agent.agentFields=h.agent.agentFields.filter(H=>H!=="status:suggestion"),h.agent.agentFields.includes("status:accepted")||h.agent.agentFields.push("status:accepted")),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"accepted",targetId:_,driftDetected:h.suggestion?.driftDetected}),this.commentService.saveComment(h,{type:Ze.SUGGESTION_ACCEPTED}),this.suggestionActions.projectAndTrigger(Ig.SUGGESTION_APPROVED,h),this.analyticsService.trackEvent(oe.Events.Comments.SUGGESTION_ACCEPTED,{annotationId:e});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(h),metadata:I,actionUser:m};return this.triggerAction(lt.SUGGESTION_ACCEPTED,S),S}catch(m){return this.loggingService.catch("Error in CommentActionsService acceptSuggestion: ",m),null}})}rejectSuggestion(c,m){return Ae(this,arguments,function*({annotationId:e,reason:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: rejectSuggestion","color: green;");let h=this.authService.getUser();if(!h)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(!_)return this.triggerAnnotationNotFoundError(e),null;if(this.ensureSuggestionObject(_),!(_.type==="suggestion"||_.commentType==="suggestion")||!_.suggestion||_.suggestion.status!=="pending")return null;_.suggestion.status="rejected",_.suggestion.rejectReason=t??null,_.suggestion.resolvedBy=h,_.suggestion.resolvedAt=this.timestamp,_.statusUpdatedByUserId=h?.userId,_.type="comment",_?.agent?.agentFields&&typeof _.agent.agentFields=="object"&&Array.isArray(_.agent.agentFields)&&(_.agent.agentFields=_.agent.agentFields.filter(H=>H!=="status:suggestion"),_.agent.agentFields.includes("status:rejected")||_.agent.agentFields.push("status:rejected")),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_REJECT_BUTTON_CLICKED,{annotationId:e,commentType:"suggestion",suggestionOutcome:"rejected",targetId:_.suggestion.targetId}),this.commentService.saveComment(_,{type:Ze.SUGGESTION_REJECTED}),this.suggestionActions.projectAndTrigger(Ig.SUGGESTION_REJECTED,_),this.analyticsService.trackEvent(oe.Events.Comments.SUGGESTION_REJECTED,{annotationId:e});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:I,actionUser:h,rejectReason:t??null};return this.triggerAction(lt.SUGGESTION_REJECTED,S),S}catch(h){return this.loggingService.catch("Error in CommentActionsService rejectSuggestion: ",h),null}})}toggleNotificationSubscription(i,c){return Ae(this,arguments,function*({annotationId:e,options:t},a){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: toggleNotificationSubscription","color: green;");let m=this.commentService.getAnnotationById(e,t),h=this.authService.getUser();if(m&&h){let _=ur(h.userId);if(_){m.subscribedUsers||(m.subscribedUsers={}),m.unsubscribedUsers||(m.unsubscribedUsers={});let I,S=!1;if(m?.unsubscribedUsers?.[_])S=!1;else if(m?.subscribedUsers?.[_])S=!0;else{let j=this.contactService.getCurrentOrganizationUserIAM();if(j){let Z=j.groups||{};Object.keys(Z).forEach(re=>{m?.subscribedGroups?.[re]&&(S=!0)})}}if(a==="subscribe"||!a&&!S)delete m.unsubscribedUsers[_],m.subscribedUsers[_]={user:h,type:"manual"},I=Ze.SUBSCRIBED;else if(a==="unsubscribe"||!a&&S)delete m.subscribedUsers[_],m.unsubscribedUsers[_]={user:h,type:"manual"},I=Ze.UNSUBSCRIBED;else return null;this.commentService.saveComment(m,{type:I});let H=yield this.metadataService.getGlobalMetadata(),$={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:H};return I===Ze.SUBSCRIBED?this.triggerAction(lt.SUBSCRIBE_COMMENT_ANNOTATION,$):this.triggerAction(lt.UNSUBSCRIBE_COMMENT_ANNOTATION,$),$}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService toggleNotificationSubscription: ",m),null}})}assignUser(c,m){return Ae(this,arguments,function*({annotationId:e,assignedTo:t,options:a},i){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: assignUser","color: green;"),!this.authService.getUser())return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;let _=this.commentService.getAnnotationById(e,a);if(_){_.assignedTo=t,this.commentService.saveComment(_,{type:Ze.ASSIGNED,assignedTo:t});let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,assignedTo:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:I};return this.triggerAction(lt.ASSIGN_USER,S),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ASSIGNED,{annotationId:e,commentType:this.commentService.getCommentType(_),commentMode:this.commentService.getCommentMode(),source:i??this.defaultSource,assignedToUserId:t?.userId}),S}else this.triggerAnnotationNotFoundError(e);return null}catch(h){return this.loggingService.catch("Error in CommentActionsService assignUser: ",h),null}})}getComment(a){return Ae(this,arguments,function*({annotationId:e,options:t}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getComment","color: green;");let i=this.commentService.getAnnotationById(e,t);return i?i.comments||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(i){return this.loggingService.catch("Error in CommentActionsService getComment: ",i),[]}})}updateOrDeleteComment(e,t,a,i,c,m){return Ae(this,null,function*(){try{if(this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateOrDeleteComment","color: green;"),t?.commentText?.trim()||t?.attachments?.length||t?.recorders?.length||lp(t)){let h=this.authService.getUser();if(this.isUserAdmin||h?.userId===t?.from?.userId){t.lastUpdated=new Date,t.status=Ze.UPDATED,!t.isEdited&&Kc(m)&&(t.isEdited=!0,t.editedAt=new Date),this.commentService.saveComment(e,{type:Ze.UPDATED,updatedComment:t});let _=yield this.metadataService.getGlobalMetadata(),I={annotationId:e?.annotationId,commentId:t?.commentId,comment:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:_};return this.triggerAction(lt.UPDATE_COMMENT,I),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_EDITED,{annotationId:e?.annotationId,commentThreadId:t?.commentId,commentType:this.commentService.getCommentType(e),commentMode:this.commentService.getCommentMode(),source:c??this.defaultSource}),I}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to update it.")}else yield this.deleteComment({annotationId:e?.annotationId,commentId:t.commentId,skipDeleteThreadConfirmation:a,options:i});return null}catch(h){return this.loggingService.catch("Error in CommentActionsService updateOrDeleteComment: ",h),null}})}updateComment(h,_){return Ae(this,arguments,function*({annotationId:e,comment:t,skipDeleteThreadConfirmation:a,merge:i,options:c},m){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateComment","color: green;");let I=this.commentService.getAnnotationById(e,c),S=this.authService.getUser();if(!S)return this.loggingService.catch("User not found. Ensure Identify method is called.",void 0,void 0,!0),null;if(I&&S){this.commentService.spliceProgressCommentsIn(I);try{let H=t,$=I.comments?.find(j=>j.commentId===t.commentId);if($){if(this.isUserAdmin||S?.userId===$?.from?.userId)return I?.status.type==="terminal"&&(I.status=this.customFilterService.defaultStatus),i&&(H=g(g({},$),t)),H.from=$.from,H.createdAt=$.createdAt,H.lastUpdated=new Date,yield this.updateOrDeleteComment(I,H,a,c,m,$);this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to update it.")}}finally{this.commentService.restoreProgressCommentSplit(I)}}else this.triggerAnnotationNotFoundError(e);return null}catch(I){return this.loggingService.catch("Error in CommentActionsService updateComment: ",I),null}})}deleteComment(m,h){return Ae(this,arguments,function*({annotationId:e,commentId:t,skipDeleteThreadConfirmation:a,options:i},c){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteComment","color: green;");let _=this.commentService.getAnnotationById(e,i),I=this.authService.getUser();if(!_)return this.triggerAnnotationNotFoundError(e),null;this.commentService.spliceProgressCommentsIn(_);try{let S=_.comments?.find(re=>re?.commentId===t);if(!S)return null;if(!(this.isUserAdmin||I?.userId===S?.from?.userId))return this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete it."),null;let H=this.commentService.willDeleteWholeAnnotation(_,t),$=this.commentService.getCommentAnnotationForClient(_);if(!a&&!(yield this.commentService.confirmDeleteCommentIfRequired(_,S)))return null;this.commentService.saveComment(_,{type:Ze.DELETED,updatedComment:S,skipDeleteThreadConfirmation:!0});let j=yield this.metadataService.getGlobalMetadata(),Z={annotationId:e,commentId:t,commentAnnotation:$,comment:S,metadata:j};if(H){let re={annotationId:e,commentAnnotation:$,metadata:j};this.triggerAction(lt.DELETE_COMMENT_ANNOTATION,re)}else this.triggerAction(lt.DELETE_COMMENT,Z);return Z}finally{this.commentService.restoreProgressCommentSplit(_)}}catch(_){return this.loggingService.catch("Error in CommentActionsService deleteComment: ",_),null}})}addAttachment(c,m){return Ae(this,arguments,function*({annotationId:e,files:t,options:a},i){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: addAttachment","color: green;");let h=[],_=this.commentService.getAnnotationById(e,a);if(_||i==="internal"){let H=[];t.forEach($=>{let{valid:j,file:Z,maxAllowedSize:re,error:se}=this.validateFile($);j&&Z?H.push(this.uploadFile(Z,_||{}).then(_e=>({valid:j,file:Z,maxAllowedSize:re,error:se,attachment:_e||void 0}))):H.push(Promise.resolve({valid:j,file:Z,maxAllowedSize:re,error:se,attachment:void 0}))}),h=yield Promise.all(H)}else this.triggerAnnotationNotFoundError(e);let I=yield this.metadataService.getGlobalMetadata(),S={annotationId:e,commentAnnotation:_?this.commentService.getCommentAnnotationForClient(_):void 0,attachments:h,metadata:I};return this.triggerAction(lt.ADD_ATTACHMENT,S),h}catch(h){return this.loggingService.catch("Error in CommentActionsService addAttachment: ",h),[]}})}validateFile(e){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: validateFile","color: green;");let t=100*1024*1024;(e?.type?.includes("image")||e?.type?.includes("pdf"))&&(t=15*1024*1024);let a=e.size<=t;return{valid:a,file:e,maxAllowedSize:t,maxAllowedSizeInMB:t/1024/1024,error:a?void 0:`File size should be less than ${t/1024/1024} MB`}}catch(t){return this.loggingService.catch("Error in CommentActionsService validateFile: ",t),{valid:!1,maxAllowedSize:0,maxAllowedSizeInMB:0,error:"Error in validating file"}}}deleteAttachment(c){return Ae(this,arguments,function*({annotationId:e,commentId:t,attachmentId:a,options:i}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteAttachment","color: green;");let m=this.commentService.getAnnotationById(e,i);if(m){let h=m.comments?.find(I=>I?.commentId===t),_=m.metadata;if(h){let I=this.authService.getUser();if(this.isUserAdmin||I?.userId===h?.from?.userId){let S=h.attachments?.find(H=>H?.attachmentId===a);if(S){h.attachments=h.attachments?.filter(Z=>Z?.attachmentId!==a);let H={attachmentId:S.attachmentId,organizationId:_?.clientOrganizationId??_?.organizationId??null,documentId:_?.clientDocumentId??_?.documentId??null,folderId:_?.folderId??null,commentAnnotationId:m.annotationId,apiKey:_?.apiKey??null};yield this.commentService.deleteAttachment({attachment:S,metadata:H});let $=yield this.metadataService.getGlobalMetadata(),j={attachment:S,annotationId:e,commentId:t,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:$};return this.triggerAction(lt.DELETE_ATTACHMENT,j),this.updateComment({annotationId:e,comment:h,options:i}),j}}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete the attachment.")}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteAttachment: ",m),null}})}getAttachment(i){return Ae(this,arguments,function*({annotationId:e,commentId:t,options:a}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getAttachment","color: green;");let c=this.commentService.getAnnotationById(e,a);return c?c.comments?.find(h=>h?.commentId===t)?.attachments||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(c){return this.loggingService.catch("Error in CommentActionsService getAttachment: ",c),[]}})}uploadFile(e,t){return Ae(this,null,function*(){try{return this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: uploadFile","color: green;"),this.commentService.uploadFile(e,t)}catch(a){return this.loggingService.catch("Error in CommentActionsService uploadFile: ",a),null}})}getRecording(i){return Ae(this,arguments,function*({annotationId:e,commentId:t,options:a}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: getRecording","color: green;");let c=this.commentService.getAnnotationById(e,a);return c?c.comments?.find(h=>h?.commentId===t)?.recorders||[]:(this.triggerAnnotationNotFoundError(e),[])}catch(c){return this.loggingService.catch("Error in CommentActionsService getRecording: ",c),[]}})}deleteRecording(c){return Ae(this,arguments,function*({annotationId:e,commentId:t,recorderId:a,options:i}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: deleteRecording","color: green;");let m=this.commentService.getAnnotationById(e,i);if(m){let h=m.comments?.find(_=>_?.commentId===t);if(h){let _=this.authService.getUser();if(this.isUserAdmin||_?.userId===h?.from?.userId){let I=h.recorders?.find(S=>S?.id===a);if(I){h.recorders=h.recorders?.filter($=>$?.id!==a);let S=yield this.metadataService.getGlobalMetadata(),H={annotationId:e,commentId:t,recording:I,commentAnnotation:this.commentService.getCommentAnnotationForClient(m),metadata:S};return this.triggerAction(lt.DELETE_RECORDING,H),this.updateComment({annotationId:e,comment:h,skipDeleteThreadConfirmation:!0,options:i}),H}}else this.loggingService.catch("Access Denied","You must be the author of the comment or an admin to delete the recording.")}}else this.triggerAnnotationNotFoundError(e);return null}catch(m){return this.loggingService.catch("Error in CommentActionsService deleteRecording: ",m),null}})}fetchCommentAnnotations(e){return Ae(this,null,function*(){try{let t=yield this.commentService.fetchCommentAnnotations(e),a;if(t?.hasMore){let c=t?.data[t?.data?.length-1];a=yield xb(c?.lastUpdated?.toString()??"","veltencrypttoken","veltencrypttoken")}let i=t?.data?.reduce((c,m)=>(c[m.metadata.clientDocumentId??m.metadata.documentId]=c[m.metadata.clientDocumentId??m.metadata.documentId]||[],c[m.metadata.clientDocumentId??m.metadata.documentId].push(this.commentService.getCommentAnnotationForClient(m)),c),{});return g({data:i},t?.hasMore?{nextPageToken:a}:{})}catch(t){return this.loggingService.catch("Error in CommentActionsService fetchCommentAnnotations: ",t),{data:null}}})}toggleReaction(m,h){return Ae(this,arguments,function*({annotationId:e,commentId:t,reaction:a,options:i},c){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: toggleReaction","color: green;");let _=this.commentService.getAnnotationById(e,i),I=this.authService.getUser();if(_&&I){this.commentService.spliceProgressCommentsIn(_);try{let S=_.comments?.find(H=>H?.commentId===t);if(S){let H=yield this.reactionService?.addOrUpdateReaction(a.reactionId,S?.reactionAnnotationIds||[],void 0,void 0,_?.annotationId,a.customReaction,c),$=Ze.REACTION_ADDED;if(H){H?.reactions?.find(re=>re.from?.userId===I?.userId)||($=Ze.REACTION_DELETED),S.reactionAnnotationIds||(S.reactionAnnotationIds=[]),S.reactionAnnotationIds.includes(H.annotationId)||S.reactionAnnotationIds.push(H.annotationId),H?.reactions?.length||(S.reactionAnnotationIds=S.reactionAnnotationIds.filter(re=>re!==H.annotationId)),this.commentService.saveComment(_,{type:$,updatedComment:S});let j=yield this.metadataService.getGlobalMetadata(),Z={annotationId:e,commentId:t,reaction:H,commentAnnotation:this.commentService.getCommentAnnotationForClient(_),metadata:j};return c==="add"?this.triggerAction(lt.ADD_REACTION,Z):c==="delete"?this.triggerAction(lt.DELETE_REACTION,Z):this.triggerAction(lt.TOGGLE_REACTION,Z),$===Ze.REACTION_ADDED?this.analyticsService.trackEvent(oe.Events.Comments.REACTION_ADDED,{annotationId:e,commentId:t,reactionId:a.reactionId,commentMode:this.commentService.getCommentMode()}):$===Ze.REACTION_DELETED&&this.analyticsService.trackEvent(oe.Events.Comments.REACTION_DELETED,{annotationId:e,commentId:t,reactionId:a.reactionId,commentMode:this.commentService.getCommentMode()}),Z}}}finally{this.commentService.restoreProgressCommentSplit(_)}}else this.triggerAnnotationNotFoundError(e);return null}catch(_){return this.loggingService.catch("Error in CommentActionsService toggleReaction: ",_),null}})}onComposerClick(t){return Ae(this,arguments,function*({commentAnnotation:e}){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onComposerClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={commentAnnotation:e?.annotationId?this.commentService.getCommentAnnotationForClient(e):void 0,metadata:a};this.triggerAction(lt.COMPOSER_CLICKED,i)}catch(a){this.loggingService.catch("Error in CommentActionsService onComposerClick: ",a)}})}onComposerTextChange(e){return Ae(this,null,function*(){try{let t=yield this.metadataService.getGlobalMetadata(),a={text:e.text,annotation:e.annotation,targetComposerElementId:e.targetComposerElementId,metadata:t};this.commentService.setComposerData(e.targetComposerElementId,a),this.triggerAction(lt.COMPOSER_TEXT_CHANGE,a)}catch(t){this.loggingService.catch("Error in CommentActionsService onComposerTextChange: ",t)}})}autocompleteSearch(e){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: autocompleteSearch","color: green;");let t=yield this.metadataService.getGlobalMetadata();e.metadata=t,this.triggerAction(lt.AUTOCOMPLETE_SEARCH,e)}catch(t){this.loggingService.catch("Error in CommentActionsService autocompleteSearch: ",t)}})}onCommentPinClick(e){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentPinClick","color: green;");let t=yield this.metadataService.getGlobalMetadata(),a={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:t};return this.triggerAction(lt.COMMENT_PIN_CLICKED,a),a}catch(t){return this.loggingService.catch("Error in CommentActionsService onCommentPinClick: ",t),null}})}onCommentBubbleClick(e){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentBubbleClick","color: green;");let t=yield this.metadataService.getGlobalMetadata(),a={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),metadata:t};return this.triggerAction(lt.COMMENT_BUBBLE_CLICKED,a),a}catch(t){return this.loggingService.catch("Error in CommentActionsService onCommentBubbleClick: ",t),null}})}onCommentToolClick(e,t){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentToolClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={context:e,targetElementId:t,metadata:a},c={context:e,targetElementId:t,metadata:a};return this.triggerAction(lt.COMMENT_TOOL_CLICK,i),this.triggerAction(lt.COMMENT_TOOL_CLICKED,c),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onCommentToolClick: ",a),null}})}onSidebarButtonClick(){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onSidebarButtonClick","color: green;");let e=yield this.metadataService.getGlobalMetadata(),t={metadata:e},a={metadata:e};return this.triggerAction(lt.SIDEBAR_BUTTON_CLICK,t),this.triggerAction(lt.SIDEBAR_BUTTON_CLICKED,a),t}catch(e){return this.loggingService.catch("Error in CommentActionsService onSidebarButtonClick: ",e),null}})}onAttachmentDownloadClick(e,t){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onAttachmentDownloadClick","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),attachment:t,metadata:a};return this.triggerAction(lt.ATTACHMENT_DOWNLOAD_CLICKED,i),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onAttachmentDownloadClick: ",a),null}})}onCommentSaveTriggered(e,t){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onCommentSaveTriggered","color: green;");let a=yield this.metadataService.getGlobalMetadata(),i={annotationId:e,commentAnnotation:this.commentService.getCommentAnnotationForClient(t),metadata:a};return this.triggerAction(lt.COMMENT_SAVE_TRIGGERED,i),i}catch(a){return this.loggingService.catch("Error in CommentActionsService onCommentSaveTriggered: ",a),null}})}onVisibilityOptionClick(e,t,a){return Ae(this,null,function*(){try{this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: onVisibilityOptionClick","color: green;");let i=yield this.metadataService.getGlobalMetadata(),c={annotationId:e.annotationId,commentAnnotation:this.commentService.getCommentAnnotationForClient(e),visibility:t,users:a?.map(m=>Rb(m)).filter(Boolean),metadata:i};return this.triggerAction(lt.VISIBILITY_OPTION_CLICKED,c),c}catch(i){return this.loggingService.catch("Error in CommentActionsService onVisibilityOptionClick: ",i),null}})}convert(e){try{if(e?.options){let{documentId:t,organizationId:a}=this.docService.getServerId(e?.options);e.options=f(g({},e?.options),{documentId:t,organizationId:a})}return this}catch(t){return this.loggingService.catch("Error in CommentActionsService convert: ",t),this}}emitCommentActionClicked(e){return Ae(this,null,function*(){try{let t=yield this.metadataService.getGlobalMetadata(),a=f(g(g({action:e.action,actionId:e.action?.id,scope:e.scope,annotationId:e.annotationId},e.commentId!==void 0?{commentId:e.commentId}:{}),e.comment!==void 0?{comment:e.comment}:{}),{commentAnnotation:this.commentService.getCommentAnnotationForClient(e.annotation),actionUser:this.authService.getUser(),metadata:t});return this.triggerAction(lt.COMMENT_ACTION_CLICKED,a),a}catch(t){return this.loggingService.catch("Error in CommentActionsService emitCommentActionClicked: ",t),null}})}triggerAction(e,t){try{this.actionSubjects.has(e)||this.actionSubjects.set(e,new jt),this.actionSubjects.get(e)?.next(t)}catch(a){this.loggingService.catch("Error in CommentActionsService triggerAction: ",a)}}onAction(e){try{return this.actionSubjects.has(e)||this.actionSubjects.set(e,new jt),this.actionSubjects.get(e)?.asObservable()}catch(t){return this.loggingService.catch("Error in CommentActionsService onAction: ",t),Ee(null)}}get timestamp(){return this.commonDbService.getServerTimestamp()}getCommentAnnotations(e){try{if(e){if(e?.allDocuments&&!e?.folderId)return this.loggingService.catch("folderId is required when allDocuments is true."),Ee({data:null});if(!e?.allDocuments&&!e?.documentIds?.length)return this.loggingService.catch("documentIds is required."),Ee({data:null})}return this.commentService.getAllCommentAnnotations({excludeDomChanges:!0,skipPositionCalculation:!0,query:e,addFilterCommentsOnDomCheck:!0}).pipe(Te(t=>t?t.reduce((a,i)=>{let c=i.metadata?.clientDocumentId;return!c||e?.documentIds&&!e?.documentIds?.includes(c)||(a[c]||(a[c]=[]),a[c].push(i)),a},{}):null),Te(t=>({data:t})))}catch(t){return this.loggingService.catch("Error in CommentActionsService getCommentAnnotation: ",t),Ee({data:null})}}getCommentAnnotationsCount$(e){try{return this.commentViewsService.getAnnotationsCount(e).pipe(Te(t=>t||{data:null}))}catch(t){return this.loggingService.catch("Error in CommentActionsService getCommentAnnotation: ",t),Ee({data:null})}}updateVisibility(e){this.loggingService.log("%c[WB] Calling CommentActionsService FUNCTION: updateVisibility","color: green;");try{let t=e.annotationId;if(!t)throw new Error("annotationId is required in visibility config");if(e.type==="restricted"){let h=this.authService.getUser();if(!h?.userId)throw new Error("Current user not found. Cannot set restricted visibility without userIds.");e=eo(e,h.userId)}if(e.type==="organizationPrivate"&&!e.organizationId&&!e.organizationIds?.length){let h=this.authService.getUser()?.clientOrganizationId;if(!h)throw new Error("No organizationId found. Cannot set organizationPrivate visibility without organizationId.");e=f(g({},e),{organizationId:h})}this.analyticsService.trackEvent(oe.Events.Comments.UPDATE_VISIBILITY_TRIGGERED,{payload:{annotationId:t,visibility:e}});let a=this.commentService.getCommentAnnotationByIdSync(t)?.from?.userId,i=a??this.authService.getUser()?.userId;a||this.loggingService.warn(`updateVisibility: annotation ${t} not in local cache \u2014 falling back to current user for the author access token`);let c=An(e,i),m=Pn(e,i);return this.commentService.updateCommentAnnotationContext(t,{_setAccessFields:c,_setVisibilityConfig:m},{merge:!0})}catch(t){return this.loggingService.catch("Error in updateVisibility: ",t),Promise.resolve()}}calculateCommentThreadIndex(e,t){try{let a=e?.commentId,i;return a&&(i=t?.comments?.findIndex(c=>c.commentId===a)),i===-1&&(i=t?.comments?.length),i}catch(a){this.loggingService.catch("Error in calculateCommentThreadIndex: ",a);return}}};o.\u0275fac=function(t){return new(t||o)(be(sr),be(ot),be(ae),be(eu),be($t),be(Dt),be(ut),be(Dr),be(A),be($g),be(ro),be(kr),be(Kg),be(Yg))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var tu=(()=>{let o=class o{constructor(e){this.loggingService=e,this.commentTextData$=new De({});try{this.loggingService.log("%c[WB] Creating CLASS: CommentTextService","color: blue;")}catch(t){this.loggingService.catch("Error in CommentTextService constructor: ",t)}}setCommentTextData(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: setCommentTextData","color: green;");let t=e.annotationId||e.multiThreadAnnotationId;if(t){let a=e.componentId,i=this.commentTextData$.getValue();i[t]||(i[t]={}),i[t][a]=e,this.commentTextData$.next(i),this.updateLastPositionInDataByAnnotationId(t)}}catch(t){this.loggingService.catch("Error in CommentTextService setCommentTextData: ",t)}}removeCommentTextData(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: removeCommentTextData","color: green;");let t=e.annotationId||e.multiThreadAnnotationId;if(t){let a=e.componentId,i=this.commentTextData$.getValue();delete i[t][a],this.commentTextData$.next(i),this.updateLastPositionInDataByAnnotationId(t)}}catch(t){this.loggingService.catch("Error in CommentTextService removeCommentTextData: ",t)}}updateLastPositionInDataByAnnotationId(e){try{this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: updateLastPositionInDataByAnnotationId","color: green;");let t=this.commentTextData$.getValue();Object.values(t[e]).forEach(a=>{a.last=this.checkIfLast(a)}),this.commentTextData$.next(t)}catch(t){this.loggingService.catch("Error in CommentTextService updateLastPositionInDataByAnnotationId: ",t)}}checkIfLast(e){try{if(this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: checkIfLast","color: green;"),e?.elementRef?.nativeElement){let t=e.elementRef.nativeElement.getRootNode(),a=t instanceof Document||t instanceof ShadowRoot?t:document,i=[];if(e.annotationId?i=Array.from(a.querySelectorAll(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.ANNOTATION_ID}="${e.annotationId}"]`)):e.multiThreadAnnotationId&&(i=Array.from(a.querySelectorAll(`${X.TAGS.VELT_COMMENT_TEXT}[${X.ATTRIBUTES.MULTI_THREAD_ANNOTATION_ID}="${e.multiThreadAnnotationId}"]`))),i.length&&i[i.length-1]===e.elementRef.nativeElement)return!0}return!1}catch(t){return this.loggingService.catch("Error in CommentTextService checkIfLast: ",t),!1}}getCommentTextDataByAnnotationIdAndComponentId(e,t){try{return this.loggingService.log("%c[WB] Calling CommentTextService FUNCTION: getCommentTextDataByAnnotationIdAndComponentId","color: green;"),this.commentTextData$.pipe(Te(a=>a&&e&&t&&a[e]?a[e][t]:null))}catch(a){return this.loggingService.catch("Error in CommentTextService getCommentTextDataByAnnotationIdAndComponentId: ",a),Ee(null)}}};o.\u0275fac=function(t){return new(t||o)(be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function ru(r,o){return r?{commentPinSelected:!0,textClicked:!!o}:{commentPinSelected:!1,textClicked:!1}}function nu(r,o,n){return r!=null&&r===o&&!!n}function Of(r){return r instanceof Document||r instanceof ShadowRoot?r:document}function Ef(r,o){let n=e=>{if(!e)return null;let t=null;return(e instanceof Document||e instanceof DocumentFragment)&&(t=e.getElementById(`comment-pin-container-${o}`)),t||e.querySelector(`[data-velt-id='${o}']`)||null};return n(r)||(r!==document?n(document):null)}var T2=["overlay"],O2=()=>["snippyly-overlay-panel","velt-overlay-panel"];function E2(r,o){if(r&1&&E(0,"span",8),r&2){let n,e=l().ngIf;pe("index-3-digit",(e.commentPinAnnotation==null||e.commentPinAnnotation.annotationNumber==null||(n=e.commentPinAnnotation.annotationNumber.toString())==null?null:n.length)===3),k("data-comment-annotation-number","#"+(e.commentPinAnnotation==null?null:e.commentPinAnnotation.annotationNumber))}}function M2(r,o){if(r&1){let n=Y();u(0),b(1,"velt-multi-thread-comment-dialog-internal",10),z("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))})("pointerUp",function(t){B(n);let a=l(3);return V(a.togglePinSelection(t))}),x(),p()}if(r&2){let n=l(2).ngIf;d(),v("multiThreadAnnotationId",n.commentPinAnnotation.annotationId)("annotation",n.commentPinAnnotation)("user",n.user)("commentPinSelected",n.commentPinSelected)}}function A2(r,o){if(r&1){let n=Y();b(0,"velt-comment-dialog-internal",11),z("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))}),x()}if(r&2){let n=l(2).ngIf;v("annotation",n.commentPinAnnotation)("user",n.user)("commentPinSelected",n.commentPinSelected)("inlineCommentMode",n.inlineCommentMode)("isInsidePdfViewer",n.isInsidePdfViewer)}}function P2(r,o){if(r&1&&s(0,M2,2,4,"ng-container",9)(1,A2,1,5,"ng-template",null,2,je),r&2){let n=we(2),e=l().ngIf;v("ngIf",(e==null||e.commentPinAnnotation==null?null:e.commentPinAnnotation.type)==="multiThread")("ngIfElse",n)}}function F2(r,o){if(r&1){let n=Y();b(0,"snippyly-comment-bottom-sheet",12),z("saveComment",function(t){B(n);let a=l(2);return V(a.saveComment(t))}),x()}if(r&2){let n=l().ngIf;v("annotation",n.commentPinAnnotation)("user",n.user)("isInsidePdfViewer",n.isInsidePdfViewer)}}function N2(r,o){if(r&1){let n=Y();u(0),b(1,"snippyly-comment-text",4,0),z("pointerover",function(t){return B(n),l().onPointerOver(t),V(t.stopPropagation())})("pointerout",function(){B(n);let t=l();return V(t.onPointerOut())})("pointerdown",function(t){return B(n),V(t.stopPropagation())})("pointerup",function(t){return B(n),l().togglePinSelection(),V(t.stopPropagation())})("touchend",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())})("click",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())}),x(),s(3,E2,1,3,"span",5)(4,P2,3,2,"ng-template",6,1,je)(6,F2,1,3,"snippyly-comment-bottom-sheet",7),p()}if(r&2){let n=o.ngIf,e=we(2),t=l();d(),pe("inline-comment-mode",n.inlineCommentMode&&!n.isInsidePdfViewer)("agent-comment",(n.commentPinAnnotation==null?null:n.commentPinAnnotation.sourceType)==="agent")("selected",n.commentPinHover||n.commentPinSelected),d(2),v("ngIf",n.last&&n.showCommentIndex&&(n.commentPinAnnotation==null?null:n.commentPinAnnotation.annotationNumber)),d(),v("cdkConnectedOverlayOrigin",e)("cdkConnectedOverlayOpen",(!n.mobileMode||!n.isPhone)&&!n.inboxMode&&!n.streamMode&&(!n.inlineCommentMode||n.isInsidePdfViewer)&&n.floatingCommentsEnabled&&(n.textClicked&&n.commentPinSelected||n.commentPinHover&&!n.commentPinSelected))("cdkConnectedOverlayOffsetY",n.overlayOriginY==="top"?-8:2)("cdkConnectedOverlayPanelClass",vt(17,O2))("cdkConnectedOverlayBackdropClass","snippyly-overlay-backdrop")("cdkConnectedOverlayLockPosition",!1)("cdkConnectedOverlayPositions",t.positions)("cdkConnectedOverlayGrowAfterOpen",!0)("cdkConnectedOverlayDisableClose",!0),d(2),v("ngIf",(n==null?null:n.user)&&n.mobileMode&&n.isPhone&&!n.sidebarVisible&&(!n.inlineCommentMode||n.isInsidePdfViewer)&&!n.inboxMode&&!n.streamMode&&n.floatingCommentsEnabled&&n.textClicked&&n.commentPinSelected)}}var ou=(()=>{let o=class o{onEnter(e){this.onKeyupEnter&&this.onKeyupEnter()}constructor(e,t,a,i,c,m,h,_){this.analyticsService=e,this.authService=t,this.breakpointObserver=a,this.domService=i,this.commentService=c,this.loggingService=m,this.serviceBook=h,this.elementRef=_,this.subscriptions=[],this.selectedAnnotationsMap={},this.customScrollableParentEventsListenersSubscriptions=[],this.isDialogOnHoverEnabled=!1,this.componentConfigSignal=Me({inlineCommentMode:!1,isInsidePdfViewer:!1,commentPinHover:!1,commentPinSelected:!1,first:!1,last:!1,showCommentIndex:!1,commentPinAnnotation:null,isPhone:!1,mobileMode:!1,streamMode:!1,inboxMode:!1,textClicked:!1,floatingCommentsEnabled:!0,sidebarVisible:!1,user:null,overlayOriginX:"start",overlayOriginY:"top"}),this.positions=X.OVERLAY_POSITIONS.map(I=>new on({originX:I.originX,originY:I.originY},{overlayX:I.overlayX,overlayY:I.overlayY})),this.veltElement=!0,this.componentId="velt-comment-text-portal",this.subscriptions.push(this.authService.getUser$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{user:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getUser$ subscription: ",I)})),this.subscriptions.push(this.commentService.getSidebarVisibility$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{sidebarVisible:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getSidebarVisibility$ subscription: ",I)})),this.subscriptions.push(this.commentService.showFloatingComments$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{floatingCommentsEnabled:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent showFloatingComments$ subscription: ",I)})),this.subscriptions.push(this.commentService.getShowCommentIndex().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{showCommentIndex:I}),S))},I=>{this.catchError("Error in CommentTextPortalComponent getShowCommentIndex subscription: ",I)})),this.subscriptions.push(this.commentService.getEnableDialogOnHover$().subscribe(I=>{this.isDialogOnHoverEnabled=I},I=>{this.catchError("Error in CommentPinComponent getEnableDialogOnHover subscription: ",I)})),this.subscriptions.push(this.breakpointObserver.observe(Zn.XSmall).subscribe(I=>{let S=!1;I.matches?S=!0:S=!1,this.componentConfigSignal.update(H=>(H=f(g({},H),{isPhone:S}),H))},I=>{this.catchError("Error in CommentTextPortalComponent breakpointObserver subscription: ",I)}))}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in CommentTextPortalComponent ngOnInit:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentTextPortalComponent setupA11yAttributes:",e)}}ngAfterViewInit(){try{let e=this.element.childNodes[0];this.element.childNodes[1].childNodes[0].appendChild(e),this.componentConfigSignal.update(a=>{let i=zv(this.element,X.ATTRIBUTES.VELT_PDF_VIEWER);return a=f(g({},a),{isInsidePdfViewer:i}),a}),this.subscriptions.push(this.overlay?.positionChange?.subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{overlayOriginX:a.connectionPair.originX,overlayOriginY:a.connectionPair.originY}),i))},a=>{this.catchError("Error in CommentTextPortalComponent positionChange subscription: ",a)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(a=>{this.selectedAnnotationsMap=a,this.checkPinSelection()},a=>{this.catchError("Error in CommentTextPortalComponent getSelectedAnnotationsMap$ subscription: ",a)})),this.subscriptions.push(this.commentService.getStreamMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{streamMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getStreamMode$ subscription: ",a)})),this.subscriptions.push(this.commentService.getInboxMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{inboxMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getInboxMode subscription: ",a)})),this.subscriptions.push(this.commentService.getMobileMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{mobileMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getMobileMode$ subscription: ",a)})),this.subscriptions.push(this.commentService.getInlineCommentMode$().subscribe(a=>{this.componentConfigSignal.update(i=>(i=f(g({},i),{inlineCommentMode:a}),i))},a=>{this.catchError("Error in CommentTextPortalComponent getInlineCommentMode$ subscription: ",a)})),this.subscriptions.push(this.serviceBook.observe(dn).pipe(Pe(a=>a?.onInitRecording()??Wn)).subscribe(a=>{this.recorderInitConfig=a},a=>{this.catchError("Error in CommentTextPortalComponent onInitRecording subscription: ",a)}))}catch(e){this.catchError("Error in CommentTextPortalComponent AfterViewInit: ",e)}}setFirst(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{first:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setFirst: ",t)}}setLast(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{last:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setLast: ",t)}}setCommentPinAnnotation(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinAnnotation:e}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent setCommentPinAnnotation: ",t)}}setElement(e){try{this.element=e,this.element?this.customScrollableParents=Fg(this.element):this.customScrollableParents=[],this.addCustomScrollableParentsEventListeners()}catch(t){this.catchError("Error in CommentTextPortalComponent setElement: ",t)}}checkPinSelection(){try{let e=!!this.selectedAnnotationsMap[this.componentConfigSignal().commentPinAnnotation?.annotationId];this.componentConfigSignal.update(t=>{let a=ru(e,t.last);return g(g({},t),a)}),nu(sessionStorage.getItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID),this.componentConfigSignal().commentPinAnnotation.annotationId,this.componentConfigSignal().last)&&(this.componentConfigSignal.update(t=>(t=f(g({},t),{textClicked:!0}),t)),sessionStorage.removeItem(X.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID))}catch(e){this.catchError("Error in CommentTextPortalComponent checkPinSelection: ",e)}}onPointerOver(e){try{if(this.componentConfigSignal().commentPinHover)return;e.buttons?this.componentConfigSignal().commentPinHover&&this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinHover:!1}),t)):!this.componentConfigSignal().commentPinHover&&this.isDialogOnHoverEnabled&&this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinHover:!0}),t))}catch(t){this.catchError("Error in CommentTextPortalComponent onPointerOver: ",t)}}onPointerOut(){this.componentConfigSignal.update(e=>(e=f(g({},e),{commentPinHover:!1}),e))}togglePinSelection(e){try{if(this.recorderInitConfig?.isCommentRecording||this.componentConfigSignal().textClicked&&!e)return;let t=e||this.componentConfigSignal().commentPinAnnotation;if(this.selectedAnnotationsMap[t.annotationId])e||(document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}="${t?.annotationId}"]`)?this.domService.resetSelectedAnnotationsMap(!0,"comments"):(this.componentConfigSignal.update(i=>(i=f(g({},i),{textClicked:!0}),i)),this.domService.toggleAnnotationSelection(t)));else{let a=document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);if(a||(a=(this.domService.getDraftCommentAnnotationDialogs()||[])[0]),a){let i=a.getAttribute(X.ATTRIBUTES.VELT_ANNOTATION_DRAFT);if(i){let c=document.getElementById(`comment-pin-container-${i}`)||document.querySelector(`[data-velt-id='${i}']`);c&&(c.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),this.domService.resetSelectedAnnotationsMap(!0,"comments"))}}else this.domService.resetSelectedAnnotationsMap(!0,"comments"),this.componentConfigSignal.update(i=>(i=f(g({},i),{textClicked:!0}),i)),this.domService.toggleAnnotationSelection(t)}}catch(t){this.catchError("Error in CommentTextPortalComponent togglePinSelection: ",t)}}saveComment(e){try{this.commentService.saveComment(this.componentConfigSignal().commentPinAnnotation,e)}catch(t){this.catchError("Error in CommentTextPortalComponent saveComment: ",t)}}updateOverlayPosition(){try{this.loggingService.log("updateOverlayPosition",this.componentConfigSignal().commentPinAnnotation?.annotationId),this.overlay&&this.overlay?.overlayRef?.updatePosition()}catch(e){this.catchError("Error in CommentTextPortalComponent updateOverlayPosition: ",e)}}addCustomScrollableParentsEventListeners(){try{this.removeCustomScrollableParentsEventListeners(),this.customScrollableParents?.length&&this.customScrollableParents?.forEach(e=>{this.customScrollableParentEventsListenersSubscriptions.push(wn(e,"scroll").subscribe(t=>{this.updateOverlayPosition()},t=>{this.catchError("Error in CommentTextPortalComponent addCustomScrollableParentsEventListeners scroll subscription: ",t)}))})}catch(e){this.catchError("Error in CommentTextPortalComponent addCustomScrollableParentsEventListeners: ",e)}}removeCustomScrollableParentsEventListeners(){try{this.customScrollableParentEventsListenersSubscriptions.map(e=>{e.unsubscribe()}),this.customScrollableParentEventsListenersSubscriptions=[]}catch(e){this.catchError("Error in CommentTextPortalComponent removeCustomScrollableParentsEventListeners: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.removeCustomScrollableParentsEventListeners(),this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.catchError("Error in CommentTextPortalComponent unsubscribe: ",e)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.componentConfigSignal()?.commentPinAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(G(sr),G(ot),G(Kn),G(Ne),G(ae),G(A),G(kr),G(me))},o.\u0275cmp=T({type:o,selectors:[["snippyly-comment-text-portal"]],viewQuery:function(t,a){if(t&1&&ft(T2,5),t&2){let i;Ct(i=kt())&&(a.overlay=i.first)}},hostVars:1,hostBindings:function(t,a){t&1&&z("keyup.enter",function(c){return a.onEnter(c)},vg),t&2&&k("data-velt-element",a.veltElement)},standalone:!1,decls:1,vars:1,consts:[["trigger","cdkOverlayOrigin"],["overlay","cdkConnectedOverlay"],["commentDialogRef",""],[4,"ngIf"],["cdkOverlayOrigin","","data-velt-comment-disabled","true",1,"comment-text-highlight",3,"pointerover","pointerout","pointerdown","pointerup","touchend","click"],["class","comment-annotation-number",3,"index-3-digit",4,"ngIf"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayOffsetY","cdkConnectedOverlayPanelClass","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayLockPosition","cdkConnectedOverlayPositions","cdkConnectedOverlayGrowAfterOpen","cdkConnectedOverlayDisableClose"],[3,"annotation","user","isInsidePdfViewer","saveComment",4,"ngIf"],[1,"comment-annotation-number"],[4,"ngIf","ngIfElse"],[3,"saveComment","pointerUp","multiThreadAnnotationId","annotation","user","commentPinSelected"],[3,"saveComment","annotation","user","commentPinSelected","inlineCommentMode","isInsidePdfViewer"],[3,"saveComment","annotation","user","isInsidePdfViewer"]],template:function(t,a){t&1&&s(0,N2,7,18,"ng-container",3),t&2&&v("ngIf",a.componentConfigSignal())},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;margin:0;padding:0;height:inherit;width:inherit;text-align:inherit;line-height:inherit;font-size:inherit;text-transform:inherit;float:inherit;-webkit-text-fill-color:initial}*[_ngcontent-%COMP%]:empty{display:revert}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);font-family:inherit}.comment-text-highlight[_ngcontent-%COMP%]{cursor:pointer} snippyly-text-highlight.snippyly-text-highlight{color:var(--velt-black)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight{color:var(--velt-warning-hover);background-color:var(--velt-warning-transparent);border-bottom:1px solid var(--velt-warning-hover)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.selected{color:var(--velt-black);background-color:var(--velt-warning)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.agent-comment{color:var(--velt-agent-accent);background-color:var(--velt-agent-accent-transparent);border-bottom-color:var(--velt-agent-accent)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.agent-comment.selected{color:var(--velt-agent-accent);background-color:var(--velt-agent-accent-transparent)} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.inline-comment-mode{background-color:inherit} snippyly-text-highlight.snippyly-text-highlight .comment-text-highlight.inline-comment-mode.selected{background-color:inherit}.comment-annotation-number[_ngcontent-%COMP%]{border-radius:50%;border:1px solid var(--velt-gray);width:20px;height:20px;font-size:calc((.7rem + 0px) * var(--velt-base-rem-unit));display:inline-flex;justify-content:center;align-items:center;box-sizing:content-box;background:var(--velt-white);color:var(--velt-black);position:relative}.comment-annotation-number.index-3-digit[_ngcontent-%COMP%]{width:32px;height:32px}.comment-annotation-number[_ngcontent-%COMP%]:after{content:attr(data-comment-annotation-number);position:absolute;font-weight:400;letter-spacing:normal;word-spacing:normal}"],changeDetection:0});let r=o;return r})();var Yv=(()=>{let o=class o{constructor(e,t,a,i,c,m,h){this.docService=e,this.domService=t,this.commentService=a,this.componentFactoryResolver=i,this.injector=c,this.appRef=m,this.loggingService=h,this.commentsTextById={},this.commonAncestorElementObservers=new Map,this.commonAncestorElementObserverCounts=new Map,this.inlineCommentMode=!1,this.restrictTextSearchToAnchor=!1;try{this.commentService.getInlineCommentMode$().subscribe(_=>{this.inlineCommentMode=_}),this.commentService.getRestrictTextSearchToAnchor$().subscribe(_=>{this.restrictTextSearchToAnchor=_})}catch(_){this.loggingService.catch("Error in CommentPinPortalService constructor: ",_)}}updateTextCommentAnnotations(e){try{this.checkToRemoveTextCommentAnnotations(e),e.forEach(t=>{this.updateTextCommentAnnotation(t)})}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateTextCommentAnnotations: ",t)}}updateTextCommentAnnotation(e){let t=this.commentsTextById[e.annotationId];if(t)if(ln(t?.annotation?.targetTextRange,e?.targetTextRange)){let a=!1;t?.texts?.length?t.texts.forEach(i=>{document.body.contains(i?.textNode)||(a=!0)}):a=!0,a?(this.removeTextCommentAnnotation(e),this.getCommonAncestorContainer(e)):(t.texts.forEach(i=>{i.portalRef&&i.portalRef.instance.setCommentPinAnnotation(e)}),t.annotation=e)}else this.removeTextCommentAnnotation(e),this.getCommonAncestorContainer(e);else this.getCommonAncestorContainer(e)}getCommonAncestorContainer(e){try{let t=this.domService.getElementFromTargetTextRange(e?.targetTextRange);if(t&&this.domService.isElementVisible(t)){let a=t?.nodeType===Node.ELEMENT_NODE?t:t?.parentElement;this.commentsTextById[e.annotationId]={texts:[],annotation:e,commonAncestorContainer:t,commonAncestorElement:a,commonAncestorText:a?.textContent},this.setTextCommentPortal(e),this.observeCommonAncestorElementChanges(e)}else this.setGhostComment(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService getCommonAncestorContainer: ",t)}}setTextCommentPortal(e){try{let t=this.commentsTextById[e.annotationId];if(t){let a=this.domService.getElementFromTargetTextRange(e?.targetTextRange),i=document.body;if(e?.locationId&&this.docService.getLocation()?.locationId!==e?.locationId){let h=this.docService.getElementMapWithLocation();h[e?.locationId]&&(a=h[e?.locationId]?.element,i=a)}let c=this.resolveHighlightRange(e,a,i);if(c){let m=c.commonAncestorContainer?.nodeType===Node.ELEMENT_NODE?c.commonAncestorContainer:c.commonAncestorContainer?.parentElement??null;m&&t.commonAncestorElement&&!t.commonAncestorElement.contains(m)&&(t.commonAncestorElement=m,t.commonAncestorContainer=m,t.commonAncestorText=m.textContent);let h=bf(c),_=[],I=h?.find(S=>!S?.textContent);if(I&&I?.remove(),h=h?.filter(S=>S?.textContent),h&&h.length){let S=-1,H=-1;if(h.forEach(($,j)=>{this.textHighlighterClass?this.domService.addClassToElement($,this.textHighlighterClass):this.domService.addClassToElement($,$.tagName?.toLowerCase()),$.setAttribute(X.ATTRIBUTES.VELT_ID,e.annotationId);let Z=$.childNodes[0],re=new Cg(ou),se=new kg($,this.appRef,this.injector),_e=se.attach(re);_e.instance.setCommentPinAnnotation(e),_e.instance.setElement($),_e.instance.onKeyupEnter=()=>{this.onCommonAncestorElementChange(e)},S<0&&(S=j),H=j,_.push({host:se,portal:re,portalRef:_e,element:$,textNode:Z})}),S>=0&&_[S]?.portalRef&&_[S].portalRef.instance.setFirst(!0),H>=0&&_[H]?.portalRef&&_[H].portalRef.instance.setLast(!0),t.texts=_,this.inlineCommentMode&&!document.querySelector(`${X.TAGS.VELT_INLINE_COMMENT}[${X.ATTRIBUTES.VELT_INLINE_COMMENT_ID}="${e.annotationId}"]`)){let j=t.texts?.filter(re=>!!re?.element)?.map(re=>re?.element),Z=j?.length?j[j.length-1]:null;if(Z&&!zv(Z,X.ATTRIBUTES.VELT_PDF_VIEWER)){let se=Z?.parentElement;if(se){let _e=document.createElement(X.TAGS.VELT_INLINE_COMMENT);_e.setAttribute(X.ATTRIBUTES.VELT_INLINE_COMMENT_ID,e.annotationId),se.insertAdjacentElement("afterend",_e),t.inlineCommentElement=_e}}}}this.removeGhostComment(e)}else this.setGhostComment(e)}else this.setGhostComment(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService setTextCommentPortal: ",t)}}resolveHighlightRange(e,t,a=document.body){try{let i=e.targetTextRange?.text,c=e.targetTextRange?.occurrence,m=t?this.buildValidRange(Qu(i,t,c),i):null;return!m&&!this.restrictTextSearchToAnchor&&a&&t!==a&&(m=this.buildValidRange(Qu(i,a,c),i)),m}catch(i){return this.loggingService.catch("Error in CommentPinPortalService resolveHighlightRange: ",i),null}}buildValidRange(e,t){try{if(!e?.length||e.some(c=>c?.textNode?.parentElement?.closest("script")))return null;let i=new Range;try{i.setStart(e[0].textNode,e[0].startOffset||0),i.setEnd(e[e.length-1].textNode,e[e.length-1].endOffset||0)}catch{return null}return i.toString()===t?i:null}catch(a){return this.loggingService.catch("Error in CommentPinPortalService buildValidRange: ",a),null}}checkToRemoveTextCommentAnnotations(e){try{let t=e.map(i=>i.annotationId),a=!1;if(Object.keys(this.commentsTextById).forEach(i=>{t.includes(i)||(this.commentsTextById[i]?.annotation?.targetTextRange&&(a=!0),this.removeTextCommentAnnotation(this.commentsTextById[i].annotation))}),a){let i=[];Object.keys(this.commentsTextById).forEach(c=>{this.commentsTextById[c]?.annotation?.targetTextRange&&(i.push(this.commentsTextById[c]?.annotation),this.removeTextCommentAnnotation(this.commentsTextById[c]?.annotation))}),i?.length&&i.forEach(c=>{this.updateTextCommentAnnotation(c)})}}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkToRemoveTextCommentAnnotations: ",t)}}removeTextCommentAnnotation(e){try{let t=this.commentsTextById[e.annotationId];if(t.texts.forEach(a=>{a?.host&&a.host.detach(),a?.element&&a?.textNode&&a.element.replaceWith(a.textNode),a.textNode&&a.textNode.parentNode?.normalize()}),t.texts?.length){let a=document.querySelectorAll(`${X.TAGS.SNIPPYLY_TEXT_HIGHLIGHT}[data-velt-id="${e?.annotationId}"]`);a?.length&&a.forEach(i=>{let c=i?.parentNode;if(i?.textContent){let m=document.createTextNode(i.textContent);i.replaceWith(m)}c&&c.normalize()})}t?.inlineCommentElement&&t?.inlineCommentElement?.remove(),this.checkToUnsubscribeCommonAncestorElementChanges(e),delete this.commentsTextById[e.annotationId]}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeTextCommentAnnotation: ",t)}}observeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];if(t.commonAncestorElement){let a=this.commonAncestorElementObservers.get(t.commonAncestorElement);if(a)a.annotations.find(i=>i.annotationId===e.annotationId)||a.annotations.push(e);else{let i=new MutationObserver(c=>{let m="";if(Tb(t?.commonAncestorElement).forEach(_=>{_?.parentElement?.closest(".comment-annotation-number")||(m+=_.textContent)}),t?.commonAncestorText!==m&&c.filter(_=>[Node.ELEMENT_NODE,Node.TEXT_NODE].includes(_.target.nodeType)).filter(_=>_.target?.parentElement&&(_?.target?.parentElement?.classList?.contains("comment-text-highlight")||!Gc(_.target?.parentElement))).length){this.commonAncestorElementObservers.get(t.commonAncestorElement)?.annotations?.forEach($=>{this.onCommonAncestorElementChange($)});let{count:I,lastUpdated:S}=this.commonAncestorElementObserverCounts.get(t.commonAncestorElement)||{count:0,lastUpdated:0},H=Date.now();this.commonAncestorElementObserverCounts.set(t.commonAncestorElement,{count:H-S<100?I+1:1,lastUpdated:Date.now()}),I>5&&(i.disconnect(),this.loggingService.catch("Failed to detect text changes."))}});i.observe(t.commonAncestorElement,{characterData:!0,subtree:!0}),a={observer:i,annotations:[e]}}this.commonAncestorElementObservers.set(t.commonAncestorElement,a)}}catch(t){this.loggingService.catch("Error in CommentPinPortalService observeCommonAncestorElementChanges: ",t)}}onCommonAncestorElementChange(e){try{let t=this.commentsTextById[e.annotationId];if(t.texts?.length){let a="";t.texts.forEach(I=>a+=I.textNode?.textContent);let i=t.texts[0].textNode,c=[];document.querySelectorAll(`${X.TAGS.SNIPPYLY_TEXT_HIGHLIGHT}[data-velt-id="${e?.annotationId}"]`)?.forEach(I=>{c.push(I)});let m=!1;if(c?.length!==t?.texts?.length&&(m=!0),c?.length){let I="";c.forEach(S=>{I+=S?.textContent||""}),I&&(a=I,m&&this.removeTextCommentAnnotation(e))}let h=yb(t.commonAncestorContainer,0,i,0,a)+1,_={};_.commonAncestorContainer=e.targetTextRange?.commonAncestorContainer,_.text=a,_.occurrence=h,ln(e.targetTextRange,_)||(t.annotation.targetTextRange=_,this.updateAnnotationToFirebase(t.annotation))}else this.setTextCommentPortal(t.annotation)}catch(t){this.loggingService.catch("Error in CommentPinPortalService onCommonAncestorElementChange: ",t)}}updateAnnotationToFirebase(e){try{this.commentService.updateComment(e,!1,!0)}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateAnnotationToFirebase: ",t)}}checkToUnsubscribeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];if(t.commonAncestorElement){let a=this.commonAncestorElementObservers.get(t.commonAncestorElement);a&&(a.annotations=a?.annotations.filter(i=>i.annotationId!==e.annotationId),a.annotations.length||this.unsubscribeCommonAncestorElementChanges(e))}}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkToUnsubscribeCommonAncestorElementChanges: ",t)}}setGhostComment(e){try{e.ghostComment={},this.commentService.setGhostCommentMessage(e),this.commentService.addAnnotationToGhostCommentAnnotationMap(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService setGhostComment: ",t)}}removeGhostComment(e){try{delete e.ghostComment,this.commentService.removeAnnotationFromGhostCommentAnnotationMap(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeGhostComment: ",t)}}onAcceptComment(e){try{let t=this.commentsTextById[e.annotationId];if(t?.texts?.length){let a=t.texts.length-1,i=t.texts[a].textNode;if(i&&i.parentNode){let c=e.comments?.length?e.comments[0]:null,m=Rg(c?.replaceContentHtml)?null:c?.replaceContentHtml,h=c?.replaceContentText||c?.commentText||"";if(Rg(m)&&!c?.replaceContentText&&(m=c?.commentHtml||""),e?.selectAllContent&&e?.targetElementId){let _=Wr(e.targetElementId,["id","data-id"]);_&&(_.innerHTML=this.domService.sanitizeHtml(Rg(m)?h||"":m||""))}else{if(m&&m!==h){let _=document.createElement("span");_.innerHTML=this.domService.sanitizeHtml(m||h||""),i.parentNode.replaceChild(_,i),t.texts[a].textNode=_}else t.texts[a].textNode.textContent=h||"";for(let _=0;_<a;_++){let I=t.texts[_].textNode;I&&(I.textContent="")}}this.removeTextCommentAnnotation(e),this.domService.resetSelectedAnnotationsMap()}}}catch(t){this.loggingService.catch("Error in CommentPinPortalService onAcceptComment: ",t)}}unsubscribeCommonAncestorElementChanges(e){try{let t=this.commentsTextById[e.annotationId];this.commonAncestorElementObservers.get(t.commonAncestorElement)?.observer?.disconnect(),this.commonAncestorElementObservers.delete(t.commonAncestorElement)}catch(t){this.loggingService.catch("Error in CommentPinPortalService unsubscribeCommonAncestorElementChanges: ",t)}}};o.\u0275fac=function(t){return new(t||o)(be(ut),be(Ne),be(ae),be(mg),be(dg),be(sg),be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function R2(r,o){if(r&1){let n=Y();b(0,"div",4),z("pointerup",function(t){return B(n),l(2).togglePinSelection(),V(t.stopPropagation())})("click",function(t){return B(n),V(t.stopPropagation())})("cdkDragStarted",function(){B(n);let t=l(2);return V(t.onPinDragStart())}),b(1,"snippyly-comment-pin",5),z("saveComment",function(t){B(n);let a=l(2);return V(a.saveComment(t))})("commentTargetElementClicked",function(){B(n);let t=l(2);return V(t.togglePinSelection())})("togglePinSelection",function(t){B(n);let a=l(2);return V(a.togglePinSelection(t))}),x()()}if(r&2){let n=l().ngIf,e=l();it("top",(n.commentPinAnnotation==null||n.commentPinAnnotation.position==null?null:n.commentPinAnnotation.position.top)-0+n.offsetTop,"px")("left",(n.commentPinAnnotation==null||n.commentPinAnnotation.position==null?null:n.commentPinAnnotation.position.left)-10+n.offsetLeft,"px"),v("id","comment-pin-container-"+(n.commentPinAnnotation==null?null:n.commentPinAnnotation.annotationId)),k("data-testid",e.componentId+"-popover")("role","button")("aria-expanded",n.commentPinSelected),d(),v("annotation",n.commentPinAnnotation)("containerComponentId",n.componentId)("commentPinSelected",n.commentPinSelected&&!n.annotationDragging)("multipleCommentPinSelected",n.commentPinSelected&&e.objectKeys(n.selectedAnnotationsMap).length>1)("targetElement",n.targetElement)("user",n.user)}}function U2(r,o){if(r&1){let n=Y();b(0,"div",7),z("pointerup",function(t){return B(n),l(3).togglePinSelection(),V(t.stopPropagation())})("touchend",function(t){return B(n),t.stopPropagation(),V(t.preventDefault())})("mousedown",function(t){return B(n),V(t.stopPropagation())})("touchstart",function(t){return B(n),V(t.stopPropagation())})("pointerdown",function(t){return B(n),V(t.stopPropagation())})("click",function(t){return B(n),V(t.stopPropagation())})("cdkDragStarted",function(){B(n);let t=l(3);return V(t.onPinDragStart())})("cdkDragMoved",function(t){B(n);let a=l(3);return V(a.onPinMove(t))})("cdkDragReleased",function(){B(n);let t=l(3);return V(t.onPinRelease())}),b(1,"snippyly-comment-pin",8,1),z("togglePinSelection",function(t){B(n);let a=l(3);return V(a.togglePinSelection(t))})("saveComment",function(t){B(n);let a=l(3);return V(a.saveComment(t))}),x()()}if(r&2){let n=we(2),e=l(2).ngIf,t=l();it("top",e.annotationDragging?(e.dragPosition==null?null:e.dragPosition.top)-((n==null?null:n.COMMENT_PIN_SIZE)||40):(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.top)-((n==null?null:n.COMMENT_PIN_SIZE)||40)+e.offsetTop,"px")("left",e.annotationDragging?e.dragPosition==null?null:e.dragPosition.left:(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.left)+e.offsetLeft,"px")("--velt-comment-pin-transform",e.annotationDragging?"none":e.pinTransform??"none")("transform",!e.annotationDragging&&(!(e.commentPinAnnotation==null||e.commentPinAnnotation.position==null)&&e.commentPinAnnotation.position.parentScaleX)?"scale("+1/((e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.parentScaleX)||1)+", "+1/((e.commentPinAnnotation==null||e.commentPinAnnotation.position==null?null:e.commentPinAnnotation.position.parentScaleY)||1)+")":""),pe("pin-dragging",e.annotationDragging),v("id","comment-pin-container-"+(e.commentPinAnnotation==null?null:e.commentPinAnnotation.annotationId))("cdkDragDisabled",!e.pinDragEnabled||(e.commentPinAnnotation==null||e.commentPinAnnotation.from==null?null:e.commentPinAnnotation.from.userId)!==(e.user==null?null:e.user.userId)),k("data-testid",t.componentId+"-default")("role","button")("aria-expanded",e.commentPinSelected)("aria-grabbed",e.annotationDragging)("data-transform-inside",e.transformContext?"true":"false"),d(),v("annotation",e.commentPinAnnotation)("annotationDragging",e.annotationDragging)("containerComponentId",e.componentId)("commentPinSelected",e.commentPinSelected&&!e.annotationDragging)("multipleCommentPinSelected",e.commentPinSelected&&t.objectKeys(e.selectedAnnotationsMap).length>1)("targetElement",e.targetElement)("user",e.user)}}function L2(r,o){if(r&1&&s(0,U2,3,24,"div",6),r&2){let n=l().ngIf;v("ngIf",n.commentPinAnnotation==null?null:n.commentPinAnnotation.position)}}function B2(r,o){if(r&1&&(u(0),s(1,R2,2,14,"div",3)(2,L2,1,1,"ng-template",null,0,je),p()),r&2){let n=o.ngIf,e=we(3);d(),v("ngIf",n.popoverMode)("ngIfElse",e)}}var au=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_){this.analyticsService=e,this.authService=t,this.docService=a,this.domService=i,this.commentService=c,this.commentActionsService=m,this.loggingService=h,this.elementRef=_,this.multipleCommentPinsSelected=!1,this.avatarErrorImage="",this.objectKeys=Object.keys,this.selectedAnnotationsLocationMap={},this.subscriptions=[],this.componentConfigSignal=Me({popoverMode:!1,commentPinAnnotation:void 0,commentPinSelected:!1,offsetLeft:0,offsetTop:0,selectedAnnotationsMap:{},annotationDragging:!1,dragPosition:null,targetElement:void 0,user:void 0,componentId:`comment-pin-portal-${Ht()}`,pinDragEnabled:!0}),this.veltElement=!0,this.componentId="velt-comment-pin-portal",this.subscriptions.push(this.authService.getUser$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{user:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getUser$ subscription: ",I)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{selectedAnnotationsMap:I}),S)),this.checkCommentPinSelected()},I=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsMap$ subscription: ",I)})),this.subscriptions.push(this.domService.getSelectedAnnotationsLocationMap$().subscribe(I=>{this.selectedAnnotationsLocationMap=I||{},this.checkCommentPinSelected()},I=>{this.catchError("Error in CommentPinPortalComponent getSelectedAnnotationsLocationMap$ subscription: ",I)})),this.subscriptions.push(this.commentService.getPinDrag$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{pinDragEnabled:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getPinDrag$ subscription: ",I)})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(I=>{this.componentConfigSignal.update(S=>(S=f(g({},S),{popoverMode:I}),S))},I=>{this.catchError("Error in CommentPinPortalComponent getPopoverMode subscription: ",I)}))}ngOnInit(){try{this.setupA11yAttributes(),this.subscriptions.push(this.commentService.getTransformContext$().subscribe(e=>{this.componentConfigSignal.update(t=>{if(t=f(g({},t),{transformContext:e}),e&&this.isElementInsideTransformContainer(this.elementRef?.nativeElement,e.containerSelector)){let a=e.transforms.scale?1/e.transforms.scale:1;t.pinTransform=`scale(${a})`}else t.pinTransform=void 0;return t})}))}catch(e){this.loggingService.catch("Error in CommentPinPortalComponent ngOnInit:",e)}}isElementInsideTransformContainer(e,t){try{return document.querySelector(t)?.contains(e)??!1}catch(a){return this.loggingService.catch("Error in CommentPinPortalComponent isElementInsideTransformContainer:",a),!1}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in CommentPinPortalComponent setupA11yAttributes:",e)}}setCommentPinAnnotation(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{commentPinAnnotation:e}),t)),this.id=this.componentConfigSignal().commentPinAnnotation?.annotationId,this.checkCommentPinSelected()}catch(t){this.catchError("Error in CommentPinPortalComponent setCommentPinAnnotation: ",t)}}setSourceId(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{sourceId:e}),t)),this.checkCommentPinSelected()}catch(t){this.catchError("Error in CommentPinPortalComponent setSourceId: ",t)}}getMultiThreadCommentAnnotations(){}checkCommentPinSelected(){try{let e=this.componentConfigSignal().selectedAnnotationsMap,t=this.componentConfigSignal().commentPinAnnotation,a=this.componentConfigSignal().sourceId;if(t){let i=!!e[t.annotationId];if(i)if(t?.isDraft)t?.sourceId&&(i=t?.sourceId===a,i&&this.domService.setSelectedAnnotationLocation(t.annotationId,this.componentConfigSignal().componentId));else{let c=this.selectedAnnotationsLocationMap?.[t.annotationId];c&&(i=c===this.componentConfigSignal().componentId)}i!==this.componentConfigSignal().commentPinSelected&&this.componentConfigSignal.update(c=>(c=f(g({},c),{commentPinSelected:i}),c))}}catch(e){this.catchError("Error in CommentPinPortalComponent checkCommentPinSelected: ",e)}}setTargetElement(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{targetElement:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setTargetElement: ",t)}}setOffsetLeft(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{offsetLeft:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setOffsetLeft: ",t)}}setOffsetTop(e){try{this.componentConfigSignal.update(t=>(t=f(g({},t),{offsetTop:e}),t))}catch(t){this.catchError("Error in CommentPinPortalComponent setOffsetTop: ",t)}}togglePinSelection(e){try{let t=e||this.componentConfigSignal().commentPinAnnotation;if(t&&this.commentActionsService.onCommentPinClick(t).catch(i=>{this.catchError("Error in CommentPinPortalComponent togglePinSelection onCommentPinClick: ",i)}),this.componentConfigSignal().selectedAnnotationsMap[t?.annotationId]&&this.selectedAnnotationsLocationMap?.[t?.annotationId]===this.componentConfigSignal().componentId)t?.ghostComment?.type!==Hr.DIFFERENT_DEVICE&&document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}="${t?.annotationId}"]`)&&this.domService.resetSelectedAnnotationsMap(!0,"comments");else{let i=document.querySelector(`[${X.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);if(i||(i=(this.domService.getDraftCommentAnnotationDialogs()||[])[0]),i){let c=i.getAttribute(X.ATTRIBUTES.VELT_ANNOTATION_DRAFT);if(c){let m=document.getElementById(`comment-pin-container-${c}`)||document.querySelector(`[data-velt-id='${c}']`);m&&(m.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),this.domService.resetSelectedAnnotationsMap(!0,"comments"))}}else this.domService.resetSelectedAnnotationsMap(!0,"comments"),this.componentConfigSignal().targetElement&&this.domService.isElementVisibleOnScreen(this.componentConfigSignal().targetElement)&&(this.componentConfigSignal().annotationDragging||this.domService.toggleAnnotationSelection(t,this.componentConfigSignal().componentId,void 0,!0))}}catch(t){this.catchError("Error in CommentPinPortalComponent togglePinSelection: ",t)}}onPinDragStart(){try{this.componentConfigSignal().selectedAnnotationsMap[this.componentConfigSignal().commentPinAnnotation.annotationId]&&this.componentConfigSignal().commentPinAnnotation?.ghostComment?.type!==Hr.DIFFERENT_DEVICE&&this.domService.toggleAnnotationSelection(this.componentConfigSignal().commentPinAnnotation,this.componentConfigSignal().componentId);let e=document.getElementById(this.componentConfigSignal().commentPinAnnotation.annotationId);if(!e)return;this.parentElement=e.parentElement;let t=this.componentConfigSignal().commentPinAnnotation.position,a=this.componentConfigSignal().transformContext,i=this.parentElement.getBoundingClientRect(),c=i.left+t.left,m=i.top+t.top,h=a&&this.isElementInsideTransformContainer(e,a.containerSelector);this.componentConfigSignal.update(_=>(_=f(g({},_),{elementInTransformedContainer:h}),_)),e.style.width="20px",e.style.height="20px",e.style.margin="0",e.style.padding="0",e.style.display="block",e.style.visibility="visible",e.style.opacity="1",e.style.backgroundColor="var(--velt-comment-pin-background-color, #2d62ff)",e.style.borderRadius="50%",e.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",e.style.pointerEvents="auto",e.offsetWidth,document.body.appendChild(e),e.style.position="fixed",e.style.top=`${m}px`,e.style.left=`${c}px`,e.style.zIndex="10000",e.style.transform="none",e.offsetWidth,document.body.classList.add(X.BODY_CLASSES.VELT_PIN_DRAGGING),this.componentConfigSignal.update(_=>(_=f(g({},_),{annotationDragging:!0}),_))}catch(e){this.catchError("Error in CommentPinPortalComponent onPinDragStart: ",e)}}onPinMove(e){try{this.updateCurrentPinPosition(e)}catch(t){this.catchError("Error in CommentPinPortalComponent onPinMove: ",t)}}updateCurrentPinPosition(e){try{this.domService.removeHighlightFromElement(this.componentConfigSignal().targetElement);let t=e.event,a=t?.touches?.length?t.touches[0]?.clientX:t.clientX,i=t?.touches?.length?t.touches[0]?.clientY:t.clientY,c=this.componentConfigSignal().transformContext,m=this.domService.getBackgroundElement(a,i);m&&this.commentService.isElementInsideAllowedElements(m)&&(this.componentConfigSignal.update(h=>(h=f(g({},h),{targetElement:m}),h)),this.domService.highlightElement(this.componentConfigSignal().targetElement),this.pointerMoveEvent=e.event,this.componentConfigSignal.update(h=>(h=f(g({},h),{dragPosition:{top:i,left:a}}),h)))}catch(t){this.catchError("Error in CommentPinPortalComponent updateCurrentPinPosition: ",t)}}onPinRelease(){try{document.body.classList.remove(X.BODY_CLASSES.VELT_PIN_DRAGGING);let e=document.getElementById(this.componentConfigSignal().commentPinAnnotation.annotationId);if(!e||!this.parentElement)return;this.domService.removeHighlightFromElement(this.componentConfigSignal().targetElement);let t=this.domService.getElementFromXPath(this.componentConfigSignal().commentPinAnnotation.targetElement?.xpath),a=this.componentConfigSignal().commentPinAnnotation?.targetElement;if(this.pointerMoveEvent){let re=this.domService.getTargetElementForCursorPosition(this.pointerMoveEvent,!0,!0,!0,se=>{if(this.commentService.getSvgAsImg()){let _e=se?.closest(`[${X.ATTRIBUTES.VELT_COMMENT_CONTAINER}]`);_e&&_e instanceof HTMLElement&&(se=_e)}return se});re&&(a=re)}let i=this.domService.getElementFromXPath(a?.xpath),c=this.componentConfigSignal().commentPinAnnotation.targetElement?.xpath,m=a?.xpath,h=c===m;if(!i)return;let _=this.componentConfigSignal().dragPosition,I=i.getBoundingClientRect(),S=50,H=50;if(_){let re=_.left-I.left,se=_.top-I.top;S=re/I.width*100,H=se/I.height*100,S=Math.max(0,Math.min(100,S)),H=Math.max(0,Math.min(100,H))}let $=g({},this.componentConfigSignal().commentPinAnnotation);$.targetElement=g({},a),$.targetElement.leftPercentage=S,$.targetElement.topPercentage=H,this.commentService.calculateCommentAnnotationPosition($),this.componentConfigSignal.update(re=>(re=f(g({},re),{commentPinAnnotation:$,targetElement:i}),re));let j=this.domService.isElementInsideAdditionalLocationContainer(t)||this.domService.isElementInsideAdditionalLocationContainer(i),Z=this.docService.getAdditionalDocumentIdFromElement(i)||this.docService.getDocumentPaths()?.clientDocumentId;if(!this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId||this.componentConfigSignal().commentPinAnnotation?.metadata?.clientDocumentId==Z?(this.componentConfigSignal.update(re=>(re=f(g({},re),{commentPinAnnotation:f(g({},re.commentPinAnnotation),{targetElement:a})}),re)),this.commentService.updateComment(this.componentConfigSignal().commentPinAnnotation,j)):this.componentConfigSignal.update(re=>(re=f(g({},re),{targetElement:t}),re)),h){let re=this.componentConfigSignal().transformContext,se=this.componentConfigSignal().elementInTransformedContainer,_e=re&&this.isElementInsideTransformContainer(i,re.containerSelector);this.componentConfigSignal.update(he=>(he=f(g({},he),{elementInTransformedContainer:_e}),he));let le=e.getBoundingClientRect();if(!se&&_e){e.style.transition="none";let he=le.top,Se=le.left;this.parentElement.appendChild(e),e.style.position="fixed",e.style.top=`${he}px`,e.style.left=`${Se}px`,e.offsetWidth,requestAnimationFrame(()=>{e.style.position="absolute",_e&&$.position.transformContext?(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`,$.position.transformContext.scale!==1&&(e.style.transform=`scale(${1/$.position.transformContext.scale})`)):(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`)})}else e.style.transition="none",this.parentElement.appendChild(e),e.style.position="absolute",e.style.width="20px",e.style.height="20px",e.style.backgroundColor="var(--velt-comment-pin-background-color, #2d62ff)",e.style.borderRadius="50%",e.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.2)",e.style.visibility="visible",e.style.display="block",e.offsetWidth,_e&&$.position.transformContext?(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`):(e.style.top=`${$.position.top}px`,e.style.left=`${$.position.left}px`);e.offsetWidth,this.componentConfigSignal.update(he=>(he=f(g({},he),{annotationDragging:!1,dragPosition:null}),he))}this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_PIN_DRAGGED,{annotationId:this.componentConfigSignal().commentPinAnnotation.annotationId,commentMode:this.commentService.getCommentMode()})}catch(e){this.catchError("Error in CommentPinPortalComponent onPinRelease: ",e)}}saveComment(e){try{this.commentService.saveComment(this.componentConfigSignal().commentPinAnnotation,e)}catch(t){this.catchError("Error in CommentPinPortalComponent saveComment: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe(),this.componentConfigSignal()?.annotationDragging&&document.body.classList.remove(X.BODY_CLASSES.VELT_PIN_DRAGGING)}catch(e){this.catchError("Error in CommentPinPortalComponent ondestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(e=>{e.unsubscribe()}),this.subscriptions=[]}catch(e){this.catchError("Error in CommentPinPortalComponent unsubscribe: ",e)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.componentConfigSignal()?.commentPinAnnotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(G(sr),G(ot),G(ut),G(Ne),G(ae),G(at),G(A),G(me))},o.\u0275cmp=T({type:o,selectors:[["snippyly-comment-pin-portal"]],hostVars:2,hostBindings:function(t,a){t&2&&(Bh("id",a.id),k("data-velt-element",a.veltElement))},inputs:{multipleCommentPinsSelected:"multipleCommentPinsSelected",avatarErrorImage:"avatarErrorImage"},standalone:!1,decls:1,vars:1,consts:[["defaultPinPortalRef",""],["commentPinRef",""],[4,"ngIf"],["class","comment-pin-portal",3,"id","top","left","pointerup","click","cdkDragStarted",4,"ngIf","ngIfElse"],[1,"comment-pin-portal",3,"pointerup","click","cdkDragStarted","id"],[3,"saveComment","commentTargetElementClicked","togglePinSelection","annotation","containerComponentId","commentPinSelected","multipleCommentPinSelected","targetElement","user"],["class","comment-pin-portal","cdkDrag","","cdkDragHandle","",3,"id","pin-dragging","top","left","--velt-comment-pin-transform","transform","cdkDragDisabled","pointerup","touchend","mousedown","touchstart","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased",4,"ngIf"],["cdkDrag","","cdkDragHandle","",1,"comment-pin-portal",3,"pointerup","touchend","mousedown","touchstart","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased","id","cdkDragDisabled"],[3,"togglePinSelection","saveComment","annotation","annotationDragging","containerComponentId","commentPinSelected","multipleCommentPinSelected","targetElement","user"]],template:function(t,a){t&1&&s(0,B2,4,2,"ng-container",2),t&2&&v("ngIf",a.componentConfigSignal())},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{position:absolute!important;top:0!important;left:0!important;box-sizing:border-box!important;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset!important;width:unset!important;text-align:left!important;z-index:var(--velt-comment-pin-z-index)!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit));-webkit-text-fill-color:initial!important}*[_ngcontent-%COMP%]:empty{display:revert!important}.comment-pin-portal[_ngcontent-%COMP%]{position:absolute;transform:var(--velt-comment-pin-transform, none)!important;transform-origin:0 100%!important;transform-box:fill-box!important;top:0;left:0}.comment-pin-portal.pin-dragging[_ngcontent-%COMP%]{position:fixed;z-index:var(--velt-comment-pin-z-index)!important}"],changeDetection:0});let r=o;return r})();var vo=(()=>{let o=class o{constructor(e,t,a,i,c,m){this.commentService=e,this.domService=t,this.componentFactoryResolver=a,this.injector=i,this.appRef=c,this.loggingService=m,this.commentsPinById={},this.commentPinTemplate$=new De(null),this.customPinEvents$=new jt}setCommentPin(e){try{if(!this.commentsPinById[e.annotationId])this.setPinPortal(e);else{let t=!1;if(e?.ghostComment?t=e?.ghostComment?.targetElement?.xpath!==this.commentsPinById[e.annotationId]?.[0]?.annotation?.ghostComment?.targetElement?.xpath:this.commentsPinById[e.annotationId]?.[0]?.annotation?.ghostComment?t=!0:t=e.targetElement?.xpath!==this.commentsPinById[e.annotationId]?.[0]?.annotation?.targetElement?.xpath,!t)this.commentsPinById[e.annotationId]?.forEach(a=>{let i=a.portalRef,c=a.userTargetElement,m=a.pinHostElement;if(document.body.contains(c)&&document.body.contains(m))i&&(i.instance.setCommentPinAnnotation(e),this.updateElementOffset(e));else{let h=a.pinHostDomPortalOutlet;h&&(this.removeCommentPinHostAttributes(e.annotationId,a.pinHostElement),this.removeCommentDisabledAttribute(m),h.detach(),delete this.commentsPinById[e.annotationId],e.ghostComment&&this.unselectCommentAnnotation(e),this.setPinPortal(e))}});else{let a=this.commentsPinById[e.annotationId]?.[0]?.pinHostDomPortalOutlet;a&&(this.removeCommentPinHostAttributes(e.annotationId,this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),this.removeCommentDisabledAttribute(this.commentsPinById[e.annotationId]?.[0]?.pinHostElement),a.detach(),delete this.commentsPinById[e.annotationId],e.ghostComment&&this.unselectCommentAnnotation(e),this.setPinPortal(e))}}}catch(t){this.loggingService.catch("Error in CommentPinPortalService setCommentPin: ",t)}}unselectCommentAnnotation(e){try{this.loggingService.log("%c[WB] Calling CommentPinPortalService FUNCTION: unselectCommentAnnotation","color: green;"),this.domService.getSelectedAnnotationsMap()?.[e?.annotationId]&&this.domService.toggleAnnotationSelection(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService unselectCommentAnnotation: ",t)}}setPinPortal(e){try{let t=this.commentService.getElementFromComments(e);t.length>0&&(this.commentsPinById[e.annotationId]=[],t.forEach(a=>{if(a){let i=this.domService.getHostElement(a),c=new Cg(au),m=new kg(i,this.appRef,this.injector),h=m.attach(c);h.instance.setCommentPinAnnotation(e),h.instance.setTargetElement(a);let _=a?.getAttribute(X.ATTRIBUTES.VELT_SOURCE_ID);_&&h.instance.setSourceId(_),this.commentsPinById[e.annotationId].push({pinHostDomPortalOutlet:m,pinPortal:c,portalRef:h,annotation:JSON.parse(JSON.stringify(e)),userTargetElement:a,pinHostElement:i}),this.setCommentPinHostAttributes(e.annotationId,i),this.setCommentDisabledAttribute(i),this.updateElementOffset(e)}}))}catch(t){this.loggingService.catch("Error in CommentPinPortalService setPinPortal: ",t)}}setCommentPinHostAttributes(e,t){try{let a=t.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(a){let i=a.split(",");i.includes(e)||(i.push(e),t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,i.join(",")))}else t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,e);this.domService.isElementOriginallyStatic(t)&&t.offsetHeight>0&&(Fb(t)||t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC,"true"))}catch(a){this.loggingService.catch("Error in CommentPinPortalService setCommentPinHostAttributes: ",a)}}removeCommentPinHostAttributes(e,t){try{let a=t.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST);if(a){let i=a.split(","),c=i.indexOf(e);c>-1&&(i.splice(c,1),i.length>0?t.setAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST,i.join(",")):t.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST))}t?.getAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST)||t.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC)}catch(a){this.loggingService.catch("Error in CommentPinPortalService removeCommentPinHostAttributes: ",a)}}setCommentDisabledAttribute(e){try{this.commentService.getPopoverMode()&&e.setAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED,"auto")}catch(t){this.loggingService.catch("Error in CommentPinPortalService setCommentDisabledAttribute: ",t)}}removeCommentDisabledAttribute(e){try{e?.getAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED)==="auto"&&e.removeAttribute(X.ATTRIBUTES.VELT_COMMENT_DISABLED)}catch(t){this.loggingService.catch("Error in CommentPinPortalService removeCommentDisabledAttribute: ",t)}}updateElementOffset(e){try{for(let t of this.commentsPinById[e.annotationId]){let{portalRef:a,userTargetElement:i,pinHostElement:c}=t,m=this.domService.getElementOffset(i,c);a.instance.setOffsetLeft(m.offsetLeft),a.instance.setOffsetTop(m.offsetTop)}}catch(t){this.loggingService.catch("Error in CommentPinPortalService updateElementOffset: ",t)}}checkPinsToRemove(e){try{let t=e.map(a=>a.annotationId);Object.keys(this.commentsPinById).forEach(a=>{t.includes(a)||(this.commentService.customPinsById.has(a)&&this.commentService.customPinsById.delete(a),this.commentsPinById[a].forEach(c=>{c.pinHostDomPortalOutlet.detach(),this.removeCommentPinHostAttributes(a,c.pinHostElement),this.removeCommentDisabledAttribute(c.pinHostElement),this.domService.removeHighlightFromElement(c.pinHostElement),c.userTargetElement&&this.domService.removeHighlightFromElement(c.userTargetElement)}),delete this.commentsPinById[a])})}catch(t){this.loggingService.catch("Error in CommentPinPortalService checkPinsToRemove: ",t)}}getAnnotationIdsByUserTargetElement(e){try{let t=[];return Object.keys(this.commentsPinById||{}).forEach(a=>{this.commentsPinById[a]?.forEach(c=>{c.userTargetElement===e&&t.push(a)})}),t?.length>0?Array.from(new Set(t)):[]}catch(t){return this.loggingService.catch("Error in CommentPinPortalService getAnnotationIdsByUserTargetElement: ",t),[]}}setCommentPinOverrideTemplate(e){this.commentPinTemplate$.next(e)}getCommentPinTemplate$(){return this.commentPinTemplate$}emitCustomPinEvent(e){try{let{element:t,annotation:a}=e;a&&this.commentService.customPinsById.set(a.annotationId,t),this.customPinEvents$.next(e)}catch(t){this.loggingService.catch("Error in CommentPinPortalService emitCustomPinEvent",t)}}getCustomPinEvents$(){return this.customPinEvents$}};o.\u0275fac=function(t){return new(t||o)(be(ae),be(Ne),be(mg),be(dg),be(sg),be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function mp(){return{sidebarMode:!1,inboxMode:!1,dialogMode:!0,inlineCommentMode:!1,inlineCommentSectionMode:!1,focusedThreadMode:!1,isFocusedThreadEnabled:!1,pageModeComposer:!1,darkMode:!1,variant:"dialog",disabled:!1,commentPinSelected:!1,fullExpanded:!1,commentDialogSelected:!1,readOnly:!1,dialogShadowDOM:!0,locationVersion:"",composerPosition:"bottom",dialogOpenedInSidebar:!1,expandOnSelection:!0,commentPinType:"pin",containerComponentId:"",dialogInstanceId:Ht(),editComment:null,editCommentIndex:null,composerInOpenState:!1,assignToMenuOpened:!1,composerContent:"",composerContentHTML:"",selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],localRecordedData:[],attachmentsToDelete:[],selectedVisibility:"public",selectedVisibilityUsers:[]}}var iu=new Ah("LocalUIStateSignal"),fn=class{constructor(){this.appState={user:new Qn,isUserAdmin:!1,isKnownUser:!1,repliesUniqueUsers:[]},this.featureState={inlineCommentMode:!1,inlineCommentSectionMode:!1,sidebarMode:!1,dialogMode:!0,focusedThreadMode:!1,isFocusedThreadEnabled:!1,pageModeComposer:!1,inboxMode:!1,fullExpanded:!1,canResolveAnnotation:!1,canUnresolveAnnotation:!1,dialogSelectedByKnownUser:!1,resolveStatusAccessAdminOnly:!1,enableResolve:!1,isPlanExpired:!1,moderatorMode:!1,enableAutoCategorize:!1,suggestionMode:!1,commentAcceptedStatus:X.CommentAcceptStatus,commentRejectedStatus:X.CommentRejectStatus,enableSignInButton:!1,enableUpgradeButton:!1,enableGhostCommentsMessage:!1,replyAvatars:!1,userMentions:!0,anonymousEmail:!0,recordingSummaryEnabled:!1,enableAttachment:!0,enableAttachmentDownload:!0,allowedFileTypes:[],allowedRecordings:["audio","video","screen"],screenSharingSupported:!0,enterKeyToSubmit:!0,deleteOnBackspace:!0,enableReactions:!0,isInsidePdfViewer:!1,sidebarButtonOnCommentDialogVisible:!1,enableAssignment:!0,enableNotifications:!0,enableEdit:!0,enableDelete:!0,enablePrivateMode:!1,deleteThreadWithFirstComment:!0,seenByUsers:!0,enableStatus:!0,enablePriority:!1,visibilityOptions:!1,isPrivateCommentsEnabled:!1,privateModeEnabled:!1,privateModeType:null,privateModeUserIds:null,dialogSelection:!0,multiThread:!1,assignToType:"dropdown"},this.data={annotation:new Nt,ghostComment:null,assignTo:void 0,isAssignedCheckbox:!1,selectedUserContacts:[],currentDialogView:{}},this.uiState={darkMode:!1,variant:"dialog",disabled:!1,commentDialogSelected:!1,commentPinSelected:!1,readOnly:!1,dialogShadowDOM:!0,composerPosition:"bottom",dialogOpenedInSidebar:!1,containerComponentId:void 0,locationVersion:void 0,isPrivateComment:!1,sidebarButtonOnCommentDialogVisible:!1,showGhostCommentMessage:!1,showReplies:!1,collapsedComments:!1,collapsedRepliesPreview:!1,showAllComments:!0,multiThreadAnnotationId:void 0,maxReplyAvatars:3,showSuggestionModeActions:!1,uploadingAttachments:!1,playVideoInFullScreen:!0,commentDialogUniqueId:void 0,reactionToolOpenIndex:-1,openDropdownIndexValue:-1,hasReactionsByCommentId:{}},this.unreadCommentsMap=null,this.unreadIndicatorMode=jv.MINIMAL,this.context={},this.trackById=o=>{try{return o?.commentId?.toString()||""}catch{return""}},this.trackByAttachmentId=o=>{try{return o?.attachmentId?.toString()||""}catch{return""}},this.trackByRecorderId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByStatusId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByPriorityId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByCustomChipId=o=>{try{return o?.id?.toString()||""}catch{return""}},this.trackByViewUserId=o=>{try{return o?.user?.userId?.toString()||""}catch{return""}},this.scrollToBottom=new Le,this.messageScrollOffset=0,this.setMessageScrollOffset=o=>{try{let n=o?.target;n&&(this.messageScrollOffset=n.scrollTop)}catch{}}}};function Pf(){return{composerContent:"",composerContentHTML:"",localRecordedData:[],selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[]}}function lu(r){return r?!r.composerContent&&!r.selectedFiles?.length&&!r.invalidSelectedFiles?.length&&!r.selectedAttachments?.length&&!r.localRecordedData?.length:!0}var co=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,H){this.commentService=e,this.authService=t,this.iamService=a,this.usersService=i,this.loggingService=c,this.serviceBook=m,this.customFilterService=h,this.contactService=_,this.themeService=I,this.docService=S,this.domService=H,this.contextMap=new Map,this.annotationSubscriptions=new Map,this.registryMap=new Map,this.localUIStateRegistry=new Map,this.selectedDialogInstancesByAnnotation=new Map,this.composerDraftMap=new Map,this.standaloneComposerOwners=new Set,this.localAnonymousEmailOverrides=new Map,this.serviceSubscriptions=[],this.currentUser=new Qn,this.currentIsUserAdmin=!1,this.currentResolveStatusAccessAdminOnly=!1,this.currentEnableResolve=!0,this.currentIsPlanExpired=!1,this.currentSidebarButtonOnCommentDialogVisible=!1,this.currentModeratorMode=!1,this.currentEnableSignInButton=!1,this.currentEnableUpgradeButton=!1,this.currentSuggestionMode=!1,this.currentEnableAutoCategorize=!1,this.currentEnableGhostCommentsMessage=!1,this.currentReadOnly=!1,this.currentMaxReplyAvatars=3,this.currentReplyAvatars=!1,this.currentEnableAttachment=!0,this.currentEnableAttachmentDownload=!0,this.currentEnableFormatOptions=!1,this.currentFormatConfig=null,this.currentAllowedFileTypes=[],this.currentAllowedRecordings=["audio","video","screen"],this.currentScreenSharingSupported=!!navigator?.mediaDevices?.getDisplayMedia,this.currentUserMentions=!0,this.currentAnonymousEmail=!0,this.currentDeleteOnBackspace=!0,this.currentEnterKeyToSubmit=!0,this.currentDialogShadowDOM=!0,this.currentRecordingSummaryEnabled=!1,this.currentEnableReactions=!0,this.currentEnableStatus=!1,this.currentCustomStatusesShown=!1,this.currentStatusOptions=[],this.currentEnablePriority=!0,this.currentPriorityOptions=[],this.currentEnableVisibilityOptions=!1,this.currentIsPrivateCommentsEnabled=!1,this.currentPrivateModeEnabled=!1,this.currentPrivateModeType=null,this.currentPrivateModeUserIds=null,this.currentDeleteThreadWithFirstComment=!0,this.currentCustomChipData=null,this.currentUnreadCommentsMap=null,this.currentUnreadIndicatorMode=void 0,this.currentSeenByUsers=!0,this.currentCommentViews=null,this.viewsService=null,this.currentUserContactsBySnippylyId=null,this.currentDarkMode=!1,this.ghostCommentSubscription=null,this.currentGhostCommentAnnotationMap=null,this.currentCommentplaceholder=void 0,this.currentReplyplaceholder=void 0,this.currentEditplaceholder=void 0,this.currentEditcommentplaceholder=void 0,this.currentEditreplyplaceholder=void 0,this.currentAtHereLabel=void 0,this.currentShortUserName=!1,this.currentAttachmentNameInMessage=!1,this.currentShowAllComments=!0,this.currentCollapsedRepliesPreview=!1,this.currentPlayVideoInFullScreen=void 0,this.currentShowScreenSizeInfo=!1,this.currentInlineCommentMode=!1,this.currentFullExpanded=!1,this.currentShowCommentIndex=!1,this.currentIsPrivateCommentAllowed=!1,this.currentLinkCallback=!1,this.currentDialogOpenedInSidebar=!1,this.currentAddCommentMode=!1,this.currentAssignToType="dropdown",this.editDraftsMap=Me(new Map),this.serviceSubscriptions.push(this.usersService.getUserById$().subscribe(()=>{this.contextMap.forEach($=>{this.updateComputedProperties($)})})),this.serviceSubscriptions.push(this.authService.getUser$().subscribe($=>{$&&(this.currentUser=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{appState:f(g({},Z.appState),{user:$})})),this.updateComputedProperties(j)}))})),this.serviceSubscriptions.push(this.iamService.isUserAdmin$().subscribe($=>{this.currentIsUserAdmin=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{appState:f(g({},Z.appState),{isUserAdmin:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getResolveStatusAccessAdminOnly$().subscribe($=>{this.currentResolveStatusAccessAdminOnly=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{resolveStatusAccessAdminOnly:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableResolve$().subscribe($=>{this.currentEnableResolve=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableResolve:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.authService.isPlanExpired$().subscribe($=>{this.currentIsPlanExpired=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPlanExpired:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getSidebarButtonOnCommentDialogVisibility$().subscribe($=>{this.currentSidebarButtonOnCommentDialogVisible=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{sidebarButtonOnCommentDialogVisible:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.themeService.getDarkMode$().subscribe($=>{this.currentDarkMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{darkMode:$})}))})})),this.serviceSubscriptions.push(this.commentService.getModeratorMode$().subscribe($=>{this.currentModeratorMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{moderatorMode:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getSignInButton$().subscribe($=>{this.currentEnableSignInButton=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableSignInButton:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getUpgradeButton$().subscribe($=>{this.currentEnableUpgradeButton=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableUpgradeButton:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getSuggestionMode$().subscribe($=>{this.currentSuggestionMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{suggestionMode:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableAutoCategorize$().subscribe($=>{this.currentEnableAutoCategorize=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAutoCategorize:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableGhostCommentsMessage$().subscribe($=>{this.currentEnableGhostCommentsMessage=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableGhostCommentsMessage:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getReadOnly$().subscribe($=>{this.currentReadOnly=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{readOnly:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getMaxReplyAvatars$().subscribe($=>{this.currentMaxReplyAvatars=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{maxReplyAvatars:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getReplyAvatars$().subscribe($=>{this.currentReplyAvatars=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{replyAvatars:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableAttachment$().subscribe($=>{this.currentEnableAttachment=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAttachment:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableAttachmentDownload$().subscribe($=>{this.currentEnableAttachmentDownload=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableAttachmentDownload:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableFormatOptions$().subscribe($=>{this.currentEnableFormatOptions=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableFormatOptions:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getFormatConfig$().subscribe($=>{this.currentFormatConfig=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{formatConfig:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableReactions$().subscribe($=>{this.currentEnableReactions=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableReactions:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableStatus$().subscribe($=>{this.currentEnableStatus=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enableStatus:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getCustomStatusesShown$().subscribe($=>{this.currentCustomStatusesShown=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{customStatusesShown:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.customFilterService.customStatusMap$.subscribe($=>{let j=$?Object.values($):[];this.currentStatusOptions=j,this.contextMap.forEach(Z=>{let re=Z();Z.set(f(g({},re),{featureState:f(g({},re.featureState),{statusOptions:j})})),this.updateComputedProperties(Z)})})),this.serviceSubscriptions.push(this.commentService.getEnablePriority$().subscribe($=>{this.currentEnablePriority=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enablePriority:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableVisibilityOptions$().subscribe($=>{this.currentEnableVisibilityOptions=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{visibilityOptions:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.authService.getIsPrivateCommentsEnabled$().subscribe($=>{this.currentIsPrivateCommentsEnabled=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPrivateCommentsEnabled:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getPrivateModeConfig$().subscribe($=>{let j=$!==null,Z=$?.type??null,re=$?.userIds??null;this.currentPrivateModeType=Z,this.currentPrivateModeUserIds=re,this.currentPrivateModeEnabled!==j&&(this.currentPrivateModeEnabled=j),this.updatePrivateModeEnabledInAllContexts()})),this.serviceSubscriptions.push(this.commentService.getPrivateCommentMode$().subscribe($=>{$&&!this.currentPrivateModeEnabled?(this.currentPrivateModeEnabled=!0,this.currentPrivateModeType="organizationPrivate",this.updatePrivateModeEnabledInAllContexts()):!$&&!this.commentService.getPrivateModeConfig()&&(this.currentPrivateModeEnabled=!1,this.currentPrivateModeType=null,this.updatePrivateModeEnabledInAllContexts())})),this.serviceSubscriptions.push(this.customFilterService.customPriorityMap$.subscribe($=>{let j=$?Object.values($):[];this.currentPriorityOptions=j,this.contextMap.forEach(Z=>{let re=Z();Z.set(f(g({},re),{featureState:f(g({},re.featureState),{priorityOptions:j})})),this.updateComputedProperties(Z)})})),this.serviceSubscriptions.push(this.commentService.getDeleteThreadWithFirstComment$().subscribe($=>{this.currentDeleteThreadWithFirstComment=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{deleteThreadWithFirstComment:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getCustomChipDropdownData$().subscribe($=>{this.currentCustomChipData=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{data:f(g({},Z.data),{customChipData:$,selectedCustomChipSet:Z.data.selectedCustomChipSet||new Set})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getAllowedFileTypes$().subscribe($=>{this.currentAllowedFileTypes=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{allowedFileTypes:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getAllowedRecordings$().subscribe($=>{this.currentAllowedRecordings=$||[],this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{allowedRecordings:$||[]})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getUserMentions$().subscribe($=>{this.currentUserMentions=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{userMentions:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnableAnonymousEmail$().subscribe($=>{this.currentAnonymousEmail=$,this.contextMap.forEach((j,Z)=>{if(this.localAnonymousEmailOverrides.has(Z))return;let re=j();j.set(f(g({},re),{featureState:f(g({},re.featureState),{anonymousEmail:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getAssignToType$().subscribe($=>{this.currentAssignToType=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{assignToType:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getDeleteOnBackspace$().subscribe($=>{this.currentDeleteOnBackspace=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{deleteOnBackspace:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getEnterKeyToSubmit$().subscribe($=>{this.currentEnterKeyToSubmit=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{enterKeyToSubmit:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getDialogShadowDOM$().subscribe($=>{this.currentDialogShadowDOM=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{dialogShadowDOM:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getComposerMode$().subscribe($=>{this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{composerMode:$||"default"})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getRecordingSummaryEnabled$().subscribe($=>{this.currentRecordingSummaryEnabled=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{recordingSummaryEnabled:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe($=>{this.currentUnreadCommentsMap=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{unreadCommentsMap:$})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getUnreadIndicatorMode$().subscribe($=>{this.currentUnreadIndicatorMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{unreadIndicatorMode:$})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.serviceBook.observe(dn).pipe(Pe($=>$?.onInitRecording()??Wn)).subscribe($=>{this.contextMap.forEach((j,Z)=>{let re=j();($?.panelId===re.uiState?.commentDialogUniqueId||$?.commentAnnotationId===Z||!$)&&(j.set(f(g({},re),{uiState:f(g({},re.uiState),{recorderInitConfig:$})})),this.updateComputedProperties(j),$?.commentAnnotationId&&$?.commentAnnotationId===Z&&!re.featureState?.sidebarMode&&this.domService.setRecordingInProgress($.commentAnnotationId,!0))})})),this.ghostCommentSubscription=this.commentService.getGhostCommentAnnotationMap$().subscribe($=>{this.currentGhostCommentAnnotationMap=$||null,this.contextMap.forEach((j,Z)=>{let re=j(),se=$?$[Z]:null;j.set(f(g({},re),{data:f(g({},re.data),{ghostComment:se||null})})),this.updateComputedProperties(j)})}),this.ghostCommentSubscription&&this.serviceSubscriptions.push(this.ghostCommentSubscription),this.serviceSubscriptions.push(this.commentService.getSeenByUsers$().subscribe($=>{this.currentSeenByUsers=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{seenByUsers:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.serviceBook.observe(Eo).pipe(Pe($=>(this.viewsService=$??null,$?$.getCommentFeatureViews$():Ee({})))).subscribe($=>{this.currentCommentViews=$,this.contextMap.forEach(j=>{this.computeCurrentDialogView(j)})})),this.serviceSubscriptions.push(this.contactService.getUserContactsBySnippylyId$().subscribe($=>{this.currentUserContactsBySnippylyId=$,this.contextMap.forEach(j=>{this.computeCurrentDialogView(j)})})),this.serviceSubscriptions.push(this.commentService.getCommentplaceholder$().subscribe($=>{this.currentCommentplaceholder=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{commentplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getReplyplaceholder$().subscribe($=>{this.currentReplyplaceholder=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{replyplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditplaceholder$().subscribe($=>{this.currentEditplaceholder=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{editplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditcommentplaceholder$().subscribe($=>{this.currentEditcommentplaceholder=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{editcommentplaceholder:$}))})})),this.serviceSubscriptions.push(this.commentService.getEditreplyplaceholder$().subscribe($=>{this.currentEditreplyplaceholder=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{editreplyplaceholder:$}))})})),this.serviceSubscriptions.push(this.contactService.getAtHereLabel().subscribe($=>{this.currentAtHereLabel=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{atHereLabel:$})}))})})),this.serviceSubscriptions.push(this.commentService.getShortUserName$().subscribe($=>{this.currentShortUserName=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{shortUserName:$})}))})})),this.serviceSubscriptions.push(this.commentService.getAttachmentNameInMessage$().subscribe($=>{this.currentAttachmentNameInMessage=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{attachmentNameInMessage:$})}))})})),this.serviceSubscriptions.push(this.commentService.getCollapsedComments$().subscribe($=>{this.currentShowAllComments=!$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showAllComments:!$,collapsedComments:$})}))})})),this.serviceSubscriptions.push(this.commentService.getCollapsedRepliesPreview$().subscribe($=>{this.currentCollapsedRepliesPreview=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{collapsedRepliesPreview:$})}))})})),this.serviceSubscriptions.push(this.serviceBook.observe(dn).pipe(Pe($=>$?.getPlayVideoInFullScreen$()??Wn)).subscribe($=>{this.currentPlayVideoInFullScreen=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{playVideoInFullScreen:$})}))})})),this.serviceSubscriptions.push(this.commentService.getShowScreenSizeInfo$().subscribe($=>{this.currentShowScreenSizeInfo=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showScreenSizeInfo:$})}))})})),this.serviceSubscriptions.push(this.commentService.getInlineCommentMode$().subscribe($=>{this.currentInlineCommentMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{inlineCommentMode:$})}))})})),this.serviceSubscriptions.push(this.commentService.getFullExpanded$().subscribe($=>{this.currentFullExpanded=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{fullExpanded:$})})),this.updateComputedProperties(j)})})),this.serviceSubscriptions.push(this.commentService.getShowCommentIndex().subscribe($=>{this.currentShowCommentIndex=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{showCommentIndex:$})}))})})),this.serviceSubscriptions.push(this.commentService.isPrivateCommentAllowed$().subscribe($=>{this.currentIsPrivateCommentAllowed=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{isPrivateCommentAllowed:$})}))})})),this.serviceSubscriptions.push(this.commentService.getLinkCallback$().subscribe($=>{this.currentLinkCallback=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{featureState:f(g({},Z.featureState),{linkCallback:$})}))})})),this.serviceSubscriptions.push(this.commentService.addCommentModeChange().subscribe($=>{this.currentAddCommentMode=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{addCommentMode:$})}))})})),this.serviceSubscriptions.push(this.domService.getDialogOpenedInSidebar().subscribe($=>{this.currentDialogOpenedInSidebar=$,this.contextMap.forEach(j=>{let Z=j();j.set(f(g({},Z),{uiState:f(g({},Z.uiState),{dialogOpenedInSidebar:$})}))})})),this.serviceSubscriptions.push(this.serviceBook.observe(dn).pipe(Pe($=>$?.onRecordingAttributeRemovedFromBody$()??Wn)).subscribe(()=>{this.contextMap.forEach($=>{let j=$();$.set(f(g({},j),{uiState:f(g({},j.uiState),{recordingAttributeRemovedTimestamp:Date.now()})}))})}))}setRegistry(e,t){try{this.registryMap.set(e,t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setRegistry:",a)}}getRegistry(e){try{return this.registryMap.get(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService getRegistry:",t);return}}clearRegistry(e){try{this.registryMap.delete(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearRegistry:",t)}}createDefaultComponentConfig(){try{let e=new fn,t=new Nt;return e.appState={user:this.currentUser,isUserAdmin:this.currentIsUserAdmin,isKnownUser:!1},e.data={annotation:t,customChipData:this.currentCustomChipData,selectedCustomChipSet:new Set,customList:t.customList||[],currentDialogView:{}},e.featureState={inlineCommentMode:this.currentInlineCommentMode,inlineCommentSectionMode:!1,canResolveAnnotation:!1,resolveStatusAccessAdminOnly:this.currentResolveStatusAccessAdminOnly,sidebarMode:!1,enableResolve:this.currentEnableResolve,dialogSelectedByKnownUser:!1,isPlanExpired:this.currentIsPlanExpired,dialogMode:!0,moderatorMode:this.currentModeratorMode,enableAutoCategorize:this.currentEnableAutoCategorize,suggestionMode:this.currentSuggestionMode,commentAcceptedStatus:X.CommentAcceptStatus,commentRejectedStatus:X.CommentRejectStatus,enableSignInButton:this.currentEnableSignInButton,enableUpgradeButton:this.currentEnableUpgradeButton,enableGhostCommentsMessage:this.currentEnableGhostCommentsMessage,replyAvatars:this.currentReplyAvatars,userMentions:this.currentUserMentions,anonymousEmail:this.currentAnonymousEmail,recordingSummaryEnabled:this.currentRecordingSummaryEnabled,enableAttachment:this.currentEnableAttachment,enableAttachmentDownload:this.currentEnableAttachmentDownload,enableFormatOptions:this.currentEnableFormatOptions,formatConfig:this.currentFormatConfig??void 0,allowedFileTypes:this.currentAllowedFileTypes,allowedRecordings:this.currentAllowedRecordings,screenSharingSupported:this.currentScreenSharingSupported,enterKeyToSubmit:this.currentEnterKeyToSubmit,deleteOnBackspace:this.currentDeleteOnBackspace,enableReactions:this.currentEnableReactions,enableStatus:this.currentEnableStatus,customStatusesShown:this.currentCustomStatusesShown,statusOptions:this.currentStatusOptions,enablePriority:this.currentEnablePriority,priorityOptions:this.currentPriorityOptions,visibilityOptions:this.currentEnableVisibilityOptions,isPrivateCommentsEnabled:this.currentIsPrivateCommentsEnabled,privateModeEnabled:this.currentPrivateModeEnabled,privateModeType:this.currentPrivateModeType,privateModeUserIds:this.currentPrivateModeUserIds,deleteThreadWithFirstComment:this.currentDeleteThreadWithFirstComment,fullExpanded:this.currentFullExpanded,seenByUsers:this.currentSeenByUsers,isPrivateCommentAllowed:this.currentIsPrivateCommentAllowed,linkCallback:this.currentLinkCallback,assignToType:this.currentAssignToType,messageTruncation:!1,messageTruncationLines:4},e.uiState={darkMode:this.currentDarkMode,variant:"dialog",disabled:!1,isPrivateComment:!1,commentDialogSelected:!1,commentPinSelected:!1,sidebarButtonOnCommentDialogVisible:this.currentSidebarButtonOnCommentDialogVisible,readOnly:this.currentReadOnly,maxReplyAvatars:this.currentMaxReplyAvatars,uploadingAttachments:!1,dialogShadowDOM:this.currentDialogShadowDOM,commentDialogUniqueId:Ht(),composerMode:"default",showReplies:!1,collapsedComments:!1,collapsedRepliesPreview:this.currentCollapsedRepliesPreview,showAllComments:this.currentShowAllComments,shortUserName:this.currentShortUserName,attachmentNameInMessage:this.currentAttachmentNameInMessage,showScreenSizeInfo:this.currentShowScreenSizeInfo,showCommentIndex:this.currentShowCommentIndex,playVideoInFullScreen:this.currentPlayVideoInFullScreen,addCommentMode:this.currentAddCommentMode,dialogOpenedInSidebar:this.currentDialogOpenedInSidebar,atHereLabel:this.currentAtHereLabel},e.unreadCommentsMap=this.currentUnreadCommentsMap,e.unreadIndicatorMode=this.currentUnreadIndicatorMode,e.commentplaceholder=this.currentCommentplaceholder,e.replyplaceholder=this.currentReplyplaceholder,e.editplaceholder=this.currentEditplaceholder,e.editcommentplaceholder=this.currentEditcommentplaceholder,e.editreplyplaceholder=this.currentEditreplyplaceholder,e}catch(e){return this.loggingService.catch("Error in CommentDialogCoreService createDefaultComponentConfig:",e),new fn}}getDefaultBase(){try{let e=this.createDefaultComponentConfig();return{appState:{user:e.appState.user,isUserAdmin:e.appState.isUserAdmin,isKnownUser:e.appState.isKnownUser,repliesUniqueUsers:e.appState.repliesUniqueUsers},data:{annotation:e.data.annotation,customChipData:e.data.customChipData,selectedCustomChipSet:e.data.selectedCustomChipSet,customList:e.data.customList},featureState:{inlineCommentMode:e.featureState.inlineCommentMode,inlineCommentSectionMode:e.featureState.inlineCommentSectionMode,canResolveAnnotation:e.featureState.canResolveAnnotation,canUnresolveAnnotation:e.featureState.canUnresolveAnnotation,resolveStatusAccessAdminOnly:e.featureState.resolveStatusAccessAdminOnly,sidebarMode:e.featureState.sidebarMode,enableResolve:e.featureState.enableResolve,dialogSelectedByKnownUser:e.featureState.dialogSelectedByKnownUser,isPlanExpired:e.featureState.isPlanExpired,moderatorMode:e.featureState.moderatorMode,enableAutoCategorize:e.featureState.enableAutoCategorize,suggestionMode:e.featureState.suggestionMode,commentAcceptedStatus:e.featureState.commentAcceptedStatus,commentRejectedStatus:e.featureState.commentRejectedStatus,enableSignInButton:e.featureState.enableSignInButton,enableUpgradeButton:e.featureState.enableUpgradeButton,enableGhostCommentsMessage:e.featureState.enableGhostCommentsMessage,replyAvatars:e.featureState.replyAvatars,userMentions:e.featureState.userMentions,anonymousEmail:e.featureState.anonymousEmail,recordingSummaryEnabled:e.featureState.recordingSummaryEnabled,enableAttachment:e.featureState.enableAttachment,enableFormatOptions:e.featureState.enableFormatOptions,formatConfig:e.featureState.formatConfig,allowedFileTypes:e.featureState.allowedFileTypes,allowedRecordings:e.featureState.allowedRecordings,screenSharingSupported:e.featureState.screenSharingSupported,enterKeyToSubmit:e.featureState.enterKeyToSubmit,deleteOnBackspace:e.featureState.deleteOnBackspace,enableReactions:e.featureState.enableReactions,enableStatus:e.featureState.enableStatus,customStatusesShown:e.featureState.customStatusesShown,statusOptions:e.featureState.statusOptions,enablePriority:e.featureState.enablePriority,priorityOptions:e.featureState.priorityOptions,deleteThreadWithFirstComment:e.featureState.deleteThreadWithFirstComment,seenByUsers:e.featureState.seenByUsers,fullExpanded:e.featureState.fullExpanded,isPrivateCommentAllowed:e.featureState.isPrivateCommentAllowed,linkCallback:e.featureState.linkCallback,assignToType:e.featureState.assignToType,visibilityOptions:e.featureState.visibilityOptions,isPrivateCommentsEnabled:e.featureState.isPrivateCommentsEnabled,messageTruncation:e.featureState.messageTruncation,messageTruncationLines:e.featureState.messageTruncationLines},uiState:{darkMode:e.uiState?.darkMode,variant:e.uiState?.variant,disabled:e.uiState?.disabled,isPrivateComment:e.uiState?.isPrivateComment,dialogShadowDOM:e.uiState?.dialogShadowDOM,composerMode:e.uiState?.composerMode??"default",showAllComments:e.uiState?.showAllComments,collapsedComments:e.uiState?.collapsedComments,collapsedRepliesPreview:e.uiState?.collapsedRepliesPreview,shortUserName:e.uiState?.shortUserName,attachmentNameInMessage:e.uiState?.attachmentNameInMessage,showScreenSizeInfo:e.uiState?.showScreenSizeInfo,showCommentIndex:e.uiState?.showCommentIndex,playVideoInFullScreen:e.uiState?.playVideoInFullScreen,addCommentMode:e.uiState?.addCommentMode,dialogOpenedInSidebar:e.uiState?.dialogOpenedInSidebar,atHereLabel:e.uiState?.atHereLabel},unreadCommentsMap:e.unreadCommentsMap,unreadIndicatorMode:e.unreadIndicatorMode,commentplaceholder:e.commentplaceholder,replyplaceholder:e.replyplaceholder}}catch(e){return this.loggingService.catch("Error in CommentDialogCoreService getDefaultBase:",e),{}}}getOrCreateContextConfig(e){try{if(!this.contextMap.has(e)){let t=this.createDefaultComponentConfig();this.currentGhostCommentAnnotationMap&&this.currentGhostCommentAnnotationMap[e]&&(t.data=f(g({},t.data),{ghostComment:this.currentGhostCommentAnnotationMap[e]}));let a=Me(t);this.contextMap.set(e,a),this.updateComputedProperties(a),this.fetchAndUpdateAnnotation(e)}return this.contextMap.get(e)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService getOrCreateContextConfig:",t),Me(new fn)}}getContextConfig(e){try{return this.contextMap.get(e)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService getContextConfig:",t);return}}setLocalAnonymousEmail(e,t){try{this.localAnonymousEmailOverrides.set(e,t);let a=this.contextMap.get(e);if(a){let i=a();a.set(f(g({},i),{featureState:f(g({},i.featureState),{anonymousEmail:t})})),this.updateComputedProperties(a)}}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setLocalAnonymousEmail:",a)}}clearLocalAnonymousEmail(e){try{this.localAnonymousEmailOverrides.delete(e);let t=this.contextMap.get(e);if(t){let a=t();t.set(f(g({},a),{featureState:f(g({},a.featureState),{anonymousEmail:this.currentAnonymousEmail})})),this.updateComputedProperties(t)}}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearLocalAnonymousEmail:",t)}}registerLocalUIState(e,t){this.localUIStateRegistry.set(e,t)}unregisterLocalUIState(e){this.localUIStateRegistry.delete(e)}getLocalUIState(e){return this.localUIStateRegistry.get(e)}getOrCreateComposerDraft(e){let t=this.composerDraftMap.get(e);return t||(t=Me(g({},Pf())),this.composerDraftMap.set(e,t)),t}clearComposerDraft(e){let t=this.composerDraftMap.get(e);t&&t.set(g({},Pf()))}appendComposerDraftRecording(e,t){this.getOrCreateComposerDraft(e).update(i=>{let c=i.localRecordedData||[];return c.some(m=>m?.id&&m.id===t?.id)?i:f(g({},i),{localRecordedData:[...c,t]})})}removeComposerDraftRecording(e,t){if(!t)return;this.getOrCreateComposerDraft(e).update(i=>f(g({},i),{localRecordedData:(i.localRecordedData||[]).filter(c=>c?.id!==t)}))}setComposerDraftAttachments(e,t){this.getOrCreateComposerDraft(e).update(i=>g(g(g(g({},i),t.selectedFiles!==void 0?{selectedFiles:t.selectedFiles}:{}),t.invalidSelectedFiles!==void 0?{invalidSelectedFiles:t.invalidSelectedFiles}:{}),t.selectedAttachments!==void 0?{selectedAttachments:t.selectedAttachments}:{}))}markStandaloneComposerOwner(e){this.standaloneComposerOwners.add(e)}unmarkStandaloneComposerOwner(e){this.standaloneComposerOwners.delete(e)}isStandaloneComposerOwner(e){return!!e&&this.standaloneComposerOwners.has(e)}getStandaloneRecorderPanelId(e){return`velt-standalone-composer-recorder-${e}`}editDraftKey(e,t){return`${e}:${t}`}getEditDraft(e,t){try{return!e||t===void 0||t===null?null:this.editDraftsMap().get(this.editDraftKey(e,t))??null}catch(a){return this.loggingService.catch("Error in getEditDraft:",a),null}}setEditDraft(e,t,a){try{let i=this.editDraftKey(e,t);this.editDraftsMap.update(c=>{let m=c.get(i);if(m&&m.composerContent===a.composerContent&&m.composerContentHTML===a.composerContentHTML)return c;let h=new Map(c);return h.set(i,a),h})}catch(i){this.loggingService.catch("Error in setEditDraft:",i)}}clearEditDraft(e,t){try{let a=this.editDraftKey(e,t);this.editDraftsMap.update(i=>{if(!i.has(a))return i;let c=new Map(i);return c.delete(a),c})}catch(a){this.loggingService.catch("Error in clearEditDraft:",a)}}setContextConfig(e,t){try{this.contextMap.set(e,t);let a=t(),i=this.getDefaultBase(),c=g(g({},i),a);this.localAnonymousEmailOverrides.has(e)&&(c.featureState=f(g({},c.featureState),{anonymousEmail:this.localAnonymousEmailOverrides.get(e)})),t.set(c),this.updateComputedProperties(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService setContextConfig:",a)}}clearContext(e){try{this.contextMap.delete(e),this.localAnonymousEmailOverrides.delete(e),this.selectedDialogInstancesByAnnotation.delete(e);let t=this.annotationSubscriptions.get(e);t&&(t.unsubscribe(),this.annotationSubscriptions.delete(e))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearContext:",t)}}generateTempAnnotationId(e){try{let t=e||Ht();return`${o.TEMP_ID_PREFIX}${t}`}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService generateTempAnnotationId:",t),"TEMP_ANNOTATION_ID"}}isTempAnnotationId(e){try{return e?.startsWith(o.TEMP_ID_PREFIX)||!1}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService isTempAnnotationId:",t),!1}}registerTempContext(e,t){try{if(!this.isTempAnnotationId(e)){this.loggingService.warn(`[registerTempContext] ID "${e}" is not a valid temp ID`);return}this.contextMap.set(e,t);let a=t(),i=this.getDefaultBase(),c=f(g(g({},i),a),{data:f(g(g({},i.data),a.data),{annotation:a.data?.annotation||i.data?.annotation}),appState:g(g({},i.appState),a.appState),featureState:f(g(g({},i.featureState),a.featureState),{allowedRecordings:i.featureState?.allowedRecordings,enableAttachment:i.featureState?.enableAttachment,enableReactions:i.featureState?.enableReactions,allowedFileTypes:i.featureState?.allowedFileTypes,screenSharingSupported:i.featureState?.screenSharingSupported,userMentions:i.featureState?.userMentions,anonymousEmail:i.featureState?.anonymousEmail,enterKeyToSubmit:i.featureState?.enterKeyToSubmit,deleteOnBackspace:i.featureState?.deleteOnBackspace,recordingSummaryEnabled:i.featureState?.recordingSummaryEnabled,enableResolve:i.featureState?.enableResolve,enableStatus:i.featureState?.enableStatus,enablePriority:i.featureState?.enablePriority,statusOptions:i.featureState?.statusOptions,priorityOptions:i.featureState?.priorityOptions,assignToType:i.featureState?.assignToType,visibilityOptions:i.featureState?.visibilityOptions,isPrivateCommentsEnabled:i.featureState?.isPrivateCommentsEnabled}),uiState:g(g({},i.uiState),a.uiState)});t.set(c),this.updateComputedProperties(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService registerTempContext:",a)}}clearTempContext(e){try{this.isTempAnnotationId(e)&&this.contextMap.has(e)&&(this.contextMap.delete(e),this.registryMap.delete(e),this.selectedDialogInstancesByAnnotation.delete(e))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService clearTempContext:",t)}}computeNewCommentPlaceholder(e,t,a,i){try{if(t)return t;if(e?.placeholder)return e.placeholder;let c=e?.featureState?.userMentions===!0,m=(e?.data?.annotation?.comments?.length||0)>0,h=a||e?.replyplaceholder,_=i||e?.commentplaceholder;return m&&h?h:!m&&_?_:c?m?"Reply or add others with @":"Comment or add others with @":m?"Write a reply...":"Write a comment..."}catch(c){return this.loggingService.catch("Error in CommentDialogCoreService computeNewCommentPlaceholder:",c),"Write a comment..."}}computeEditCommentPlaceholder(e,t,a,i=!1,c,m,h){try{if(t)return t;if(e?.placeholder)return e.placeholder;let _=c||e?.editcommentplaceholder,I=m||e?.editreplyplaceholder,S;if(typeof h=="number"?S=h>0:S=(e?.data?.annotation?.comments?.length||0)>0,S&&I)return I;if(!S&&_)return _;let H=a||e?.editplaceholder;return H||(i?S?"Edit your reply...":"Edit your comment...":"Edit comment...")}catch(_){return this.loggingService.catch("Error in CommentDialogCoreService computeEditCommentPlaceholder:",_),"Edit comment..."}}recomputeDerivedProperties(e){try{let t=this.getContextConfig(e);t&&this.updateComputedProperties(t)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService recomputeDerivedProperties:",t)}}markDialogSelected(e,t){try{if(!e||!t)return;let a=this.selectedDialogInstancesByAnnotation.get(e);a||(a=new Set,this.selectedDialogInstancesByAnnotation.set(e,a)),a.add(t)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService markDialogSelected:",a)}}markDialogDeselected(e,t){try{if(!e||!t)return;let a=this.selectedDialogInstancesByAnnotation.get(e);if(!a)return;a.delete(t),a.size===0&&this.selectedDialogInstancesByAnnotation.delete(e)}catch(a){this.loggingService.catch("Error in CommentDialogCoreService markDialogDeselected:",a)}}hasOtherSelectedDialogInstance(e,t){try{let a=this.selectedDialogInstancesByAnnotation.get(e);return!a||a.size===0?!1:t?!(a.size===1&&a.has(t)):a.size>0}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService hasOtherSelectedDialogInstance:",a),!1}}resetCollapsedCommentsToDefault(e,t){try{if(this.hasOtherSelectedDialogInstance(e,t))return;let a=this.getContextConfig(e);if(!a)return;let i=a();if(i.uiState?.showAllComments===this.currentShowAllComments&&i.uiState?.collapsedComments===!this.currentShowAllComments&&!i.uiState?.showReplies&&!i.uiState?.showReplyComposer)return;a.set(f(g({},i),{uiState:f(g({},i.uiState),{showAllComments:this.currentShowAllComments,collapsedComments:!this.currentShowAllComments,showReplies:!1,showReplyComposer:!1})}))}catch(a){this.loggingService.catch("Error in CommentDialogCoreService resetCollapsedCommentsToDefault:",a)}}ngOnDestroy(){try{this.serviceSubscriptions.forEach(e=>{e&&!e.closed&&e.unsubscribe()}),this.serviceSubscriptions=[],this.ghostCommentSubscription=null,this.annotationSubscriptions.forEach(e=>{e&&!e.closed&&e.unsubscribe()}),this.annotationSubscriptions.clear()}catch(e){this.loggingService.catch("Error in CommentDialogCoreService ngOnDestroy:",e)}}fetchAndUpdateAnnotation(e,t){try{if(this.annotationSubscriptions.has(e))t&&t();else{let a=this.commentService.getCommentAnnotationByAnnotationId(e).subscribe({next:i=>{if(i){let c=this.getContextConfig(e);if(c){let m=c(),h=f(g({},i),{annotationId:e});c.update(_=>f(g({},_),{data:f(g({},_.data),{annotation:h})})),this.updateComputedProperties(c),this.computeCurrentDialogView(c)}t&&t()}},error:i=>{},complete:()=>{}});this.annotationSubscriptions.set(e,a)}}catch{}}updateContextConfig(e,t){try{let a=this.getContextConfig(e);if(a){let i=a();a.set(g(g({},i),t))}}catch(a){this.loggingService.catch("Error in CommentDialogCoreService updateContextConfig:",a)}}updatePrivateModeEnabledInAllContexts(){this.contextMap.forEach(e=>{let t=e();e.set(f(g({},t),{featureState:f(g({},t.featureState),{privateModeEnabled:this.currentPrivateModeEnabled,privateModeType:this.currentPrivateModeType,privateModeUserIds:this.currentPrivateModeUserIds})})),this.updateComputedProperties(e)})}updateComputedProperties(e){try{let t=e(),a=this.computeIsKnownUser(t),i=this.computeDialogSelectedByKnownUser(t,a),c=this.computeIsPrivateComment(t),m=this.computeCanResolveAnnotation(t,i),h=this.computeCanUnresolveAnnotation(t,i),_=this.computeShowGhostCommentMessage(t),I=this.computeRepliesUniqueUsers(t),S=this.computeShowSuggestionModeActions(t,i),H=this.computeHasReactionsByCommentId(t),$=this.computeUnreadStatus(t),j=!1,Z={};t.appState.isKnownUser!==a&&(j=!0,Z.appState=f(g({},t.appState),{isKnownUser:a})),t.featureState.dialogSelectedByKnownUser!==i&&(j=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{dialogSelectedByKnownUser:i})),t.featureState.canResolveAnnotation!==m&&(j=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{canResolveAnnotation:m})),t.featureState.canUnresolveAnnotation!==h&&(j=!0,Z.featureState=f(g(g({},t.featureState),Z.featureState),{canUnresolveAnnotation:h})),t.uiState.isPrivateComment!==c&&(j=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{isPrivateComment:c})),t.uiState.showGhostCommentMessage!==_&&(j=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{showGhostCommentMessage:_}));let re=(t.appState.repliesUniqueUsers||[]).map(ct=>ct?.userId).sort().join(","),se=(I||[]).map(ct=>ct?.userId).sort().join(",");re!==se&&(j=!0,Z.appState=f(g(g({},t.appState),Z.appState),{repliesUniqueUsers:I})),t.uiState.showSuggestionModeActions!==S&&(j=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{showSuggestionModeActions:S}));let _e=JSON.stringify(t.uiState.hasReactionsByCommentId||{}),le=JSON.stringify(H||{});_e!==le&&(j=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{hasReactionsByCommentId:H})),t.uiState.unread!==$&&(j=!0,Z.uiState=f(g(g({},t.uiState),Z.uiState),{unread:$}));let Se=(t.data?.annotation?.customList||[]).map(ct=>ct?.id).filter(Boolean),Re=t.data?.selectedCustomChipSet;(Re instanceof Set?Array.from(Re):[]).slice().sort().join("\0")!==Se.slice().sort().join("\0")&&(j=!0,Z.data=f(g(g({},t.data),Z.data),{selectedCustomChipSet:new Set(Se)})),j&&e.update(ct=>f(g(g({},ct),Z),{appState:g(g({},ct.appState),Z.appState),featureState:g(g({},ct.featureState),Z.featureState),uiState:g(g({},ct.uiState),Z.uiState),data:g(g({},ct.data),Z.data)}))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService updateComputedProperties:",t)}}computeIsKnownUser(e){try{let t=e.appState?.user;return!!(t&&!t.isReadOnly&&!t.isAnonymous)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeIsKnownUser:",t),!1}}computeDialogSelectedByKnownUser(e,t){try{return t&&!!e.appState?.user}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeDialogSelectedByKnownUser:",a),!1}}computeCanResolveAnnotation(e,t){try{let a=e.data?.annotation,i=e.featureState,c=e.uiState;return!!(a&&!c?.disabled&&i?.enableResolve&&t&&a?.status?.type!=="terminal"&&!i?.isPlanExpired)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeCanResolveAnnotation:",a),!1}}computeCanUnresolveAnnotation(e,t){try{let a=e.data?.annotation,i=e.featureState,c=e.uiState;return!!(a&&!c?.disabled&&i?.enableResolve&&t&&a?.status?.type==="terminal"&&!i?.isPlanExpired)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeCanUnresolveAnnotation:",a),!1}}computeIsPrivateComment(e){try{return pr(e.data?.annotation)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeIsPrivateComment:",t),!1}}computeShowGhostCommentMessage(e){try{let t=e.data?.ghostComment,a=e.featureState?.enableGhostCommentsMessage,i=e.data?.annotation,c=e.featureState?.commentAcceptedStatus,m=e.featureState?.commentRejectedStatus;return!!(t&&a&&![c?.id,m?.id].includes(i?.status?.id))}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeShowGhostCommentMessage:",t),!1}}computeRepliesUniqueUsers(e){try{let t=e.data?.annotation;if(!t?.comments||t.comments.length<=1)return[];let a=t.comments.slice(1).map(m=>m?.from).filter(m=>m);return this.getUniqueUsers(a).map(m=>m?.userId&&this.usersService.getUserById(m.userId)||m).filter(m=>m)}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeRepliesUniqueUsers:",t),[]}}getUniqueUsers(e){try{let t=new Map;return e.forEach(a=>{a?.userId&&!t.has(a.userId)&&t.set(a.userId,a)}),Array.from(t.values())}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService getUniqueUsers:",t),[]}}computeShowSuggestionModeActions(e,t){try{let a=e.data?.annotation;if(a?.type==="suggestion"&&!!a?.suggestion&&a.suggestion.status==="pending"&&t)return!0;let c=e.featureState?.suggestionMode,m=!!a?.comments?.length,h=a?.status?.type!=="terminal";return!!(c&&t&&h&&m)}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService computeShowSuggestionModeActions:",a),!1}}computeHasReactionsByCommentId(e){try{let t={},a=e.data?.annotation;return a?.comments&&Array.isArray(a.comments)&&a.comments.forEach(i=>{i?.commentId&&(t[i.commentId]=i?.reactionAnnotationIds?.length>0)}),t}catch(t){return this.loggingService.catch("Error in CommentDialogCoreService computeHasReactionsByCommentId:",t),{}}}computeUnreadStatus(e){try{let t=e.data?.annotation,a=e.appState?.user;return!t||!a?.userSnippylyId?void 0:!t?.viewedByUserIds?.includes(a.userSnippylyId)}catch(t){this.loggingService.catch("Error in CommentDialogCoreService computeUnreadStatus:",t);return}}computeCurrentDialogView(e){try{let t=e(),a=t.data?.annotation,i=a?.annotationId,c=t.appState?.user?.userId,m=a?.from?.userId,h={};if(i&&this.currentCommentViews){let S=this.currentCommentViews?.[i]?.comments;Object.keys(S||{}).forEach(H=>{let $=[],j=0;Object.keys(S[H]?.views||{}).forEach(Z=>{let re={};re.user=this.currentUserContactsBySnippylyId?.[Z],re.viewedAt=S[H]?.views?.[Z]?.timestamp,re.user?.userId!==c&&re.user?.userId!==m&&($.push(re),(re.user?.email||re.user?.name)&&j++)}),h[H]={count:j,views:$}})}let _=JSON.stringify(t.data?.currentDialogView||{}),I=JSON.stringify(h);_!==I&&e.update(S=>f(g({},S),{data:f(g({},S.data),{currentDialogView:h})}))}catch(t){this.loggingService.catch("Error in CommentDialogCoreService computeCurrentDialogView:",t)}}findParentAnnotationId(e,t=20){try{let a=e.nativeElement.parentElement,i=0;for(;a&&i<t;){if(a.tagName?.toLowerCase()==="velt-comment-dialog-context-wrapper"){let m=a.getAttribute("annotation-id");if(m)return m;let h=a.__veltContext;if(h?.annotationId)return h.annotationId;let _=a.__ngContext__;if(_&&Array.isArray(_))for(let I=0;I<_.length;I++){let S=_[I];if(S&&typeof S=="object"&&S.annotationId)return S.annotationId}}a=a.parentElement,i++}return""}catch(a){return this.loggingService.catch("Error in CommentDialogCoreService findParentAnnotationId:",a),""}}};o.TEMP_ID_PREFIX="TEMP_COMPOSER_",o.\u0275fac=function(t){return new(t||o)(be(ae),be(ot),be(Dr),be(Qb),be(A),be(kr),be(Dt),be($t),be(Et),be(ut),be(Ne))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Cn=(()=>{let o=class o{constructor(e){this.loggingService=e,this.subscribers=new Set}register(e){try{if(this.subscribers.add(e),this.lastPayload)try{e(this.lastPayload)}catch(t){this.loggingService.catch("[REGISTRY] Error initializing subscriber:",t)}}catch(t){this.loggingService.catch("[REGISTRY] Error in register:",t)}}unregister(e){try{this.subscribers.delete(e)}catch(t){this.loggingService.catch("[REGISTRY] Error in unregister:",t)}}broadcast(e){try{this.lastPayload=e;let t=0,a=0;this.subscribers.forEach((i,c)=>{try{i(e),t++}catch(m){a++,this.loggingService.catch(`[REGISTRY] Error in subscriber #${t+a}:`,m)}})}catch(t){this.loggingService.catch("[REGISTRY] Error in broadcast:",t)}}getLastPayload(){try{return this.lastPayload}catch(e){this.loggingService.catch("[REGISTRY] Error in getLastPayload:",e);return}}};o.\u0275fac=function(t){return new(t||o)(be(A))},o.\u0275prov=rt({token:o,factory:o.\u0275fac});let r=o;return r})();var du=new WeakMap;function Kv(r){try{if(!r)return;let o=du.get(r);o&&o()}catch{}}function Nf(r,o,n){if(r)return r;if(o)return o;try{return n()||void 0}catch{return}}function $2(r,o){return r&&r!==o?{nextCachedId:r,annotationChanged:!0}:{nextCachedId:o,annotationChanged:!1}}var te=(()=>{let o=class o extends At{getCachedAnnotationId(){return this._annotationId}setCachedAnnotationId(e){this._annotationId=e}set parentLocalUIState(e){e&&(this.localUIStateSignal=e,this.isLocalUIStateOwner=!1)}get elementRef(){return this.hostElementRef}flushChangeDetection(){this.runScopedFlush();try{(typeof requestAnimationFrame<"u"?requestAnimationFrame:t=>setTimeout(()=>t(0),16))(()=>this.runScopedFlush())}catch{}}runScopedFlush(){try{let e=this.localUIStateSignal?du.get(this.localUIStateSignal):void 0;e?e():this.cd.detectChanges()}catch{try{this.cd.markForCheck()}catch{}}}constructor(){let e=ge(me),t=ge(Et),a=ge(ar),i=ge(ae,{optional:!0}),c=ge(D),m=ge(A),h=new De(null);super(e,t,a,i??void 0,h,c,m),this.annotationId=Q(),this.inlineCommentSectionMode=Q(!1,{transform:_=>{try{return typeof _=="string"?_==="true"||_==="":_}catch{return!1}}}),this.defaultCondition=Q(!0,{transform:_=>{try{return typeof _=="string"?_==="true"||_==="":_}catch{return!0}}}),this._contextData={},this.isLocalUIStateOwner=!1,this.isContextInitialized=!1,this.registryCheckAttempts=0,this.MAX_REGISTRY_CHECK_ATTEMPTS=50,this.lastFollowedDarkMode=void 0,this.globalDarkMode=Me(!1),this.composerDraft=L(()=>{try{let _=this.componentConfigSignal()?.data?.annotation?.annotationId||this._annotationId;if(!_)return null;let I=this.coreService.getOrCreateComposerDraft(_)();return lu(I)?null:I}catch{return null}}),this.onContextPayload=_=>{try{this.isContextInitialized||(this.isContextInitialized=!0),this._annotationId=_.annotationId,this._contextData=_.contextData||{};let I=this.coreService.getContextConfig(_.annotationId);if(I){if(this.componentConfigSignal.update(S=>g({},S)),this.componentConfigSignal=I,this.isLocalUIStateOwner){let S=this._contextData["comment-pin-selected"],H=S==="true"||S==="",$=this._contextData["full-expanded"],j=$==="true"||$==="",Z=H||j,re=this._contextData["inline-comment-section-mode"],se=re==="true"||re==="";this.localUIStateSignal.update(_e=>f(g({},_e),{commentPinSelected:H,fullExpanded:j,commentDialogSelected:Z})),I.update(_e=>f(g({},_e),{featureState:f(g({},_e.featureState),{inlineCommentSectionMode:se||_e.featureState.inlineCommentSectionMode,fullExpanded:j})}))}this.coreService.recomputeDerivedProperties(_.annotationId),this.cd.markForCheck()}}catch(I){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent onContextPayload:",I)}},this.darkModeFollow$=h,this.globalDarkModeSubscription=t.getDarkMode$().subscribe(_=>{this.globalDarkMode.set(!!_)}),this.hostElementRef=e,this.themeService=t,this.dynamicDataService=c,this.loggingService=m,this.coreService=ge(co),this.actionService=ge(Zv),this.cd=a,this.commentService=i??void 0,this.registry=ge(Cn,{optional:!0})??void 0,this.initializeLocalUIState(),_t(()=>{try{let _=this.componentConfigSignal?.()?.uiState?.darkMode;this.globalDarkMode(),this.applyFollowedDarkMode(_)}catch(_){this.loggingService?.catch("Error in CommentDialogPrimitiveThemedComponent darkMode follow effect:",_)}})}applyFollowedDarkMode(e){try{if(this.isLocalUIStateOwner)return;let a=typeof e=="boolean"&&e!==this.globalDarkMode()?e:null;if(this.lastFollowedDarkMode===a)return;this.lastFollowedDarkMode=a,this.darkModeFollow$?.next(a)}catch(t){this.loggingService?.catch("Error in CommentDialogPrimitiveThemedComponent applyFollowedDarkMode:",t)}}initializeLocalUIState(){try{let e=ge(iu,{optional:!0,skipSelf:!0});e?(this.localUIStateSignal=e,this.isLocalUIStateOwner=!1):(this.localUIStateSignal=Me(mp()),this.isLocalUIStateOwner=!0)}catch{this.localUIStateSignal=Me(mp()),this.isLocalUIStateOwner=!0}}ngOnInit(){try{super.ngOnInit(),this.isLocalUIStateOwner&&this.localUIStateSignal&&du.set(this.localUIStateSignal,()=>{try{this.cd.detectChanges()}catch{}});let e=this.annotationId();if(!e){let a=this.hostElementRef?.nativeElement?.getAttribute?.("annotation-id");a&&(e=a)}if(this.componentConfigSignal&&this.componentConfigSignal()&&Object.keys(this.componentConfigSignal()).length>0){this.initializeFromConfigSignal(this.componentConfigSignal),this.setupA11yAttributes(),this.setupDarkModeSync();return}if(e){this._annotationId=e,this.initializeFromAnnotationId(e),this.setupA11yAttributes(),this.setupDarkModeSync();return}let t=this.findNearestParentWrapperRegistry();if(t){this.registry=t,this.registry.register(this.onContextPayload);let a=this.registry.getLastPayload?.();a&&this.onContextPayload(a),this.setupA11yAttributes(),this.setupDarkModeSync();return}if(this.registry){this.registry.register(this.onContextPayload);let a=this.registry.getLastPayload?.();a&&this.onContextPayload(a),this.setupA11yAttributes(),this.setupDarkModeSync();return}this.tryRegisterWithContext(),this.setupA11yAttributes(),this.setupDarkModeSync()}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnInit:",e)}}ngOnChanges(e){try{super.ngOnChanges(e);let t=e.componentConfigSignal;t&&!t.firstChange&&this.refreshAnnotationContextFromSignal()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnChanges:",t)}}refreshAnnotationContextFromSignal(){try{let e=Vc(()=>this.componentConfigSignal?.()?.data?.annotation?.annotationId),{nextCachedId:t,annotationChanged:a}=$2(e,this._annotationId);if(a){let i=this._annotationId;this._annotationId=t,this.onAnnotationContextChanged(i,t),this.cd?.markForCheck()}}catch(e){this.loggingService?.catch("Error in CommentDialogPrimitiveThemedComponent refreshAnnotationContextFromSignal:",e)}}onAnnotationContextChanged(e,t){}ngOnDestroy(){try{this.registryCheckTimer&&(clearTimeout(this.registryCheckTimer),this.registryCheckTimer=void 0),this.registry&&this.registry.unregister(this.onContextPayload),this.globalDarkModeSubscription&&this.globalDarkModeSubscription.unsubscribe(),this.darkModeConfigSyncSubscription&&this.darkModeConfigSyncSubscription.unsubscribe(),this.isLocalUIStateOwner&&this.localUIStateSignal&&du.delete(this.localUIStateSignal),super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent ngOnDestroy:",e)}}setupA11yAttributes(){}setupDarkModeSync(){try{if(!this.isLocalUIStateOwner)return;let e=!1;this.darkModeConfigSyncSubscription=this.onDarkModeChange().subscribe(t=>{try{let a=!e;if(e=!0,this.componentConfigSignal&&typeof this.componentConfigSignal=="function"){let i=this.componentConfigSignal();i&&i.uiState&&i.uiState.darkMode!==t&&this.componentConfigSignal.update(c=>f(g({},c),{uiState:f(g({},c.uiState),{darkMode:t})}))}a||Kv(this.localUIStateSignal)}catch(a){this.loggingService.catch("Error in darkMode sync subscription:",a)}})}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent setupDarkModeSync:",e)}}findNearestParentWrapperRegistry(){try{let e=this.hostElementRef?.nativeElement;if(!e)return;let t=e.parentElement;for(;t;){if(t.tagName?.toLowerCase()==="velt-comment-dialog-context-wrapper"){let a=t.__veltContext;if(a?.registry instanceof Cn)return a.contextData&&(this._contextData=a.contextData),a.registry;let i=window.ng;if(i?.getComponent){let m=i.getComponent(t);if(m?.registry)return m.registry}let c=t.__ngContext__;if(c&&Array.isArray(c))for(let m=0;m<c.length;m++){let h=c[m];if(h&&typeof h=="object"&&h.registry instanceof Cn)return h.registry}}t=t.parentElement}}catch(e){this.loggingService.catch("[PRIMITIVE BASE] Error finding parent wrapper registry:",e)}}tryRegisterWithContext(){try{let e=this.coreService.findParentAnnotationId(this.hostElementRef);if(!e){this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS&&(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10));return}this.registry=this.coreService.getRegistry(e),this.registry?this.registry.register(this.onContextPayload):this.registryCheckAttempts<this.MAX_REGISTRY_CHECK_ATTEMPTS?(this.registryCheckAttempts++,this.registryCheckTimer=setTimeout(()=>this.tryRegisterWithContext(),10)):this.initializeFromDOM(e)}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent tryRegisterWithContext:",e)}}getContextValue(e){try{let t=this._contextData[e];if(t!=null)return t;let a=this.hostElementRef?.nativeElement?.getAttribute(e);return a!==null?a:void 0}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getContextValue:",t);return}}getContextCommentId(){try{let e=this.getContextValue("comment-id");if(e==null)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getContextCommentId:",e);return}}getAnnotationId(){try{return this.resolveAnnotationIdUntracked()}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getAnnotationId:",e);return}}resolveAnnotationIdUntracked(){return Nf(Vc(()=>this.componentConfigSignal()?.data?.annotation?.annotationId),this._annotationId,()=>this.coreService.findParentAnnotationId(this.hostElementRef))}getAnnotationIdReactive(){try{return Nf(this.componentConfigSignal()?.data?.annotation?.annotationId,this._annotationId,()=>this.coreService.findParentAnnotationId(this.hostElementRef))}catch(e){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent getAnnotationIdReactive:",e);return}}initializeFromDOM(e){try{this._annotationId=e;let t=this.coreService.getContextConfig(e);t&&(this.componentConfigSignal.update(a=>g({},a)),this.componentConfigSignal=t,this.isContextInitialized=!0,this.cd.markForCheck())}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromDOM:",t)}}initializeFromAnnotationId(e){try{this._annotationId=e;let t=this.coreService.getOrCreateContextConfig(e);this.componentConfigSignal.update(S=>g({},S)),this.componentConfigSignal=t,this.isContextInitialized=!0;let a=!1,i=!1,c=this.hostElementRef?.nativeElement?.getAttribute?.("comment-pin-selected");(c==="true"||c==="")&&(a=!0);let m=this.hostElementRef?.nativeElement?.getAttribute?.("full-expanded");(m==="true"||m==="")&&(i=!0);let h=a||i,_=t(),I=this.inlineCommentSectionMode();t.set(f(g({},_),{featureState:f(g({},_.featureState),{inlineCommentSectionMode:I!==!1?I:_.featureState.inlineCommentSectionMode,fullExpanded:i})})),this.isLocalUIStateOwner&&this.localUIStateSignal.update(S=>f(g({},S),{commentPinSelected:a,fullExpanded:i,commentDialogSelected:h})),this.coreService.recomputeDerivedProperties(e),this.cd.markForCheck()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromAnnotationId:",t)}}initializeFromConfigSignal(e){try{let a=e().data?.annotation?.annotationId;a&&(this._annotationId=a),this.isContextInitialized=!0,this.cd.markForCheck()}catch(t){this.loggingService.catch("Error in CommentDialogPrimitiveThemedComponent initializeFromConfigSignal:",t)}}veltEmit(e){return typeof CustomEvent<"u"&&e instanceof CustomEvent?e.detail:e}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["app-comment-dialog-primitive-themed-base"]],inputs:{annotationId:[1,"annotationId"],inlineCommentSectionMode:[1,"inlineCommentSectionMode"],defaultCondition:[1,"defaultCondition"],parentLocalUIState:"parentLocalUIState"},standalone:!1,features:[M,nt],decls:0,vars:0,template:function(t,a){},encapsulation:2});let r=o;return r})();function Rf(r,o){try{let n=r??[];if(n.some(a=>a.startsWith("organizationPrivate:")))return dt.ORGANIZATION_PRIVATE;let e=X.VISIBILITY_SELF_PREFIX,t=n.filter(a=>a.startsWith(e));if(t.length>0){if(t.length===1&&o?.userId){let a=new Set(t.map(c=>c.substring(e.length))),i=ur(o.userId).toString();if(a.has(i))return dt.RESTRICTED_SELF}return dt.RESTRICTED_SELECTED_PEOPLE}return dt.PUBLIC}catch{return dt.PUBLIC}}function sp(r,o){try{let n=r??[],e=X.VISIBILITY_SELF_PREFIX,t=n.filter(m=>m.startsWith(e));if(t.length===0)return[];let a=new Set(t.map(m=>m.substring(e.length))),i=o??[],c=[];for(let m of i)if(m?.userId){let h=ur(m.userId).toString();a.has(h)&&c.push(m)}return c}catch{return[]}}function j2(r,o,n){try{let e=r?.visibilityConfig?.type==="restricted"?r?.visibilityConfig?.userIds:void 0;return e&&e.length>0?Lf(e,n):sp(o,n)}catch{return[]}}function mo(r,o){try{let n=r??[],e="organizationPrivate:",t=n.filter(i=>i.startsWith(e));if(t.length===0)return[];let a=new Set(t.map(i=>i.substring(e.length)));return(o??[]).filter(i=>i?.id&&a.has(Gv(i.id)))}catch{return[]}}function Uf(r){try{let o=r?.privateModeEnabled,n=r?.privateModeType;if(!o||!n)return dt.PUBLIC;switch(n){case"organizationPrivate":return dt.ORGANIZATION_PRIVATE;case"restricted":{let e=r?.privateModeUserIds;return e&&e.length>0?dt.RESTRICTED_SELECTED_PEOPLE:dt.RESTRICTED_SELF}default:return dt.PUBLIC}}catch{return dt.PUBLIC}}function Lf(r,o){try{let n=r??[];if(n.length===0)return[];let e=o??[],t=new Set(n),a=e.filter(c=>t.has(c?.userId)),i=new Set(a.map(c=>c.userId));for(let c of n)i.has(c)||a.push({userId:c});return a}catch{return[]}}function Tr(r){try{let n=r?.data?.annotation?.context?.accessFields??[];return n.length>0?Rf(n,r?.appState?.user):Uf(r?.featureState)}catch{return dt.PUBLIC}}function kn(r,o,n){try{return r&&r.length>0?r:Zc(o,n).users}catch{return[]}}function Zc(r,o){try{let n=r?.data?.annotation,e=n?.context?.accessFields??[];if(e.length>0){let i=Rf(e,r?.appState?.user),c=i===dt.RESTRICTED_SELECTED_PEOPLE?j2(n,e,o):[];return{visibility:i,users:c}}let t=Uf(r?.featureState),a=t===dt.RESTRICTED_SELECTED_PEOPLE?Lf(r?.featureState?.privateModeUserIds,o):[];return{visibility:t,users:a}}catch{return{visibility:dt.PUBLIC,users:[]}}}var Zv=(()=>{let o=class o{constructor(e,t,a,i,c,m,h,_,I,S,H,$,j,Z,re,se){this.commentActionsService=e,this.commentService=t,this.domService=a,this.coreService=i,this.customFilterService=c,this.loggingService=m,this.analyticsService=h,this.commentTextPortalService=_,this.serviceBook=I,this.domSanitizer=S,this.contactService=H,this.authService=$,this.docService=j,this.targetRegistry=Z,this.suggestionActions=re,this.commonDbService=se,this.viewsService=null,this.inFlightSubmits=new Set,this.serviceBook.observe(Eo).subscribe(_e=>{this.viewsService=_e??null})}isSubmitInFlight(e){return!!e&&this.inFlightSubmits.has(e)}get timestamp(){return this.commonDbService.getServerTimestamp()}deleteComment(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=i(),m=t;t||(m=c.data?.annotation?.comments?.length?c.data?.annotation?.comments[0]:null),this.commentActionsService.deleteComment({annotationId:e,commentId:m?.commentId,skipDeleteThreadConfirmation:a}),m?.commentId&&this.clearEditDraftFromSession(e,m.commentId)}catch(i){this.loggingService.catch("Error in CommentDialogActionService deleteComment:",i)}}changeCommentStatus(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:t.status})}catch(a){this.loggingService.catch("Error in CommentDialogActionService changeCommentStatus:",a)}}changeStatus(e,t){try{this.changeCommentStatus(e,t)}catch(a){this.loggingService.catch("Error in CommentDialogActionService changeStatus:",a)}}openAllComments(e){try{if(!this.coreService.getContextConfig(e))return;this.commentService.onSidebarButtonOnCommentDialogClick(),this.commentService.setSidebarVisibility(!0),(document.querySelector(X.TAGS.VELT_COMMENTS_SIDEBAR)||document.querySelector(X.TAGS.SNIPPYLY_COMMENTS_SIDEBAR))?.hasAttribute(X.ATTRIBUTES.EMBED_MODE)&&this.commentService.openSidebar()}catch(t){this.loggingService.catch("Error in CommentDialogActionService openAllComments:",t)}}copyLink(e){return Ae(this,null,function*(){try{return this.coreService.getContextConfig(e)?!!(yield this.commentActionsService.copyLink({annotationId:e})):!1}catch(t){return this.loggingService.catch("Error in CommentDialogActionService copyLink:",t),!1}})}approveComment(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t().data?.annotation&&this.commentActionsService.approveCommentAnnotation({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService approveComment:",t)}}closeAssignToMenu(e,t){try{let a=t?this.coreService.getLocalUIState(t):void 0;a&&a.update(i=>f(g({},i),{assignToMenuOpened:!1}))}catch(a){this.loggingService.catch("Error in CommentDialogActionService closeAssignToMenu:",a)}}assignCommentToUser(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;i().data?.annotation&&(this.commentActionsService.assignUser({annotationId:e,assignedTo:t}),this.closeAssignToMenu(e,a))}catch(i){this.loggingService.catch("Error in CommentDialogActionService assignCommentToUser:",i)}}closeDialog(){try{this.domService.resetSelectedAnnotationsMap()}catch(e){this.loggingService.catch("Error in CommentDialogActionService closeDialog:",e)}}toggleHideReply(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(t.update(c=>(c.uiState.showReplies=!1,c.uiState.collapsedComments=!0,c.uiState.showAllComments=!1,c)),this.coreService.recomputeDerivedProperties(e),i)if(a.featureState?.sidebarMode)this.domService.toggleAnnotationSelection(i,a.uiState?.containerComponentId,"sidebarShowReplies");else{let c=i.multiThreadAnnotationId||a.uiState?.multiThreadAnnotationId;this.domService.toggleAnnotationSelection(i,a.uiState?.containerComponentId,void 0,void 0,c)}}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleHideReply:",t)}}toggleFormatToolbar(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{formatToolbarOpen:!a.uiState?.formatToolbarOpen})}))}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleFormatToolbar:",t)}}showReplyComposer(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{showReplyComposer:!0})})),setTimeout(()=>this.focusOnComposerInput(e),100)}catch(t){this.loggingService.catch("Error in CommentDialogActionService showReplyComposer:",t)}}onMoreRepliesClick(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t();this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_MORE_REPLY_OPTION_CLICKED,{annotationId:e,commentType:this.commentService.getCommentType(a.data?.annotation),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),t.update(i=>{let c=!i.uiState.showAllComments;return i.uiState.showAllComments=c,i.uiState.collapsedComments=!c,i})}catch(t){this.loggingService.catch("Error in CommentDialogActionService onMoreRepliesClick:",t)}}navigateToComment(e){try{let t=this.coreService.getContextConfig(e);if(!t)return null;let i=t().data?.annotation;return i?(this.commentService.onCommentNavigationButtonClick(i),i):null}catch(t){return this.loggingService.catch("Error in CommentDialogActionService navigateToComment:",t),null}}onInboxModeChange(e,t){try{if(t){let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>f(g({},i),{uiState:f(g({},i.uiState),{showAllComments:!0,collapsedComments:!1})}))}}catch(a){this.loggingService.catch("Error in CommentDialogActionService onInboxModeChange:",a)}}onSignInClick(){try{this.commentService.onSignInClick()}catch(e){this.loggingService.catch("Error in CommentDialogActionService onSignInClick:",e)}}onUpgradeClick(){try{this.commentService.onUpgradeClick()}catch(e){this.loggingService.catch("Error in CommentDialogActionService onUpgradeClick:",e)}}resolveComment(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: resolveComment","color: green;");try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:this.customFilterService.resolvedStatus})}catch(a){this.loggingService.catch("Error in CommentDialogActionService resolveComment:",a)}}unresolveComment(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: unresolveComment","color: green;");try{let a=this.coreService.getContextConfig(e);if(!a)return;a().data?.annotation&&this.commentActionsService.updateStatus({annotationId:e,status:this.customFilterService.defaultStatus})}catch(a){this.loggingService.catch("Error in CommentDialogActionService unresolveComment:",a)}}toggleShowReplies(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return{openFocusedThread:!1,annotation:null};let i=a(),c=i.data?.annotation;if(c){if(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_MORE_REPLY_OPTION_CLICKED,{annotationId:c.annotationId,commentType:this.commentService.getCommentType(c),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),i.featureState?.isFocusedThreadEnabled&&i.featureState?.openAnnotationInFocusMode)return{openFocusedThread:!0,annotation:c};if(a.update(m=>{let h=t!==void 0?t:!m.uiState.showReplies;return f(g({},m),{uiState:f(g({},m.uiState),{showReplies:h,collapsedComments:!1,showAllComments:!0,commentDialogSelected:h})})}),this.coreService.recomputeDerivedProperties(e),!i.uiState?.commentPinSelected)if(i.featureState?.sidebarMode)this.domService.toggleAnnotationSelection(c,i.uiState?.containerComponentId,"sidebarShowReplies");else{let m=c.multiThreadAnnotationId||i.uiState?.multiThreadAnnotationId;this.domService.toggleAnnotationSelection(c,i.uiState?.containerComponentId,void 0,void 0,m)}}return{openFocusedThread:!1,annotation:null}}catch(a){return this.loggingService.catch("Error in CommentDialogActionService toggleShowReplies:",a),{openFocusedThread:!1,annotation:null}}}acceptCommentAnnotation(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(!i)return;this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ACCEPT_BUTTON_CLICKED,{annotationId:i.annotationId,commentType:this.commentService.getCommentType(i),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),this.commentTextPortalService.onAcceptComment(i),this.commentActionsService.acceptCommentAnnotation({annotationId:i.annotationId})}catch(t){this.loggingService.catch("Error in CommentDialogActionService acceptCommentAnnotation:",t)}}emitCommentActionClicked(e){try{let t=this.commentService.getCommentAnnotationByIdSync(e.annotationId);if(!t)return;this.commentActionsService.emitCommentActionClicked(f(g({},e),{annotation:t}))}catch(t){this.loggingService.catch("Error in CommentDialogActionService emitCommentActionClicked:",t)}}acceptSuggestion(e){return Ae(this,null,function*(){try{this.commentActionsService.acceptSuggestion({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService acceptSuggestion:",t)}})}rejectSuggestion(e,t){return Ae(this,null,function*(){try{this.commentActionsService.rejectSuggestion({annotationId:e,reason:t})}catch(a){this.loggingService.catch("Error in CommentDialogActionService rejectSuggestion:",a)}})}deleteSuggestionThread(e){return Ae(this,null,function*(){try{if(!e)return;yield this.commentActionsService.deleteCommentAnnotation({annotationId:e})}catch(t){this.loggingService.catch("Error in CommentDialogActionService deleteSuggestionThread:",t)}})}openSuggestionComment(e){try{if(!e)return;this.commentService.scrollToCommentByAnnotationId(e),this.commentService.selectCommentByAnnotationId(e)}catch(t){this.loggingService.catch("Error in CommentDialogActionService openSuggestionComment:",t)}}rejectCommentAnnotation(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t(),i=a.data?.annotation;if(!i)return;this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_REJECT_BUTTON_CLICKED,{annotationId:i.annotationId,commentType:this.commentService.getCommentType(i),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),this.commentActionsService.rejectCommentAnnotation({annotationId:i.annotationId})}catch(t){this.loggingService.catch("Error in CommentDialogActionService rejectCommentAnnotation:",t)}}deleteAttachment(e,t,a,i){try{let c=this.coreService.getContextConfig(e);if(!c)return;let m=c(),h=i?this.coreService.getLocalUIState(i):void 0,_=h?.()?.editComment,I=null;if(a?I=_?.attachments?.[t]:I=h?.()?.selectedAttachments?.[t],I?.attachmentId){let S=_?m.uiState?.editCommentTextArea?.nativeElement:m.uiState?.newCommentTextArea?.nativeElement;S&&this.removeAttachmentTag(e,I.attachmentId,S,i)}if(a&&h){let S=h()?.editComment;if(S?.attachments){let H=[...S.attachments],$=H.splice(t,1);h.update(j=>f(g({},j),{editComment:f(g({},j.editComment),{attachments:H}),attachmentsToDelete:[...j.attachmentsToDelete||[],...$]}))}}else if(h){let H=h()?.selectedFiles?.[t];if(H?.url)try{URL.revokeObjectURL(H.url)}catch{}h.update($=>{let j=$.selectedFiles?[...$.selectedFiles.slice(0,t),...$.selectedFiles.slice(t+1)]:[],Z=$.selectedAttachments?[...$.selectedAttachments.slice(0,t),...$.selectedAttachments.slice(t+1)]:[];return f(g({},$),{selectedFiles:j,selectedAttachments:Z})})}if(!a){let H=this.coreService.getOrCreateComposerDraft(e)();if(H.selectedFiles?.length||H.selectedAttachments?.length){let $=H.selectedFiles?.[t];if($?.url)try{URL.revokeObjectURL($.url)}catch{}this.coreService.setComposerDraftAttachments(e,{selectedFiles:(H.selectedFiles||[]).filter((j,Z)=>Z!==t),selectedAttachments:(H.selectedAttachments||[]).filter((j,Z)=>Z!==t)}),Kv(h)}}!a&&I&&this.deleteAttachments(e,[I]),this.checkGetAnnotationDraftAttribute(e,i)}catch(c){this.loggingService.catch("Error in CommentDialogActionService deleteAttachment:",c)}}removeInvalidFile(e,t,a){try{let c=this.coreService.getOrCreateComposerDraft(e)(),m=!1;if(c.invalidSelectedFiles?.length&&t>=0&&t<c.invalidSelectedFiles.length){let I=c.invalidSelectedFiles[t];if(I?.url)try{URL.revokeObjectURL(I.url)}catch{}this.coreService.setComposerDraftAttachments(e,{invalidSelectedFiles:c.invalidSelectedFiles.filter((S,H)=>H!==t)}),m=!0}let h=a?this.coreService.getLocalUIState(a):void 0;if(!h)return;let _=h();if(_?.invalidSelectedFiles&&_.invalidSelectedFiles.length>t){let I=[..._.invalidSelectedFiles.slice(0,t),..._.invalidSelectedFiles.slice(t+1)];this.loggingService.log(`Invalid file removed at index ${t} for annotation ${e}. Remaining: ${I.length}`),h.update(S=>f(g({},S),{invalidSelectedFiles:I}))}else m||this.loggingService.catch(`Cannot remove invalid file: Index ${t} out of bounds for annotation ${e}`,new Error("Index out of bounds"))}catch(i){this.loggingService.catch("Error in CommentDialogActionService removeInvalidFile:",i)}}setAssignTo(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>{let c=i.featureState?.assignToType==="checkbox"?!0:i.data?.isAssignedCheckbox;return f(g({},i),{data:f(g({},i.data),{assignTo:t,isAssignedCheckbox:c})})})}catch(a){this.loggingService.catch("Error in CommentDialogActionService setAssignTo:",a)}}toggleAssignToCheckbox(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;t.update(a=>f(g({},a),{data:f(g({},a.data),{isAssignedCheckbox:!a.data?.isAssignedCheckbox})}))}catch(t){this.loggingService.catch("Error in CommentDialogActionService toggleAssignToCheckbox:",t)}}onDeleteRecorderAnnotation(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=a?this.coreService.getLocalUIState(a):void 0;c&&c.update(I=>f(g({},I),{localRecordedData:(I.localRecordedData||[]).filter(S=>S.id!==t.annotationId)}));let m=c?.()?.editComment,_=i().data?.annotation;m?.commentId&&_?.annotationId&&this.commentActionsService.deleteRecording({annotationId:_.annotationId,commentId:m.commentId,recorderId:t.annotationId})}catch(i){this.loggingService.catch("Error in CommentDialogActionService onDeleteRecorderAnnotation:",i)}}onRecordedData(e,t,a){try{let i=a?this.coreService.getLocalUIState(a):void 0;i&&(i.update(c=>f(g({},c),{localRecordedData:[...c.localRecordedData||[],t]})),Kv(i)),this.domService.setRecordingInProgress(e,!1),this.checkGetAnnotationDraftAttribute(e,a)}catch(i){this.loggingService.catch("Error in CommentDialogActionService onRecordedData:",i)}}addFiles(e,t,a){return Ae(this,null,function*(){try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot add files: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation;if(!m){this.loggingService.catch(`Cannot add files: No annotation found for ${e}`,new Error("Annotation not found"));return}this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_BUTTON_CLICKED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()});let h=a?this.coreService.getLocalUIState(a):void 0,_=[],I=[];if(t.length)for(let H=0;H<t.length;H++){let $=t[H],j=URL.createObjectURL($),Z=this.domSanitizer.bypassSecurityTrustUrl(j),re=this.commentActionsService.validateFile($);if(re.valid){let se=$?.type,_e={file:$,url:$?.type?.includes("svg")?Z:j,fileType:se};_.push(_e),h&&h.update(le=>f(g({},le),{selectedFiles:[...le.selectedFiles||[],_e]}))}else{let se={file:$,url:j,errorMessage:re?.maxAllowedSizeInMB?`Size > ${re?.maxAllowedSizeInMB}MB`:"Size > 15MB"};I.push(se),h&&h.update(_e=>f(g({},_e),{invalidSelectedFiles:[..._e.invalidSelectedFiles||[],se]})),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_SIZE_EXCEEDED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentSize:$.size,attachmentType:$.type})}}if(i.update(H=>f(g({},H),{uiState:f(g({},H.uiState),{uploadingAttachments:!0})})),Kv(h),this.coreService.isStandaloneComposerOwner(a)){let H=this.coreService.getOrCreateComposerDraft(e)();this.coreService.setComposerDraftAttachments(e,{selectedFiles:[...H.selectedFiles||[],..._],invalidSelectedFiles:[...H.invalidSelectedFiles||[],...I]})}let S=yield this.uploadFiles(e,a);if(h&&h.update(H=>f(g({},H),{selectedAttachments:[...H.selectedAttachments||[],...S]})),i.update(H=>f(g({},H),{uiState:f(g({},H.uiState),{uploadingAttachments:!1})})),Kv(h),this.coreService.isStandaloneComposerOwner(a)){let H=this.coreService.getOrCreateComposerDraft(e)();this.coreService.setComposerDraftAttachments(e,{selectedAttachments:[...H.selectedAttachments||[],...S||[]]})}this.checkGetAnnotationDraftAttribute(e,a)}catch(i){this.loggingService.catch("Error in CommentDialogActionService addFiles:",i);let c=this.coreService.getContextConfig(e);c&&c.update(m=>f(g({},m),{uiState:f(g({},m.uiState),{uploadingAttachments:!1})}))}})}uploadFiles(e,t){return Ae(this,null,function*(){try{let a=this.coreService.getContextConfig(e);if(!a)return[];let i=a(),c=i.data?.annotation,m=t?this.coreService.getLocalUIState(t):void 0,h=m?.()?.selectedFiles||[];if(!c||!h.length)return[];let _=[],I=(S,H)=>{m&&m.update($=>f(g({},$),{selectedFiles:$.selectedFiles?.map((j,Z)=>Z===S?g(g({},j),H):j)}))};for(let S=0;S<h.length;S++){let H=h[S];if(!H.uploaded&&!H.uploading){I(S,{uploading:!0});let $=H.file;try{let[j]=yield this.commentActionsService.addAttachment({annotationId:c.annotationId,files:[$]},"internal"),Z=j?.attachment;if(Z){this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_ADDED,{annotationId:c.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(c),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentId:Z.attachmentId,attachmentSize:Z.size,attachmentType:Z.type}),_.push(Z);let re=a(),se=re.uiState?.editCommentTextArea?.nativeElement||re.uiState?.newCommentTextArea?.nativeElement;se&&re.uiState?.attachmentNameInMessage&&setTimeout(()=>{this.focusOnComposerInput(e,!0),this.insertAttachmentTag(e,se,Z,t)},100)}I(S,{uploaded:!0,uploading:!1})}catch(j){this.loggingService.catch("Error uploading individual file:",j),I(S,{uploading:!1})}}}return _}catch(a){return this.loggingService.catch("Error in CommentDialogActionService uploadFiles:",a),[]}})}startRecording(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot start recording: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation;if(!m){this.loggingService.catch(`Cannot start recording: No annotation found for ${e}`,new Error("Annotation not found"));return}this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_RECORDING_TOOL_CLICKED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),recorderType:t});let h=m?.metadata?.clientDocumentId,_=c.uiState?.commentDialogUniqueId,I=c.uiState?.darkMode,S=c.uiState?.dialogShadowDOM;this.serviceBook.get(dn)?.initRecording(t,a??_,!0,I,S,m.annotationId,h),setTimeout(()=>{this.checkGetAnnotationDraftAttribute(e,a)},100)}catch(i){this.loggingService.catch("Error in CommentDialogActionService startRecording:",i)}}checkGetAnnotationDraftAttribute(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;let i=a(),m=(t?this.coreService.getLocalUIState(t):void 0)?.(),h=m?.composerContent,_=h&&h!==`
2
2
  `&&h.trim()!=="",I=m?.selectedAttachments,S=m?.localRecordedData,H=i.uiState?.recorderInitConfig,j=!!(_||I?.length||S?.length||H&&(H?.panelId===t||H?.commentAnnotationId===e))?e:null;i.uiState?.getAnnotationDraftAttribute!==j&&a.update(Z=>f(g({},Z),{uiState:f(g({},Z.uiState),{getAnnotationDraftAttribute:j})}))}catch(a){this.loggingService.catch("Error in CommentDialogActionService checkGetAnnotationDraftAttribute:",a)}}saveDraftComment(e,t){return Ae(this,null,function*(){try{let a=this.commentService.getDraftMode(),i=this.coreService.getContextConfig(e);if(!i)return;let c=i(),h=(t?this.coreService.getLocalUIState(t):void 0)?.(),_=!!h?.editComment,I=!!c.uiState?.getAnnotationDraftAttribute,S=h?.composerContent,H=!!(S&&S!==`
3
3
  `&&S.trim()||h?.selectedAttachments?.length||h?.localRecordedData?.length);a&&!_&&(I||H)&&(yield this.addComment(e,!0,t))}catch(a){this.loggingService.catch("Error in CommentDialogActionService saveDraftComment:",a)}})}saveEditDraftToSession(e,t){try{if(!t)return;let i=this.coreService.getLocalUIState(t)?.(),c=i?.editComment,m=c?.commentId;if(!c||!m)return;let h=i?.composerContent??"",_=i?.composerContentHTML??"",H=this.coreService.getContextConfig(e)?.()?.uiState?.editCommentTextArea?.nativeElement?.innerHTML??_,$=c.commentText??"",j=c.commentHtml??"";if(!(h!==$||H!==j)){this.clearEditDraftFromSession(e,m);return}this.coreService.setEditDraft(e,m,{composerContent:h,composerContentHTML:H})}catch(a){this.loggingService.catch("Error in CommentDialogActionService saveEditDraftToSession:",a)}}restoreEditDraftFromSession(e,t){try{return this.coreService.getEditDraft(e,t)}catch(a){return this.loggingService.catch("Error in CommentDialogActionService restoreEditDraftFromSession:",a),null}}clearEditDraftFromSession(e,t){try{this.coreService.clearEditDraft(e,t)}catch(a){this.loggingService.catch("Error in CommentDialogActionService clearEditDraftFromSession:",a)}}buildDraftCommentSnapshot(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return null;let i=a(),m=(t?this.coreService.getLocalUIState(t):void 0)?.(),h=(m?.composerContent??"").trim(),_=m?.composerContentHTML??"",I=m?.editComment,S=i.uiState?.editCommentTextArea?.nativeElement,H=i.uiState?.newCommentTextArea?.nativeElement,$=I?S:H;$&&(_=$.innerHTML);let j=m?.selectedAttachments?m.selectedAttachments.slice():[],Z=m?.localRecordedData?m.localRecordedData.slice():[],re=new qn;return I?(Object.assign(re,I),re.attachments=[...I.attachments||[],...j],re.recorders=[...I.recorders||[],...Z]):(re.from=i.appState?.user??this.authService.getUser(),re.createdAt=new Date,re.attachments=j,re.recorders=Z),re.commentText=h,re.commentHtml=_,re.isDraft=!0,re.lastUpdated=new Date,re}catch(a){return this.loggingService.catch("Error in CommentDialogActionService buildDraftCommentSnapshot:",a),null}}addComment(e,t=!1,a){return Ae(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: addComment","color: green;");let i=!t&&!!a;i&&this.inFlightSubmits.add(a);try{let c=this.coreService.getContextConfig(e);if(!c){this.loggingService.catch(`Cannot add comment: No config found for annotation ${e}`,new Error("Config not found"));return}let m=c(),h=m.data?.annotation,_=a?this.coreService.getLocalUIState(a):void 0,I=_?.(),S=I?.selectedVisibility,H=I?.selectedVisibilityUsers,$=null;if(S&&S!=="public")try{switch(S){case dt.RESTRICTED_SELF:let le=this.authService.getUser();le?.userId&&($={type:"restricted",userIds:[le.userId]});break;case dt.RESTRICTED_SELECTED_PEOPLE:{let he=(h?.visibilityConfig?.type==="restricted"?h?.visibilityConfig?.userIds??[]:[]).filter(Ue=>!!Ue);if(he.length){$={type:"restricted",userIds:Array.from(new Set(he))};break}let Se=h?.context?.accessFields??[],Re=X.VISIBILITY_SELF_PREFIX,ze=Se.filter(Ue=>typeof Ue=="string"&&Ue.startsWith(Re)).length,Ye=sp(Se,this.contactService.getInternalUserContacts()).map(Ue=>Ue.userId).filter(Ue=>!!Ue);if(ze>0&&Ye.length===ze){$={type:"restricted",userIds:Ye};break}let ct=(H??[]).map(Ue=>Ue.userId).filter(Ue=>!!Ue),$e=this.commentService.getPrivateModeConfig(),bt=$e?.type==="restricted"?($e.userIds??[]).filter(Ue=>!!Ue):[],Xe=Array.from(new Set([...ct,...bt]));if(Xe.length){$={type:"restricted",userIds:Xe};break}let Tt=this.authService.getUser();Tt?.userId&&($={type:"restricted",userIds:[Tt.userId]});break}case dt.ORGANIZATION_PRIVATE:{let he=h?.context?.accessFields??[],Se=he.filter(ct=>typeof ct=="string"&&ct.startsWith("organizationPrivate:")).length,Re=mo(he,this.contactService.getOrgList()).map(ct=>ct.id).filter(Boolean);if(Se>0&&Re.length===Se){$={type:"organizationPrivate",organizationIds:Re};break}let ze=this.commentService.getPrivateModeConfig();if(ze?.type==="organizationPrivate"&&(ze.organizationIds?.length||ze.organizationId)){$=g(g({type:"organizationPrivate"},ze.organizationIds?.length&&{organizationIds:ze.organizationIds}),ze.organizationId&&{organizationId:ze.organizationId});break}let Ye=this.authService.getUser()?.clientOrganizationId;Ye&&($={type:"organizationPrivate",organizationId:Ye});break}}if($?.type==="restricted"){let le=this.authService.getUser();le?.userId&&($=eo($,le.userId))}}catch(le){this.loggingService.catch("Error converting visibility config:",le)}let j=I?.composerContent,Z=I?.composerContentHTML,re=I?.selectedAttachments||[],se=I?.localRecordedData||[],_e=m.uiState?.newCommentTextArea?.nativeElement;if(_e?.innerHTML&&(Z=_e.innerHTML),!h){this.loggingService.catch(`Cannot add comment: No annotation found for ${e}`,new Error("Annotation not found"));return}if(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_SUBMIT_TRIGGERED,{annotationId:h.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(h),uiLocation:m.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),triggerType:"submitButton"}),j?.trim()||re?.length||se?.length){let le=new qn;le.attachments=re,le.recorders=se?se.slice():[],le.commentText=j?.trim()||"";let he=this.domService.trimCommentHtml(Z||"");he=this.highlightLinks(he),he=this.highlightAtHere(he,m.uiState?.atHereLabel),le.commentHtml=he,le.lastUpdated=new Date,le.createdAt=new Date,le.from=m.appState?.user??this.authService.getUser(),le.customList=m.data?.customList||[],le.toOrganizationUserGroup=m.data?.toOrganizationUserGroup||[],le.taggedUserContacts=m.data?.taggedUserContacts?.slice()||[],le.isDraft=t,this.addToEmailsToComment(e,le,a),h.status?.type==="terminal"&&c.update(Xe=>f(g({},Xe),{data:f(g({},Xe.data),{annotation:f(g({},Xe.data.annotation),{status:this.customFilterService.defaultStatus})})}));let Se=Bf(m.data?.assignTo,m.featureState?.assignToType,m.data?.isAssignedCheckbox),Re=Se;Se&&(c.update(Xe=>f(g({},Xe),{data:f(g({},Xe.data),{annotation:f(g({},Xe.data.annotation),{assignedTo:Xe.data?.assignTo})})})),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ASSIGNED,{annotationId:h.annotationId,commentThreadId:le?.commentId,commentType:this.commentService.getCommentType(h),uiLocation:m.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}));let ze=c().data?.annotation,Ye=f(g({},ze),{comments:[...ze?.comments||[],le]});this.commentActionsService.onCommentSaveTriggered(h.annotationId,Ye);let ct=this.coreService.isTempAnnotationId(h.annotationId),$e=I?.inlineCommentSectionMode??m.featureState?.inlineCommentSectionMode;if(z2($e,h.annotationId,ct)){let Xe=ze;if($)try{let Ue=this.authService.getUser()?.userId,Ut=An($,Ue);Xe=f(g({},ze),{context:f(g({},ze?.context),{_setAccessFields:Ut}),visibilityConfig:Pn($,Ue)})}catch(Ue){this.loggingService.catch("Error building accessFields from visibility:",Ue)}let Tt={annotation:Xe,updatedComment:le,type:Xe?.comments?.length?Ze.ADDED:Ze.NEWLY_ADDED};c.update(Ue=>f(g({},Ue),{uiState:f(g({},Ue.uiState),{pendingSaveComment:Tt})}))}else this.commentActionsService.addComment({annotationId:h.annotationId,comment:le,assignedTo:ze?.assignedTo,assigned:Re,visibility:$??void 0});if(c.update(Xe=>f(g({},Xe),{uiState:f(g({},Xe.uiState),{showCommentButtons:!1,getAnnotationDraftAttribute:null,formatToolbarOpen:!1}),data:f(g({},Xe.data),{customList:[],toOrganizationUserGroup:[],taggedUserContacts:[],selectedUserContacts:[]})})),_&&_.update(Xe=>f(g({},Xe),{composerContent:"",composerContentHTML:"",composerInOpenState:!1,selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],localRecordedData:[],attachmentsToDelete:[]})),!t){let Xe=this.coreService.getOrCreateComposerDraft(e)();lu(Xe)||this.coreService.clearComposerDraft(e)}let bt=c();bt.uiState?.newCommentTextArea?.nativeElement&&(bt.uiState.newCommentTextArea.nativeElement.innerText=""),this.scrollToBottom(e)}}catch(c){this.loggingService.catch("Error in CommentDialogActionService addComment:",c)}finally{try{i&&this.inFlightSubmits.delete(a)}catch(c){this.loggingService.catch("Error in CommentDialogActionService addComment:",c)}}})}updateComment(e,t,a){return Ae(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateComment","color: green;");try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot update comment: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation,h=a?this.coreService.getLocalUIState(a):void 0,_=h?.(),I=_?.editComment,S=_?.composerContentHTML,H=_?.composerContent,$=c.uiState?.editCommentTextArea?.nativeElement;if($?.innerHTML&&(S=$.innerHTML),!m||!I){this.loggingService.catch(`Cannot update comment: Missing annotation or editComment for ${e}`,new Error("Missing data"));return}this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_SUBMIT_TRIGGERED,{annotationId:m.annotationId,commentThreadId:I.commentId,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),triggerType:"submitButton"});let j=g({},I);j.isDraft&&(j.isDraft=!1),j.commentText=H||"",j.lastUpdated=new Date;let Z=this.domService.trimCommentHtml(S||"");Z=this.highlightLinks(Z),Z=this.highlightAtHere(Z,c.uiState?.atHereLabel),j.commentHtml=Z;let re=_?.selectedAttachments||[];re.length&&(j.attachments||(j.attachments=[]),j.attachments=[...j.attachments,...re]);let se=_?.localRecordedData||[];se.length&&(j.recorders||(j.recorders=[]),j.recorders.push(...se)),c.data?.customList?.length&&(j.customList||(j.customList=[]),j.customList=[...j.customList,...c.data.customList]),c.data?.toOrganizationUserGroup?.length&&(j.toOrganizationUserGroup||(j.toOrganizationUserGroup=[]),j.toOrganizationUserGroup=[...j.toOrganizationUserGroup,...c.data.toOrganizationUserGroup]),c.data?.taggedUserContacts?.length&&(j.taggedUserContacts=c.data.taggedUserContacts||[]),this.addToEmailsToComment(e,j,a),m.status?.type==="terminal"&&i.update(Ye=>f(g({},Ye),{data:f(g({},Ye.data),{annotation:f(g({},Ye.data.annotation),{status:this.customFilterService.defaultStatus})})}));let _e=c.data?.assignTo,le=Bf(_e,c.featureState?.assignToType,c.data?.isAssignedCheckbox);le&&(i.update(Ye=>f(g({},Ye),{data:f(g({},Ye.data),{annotation:f(g({},Ye.data.annotation),{assignedTo:Ye.data?.assignTo})})})),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ASSIGNED,{annotationId:m.annotationId,commentThreadId:j.commentId,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}));let he=i().data?.annotation,Se=f(g({},he),{comments:(he?.comments||[]).map(Ye=>Ye.commentId===j.commentId?j:Ye)});this.commentActionsService.onCommentSaveTriggered(m.annotationId,Se),this.commentActionsService.updateComment({annotationId:m.annotationId,comment:j}),j.commentId&&this.clearEditDraftFromSession(m.annotationId,j.commentId),le&&_e&&this.commentActionsService.assignUser({annotationId:m.annotationId,assignedTo:_e});let Re=_?.attachmentsToDelete||[];Re.length&&this.deleteAttachments(e,Re),h&&h.update(Ye=>f(g({},Ye),{editComment:null,editCommentIndex:null,composerContent:"",composerContentHTML:"",composerInOpenState:!1,selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],localRecordedData:[],attachmentsToDelete:[]})),i.update(Ye=>f(g({},Ye),{uiState:f(g({},Ye.uiState),{getAnnotationDraftAttribute:null,formatToolbarOpen:!1}),data:f(g({},Ye.data),{customList:[],toOrganizationUserGroup:[],taggedUserContacts:[],selectedUserContacts:[]})}));let ze=i();ze.uiState?.editCommentTextArea?.nativeElement&&(ze.uiState.editCommentTextArea.nativeElement.innerText="")}catch(i){this.loggingService.catch("Error in CommentDialogActionService updateComment:",i)}})}deleteAnnotation(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: deleteAnnotation","color: green;");try{if(["keydownBackspace","keydownDelete","keyupBackspace","keyupDelete"].includes(t)&&!this.commentService.getDeleteOnBackspace())return;this.commentService.deleteCommentPinAnnotations(t)}catch(a){this.loggingService.catch("Error in CommentDialogActionService deleteAnnotation:",a)}}cancelEdit(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: cancelEdit","color: green;");try{if(t){let i=this.coreService.getLocalUIState(t);i&&i.update(c=>f(g({},c),{editComment:null,editCommentIndex:null,composerContent:"",composerContentHTML:"",composerInOpenState:!1,selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],attachmentsToDelete:[],localRecordedData:[]}))}let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>{let c=f(g({},i),{data:f(g({},i.data),{taggedUserContacts:[],toOrganizationUserGroup:[],customList:[],assignTo:void 0,selectedUserContacts:[]}),uiState:f(g({},i.uiState),{getAnnotationDraftAttribute:null,formatToolbarOpen:!1})});return i.uiState?.editCommentTextArea?.nativeElement&&(i.uiState.editCommentTextArea.nativeElement.innerText=""),c})}catch(a){this.loggingService.catch("Error in CommentDialogActionService cancelEdit:",a)}}onAtClick(e,t,a){this.loggingService.log("%c[WB] Calling FUNCTION: onAtClick","color: green;");try{let i=this.coreService.getContextConfig(e);if(!i){this.loggingService.catch(`Cannot handle onAtClick: No config found for annotation ${e}`,new Error("Config not found"));return}let c=i(),m=c.data?.annotation;if(!m){this.loggingService.catch(`Cannot handle onAtClick: No annotation found for ${e}`,new Error("Annotation not found"));return}let h=G2(t,c.uiState),_=a?this.coreService.getLocalUIState(a):void 0;_&&h&&_.update(I=>f(g({},I),{composerContent:h.innerText,composerContentHTML:this.domService.sanitizeHtml(h.innerHTML)})),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_TAG_BUTTON_CLICKED,{annotationId:m.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(m),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()})}catch(i){this.loggingService.catch("Error in CommentDialogActionService onAtClick:",i)}}onAttachmentButtonClick(e){try{let t=this.coreService.getContextConfig(e);if(!t){this.loggingService.catch(`Cannot handle onAttachmentButtonClick: No config found for annotation ${e}`,new Error("Config not found"));return}let a=t(),i=a.data?.annotation;if(!i){this.loggingService.catch(`Cannot handle onAttachmentButtonClick: No annotation found for ${e}`,new Error("Annotation not found"));return}this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_BUTTON_CLICKED,{annotationId:i.annotationId,commentThreadId:void 0,commentType:this.commentService.getCommentType(i),uiLocation:a.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()})}catch(t){this.loggingService.catch("Error in CommentDialogActionService onAttachmentButtonClick:",t)}}userContactSelected(e,t,a,i){try{let c=this.coreService.getContextConfig(e);if(!c)return;c().data?.taggedUserContacts||c.update($=>f(g({},$),{data:f(g({},$.data),{taggedUserContacts:[]})}));let h=!t?.contact?.userId,_=c()?.featureState?.anonymousEmail??this.commentService.getEnableAnonymousEmail();if(!(t?.isEmailValid===!1)&&(!h||_)&&((c().data?.taggedUserContacts||[]).find(j=>j.text===t.text)||(t?.contact?.email&&(t.contact.email=t.contact.email.replace(/[^a-zA-Z0-9]+$/,"")),c.update(j=>f(g({},j),{data:f(g({},j.data),{taggedUserContacts:[...j.data?.taggedUserContacts||[],t]})})))),a){let $=i?this.coreService.getLocalUIState(i):void 0;$&&$.update(j=>f(g({},j),{composerContent:a.innerText,composerContentHTML:a.innerHTML})),this.addSpaceAndPositionCursor(a)}let H=(i?this.coreService.getLocalUIState(i):void 0)?.()?.composerContent||"";this.extractContacts(e,H)}catch(c){this.loggingService.catch("Error in CommentDialogActionService userContactSelected:",c)}}customOptionSelected(e,t,a,i){try{if(!a)return;let c=i?this.coreService.getLocalUIState(i):void 0;c&&c.update(m=>f(g({},m),{composerContent:a.innerText,composerContentHTML:a.innerHTML})),this.addSpaceAndPositionCursor(a)}catch(c){this.loggingService.catch("Error in CommentDialogActionService customOptionSelected:",c)}}groupSelected(e,t,a,i){try{let c=this.coreService.getContextConfig(e);if(!c)return;if(c().data?.taggedGroups||c.update(_=>f(g({},_),{data:f(g({},_.data),{taggedGroups:[]})})),(c().data?.taggedGroups||[]).find(_=>_.text===t.text)||c.update(_=>f(g({},_),{data:f(g({},_.data),{taggedGroups:[..._.data?.taggedGroups||[],t]})})),a){let _=i?this.coreService.getLocalUIState(i):void 0;_&&_.update(I=>f(g({},I),{composerContent:a.innerText,composerContentHTML:a.innerHTML})),this.addSpaceAndPositionCursor(a)}}catch(c){this.loggingService.catch("Error in CommentDialogActionService groupSelected:",c)}}atHereSelected(e,t,a,i){try{if(!a)return;let c=i?this.coreService.getLocalUIState(i):void 0;c&&c.update(m=>f(g({},m),{composerContent:a.innerText,composerContentHTML:a.innerHTML})),this.addSpaceAndPositionCursor(a)}catch(c){this.loggingService.catch("Error in CommentDialogActionService atHereSelected:",c)}}addSpaceAndPositionCursor(e){try{let t=e.querySelectorAll("span[data-recently-added]"),a=null,i=0;for(let m=0;m<t.length;m++){let h=t[m],_=h.getAttribute("data-recently-added");if(_){let I=parseInt(_.split("_")[0]);I>i&&(i=I,a=h)}}if(a){let m=a.getAttribute("data-recently-added"),h=e.innerHTML,_=a.outerHTML,I=h.indexOf(_);if(I!==-1){let S=h.substring(0,I),H=h.substring(I+_.length);e.innerHTML=S+_+"&nbsp;"+H;let $=e.querySelector(`span[data-recently-added="${m}"]`);if($&&$.removeAttribute("data-recently-added"),e.focus(),$&&$.nextSibling){let j=document.createRange();j.setStart($.nextSibling,1),j.collapse(!0);let Z=window.getSelection();Z?.removeAllRanges(),Z?.addRange(j)}return}}e.focus();let c=window.getSelection();if(c&&c.rangeCount>0){let m=c.getRangeAt(0),h=document.createTextNode(" ");m.insertNode(h),m.setStartAfter(h),m.collapse(!0),c.removeAllRanges(),c.addRange(m)}else e.innerHTML=e.innerHTML+" ",setTimeout(()=>{try{let m=document.createRange();m.selectNodeContents(e),m.collapse(!1);let h=window.getSelection();h?.removeAllRanges(),h?.addRange(m)}catch(m){this.loggingService.catch("Error positioning cursor at end:",m)}},0)}catch(t){this.loggingService.catch("Error in addSpaceAndPositionCursor:",t)}}enterEditMode(e,t,a,i){try{let c=this.coreService.getContextConfig(e);if(!c)return;let m=c(),h=structuredClone(a),_=h?.commentId?this.restoreEditDraftFromSession(e,h.commentId):null,I=_?.composerContent??h?.commentText??"",S=_?.composerContentHTML??h?.commentHtml??"",H=i?this.coreService.getLocalUIState(i):void 0;H&&H.update($=>f(g({},$),{editComment:h,editCommentIndex:t,composerContent:I,composerContentHTML:S,composerInOpenState:!0})),c.update($=>f(g({},$),{data:f(g({},$.data),{taggedUserContacts:h?.taggedUserContacts||[]})})),this.extractContacts(e,h?.commentText||""),this.emailChipMigration(e,h?.commentHtml||""),setTimeout(()=>{let $=c();if($?.uiState?.editCommentTextArea?.nativeElement){let j=$.uiState.editCommentTextArea.nativeElement.closest(".velt-comment-dialog-composer");j&&j.scrollIntoView({behavior:"smooth",block:"nearest"}),$.uiState.editCommentTextArea.nativeElement.innerHTML=this.domService.sanitizeHtml(S),this.setCursorToEnd($.uiState.editCommentTextArea.nativeElement)}},300),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_EDIT_BUTTON_CLICKED,{annotationId:e,commentThreadId:a?.commentId,commentType:this.commentService.getCommentType(m.data?.annotation),uiLocation:m.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode()}),setTimeout(()=>{this.checkGetAnnotationDraftAttribute(e,i)},100)}catch(c){this.loggingService.catch("Error in enterEditMode:",c)}}setCursorToEnd(e){try{if(!e||!e.isConnected)return;let t=document.createRange(),a=window.getSelection();t.selectNodeContents(e),t.collapse(!1),a?.removeAllRanges(),a?.addRange(t),e.focus()}catch(t){this.loggingService.catch("Error in setCursorToEnd:",t)}}findParentSpan(e){try{return e.parentNode&&e.parentNode.nodeName==="SPAN"?e.parentNode:null}catch(t){return this.loggingService.catch("Error in findParentSpan:",t),null}}isCursorInsideSpan(e,t){try{let a=e.textContent||"",i=t.startOffset;return i>=0&&i<=a.length}catch(a){return this.loggingService.catch("Error in isCursorInsideSpan:",a),!1}}getOffsetInsideContainer(e){try{let t=0,a=e.previousSibling;for(;a;)a.nodeType===Node.TEXT_NODE?t+=a.textContent?.length||0:a.nodeType===Node.ELEMENT_NODE&&(t+=a.innerText.length),a=a.previousSibling;return t}catch(t){return this.loggingService.catch("Error in getOffsetInsideContainer:",t),0}}setCursorPositionAfterSpan(e,t){try{let a=window.getSelection(),i=document.createRange();if(e&&a){let c=e.length,m=Math.min(t+c,c);i.setStart(e,m),i.setEnd(e,m),a.removeAllRanges(),a.addRange(i)}}catch(a){this.loggingService.catch("Error in setCursorPositionAfterSpan:",a)}}moveCursorToEnd(e){try{if(!e?.isConnected)return;e.focus(),setTimeout(()=>{let t=document.createRange(),a=window.getSelection();t.selectNodeContents(e),t.collapse(!1),a?.removeAllRanges(),a?.addRange(t),setTimeout(()=>{this.autoScrollToBottom(e)},50)},0)}catch(t){this.loggingService.catch("Error in moveCursorToEnd:",t)}}autoScrollToBottom(e){try{if(e&&e.isConnected){let t=e.closest(".velt-composer-input");t&&(t.scrollTop=t.scrollHeight)}}catch(t){this.loggingService.catch("Error in autoScrollToBottom:",t)}}handleBackspaceOnMentionSpan(e){try{if(e.inputType!=="deleteContentBackward"&&e.inputType!=="deleteContentForward")return!1;let t=window.getSelection(),a=t?.getRangeAt(0),i=t?.anchorNode;if(i&&a){let c=this.findParentSpan(i),m=c?.parentNode;if(c&&this.isCursorInsideSpan(c,a)){e.preventDefault();let h=this.getOffsetInsideContainer(c),_=c.textContent,I=document.createTextNode(_||"");return c.replaceWith(I),this.setCursorPositionAfterSpan(I,h),m?.normalize(),!0}}return!1}catch(t){return this.loggingService.catch("Error in handleBackspaceOnMentionSpan:",t),!1}}focusOnComposerInput(e,t=!1){try{let a=this.coreService.getContextConfig(e);if(!a)return;let i=a(),c=i?.data?.annotation,m=i?.featureState?.sidebarMode,h=i?.uiState?.containerComponentId;this.commentActionsService.onComposerClick({commentAnnotation:c});let _=Nb(),I=i?.uiState?.newCommentTextArea?.nativeElement,S=i?.uiState?.editCommentTextArea?.nativeElement;I&&(I.contains(_)||this.moveCursorToEnd(I)),S&&(S.contains(_)||this.moveCursorToEnd(S))}catch(a){this.loggingService.catch("Error in focusOnComposerInput:",a)}}exitEditMode(e,t){try{if(t){let i=this.coreService.getLocalUIState(t);i&&i.update(c=>f(g({},c),{editComment:null,editCommentIndex:null}))}let a=this.coreService.getContextConfig(e);if(!a)return;a.update(i=>f(g({},i),{data:f(g({},i.data),{selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[],attachmentsToDelete:[],taggedUserContacts:[],toOrganizationUserGroup:[],customList:[],assignTo:void 0,selectedUserContacts:[]})}))}catch(a){this.loggingService.catch("Error in exitEditMode:",a)}}deleteCommentAttachment(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=i(),m=c.data?.annotation?.comments;if(!m||t<0||t>=m.length){this.loggingService.catch("Invalid comment index for deleteAttachment",new Error(`Index: ${t}`));return}let h=m[t],_=h?.attachments;if(!_||a<0||a>=_.length){this.loggingService.catch("Invalid attachment index for deleteAttachment",new Error(`Index: ${a}`));return}let I=_[a];this.commentActionsService.deleteAttachment({annotationId:e,commentId:h.commentId,attachmentId:I.attachmentId}),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_DELETED,{annotationId:e,commentThreadId:h?.commentId,commentType:this.commentService.getCommentType(c.data?.annotation),uiLocation:c.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentId:I.attachmentId,attachmentSize:I.size,attachmentType:I.type})}catch(i){this.loggingService.catch("Error in deleteAttachment:",i)}}deleteAttachments(e,t){return Ae(this,null,function*(){try{if(!t?.length)return;let a=this.coreService.getContextConfig(e);if(!a)return;let i=a();for(let c=0;c<t.length;c++){let m=t[c];yield this.commentService.deleteAttachment({attachment:m}),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_DELETED,{annotationId:e,commentThreadId:void 0,commentType:this.commentService.getCommentType(i.data?.annotation),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentId:m.attachmentId,attachmentSize:m.size,attachmentType:m.type})}}catch(a){this.loggingService.catch("Error in deleteAttachments:",a)}})}insertAttachmentTag(e,t,a,i){try{if(!this.coreService.getContextConfig(e))return;let m=null;try{if(t.getRootNode()instanceof ShadowRoot){let H=t.getRootNode();H.getSelection&&(m=H.getSelection())}}catch{}if(m=m||window.getSelection(),!m||!m.rangeCount)return;let h=m.getRangeAt(0),_=document.createElement("a");_.contentEditable="false",_.classList.add("velt-attachment-tag"),_.setAttribute("data-attachment-id",a.attachmentId.toString()),_.textContent=a.name||"",_.href=a.url||"#",_.target="_blank",_.rel="noopener noreferrer",_.addEventListener("click",H=>{H.preventDefault(),a.url&&window.open(a.url,"_blank")});let I=document.createTextNode("\xA0");h.insertNode(I),h.insertNode(_),h.collapse(!1);let S=i?this.coreService.getLocalUIState(i):void 0;S&&S.update(H=>f(g({},H),{composerContent:t.innerText,composerContentHTML:this.domService.sanitizeHtml(t.innerHTML)}))}catch(c){this.loggingService.catch("Error in insertAttachmentTag:",c)}}removeAttachmentTag(e,t,a,i){try{a.querySelectorAll(`a.velt-attachment-tag[data-attachment-id="${t}"]`).forEach(h=>{h.remove()});let m=i?this.coreService.getLocalUIState(i):void 0;m&&m.update(h=>f(g({},h),{composerContent:a.innerText,composerContentHTML:this.domService.sanitizeHtml(a.innerHTML)}))}catch(c){this.loggingService.catch("Error in removeAttachmentTag:",c)}}downloadAttachment(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;let i=a();i.featureState?.enableAttachmentDownload!==!1&&this.commentService.downloadAttachment(t),i.data?.annotation&&this.commentActionsService.onAttachmentDownloadClick(i.data.annotation,t),this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_DOWNLOADED,{annotationId:e,commentThreadId:void 0,commentType:this.commentService.getCommentType(i.data?.annotation),uiLocation:i.featureState?.sidebarMode?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),attachmentId:t.attachmentId,attachmentSize:t.size,attachmentType:t.type})}catch(a){this.loggingService.catch("Error in downloadAttachment:",a)}}scrollToBottom(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t();a?.scrollToBottom&&a.scrollToBottom.emit()}catch(t){this.loggingService.catch("Error in scrollToBottom:",t)}}updateCommentReaction(e,t,a){this.loggingService.log("%c[WB] Calling FUNCTION: updateCommentReaction","color: green;");try{let i=this.coreService.getContextConfig(e);if(!i)return;let c=i();if(c.uiState?.readOnly||c.uiState?.disabled)return;this.commentActionsService.toggleReaction({annotationId:e,commentId:a?.commentId,reaction:{reactionId:t}})}catch(i){this.loggingService.catch("Error in updateCommentReaction:",i)}}reactionToolOpen(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;i.update(c=>f(g({},c),{uiState:f(g({},c.uiState),{reactionToolOpenIndex:a?t:-1})}))}catch(i){this.loggingService.catch("Error in reactionToolOpen:",i)}}threadCardDropdownOpen(e,t,a){try{let i=this.coreService.getContextConfig(e);if(!i)return;i.update(c=>f(g({},c),{uiState:f(g({},c.uiState),{openDropdownIndexValue:a?t:-1})}))}catch(i){this.loggingService.catch("Error in optionsDropdownOpen:",i)}}changeCommentPriority(e,t){try{let a=this.coreService.getContextConfig(e);if(!a){this.loggingService.catch("changeCommentPriority: Config not found for annotation",null,{annotationId:e});return}if(!a()?.data?.annotation){this.loggingService.catch("changeCommentPriority: Annotation not found",null,{annotationId:e});return}this.commentActionsService.updatePriority({annotationId:e,priority:t.priority})}catch(a){this.loggingService.catch("Error in changeCommentPriority:",a,{annotationId:e})}}changePriorityLocally(e,t){try{let a=this.coreService.getContextConfig(e);if(!a){this.loggingService.catch("changePriorityLocally: Config not found for annotation",null,{annotationId:e});return}let c=a()?.data?.annotation?.priority,m=t.priority;m!==void 0&&m?.id===c?.id&&(m=void 0),a.update(h=>f(g({},h),{data:f(g({},h.data),{annotation:f(g({},h.data?.annotation),{priority:m})})})),this.coreService.updateComputedProperties(a)}catch(a){this.loggingService.catch("Error in changePriorityLocally:",a,{annotationId:e})}}editComment(e,t=0,a){try{let i=this.coreService.getContextConfig(e);if(!i)return this.loggingService.catch("editComment: Config not found",null,{annotationId:e}),{openFocusedThreadWithEditMode:!1,annotation:null,editCommentIndex:t};let c=i(),m=c?.data?.annotation,h=m?.comments;if(!h||!Array.isArray(h)||h.length===0)return this.loggingService.catch("editComment: No comments found",null,{annotationId:e}),{openFocusedThreadWithEditMode:!1,annotation:null,editCommentIndex:t};let _=h[t];return _?c.featureState?.isFocusedThreadEnabled&&c.featureState?.openAnnotationInFocusMode&&m?{openFocusedThreadWithEditMode:!0,annotation:m,editCommentIndex:t}:(!this.domService.getSelectedAnnotationsMap()[e]&&m&&this.domService.toggleAnnotationSelection(m,c?.uiState?.containerComponentId),this.enterEditMode(e,t,_,a),{openFocusedThreadWithEditMode:!1,annotation:null,editCommentIndex:t}):(this.loggingService.catch("editComment: Comment not found at index",null,{annotationId:e,commentIndex:t}),{openFocusedThreadWithEditMode:!1,annotation:null,editCommentIndex:t})}catch(i){return this.loggingService.catch("Error in editComment:",i,{annotationId:e,commentIndex:t}),{openFocusedThreadWithEditMode:!1,annotation:null,editCommentIndex:t}}}toggleNotificationSubscription(e){try{let t=this.coreService.getContextConfig(e);if(!t){this.loggingService.catch("toggleNotificationSubscription: Config not found",null,{annotationId:e});return}if(!t()?.data?.annotation){this.loggingService.catch("toggleNotificationSubscription: Annotation not found",null,{annotationId:e});return}this.commentActionsService.toggleNotificationSubscription({annotationId:e})}catch(t){this.loggingService.catch("Error in toggleNotificationSubscription:",t,{annotationId:e})}}openAssignToMenu(e,t){try{let a=t?this.coreService.getLocalUIState(t):void 0;a&&a.update(i=>f(g({},i),{assignToMenuOpened:!0}))}catch(a){this.loggingService.catch("Error in openAssignToMenu:",a,{annotationId:e})}}changeCommentAccessMode(e,t){try{let a=this.coreService.getContextConfig(e);if(!a){this.loggingService.catch("changeCommentAccessMode: Config not found",null,{annotationId:e});return}if(!a()?.data?.annotation){this.loggingService.catch("changeCommentAccessMode: Annotation not found",null,{annotationId:e});return}a.update(m=>f(g({},m),{data:f(g({},m.data),{annotation:f(g({},m.data?.annotation),{iam:f(g({},m.data?.annotation?.iam),{accessMode:t})})})})),this.coreService.updateComputedProperties(a),this.commentActionsService.updateAccess({annotationId:e,accessMode:t})}catch(a){this.loggingService.catch("Error in changeCommentAccessMode:",a,{annotationId:e})}}toggleCustomChip(e,t){return Ae(this,null,function*(){try{let a=this.coreService.getContextConfig(e);if(!a){this.loggingService.catch("toggleCustomChip: Config not found",null,{annotationId:e});return}let i=a(),c=i?.data?.annotation,m=i?.data?.customChipData;if(!c){this.loggingService.catch("toggleCustomChip: Annotation not found",null,{annotationId:e});return}if(!m){this.loggingService.catch("toggleCustomChip: CustomChipData not configured",null,{annotationId:e});return}if(!t||!t.id){this.loggingService.catch("toggleCustomChip: Invalid item",null,{annotationId:e,item:t});return}let h=c.customList||[],_=new Set(h.map($=>$.id)),I=h.find($=>$.id===t.id),S=[];m.type==="single"?I?S=[]:S=[t]:I?S=h.filter($=>$.id!==t.id):S=[...h,t];let H=new Set(S.map($=>$.id));if(a.update($=>f(g({},$),{data:f(g({},$.data),{annotation:f(g({},$.data.annotation),{customList:S}),selectedCustomChipSet:H})})),c.annotationId)try{let $=f(g({},c),{customList:S});yield this.commentService.saveComment($,{type:Ze.CUSTOM_LIST_CHANGED,annotation:$,updatedComment:null,oldCustomList:h,newCustomList:S})}catch($){this.loggingService.catch("Error saving custom list:",$,{annotationId:e}),a.update(j=>f(g({},j),{data:f(g({},j.data),{annotation:f(g({},j.data.annotation),{customList:h}),selectedCustomChipSet:_})}))}}catch(a){this.loggingService.catch("Error in toggleCustomChip:",a,{annotationId:e,item:t})}})}markAsRead(e){this.loggingService.log("%c[WB] Calling FUNCTION: markAsRead","color: green;");try{let t=this.coreService.getContextConfig(e);if(!t){this.loggingService.catch("markAsRead: Config not found",null,{annotationId:e});return}let a=t();if(!a?.appState?.isKnownUser||a?.appState?.user?.isGuest){this.loggingService.log("markAsRead: User is not known or is guest, skipping");return}let i=a?.data?.annotation;if(!i){this.loggingService.catch("markAsRead: Annotation not found",null,{annotationId:e});return}if(!H2(i)){this.loggingService.log("markAsRead: no readable content yet (progress-only) \u2014 not stamping read");return}this.commentService.withProgressCommentsSpliced(i,()=>this.viewsService?.setCommentAnnotationAsRead(i));let c=structuredClone(i);t.update(m=>f(g({},m),{data:f(g({},m.data),{annotation:c})})),this.coreService.updateComputedProperties(t)}catch(t){this.loggingService.catch("Error in markAsRead:",t,{annotationId:e})}}markAsUnread(e){this.loggingService.log("%c[WB] Calling FUNCTION: markAsUnread","color: green;");try{let t=this.coreService.getContextConfig(e);if(!t){this.loggingService.catch("markAsUnread: Config not found",null,{annotationId:e});return}let a=t();if(!a?.appState?.isKnownUser||a?.appState?.user?.isGuest){this.loggingService.log("markAsUnread: User is not known or is guest, skipping");return}let i=a?.data?.annotation;if(!i){this.loggingService.catch("markAsUnread: Annotation not found",null,{annotationId:e});return}this.commentService.withProgressCommentsSpliced(i,()=>this.viewsService?.setCommentAnnotationAsUnread(i));let c=structuredClone(i);t.update(m=>f(g({},m),{data:f(g({},m.data),{annotation:c})})),this.coreService.updateComputedProperties(t)}catch(t){this.loggingService.catch("Error in markAsUnread:",t,{annotationId:e})}}onClick(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: onClick","color: green;");try{let a=this.coreService.getContextConfig(e);if(!a)return;let i=a();if(i?.featureState?.inlineCommentSectionMode&&e&&i?.uiState?.commentPinSelected&&i?.unreadCommentsMap?.[e]&&this.markAsRead(e),!i?.featureState?.dialogSelection)return;let m=(t?this.coreService.getLocalUIState(t):void 0)?.()?.composerContent;if(!(m&&m.trim().length>0)){let _=t?this.coreService.getLocalUIState(t):void 0;_&&_.update(S=>f(g({},S),{composerInOpenState:!1}));let I=this.coreService.getContextConfig(e);I&&I.update(S=>f(g({},S),{uiState:f(g({},S.uiState),{formatToolbarOpen:!1})}))}}catch(a){this.loggingService.catch("Error in onClick:",a,{annotationId:e})}}extractEmails(e){this.loggingService.log("%c[WB] Calling FUNCTION: extractEmails","color: green;");try{let t=Array.from(e.matchAll(new RegExp(X.REGEX_EMAIL))),a=[];for(let i of t)this.loggingService.log(i),this.loggingService.log(i.index),a.push(i[2]);return a}catch(t){return this.loggingService.catch("Error in CommentDialogActionService extractEmails:",t),[]}}checkTaggedUserContacts(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;let c=a().data?.taggedUserContacts||[];if(t){let m=[];c?.forEach(h=>{t?.includes(h?.text)||m.push(h?.text)}),c=c?.filter(h=>!m.includes(h?.text))}else c=[];a.update(m=>f(g({},m),{data:f(g({},m.data),{taggedUserContacts:c})}))}catch(a){this.loggingService.catch("Error in CommentDialogActionService checkTaggedUserContacts:",a)}}extractContacts(e,t,a=!1){this.loggingService.log("%c[WB] Calling FUNCTION: extractContacts","color: green;");try{let i=this.coreService.getContextConfig(e);if(!i)return[];let c=i(),m=this.extractEmails(t)||[];this.loggingService.log(m);let h=Array.from(new Set(m)),_=[],I=this.contactService.getInternalUserContacts()||[],S=c?.featureState?.anonymousEmail??this.commentService.getEnableAnonymousEmail();h.forEach(j=>{let Z=j?.trim()?.toLowerCase(),re=new $c,se=I.filter(_e=>_e.email===Z);if(se&&se.length>0)re=se[0];else{if(!S)return;re.email=Z,re.source="manual",a&&this.commentService.addUserContact(re)}_.push(re)}),c.data?.taggedUserContacts?.length&&c.data.taggedUserContacts.forEach(j=>{j?.contact&&!_.find(Z=>j?.contact?.email&&Z.email===j?.contact?.email)&&!_.find(Z=>j?.contact?.userId&&Z.userId===j?.contact?.userId)&&_.push(j.contact)}),i.update(j=>f(g({},j),{data:f(g({},j.data),{selectedUserContacts:_.slice()})}));let H=i();if(H.data?.selectedUserContacts?.find(j=>j.email===H.data?.assignTo?.email)||i.update(j=>j.featureState?.assignToType==="checkbox"&&_.length>0?f(g({},j),{data:f(g({},j.data),{assignTo:_[0],isAssignedCheckbox:!1})}):f(g({},j),{data:f(g({},j.data),{assignTo:void 0})})),this.extractAtHere(t,c.uiState?.atHereLabel)?.length)if(c.appState?.user?.organizationId){let Z=this.contactService.getUserDocumentContacts();Z?.length&&Z.forEach(re=>{_.find(se=>se.email===re.email)||_.push(re)})}else{let Z=this.contactService.getUserGroupContacts();Z?.length&&Z.forEach(re=>{_.find(se=>se.email===re.email)||_.push(re)})}return _}catch(i){return this.loggingService.catch("Error in CommentDialogActionService extractContacts:",i),[]}}extractAtHere(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: extractAtHere","color: green;");try{let a=new RegExp(`@${t||"here"}`,"gi"),i=Array.from(e.matchAll(a)),c=[];for(let m of i)this.loggingService.log(m),this.loggingService.log(m.index),c.push(m[0]);return c}catch(a){return this.loggingService.catch("Error in CommentDialogActionService extractAtHere:",a),[]}}highlightLinks(e){this.loggingService.log("%c[WB] Calling FUNCTION: highlightLinks","color: green;");try{if(typeof e=="string"){e&&(e=e?.replaceAll("&amp;","&"));let t=document.createElement("div");t.innerHTML=e,t.querySelectorAll("a").forEach(c=>{c.classList.contains("velt-comment-dialog--comment-link")||c.classList.add("velt-comment-dialog--comment-link"),c.hasAttribute("target")||c.setAttribute("target","_blank"),c.hasAttribute("rel")||c.setAttribute("rel","noopener noreferrer")});let i=c=>{if(c.nodeType===Node.TEXT_NODE){let m=c.textContent?.replaceAll(X.REGEX_URL,h=>new RegExp(X.REGEX_EMAIL).test("@"+h)?h:`<a class="velt-comment-dialog--comment-link" href="${h.match(/^[a-zA-Z][a-zA-Z\d+\-.]*:/)?h:`https://${h}`}" target="_blank" rel="noopener noreferrer">${h}</a>`)||"";if(m!==c.textContent){let h=document.createElement("span");h.innerHTML=m,c.parentNode?.replaceChild(h,c)}}else c.nodeType===Node.ELEMENT_NODE&&c.tagName!=="A"&&Array.from(c.childNodes).forEach(i)};return Array.from(t.childNodes).forEach(i),t.innerHTML}else return this.loggingService.catch("Error in CommentDialogActionService highlightLinks: text is not string",e),e}catch(t){return this.loggingService.catch("Error in CommentDialogActionService highlightLinks:",t),""}}highlightAtHere(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: highlightAtHere","color: green;");try{let a=t||"here",i=new RegExp(`@(${a})\\b`,"gi");return e.replaceAll(i,(m,h)=>`<mark class="velt-comment-dialog--here-chip">${h}</mark>`)}catch(a){return this.loggingService.catch("Error in CommentDialogActionService highlightAtHere:",a),""}}handleCommentLinkClick(e,t){try{this.loggingService.log("%c[WB] Calling FUNCTION: handleCommentLinkClick","color: green;");let a=this.coreService.getContextConfig(e);if(!a)return;let i=a(),c=t.target;if(i.uiState?.dialogShadowDOM&&t.composedPath&&(c=t.composedPath().find(h=>h.nodeType===Node.ELEMENT_NODE&&h.classList?.contains("velt-comment-dialog--comment-link"))||c),c&&c.classList.contains("velt-comment-dialog--comment-link")){t.preventDefault(),t.stopPropagation();let m=c.textContent||"",h=c.href||"",I=c.closest("[data-comment-id]")?.getAttribute("data-comment-id");if(I&&i.data?.annotation){let S=i.data.annotation.comments?.find(H=>H.commentId.toString()===I);if(S){let H={text:m,link:h,commentAnnotation:this.commentService.getCommentAnnotationForClient(i.data.annotation),commentId:S.commentId};i.featureState?.linkCallback?this.commentActionsService.triggerAction(lt.LINK_CLICKED,H):window.open(h,"_blank")?.focus()}}}}catch(a){this.loggingService.catch("Error in CommentDialogActionService handleCommentLinkClick:",a)}}addToEmailsToComment(e,t,a){this.loggingService.log("%c[WB] Calling FUNCTION: addToEmailsToComment","color: green;");try{if(!this.coreService.getContextConfig(e))return;let m=(a?this.coreService.getLocalUIState(a):void 0)?.()?.composerContent||"",h=this.extractContacts(e,m,!0);t.to=h}catch(i){this.loggingService.catch("Error in CommentDialogActionService addToEmailsToComment:",i)}}emailChipMigration(e,t){try{if(!t)return;let a=this.coreService.getContextConfig(e);if(!a)return;let{modifiedText:i,data:c}=this.replaceVeltAutocompleteChipAndExtractData(t);a().data?.taggedUserContacts||a.update(h=>f(g({},h),{data:f(g({},h.data),{taggedUserContacts:[]})})),c.forEach(h=>Ae(this,null,function*(){if(h.email){let _=this.contactService.getContactByEmail(h.email);_||(_=this.contactService.getUserByEmail(h.email)),_&&a.update(I=>f(g({},I),{data:f(g({},I.data),{taggedUserContacts:[...I.data?.taggedUserContacts||[],{text:h.text,userId:_.userId,contact:_}]})}))}}))}catch(a){this.loggingService.catch("Error in CommentDialogActionService emailChipMigration:",a)}}replaceVeltAutocompleteChipAndExtractData(e){try{let t=/<velt-autocomplete-chip[^>]*email="([^"]*)"[^>]*text="([^"]*)"[^>]*>.*?<\/velt-autocomplete-chip>/gi,a=[];return{modifiedText:e.replace(t,(c,m,h)=>(a.push({email:m,text:h}),h)),data:a}}catch(t){return this.loggingService.catch("Error in CommentDialogActionService replaceVeltAutocompleteChipAndExtractData:",t),{modifiedText:e,data:[]}}}detectEmailAfterAt(e,t,a,i,c){try{if(t.inputType!=="insertText"||t.data!==" "||!this.coreService.getContextConfig(e))return;let h=a,_,I=i.getRootNode();if(I instanceof ShadowRoot?_=I?.getSelection():_=window.getSelection(),_?.rangeCount){let $=_.getRangeAt(0),j=$.endOffset,Z=$.endContainer;if(Z.nodeType===Node.TEXT_NODE){let se=(Z.textContent||"").substring(0,j),_e="",le=Z;for(;le;)if(le.previousSibling)le=le.previousSibling,_e=(le.textContent||"")+_e;else if(le.parentNode&&le.parentNode!==i)le=le.parentNode;else break;h=_e+se}}let S=h.split(/\s+/),H=S.length>=2?S[S.length-2]:S[S.length-1];if(H&&H.startsWith("@")){let $=H.substring(1);if($.includes("@")&&new RegExp(X.REGEX_EMAIL).test("@"+$)){let Z=this.contactService.getContactByEmail($);if(!Z){Z=new $c;let le=$?.toLowerCase()?.trim();Z.email=le,this.contactService.addUserContact(Z)}let se="@"+(Z.name||Z.email);zc(i,se,["@"]);let _e=se;if(_e){let le={text:_e,userId:Z.userId,contact:Z};this.userContactSelected(e,le,i,c),this.closeAutocompletePanel(e)}}}}catch(m){this.loggingService.catch("Error in CommentDialogActionService detectEmailAfterAt:",m)}}closeAutocompletePanel(e){try{let t=this.coreService.getContextConfig(e);if(!t)return;let a=t();setTimeout(()=>{let i=new Event("blur"),c=a.uiState?.newCommentTextArea?.nativeElement,m=a.uiState?.editCommentTextArea?.nativeElement;c?(c.dispatchEvent(i),setTimeout(()=>{c?.focus()},10)):m&&(m.dispatchEvent(i),setTimeout(()=>{m?.focus()},10))},50)}catch(t){this.loggingService.catch("Error in CommentDialogActionService closeAutocompletePanel:",t)}}cancelComment(e,t){try{let a=this.coreService.getContextConfig(e);if(!a)return;let c=!!a().data?.annotation?.comments?.length;if(t){let h=this.coreService.getLocalUIState(t);h&&h.update(_=>f(g({},_),{composerContent:"",composerContentHTML:"",selectedFiles:[],invalidSelectedFiles:[],selectedAttachments:[]}))}a.update(h=>f(g({},h),{uiState:g(f(g({},h.uiState),{showCommentButtons:!1}),c?{}:{pendingDeleteCommentThread:!0})}));let m=a();m.uiState?.newCommentTextArea?.nativeElement&&(m.uiState.newCommentTextArea.nativeElement.innerText="",m.uiState.newCommentTextArea.nativeElement.innerHTML=""),this.checkGetAnnotationDraftAttribute(e,t)}catch(a){this.loggingService.catch("Error in cancelComment:",a)}}prePopulateCommentText(e,t){try{setTimeout(()=>{try{let a=sessionStorage.getItem(X.SESSION_STORAGE.SNIPPYLY_COMMENT_DIALOG_AUTO_POPULATE_TEXT);if(!a)return;let i=this.coreService.getContextConfig(e);if(!i)return;let m=i().uiState?.newCommentTextArea?.nativeElement;if(!m)return;sessionStorage.removeItem(X.SESSION_STORAGE.SNIPPYLY_COMMENT_DIALOG_AUTO_POPULATE_TEXT);let h=this.domService.sanitizeHtml(a+"&nbsp;<div><br></div>");m.innerHTML=h;let _=t?this.coreService.getLocalUIState(t):void 0;_&&_.update(I=>f(g({},I),{composerContent:m.innerText,composerContentHTML:this.domService.sanitizeHtml(m.innerHTML)})),this.setCursorToEnd(m),this.checkGetAnnotationDraftAttribute(e,t)}catch(a){this.loggingService.catch("Error in prePopulateCommentText setTimeout callback:",a)}},300)}catch(a){this.loggingService.catch("Error in prePopulateCommentText:",a)}}setCommentReadInAnalytics(e,t,a,i){try{if(t||i)return!1;let c=this.coreService.getContextConfig(e);if(!c)return!1;let h=c().data?.annotation;return h?.comments?.length?(this.analyticsService.trackEvent(oe.Events.Comments.COMMENT_READ,{annotationId:h.annotationId,commentType:this.commentService.getCommentType(h),uiLocation:t?"sidebar":"dialog",commentMode:this.commentService.getCommentMode(),readType:a?"open":"hover"}),!0):!1}catch(c){return this.loggingService.catch("Error in setCommentReadInAnalytics:",c),!1}}onVisibilityOptionClick(e,t,a,i){try{this.commentService.emitVisibilityOptionClicked({annotationId:e,visibility:t,users:a});let c=this.coreService.getContextConfig(e);if(!c)return;let m=c()?.data?.annotation;if(!m)return;this.commentActionsService.onVisibilityOptionClick(m,t,a),this.updateVisibility(e,t,a,i)}catch(c){this.loggingService.catch("Error in onVisibilityOptionClick:",c)}}updateVisibility(e,t,a,i){try{let c;switch(t){case"public":c={type:"public",annotationId:e};break;case dt.RESTRICTED_SELF:let m=this.authService.getUser();if(!m?.userId){this.loggingService.warn("updateVisibility: Current user not found for restrictedSelf visibility");return}c={type:"restricted",annotationId:e,userIds:[m.userId]};break;case dt.RESTRICTED_SELECTED_PEOPLE:let h=a?.map(_=>_.userId).filter(Boolean)||[];if(!h.length){this.loggingService.warn("updateVisibility: No users selected for restrictedSelectedPeople visibility");return}c={type:"restricted",annotationId:e,userIds:h};break;case dt.ORGANIZATION_PRIVATE:c=g({type:"organizationPrivate",annotationId:e},i?.length?{organizationIds:i}:{});break;default:this.loggingService.warn("updateVisibility: Invalid visibility type: "+t);return}this.applyOptimisticVisibility(e,c),this.commentActionsService.updateVisibility(c)}catch(c){this.loggingService.catch("Error in updateVisibility:",c)}}applyOptimisticVisibility(e,t){try{let a=t;if(a.type==="restricted"){let I=this.authService.getUser();I?.userId&&(a=eo(a,I.userId))}if(a.type==="organizationPrivate"&&!a.organizationId&&!a.organizationIds?.length){let I=this.authService.getUser()?.clientOrganizationId;I&&(a=f(g({},a),{organizationId:I}))}let i=this.coreService.getContextConfig(e);if(!i)return;let m=i()?.data?.annotation?.from?.userId??this.authService.getUser()?.userId,h=An(a,m),_=Pn(a,m);i.update(I=>{let S=I?.data?.annotation;return S?f(g({},I),{data:f(g({},I.data),{annotation:f(g({},S),{visibilityConfig:_,context:f(g({},S.context||{}),{accessFields:h})})})}):I})}catch(a){this.loggingService.catch("Error in applyOptimisticVisibility:",a)}}};o.\u0275fac=function(t){return new(t||o)(be(at),be(ae),be(Ne),be(co),be(Dt),be(A),be(sr),be(Yv),be(kr),be(Hh),be($t),be(ot),be(ut),be(Yg),be(Kg),be(ro))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();function Bf(r,o,n){return!!r&&(o!=="checkbox"||!!n)}function G2(r,o){return r||o?.editCommentTextArea?.nativeElement||o?.newCommentTextArea?.nativeElement}function z2(r,o,n){return!!r||!o||!!n}function H2(r){try{let o=r?.comments;return!Array.isArray(o)||o.length===0?!1:o.some(n=>Kc(n))}catch{return!0}}var vu=class extends uf{constructor(o){super(o),this._submitComment=n=>{this.getService(A).log("%c[WB] Calling FUNCTION: submitComment","color: green;");try{this.trackEvent(oe.Events.Comments.SUBMIT_COMMENT_TRIGGERED,{payload:{referenceId:n.targetComposerElementId}}),this.getService(ae).submitComment(n)}catch(e){this.getService(A).catch("Error in _submitComment: ",e)}},this._clearComposer=n=>{this.getService(A).log("%c[WB] Calling FUNCTION: clearComposer","color: green;");try{this.trackEvent(oe.Events.Comments.CLEAR_COMPOSER_TRIGGERED),this.getService(ae).clearComposer(n)}catch(e){this.getService(A).catch("Error in _clearComposer: ",e)}},this._enableFormatOptions=()=>{this.getService(A).log("%c[WB] Calling FUNCTION: enableFormatOptions","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_FORMAT_OPTIONS_TRIGGERED),this.getService(ae).enableFormatOptions()}catch(n){this.getService(A).catch("Error in _enableFormatOptions: ",n)}},this._disableFormatOptions=()=>{this.getService(A).log("%c[WB] Calling FUNCTION: disableFormatOptions","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_FORMAT_OPTIONS_TRIGGERED),this.getService(ae).disableFormatOptions()}catch(n){this.getService(A).catch("Error in _disableFormatOptions: ",n)}},this._setFormatConfig=n=>{this.getService(A).log("%c[WB] Calling FUNCTION: setFormatConfig","color: green;");try{this.trackEvent(oe.Events.Comments.SET_FORMAT_CONFIG_TRIGGERED,{payload:{config:n}}),this.getService(ae).setFormatConfig(n)}catch(e){this.getService(A).catch("Error in _setFormatConfig: ",e)}},this._getComposerData=n=>{this.getService(A).log("%c[WB] Calling FUNCTION: getComposerData","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_COMPOSER_DATA_TRIGGERED),this.getService(ae).getComposerData(n)}catch(e){return this.getService(A).catch("Error in _getComposerData: ",e),null}},this.getService(A).log("%c[WB] Creating CLASS: CommentElement","color: blue;"),this.getAllCommentAnnotations=this._getAllCommentAnnotations,this.deleteSelectedComment=this._deleteSelectedComment,this.enableTextComments=this._enableTextComments,this.disableTextComments=this._disableTextComments,this.allowedElementIds=this._allowedElementIds,this.allowedElementClassNames=this._allowedElementClassNames,this.allowedElementQuerySelectors=this._allowedElementQuerySelectors,this.disableFloatingCommentDialog=this._disableFloatingComments,this.enableFloatingCommentDialog=this._enableFloatingComments,this.attachComment=this._attachComment,this.openCommentSidebar=this._openCommentSidebar,this.closeCommentSidebar=this._closeCommentSidebar,this.toggleCommentSidebar=this._toggleCommentSidebar,this.enableModeratorMode=this._enableModeratorMode,this.disableModeratorMode=this._disableModeratorMode,this.enableStreamMode=this._enableStreamMode,this.disableStreamMode=this._disableStreamMode,this.enableSignInButton=this._enableSignInButton,this.disableSignInButton=this._disableSignInButton,this.enableUpgradeButton=this._enableUpgradeButton,this.disableUpgradeButton=this._disableUpgradeButton,this.onCommentModeChange=this._onCommentModeChange,this.enableAttachments=this._enableAttachment,this.disableAttachments=this._disableAttachment,this.enableAttachmentDownload=this._enableAttachmentDownload,this.disableAttachmentDownload=this._disableAttachmentDownload,this.isUserGlobalContact=this._isUserGlobalContact,this.enableDeviceInfo=this._enableDeviceInfo,this.disableDeviceInfo=this._disableDeviceInfo,this.enableCommentMode=this._enableCommentMode,this.disableCommentMode=this._disableCommentMode,this.enablePersistentCommentMode=this._enablePersistentCommentMode,this.disablePersistentCommentMode=this._disablePersistentCommentMode,this.enableCommentIndex=this._enableCommentIndex,this.disableCommentIndex=this._disableCommentIndex,this.enablePopoverMode=this._enablePopoverMode,this.disablePopoverMode=this._disablePopoverMode,this.enableDialogOnHover=this._enableDialogOnHover,this.enablePopoverTriangleComponent=this._enablePopoverTriangleComponent,this.disablePopoverTriangleComponent=this._disablePopoverTriangleComponent,this.disableDialogOnHover=this._disableDialogOnHover,this.enableDialogOnTargetElementClick=this._enableDialogOnTargetElementClick,this.disableDialogOnTargetElementClick=this._disableDialogOnTargetElementClick,this.enablePriority=this._enablePriority,this.disablePriority=this._disablePriority,this.enableStatus=this._enableStatus,this.disableStatus=this._disableStatus,this.enableVisibilityOptions=this._enableVisibilityOptions,this.disableVisibilityOptions=this._disableVisibilityOptions,this.enableResolveButton=this._enableResolveButton,this.disableResolveButton=this._disableResolveButton,this.enableGhostComments=this._enableGhostComments,this.disableGhostComments=this._disableGhostComments,this.enableGhostCommentsIndicator=this._enableGhostCommentsIndicator,this.disableGhostCommentsIndicator=this._disableGhostCommentsIndicator,this.setCustomStatus=this._setCustomStatus,this.setCustomPriority=this._setCustomPriority,this.setCustomCategory=this._setCustomCategory,this.enableInboxMode=this._enableInboxMode,this.disableInboxMode=this._disableInboxMode,this.enableAutoCategorize=this._enableAutoCategorize,this.disableAutoCategorize=this._disableAutoCategorize,this.enableDarkMode=this._enableDarkMode,this.disableDarkMode=this._disableDarkMode,this.setContextProvider=this._setContextProvider,this.enableSuggestionMode=this._enableSuggestionMode,this.disableSuggestionMode=this._disableSuggestionMode,this.enableMobileMode=this._enableMobileMode,this.disableMobileMode=this._disableMobileMode,this.enableInlineCommentMode=this._enableInlineCommentMode,this.disableInlineCommentMode=this._disableInlineCommentMode,this.enableMinimap=this._enableMinimap,this.disableMinimap=this._disableMinimap,this.showCommentsOnDom=this._showCommentsOnDom,this.hideCommentsOnDom=this._hideCommentsOnDom,this.enableCommentTool=this._enableCommentTool,this.disableCommentTool=this._disableCommentTool,this.setTotalMediaLength=this._setTotalMediaLength,this.onCommentAdd=this._onCommentAdd,this.onCommentUpdate=this._onCommentUpdate,this.addCommentOnSelectedText=this._addCommentOnSelectedText,this.enableSidebarUrlNavigation=this._enableSidebarUrlNavigation,this.disableSidebarUrlNavigation=this._disableSidebarUrlNavigation,this.setDStrategy=this._setDStrategy,this.enableSidebarButtonOnCommentDialog=this._enableSidebarButtonOnCommentDialog,this.disableSidebarButtonOnCommentDialog=this._disableSidebarButtonOnCommentDialog,this.onSidebarButtonOnCommentDialogClick=this._onSidebarButtonOnCommentDialogClick,this.enableReactions=this._enableReactions,this.disableReactions=this._disableReactions,this.enableAnonymousEmail=this._enableAnonymousEmail,this.disableAnonymousEmail=this._disableAnonymousEmail,this.setRecordings=this._setRecordings,this.addCommentOnElement=this._addCommentOnElement,this.enablePrivateCommentMode=this._enablePrivateCommentMode,this.disablePrivateCommentMode=this._disablePrivateCommentMode,this.enablePrivateMode=this._enablePrivateMode,this.disablePrivateMode=this._disablePrivateMode,this.enableScrollToComment=this._enableScrollToComment,this.disableScrollToComment=this._disableScrollToComment,this.enableUserMentions=this._enableUserMentions,this.disableUserMentions=this._disableUserMentions,this.setCommentSidebarFilters=this._setCommentSidebarFilters,this.setSystemFiltersOperator=this._setSystemFiltersOperator,this.enableCommentPinHighlighter=this._enableCommentPinHighlighter,this.disableCommentPinHighlighter=this._disableCommentPinHighlighter,this.enableDeleteOnBackspace=this._enableDeleteOnBackspace,this.disableDeleteOnBackspace=this._disableDeleteOnBackspace,this.enableHotkey=this._enableHotkey,this.disableHotkey=this._disableHotkey,this.enableDeviceIndicatorOnCommentPins=this._enableDeviceIndicatorOnCommentPins,this.disableDeviceIndicatorOnCommentPins=this._disableDeviceIndicatorOnCommentPins,this.getElementRefByAnnotationId=this._getElementRefByAnnotationId,this.scrollToCommentByAnnotationId=this._scrollToCommentByAnnotationId,this.selectCommentByAnnotationId=this._selectCommentByAnnotationId,this.enableRecordingSummary=this._enableRecordingSummary,this.disableRecordingSummary=this._disableRecordingSummary,this.enableRecordingTranscription=this._enableRecordingTranscription,this.disableRecordingTranscription=this._disableRecordingTranscription,this.enableRecordingCountdown=this._enableRecordingCountdown,this.disableRecordingCountdown=this._disableRecordingCountdown,this.setUnreadIndicatorMode=this._setUnreadIndicatorMode,this.enableEnterKeyToSubmit=this._enableEnterKeyToSubmit,this.disableEnterKeyToSubmit=this._disableEnterKeyToSubmit,this.enablePinShadowDOM=this._enablePinShadowDOM,this.disablePinShadowDOM=this._disablePinShadowDOM,this.enableDialogShadowDOM=this._enableDialogShadowDOM,this.disableDialogShadowDOM=this._disableDialogShadowDOM,this.enableSidebarShadowDOM=this._enableSidebarShadowDOM,this.disableSidebarShadowDOM=this._disableSidebarShadowDOM,this.enableChangeDetectionInCommentMode=this._enableChangeDetectionInCommentMode,this.disableChangeDetectionInCommentMode=this._disableChangeDetectionInCommentMode,this.showResolvedCommentsOnDom=this._showResolvedCommentsOnDom,this.enableLazyLoadResolvedComments=this._enableLazyLoadResolvedComments,this.disableLazyLoadResolvedComments=this._disableLazyLoadResolvedComments,this.hideResolvedCommentsOnDom=this._hideResolvedCommentsOnDom,this.setCustomReactions=this._setCustomReactions,this.onCommentSelectionChange=this._onCommentSelectionChange,this.getUnreadCommentCountByAnnotationId=this._getUnreadCommentCountByAnnotationId,this.getUnreadCommentAnnotationCountOnCurrentDocument=this._getUnreadCommentAnnotationCountOnCurrentDocument,this.getUnreadCommentCountOnCurrentDocument=this._getUnreadCommentCountOnCurrentDocument,this.getUnreadCommentAnnotationCountByLocationId=this._getUnreadCommentAnnotationCountByLocationId,this.getUnreadCommentCountByLocationId=this._getUnreadCommentCountByLocationId,this.updateCommentDialogPosition=this._updateCommentDialogPosition,this.enableAreaComment=this._enableAreaComment,this.disableAreaComment=this._disableAreaComment,this.setPinCursorImage=this._setPinCursorImage,this.addManualComment=this._addManualComment,this.createCustomListDataOnAnnotation=this._createCustomListDataOnAnnotation,this.createCustomListDataOnComment=this._createCustomListDataOnComment,this.excludeLocationIdsFromSidebar=this._excludeLocationIdsFromSidebar,this.enableBubbleOnPin=this._enableBubbleOnPin,this.disableBubbleOnPin=this._disableBubbleOnPin,this.enableBubbleOnPinHover=this._enableBubbleOnPinHover,this.disableBubbleOnPinHover=this._disableBubbleOnPinHover,this.enablePinDrag=this._enablePinDrag,this.disablePinDrag=this._disablePinDrag,this.enableMultiThreadMode=this._enableMultiThread,this.disableMultiThreadMode=this._disableMultiThread,this.enableMultiThread=this._enableMultiThread,this.disableMultiThread=this._disableMultiThread,this.enableGroupMultipleMatch=this._enableGroupMatchedComments,this.disableGroupMultipleMatch=this._disableGroupMatchedComments,this.enableGroupMatchedComments=this._enableGroupMatchedComments,this.disableGroupMatchedComments=this._disableGroupMatchedComments,this.enableRestrictTextSearchToAnchor=this._enableRestrictTextSearchToAnchor,this.disableRestrictTextSearchToAnchor=this._disableRestrictTextSearchToAnchor,this.updateContext=this._updateContext,this.updateVisibility=this._updateVisibility,this.getSelectedComments=this._getSelectedComments,this.enableDeleteReplyConfirmation=this._enableDeleteReplyConfirmation,this.disableDeleteReplyConfirmation=this._disableDeleteReplyConfirmation,this.onCopyLink=this._onCopyLink,this.getCommentAnnotationById=this._getCommentAnnotationById,this.enableCollapsedComments=this._enableCollapsedComments,this.disableCollapsedComments=this._disableCollapsedComments,this.enableCollapsedRepliesPreview=this._enableCollapsedRepliesPreview,this.disableCollapsedRepliesPreview=this._disableCollapsedRepliesPreview,this.onCommentSidebarActionButtonClick=this._onCommentSidebarActionButtonClick,this.setCommentSidebarData=this._setCommentSidebarData,this.onCommentSidebarInit=this._onCommentSidebarInit,this.onCommentSidebarData=this._onCommentSidebarData,this.setCommentSidebarDefaultCustomActions=this._setCommentSidebarDefaultCustomActions,this.enableSidebarCustomActions=this._enableSidebarCustomActions,this.disableSidebarCustomActions=this._disableSidebarCustomActions,this.enableQueryParamsComments=this._enableQueryParamsComments,this.disableQueryParamsComments=this._disableQueryParamsComments,this.enableResolveStatusAccessAdminOnly=this._enableResolveStatusAccessAdminOnly,this.disableResolveStatusAccessAdminOnly=this._disableResolveStatusAccessAdminOnly,this.enableLinkCallback=this._enableLinkCallback,this.disableLinkCallback=this._disableLinkCallback,this.enableSeenByUsers=this._enableSeenByUsers,this.disableSeenByUsers=this._disableSeenByUsers,this.enableShortUserName=this._enableShortUserName,this.disableShortUserName=this._disableShortUserName,this.addCommentAnnotation=this._addCommentAnnotation,this.approveCommentAnnotation=this._approveCommentAnnotation,this.acceptCommentAnnotation=this._acceptCommentAnnotation,this.rejectCommentAnnotation=this._rejectCommentAnnotation,this.acceptSuggestion=this._acceptSuggestion,this.rejectSuggestion=this._rejectSuggestion,this.subscribeCommentAnnotation=this._subscribeCommentAnnotation,this.unsubscribeCommentAnnotation=this._unsubscribeCommentAnnotation,this.deleteCommentAnnotation=this._deleteCommentAnnotation,this.getCommentAnnotations=this._getCommentAnnotations,this.getCommentAnnotationsCount=this._getCommentAnnotationsCount,this.assignUser=this._assignUser,this.updatePriority=this._updatePriority,this.updateStatus=this._updateStatus,this.updateAccess=this._updateAccess,this.resolveCommentAnnotation=this._resolveCommentAnnotation,this.getLink=this._getLink,this.copyLink=this._copyLink,this.addComment=this._addComment,this.updateComment=this._updateComment,this.deleteComment=this._deleteComment,this.getComment=this._getComment,this.addAttachment=this._addAttachment,this.deleteAttachment=this._deleteAttachment,this.getAttachment=this._getAttachment,this.deleteRecording=this._deleteRecording,this.getRecording=this._getRecording,this.addReaction=this._addReaction,this.deleteReaction=this._deleteReaction,this.toggleReaction=this._toggleReaction,this.enableReadOnly=this._enableReadOnly,this.disableReadOnly=this._disableReadOnly,this.setAssignToType=this._setAssignToType,this.enableContextInPageModeComposer=this._enableContextInPageModeComposer,this.disableContextInPageModeComposer=this._disableContextInPageModeComposer,this.clearPageModeComposerContext=this._clearPageModeComposerContext,this.setContextInPageModeComposer=this._setContextInPageModeComposer,this.focusPageModeComposer=this._focusPageModeComposer,this.enableCustomAutocompleteSearch=this._enableCustomAutocompleteSearch,this.disableCustomAutocompleteSearch=this._disableCustomAutocompleteSearch,this.fetchCommentAnnotations=this._fetchCommentAnnotations,this.setTransformContext=this._setTransformContext,this.enableSvgAsImg=this._enableSvgAsImg,this.disableSvgAsImg=this._disableSvgAsImg,this.enableFullExpanded=this._enableFullExpanded,this.disableFullExpanded=this._disableFullExpanded,this.enableCommentToNearestAllowedElement=this._enableCommentToNearestAllowedElement,this.disableCommentToNearestAllowedElement=this._disableCommentToNearestAllowedElement,this.enableDraftMode=this._enableDraftMode,this.disableDraftMode=this._disableDraftMode,this.enableDraftConfirmation=this._enableDraftConfirmation,this.disableDraftConfirmation=this._disableDraftConfirmation,this.enableFilterCommentsOnDom=this._enableFilterCommentsOnDom,this.disableFilterCommentsOnDom=this._disableFilterCommentsOnDom,this.enableReplyAvatars=this._enableReplyAvatars,this.disableReplyAvatars=this._disableReplyAvatars,this.setMaxReplyAvatars=this._setMaxReplyAvatars,this.setCommentProgressStaleAfter=this._setCommentProgressStaleAfter,this.setSidebarButtonCountType=this._setSidebarButtonCountType,this.enableFilterGhostCommentsInSidebar=this._enableFilterGhostCommentsInSidebar,this.disableFilterGhostCommentsInSidebar=this._disableFilterGhostCommentsInSidebar,this.enableFullScreenInSidebar=this._enableFullScreenInSidebar,this.disableFullScreenInSidebar=this._disableFullScreenInSidebar,this.setComposerFileAttachments=this._setComposerFileAttachments,this.setAllowedFileTypes=this._setAllowedFileTypes,this.enableForceCloseAllOnEsc=this._enableForceCloseAllOnEsc,this.disableForceCloseAllOnEsc=this._disableForceCloseAllOnEsc,this.markAsRead=this._markAsRead,this.markAsUnread=this._markAsUnread,this.enableScreenshot=this._enableScreenshot,this.disableScreenshot=this._disableScreenshot,this.enablePaginatedContactList=this._enablePaginatedContactList,this.disablePaginatedContactList=this._disablePaginatedContactList,this.enableFormatOptions=this._enableFormatOptions,this.disableFormatOptions=this._disableFormatOptions,this.setFormatConfig=this._setFormatConfig,this.submitComment=this._submitComment,this.clearComposer=this._clearComposer,this.on=this._on,this.getComposerData=this._getComposerData}_getAllCommentAnnotations(o,n){this.getService(A).log("%c[WB] Calling FUNCTION: getOnlineUsers","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_ALL_COMMENT_ANNOTATIONS_TRIGGERED,{payload:{documentId:o,location:n}}),this.getService(ae).getAllCommentAnnotations({customClientDocumentId:o,params:n,excludeDomChanges:!0,skipPositionCalculation:!0,addFilterCommentsOnDomCheck:!0}).pipe(Te(e=>e?.length?e?.map(t=>this.getService(ae).getCommentAnnotationForClient(t)):e))}catch(e){return this.getService(A).catch("Error in _getLiveCommentsOnCurrentDocument: ",e),Ee(null)}}_deleteSelectedComment(){this.getService(A).log("%c[WB] Calling FUNCTION: deleteSelectedComment","color: green;");try{return this.trackEvent(oe.Events.Comments.DELETE_SELECTED_COMMENT_TRIGGERED),this.getService(ae).deleteCommentPinAnnotations("commentElement")}catch(o){return this.getService(A).catch("Error in _deleteSelectedComment: ",o),Promise.resolve(null)}}_enableTextComments(){this.getService(A).log("%c[WB] Calling FUNCTION: enableTextComments","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_TEXT_COMMENTS_TRIGGERED),this.getService(ae).enableTextComments()}catch(o){this.getService(A).catch("Error in _enableTextComments: ",o)}}_disableTextComments(){this.getService(A).log("%c[WB] Calling FUNCTION: disableTextComments","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_TEXT_COMMENTS_TRIGGERED),this.getService(ae).disableTextComments()}catch(o){this.getService(A).catch("Error in _disableTextComments: ",o)}}_allowedElementIds(o){this.getService(A).log("%c[WB] Calling FUNCTION: allowedElementIds","color: green;");try{this.trackEvent(oe.Events.Comments.ALLOWED_ELEMENT_IDS_TRIGGERED,{payload:{elementIds:o}}),this.getService(ae).setAllowedElementIds(o)}catch(n){this.getService(A).catch("Error in allowedElementIds: ",n)}}_allowedElementClassNames(o){this.getService(A).log("%c[WB] Calling FUNCTION: allowedElementClassNames","color: green;");try{this.trackEvent(oe.Events.Comments.ALLOWED_ELEMENT_CLASS_NAMES_TRIGGERED,{payload:{classNames:o}}),this.getService(ae).setAllowedElementClassNames(o)}catch(n){this.getService(A).catch("Error in allowedElementClassNames: ",n)}}_allowedElementQuerySelectors(o){this.getService(A).log("%c[WB] Calling FUNCTION: allowedElementQuerySelectors","color: green;");try{this.trackEvent(oe.Events.Comments.ALLOWED_ELEMENT_QUERY_SELECTORS_TRIGGERED,{payload:{querySelectors:o}}),this.getService(ae).setAllowedElementQuerySelectors(o)}catch(n){this.getService(A).catch("Error in allowedElementQuerySelectors: ",n)}}_disableFloatingComments(){this.getService(A).log("%c[WB] Calling FUNCTION: disableFloatingComments","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_FLOATING_COMMENT_DIALOG_TRIGGERED),this.getService(ae).disableFloatingComments(!0)}catch(o){this.getService(A).catch("Error in _disableFloatingComments: ",o)}}_enableFloatingComments(){this.getService(A).log("%c[WB] Calling FUNCTION: enableFloatingComments","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_FLOATING_COMMENT_DIALOG_TRIGGERED),this.getService(ae).disableFloatingComments(!1)}catch(o){this.getService(A).catch("Error in _enableFloatingComments: ",o)}}_attachComment(o){this.getService(A).log("%c[WB] Calling FUNCTION: attachComment","color: green;");try{this.trackEvent(oe.Events.Comments.ATTACH_COMMENT_TRIGGERED,{payload:{elementId:o}}),this.getService(ae).attachComment(o,["id","data-id"])}catch(n){this.getService(A).catch("Error in _attachComment: ",n)}}_openCommentSidebar(){this.getService(A).log("%c[WB] Calling FUNCTION: openCommentSidebar","color: green;");try{this.trackEvent(oe.Events.Comments.OPEN_COMMENT_SIDEBAR_TRIGGERED),this.getService(ae).setSidebarVisibility(!0,!0)}catch(o){this.getService(A).catch("Error in _openCommentSidebar: ",o)}}_closeCommentSidebar(){this.getService(A).log("%c[WB] Calling FUNCTION: closeCommentSidebar","color: green;");try{this.trackEvent(oe.Events.Comments.CLOSE_COMMENT_SIDEBAR_TRIGGERED),this.getService(ae).setSidebarVisibility(!1,!0)}catch(o){this.getService(A).catch("Error in _closeCommentSidebar: ",o)}}_toggleCommentSidebar(){this.getService(A).log("%c[WB] Calling FUNCTION: toggleCommentSidebar","color: green;");try{this.trackEvent(oe.Events.Comments.TOGGLE_COMMENT_SIDEBAR_TRIGGERED),this.getService(ae).toggleSidebarVisibility(!0)}catch(o){this.getService(A).catch("Error in _toggleCommentSidebar: ",o)}}_enableModeratorMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enableModeratorMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_MODERATOR_MODE_TRIGGERED),this.getService(ae).setModeratorMode(!0)}catch(o){this.getService(A).catch("Error in _enableModeratorMode: ",o)}}_disableModeratorMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disableModeratorMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_MODERATOR_MODE_TRIGGERED),this.getService(ae).setModeratorMode(!1)}catch(o){this.getService(A).catch("Error in _disableModeratorMode: ",o)}}_enableStreamMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enableStreamMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_STREAM_MODE_TRIGGERED),this.getService(ae).setStreamMode(!0)}catch(o){this.getService(A).catch("Error in _enableStreamMode: ",o)}}_disableStreamMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disableStreamMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_STREAM_MODE_TRIGGERED),this.getService(ae).setStreamMode(!1)}catch(o){this.getService(A).catch("Error in _disableStreamMode: ",o)}}_enableSignInButton(){this.getService(A).log("%c[WB] Calling FUNCTION: enableSignInButton","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SIGN_IN_BUTTON_TRIGGERED),this.getService(ae).enableSignInButton(!0)}catch(o){this.getService(A).catch("Error in _enableSignInButton: ",o)}}_disableSignInButton(){this.getService(A).log("%c[WB] Calling FUNCTION: disableSignInButton","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SIGN_IN_BUTTON_TRIGGERED),this.getService(ae).enableSignInButton(!1)}catch(o){this.getService(A).catch("Error in _disableSignInButton: ",o)}}_enableUpgradeButton(){this.getService(A).log("%c[WB] Calling FUNCTION: enableUpgradeButton","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_UPGRADE_BUTTON_TRIGGERED),this.getService(ae).enableUpgradeButton(!0)}catch(o){this.getService(A).catch("Error in _enableUpgradeButton: ",o)}}_disableUpgradeButton(){this.getService(A).log("%c[WB] Calling FUNCTION: disableUpgradeButton","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_UPGRADE_BUTTON_TRIGGERED),this.getService(ae).enableUpgradeButton(!1)}catch(o){this.getService(A).catch("Error in _disableUpgradeButton: ",o)}}_onCommentModeChange(){this.getService(A).log("%c[WB] Calling FUNCTION: onCommentModeChange","color: green;");try{return this.trackEvent(oe.Events.Comments.ON_COMMENT_MODE_CHANGE_TRIGGERED),this.getService(ae).addCommentModeChange()}catch(o){return this.getService(A).catch("Error in _onCommentModeChange: ",o),Ee(!1)}}_enableAttachment(){this.getService(A).log("%c[WB] Calling FUNCTION: enableAttachment","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_ATTACHMENTS_TRIGGERED),this.getService(ae).enableAttachment(!0)}catch(o){this.getService(A).catch("Error in _enableAttachment: ",o)}}_disableAttachment(){this.getService(A).log("%c[WB] Calling FUNCTION: disableAttachment","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_ATTACHMENTS_TRIGGERED),this.getService(ae).enableAttachment(!1)}catch(o){this.getService(A).catch("Error in _disableAttachment: ",o)}}_enableAttachmentDownload(){this.getService(A).log("%c[WB] Calling FUNCTION: enableAttachmentDownload","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_ATTACHMENT_DOWNLOAD_TRIGGERED),this.getService(ae).enableAttachmentDownload()}catch(o){this.getService(A).catch("Error in _enableAttachmentDownload: ",o)}}_disableAttachmentDownload(){this.getService(A).log("%c[WB] Calling FUNCTION: disableAttachmentDownload","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_ATTACHMENT_DOWNLOAD_TRIGGERED),this.getService(ae).disableAttachmentDownload()}catch(o){this.getService(A).catch("Error in _disableAttachmentDownload: ",o)}}_isUserGlobalContact(){this.getService(A).log("%c[WB] Calling FUNCTION: isUserGlobalContact","color: green;");try{return this.trackEvent(oe.Events.Comments.IS_USER_GLOBAL_CONTACT_TRIGGERED),this.getService(ae).isUserGlobalContact$()}catch(o){return this.getService(A).catch("Error in _isUserGlobalContact: ",o),Ee(!1)}}_enableDeviceInfo(){this.getService(A).log("%c[WB] Calling FUNCTION: enableDeviceInfo","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_DEVICE_INFO_TRIGGERED),this.getService(ae).showScreenSizeInfo(!0)}catch(o){this.getService(A).catch("Error in _enableDeviceInfo: ",o)}}_disableDeviceInfo(){this.getService(A).log("%c[WB] Calling FUNCTION: disableDeviceInfo","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_DEVICE_INFO_TRIGGERED),this.getService(ae).showScreenSizeInfo(!1)}catch(o){this.getService(A).catch("Error in _disableDeviceInfo: ",o)}}_enableCommentMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enableCommentMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_COMMENT_MODE_TRIGGERED),this.getService(ae).enableAddCommentMode()}catch(o){this.getService(A).catch("Error in _enableCommentMode: ",o)}}_disableCommentMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disableCommentMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_COMMENT_MODE_TRIGGERED),this.getService(ae).disableAddCommentMode()}catch(o){this.getService(A).catch("Error in _disableCommentMode: ",o)}}_enablePersistentCommentMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enablePersistentCommentMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_PERSISTENT_COMMENT_MODE_TRIGGERED),this.getService(ae).enablePersistentCommentMode()}catch(o){this.getService(A).catch("Error in _enablePersistentCommentMode: ",o)}}_disablePersistentCommentMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disablePersistentCommentMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_PERSISTENT_COMMENT_MODE_TRIGGERED),this.getService(ae).disablePersistentCommentMode()}catch(o){this.getService(A).catch("Error in _disablePersistentCommentMode: ",o)}}_showCommentIndex(o){this.getService(A).log("%c[WB] Calling FUNCTION: showCommentIndex","color: green;");try{this.trackEvent(oe.Events.Comments.SHOW_COMMENT_INDEX_TRIGGERED,{payload:{show:o}}),this.getService(ae).showCommentIndex(o)}catch(n){this.getService(A).catch("Error in _showCommentIndex: ",n)}}_enableCommentIndex(){this.getService(A).log("%c[WB] Calling FUNCTION: enableCommentIndex","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_COMMENT_INDEX_TRIGGERED),this.getService(ae).showCommentIndex(!0)}catch(o){this.getService(A).catch("Error in _enableCommentIndex: ",o)}}_disableCommentIndex(){this.getService(A).log("%c[WB] Calling FUNCTION: disableCommentIndex","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_COMMENT_INDEX_TRIGGERED),this.getService(ae).showCommentIndex(!1)}catch(o){this.getService(A).catch("Error in _disableCommentIndex: ",o)}}_enablePopoverMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enablePopoverMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_POPOVER_MODE_TRIGGERED),this.getService(ae).enablePopoverMode()}catch(o){this.getService(A).catch("Error in _enablePopoverMode: ",o)}}_disablePopoverMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disablePopoverMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_POPOVER_MODE_TRIGGERED),this.getService(ae).disablePopoverMode()}catch(o){this.getService(A).catch("Error in _disablePopoverMode: ",o)}}_enableDialogOnHover(){this.getService(A).log("%c[WB] Calling FUNCTION: enableDialogOnHover","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_DIALOG_ON_HOVER_TRIGGERED),this.getService(ae).setEnableDialogOnHover(!0)}catch(o){this.getService(A).catch("Error in _enableDialogOnHover: ",o)}}_disableDialogOnHover(){this.getService(A).log("%c[WB] Calling FUNCTION: disableDialogOnHover","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_DIALOG_ON_HOVER_TRIGGERED),this.getService(ae).setEnableDialogOnHover(!1)}catch(o){this.getService(A).catch("Error in _disableDialogOnHover: ",o)}}_enablePopoverTriangleComponent(){this.getService(A).log("%c[WB] Calling FUNCTION: enablePopoverTriangleComponent","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_POPOVER_TRIANGLE_COMPONENT_TRIGGERED),this.getService(ae).enablePopoverTriangleComponent()}catch(o){this.getService(A).catch("Error in _enablePopoverTriangleComponent: ",o)}}_disablePopoverTriangleComponent(){this.getService(A).log("%c[WB] Calling FUNCTION: disablePopoverTriangleComponent","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_POPOVER_TRIANGLE_COMPONENT_TRIGGERED),this.getService(ae).disablePopoverTriangleComponent()}catch(o){this.getService(A).catch("Error in _disablePopoverTriangleComponent: ",o)}}_enableDialogOnTargetElementClick(){this.getService(A).log("%c[WB] Calling FUNCTION: enableDialogOnTargetElementClick","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_DIALOG_ON_TARGET_ELEMENT_CLICK_TRIGGERED),this.getService(ae).setEnableDialogOnTargetElementClick(!0)}catch(o){this.getService(A).catch("Error in _enableDialogOnTargetElementClick: ",o)}}_disableDialogOnTargetElementClick(){this.getService(A).log("%c[WB] Calling FUNCTION: disableDialogOnTargetElementClick","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_DIALOG_ON_TARGET_ELEMENT_CLICK_TRIGGERED),this.getService(ae).setEnableDialogOnTargetElementClick(!1)}catch(o){this.getService(A).catch("Error in _disableDialogOnTargetElementClick: ",o)}}_enablePriority(){this.getService(A).log("%c[WB] Calling FUNCTION: enablePriority","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_PRIORITY_TRIGGERED),this.getService(ae).setEnablePriority(!0)}catch(o){this.getService(A).catch("Error in _enablePriority: ",o)}}_disablePriority(){this.getService(A).log("%c[WB] Calling FUNCTION: disablePriority","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_PRIORITY_TRIGGERED),this.getService(ae).setEnablePriority(!1)}catch(o){this.getService(A).catch("Error in _disablePriority: ",o)}}_enableStatus(){this.getService(A).log("%c[WB] Calling FUNCTION: enableStatus","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_STATUS_TRIGGERED),this.getService(ae).setEnableStatus(!0)}catch(o){this.getService(A).catch("Error in _enableStatus: ",o)}}_disableStatus(){this.getService(A).log("%c[WB] Calling FUNCTION: disableStatus","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_STATUS_TRIGGERED),this.getService(ae).setEnableStatus(!1)}catch(o){this.getService(A).catch("Error in _disableStatus: ",o)}}_enableVisibilityOptions(){this.getService(A).log("%c[WB] Calling FUNCTION: enableVisibilityOptions","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_VISIBILITY_OPTIONS_TRIGGERED),this.getService(ae).setEnableVisibilityOptions(!0)}catch(o){this.getService(A).catch("Error in _enableVisibilityOptions: ",o)}}_disableVisibilityOptions(){this.getService(A).log("%c[WB] Calling FUNCTION: disableVisibilityOptions","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_VISIBILITY_OPTIONS_TRIGGERED),this.getService(ae).setEnableVisibilityOptions(!1)}catch(o){this.getService(A).catch("Error in _disableVisibilityOptions: ",o)}}_enableResolveButton(){this.getService(A).log("%c[WB] Calling FUNCTION: enableResolveButton","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_RESOLVE_BUTTON_TRIGGERED),this.getService(ae).setEnableResolve(!0)}catch(o){this.getService(A).catch("Error in _enableResolveButton: ",o)}}_disableResolveButton(){this.getService(A).log("%c[WB] Calling FUNCTION: disableResolveButton","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_RESOLVE_BUTTON_TRIGGERED),this.getService(ae).setEnableResolve(!1)}catch(o){this.getService(A).catch("Error in _disableResolveButton: ",o)}}_enableGhostComments(){this.getService(A).log("%c[WB] Calling FUNCTION: enableGhostComments","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_GHOST_COMMENTS_TRIGGERED),this.getService(ae).enableGhostComments()}catch(o){this.getService(A).catch("Error in _enableGhostCommentsInDOM: ",o)}}_disableGhostComments(){this.getService(A).log("%c[WB] Calling FUNCTION: disableGhostComments","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_GHOST_COMMENTS_TRIGGERED),this.getService(ae).disableGhostComments()}catch(o){this.getService(A).catch("Error in _disableGhostComments: ",o)}}_enableGhostCommentsIndicator(){this.getService(A).log("%c[WB] Calling FUNCTION: enableGhostCommentsIndicator","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_GHOST_COMMENTS_INDICATOR_TRIGGERED),this.getService(ae).enableGhostCommentsMessage()}catch(o){this.getService(A).catch("Error in _enableGhostCommentsIndicator: ",o)}}_disableGhostCommentsIndicator(){this.getService(A).log("%c[WB] Calling FUNCTION: disableGhostCommentsIndicator","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_GHOST_COMMENTS_INDICATOR_TRIGGERED),this.getService(ae).disableGhostCommentsMessage()}catch(o){this.getService(A).catch("Error in _disableGhostCommentsIndicator: ",o)}}_setCustomStatus(o){this.getService(A).log("%c[WB] Calling FUNCTION: setCustomStatus","color: green;");try{this.trackEvent(oe.Events.Comments.SET_CUSTOM_STATUS_TRIGGERED,{payload:{customStatuses:o}}),this.getService(ae).setCustomStatuses(o)}catch(n){this.getService(A).catch("Error in _setCustomStatus: ",n)}}_enableInboxMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enableInboxMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_INBOX_MODE_TRIGGERED),this.getService(ae).enableInboxMode()}catch(o){this.getService(A).catch("Error in _enableInboxMode: ",o)}}_setCustomPriority(o){this.getService(A).log("%c[WB] Calling FUNCTION: setCustomPriority","color: green;");try{this.trackEvent(oe.Events.Comments.SET_CUSTOM_PRIORITY_TRIGGERED,{payload:{customPriorities:o}}),this.getService(ae).setCustomPriorities(o)}catch(n){this.getService(A).catch("Error in _setCustomPriority: ",n)}}_setCustomCategory(o){this.getService(A).log("%c[WB] Calling FUNCTION: setCustomCategory","color: green;");try{this.trackEvent(oe.Events.Comments.SET_CUSTOM_CATEGORY_TRIGGERED,{payload:{customCategories:o}}),this.getService(ae).setCustomCategories(o)}catch(n){this.getService(A).catch("Error in _setCustomCategory: ",n)}}_disableInboxMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disableInboxMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_INBOX_MODE_TRIGGERED),this.getService(ae).disableInboxMode()}catch(o){this.getService(A).catch("Error in _disableInboxMode: ",o)}}_enableAutoCategorize(){this.getService(A).log("%c[WB] Calling FUNCTION: enableAutoCategorize","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_AUTO_CATEGORIZE_TRIGGERED),this.getService(ae).setEnableAutoCategorize(!0)}catch(o){this.getService(A).catch("Error in _enableAutoCategorize: ",o)}}_disableAutoCategorize(){this.getService(A).log("%c[WB] Calling FUNCTION: disableAutoCategorize","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_AUTO_CATEGORIZE_TRIGGERED),this.getService(ae).setEnableAutoCategorize(!1)}catch(o){this.getService(A).catch("Error in _disableAutoCategorize: ",o)}}_enableDarkMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_DARK_MODE_TRIGGERED),this.getService(ae).setCommentContainerDarkMode(!0)}catch(o){this.getService(A).catch("Error in _enableDarkMode: ",o)}}_disableDarkMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_DARK_MODE_TRIGGERED),this.getService(ae).setCommentContainerDarkMode(!1)}catch(o){this.getService(A).catch("Error in _disableDarkMode: ",o)}}_setContextProvider(o){try{this.trackEvent(oe.Events.Comments.SET_CONTEXT_PROVIDER_TRIGGERED,{payload:{}}),this.getService(ae).setContextProvider(o)}catch(n){this.getService(A).catch("Error in _setContextProvider: ",n)}}_enableSuggestionMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enableSuggestionMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SUGGESTION_MODE_TRIGGERED),this.getService(ae).setSuggestionMode(!0)}catch(o){this.getService(A).catch("Error in _enableSuggestionMode: ",o)}}_disableSuggestionMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disableSuggestionMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SUGGESTION_MODE_TRIGGERED),this.getService(ae).setSuggestionMode(!1)}catch(o){this.getService(A).catch("Error in _disableSuggestionMode: ",o)}}_enableMobileMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enableMobileMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_MOBILE_MODE_TRIGGERED),this.getService(ae).setMobileMode(!0)}catch(o){this.getService(A).catch("Error in _enableMobileMode: ",o)}}_disableMobileMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disableMobileMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_MOBILE_MODE_TRIGGERED),this.getService(ae).setMobileMode(!1)}catch(o){this.getService(A).catch("Error in _disableMobileMode: ",o)}}_enableInlineCommentMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enableInlineCommentMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_INLINE_COMMENT_MODE_TRIGGERED),this.getService(ae).enableInlineCommentMode()}catch(o){this.getService(A).catch("Error in _enableInlineCommentMode: ",o)}}_disableInlineCommentMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disableInlineCommentMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_INLINE_COMMENT_MODE_TRIGGERED),this.getService(ae).disableInlineCommentMode()}catch(o){this.getService(A).catch("Error in _disableInlineCommentMode: ",o)}}_enableMinimap(){this.getService(A).log("%c[WB] Calling FUNCTION: enableMinimap","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_MINIMAP_TRIGGERED),this.getService(ae).enableMinimap()}catch(o){this.getService(A).catch("Error in _enableMinimap: ",o)}}_disableMinimap(){this.getService(A).log("%c[WB] Calling FUNCTION: disableMinimap","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_MINIMAP_TRIGGERED),this.getService(ae).disableMinimap()}catch(o){this.getService(A).catch("Error in _disableMinimap: ",o)}}_showCommentsOnDom(){this.getService(A).log("%c[WB] Calling FUNCTION: showCommentsOnDom","color: green;");try{this.trackEvent(oe.Events.Comments.SHOW_COMMENTS_ON_DOM_TRIGGERED),this.getService(ae).showCommentsOnDom()}catch(o){this.getService(A).catch("Error in _showCommentsOnDom: ",o)}}_hideCommentsOnDom(){this.getService(A).log("%c[WB] Calling FUNCTION: hideCommentsOnDom","color: green;");try{this.trackEvent(oe.Events.Comments.HIDE_COMMENTS_ON_DOM_TRIGGERED),this.getService(ae).hideCommentsOnDom()}catch(o){this.getService(A).catch("Error in _hideCommentsOnDom: ",o)}}_enableCommentTool(){this.getService(A).log("%c[WB] Calling FUNCTION: enableCommentTool","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_COMMENT_TOOL_TRIGGERED),this.getService(ae).enableCommentTool()}catch(o){this.getService(A).catch("Error in _enableCommentTool: ",o)}}_disableCommentTool(){this.getService(A).log("%c[WB] Calling FUNCTION: disableCommentTool","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_COMMENT_TOOL_TRIGGERED),this.getService(ae).disableCommentTool()}catch(o){this.getService(A).catch("Error in _disableCommentTool: ",o)}}_setTotalMediaLength(o){this.getService(A).log("%c[WB] Calling FUNCTION: setTotalMediaLength","color: green;");try{this.trackEvent(oe.Events.Comments.SET_TOTAL_MEDIA_LENGTH_TRIGGERED,{payload:{length:o}}),this.getService(ae).setTotalMediaLength(o)}catch(n){this.getService(A).catch("Error in _setTotalMediaLength: ",n)}}_onCommentAdd(){this.getService(A).log("%c[WB] Calling FUNCTION: onCommentAdd","color: green;");try{return this.trackEvent(oe.Events.Comments.ON_COMMENT_ADD_TRIGGERED),this.getService(ae).onCommentAdd$()}catch(o){return this.getService(A).catch("Error in _onCommentAdd: ",o),Ee()}}_onCommentUpdate(){this.getService(A).log("%c[WB] Calling FUNCTION: onCommentUpdate","color: green;");try{return this.trackEvent(oe.Events.Comments.ON_COMMENT_UPDATE_TRIGGERED),this.getService(ae).onCommentUpdate$()}catch(o){return this.getService(A).catch("Error in _onCommentUpdate: ",o),Ee()}}_addCommentOnSelectedText(){this.getService(A).log("%c[WB] Calling FUNCTION: addCommentOnSelectedText","color: green;");try{this.trackEvent(oe.Events.Comments.ADD_COMMENT_ON_SELECTED_TEXT_TRIGGERED),this.getService(ae).addCommentOnSelectedText()}catch(o){this.getService(A).catch("Error in _addCommentOnSelectedText: ",o)}}_enableSidebarUrlNavigation(){this.getService(A).log("%c[WB] Calling FUNCTION: enableSidebarUrlNavigation","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SIDEBAR_URL_NAVIGATION_TRIGGERED),this.getService(ae).enableSidebarUrlNavigation()}catch(o){this.getService(A).catch("Error in _enableSidebarUrlNavigation: ",o)}}_disableSidebarUrlNavigation(){this.getService(A).log("%c[WB] Calling FUNCTION: disableSidebarUrlNavigation","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SIDEBAR_URL_NAVIGATION_TRIGGERED),this.getService(ae).disableSidebarUrlNavigation()}catch(o){this.getService(A).catch("Error in _disableSidebarUrlNavigation: ",o)}}_setDStrategy(o){this.getService(A).log("%c[WB] Calling FUNCTION: setDStrategy","color: green;");try{this.trackEvent(oe.Events.Comments.SET_D_STRATEGY_TRIGGERED,{payload:{strategy:o}}),this.getService(ae).setDetectionStrategy(o)}catch(n){this.getService(A).catch("Error in _setDStrategy: ",n)}}_enableSidebarButtonOnCommentDialog(){this.getService(A).log("%c[WB] Calling FUNCTION: enableSidebarButtonOnCommentDialog","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_TRIGGERED),this.getService(ae).enableSidebarButtonOnCommentDialog()}catch(o){this.getService(A).catch("Error in _enableSidebarButtonOnCommentDialog: ",o)}}_disableSidebarButtonOnCommentDialog(){this.getService(A).log("%c[WB] Calling FUNCTION: disableSidebarButtonOnCommentDialog","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_TRIGGERED),this.getService(ae).disableSidebarButtonOnCommentDialog()}catch(o){this.getService(A).catch("Error in _disableSidebarButtonOnCommentDialog: ",o)}}_onSidebarButtonOnCommentDialogClick(){this.getService(A).log("%c[WB] Calling FUNCTION: onSidebarButtonOnCommentDialogClick","color: green;");try{return this.trackEvent(oe.Events.Comments.ON_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_CLICK_TRIGGERED),this.getService(ae).getSidebarButtonOnCommentDialogClick$()}catch(o){return this.getService(A).catch("Error in _onSidebarButtonOnCommentDialogClick: ",o),Ee(null)}}_enableReactions(){this.getService(A).log("%c[WB] Calling FUNCTION: enableReactions","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_REACTIONS_TRIGGERED),this.getService(ae).enableReactions()}catch(o){this.getService(A).catch("Error in _enableReactions: ",o)}}_disableReactions(){this.getService(A).log("%c[WB] Calling FUNCTION: disableReactions","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_REACTIONS_TRIGGERED),this.getService(ae).disableReactions()}catch(o){this.getService(A).catch("Error in _disableReactions: ",o)}}_enableAnonymousEmail(){this.getService(A).log("%c[WB] Calling FUNCTION: enableAnonymousEmail","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_ANONYMOUS_EMAIL_TRIGGERED),this.getService(ae).enableAnonymousEmail()}catch(o){this.getService(A).catch("Error in _enableAnonymousEmail: ",o)}}_disableAnonymousEmail(){this.getService(A).log("%c[WB] Calling FUNCTION: disableAnonymousEmail","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_ANONYMOUS_EMAIL_TRIGGERED),this.getService(ae).disableAnonymousEmail()}catch(o){this.getService(A).catch("Error in _disableAnonymousEmail: ",o)}}_setRecordings(o){this.getService(A).log("%c[WB] Calling FUNCTION: setRecordings","color: green;");try{this.trackEvent(oe.Events.Comments.SET_RECORDINGS_TRIGGERED,{payload:{allowedRecordings:o}}),typeof o=="string"&&(o=o?.split(",")?.map(n=>n.trim())),this.getService(ae).setAllowedRecordings(o)}catch(n){this.getService(A).catch("Error in _setRecordings: ",n)}}_addCommentOnElement(o){this.getService(A).log("%c[WB] Calling FUNCTION: addCommentOnElement","color: green;");try{this.trackEvent(oe.Events.Comments.ADD_COMMENT_ON_ELEMENT_TRIGGERED,{payload:{data:o}}),this.getService(ae).addCommentOnElement(o)}catch(n){this.getService(A).catch("Error in _addCommentOnElement: ",n)}}_enablePrivateCommentMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enablePrivateCommentMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_PRIVATE_COMMENT_MODE_TRIGGERED),this.getService(ae).enablePrivateCommentMode()}catch(o){this.getService(A).catch("Error in _enablePrivateCommentMode: ",o)}}_disablePrivateCommentMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disablePrivateCommentMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_PRIVATE_COMMENT_MODE_TRIGGERED),this.getService(ae).disablePrivateCommentMode()}catch(o){this.getService(A).catch("Error in _disablePrivateCommentMode: ",o)}}_enablePrivateMode(o){this.getService(A).log("%c[WB] Calling FUNCTION: enablePrivateMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_PRIVATE_MODE_TRIGGERED,{payload:{config:o}}),this.getService(ae).enablePrivateMode(o)}catch(n){this.getService(A).catch("Error in _enablePrivateMode: ",n)}}_disablePrivateMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disablePrivateMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_PRIVATE_MODE_TRIGGERED),this.getService(ae).disablePrivateMode()}catch(o){this.getService(A).catch("Error in _disablePrivateMode: ",o)}}_enableScrollToComment(){this.getService(A).log("%c[WB] Calling FUNCTION: enableScrollToComment","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SCROLL_TO_COMMENT_TRIGGERED),this.getService(ae).enableScrollToComment()}catch(o){this.getService(A).catch("Error in _enableScrollToComment: ",o)}}_disableScrollToComment(){this.getService(A).log("%c[WB] Calling FUNCTION: disableScrollToComment","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SCROLL_TO_COMMENT_TRIGGERED),this.getService(ae).disableScrollToComment()}catch(o){this.getService(A).catch("Error in _disableScrollToComment: ",o)}}_enableUserMentions(){this.getService(A).log("%c[WB] Calling FUNCTION: enableUserMentions","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_USER_MENTIONS_TRIGGERED),this.getService(ae).enableUserMentions()}catch(o){this.getService(A).catch("Error in _enableUserMentions: ",o)}}_disableUserMentions(){this.getService(A).log("%c[WB] Calling FUNCTION: disableUserMentions","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_USER_MENTIONS_TRIGGERED),this.getService(ae).disableUserMentions()}catch(o){this.getService(A).catch("Error in _disableUserMentions: ",o)}}_setCommentSidebarFilters(o){this.getService(A).log("%c[WB] Calling FUNCTION: setCommentSidebarFilters","color: green;");try{this.trackEvent(oe.Events.Comments.SET_COMMENT_SIDEBAR_FILTERS_TRIGGERED,{payload:{filters:o}}),this.getService(ae).setCommentSidebarFilters(o)}catch(n){this.getService(A).catch("Error in _setCommentSidebarFilters: ",n)}}_setSystemFiltersOperator(o){this.getService(A).log("%c[WB] Calling FUNCTION: setSystemFiltersOperator","color: green;");try{this.trackEvent(oe.Events.Comments.SET_SYSTEM_FILTERS_OPERATOR_TRIGGERED,{payload:{operator:o}}),this.getService(ae).setCommentSidebarSystemFiltersOperator(o)}catch(n){this.getService(A).catch("Error in _setSystemFiltersOperator: ",n)}}_enableCommentPinHighlighter(){this.getService(A).log("%c[WB] Calling FUNCTION: enableCommentPinHighlighter","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_COMMENT_PIN_HIGHLIGHTER_TRIGGERED),this.getService(ae).enableCommentPinHighlighter()}catch(o){this.getService(A).catch("Error in _enableCommentPinHighlighter: ",o)}}_disableCommentPinHighlighter(){this.getService(A).log("%c[WB] Calling FUNCTION: disableCommentPinHighlighter","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_COMMENT_PIN_HIGHLIGHTER_TRIGGERED),this.getService(ae).disableCommentPinHighlighter()}catch(o){this.getService(A).catch("Error in _disableCommentPinHighlighter: ",o)}}_enableDeleteOnBackspace(){this.getService(A).log("%c[WB] Calling FUNCTION: enableDeleteOnBackspace","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_DELETE_ON_BACKSPACE_TRIGGERED),this.getService(ae).enableDeleteOnBackspace()}catch(o){this.getService(A).catch("Error in _enableDeleteOnBackspace: ",o)}}_disableDeleteOnBackspace(){this.getService(A).log("%c[WB] Calling FUNCTION: disableDeleteOnBackspace","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_DELETE_ON_BACKSPACE_TRIGGERED),this.getService(ae).disableDeleteOnBackspace()}catch(o){this.getService(A).catch("Error in _disableDeleteOnBackspace: ",o)}}_enableHotkey(){this.getService(A).log("%c[WB] Calling FUNCTION: enableHotkey","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_HOTKEY_TRIGGERED),this.getService(ae).enableHotkey()}catch(o){this.getService(A).catch("Error in _enableHotkey: ",o)}}_disableHotkey(){this.getService(A).log("%c[WB] Calling FUNCTION: disableHotkey","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_HOTKEY_TRIGGERED),this.getService(ae).disableHotkey()}catch(o){this.getService(A).catch("Error in _disableHotkey: ",o)}}_enableDeviceIndicatorOnCommentPins(){this.getService(A).log("%c[WB] Calling FUNCTION: enableDeviceIndicatorOnCommentPins","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_DEVICE_INDICATOR_ON_COMMENT_PINS_TRIGGERED),this.getService(ae).enableDeviceIndicatorOnCommentPins()}catch(o){this.getService(A).catch("Error in _enableDeviceIndicatorOnCommentPins: ",o)}}_disableDeviceIndicatorOnCommentPins(){this.getService(A).log("%c[WB] Calling FUNCTION: disableDeviceIndicatorOnCommentPins","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_DEVICE_INDICATOR_ON_COMMENT_PINS_TRIGGERED),this.getService(ae).disableDeviceIndicatorOnCommentPins()}catch(o){this.getService(A).catch("Error in _disableDeviceIndicatorOnCommentPins: ",o)}}_getElementRefByAnnotationId(o){this.getService(A).log("%c[WB] Calling FUNCTION: getElementRefByAnnotationId","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_ELEMENT_REF_BY_ANNOTATION_ID_TRIGGERED,{payload:{annotationId:o}}),this.getService(ae).getElementRefByAnnotationId(o)}catch(n){this.getService(A).catch("Error in _getElementRefByAnnotationId: ",n);return}}_scrollToCommentByAnnotationId(o){this.getService(A).log("%c[WB] Calling FUNCTION: scrollToCommentByAnnotationId","color: green;");try{this.trackEvent(oe.Events.Comments.SCROLL_TO_COMMENT_BY_ANNOTATION_ID_TRIGGERED,{payload:{annotationId:o}}),this.getService(ae).scrollToCommentByAnnotationId(o)}catch(n){this.getService(A).catch("Error in _scrollToCommentByAnnotationId: ",n)}}_selectCommentByAnnotationId(o){this.getService(A).log("%c[WB] Calling FUNCTION: selectCommentByAnnotationId","color: green;");try{this.trackEvent(oe.Events.Comments.SELECT_COMMENT_BY_ANNOTATION_ID_TRIGGERED,{payload:{annotationId:o}}),this.getService(ae).selectCommentByAnnotationId(o)}catch(n){this.getService(A).catch("Error in _selectCommentByAnnotationId: ",n)}}_enableRecordingSummary(){this.getService(A).log("%c[WB] Calling FUNCTION: enableRecordingSummary","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_RECORDING_SUMMARY_TRIGGERED),this.getService(ae).enableRecordingSummary()}catch(o){this.getService(A).catch("Error in _enableRecordingSummary: ",o)}}_disableRecordingSummary(){this.getService(A).log("%c[WB] Calling FUNCTION: disableRecordingSummary","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_RECORDING_SUMMARY_TRIGGERED),this.getService(ae).disableRecordingSummary()}catch(o){this.getService(A).catch("Error in _disableRecordingSummary: ",o)}}_enableRecordingTranscription(){this.getService(A).log("%c[WB] Calling FUNCTION: enableRecordingTranscription","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_RECORDING_TRANSCRIPTION_TRIGGERED),this.getService(ap).enableRecordingTranscription()}catch(o){this.getService(A).catch("Error in _enableRecordingTranscription: ",o)}}_disableRecordingTranscription(){this.getService(A).log("%c[WB] Calling FUNCTION: disableRecordingTranscription","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_RECORDING_TRANSCRIPTION_TRIGGERED),this.getService(ap).disableRecordingTranscription()}catch(o){this.getService(A).catch("Error in _disableRecordingTranscription: ",o)}}_enableRecordingCountdown(){this.getService(A).log("%c[WB] Calling FUNCTION: enableRecordingCountdown","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_RECORDING_COUNTDOWN_TRIGGERED),this.getService(ae).enableRecordingCountdown()}catch(o){this.getService(A).catch("Error in _enableRecordingCountdown: ",o)}}_disableRecordingCountdown(){this.getService(A).log("%c[WB] Calling FUNCTION: disableRecordingCountdown","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_RECORDING_COUNTDOWN_TRIGGERED),this.getService(ae).disableRecordingCountdown()}catch(o){this.getService(A).catch("Error in _disableRecordingCountdown: ",o)}}_setUnreadIndicatorMode(o){this.getService(A).log("%c[WB] Calling FUNCTION: setUnreadIndicatorMode","color: green;");try{this.trackEvent(oe.Events.Comments.SET_UNREAD_INDICATOR_MODE_TRIGGERED,{payload:{mode:o}}),this.getService(ae).setUnreadIndicatorMode(o)}catch(n){this.getService(A).catch("Error in _setUnreadIndicatorMode: ",n)}}_enableEnterKeyToSubmit(){this.getService(A).log("%c[WB] Calling FUNCTION: enableEnterKeyToSubmit","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_ENTER_KEY_TO_SUBMIT_TRIGGERED),this.getService(ae).enableEnterKeyToSubmit()}catch(o){this.getService(A).catch("Error in _enableEnterKeyToSubmit: ",o)}}_disableEnterKeyToSubmit(){this.getService(A).log("%c[WB] Calling FUNCTION: disableEnterKeyToSubmit","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_ENTER_KEY_TO_SUBMIT_TRIGGERED),this.getService(ae).disableEnterKeyToSubmit()}catch(o){this.getService(A).catch("Error in _disableEnterKeyToSubmit: ",o)}}_enablePinShadowDOM(){this.getService(A).log("%c[WB] Calling FUNCTION: enablePinShadowDOM","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_PIN_SHADOW_DOM_TRIGGERED),this.getService(ae).enablePinShadowDOM()}catch(o){this.getService(A).catch("Error in _enablePinShadowDOM: ",o)}}_disablePinShadowDOM(){this.getService(A).log("%c[WB] Calling FUNCTION: disablePinShadowDOM","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_PIN_SHADOW_DOM_TRIGGERED),this.getService(ae).disablePinShadowDOM()}catch(o){this.getService(A).catch("Error in _disablePinShadowDOM: ",o)}}_enableDialogShadowDOM(){this.getService(A).log("%c[WB] Calling FUNCTION: enableDialogShadowDOM","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_DIALOG_SHADOW_DOM_TRIGGERED),this.getService(ae).enableDialogShadowDOM()}catch(o){this.getService(A).catch("Error in _enableDialogShadowDOM: ",o)}}_disableDialogShadowDOM(){this.getService(A).log("%c[WB] Calling FUNCTION: disableDialogShadowDOM","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_DIALOG_SHADOW_DOM_TRIGGERED),this.getService(ae).disableDialogShadowDOM()}catch(o){this.getService(A).catch("Error in _disableDialogShadowDOM: ",o)}}_enableSidebarShadowDOM(){this.getService(A).log("%c[WB] Calling FUNCTION: enableSidebarShadowDOM","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SIDEBAR_SHADOW_DOM_TRIGGERED),this.getService(ae).enableSidebarShadowDOM()}catch(o){this.getService(A).catch("Error in _enableSidebarShadowDOM: ",o)}}_disableSidebarShadowDOM(){this.getService(A).log("%c[WB] Calling FUNCTION: disableSidebarShadowDOM","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SIDEBAR_SHADOW_DOM_TRIGGERED),this.getService(ae).disableSidebarShadowDOM()}catch(o){this.getService(A).catch("Error in _disableSidebarShadowDOM: ",o)}}_enableChangeDetectionInCommentMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enableChangeDetectionInCommentMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_CHANGE_DETECTION_IN_COMMENT_MODE_TRIGGERED),this.getService(ae).enableChangeDetectionInCommentMode()}catch(o){this.getService(A).catch("Error in _enableChangeDetectionInCommentMode: ",o)}}_disableChangeDetectionInCommentMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disableChangeDetectionInCommentMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_CHANGE_DETECTION_IN_COMMENT_MODE_TRIGGERED),this.getService(ae).disableChangeDetectionInCommentMode()}catch(o){this.getService(A).catch("Error in _disableChangeDetectionInCommentMode: ",o)}}_enableLazyLoadResolvedComments(){this.getService(A).log("%c[WB] Calling FUNCTION: enableLazyLoadResolvedComments","color: green;");try{this.getService(ae).enableLazyLoadResolvedComments()}catch(o){this.getService(A).catch("Error in _enableLazyLoadResolvedComments: ",o)}}_disableLazyLoadResolvedComments(){this.getService(A).log("%c[WB] Calling FUNCTION: disableLazyLoadResolvedComments","color: green;");try{this.getService(ae).disableLazyLoadResolvedComments()}catch(o){this.getService(A).catch("Error in _disableLazyLoadResolvedComments: ",o)}}_showResolvedCommentsOnDom(){this.getService(A).log("%c[WB] Calling FUNCTION: showResolvedCommentsOnDom","color: green;");try{this.trackEvent(oe.Events.Comments.SHOW_RESOLVED_COMMENTS_ON_DOM_TRIGGERED),this.getService(ae).showResolvedCommentsOnDom()}catch(o){this.getService(A).catch("Error in _showResolvedCommentsOnDom: ",o)}}_hideResolvedCommentsOnDom(){this.getService(A).log("%c[WB] Calling FUNCTION: hideResolvedCommentsOnDom","color: green;");try{this.trackEvent(oe.Events.Comments.HIDE_RESOLVED_COMMENTS_ON_DOM_TRIGGERED),this.getService(ae).hideResolvedCommentsOnDom()}catch(o){this.getService(A).catch("Error in _hideResolvedCommentsOnDom: ",o)}}_setCustomReactions(o){this.getService(A).log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;");try{this.trackEvent(oe.Events.Comments.SET_CUSTOM_REACTIONS_TRIGGERED,{payload:{reactions:o}}),this.getService(ae).setCustomReactions(o)}catch(n){this.getService(A).catch("Error in _setCustomReactions: ",n)}}_onCommentSelectionChange(){this.getService(A).log("%c[WB] Calling FUNCTION: onCommentSelectionChange","color: green;");try{return this.trackEvent(oe.Events.Comments.ON_COMMENT_SELECTION_CHANGE_TRIGGERED),this.getService(ae).onCommentSelectionChange$()}catch(o){return this.getService(A).catch("Error in _onCommentSelectionChange: ",o),Ee(null)}}_getUnreadCommentCountByAnnotationId(o){this.getService(A).log("%c[WB] Calling FUNCTION: getUnreadCommentCountByAnnotationId","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_UNREAD_COMMENT_COUNT_BY_ANNOTATION_ID_TRIGGERED,{payload:{commentAnnotationId:o}}),this.getService(ae).getUnreadCommentCountByAnnotationId$(o)}catch(n){return this.getService(A).catch("Error in _getUnreadCommentCountByAnnotationId: ",n),Ee(null)}}_getUnreadCommentAnnotationCountOnCurrentDocument(){this.getService(A).log("%c[WB] Calling FUNCTION: getUnreadCommentAnnotationCountOnCurrentDocument","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_UNREAD_COMMENT_ANNOTATION_COUNT_ON_CURRENT_DOCUMENT_TRIGGERED),this.getService(ae).getUnreadCommentAnnotationCountOnCurrentDocument$()}catch(o){return this.getService(A).catch("Error in _getUnreadCommentAnnotationCountOnCurrentDocument: ",o),Ee(null)}}_getUnreadCommentCountOnCurrentDocument(){this.getService(A).log("%c[WB] Calling FUNCTION: getUnreadCommentCountOnCurrentDocument","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_UNREAD_COMMENT_COUNT_ON_CURRENT_DOCUMENT_TRIGGERED),this.getService(ae).getUnreadCommentCountOnCurrentDocument$()}catch(o){return this.getService(A).catch("Error in _getUnreadCommentCountOnCurrentDocument: ",o),Ee(null)}}_getUnreadCommentAnnotationCountByLocationId(o){this.getService(A).log("%c[WB] Calling FUNCTION: getUnreadCommentAnnotationCountByLocationId","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_UNREAD_COMMENT_ANNOTATION_COUNT_BY_LOCATION_ID_TRIGGERED,{payload:{locationId:o}}),this.getService(ae).getUnreadCommentAnnotationCountByLocationId$(o)}catch(n){return this.getService(A).catch("Error in _getUnreadCommentAnnotationCountByLocationId: ",n),Ee(null)}}_getUnreadCommentCountByLocationId(o){this.getService(A).log("%c[WB] Calling FUNCTION: getUnreadCommentCountByLocationId","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_UNREAD_COMMENT_COUNT_BY_LOCATION_ID_TRIGGERED,{payload:{locationId:o}}),this.getService(ae).getUnreadCommentCountByLocationId$(o)}catch(n){return this.getService(A).catch("Error in _getUnreadCommentCountByLocationId: ",n),Ee(null)}}_updateCommentDialogPosition(){this.getService(A).log("%c[WB] Calling FUNCTION: updateCommentDialogPosition","color: green;");try{this.trackEvent(oe.Events.Comments.UPDATE_COMMENT_DIALOG_POSITION_TRIGGERED),this.getService(ae).updateCommentDialogPosition()}catch(o){this.getService(A).catch("Error in _updateCommentDialogPosition: ",o)}}_enableAreaComment(){this.getService(A).log("%c[WB] Calling FUNCTION: enableAreaComment","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_AREA_COMMENT_TRIGGERED),this.getService(ae).enableAreaComment()}catch(o){this.getService(A).catch("Error in _enableAreaComment: ",o)}}_disableAreaComment(){this.getService(A).log("%c[WB] Calling FUNCTION: disableAreaComment","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_AREA_COMMENT_TRIGGERED),this.getService(ae).disableAreaComment()}catch(o){this.getService(A).catch("Error in _disableAreaComment: ",o)}}_setPinCursorImage(o){this.getService(A).log("%c[WB] Calling FUNCTION: setPinCursorImage","color: green;");try{this.trackEvent(oe.Events.Comments.SET_PIN_CURSOR_IMAGE_TRIGGERED,{payload:{image:o}}),this.getService(ae).setPinCursorImage(o)}catch(n){this.getService(A).catch("Error in _setPinCursorImage: ",n)}}_addManualComment(o){this.getService(A).log("%c[WB] Calling FUNCTION: addManualComment","color: green;");try{return this.trackEvent(oe.Events.Comments.ADD_MANUAL_COMMENT_TRIGGERED,{payload:{config:o}}),this.getService(ae).addManualComment(o)}catch(n){return this.getService(A).catch("Error in _addManualComment: ",n),Promise.resolve()}}_createCustomListDataOnAnnotation(o){this.getService(A).log("%c[WB] Calling FUNCTION: createCustomListDataOnAnnotation","color: green;");try{this.trackEvent(oe.Events.Comments.CREATE_CUSTOM_LIST_DATA_ON_ANNOTATION_TRIGGERED,{payload:{data:o}}),this.getService(ae).createCustomListDataOnAnnotation(o)}catch(n){this.getService(A).catch("Error in _createCustomListDataOnAnnotation: ",n)}}_createCustomListDataOnComment(o){this.getService(A).log("%c[WB] Calling FUNCTION: createCustomListDataOnComment","color: green;");try{return this.trackEvent(oe.Events.Comments.CREATE_CUSTOM_LIST_DATA_ON_COMMENT_TRIGGERED,{payload:{data:o}}),this.getService(Vg).create(o)}catch(n){this.getService(A).catch("Error in _createCustomListDataOnComment: ",n)}}_excludeLocationIdsFromSidebar(o){this.getService(A).log("%c[WB] Calling FUNCTION: excludeLocationIdsFromSidebar","color: green;");try{this.trackEvent(oe.Events.Comments.EXCLUDE_LOCATION_IDS_FROM_SIDEBAR_TRIGGERED,{payload:{locationIds:o}}),this.getService(ae).setExcludeLocationIdsFromSidebar(o)}catch(n){this.getService(A).catch("Error in _excludeLocationIdsFromSidebar: ",n)}}_enableBubbleOnPin(){this.getService(A).log("%c[WB] Calling FUNCTION: enableBubbleOnPin","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_BUBBLE_ON_PIN_TRIGGERED),this.getService(ae).enableBubbleOnPin()}catch(o){this.getService(A).catch("Error in _enableBubbleOnPin: ",o)}}_disableBubbleOnPin(){this.getService(A).log("%c[WB] Calling FUNCTION: disableBubbleOnPin","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_BUBBLE_ON_PIN_TRIGGERED),this.getService(ae).disableBubbleOnPin()}catch(o){this.getService(A).catch("Error in _disableBubbleOnPin: ",o)}}_enableBubbleOnPinHover(){this.getService(A).log("%c[WB] Calling FUNCTION: enableBubbleOnPinHover","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_BUBBLE_ON_PIN_HOVER_TRIGGERED),this.getService(ae).enableBubbleOnPinHover()}catch(o){this.getService(A).catch("Error in _enableBubbleOnPinHover: ",o)}}_disableBubbleOnPinHover(){this.getService(A).log("%c[WB] Calling FUNCTION: disableBubbleOnPinHover","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_BUBBLE_ON_PIN_HOVER_TRIGGERED),this.getService(ae).disableBubbleOnPinHover()}catch(o){this.getService(A).catch("Error in _disableBubbleOnPinHover: ",o)}}_enablePinDrag(){this.getService(A).log("%c[WB] Calling FUNCTION: enablePinDrag","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_PIN_DRAG_TRIGGERED),this.getService(ae).enablePinDrag()}catch(o){this.getService(A).catch("Error in _enablePinDrag: ",o)}}_disablePinDrag(){this.getService(A).log("%c[WB] Calling FUNCTION: disablePinDrag","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_PIN_DRAG_TRIGGERED),this.getService(ae).disablePinDrag()}catch(o){this.getService(A).catch("Error in _disablePinDrag: ",o)}}_enableMultiThread(){this.getService(A).log("%c[WB] Calling FUNCTION: enableMultiThread","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_MULTI_THREAD_TRIGGERED),this.getService(ae).enableMultiThread()}catch(o){this.getService(A).catch("Error in _enableMultiThread: ",o)}}_disableMultiThread(){this.getService(A).log("%c[WB] Calling FUNCTION: disableMultiThread","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_MULTI_THREAD_TRIGGERED),this.getService(ae).disableMultiThread()}catch(o){this.getService(A).catch("Error in _disableMultiThread: ",o)}}_enableGroupMatchedComments(){this.getService(A).log("%c[WB] Calling FUNCTION: enableGroupMatchedComments","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_GROUP_MATCHED_COMMENTS_TRIGGERED),this.getService(ae).enableGroupMatchedComments()}catch(o){this.getService(A).catch("Error in _enableGroupMatchedComments: ",o)}}_disableGroupMatchedComments(){this.getService(A).log("%c[WB] Calling FUNCTION: disableGroupMatchedComments","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_GROUP_MATCHED_COMMENTS_TRIGGERED),this.getService(ae).disableGroupMatchedComments()}catch(o){this.getService(A).catch("Error in _disableGroupMatchedComments: ",o)}}_enableRestrictTextSearchToAnchor(){this.getService(A).log("%c[WB] Calling FUNCTION: enableRestrictTextSearchToAnchor","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_RESTRICT_TEXT_SEARCH_TO_ANCHOR_TRIGGERED),this.getService(ae).enableRestrictTextSearchToAnchor()}catch(o){this.getService(A).catch("Error in _enableRestrictTextSearchToAnchor: ",o)}}_disableRestrictTextSearchToAnchor(){this.getService(A).log("%c[WB] Calling FUNCTION: disableRestrictTextSearchToAnchor","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_RESTRICT_TEXT_SEARCH_TO_ANCHOR_TRIGGERED),this.getService(ae).disableRestrictTextSearchToAnchor()}catch(o){this.getService(A).catch("Error in _disableRestrictTextSearchToAnchor: ",o)}}_updateContext(o,n,e){this.getService(A).log("%c[WB] Calling FUNCTION: updateContext","color: green;");try{return this.trackEvent(oe.Events.Comments.UPDATE_CONTEXT_TRIGGERED,{payload:{annotationId:o,context:n,config:e}}),this.getService(ae).updateCommentAnnotationContext(o,n,e)}catch(t){return this.getService(A).catch("Error in _updateContext: ",t),Promise.resolve()}}_updateVisibility(o){this.getService(A).log("%c[WB] Calling FUNCTION: updateVisibility","color: green;");try{return this.trackEvent(oe.Events.Comments.UPDATE_VISIBILITY_TRIGGERED,{payload:{visibility:o}}),this.getService(at).updateVisibility(o)}catch(n){return this.getService(A).catch("Error in _updateVisibility: ",n),Promise.resolve()}}_getSelectedComments(){this.getService(A).log("%c[WB] Calling FUNCTION: getSelectedComments","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_SELECTED_COMMENTS_TRIGGERED),this.getService(Ne).getSelectedComments$()}catch(o){return this.getService(A).catch("Error in _getSelectedComments: ",o),Ee([])}}_enableDeleteReplyConfirmation(){this.getService(A).log("%c[WB] Calling FUNCTION: enableDeleteReplyConfirmation","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_DELETE_REPLY_CONFIRMATION_TRIGGERED),this.getService(ae).enableDeleteReplyConfirmation()}catch(o){this.getService(A).catch("Error in _enableDeleteReplyConfirmation: ",o)}}_disableDeleteReplyConfirmation(){this.getService(A).log("%c[WB] Calling FUNCTION: disableDeleteReplyConfirmation","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_DELETE_REPLY_CONFIRMATION_TRIGGERED),this.getService(ae).disableDeleteReplyConfirmation()}catch(o){this.getService(A).catch("Error in _disableDeleteReplyConfirmation: ",o)}}_onCopyLink(){this.getService(A).log("%c[WB] Calling FUNCTION: onCopyLink","color: green;");try{return this.trackEvent(oe.Events.Comments.ON_COPY_LINK_TRIGGERED),this.getService(ae).getCopyLink$()}catch(o){return this.getService(A).catch("Error in _onCopyLink: ",o),Ee("")}}_getCommentAnnotationById(o){this.getService(A).log("%c[WB] Calling FUNCTION: getCommentAnnotationById","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_COMMENT_ANNOTATION_BY_ID_TRIGGERED,{payload:{config:o}}),this.getService(ae).getCommentAnnotationById(o)}catch(n){return this.getService(A).catch("Error in _getCommentAnnotationById: ",n),Ee(null)}}_enableCollapsedComments(){this.getService(A).log("%c[WB] Calling FUNCTION: enableCollapsedComments","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_COLLAPSED_COMMENTS_TRIGGERED),this.getService(ae).enableCollapsedComments()}catch(o){this.getService(A).catch("Error in _enableCollapsedComments: ",o)}}_disableCollapsedComments(){this.getService(A).log("%c[WB] Calling FUNCTION: disableCollapsedComments","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_COLLAPSED_COMMENTS_TRIGGERED),this.getService(ae).disableCollapsedComments()}catch(o){this.getService(A).catch("Error in _disableCollapsedComments: ",o)}}_enableCollapsedRepliesPreview(){this.getService(A).log("%c[WB] Calling FUNCTION: enableCollapsedRepliesPreview","color: green;");try{this.getService(ae).enableCollapsedRepliesPreview()}catch(o){this.getService(A).catch("Error in _enableCollapsedRepliesPreview: ",o)}}_disableCollapsedRepliesPreview(){this.getService(A).log("%c[WB] Calling FUNCTION: disableCollapsedRepliesPreview","color: green;");try{this.getService(ae).disableCollapsedRepliesPreview()}catch(o){this.getService(A).catch("Error in _disableCollapsedRepliesPreview: ",o)}}_onCommentSidebarActionButtonClick(){this.getService(A).log("%c[WB] Calling FUNCTION: onCommentSidebarActionButtonClick","color: green;");try{return this.getService(ae).getSidebarCustomActionEventData()}catch(o){return this.getService(A).catch("Error in _onCommentSidebarActionButtonClick: ",o),Ee(null)}}_setCommentSidebarData(o,n){this.getService(A).log("%c[WB] Calling FUNCTION: setCommentSidebarData","color: green;");try{this.trackEvent(oe.Events.Comments.SET_COMMENT_SIDEBAR_DATA_TRIGGERED,{payload:{data:o,options:n}}),this.getService(ae).setCommentSidebarData(o,n)}catch(e){this.getService(A).catch("Error in _setCommentSidebarData: ",e)}}_onCommentSidebarInit(){this.getService(A).log("%c[WB] Calling FUNCTION: onCommentSidebarInit","color: green;");try{return this.trackEvent(oe.Events.Comments.ON_COMMENT_SIDEBAR_INIT_TRIGGERED),this.getService(ae).getSidebarCustomActionEventDataOnInit()}catch(o){return this.getService(A).catch("Error in _onCommentSidebarInit: ",o),Ee(null)}}_onCommentSidebarData(){this.getService(A).log("%c[WB] Calling FUNCTION: onCommentSidebarData","color: green;");try{return this.trackEvent(oe.Events.Comments.ON_COMMENT_SIDEBAR_DATA_TRIGGERED),this.getService(ae).getSidebarCustomActionEventDataAllChanges()}catch(o){return this.getService(A).catch("Error in _onCommentSidebarData: ",o),Ee(null)}}_setCommentSidebarDefaultCustomActions(o){this.getService(A).log("%c[WB] Calling FUNCTION: setCommentSidebarDefaultCustomActions","color: green;");try{this.trackEvent(oe.Events.Comments.SET_COMMENT_SIDEBAR_DEFAULT_CUSTOM_ACTIONS_TRIGGERED,{payload:{actions:o}}),this.getService(ae).setSidebarCustomActionEventData(o,[],{},[],{})}catch(n){this.getService(A).catch("Error in _setCommentSidebarDefaultCustomActions: ",n)}}_enableSidebarCustomActions(){this.getService(A).log("%c[WB] Calling FUNCTION: enableSidebarCustomActions","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SIDEBAR_CUSTOM_ACTIONS_TRIGGERED),this.getService(ae).enableSidebarCustomActions()}catch(o){this.getService(A).catch("Error in _enableSidebarCustomActions: ",o)}}_disableSidebarCustomActions(){this.getService(A).log("%c[WB] Calling FUNCTION: disableSidebarCustomActions","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SIDEBAR_CUSTOM_ACTIONS_TRIGGERED),this.getService(ae).disableSidebarCustomActions()}catch(o){this.getService(A).catch("Error in _disableSidebarCustomActions: ",o)}}_enableQueryParamsComments(){this.getService(A).log("%c[WB] Calling FUNCTION: enableQueryParamsComments","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_QUERY_PARAMS_COMMENTS_TRIGGERED),this.getService(ae).enableQueryParamsComments()}catch(o){this.getService(A).catch("Error in _enableQueryParamsComments: ",o)}}_disableQueryParamsComments(){this.getService(A).log("%c[WB] Calling FUNCTION: disableQueryParamsComments","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_QUERY_PARAMS_COMMENTS_TRIGGERED),this.getService(ae).disableQueryParamsComments()}catch(o){this.getService(A).catch("Error in _disableQueryParamsComments: ",o)}}_enableResolveStatusAccessAdminOnly(){this.getService(A).log("%c[WB] Calling FUNCTION: enableResolveStatusAccessAdminOnly","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_RESOLVE_STATUS_ACCESS_ADMIN_ONLY_TRIGGERED),this.getService(ae).enableResolveStatusAccessAdminOnly()}catch(o){this.getService(A).catch("Error in _enableResolveStatusAccessAdminOnly: ",o)}}_disableResolveStatusAccessAdminOnly(){this.getService(A).log("%c[WB] Calling FUNCTION: disableResolveStatusAccessAdminOnly","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_RESOLVE_STATUS_ACCESS_ADMIN_ONLY_TRIGGERED),this.getService(ae).disableResolveStatusAccessAdminOnly()}catch(o){this.getService(A).catch("Error in _disableResolveStatusAccessAdminOnly: ",o)}}_enableLinkCallback(){this.getService(A).log("%c[WB] Calling FUNCTION: enableLinkCallback","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_LINK_CALLBACK_TRIGGERED),this.getService(ae).enableLinkCallback()}catch(o){this.getService(A).catch("Error in _enableLinkCallback: ",o)}}_disableLinkCallback(){this.getService(A).log("%c[WB] Calling FUNCTION: disableLinkCallback","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_LINK_CALLBACK_TRIGGERED),this.getService(ae).disableLinkCallback()}catch(o){this.getService(A).catch("Error in _disableLinkCallback: ",o)}}_enableSeenByUsers(){this.getService(A).log("%c[WB] Calling FUNCTION: enableSeenByUsers","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SEEN_BY_USERS_TRIGGERED),this.getService(ae).enableSeenByUsers()}catch(o){this.getService(A).catch("Error in _enableSeenByUsers: ",o)}}_disableSeenByUsers(){this.getService(A).log("%c[WB] Calling FUNCTION: disableSeenByUsers","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SEEN_BY_USERS_TRIGGERED),this.getService(ae).disableSeenByUsers()}catch(o){this.getService(A).catch("Error in _disableSeenByUsers: ",o)}}_enableShortUserName(){this.getService(A).log("%c[WB] Calling FUNCTION: enableShortUserName","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SHORT_USER_NAME_TRIGGERED),this.getService(ae).enableShortUserName()}catch(o){this.getService(A).catch("Error in _enableShortUserName: ",o)}}_disableShortUserName(){this.getService(A).log("%c[WB] Calling FUNCTION: disableShortUserName","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SHORT_USER_NAME_TRIGGERED),this.getService(ae).disableShortUserName()}catch(o){this.getService(A).catch("Error in _disableShortUserName: ",o)}}_addCommentAnnotation(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: addCommentAnnotation","color: green;");try{return this.trackEvent(oe.Events.Comments.ADD_COMMENT_ANNOTATION_TRIGGERED,{payload:{addCommentAnnotationRequest:o}}),this.getService(at).convert(o).addCommentAnnotation(o,"external")}catch(n){return this.getService(A).catch("Error in _addCommentAnnotation: ",n),null}})}_approveCommentAnnotation(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: approveCommentAnnotation","color: green;");try{return this.trackEvent(oe.Events.Comments.APPROVE_COMMENT_ANNOTATION_TRIGGERED,{payload:{approveCommentAnnotationRequest:o}}),this.getService(at).convert(o).approveCommentAnnotation(o,"external")}catch(n){return this.getService(A).catch("Error in _approveCommentAnnotation: ",n),null}})}_acceptCommentAnnotation(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: acceptCommentAnnotation","color: green;");try{return this.trackEvent(oe.Events.Comments.ACCEPT_COMMENT_ANNOTATION_TRIGGERED,{payload:{acceptCommentAnnotationRequest:o}}),this.getService(at).convert(o).acceptCommentAnnotation(o,"external")}catch(n){return this.getService(A).catch("Error in _acceptCommentAnnotation: ",n),null}})}_acceptSuggestion(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: acceptSuggestion","color: green;");try{return this.trackEvent(oe.Events.Comments.ACCEPT_SUGGESTION_TRIGGERED,{payload:{acceptSuggestionRequest:o}}),this.getService(at).convert(o).acceptSuggestion(o,"external")}catch(n){return this.getService(A).catch("Error in _acceptSuggestion: ",n),null}})}_rejectSuggestion(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: rejectSuggestion","color: green;");try{return this.trackEvent(oe.Events.Comments.REJECT_SUGGESTION_TRIGGERED,{payload:{rejectSuggestionRequest:o}}),this.getService(at).convert(o).rejectSuggestion(o,"external")}catch(n){return this.getService(A).catch("Error in _rejectSuggestion: ",n),null}})}_rejectCommentAnnotation(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: rejectCommentAnnotation","color: green;");try{return this.trackEvent(oe.Events.Comments.REJECT_COMMENT_ANNOTATION_TRIGGERED,{payload:{rejectCommentAnnotationRequest:o}}),this.getService(at).convert(o).rejectCommentAnnotation(o,"external")}catch(n){return this.getService(A).catch("Error in _rejectCommentAnnotation: ",n),null}})}_subscribeCommentAnnotation(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: subscribeCommentAnnotation","color: green;");try{return this.trackEvent(oe.Events.Comments.SUBSCRIBE_COMMENT_ANNOTATION_TRIGGERED,{payload:{subscribeCommentAnnotationRequest:o}}),this.getService(at).convert(o).toggleNotificationSubscription(o,"subscribe")}catch(n){return this.getService(A).catch("Error in _subscribeCommentAnnotation: ",n),null}})}_unsubscribeCommentAnnotation(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: unsubscribeCommentAnnotation","color: green;");try{return this.trackEvent(oe.Events.Comments.UNSUBSCRIBE_COMMENT_ANNOTATION_TRIGGERED,{payload:{unsubscribeCommentAnnotationRequest:o}}),this.getService(at).convert(o).toggleNotificationSubscription(o,"unsubscribe")}catch(n){return this.getService(A).catch("Error in _unsubscribeCommentAnnotation: ",n),null}})}_deleteCommentAnnotation(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: deleteCommentAnnotation","color: green;");try{return this.trackEvent(oe.Events.Comments.DELETE_COMMENT_ANNOTATION_TRIGGERED,{payload:{deleteCommentAnnotationRequest:o}}),this.getService(at).convert(o).deleteCommentAnnotation(o,"external")}catch(n){return this.getService(A).catch("Error in _deleteCommentAnnotation: ",n),null}})}_getCommentAnnotations(o){this.getService(A).log("%c[WB] Calling FUNCTION: getCommentAnnotations","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_COMMENT_ANNOTATIONS_TRIGGERED,{payload:{query:o}}),this.getService(at).getCommentAnnotations(o).pipe(Te(n=>(n.data&&Object.keys(n.data).forEach(e=>{if(n.data?.[e]?.length){let t=n.data[e];n.data[e]=t?.map(a=>this.getService(ae).getCommentAnnotationForClient(a))}}),n)))}catch(n){return this.getService(A).catch("Error in _getCommentAnnotations: ",n),Ee({data:null})}}_getCommentAnnotationsCount(o){this.getService(A).log("%c[WB] Calling FUNCTION: getCommentAnnotationsCount","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_COMMENT_ANNOTATIONS_COUNT_TRIGGERED,{payload:{query:o}}),this.getService(at).getCommentAnnotationsCount$(o)}catch(n){return this.getService(A).catch("Error in _getCommentAnnotationsCount: ",n),Ee({data:null})}}_assignUser(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: assignUser","color: green;");try{return this.trackEvent(oe.Events.Comments.ASSIGN_USER_TRIGGERED,{payload:{assignUserRequest:o}}),this.getService(at).convert(o).assignUser(o,"external")}catch(n){return this.getService(A).catch("Error in _assignUser: ",n),null}})}_updatePriority(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: updatePriority","color: green;");try{return this.trackEvent(oe.Events.Comments.UPDATE_PRIORITY_TRIGGERED,{payload:{updatePriorityRequest:o}}),this.getService(at).convert(o).updatePriority(o,"external")}catch(n){return this.getService(A).catch("Error in _updatePriority: ",n),null}})}_updateStatus(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: updateStatus","color: green;");try{return this.trackEvent(oe.Events.Comments.UPDATE_STATUS_TRIGGERED,{payload:{updateStatusRequest:o}}),this.getService(at).convert(o).updateStatus(o,"external")}catch(n){return this.getService(A).catch("Error in _updateStatus: ",n),null}})}_updateAccess(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: updateAccess","color: green;");try{return this.trackEvent(oe.Events.Comments.UPDATE_ACCESS_TRIGGERED,{payload:{updateAccessRequest:o}}),this.getService(at).convert(o).updateAccess(o,"external")}catch(n){return this.getService(A).catch("Error in _updateAccess: ",n),null}})}_resolveCommentAnnotation(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: resolveCommentAnnotation","color: green;");try{return this.trackEvent(oe.Events.Comments.RESOLVE_COMMENT_ANNOTATION_TRIGGERED,{payload:{resolveCommentAnnotationRequest:o}}),this.getService(at).convert(o).resolveCommentAnnotation(o)}catch(n){return this.getService(A).catch("Error in _resolveCommentAnnotation: ",n),null}})}_getLink(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: getLink","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_LINK_TRIGGERED,{payload:{getLinkRequest:o}}),this.getService(at).convert(o).getLink(o,"external")}catch(n){return this.getService(A).catch("Error in _getLink: ",n),null}})}_copyLink(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: copyLink","color: green;");try{return this.trackEvent(oe.Events.Comments.COPY_LINK_TRIGGERED,{payload:{copyLinkRequest:o}}),this.getService(at).convert(o).copyLink(o,"external")}catch(n){return this.getService(A).catch("Error in _copyLink: ",n),null}})}_addComment(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: addComment","color: green;");try{return this.trackEvent(oe.Events.Comments.ADD_COMMENT_TRIGGERED,{payload:{addCommentRequest:o}}),this.getService(at).convert(o).addComment(o,"external")}catch(n){return this.getService(A).catch("Error in _addComment: ",n),null}})}_updateComment(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: updateComment","color: green;");try{return this.trackEvent(oe.Events.Comments.UPDATE_COMMENT_TRIGGERED,{payload:{updateCommentRequest:o}}),this.getService(at).convert(o).updateComment(o,"external")}catch(n){return this.getService(A).catch("Error in _updateComment: ",n),null}})}_deleteComment(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: deleteComment","color: green;");try{return this.trackEvent(oe.Events.Comments.DELETE_COMMENT_TRIGGERED,{payload:{deleteCommentRequest:o}}),this.getService(at).convert(o).deleteComment(o,"external")}catch(n){return this.getService(A).catch("Error in _deleteComment: ",n),null}})}_getComment(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: getComment","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_COMMENT_TRIGGERED,{payload:{getCommentRequest:o}}),this.getService(at).convert(o).getComment(o)}catch(n){return this.getService(A).catch("Error in _getComment: ",n),[]}})}_addAttachment(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: addAttachment","color: green;");try{return this.trackEvent(oe.Events.Comments.ADD_ATTACHMENT_TRIGGERED,{payload:{addAttachmentRequest:o}}),this.getService(at).convert(o).addAttachment(o)}catch(n){return this.getService(A).catch("Error in _addAttachment: ",n),Promise.resolve([])}})}_deleteAttachment(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: deleteAttachment","color: green;");try{return this.trackEvent(oe.Events.Comments.DELETE_ATTACHMENT_TRIGGERED,{payload:{deleteAttachmentRequest:o}}),this.getService(at).convert(o).deleteAttachment(o)}catch(n){return this.getService(A).catch("Error in _deleteAttachment: ",n),null}})}_getAttachment(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: getAttachment","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_ATTACHMENT_TRIGGERED,{payload:{getAttachmentRequest:o}}),this.getService(at).convert(o).getAttachment(o)}catch(n){return this.getService(A).catch("Error in _getAttachment: ",n),[]}})}_getRecording(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: getRecording","color: green;");try{return this.trackEvent(oe.Events.Comments.GET_RECORDING_TRIGGERED,{payload:{getRecordingRequest:o}}),this.getService(at).convert(o).getRecording(o)}catch(n){return this.getService(A).catch("Error in _getRecording: ",n),[]}})}_deleteRecording(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: deleteRecording","color: green;");try{return this.trackEvent(oe.Events.Comments.DELETE_RECORDING_TRIGGERED,{payload:{deleteRecordingRequest:o}}),this.getService(at).convert(o).deleteRecording(o)}catch(n){return this.getService(A).catch("Error in _deleteRecording: ",n),null}})}_fetchCommentAnnotations(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: fetchCommentAnnotations","color: green;");try{return this.trackEvent(oe.Events.Comments.FETCH_COMMENT_ANNOTATIONS_TRIGGERED,{payload:{fetchCommentAnnotationsRequest:o}}),this.getService(at).fetchCommentAnnotations(o)}catch(n){return this.getService(A).catch("Error in _fetchCommentAnnotations: ",n),{data:null}}})}_addReaction(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: addReaction","color: green;");try{return this.trackEvent(oe.Events.Comments.ADD_REACTION_TRIGGERED,{payload:{addReactionRequest:o}}),this.getService(at).convert(o).toggleReaction(o,"add")}catch(n){return this.getService(A).catch("Error in _addReaction: ",n),null}})}_deleteReaction(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: deleteReaction","color: green;");try{return this.trackEvent(oe.Events.Comments.DELETE_REACTION_TRIGGERED,{payload:{deleteReactionRequest:o}}),this.getService(at).convert(o).toggleReaction(o,"delete")}catch(n){return this.getService(A).catch("Error in _deleteReaction: ",n),null}})}_toggleReaction(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: toggleReaction","color: green;");try{return this.trackEvent(oe.Events.Comments.TOGGLE_REACTION_TRIGGERED,{payload:{toggleReactionRequest:o}}),this.getService(at).convert(o).toggleReaction(o)}catch(n){return this.getService(A).catch("Error in _toggleReaction: ",n),null}})}_on(o){this.getService(A).log("%c[WB] Calling FUNCTION: on","color: green;");try{return this.getService(at).onAction(o)}catch(n){return this.getService(A).catch("Error in _on: ",n),Ee(null)}}_enableReadOnly(){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: enableReadOnly","color: green;");try{return this.trackEvent(oe.Events.Comments.ENABLE_READ_ONLY_TRIGGERED),this.getService(ae).enableReadOnly()}catch(o){this.getService(A).catch("Error in _toggleReaction: ",o);return}})}_disableReadOnly(){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: disableReadOnly","color: green;");try{return this.trackEvent(oe.Events.Comments.DISABLE_READ_ONLY_TRIGGERED),this.getService(ae).disableReadOnly()}catch(o){this.getService(A).catch("Error in _disableReadOnly: ",o);return}})}_setAssignToType(o){this.getService(A).log("%c[WB] Calling FUNCTION: setAssignToType","color: green;");try{this.trackEvent(oe.Events.Comments.SET_ASSIGN_TO_TYPE_TRIGGERED,{payload:{type:o.type}}),this.getService(ae).setAssignToType(o)}catch(n){this.getService(A).catch("Error in _setAssignToType: ",n)}}_enableContextInPageModeComposer(){this.getService(A).log("%c[WB] Calling FUNCTION: enableContextInPageModeComposer","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED),this.getService(ae).enableContextInPageModeComposer()}catch(o){this.getService(A).catch("Error in _enableContextInPageModeComposer: ",o)}}_disableContextInPageModeComposer(){this.getService(A).log("%c[WB] Calling FUNCTION: disableContextInPageModeComposer","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED),this.getService(ae).disableContextInPageModeComposer()}catch(o){this.getService(A).catch("Error in _disableContextInPageModeComposer: ",o)}}_clearPageModeComposerContext(){this.getService(A).log("%c[WB] Calling FUNCTION: clearPageModeComposerContext","color: green;");try{this.trackEvent(oe.Events.Comments.CLEAR_PAGE_MODE_COMPOSER_CONTEXT_TRIGGERED),this.getService(ae).clearPageModeComposerContext()}catch(o){this.getService(A).catch("Error in _clearPageModeComposerContext: ",o)}}_setContextInPageModeComposer(o){this.getService(A).log("%c[WB] Calling FUNCTION: setContextInPageModeComposer","color: green;");try{this.trackEvent(oe.Events.Comments.SET_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED),this.getService(ae).setPageModeComposerContext(o)}catch(n){this.getService(A).catch("Error in _setContextInPageModeComposer: ",n)}}_focusPageModeComposer(){this.getService(A).log("%c[WB] Calling FUNCTION: focusPageModeComposer","color: green;");try{this.trackEvent(oe.Events.Comments.FOCUS_PAGE_MODE_COMPOSER_TRIGGERED),this.getService(ae).focusPageModeComposer()}catch(o){this.getService(A).catch("Error in _focusPageModeComposer: ",o)}}_enableCustomAutocompleteSearch(){this.getService(A).log("%c[WB] Calling FUNCTION: enableCustomAutocompleteSearch","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_CUSTOM_AUTOCOMPLETE_SEARCH_TRIGGERED),this.getService(ae).enableCustomAutocompleteSearch()}catch(o){this.getService(A).catch("Error in _enableCustomAutocompleteSearch: ",o);return}}_disableCustomAutocompleteSearch(){this.getService(A).log("%c[WB] Calling FUNCTION: disableCustomAutocompleteSearch","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_CUSTOM_AUTOCOMPLETE_SEARCH_TRIGGERED),this.getService(ae).disableCustomAutocompleteSearch()}catch(o){this.getService(A).catch("Error in _disableCustomAutocompleteSearch: ",o);return}}_setTransformContext(o){this.getService(A).log("%c[WB] Calling FUNCTION: setTransformContext","color: green;");try{this.trackEvent(oe.Events.Comments.SET_TRANSFORM_CONTEXT_TRIGGERED,{payload:{transformContext:o}}),this.getService(ae).setTransformContext(o)}catch(n){this.getService(A).catch("Error in _setTransformContext: ",n);return}}_enableSvgAsImg(){this.getService(A).log("%c[WB] Calling FUNCTION: enableSvgAsImg","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SVG_AS_IMG_TRIGGERED),this.getService(ae).enableSvgAsImg()}catch(o){this.getService(A).catch("Error in _enableSvgAsImg: ",o);return}}_disableSvgAsImg(){this.getService(A).log("%c[WB] Calling FUNCTION: disableSvgAsImg","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SVG_AS_IMG_TRIGGERED),this.getService(ae).disableSvgAsImg()}catch(o){this.getService(A).catch("Error in _disableSvgAsImg: ",o);return}}_enableFullExpanded(){this.getService(A).log("%c[WB] Calling FUNCTION: enableFullExpanded","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_FULL_EXPANDED_TRIGGERED),this.getService(ae).enableFullExpanded()}catch(o){this.getService(A).catch("Error in _enableFullExpanded: ",o);return}}_disableFullExpanded(){this.getService(A).log("%c[WB] Calling FUNCTION: disableFullExpanded","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_FULL_EXPANDED_TRIGGERED),this.getService(ae).disableFullExpanded()}catch(o){this.getService(A).catch("Error in _disableFullExpanded: ",o);return}}_enableCommentToNearestAllowedElement(){this.getService(A).log("%c[WB] Calling FUNCTION: enableCommentToNearestAllowedElement","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_COMMENT_TO_NEAREST_ALLOWED_ELEMENT_TRIGGERED),this.getService(ae).enableCommentToNearestAllowedElement()}catch(o){this.getService(A).catch("Error in _enableCommentToNearestAllowedElement: ",o);return}}_disableCommentToNearestAllowedElement(){this.getService(A).log("%c[WB] Calling FUNCTION: disableCommentToNearestAllowedElement","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_COMMENT_TO_NEAREST_ALLOWED_ELEMENT_TRIGGERED),this.getService(ae).disableCommentToNearestAllowedElement()}catch(o){this.getService(A).catch("Error in _disableCommentToNearestAllowedElement: ",o);return}}_enableDraftMode(){this.getService(A).log("%c[WB] Calling FUNCTION: enableDraftMode","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_DRAFT_MODE_TRIGGERED),this.getService(ae).enableDraftMode()}catch(o){this.getService(A).catch("Error in _enableDraftMode: ",o);return}}_disableDraftMode(){this.getService(A).log("%c[WB] Calling FUNCTION: disableDraftMode","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_DRAFT_MODE_TRIGGERED),this.getService(ae).disableDraftMode()}catch(o){this.getService(A).catch("Error in _disableDraftMode: ",o);return}}_enableDraftConfirmation(){this.getService(A).log("%c[WB] Calling FUNCTION: enableDraftConfirmation","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_DRAFT_CONFIRMATION_TRIGGERED),this.getService(ae).enableDraftConfirmation()}catch(o){this.getService(A).catch("Error in _enableDraftConfirmation: ",o);return}}_disableDraftConfirmation(){this.getService(A).log("%c[WB] Calling FUNCTION: disableDraftConfirmation","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_DRAFT_CONFIRMATION_TRIGGERED),this.getService(ae).disableDraftConfirmation()}catch(o){this.getService(A).catch("Error in _disableDraftConfirmation: ",o);return}}_enableFilterCommentsOnDom(){this.getService(A).log("%c[WB] Calling FUNCTION: enableFilterCommentsOnDom","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_FILTER_COMMENTS_ON_DOM_TRIGGERED),this.getService(ae).enableFilterCommentsOnDom()}catch(o){this.getService(A).catch("Error in _enableFilterCommentsOnDom: ",o);return}}_disableFilterCommentsOnDom(){this.getService(A).log("%c[WB] Calling FUNCTION: disableFilterCommentsOnDom","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_FILTER_COMMENTS_ON_DOM_TRIGGERED),this.getService(ae).disableFilterCommentsOnDom()}catch(o){this.getService(A).catch("Error in _disableFilterCommentsOnDom: ",o);return}}_enableReplyAvatars(){this.getService(A).log("%c[WB] Calling FUNCTION: enableReplyAvatars","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_REPLY_AVATARS_TRIGGERED),this.getService(ae).enableReplyAvatars()}catch(o){this.getService(A).catch("Error in _enableReplyAvatars: ",o);return}}_disableReplyAvatars(){this.getService(A).log("%c[WB] Calling FUNCTION: disableReplyAvatars","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_REPLY_AVATARS_TRIGGERED),this.getService(ae).disableReplyAvatars()}catch(o){this.getService(A).catch("Error in _disableReplyAvatars: ",o);return}}_setCommentProgressStaleAfter(o){this.getService(A).log("%c[WB] Calling FUNCTION: setCommentProgressStaleAfter","color: green;");try{this.getService(ae).setCommentProgressStaleAfter(o)}catch(n){this.getService(A).catch("Error in _setCommentProgressStaleAfter: ",n)}}_setMaxReplyAvatars(o){this.getService(A).log("%c[WB] Calling FUNCTION: setMaxReplyAvatars","color: green;");try{this.trackEvent(oe.Events.Comments.SET_MAX_REPLY_AVATARS_TRIGGERED,{payload:{maxReplyAvatars:o}}),this.getService(ae).setMaxReplyAvatars(o)}catch(n){this.getService(A).catch("Error in _setMaxReplyAvatars: ",n);return}}_setSidebarButtonCountType(o){this.getService(A).log("%c[WB] Calling FUNCTION: setSidebarButtonCountType","color: green;");try{this.trackEvent(oe.Events.Comments.SET_SIDEBAR_BUTTON_COUNT_TYPE_TRIGGERED,{payload:{type:o}}),this.getService(ae).setSidebarButtonCountType(o)}catch(n){this.getService(A).catch("Error in _setSidebarButtonCountType: ",n);return}}_enableFilterGhostCommentsInSidebar(){this.getService(A).log("%c[WB] Calling FUNCTION: enableFilterGhostCommentsInSidebar","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_FILTER_GHOST_COMMENTS_IN_SIDEBAR_TRIGGERED),this.getService(ae).enableFilterGhostCommentsInSidebar()}catch(o){this.getService(A).catch("Error in _enableFilterGhostCommentsInSidebar: ",o);return}}_disableFilterGhostCommentsInSidebar(){this.getService(A).log("%c[WB] Calling FUNCTION: disableFilterGhostCommentsInSidebar","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_FILTER_GHOST_COMMENTS_IN_SIDEBAR_TRIGGERED),this.getService(ae).disableFilterGhostCommentsInSidebar()}catch(o){this.getService(A).catch("Error in _disableFilterGhostCommentsInSidebar: ",o);return}}_enableFullScreenInSidebar(){this.getService(A).log("%c[WB] Calling FUNCTION: enableFullScreenInSidebar","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_FULL_SCREEN_IN_SIDEBAR_TRIGGERED),this.getService(ae).enableFullScreenInSidebar()}catch(o){this.getService(A).catch("Error in _enableFullScreenInSidebar: ",o);return}}_disableFullScreenInSidebar(){this.getService(A).log("%c[WB] Calling FUNCTION: disableFullScreenInSidebar","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_FULL_SCREEN_IN_SIDEBAR_TRIGGERED),this.getService(ae).disableFullScreenInSidebar()}catch(o){this.getService(A).catch("Error in _disableFullScreenInSidebar: ",o);return}}_setComposerFileAttachments(o){this.getService(A).log("%c[WB] Calling FUNCTION: setComposerFileAttachments","color: green;");try{this.getService(ae).setComposerFileAttachments(o),this.trackEvent(oe.Events.Comments.SET_COMPOSER_FILE_ATTACHMENTS_TRIGGERED,{payload:{data:o}})}catch(n){this.getService(A).catch("Error in _setComposerFileAttachments: ",n);return}}_setAllowedFileTypes(o){this.getService(A).log("%c[WB] Calling FUNCTION: setAllowedFileTypes","color: green;");try{this.trackEvent(oe.Events.Comments.COMMENT_ATTACHMENT_SET_ALLOWED_FILE_TYPES_TRIGGERED,{payload:{allowedFileTypes:o}}),this.getService(ae).setAllowedFileTypes(o)}catch(n){this.getService(A).catch("Error in _setAllowedFileTypes: ",n);return}}_enableForceCloseAllOnEsc(){this.getService(A).log("%c[WB] Calling FUNCTION: enableForceCloseAllOnEsc","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_FORCE_CLOSE_ALL_ON_ESC_TRIGGERED),this.getService(ae).enableForceCloseAllOnEsc()}catch(o){this.getService(A).catch("Error in _enableForceCloseAllOnEsc: ",o);return}}_disableForceCloseAllOnEsc(){this.getService(A).log("%c[WB] Calling FUNCTION: disableForceCloseAllOnEsc","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_FORCE_CLOSE_ALL_ON_ESC_TRIGGERED),this.getService(ae).disableForceCloseAllOnEsc()}catch(o){this.getService(A).catch("Error in _disableForceCloseAllOnEsc: ",o);return}}_markAsRead(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: markAsRead","color: green;");try{this.trackEvent(oe.Events.Comments.MARK_AS_READ_TRIGGERED,{payload:{annotationId:o}}),yield this.getService(ae).markAsRead(o);return}catch(n){this.getService(A).catch("Error in _markAsRead: ",n);return}})}_markAsUnread(o){return Ae(this,null,function*(){this.getService(A).log("%c[WB] Calling FUNCTION: markAsUnread","color: green;");try{this.trackEvent(oe.Events.Comments.MARK_AS_UNREAD_TRIGGERED,{payload:{annotationId:o}}),yield this.getService(ae).markAsUnread(o)}catch(n){this.getService(A).catch("Error in _markAsUnread: ",n);return}})}_enableScreenshot(){this.getService(A).log("%c[WB] Calling FUNCTION: enableScreenshot","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_SCREENSHOT_TRIGGERED),this.getService(ae).enableScreenshot()}catch(o){this.getService(A).catch("Error in _enableScreenshot: ",o);return}}_disableScreenshot(){this.getService(A).log("%c[WB] Calling FUNCTION: disableScreenshot","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_SCREENSHOT_TRIGGERED),this.getService(ae).disableScreenshot()}catch(o){this.getService(A).catch("Error in _disableScreenshot: ",o);return}}_enablePaginatedContactList(){this.getService(A).log("%c[WB] Calling FUNCTION: enablePaginatedContactList","color: green;");try{this.trackEvent(oe.Events.Comments.ENABLE_PAGINATED_CONTACT_LIST_TRIGGERED),this.getService(ae).enablePaginatedContactList()}catch(o){this.getService(A).catch("Error in _enablePaginatedContactList: ",o);return}}_disablePaginatedContactList(){this.getService(A).log("%c[WB] Calling FUNCTION: disablePaginatedContactList","color: green;");try{this.trackEvent(oe.Events.Comments.DISABLE_PAGINATED_CONTACT_LIST_TRIGGERED),this.getService(ae).disablePaginatedContactList()}catch(o){this.getService(A).catch("Error in _disablePaginatedContactList: ",o);return}}};function J2(r,o){r&1&&(de(),b(0,"svg",4),E(1,"rect",11),x())}function Y2(r,o){r&1&&(de(),b(0,"svg",4),E(1,"rect",12)(2,"path",13),x())}function K2(r,o){if(r&1){let n=Y();b(0,"div",10),z("click",function(t){return B(n),l(2).onCheckboxToggle(),V(t.stopPropagation())})("keydown.space",function(t){return B(n),l(2).onCheckboxToggle(),t.preventDefault(),V(t.stopPropagation())})("keydown.enter",function(t){return B(n),l(2).onCheckboxToggle(),t.preventDefault(),V(t.stopPropagation())}),y(1,J2,2,0,":svg:svg",4),y(2,Y2,3,0,":svg:svg",4),x()}if(r&2){let n=l(2);pe("velt-assign-dropdown--checkbox-icon-selected",n.isAssignedCheckbox),k("data-testid",n.componentId+"-checkbox-icon")("aria-checked",n.isAssignedCheckbox),d(),w(n.isAssignedCheckbox?-1:1),d(),w(n.isAssignedCheckbox?2:-1)}}function Z2(r,o){if(r&1&&(de(),b(0,"svg",4)(1,"g"),E(2,"path",14)(3,"path",15)(4,"path",16),x()()),r&2){let n=l(2);k("data-testid",n.componentId+"-icon")}}function X2(r,o){if(r&1){let n=Y();u(0,9),b(1,"div",17),z("click",function(){let t=B(n).$implicit,a=l(2);return V(a.assignContact(t))}),b(2,"div",18),E(3,"snippyly-user-avatar",19),b(4,"span",20),ie(5),F(6,"translate"),x()()(),p()}if(r&2){let n=o.$implicit,e=o.$index,t=l(2);d(),k("aria-selected",n.userId===(t.assignTo==null?null:t.assignTo.userId))("aria-label","Assign to "+((n==null?null:n.name)||(n==null?null:n.email)))("data-testid",t.componentId+"-option-"+e),d(),pe("s-dark",t.darkMode)("velt-assign-dropdown--item-dark",t.darkMode),d(),v("size",24)("user",n),k("data-testid",t.componentId+"-option-avatar-"+e),d(),k("data-testid",t.componentId+"-option-label-"+e),d(),Ge(R(6,12,(n==null?null:n.name)||(n==null?null:n.email)))}}function q2(r,o){if(r&1&&(b(0,"app-dropdown",1),u(1,2),y(2,K2,3,6,"div",3),y(3,Z2,5,1,":svg:svg",4),b(4,"div",5),ie(5),F(6,"translate"),x(),b(7,"div",6),ie(8),F(9,"translate"),x(),de(),b(10,"svg",7),E(11,"path",8),x(),p(),et(12,X2,7,14,"ng-container",9,Gr().trackByUserContact,!0),x()),r&2){let n=l();pe("velt-assign-dropdown--checkbox",n.assignToType==="checkbox"),v("darkMode",n.darkMode),k("data-testid",n.componentId)("data-velt-assign-to-type",n.assignToType),d(2),w(n.assignToType==="checkbox"?2:-1),d(),w(n.assignToType==="dropdown"?3:-1),d(),k("data-testid",n.componentId+"-label"),d(),Ge(R(6,13,"Assign to")),d(2),k("aria-labelledby","velt-assign-label")("data-testid",n.componentId+"-selected"),d(),fe(" ",R(9,15,(n.assignTo==null?null:n.assignTo.name)||(n.assignTo==null?null:n.assignTo.email))," "),d(2),k("data-testid",n.componentId+"-arrow"),d(2),tt(n.selectedUserContacts)}}var gp=(()=>{let o=class o extends At{constructor(e,t,a){super(t,a),this.loggingService=e,this.elementRef=t,this.themeService=a,this.assignToType="dropdown",this.isAssignedCheckbox=!1,this.setAssignTo=new Le,this.toggleCheckbox=new Le,this.componentId="velt-assign-dropdown"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in AssignDropdownComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in AssignDropdownComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{Q2(this.elementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in AssignDropdownComponent setupA11yAttributes:",e)}}trackByUserContact(e,t){try{return t?.userId||t?.email||e}catch(a){return this.loggingService.catch("Error in AssignDropdownComponent trackByUserContact:",a),e}}assignContact(e){try{this.setAssignTo.emit({assignTo:e})}catch(t){this.loggingService.catch("Error in AssignDropdownComponent assignContact err: ",t)}}onCheckboxToggle(){try{this.toggleCheckbox.emit()}catch(e){this.loggingService.catch("Error in AssignDropdownComponent onCheckboxToggle err: ",e)}}};o.\u0275fac=function(t){return new(t||o)(G(A),G(me),G(Et))},o.\u0275cmp=T({type:o,selectors:[["app-assign-dropdown"]],inputs:{assignTo:"assignTo",selectedUserContacts:"selectedUserContacts",assignToType:"assignToType",isAssignedCheckbox:"isAssignedCheckbox"},outputs:{setAssignTo:"setAssignTo",toggleCheckbox:"toggleCheckbox"},standalone:!1,features:[M],decls:1,vars:1,consts:[["dropdownClass","velt-assign-dropdown-container","dropdownType","assign",1,"velt-assign-dropdown","s-assign-to-container",3,"darkMode","velt-assign-dropdown--checkbox"],["dropdownClass","velt-assign-dropdown-container","dropdownType","assign",1,"velt-assign-dropdown","s-assign-to-container",3,"darkMode"],["trigger",""],["role","checkbox","tabindex","0",1,"velt-assign-dropdown--checkbox-icon",3,"velt-assign-dropdown--checkbox-icon-selected"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],[1,"velt-assign-dropdown--input-label","input__label"],[1,"velt-assign-dropdown--contact","s-assigned-contact"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false",1,"velt-assign-dropdown--arrow"],["fill-rule","evenodd","clip-rule","evenodd","d","M16.2071 9.79289C15.8166 9.40237 15.1834 9.40237 14.7929 9.79289L12 12.5858L9.20711 9.79289C8.81658 9.40237 8.18342 9.40237 7.79289 9.79289C7.40237 10.1834 7.40237 10.8166 7.79289 11.2071L11.2929 14.7071C11.6834 15.0976 12.3166 15.0976 12.7071 14.7071L16.2071 11.2071C16.5976 10.8166 16.5976 10.1834 16.2071 9.79289Z","fill","currentColor"],["content",""],["role","checkbox","tabindex","0",1,"velt-assign-dropdown--checkbox-icon",3,"click","keydown.space","keydown.enter"],["x","1","y","1","width","18","height","18","rx","3","stroke","currentColor","stroke-width","2","fill","none"],["x","1","y","1","width","18","height","18","rx","3","fill","currentColor"],["d","M5.5 10L8.5 13L14.5 7","stroke","white","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M13.3589 7.30469C11.3965 7.30469 9.65206 8.25585 8.56223 9.72128C8.12056 9.62865 7.66922 9.58074 7.21356 9.58074C3.6054 9.58074 0.669922 12.5162 0.669922 16.1244C0.669922 16.5957 1.05207 16.9779 1.52344 16.9779H8.67C9.76512 18.3633 11.4599 19.2539 13.3589 19.2539C16.6533 19.2539 19.3335 16.5737 19.3335 13.2793C19.3335 9.9849 16.6533 7.30469 13.3589 7.30469ZM2.45235 15.2709C2.85669 13.0097 4.83782 11.2878 7.21356 11.2878C7.38233 11.2878 7.55007 11.2972 7.71662 11.3143C7.50159 11.93 7.38426 12.5912 7.38426 13.2793C7.38426 13.9774 7.50501 14.6476 7.72601 15.2709H2.45235ZM13.3589 17.5469C11.0057 17.5469 9.0913 15.6325 9.0913 13.2793C9.0913 10.9262 11.0057 9.01172 13.3589 9.01172C15.712 9.01172 17.6265 10.9262 17.6265 13.2793C17.6265 15.6325 15.712 17.5469 13.3589 17.5469Z","fill","currentColor"],["d","M7.21319 7.87352C9.18202 7.87352 10.7837 6.27181 10.7837 4.30303C10.7837 2.33419 9.18202 0.732422 7.21319 0.732422C5.24435 0.732422 3.64258 2.33419 3.64258 4.30303C3.64258 6.27181 5.24435 7.87352 7.21319 7.87352ZM7.21319 2.43946C8.24076 2.43946 9.0767 3.27545 9.0767 4.30303C9.0767 5.33055 8.24076 6.16649 7.21319 6.16649C6.18561 6.16649 5.34961 5.33055 5.34961 4.30303C5.34961 3.27545 6.18561 2.43946 7.21319 2.43946Z","fill","currentColor"],["d","M15.0664 12.4258H14.2129V11.5723C14.2129 11.1009 13.8308 10.7188 13.3594 10.7188C12.888 10.7188 12.5059 11.1009 12.5059 11.5723V12.4258H11.6523C11.181 12.4258 10.7988 12.8079 10.7988 13.2793C10.7988 13.7507 11.181 14.1328 11.6523 14.1328H12.5059V14.9863C12.5059 15.4577 12.888 15.8399 13.3594 15.8399C13.8308 15.8399 14.2129 15.4577 14.2129 14.9863V14.1328H15.0664C15.5378 14.1328 15.9199 13.7507 15.9199 13.2793C15.9199 12.8079 15.5378 12.4258 15.0664 12.4258Z","fill","currentColor"],["mat-menu-item","","tabindex","0",3,"click"],[1,"velt-assign-dropdown--item","s-assign-to-menu-item"],["aria-hidden","true",3,"size","user"],[1,"velt-assign-dropdown--item-label","s-contact-label"]],template:function(t,a){t&1&&y(0,q2,14,17,"app-dropdown",0),t&2&&w(a.selectedUserContacts!=null&&a.selectedUserContacts.length?0:-1)},dependencies:[gb,Lt,xr,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{width:100%}.velt-assign-dropdown[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:unset;border-radius:var(--velt-border-radius-md);cursor:pointer;margin-bottom:var(--velt-spacing-sm);color:var(--velt-accent-text)} .velt-assign-dropdown>div{width:100%;display:flex;align-items:center;gap:var(--velt-spacing-sm);padding:var(--velt-spacing-md) var(--velt-spacing-lg);box-sizing:border-box}.velt-assign-dropdown[_ngcontent-%COMP%] .velt-assign-dropdown--contact[_ngcontent-%COMP%]{flex-grow:1;flex-basis:0%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.velt-assign-dropdown[_ngcontent-%COMP%] .velt-assign-dropdown--arrow[_ngcontent-%COMP%]{color:var(--velt-text-10)}.velt-assign-dropdown--item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm);justify-content:flex-start;color:var(--velt-light-mode-text-1);text-decoration:none;font-size:var(--velt-font-size-sm)}.velt-assign-dropdown--item.velt-assign-dropdown--item-dark[_ngcontent-%COMP%]{color:var(--velt-dark-mode-text-1)}.velt-assign-dropdown--item[_ngcontent-%COMP%] snippyly-user-avatar[_ngcontent-%COMP%]{display:flex}.velt-assign-dropdown--checkbox-icon[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let r=o;return r})();function Q2(r,o){try{r.setAttribute("role","combobox"),r.setAttribute("aria-label","Assign user dropdown"),r.setAttribute("data-testid",o+"-container")}catch{}}var rw=(r,o,n,e,t,a)=>({template:r,componentName:o,variant:n,suffix:e,setIfCondition:t,componentElementRef:a});function nw(r,o){r&1&&(u(0),de(),b(1,"svg",5),E(2,"path",6),x(),p())}var up=(()=>{let o=class o extends At{constructor(e,t,a,i){super(t,a,e),this.changeDetector=e,this.elementRef=t,this.themeService=a,this.loggingService=i,this.clicked=new Le,this.selectFiles=new Le,this.setIfConditionEvent=new Le,this.acceptAttribute=Me(""),this.componentId="velt-attachment-button"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in AttachmentButtonComponent ngOnInit:",e)}}ngOnChanges(e){try{if(super.ngOnChanges(e),e.allowedFileTypes&&e.allowedFileTypes.previousValue!==e.allowedFileTypes.currentValue){let t=this.getAcceptAttribute(e.allowedFileTypes.currentValue);this.acceptAttribute.set(t)}}catch(t){this.loggingService.catch("Error in AttachmentButtonComponent ngOnChanges:",t)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in AttachmentButtonComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{ow(this.elementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in AttachmentButtonComponent setupA11yAttributes:",e)}}setIfConditionEventCalled(e){try{this.setIfConditionEvent.emit(e)}catch(t){this.loggingService.catch("Error in AttachmentButtonComponent setIfConditionEventCalled:",t)}}getAcceptAttribute(e){try{return e?.length?e.map(a=>{let i=a.toLowerCase().replace(".","");switch(i){case"png":case"jpg":case"jpeg":case"gif":case"webp":case"svg":return`image/${i==="jpg"?"jpeg":i==="svg"?"svg+xml":i}`;case"pdf":return"application/pdf";case"mp4":case"webm":case"ogg":return`video/${i}`;case"csv":return"text/csv";case"json":return"application/json";case"xls":return"application/vnd.ms-excel";case"xlsx":return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";case"doc":return"application/msword";case"docx":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"ppt":return"application/vnd.ms-powerpoint";case"pptx":return"application/vnd.openxmlformats-officedocument.presentationml.presentation";case"txt":return"text/plain";default:return`.${i}`}}).join(", "):"image/png, image/gif, image/jpeg, image/svg+xml, image/webp, application/pdf, video/*, text/csv, application/json, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.presentationml.presentation, text/plain"}catch(t){return this.loggingService.catch("Error in AttachmentButtonComponent getAcceptAttribute:",t),""}}};o.\u0275fac=function(t){return new(t||o)(G(ar),G(me),G(Et),G(A))},o.\u0275cmp=T({type:o,selectors:[["app-attachment-button"]],inputs:{template:"template",componentMeta:"componentMeta",allowedFileTypes:"allowedFileTypes"},outputs:{clicked:"clicked",selectFiles:"selectFiles",setIfConditionEvent:"setIfConditionEvent"},standalone:!1,features:[M,nt],decls:8,vars:22,consts:[["fileInputRef",""],[3,"clicked","darkMode","title","ariaLabel"],["icon","","aria-hidden","true",1,"velt-attachment-button--icon"],[4,"veltDynamicTemplate"],["extra","","type","file","multiple","","tabindex","-1",1,"velt-attachment-button--input","file-upload-input",3,"change","accept"],["width","18","height","18","viewBox","0 0 18 18","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["fill-rule","evenodd","clip-rule","evenodd","d","M12.9295 0.71123C12.3395 0.803913 11.6796 1.06532 11.2298 1.3845C11.0263 1.52893 2.52007 9.03742 2.04935 9.48817C1.00899 10.4844 0.506081 11.9146 0.711064 13.2941C0.851555 14.2395 1.27958 15.0628 2.01012 15.7928C2.43833 16.2207 2.80773 16.4885 3.33384 16.7523C5.03396 17.6049 7.15751 17.5119 8.75811 16.5147C9.15263 16.2689 9.26532 16.175 10.8619 14.7616C11.6227 14.0881 12.6557 13.1735 13.1576 12.7292C13.6595 12.2849 14.625 11.4304 15.3033 10.8303C15.9816 10.2302 16.5717 9.68614 16.6147 9.62127C16.8654 9.24269 16.7159 8.68509 16.3068 8.47273C16.0924 8.36142 15.8057 8.3495 15.6017 8.44345C15.5271 8.47788 13.9216 9.87541 11.8443 11.7142C9.84941 13.48 8.11611 14.992 7.99257 15.0741C7.60179 15.3337 7.13724 15.5224 6.60924 15.6361C6.28899 15.7051 5.40697 15.7125 5.10817 15.6487C3.9235 15.396 3.0364 14.7672 2.58094 13.8576C2.37358 13.4435 2.30765 13.1555 2.30765 12.6644C2.30765 12.3244 2.32193 12.1911 2.3802 11.9873C2.52372 11.4852 2.79821 11.0383 3.20713 10.6411C3.3386 10.5133 4.48087 9.49485 5.74557 8.37774C8.22821 6.18475 9.71094 4.87325 11.2002 3.55303C12.0417 2.80708 12.1801 2.6972 12.4406 2.56811C12.9245 2.32836 13.39 2.24958 13.8905 2.32269C14.4532 2.40492 14.8442 2.59357 15.2108 2.95974C15.8379 3.58622 15.885 4.44576 15.3305 5.14671C15.1737 5.34504 8.02444 11.6759 7.78908 11.8249C7.28914 12.1415 6.84228 12.0807 6.57896 11.6603C6.3994 11.3736 6.44062 11.0391 6.68556 10.7956C6.75071 10.7309 7.74228 9.84838 8.88908 8.83454C10.0359 7.82073 11.2376 6.75804 11.5595 6.47305C12.2694 5.84466 12.3362 5.75879 12.3535 5.4526C12.3691 5.17745 12.3222 5.02657 12.1678 4.85547C11.9214 4.58228 11.5505 4.50031 11.2349 4.64926C11.1217 4.70264 10.2696 5.43521 8.44851 7.04449C7.00565 8.31957 5.69952 9.49029 5.54603 9.64602C5.23559 9.96099 5.06326 10.237 4.93561 10.6236C4.86603 10.8343 4.85277 10.9368 4.85062 11.2803C4.84782 11.727 4.90641 11.9879 5.09213 12.3556C5.34043 12.8471 5.83894 13.2975 6.36283 13.5037C7.23344 13.8464 8.26299 13.6025 9.1321 12.8477C9.24815 12.7469 10.1867 11.9185 11.2178 11.0069C12.2488 10.0953 13.7743 8.74778 14.6078 8.01238C15.4412 7.27701 16.2303 6.56564 16.3612 6.43156C16.7849 5.99759 17.0791 5.48562 17.2389 4.90396C17.358 4.47067 17.3644 3.79519 17.2538 3.35054C17.0553 2.55319 16.4914 1.77933 15.7647 1.30696C14.9688 0.789649 13.8829 0.561492 12.9295 0.71123Z","fill","currentColor"]],template:function(t,a){if(t&1){let i=Y();b(0,"app-action-button",1),F(1,"translate"),F(2,"translate"),z("clicked",function(){B(i);let m=we(6);return m==null||m.click(),V(a.clicked.emit())}),b(3,"div",2),s(4,nw,3,0,"ng-container",3),x(),b(5,"input",4,0),F(7,"translate"),z("change",function(m){return B(i),V(a.selectFiles.emit(m))}),x()()}t&2&&(v("darkMode",a.darkMode)("title",R(1,9,"Attach files"))("ariaLabel",R(2,11,"Attach files")),k("data-testid",a.componentId+"-trigger"),d(3),k("data-testid",a.componentId+"-icon"),d(),v("veltDynamicTemplate",yt(15,rw,a.template,a.componentMeta==null?null:a.componentMeta.componentName,a.componentMeta==null?null:a.componentMeta.variant,a.componentMeta==null?null:a.componentMeta.suffix,a.setIfConditionEventCalled.bind(a),a.elementRef)),d(),v("accept",a.acceptAttribute()),k("aria-label",R(7,13,"Attach files input"))("data-testid",a.componentId+"-input"))},dependencies:[N,zg,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}.velt-attachment-button--input[_ngcontent-%COMP%]{display:none}.velt-attachment-button--icon[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let r=o;return r})();function ow(r,o){try{r.setAttribute("role","presentation"),r.setAttribute("data-testid",o+"-container")}catch{}}function pp(){return{appState:{user:null,deviceInfo:null},featureState:{showCommentIndex:!1,bubbleOnPin:!1,bubbleOnPinHover:!1,popoverMode:!1,popoverTriangleComponent:!1,isDeviceIndicatorOnCommentPinsEnabled:!1,customStatusesShown:!1,pinShadowDOM:!1,pinDarkMode:null,pinDrag:!0}}}function hp(){return{data:{annotation:null,unreadCommentsMap:null,isGhostComment:!1,isPrivateComment:!1,isCommentAddedOnDifferentDeviceType:!1,commentBubbleElementAnnotationId:""},uiState:{commentPinSelected:!1,annotationDragging:!1,darkMode:!1,isOutsideViewport:!1,usingCustomCommentPin:!1}}}function Vf(){return{darkMode:!1,commentPinType:"pin",pinShadowDOM:!1}}var cu=(()=>{let o=class o{constructor(){this.authService=ge(ot),this.commentService=ge(ae),this.domService=ge(Ne),this.loggingService=ge(A),this.globalConfigSignal=Me(pp()),this.contextMap=new Map,this.currentUnreadCommentsMap=null,this.standaloneAnnotationSubscriptions=new Map,this.subscriptions=[],this.initialized=!1}initialize(){try{if(this.initialized)return;this.initialized=!0,this.subscriptions.push(this.authService.getUser$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{appState:f(g({},t.appState),{user:e??null})}))})),this.subscriptions.push(this.domService.getDeviceInfo$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{appState:f(g({},t.appState),{deviceInfo:e??null})}))})),this.subscriptions.push(this.commentService.getShowCommentIndex().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{showCommentIndex:e})}))})),this.subscriptions.push(this.commentService.getBubbleOnPin$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{bubbleOnPin:e})}))})),this.subscriptions.push(this.commentService.getPinDrag$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{pinDrag:e})}))})),this.subscriptions.push(this.commentService.getBubbleOnPinHover$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{bubbleOnPinHover:e})}))})),this.subscriptions.push(this.commentService.getPopoverMode$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{popoverMode:e})}))})),this.subscriptions.push(this.commentService.getPopoverTriangleComponent$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{popoverTriangleComponent:e})}))})),this.subscriptions.push(this.commentService.getDeviceIndicatorOnCommentPins$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{isDeviceIndicatorOnCommentPinsEnabled:e})}))})),this.subscriptions.push(this.commentService.getCustomStatusesShown$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{customStatusesShown:e})}))})),this.subscriptions.push(this.commentService.getPinShadowDOM$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{pinShadowDOM:e})}))})),this.subscriptions.push(this.commentService.getPinDarkMode$().subscribe(e=>{this.globalConfigSignal.update(t=>f(g({},t),{featureState:f(g({},t.featureState),{pinDarkMode:e})}))})),this.subscriptions.push(this.commentService.getUnreadCommentsMap$().subscribe(e=>{this.currentUnreadCommentsMap=e,this.contextMap.forEach((t,a)=>{try{t().data.unreadCommentsMap!==e&&t.update(c=>f(g({},c),{data:f(g({},c.data),{unreadCommentsMap:e})}))}catch(i){this.loggingService.catch("Error updating unreadCommentsMap for context "+a+":",i)}})})),this.subscriptions.push(this.commentService.getBubbleCommentAnnotationIds$().subscribe(e=>{this.contextMap.forEach((t,a)=>{try{let i=t(),c=i.data.annotation,m=c?.annotationId||"";if(m&&e?.includes(m)){let _=this.commentService.getCommentBubbleElement(c)?.getAttribute(X.ATTRIBUTES.VELT_ANNOTATION_ID)||"";i.data.commentBubbleElementAnnotationId!==_&&t.update(I=>f(g({},I),{data:f(g({},I.data),{commentBubbleElementAnnotationId:_})}))}else i.data.commentBubbleElementAnnotationId&&t.update(h=>f(g({},h),{data:f(g({},h.data),{commentBubbleElementAnnotationId:""})}))}catch(i){this.loggingService.catch("Error updating commentBubbleElementAnnotationId for context "+a+":",i)}})}))}catch(e){this.loggingService.catch("Error in CommentPinCoreService initialize:",e)}}getOrCreateContextConfig(e){try{let t=this.contextMap.get(e);if(!t){let a=hp();this.currentUnreadCommentsMap&&(a.data.unreadCommentsMap=this.currentUnreadCommentsMap),t=Me(a),this.contextMap.set(e,t)}return t}catch(t){return this.loggingService.catch("Error in CommentPinCoreService getOrCreateContextConfig:",t),Me(hp())}}getOrCreateContextConfigForAnnotation(e){try{let t=this.getOrCreateContextConfig(e);if(!this.standaloneAnnotationSubscriptions.has(e)){let a=this.commentService.getCommentAnnotationByAnnotationId(e).subscribe({next:i=>{try{if(!i)return;let c=f(g({},i),{annotationId:e});this.processAnnotationChange(e,c)}catch(c){this.loggingService.catch("Error in standalone pin annotation subscribe handler:",c)}},error:i=>{this.loggingService.catch("Error in standalone pin annotation subscription:",i)}});this.standaloneAnnotationSubscriptions.set(e,a)}return t}catch(t){return this.loggingService.catch("Error in CommentPinCoreService getOrCreateContextConfigForAnnotation:",t),this.getOrCreateContextConfig(e)}}getContextConfig(e){try{return this.contextMap.get(e)}catch(t){this.loggingService.catch("Error in CommentPinCoreService getContextConfig:",t);return}}processAnnotationChange(e,t){try{let a=this.contextMap.get(e);if(!a)return;let i=this.globalConfigSignal(),c=!!t?.ghostComment,m=pr(t),h=!!t?.pageInfo?.deviceInfo?.deviceType&&!!i.appState.deviceInfo?.deviceType&&t.pageInfo.deviceInfo.deviceType!==i.appState.deviceInfo.deviceType;a.update(_=>f(g({},_),{data:f(g({},_.data),{annotation:t,isGhostComment:c,isPrivateComment:m,isCommentAddedOnDifferentDeviceType:h})}))}catch(a){this.loggingService.catch("Error in CommentPinCoreService processAnnotationChange:",a)}}clearContext(e){try{this.contextMap.delete(e)}catch(t){this.loggingService.catch("Error in CommentPinCoreService clearContext:",t)}}destroy(){try{this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions=[],this.standaloneAnnotationSubscriptions.forEach(e=>e.unsubscribe()),this.standaloneAnnotationSubscriptions.clear(),this.contextMap.clear(),this.currentUnreadCommentsMap=null,this.globalConfigSignal.set(pp()),this.initialized=!1}catch(e){this.loggingService.catch("Error in CommentPinCoreService destroy:",e)}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var $f=(()=>{let o=class o{constructor(e,t){this.loggingService=e,this.coreService=t}onPointerUpOnDialog(e){try{return!this.coreService.getContextConfig(e)?.()?.uiState?.commentPinSelected}catch(t){return this.loggingService.catch("Error in CommentPinActionService onPointerUpOnDialog:",t),!1}}onPinBubblePointerUp(e,t){try{return!!(!this.coreService.getContextConfig(e)?.()?.uiState?.commentPinSelected||t)}catch(a){return this.loggingService.catch("Error in CommentPinActionService onPinBubblePointerUp:",a),!1}}updateOverlayPosition(e){try{e?.updateOverlayPosition()}catch(t){this.loggingService.catch("Error in CommentPinActionService updateOverlayPosition:",t)}}};o.\u0275fac=function(t){return new(t||o)(be(A),be(cu))},o.\u0275prov=rt({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var Fr=(()=>{let o=class o extends Kr{constructor(){super(...arguments),this.coreService=ge(cu),this.actionService=ge($f),this.annotationId=Q()}getDefaultLocalUIState(){return Vf()}getServiceComponentConfigSignal(){try{this.coreService.initialize();let e=this.annotationId();if(!e){let a=this.hostElementRef?.nativeElement?.getAttribute?.("annotation-id");a&&(e=a)}let t=e?.trim();return t?this.coreService.getOrCreateContextConfigForAnnotation(t):this.coreService.getOrCreateContextConfig("default")}catch{return}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["app-comment-pin-primitive-themed-base"]],inputs:{annotationId:[1,"annotationId"]},standalone:!1,features:[M],decls:0,vars:0,template:function(t,a){},encapsulation:2});let r=o;return r})();var jf=(r,o)=>{try{if(r.hasAttribute(o))return r;if(r.children.length===0)return;for(let n=0;n<r.children.length;n++){let e=r.children[n],t=jf(e,o);if(t!==void 0)return t}return}catch(n){Ju.catch("Error in utils findInjectionPointByAttribute: ",n)}},bp=(r,o,n)=>{try{let e=jf(r,o);if(e===void 0)return;let t=e.getAttribute(o);if(t===null)return;if(Object.values(X.INJECTION_ATTRIBUTES).includes(o)){if(n===null){e.removeAttribute(t);return}if(t===""){switch(e.tagName.toLowerCase()){case"img":e.src=n;break;case"p":case"a":case"b":case"strong":case"i":case"span":e.innerText=n;break}return}e[t]=n}if(n===null){e.style.removeProperty(t);return}e.style.setProperty(t,n,"important")}catch(e){Ju.catch("Error in utils injectAttributeData: ",e)}},fp=r=>{let o={};return r.from?.photoUrl?o[X.INJECTION_ATTRIBUTES.VELT_AVATAR_IMG]=r.from?.photoUrl:o[X.INJECTION_ATTRIBUTES.VELT_AVATAR_IMG]=null,r.priority?o[X.INJECTION_STYLE_PROPS.VELT_COMMENT_PRIORITY_COLOR]=r.priority.color:o[X.INJECTION_STYLE_PROPS.VELT_COMMENT_PRIORITY_COLOR]=null,r.from?.color?o[X.INJECTION_STYLE_PROPS.VELT_AVATAR_COLOR]=r.from?.color:o[X.INJECTION_STYLE_PROPS.VELT_AVATAR_COLOR]=null,o[X.INJECTION_ATTRIBUTES.VELT_COMMENT_LENGTH]=r.comments?.length||0,o};var Gf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),lw=(r,o)=>({condition:r,data:o}),dw=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-suggestion-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function vw(r,o){if(r&1&&(b(0,"div",2),F(1,"translate"),E(2,"velt-comment-dialog-suggestion-banner-internal",3)(3,"velt-comment-dialog-suggestion-header-internal",3)(4,"velt-comment-dialog-suggestion-body-internal",3)(5,"velt-comment-dialog-progress-internal",4)(6,"velt-comment-dialog-suggestion-footer-internal",3),x()),r&2){let n=l(4);pe("velt-suggestion--sidebar",n.localUIStateSignal().sidebarMode),k("data-testid",n.componentId)("aria-label",R(1,20,"Suggestion")),d(2),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),k("data-testid",n.componentId+"-banner"),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),k("data-testid",n.componentId+"-header"),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),k("data-testid",n.componentId+"-body"),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)("wireframe",n.wireframe),k("data-testid",n.componentId+"-progress"),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),k("data-testid",n.componentId+"-footer")}}function cw(r,o){if(r&1&&(u(0),s(1,vw,7,22,"div",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,dw,e.template,C(1,Gf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function mw(r,o){if(r&1&&s(0,cw,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,lw,n.conditionSignal(),C(1,Gf,n.componentConfigSignal,n.localUIStateSignal)))}}function sw(r,o){if(r&1&&y(0,mw,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var go=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-suggestion-internal",this.shouldShow=L(()=>{try{return Xc(this.defaultCondition(),this.componentConfigSignal())}catch(e){return this.loggingService.catch("Error in CommentDialogSuggestionComponent shouldShow:",e),!1}})}setupA11yAttributes(){try{gw(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogSuggestionComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-suggestion-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["class","velt-suggestion","role","region",3,"velt-suggestion--sidebar",4,"veltDynamicTemplate"],["role","region",1,"velt-suggestion"],[3,"componentConfigSignal","parentLocalUIState"],[3,"componentConfigSignal","parentLocalUIState","wireframe"]],template:function(t,a){if(t&1&&y(0,sw,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-suggestion[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-sm);color:var(--velt-text-2);max-height:var(--velt-suggestion-max-height, 320px)}.velt-suggestion[_ngcontent-%COMP%] > velt-comment-dialog-suggestion-header-internal[_ngcontent-%COMP%], .velt-suggestion[_ngcontent-%COMP%] > velt-comment-dialog-suggestion-footer-internal[_ngcontent-%COMP%]{flex:0 0 auto}.velt-suggestion[_ngcontent-%COMP%] > velt-comment-dialog-suggestion-body-internal[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto}.velt-suggestion__avatar[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 auto;border-radius:var(--velt-border-radius-sm);background:var(--velt-accent);color:var(--velt-accent-foreground);overflow:hidden}.velt-suggestion__avatar-img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.velt-suggestion__name[_ngcontent-%COMP%]{font-weight:600;color:var(--velt-text-0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.velt-suggestion__time[_ngcontent-%COMP%]{color:var(--velt-text-4);flex:0 0 auto}.velt-suggestion__menu[_ngcontent-%COMP%]{flex:0 0 auto;display:inline-flex}.velt-suggestion__menu-dots[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:var(--velt-border-radius-sm);color:var(--velt-text-4);cursor:pointer}.velt-suggestion__menu-dots[_ngcontent-%COMP%]:hover{background:var(--velt-background-2);color:var(--velt-text-2)}.velt-suggestion__menu-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:180px;padding:var(--velt-spacing-xs);background:var(--velt-background-0);border:1px solid var(--velt-border-4);border-radius:var(--velt-border-radius-md);box-shadow:0 8px 16px -8px #0f0f0f1a}.velt-suggestion__menu-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm);padding:var(--velt-spacing-sm);border-radius:var(--velt-border-radius-sm);color:var(--velt-text-2);cursor:pointer}.velt-suggestion__menu-item[_ngcontent-%COMP%]:hover{background:var(--velt-background-2)}.velt-suggestion__menu-item[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--velt-accent);outline-offset:-2px}.velt-suggestion__menu-item--danger[_ngcontent-%COMP%]{color:var(--velt-error)}.velt-suggestion__menu-label[_ngcontent-%COMP%]{font-weight:500}.velt-suggestion__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:var(--velt-spacing-sm);margin-top:var(--velt-spacing-xs)}.velt-suggestion__open-comment[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--velt-spacing-xs);margin-right:auto;padding:0;background:transparent;border:none;cursor:pointer;color:var(--velt-text-4);font:inherit;font-weight:500}.velt-suggestion__open-comment[_ngcontent-%COMP%]:hover{text-decoration:underline;color:var(--velt-text-2)}.velt-suggestion__open-comment[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--velt-accent);outline-offset:2px;border-radius:var(--velt-border-radius-sm)}"],changeDetection:0});let r=o;return r})();function Xc(r,o){try{if(!r)return!0;let n=o?.data?.annotation;return n?.type==="suggestion"||n?.commentType==="suggestion"}catch{return!1}}function mu(r){try{return r?.data?.annotation?.sourceType==="agent"}catch{return!1}}function gw(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region"),r.setAttribute("aria-label","Suggestion")}catch{}}var zf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),pw=(r,o)=>({condition:r,data:o}),hw=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-all-comment-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function bw(r,o){if(r&1&&(b(0,"div",3),F(1,"translate"),de(),b(2,"svg",4),E(3,"path",5)(4,"path",6),x(),xt(),b(5,"div",7),ie(6),F(7,"translate"),x()()),r&2){let n=l(4);k("aria-label",R(1,7,"View all comments"))("aria-haspopup",!0)("aria-expanded",!1)("data-testid",n.componentId+"-button"),d(2),k("data-testid",n.componentId+"-icon"),d(3),k("data-testid",n.componentId+"-label"),d(),fe(" ",R(7,9,"All comments"))}}function fw(r,o){if(r&1){let n=Y();u(0),b(1,"div",1),z("click",function(t){return B(n),l(3).onAllCommentClick(),V(t.stopPropagation())}),s(2,bw,8,11,"div",2),x(),p()}if(r&2){let n=l(2),e=l();d(),k("data-testid",e.componentId),d(),v("veltDynamicTemplate",O(5,hw,e.template,C(2,zf,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function Cw(r,o){if(r&1&&s(0,fw,3,11,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,pw,n.conditionSignal(),C(1,zf,n.componentConfigSignal,n.localUIStateSignal)))}}function kw(r,o){if(r&1&&y(0,Cw,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Ao=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-all-comment-internal",this.isDialogSelected=L(()=>_w(this.localUIStateSignal())),this.shouldShow=L(()=>Sw(this.defaultCondition(),this.isDialogSelected(),this.componentConfigSignal()))}setupA11yAttributes(){try{xw(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAllCommentComponent setupA11yAttributes:",e)}}onAllCommentClick(){try{let e=this.getAnnotationId();if(!e)return;this.actionService.openAllComments(e)}catch(e){this.loggingService.catch("Error in onAllCommentClick:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-all-comment-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[3,"click"],["class","velt-all-comment","role","button","tabindex","0",4,"veltDynamicTemplate"],["role","button","tabindex","0",1,"velt-all-comment"],["width","18","height","18","viewBox","0 0 18 18","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["fill-rule","evenodd","clip-rule","evenodd","d","M4.83268 12.2505V14.8286L9.05119 12.3358L9.49212 12.3286C11.2454 12.2999 12.8232 12.1234 14.003 11.9439C14.7476 11.8306 15.2649 11.3109 15.3773 10.6585C15.5332 9.75341 15.666 8.60678 15.666 7.33268C15.666 6.05858 15.5332 4.91195 15.3773 4.0069C15.2649 3.35442 14.7476 2.83478 14.003 2.72149C12.7126 2.52515 10.948 2.33268 8.99935 2.33268C7.05074 2.33268 5.28608 2.52515 3.9957 2.72149C3.25113 2.83478 2.73377 3.35442 2.62138 4.00691C2.46548 4.91195 2.33268 6.05858 2.33268 7.33268C2.33268 8.60678 2.46548 9.75341 2.62138 10.6585C2.71897 11.2251 3.1148 11.6792 3.69192 11.8711L4.83268 12.2505ZM0.978897 3.72399C1.22072 2.32008 2.33662 1.28808 3.74499 1.07379C5.09444 0.86846 6.94567 0.666016 8.99935 0.666016C11.053 0.666016 12.9043 0.86846 14.2537 1.07379C15.6621 1.28808 16.778 2.32008 17.0198 3.72399C17.1883 4.70245 17.3327 5.94539 17.3327 7.33268C17.3327 8.71997 17.1883 9.96292 17.0198 10.9414C16.778 12.3453 15.6621 13.3773 14.2537 13.5916C13.0192 13.7794 11.3647 13.9648 9.51941 13.9951L4.42329 17.0064C3.86778 17.3347 3.16602 16.9342 3.16602 16.289V13.4526C2.03815 13.0776 1.18648 12.1465 0.978897 10.9414C0.810359 9.96292 0.666016 8.71997 0.666016 7.33268C0.666016 5.94539 0.810359 4.70245 0.978897 3.72399Z","fill","currentColor"],["fill-rule","evenodd","clip-rule","evenodd","d","M4.83268 4.83268C4.37244 4.83268 3.99935 5.20578 3.99935 5.66602C3.99935 6.12625 4.37244 6.49935 4.83268 6.49935H13.166C13.6263 6.49935 13.9993 6.12625 13.9993 5.66602C13.9993 5.20578 13.6263 4.83268 13.166 4.83268H4.83268ZM4.83268 8.16602C4.37244 8.16602 3.99935 8.53911 3.99935 8.99935C3.99935 9.45959 4.37245 9.83268 4.83268 9.83268H8.16602C8.62625 9.83268 8.99935 9.45959 8.99935 8.99935C8.99935 8.53911 8.62625 8.16602 8.16602 8.16602H4.83268Z","fill","currentColor"],[1,"velt-all-comment--button"]],template:function(t,a){if(t&1&&y(0,kw,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-all-comment[_ngcontent-%COMP%]{gap:var(--velt-spacing-xs);display:flex;flex-direction:row;align-items:center;justify-content:center}.velt-all-comment[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{color:var(--velt-accent-text)}.velt-all-comment--button[_ngcontent-%COMP%]{position:relative;line-height:1.25em;font-weight:600;display:inline-block;cursor:pointer}"],changeDetection:0});let r=o;return r})();function xw(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}function _w(r){try{let n=r?.commentDialogSelected??!1,e=r?.sidebarMode,t=r?.expandOnSelection!==!1;return e&&!t?!1:n}catch{return!1}}function Sw(r,o,n){try{return r?o&&!!n?.data?.annotation?.comments?.length&&!!n?.featureState?.dialogMode&&!!n?.uiState?.sidebarButtonOnCommentDialogVisible:!0}catch{return!1}}var Hf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),ww=(r,o)=>({condition:r,data:o}),Iw=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-approve-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Dw(r,o){if(r&1&&(u(0),E(1,"div",3),b(2,"div",4),ie(3),F(4,"translate"),x(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-fill"),d(),k("data-testid",n.componentId+"-label"),d(),fe(" ",R(4,3,"Approve"))}}function Tw(r,o){if(r&1){let n=Y();u(0),b(1,"div",1),F(2,"translate"),z("click",function(t){return B(n),l(3).onApproveClick(),V(t.stopPropagation())}),s(3,Dw,5,5,"ng-container",2),x(),p()}if(r&2){let n=l(2),e=l();d(),k("aria-label",R(2,4,"Approve comment"))("aria-pressed",!1)("data-testid",e.componentId+"-button"),d(2),v("veltDynamicTemplate",O(9,Iw,e.template,C(6,Hf,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function Ow(r,o){if(r&1&&s(0,Tw,4,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,ww,n.conditionSignal(),C(1,Hf,n.componentConfigSignal,n.localUIStateSignal)))}}function Ew(r,o){if(r&1&&y(0,Ow,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Po=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-approve-internal",this.isDialogSelected=L(()=>Aw(this.localUIStateSignal())),this.shouldShow=L(()=>Pw(this.defaultCondition(),this.isDialogSelected(),this.componentConfigSignal()))}setupA11yAttributes(){try{Mw(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogApproveComponent setupA11yAttributes:",e)}}onApproveClick(){try{let e=this.getAnnotationId();if(!e)return;this.actionService.approveComment(e)}catch(e){this.loggingService.catch("Error in onApproveClick:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-approve-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","button","tabindex","0",3,"click"],[4,"veltDynamicTemplate"],["aria-hidden","true",1,"velt-fill"],[1,"velt-flat-button"]],template:function(t,a){if(t&1&&y(0,Ew,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-fill[_ngcontent-%COMP%]{flex-grow:1}.velt-flat-button[_ngcontent-%COMP%]{padding:var(--velt-spacing-sm) var(--velt-spacing-md);background:var(--velt-accent);border-radius:var(--velt-border-radius-3xl);border:0;color:var(--velt-accent-foreground);font-weight:700;transition:.2s;font-size:var(--velt-font-size-sm);cursor:pointer}.velt-flat-button[_ngcontent-%COMP%]:hover{background:var(--velt-accent-hover)}"],changeDetection:0});let r=o;return r})();function Mw(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}function Aw(r){try{let n=r?.commentDialogSelected??!1,e=r?.sidebarMode,t=r?.expandOnSelection!==!1;return e&&!t?!1:n}catch{return!1}}function Pw(r,o,n){try{return r?o&&!!n?.data?.annotation?.comments?.length&&!!n?.featureState?.moderatorMode&&!n?.data?.annotation?.approved&&!!n?.appState?.isUserAdmin:!0}catch{return!1}}var Nw=["*"],qc=(()=>{let o=class o extends At{constructor(e,t,a,i){super(a,i),this.loggingService=e,this.customFilterService=t,this.elementRef=a,this.themeService=i,this.headingMode=!1,this.changeStatus=new Le,this.componentId="velt-resolve-button"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ResolveButtonComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ResolveButtonComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{Rw(this.elementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in ResolveButtonComponent setupA11yAttributes:",e)}}resolveComment(e){this.loggingService.log("%c[WB] Calling FUNCTION: resolveComment","color: green;");try{if(!this.annotation)return;this.changeStatus.emit({status:this.customFilterService.resolvedStatus,statusOptionType:e})}catch(t){this.catchError("Error in CommentDialogComponent resolveComment: ",t)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(G(A),G(Dt),G(me),G(Et))},o.\u0275cmp=T({type:o,selectors:[["app-resolve-button"]],inputs:{annotation:"annotation",sidebarMode:"sidebarMode",headingMode:"headingMode",zIndex:"zIndex"},outputs:{changeStatus:"changeStatus"},standalone:!1,features:[M],ngContentSelectors:Nw,decls:3,vars:9,consts:[[3,"clicked","tooltip","darkMode","colorMode","zIndex"]],template:function(t,a){t&1&&(br(),b(0,"app-tooltip-button",0),F(1,"translate"),z("clicked",function(){return a.resolveComment("button")}),fr(2),x()),t&2&&(it("color",(a.annotation==null||a.annotation.status==null?null:a.annotation.status.color)+" !important"),v("tooltip",R(1,7,"Resolve"))("darkMode",a.darkMode)("colorMode",a.headingMode)("zIndex",a.zIndex||1e3),k("data-testid",a.componentId))},dependencies:[hn,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}"],changeDetection:0});let r=o;return r})();function Rw(r,o){try{r.setAttribute("role","presentation"),r.setAttribute("data-testid",o+"-container")}catch{}}var Jf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),Uw=(r,o)=>({condition:r,data:o}),Lw=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-assignee-banner-resolve-button-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Bw(r,o){if(r&1&&(u(0),de(),b(1,"svg",3),E(2,"path",4),x(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-icon")}}function Vw(r,o){if(r&1){let n=Y();u(0),b(1,"app-resolve-button",1),z("changeStatus",function(t){B(n);let a=l(3);return V(a.onResolveClick(t))}),s(2,Bw,3,1,"ng-container",2),x(),p()}if(r&2){let n,e=l(2),t=l();d(),v("darkMode",!!(e.uiState!=null&&e.uiState.darkMode))("headingMode",!0)("annotation",e.data==null?null:e.data.annotation)("sidebarMode",(n=t.localUIStateSignal())==null?null:n.sidebarMode),k("data-testid",t.componentId),d(),v("veltDynamicTemplate",O(9,Lw,t.template,C(6,Jf,t.componentConfigSignal,t.localUIStateSignal),e.uiState==null?null:e.uiState.variant,t.setIfCondition.bind(t),t.elementRef))}}function $w(r,o){if(r&1&&s(0,Vw,3,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,Uw,n.conditionSignal(),C(1,Jf,n.componentConfigSignal,n.localUIStateSignal)))}}function jw(r,o){if(r&1&&y(0,$w,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Fo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-assignee-banner-resolve-button-internal",this.shouldShow=L(()=>zw(this.defaultCondition(),this.componentConfigSignal()))}setupA11yAttributes(){try{Gw(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAssigneeBannerResolveButtonComponent setupA11yAttributes:",e)}}onResolveClick(e){try{let t=this.getAnnotationId();if(!t)return;this.actionService.resolveComment(t,e.statusOptionType)}catch(t){this.loggingService.catch("Error in CommentDialogAssigneeBannerResolveButtonComponent onResolveClick:",t)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-assignee-banner-resolve-button-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[3,"changeStatus","darkMode","headingMode","annotation","sidebarMode"],[4,"veltDynamicTemplate"],["width","12","height","10","viewBox","0 0 12 10","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["fill-rule","evenodd","clip-rule","evenodd","d","M11.5886 1.07806C11.914 1.4035 11.914 1.93114 11.5886 2.25657L4.92194 8.92324C4.5965 9.24868 4.06886 9.24868 3.74343 8.92324L0.410093 5.58991C0.0846564 5.26447 0.0846564 4.73683 0.410093 4.4114C0.73553 4.08596 1.26317 4.08596 1.5886 4.4114L4.33268 7.15547L10.4101 1.07806C10.7355 0.752625 11.2632 0.752625 11.5886 1.07806Z","fill","currentColor"]],template:function(t,a){if(t&1&&y(0,jw,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,qc],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function Gw(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","button"),r.setAttribute("aria-label","Resolve comment")}catch{}}function zw(r,o){try{return r?!!o?.featureState?.canResolveAnnotation:!0}catch{return!1}}var Ww=["*"],Qc=(()=>{let o=class o extends At{constructor(e,t,a,i){super(a,i),this.loggingService=e,this.customFilterService=t,this.elementRef=a,this.themeService=i,this.headingMode=!1,this.changeStatus=new Le,this.componentId="velt-unresolve-button"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in UnresolveButtonComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in UnresolveButtonComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{Jw(this.elementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in UnresolveButtonComponent setupA11yAttributes: ",e)}}unresolveComment(e){this.loggingService.log("%c[WB] Calling FUNCTION: unresolveComment","color: green;");try{if(!this.annotation)return;this.changeStatus.emit({status:this.customFilterService.defaultStatus,statusOptionType:e})}catch(t){this.catchError("Error in UnresolveButtonComponent unresolveComment: ",t)}}catchError(e,t,a){try{this.loggingService.catch(e,t,f(g({},a||{}),{annotationId:this.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(G(A),G(Dt),G(me),G(Et))},o.\u0275cmp=T({type:o,selectors:[["app-unresolve-button"]],inputs:{annotation:"annotation",sidebarMode:"sidebarMode",headingMode:"headingMode",zIndex:"zIndex"},outputs:{changeStatus:"changeStatus"},standalone:!1,features:[M],ngContentSelectors:Ww,decls:3,vars:9,consts:[["type","unresolve",3,"clicked","tooltip","darkMode","colorMode","zIndex"]],template:function(t,a){t&1&&(br(),b(0,"app-tooltip-button",0),F(1,"translate"),z("clicked",function(){return a.unresolveComment("button")}),fr(2),x()),t&2&&(it("color",(a.annotation==null||a.annotation.status==null?null:a.annotation.status.color)+" !important"),v("tooltip",R(1,7,"Unresolve"))("darkMode",a.darkMode)("colorMode",a.headingMode)("zIndex",a.zIndex||1e3),k("data-testid",a.componentId+"-tooltip-button"))},dependencies:[hn,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}"]});let r=o;return r})();function Jw(r,o){try{r.setAttribute("role","button"),r.setAttribute("aria-label","Unresolve comment"),r.setAttribute("data-testid",o+"-container")}catch{}}var Kf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),Yw=(r,o)=>({condition:r,data:o}),Kw=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-assignee-banner-unresolve-button-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function Zw(r,o){if(r&1&&(u(0),de(),b(1,"svg",3),E(2,"path",4),x(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-icon")}}function Xw(r,o){if(r&1){let n=Y();u(0),b(1,"app-unresolve-button",1),z("changeStatus",function(t){B(n);let a=l(3);return V(a.onUnresolveClick(t))}),s(2,Zw,3,1,"ng-container",2),x(),p()}if(r&2){let n,e=l(2),t=l();d(),v("darkMode",!!(e.uiState!=null&&e.uiState.darkMode))("headingMode",!0)("annotation",e.data==null?null:e.data.annotation)("sidebarMode",(n=t.localUIStateSignal())==null?null:n.sidebarMode),k("data-testid",t.componentId),d(),v("veltDynamicTemplate",O(9,Kw,t.template,C(6,Kf,t.componentConfigSignal,t.localUIStateSignal),e.uiState==null?null:e.uiState.variant,t.setIfCondition.bind(t),t.elementRef))}}function qw(r,o){if(r&1&&s(0,Xw,3,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,Yw,n.conditionSignal(),C(1,Kf,n.componentConfigSignal,n.localUIStateSignal)))}}function Qw(r,o){if(r&1&&y(0,qw,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var No=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-assignee-banner-unresolve-button-internal",this.shouldShow=L(()=>tI(this.defaultCondition(),this.componentConfigSignal()))}setupA11yAttributes(){try{eI(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAssigneeBannerUnresolveButtonComponent setupA11yAttributes:",e)}}onUnresolveClick(e){try{let t=this.getAnnotationId();if(!t)return;this.actionService.unresolveComment(t,e.statusOptionType)}catch(t){this.loggingService.catch("Error in CommentDialogAssigneeBannerUnresolveButtonComponent onUnresolveClick:",t)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-assignee-banner-unresolve-button-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[3,"changeStatus","darkMode","headingMode","annotation","sidebarMode"],[4,"veltDynamicTemplate"],["width","12","height","10","viewBox","0 0 12 10","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["fill-rule","evenodd","clip-rule","evenodd","d","M11.5886 1.07806C11.914 1.4035 11.914 1.93114 11.5886 2.25657L4.92194 8.92324C4.5965 9.24868 4.06886 9.24868 3.74343 8.92324L0.410093 5.58991C0.0846564 5.26447 0.0846564 4.73683 0.410093 4.4114C0.73553 4.08596 1.26317 4.08596 1.5886 4.4114L4.33268 7.15547L10.4101 1.07806C10.7355 0.752625 11.2632 0.752625 11.5886 1.07806Z","fill","currentColor"]],template:function(t,a){if(t&1&&y(0,Qw,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Qc],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function eI(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","button"),r.setAttribute("aria-label","Unresolve comment")}catch{}}function tI(r,o){try{return r?!!o?.featureState?.canUnresolveAnnotation:!0}catch{return!1}}var Zf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),nI=(r,o)=>({condition:r,data:o}),oI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-assignee-banner-user-avatar-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function aI(r,o){if(r&1&&(u(0),E(1,"snippyly-user-avatar",2),F(2,"translate"),p()),r&2){let n=l(2),e=l();d(),v("size",28)("user",n.data==null||n.data.annotation==null?null:n.data.annotation.assignedTo),k("aria-label",R(2,4,"Avatar for assigned user"))("data-testid",e.componentId+"-avatar")}}function iI(r,o){if(r&1&&(u(0),s(1,aI,3,6,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,oI,e.template,C(1,Zf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function lI(r,o){if(r&1&&s(0,iI,2,10,"ng-container",0),r&2){let n=l();v("veltIf",C(4,nI,n.conditionSignal(),C(1,Zf,n.componentConfigSignal,n.localUIStateSignal)))}}var Ro=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-assignee-banner-user-avatar-internal"}setupA11yAttributes(){try{dI(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAssigneeBannerUserAvatarComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-assignee-banner-user-avatar-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-assignee-banner--user-avatar",3,"size","user"]],template:function(t,a){if(t&1&&y(0,lI,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Lt,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-assignee-banner--user-avatar[_ngcontent-%COMP%]{align-self:center}"],changeDetection:0});let r=o;return r})();function dI(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var Xf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),cI=(r,o)=>({condition:r,data:o}),mI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-assignee-banner-user-name-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function sI(r,o){if(r&1&&(b(0,"div",2),F(1,"translate"),ie(2),F(3,"translate"),x()),r&2){let n=l(4),e=l();k("data-testid",e.componentId)("aria-label",R(1,3,"Assigned to")+" "+((n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null?null:n.data.annotation.assignedTo.name)||(n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null?null:n.data.annotation.assignedTo.email))),d(2),fe(" ",R(3,5,(n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null?null:n.data.annotation.assignedTo.name)||(n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null?null:n.data.annotation.assignedTo.email))," ")}}function gI(r,o){r&1&&E(0,"velt-skeleton-loader-internal",3)}function uI(r,o){if(r&1&&(u(0),y(1,sI,4,7,"div",2)(2,gI,1,0,"velt-skeleton-loader-internal",3),p()),r&2){let n=l(3);d(),w(!(n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null)&&n.data.annotation.assignedTo.name||!(n.data==null||n.data.annotation==null||n.data.annotation.assignedTo==null)&&n.data.annotation.assignedTo.email?1:2)}}function pI(r,o){if(r&1&&(u(0),s(1,uI,3,1,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,mI,e.template,C(1,Xf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function hI(r,o){if(r&1&&s(0,pI,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,cI,n.conditionSignal(),C(1,Xf,n.componentConfigSignal,n.localUIStateSignal)))}}function bI(r,o){if(r&1&&y(0,hI,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Uo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-assignee-banner-user-name-internal",this.shouldShow=L(()=>CI(this.defaultCondition()))}setupA11yAttributes(){try{fI(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAssigneeBannerUserNameComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-assignee-banner-user-name-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","text",1,"velt-assignee-banner--user-name"],["height","16px","width","80px","borderRadius","8px"]],template:function(t,a){if(t&1&&y(0,bI,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Yr,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{width:100%}[_nghost-%COMP%]:empty{display:none}.velt-assignee-banner--user-name[_ngcontent-%COMP%]{color:var(--velt-accent-foreground);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}"],changeDetection:0});let r=o;return r})();function fI(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}function CI(r){try{return!0}catch{return!1}}var qf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),xI=(r,o)=>({condition:r,data:o}),_I=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-assignee-banner-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function SI(r,o){if(r&1&&E(0,"velt-comment-dialog-assignee-banner-resolve-button-internal",6)(1,"velt-comment-dialog-assignee-banner-unresolve-button-internal",7),r&2){let n=l(5);v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)}}function yI(r,o){if(r&1&&(b(0,"div",2),F(1,"translate"),E(2,"velt-comment-dialog-assignee-banner-user-avatar-internal",3),b(3,"div",4)(4,"div",5),ie(5),F(6,"translate"),x(),E(7,"velt-comment-dialog-assignee-banner-user-name-internal",3),x(),y(8,SI,2,4),x()),r&2){let n=l(3),e=l();it("background-color",n.data==null||n.data.annotation==null||n.data.annotation.status==null?null:n.data.annotation.status.color)("--legacy-velt-assignee-banner-color",(n.data==null||n.data.annotation==null||n.data.annotation.status==null?null:n.data.annotation.status.lightColor)||"white")("--legacy-velt-tooltip-button-color",(n.data==null||n.data.annotation==null||n.data.annotation.status==null?null:n.data.annotation.status.lightColor)||"white"),pe("velt-assignee-banner--private-comment-mode",n.uiState==null?null:n.uiState.isPrivateComment)("velt-assignee-banner--has-visibility-banner",e.hasVisibilityBanner())("private-comment",n.uiState==null?null:n.uiState.isPrivateComment),k("data-testid",e.componentId)("aria-label",R(1,21,"Comment assignment details")),d(2),v("componentConfigSignal",e.componentConfigSignal)("parentLocalUIState",e.localUIStateSignal),d(),k("data-testid",e.componentId+"-author"),d(2),Ge(R(6,23,"Assigned to:")),d(2),v("componentConfigSignal",e.componentConfigSignal)("parentLocalUIState",e.localUIStateSignal),d(),w(n.uiState!=null&&n.uiState.readOnly?-1:8)}}function wI(r,o){if(r&1&&(u(0),s(1,yI,9,25,"div",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,_I,e.template,C(1,qf,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function II(r,o){if(r&1&&s(0,wI,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,xI,n.conditionSignal(),C(1,qf,n.componentConfigSignal,n.localUIStateSignal)))}}function DI(r,o){if(r&1&&y(0,II,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Lo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-assignee-banner-internal",this.hasVisibilityBanner=L(()=>{let e=this.componentConfigSignal();return e?.featureState?.visibilityOptions===!0&&e?.featureState?.isPrivateCommentsEnabled===!0}),this.shouldShow=L(()=>OI(this.defaultCondition(),this.componentConfigSignal()))}setupA11yAttributes(){try{TI(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogAssigneeBannerComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-assignee-banner-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["class","velt-assignee-banner--heading","role","region",3,"velt-assignee-banner--private-comment-mode","velt-assignee-banner--has-visibility-banner","private-comment","backgroundColor","--legacy-velt-assignee-banner-color","--legacy-velt-tooltip-button-color",4,"veltDynamicTemplate"],["role","region",1,"velt-assignee-banner--heading"],[3,"componentConfigSignal","parentLocalUIState"],[1,"velt-assignee-banner--author"],[1,"velt-assignee-banner--text"],[1,"velt-assignee-banner--resolve-button",3,"componentConfigSignal","parentLocalUIState"],[1,"velt-assignee-banner--unresolve-button",3,"componentConfigSignal","parentLocalUIState"]],template:function(t,a){if(t&1&&y(0,DI,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Fo,No,Ro,Uo,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{width:100%}[_nghost-%COMP%]:empty{display:none}.velt-assignee-banner--heading[_ngcontent-%COMP%]{background:var(--velt-green);margin:calc(var(--velt-spacing-lg) * -1);padding:var(--velt-spacing-lg);color:var(--velt-white);display:flex;align-items:center;justify-content:flex-start;grid-gap:var(--velt-spacing-sm);gap:var(--velt-spacing-sm);margin-bottom:0;border-radius:var(--velt-border-radius-md) var(--velt-border-radius-md) 0 0}.velt-assignee-banner--heading.velt-assignee-banner--private-comment-mode[_ngcontent-%COMP%], .velt-assignee-banner--heading.velt-assignee-banner--has-visibility-banner[_ngcontent-%COMP%]{border-radius:0}.velt-assignee-banner--heading.velt-assignee-banner--private-comment-mode[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--velt-purple) 32%,var(--velt-black) 100%)}.velt-assignee-banner--author[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;overflow:hidden}.velt-assignee-banner--text[_ngcontent-%COMP%]{font-style:normal;font-weight:400;font-size:var(--velt-font-size-xs);line-height:17px;color:var(--velt-accent-foreground)}.velt-assignee-banner--user-name[_ngcontent-%COMP%]{color:var(--velt-accent-foreground);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.velt-assignee-banner--resolve-button[_ngcontent-%COMP%], .velt-assignee-banner--unresolve-button[_ngcontent-%COMP%]{margin-left:auto}"],changeDetection:0});let r=o;return r})();function TI(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region"),r.setAttribute("aria-label","Comment assignment details")}catch{}}function OI(r,o){try{if(!r)return!0;if(o?.featureState?.inlineCommentMode)return!1;let n=!!o?.data?.annotation?.assignedTo;return o?.featureState?.assignToType==="checkbox"?n||!!o?.data?.isAssignedCheckbox:n}catch{return!1}}var Qf=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),MI=(r,o)=>({condition:r,data:o}),AI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-hide-reply-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function PI(r,o){r&1&&(u(0),b(1,"div",3),ie(2," Hide replies "),x(),p())}function FI(r,o){if(r&1){let n=Y();u(0),b(1,"div",1),F(2,"translate"),z("click",function(t){B(n);let a=l(3);return V(a.onToggleHideReply(t))}),s(3,PI,3,0,"ng-container",2),x(),p()}if(r&2){let n=l(2),e=l();d(),k("data-testid",e.componentId)("aria-expanded",n==null||n.uiState==null?null:n.uiState.showReplies)("aria-label",R(2,4,"Hide reply")),d(2),v("veltDynamicTemplate",O(9,AI,e.template,C(6,Qf,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function NI(r,o){if(r&1&&s(0,FI,4,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,MI,n.conditionSignal(),C(1,Qf,n.componentConfigSignal,n.localUIStateSignal)))}}function RI(r,o){if(r&1&&y(0,NI,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Bo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-hide-reply-internal",this.isDialogSelected=L(()=>LI(this.localUIStateSignal())),this.shouldShow=L(()=>BI(this.defaultCondition(),this.componentConfigSignal(),this.isDialogSelected()))}setupA11yAttributes(){try{UI(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogHideReplyComponent setupA11yAttributes:",e)}}onToggleHideReply(e){try{e?.stopPropagation();let t=this.getAnnotationId();if(!t)return;this.actionService.toggleHideReply(t)}catch(t){this.loggingService.catch("Error in onToggleHideReply:",t)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-hide-reply-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","button","tabindex","0",1,"velt-comment-dialog-hide-reply-container",3,"click"],[4,"veltDynamicTemplate"],[1,"velt-comment-dialog-hide-reply"]],template:function(t,a){if(t&1&&y(0,RI,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-comment-dialog-hide-reply[_ngcontent-%COMP%]{color:var(--velt-text-8);font-size:var(--velt-font-size-xs);cursor:pointer;padding:var(--velt-spacing-xs) var(--velt-spacing-sm) var(--velt-spacing-xs) 0px;display:inline-flex;align-items:center;margin-top:var(--velt-spacing-xs)}"],changeDetection:0});let r=o;return r})();function UI(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}function LI(r){try{let n=r?.commentDialogSelected??!1,e=r?.sidebarMode,t=r?.expandOnSelection!==!1;return e&&!t?!1:n}catch{return!1}}function BI(r,o,n){try{return r?!o?.uiState?.collapsedComments&&n&&(o?.data?.annotation?.comments?.length??0)>1:!0}catch{return!1}}var eC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),$I=(r,o)=>({condition:r,data:o}),jI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-reply-avatars-list-item-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function GI(r,o){if(r&1&&(u(0),E(1,"snippyly-user-avatar",2),p()),r&2){let n=l(4);d(),v("user",n.resolvedUser()),k("data-testid",n.componentId+"-avatar")}}function zI(r,o){if(r&1&&(u(0),s(1,GI,2,2,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,jI,e.template,C(1,eC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function HI(r,o){if(r&1&&s(0,zI,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,$I,n.conditionSignal(),C(1,eC,n.componentConfigSignal,n.localUIStateSignal)))}}function WI(r,o){if(r&1&&y(0,HI,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Vo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-reply-avatars-list-item-internal",this.domService=ge(Ne),this.user=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e??null}catch{return null}}}),this.index=Q(0,{transform:e=>{try{if(e==null)return 0;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedUser=L(()=>{let e=this.user();if(e)return e;let t=this.componentConfigSignal(),a=t?.appState?.repliesUniqueUsers;return(Array.isArray(a)&&a.length>0?a:YI(t?.data?.annotation?.comments))[this.index()]??void 0}),this.shouldShow=L(()=>{try{return!!this.resolvedUser()}catch{return!1}})}get itemTemplate(){return this._itemTemplate}set itemTemplate(e){try{this._itemTemplate=e,e?this.template=this.domService.deepCloneElement(e):this.template=null}catch{}}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,user:this.resolvedUser(),index:this.index()})}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsListItemComponent ngOnInit:",e)}}setupA11yAttributes(){try{JI(this.hostElementRef.nativeElement,this.componentId,this.index())}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsListItemComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-reply-avatars-list-item-internal"]],inputs:{user:[1,"user"],index:[1,"index"],itemTemplate:"itemTemplate"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"user"]],template:function(t,a){if(t&1&&y(0,WI,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Lt],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.3rem}"],changeDetection:0});let r=o;return r})();function JI(r,o,n){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","listitem"),r.setAttribute("aria-label",`Reply avatar ${n+1}`)}catch{}}function YI(r){try{if(!Array.isArray(r))return[];let o=new Set,n=[];for(let e of r){let t=e?.from,a=t?.userId||t?.email;t&&a&&!o.has(a)&&(o.add(a),n.push(t))}return n}catch{return[]}}var tC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),ZI=(r,o)=>({condition:r,data:o}),XI=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-reply-avatars-list-wireframe",variant:n,setIfCondition:e,componentElementRef:t,replaceTemplate:!1}),qI=()=>[],QI=(r,o)=>(o==null?null:o.userId)||r;function e3(r,o){if(r&1&&E(0,"velt-comment-dialog-reply-avatars-list-item-internal",3),r&2){let n=o.$implicit,e=o.$index,t=l(4);v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("user",n)("index",e)("itemTemplate",t.itemTemplate)}}function t3(r,o){if(r&1&&(u(0),b(1,"div",2),et(2,e3,1,5,"velt-comment-dialog-reply-avatars-list-item-internal",3,QI),x(),p()),r&2){let n=l(2),e=l();d(),k("data-testid",e.componentId),d(),tt((n==null||n.appState==null||n.appState.repliesUniqueUsers==null?null:n.appState.repliesUniqueUsers.slice(0,n==null||n.uiState==null?null:n.uiState.maxReplyAvatars))||vt(1,qI))}}function r3(r,o){if(r&1&&(u(0),s(1,t3,4,2,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,XI,e.template,C(1,tC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function n3(r,o){if(r&1&&s(0,r3,2,10,"ng-container",0),r&2){let n=l();v("veltIf",C(4,ZI,n.conditionSignal(),C(1,tC,n.componentConfigSignal,n.localUIStateSignal)))}}var $o=(()=>{let o=class o extends te{constructor(){super(),this.componentId="velt-comment-dialog-reply-avatars-list-internal"}ngOnInit(){try{super.ngOnInit();let e=this.template?.querySelector("velt-comment-dialog-reply-avatars-list-item-wireframe");ye(e)||(this.itemTemplate=e)}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsListComponent ngOnInit:",e)}}setupA11yAttributes(){try{o3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsListComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-reply-avatars-list-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-comment-dialog-reply-avatars-list"],[3,"componentConfigSignal","parentLocalUIState","user","index","itemTemplate"]],template:function(t,a){if(t&1&&y(0,n3,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Vo],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-comment-dialog-reply-avatars-list[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-start}velt-comment-dialog-reply-avatars-list-item-internal[_ngcontent-%COMP%]:not(:first-child){margin-left:calc(var(--velt-spacing-xs) * -1)}"],changeDetection:0});let r=o;return r})();function o3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","list"),r.setAttribute("aria-label","Reply avatars list")}catch{}}var rC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),i3=(r,o)=>({condition:r,data:o}),l3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-reply-avatars-remaining-count-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function d3(r,o){if(r&1&&(u(0),E(1,"snippyly-user-avatar",2),p()),r&2){let n=l(3),e=l();d(),v("initial","+"+(((n.appState==null||n.appState.repliesUniqueUsers==null?null:n.appState.repliesUniqueUsers.length)||0)-((n.uiState==null?null:n.uiState.maxReplyAvatars)||0)).toString()),k("data-testid",e.componentId+"-avatar")}}function v3(r,o){if(r&1&&(u(0),s(1,d3,2,2,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,l3,e.template,C(1,rC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function c3(r,o){if(r&1&&s(0,v3,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,i3,n.conditionSignal(),C(1,rC,n.componentConfigSignal,n.localUIStateSignal)))}}function m3(r,o){if(r&1&&y(0,c3,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var jo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-reply-avatars-remaining-count-internal",this.shouldShow=L(()=>g3(this.defaultCondition(),this.componentConfigSignal()))}setupA11yAttributes(){try{s3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsRemainingCountComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-reply-avatars-remaining-count-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"initial"]],template:function(t,a){if(t&1&&y(0,m3,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Lt],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{display:block;margin-left:calc(var(--velt-spacing-xs) * -1)}[_nghost-%COMP%]:empty{display:none}snippyly-user-avatar[_ngcontent-%COMP%]{--legacy-velt-user-avatar-size: 1.3rem}"],changeDetection:0});let r=o;return r})();function s3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation"),r.setAttribute("aria-label","Additional reply count")}catch{}}function g3(r,o){try{return r?!!o?.appState?.repliesUniqueUsers&&!!o?.uiState?.maxReplyAvatars&&(o?.appState?.repliesUniqueUsers?.length??0)>(o?.uiState?.maxReplyAvatars??0):!0}catch{return!1}}var nC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),p3=(r,o)=>({condition:r,data:o}),h3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-reply-avatars-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function b3(r,o){if(r&1&&(u(0),b(1,"div",2),E(2,"velt-comment-dialog-reply-avatars-list-internal",3)(3,"velt-comment-dialog-reply-avatars-remaining-count-internal",3),x(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-container"),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)}}function f3(r,o){if(r&1&&(u(0),s(1,b3,4,5,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,h3,e.template,C(1,nC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function C3(r,o){if(r&1&&s(0,f3,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,p3,n.conditionSignal(),C(1,nC,n.componentConfigSignal,n.localUIStateSignal)))}}function k3(r,o){if(r&1&&y(0,C3,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Go=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-reply-avatars-internal",this.shouldShow=L(()=>_3(this.defaultCondition(),this.componentConfigSignal()))}setupA11yAttributes(){try{x3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogReplyAvatarsComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-reply-avatars-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-comment-dialog-reply-avatars"],[3,"componentConfigSignal","parentLocalUIState"]],template:function(t,a){if(t&1&&y(0,k3,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,$o,jo],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-comment-dialog-reply-avatars[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-start}"],changeDetection:0});let r=o;return r})();function x3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","complementary"),r.setAttribute("aria-label","Reply avatars")}catch{}}function _3(r,o){try{return r?!!o?.appState?.repliesUniqueUsers?.length:!0}catch{return!1}}var oC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),y3=(r,o)=>({condition:r,data:o}),w3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-more-reply-count-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function I3(r,o){if(r&1&&(u(0),ie(1),p()),r&2){let n=l(4);d(),fe(" ",n.hiddenCount()," ")}}function D3(r,o){if(r&1&&(u(0),s(1,I3,2,1,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,w3,e.template,C(1,oC,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function T3(r,o){if(r&1&&s(0,D3,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,y3,n.conditionSignal(),C(1,oC,n.componentConfigSignal,n.localUIStateSignal)))}}function O3(r,o){if(r&1&&y(0,T3,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var zo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-more-reply-count-internal",this.shouldShow=L(()=>M3(this.defaultCondition(),this.componentConfigSignal())),this.hiddenCount=L(()=>A3(this.componentConfigSignal()))}setupA11yAttributes(){try{E3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogMoreReplyCountComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-more-reply-count-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"]],template:function(t,a){if(t&1&&y(0,O3,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{color:var(--velt-text-10)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function E3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.setAttribute("aria-label","Hidden reply count")}catch{}}function M3(r,o){try{return r?(o?.data?.annotation?.comments?.length??0)>2:!0}catch{return!1}}function A3(r){try{let o=r?.data?.annotation?.comments?.length??0;return Math.max(0,o-2)}catch{return 0}}var aC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),F3=(r,o)=>({condition:r,data:o}),N3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-more-reply-text-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function R3(r,o){if(r&1&&(u(0),ie(1),F(2,"translate"),p()),r&2){let n=l(3);d(),fe(" ",R(2,1,n.pluralKey())," ")}}function U3(r,o){if(r&1&&(u(0),s(1,R3,3,3,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,N3,e.template,C(1,aC,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function L3(r,o){if(r&1&&s(0,U3,2,10,"ng-container",0),r&2){let n=l();v("veltIf",C(4,F3,n.conditionSignal(),C(1,aC,n.componentConfigSignal,n.localUIStateSignal)))}}var Ho=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-more-reply-text-internal",this.pluralKey=L(()=>V3(this.componentConfigSignal()))}setupA11yAttributes(){try{B3(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in CommentDialogMoreReplyTextComponent setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-more-reply-text-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"]],template:function(t,a){if(t&1&&y(0,L3,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{color:var(--velt-text-10)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function B3(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","text"),r.setAttribute("aria-hidden","true")}catch{}}function V3(r){try{return(r?.data?.annotation?.comments?.length??0)===3?"reply":"replies"}catch{return"replies"}}var iC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),j3=(r,o)=>({condition:r,data:o}),G3=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-more-reply-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function z3(r,o){if(r&1&&(b(0,"div",3),ie(1),F(2,"translate"),E(3,"velt-comment-dialog-more-reply-count-internal",4)(4,"velt-comment-dialog-more-reply-text-internal",4),x()),r&2){let n=l(4);k("data-testid",n.componentId+"-count-"+n.index())("aria-live","polite"),d(),fe(" ",R(2,7,"Show")," "),d(2),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)}}function H3(r,o){if(r&1){let n=Y();u(0),b(1,"div",1),F(2,"translate"),F(3,"translate"),z("click",function(t){return B(n),l(3).onMoreRepliesClick(),V(t.stopPropagation())}),s(4,z3,5,9,"div",2),x(),p()}if(r&2){let n=l(2),e=l();d(),k("data-testid",e.componentId+"-button-"+e.index())("aria-label",(n==null||n.data==null||n.data.annotation==null||n.data.annotation.comments==null?null:n.data.annotation.comments.length)===3?R(2,3,"Show 1 more reply"):R(3,5,"Show "+((n==null||n.data==null||n.data.annotation==null||n.data.annotation.comments==null?null:n.data.annotation.comments.length)-2)+" more replies")),d(3),v("veltDynamicTemplate",O(10,G3,e.template,C(7,iC,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function W3(r,o){if(r&1&&s(0,H3,5,16,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,j3,n.conditionSignal(),C(1,iC,n.componentConfigSignal,n.localUIStateSignal)))}}function J3(r,o){if(r&1&&y(0,W3,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Wo=(()=>{let o=class o extends te{constructor(){super(),this.index=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.moreReplyTemplate=Q(),this.domService=ge(Ne),this.componentId="velt-comment-dialog-more-reply-internal",this.isDialogSelected=L(()=>K3(this.localUIStateSignal())),this.shouldShow=L(()=>X3(this.defaultCondition(),this.componentConfigSignal(),this.isDialogSelected(),this.index())),_t(()=>{try{let e=this.moreReplyTemplate();e?this.template=this.domService.deepCloneElement(e):this.template=null}catch(e){this.loggingService.catch("Error in CommentDialogMoreReplyComponent moreReplyTemplate effect:",e)}})}setupA11yAttributes(){try{Y3(this.hostElementRef.nativeElement,this.componentId,this.index())}catch(e){this.loggingService.catch("Error in CommentDialogMoreReplyComponent setupA11yAttributes:",e)}}onMoreRepliesClick(){try{let e=this.getAnnotationId();if(!e)return;let t=!!this.componentConfigSignal()?.uiState?.collapsedRepliesPreview;if(Z3(t,this.isDialogSelected())){let a=this.actionService.toggleShowReplies(e,!0);if(a.openFocusedThread&&a.annotation){let i=this.coreService.getContextConfig(e);i&&i.update(c=>f(g({},c),{uiState:f(g({},c.uiState),{pendingOpenFocusedThread:a.annotation})}))}return}this.actionService.onMoreRepliesClick(e)}catch(e){this.loggingService.catch("Error in onMoreRepliesClick:",e)}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-more-reply-internal"]],inputs:{index:[1,"index"],moreReplyTemplate:[1,"moreReplyTemplate"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","button","tabindex","0",3,"click"],["class","velt-hidden-count","role","status",4,"veltDynamicTemplate"],["role","status",1,"velt-hidden-count"],[3,"componentConfigSignal","parentLocalUIState"]],template:function(t,a){if(t&1&&y(0,J3,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,zo,Ho,W],styles:['html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-hidden-count[_ngcontent-%COMP%]{text-align:center;color:var(--velt-text-10);cursor:pointer}.velt-hidden-count[_ngcontent-%COMP%]:before, .velt-hidden-count[_ngcontent-%COMP%]:after{background-color:var(--velt-background-4);content:"";display:inline-block;height:1px;position:relative;vertical-align:middle;width:calc(50% - 50px - 1em)}.velt-hidden-count[_ngcontent-%COMP%]:before{right:.5em;margin-left:-50%}.velt-hidden-count[_ngcontent-%COMP%]:after{left:.5em;margin-right:-50%}'],changeDetection:0});let r=o;return r})();function Y3(r,o,n){try{r.setAttribute("data-testid",`${o}-host-${n}`)}catch{}}function K3(r){try{let n=r?.commentDialogSelected??!1,e=r?.sidebarMode,t=r?.expandOnSelection!==!1;return e&&!t?!1:n}catch{return!1}}function Z3(r,o){return r&&!o}function X3(r,o,n,e){try{return r?(n?!o?.uiState?.showAllComments:!!o?.uiState?.collapsedRepliesPreview&&!o?.uiState?.showReplies)&&(o?.data?.annotation?.comments?.length??0)>2&&e===1:!0}catch{return!1}}function lC(r,o){if(!(!Array.isArray(r)||r.length===0))return o!=null?r.find(n=>n?.commentId?.toString()===o.toString()):r[0]}function gr(r){let{attachment:o,commentObj:n,attachmentIndex:e,config:t,contextAttachmentId:a,contextCommentId:i}=r;if(o)return o;if(n?.attachments&&Array.isArray(n.attachments))return n.attachments[e];let c=t?.data?.annotation?.comments;if(a){let I=lC(c,i)?.attachments;if(Array.isArray(I)){let S=I.find(H=>H?.attachmentId?.toString()===a.toString());if(S)return S}return null}let h=lC(c,i)?.attachments;return Array.isArray(h)?h[e]??null:null}var dC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,attachmentIndex:e,attachment:t}),Q3=(r,o)=>({condition:r,data:o}),eD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-image-delete-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function tD(r,o){r&1&&(u(0),b(1,"div",3),de(),b(2,"svg",4),E(3,"path",5)(4,"path",6),x()(),p())}function rD(r,o){if(r&1){let n=Y();b(0,"div",1),F(1,"translate"),F(2,"translate"),z("click",function(t){return B(n),l(3).onDeleteClick(),V(t.stopPropagation())}),s(3,tD,5,0,"ng-container",2),x()}if(r&2){let n=l(2),e=l();k("title",R(1,4,"Delete Attachment"))("aria-label",R(2,6,"Delete attachment"))("data-testid",e.componentId),d(3),v("veltDynamicTemplate",O(14,eD,e.template,O(8,dC,e.componentConfigSignal,e.localUIStateSignal,e.commentObj(),e.attachmentIndex(),e.resolvedAttachment()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function nD(r,o){if(r&1&&(u(0),y(1,rD,4,20,"div"),p()),r&2){let n=l(2);d(),w(n.shouldShowDeleteButton()?1:-1)}}function oD(r,o){if(r&1&&s(0,nD,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,Q3,n.conditionSignal(),O(1,dC,n.componentConfigSignal,n.localUIStateSignal,n.commentObj(),n.attachmentIndex(),n.resolvedAttachment())))}}var Jo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-image-delete-internal",this.attachment=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentIndex=Q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.attachmentIndex=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return gr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}}),this.shouldShowDeleteButton=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal();if(!e)return!1;let t=e.uiState?.disabled,a=e.featureState?.isPlanExpired,i=e.appState?.user?.userId,c=this.resolveComment()?.from?.userId;return!t&&!a&&i===c}catch(e){return this.loggingService.catch("Error in shouldShowDeleteButton:",e),!1}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsImageDeleteComponent ngOnInit:",e)}}onDeleteClick(){try{let e=this.getAnnotationId();if(!e)return;let t=this.resolveCommentIndex();if(t===void 0)return;let a=this.attachmentIndex();this.actionService.deleteCommentAttachment(e,t,a)}catch(e){this.loggingService.catch("Error in onDeleteClick:",e)}}resolveComment(){try{let e=this.commentObj();if(e)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.getContextCommentId();if(a!=null){let i=t.find(c=>c?.commentId?.toString()===a.toString());if(i)return i}return t[0]}catch(e){this.loggingService.catch("Error in resolveComment:",e);return}}resolveCommentIndex(){try{let e=this.commentIndex();if(e!==void 0)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.getContextCommentId();if(a!=null){let i=t.findIndex(c=>c?.commentId?.toString()===a.toString());if(i>=0)return i}return 0}catch(e){this.loggingService.catch("Error in resolveCommentIndex:",e);return}}setupA11yAttributes(){try{aD(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-image-delete-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],commentIndex:[1,"commentIndex"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[3,"click"],[4,"veltDynamicTemplate"],[1,"icon-button","velt-comment-attachment--image-action-btn"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","focusable","false"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"]],template:function(t,a){if(t&1&&y(0,oD,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-comment-attachment--image-action-btn[_ngcontent-%COMP%]{background:var(--velt-white);display:flex;align-items:center;border-radius:var(--velt-border-radius-3xl);width:40px;height:40px;justify-content:center;opacity:1;margin:var(--velt-spacing-xs);border:0;cursor:pointer;color:var(--velt-black)}"],changeDetection:0});let r=o;return r})();function aD(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var lD=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,attachmentIndex:e,attachment:t}),dD=(r,o)=>({condition:r,data:o}),vD=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,commentObj:e,attachmentIndex:t}),cD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-image-download-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function mD(r,o){r&1&&(u(0),b(1,"div",4),de(),b(2,"svg",5)(3,"g"),E(4,"rect",6),x(),b(5,"g"),E(6,"path",7),x()()(),p())}function sD(r,o){if(r&1){let n=Y();b(0,"div",2),F(1,"translate"),F(2,"translate"),z("click",function(t){return B(n),l(3).onDownloadClick(),V(t.stopPropagation())}),s(3,mD,7,0,"ng-container",3),x()}if(r&2){let n=l(2),e=l();k("title",R(1,4,"Download attachment"))("aria-label",R(2,6,"Download attachment"))("data-testid",e.componentId),d(3),v("veltDynamicTemplate",O(14,cD,e.template,O(8,vD,e.componentConfigSignal,e.localUIStateSignal,e.resolvedAttachment(),e.commentObj(),e.attachmentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function gD(r,o){if(r&1&&(u(0),y(1,sD,4,20,"div",1),p()),r&2){let n=l(2);d(),w(n.shouldShowDownloadButton()?1:-1)}}function uD(r,o){if(r&1&&s(0,gD,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,dD,n.conditionSignal(),O(1,lD,n.componentConfigSignal,n.localUIStateSignal,n.commentObj(),n.attachmentIndex(),n.resolvedAttachment())))}}var Yo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-image-download-internal",this.attachment=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.shouldShowDownloadButton=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal();if(!e)return!1;let t=e.uiState?.disabled,a=e.featureState?.isPlanExpired,i=e.appState?.user;return!t&&!a&&!!i?.userId&&!i?.isAnonymous}catch(e){return this.loggingService.catch("Error in shouldShowDownloadButton:",e),!1}}),this.resolvedAttachment=L(()=>{try{return gr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsImageDownloadComponent ngOnInit:",e)}}onDownloadClick(){try{let e=this.getAnnotationId();if(!e)return;let t=this.resolvedAttachment();if(!t)return;this.actionService.downloadAttachment(e,t)}catch(e){this.loggingService.catch("Error in onDownloadClick:",e)}}setupA11yAttributes(){try{pD(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-image-download-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[1,"velt-comment-attachment--image-download-wrapper"],[1,"velt-comment-attachment--image-download-wrapper",3,"click"],[4,"veltDynamicTemplate"],[1,"icon-button","velt-comment-attachment--image-action-btn"],["xmlns","http://www.w3.org/2000/svg","enable-background","new 0 0 24 24","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","focusable","false"],["fill","none","height","24","width","24"],["d","M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z"]],template:function(t,a){if(t&1&&y(0,uD,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-comment-attachment--image-action-btn[_ngcontent-%COMP%]{background:var(--velt-white);display:flex;align-items:center;border-radius:var(--velt-border-radius-3xl);width:40px;height:40px;justify-content:center;opacity:1;margin:var(--velt-spacing-xs);border:0;cursor:pointer;color:var(--velt-black)}"],changeDetection:0});let r=o;return r})();function pD(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var vC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,attachmentIndex:e,commentObj:t}),bD=(r,o)=>({condition:r,data:o}),fD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-image-preview-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function CD(r,o){if(r&1){let n=Y();u(0),b(1,"snippyly-lightbox",3,0)(3,"img",4),F(4,"translate"),F(5,"translate"),z("click",function(t){B(n);let a=we(2);return a==null||a.openImageInFullScreen(),V(t.stopPropagation())}),x()(),p()}if(r&2){let n,e,t,a=l(3);d(),v("src",(n=a.resolvedAttachment())==null?null:n.url),k("data-testid",a.componentId+"-lightbox"),d(2),v("src",(e=a.resolvedAttachment())==null?null:e.url,vr),k("alt",R(4,5,"Attachment")+" "+R(5,7,((t=a.resolvedAttachment())==null?null:t.name)||"preview"))("data-testid","velt-attachment-preview-image")}}function kD(r,o){if(r&1&&(u(0),s(1,CD,6,9,"ng-container",2),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,fD,e.template,O(1,vC,e.componentConfigSignal,e.localUIStateSignal,e.resolvedAttachment(),e.attachmentIndex(),e.commentObj()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function xD(r,o){if(r&1&&s(0,kD,2,13,"ng-container",1),r&2){let n=l();v("veltIf",C(7,bD,n.conditionSignal(),O(1,vC,n.componentConfigSignal,n.localUIStateSignal,n.resolvedAttachment(),n.attachmentIndex(),n.commentObj())))}}var Ko=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-image-preview-internal",this.attachment=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return gr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsImagePreviewComponent ngOnInit:",e)}}setupA11yAttributes(){try{_D(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-image-preview-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[["lightboxRef",""],[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"src"],[3,"click","src"]],template:function(t,a){if(t&1&&y(0,xD,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,lf,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}img[_ngcontent-%COMP%]{width:100%;object-fit:cover}"],changeDetection:0});let r=o;return r})();function _D(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","img"),r.setAttribute("aria-label","Attachment image preview")}catch{}}var yD=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,commentObj:e,attachmentIndex:t}),wD=(r,o)=>({condition:r,data:o}),ID=(r,o,n,e,t,a)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,commentObj:e,commentIndex:t,attachmentIndex:a}),DD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-image-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function TD(r,o){if(r&1&&(b(0,"div",4),F(1,"translate"),E(2,"velt-comment-dialog-thread-card-attachments-image-download-internal",6)(3,"velt-comment-dialog-thread-card-attachments-image-delete-internal",7),x()),r&2){let n=l(5);k("aria-label",R(1,13,"Image attachment actions"))("data-testid",n.componentId+"-actions"),d(2),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)("attachment",n.resolvedAttachment())("commentObj",n.commentObj())("attachmentIndex",n.attachmentIndex()),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)("attachment",n.resolvedAttachment())("commentObj",n.resolvedComment())("commentIndex",n.resolvedCommentIndex())("attachmentIndex",n.attachmentIndex())}}function OD(r,o){if(r&1&&(b(0,"div",2),F(1,"translate"),y(2,TD,4,15,"div",4),E(3,"velt-comment-dialog-thread-card-attachments-image-preview-internal",5),x()),r&2){let n,e=l(3),t=l();k("aria-label",R(1,10,"Image attachment controls"))("data-testid",t.componentId),d(2),w(e.uiState!=null&&e.uiState.readOnly?-1:2),d(),v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("attachment",t.resolvedAttachment())("commentObj",t.commentObj())("attachmentIndex",t.attachmentIndex()),k("aria-label","Preview of image: "+(((n=t.resolvedAttachment())==null?null:n.name)||"unnamed image"))("data-testid",t.componentId+"-file-preview")}}function ED(r,o){r&1&&E(0,"velt-skeleton-loader-internal",3)}function MD(r,o){if(r&1&&(u(0),y(1,OD,4,12,"div",2)(2,ED,1,0,"velt-skeleton-loader-internal",3),p()),r&2){let n=l(3);d(),w(n.showLoadingTemplate()?2:1)}}function AD(r,o){if(r&1&&(u(0),s(1,MD,3,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(8,DD,e.template,yt(1,ID,e.componentConfigSignal,e.localUIStateSignal,e.resolvedAttachment(),e.commentObj(),e.commentIndex(),e.attachmentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function PD(r,o){if(r&1&&s(0,AD,2,14,"ng-container",0),r&2){let n=l();v("veltIf",C(7,wD,n.conditionSignal(),O(1,yD,n.componentConfigSignal,n.localUIStateSignal,n.resolvedAttachment(),n.commentObj(),n.attachmentIndex())))}}var Zo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-image-internal",this.domService=ge(Ne),this.attachment=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentIndex=Q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.attachmentIndex=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return gr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}}),this.showLoadingTemplate=L(()=>{try{let e=this.resolvedAttachment();return e?.isAttachmentResolverUsed===!0&&!e?.url}catch(e){return this.loggingService.catch("Error in showLoadingTemplate:",e),!1}}),this.resolvedComment=L(()=>{try{let e=this.commentObj();if(e)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return null;let a=this.getContextCommentId();if(a!=null){let i=t.find(c=>c?.commentId?.toString()===a.toString());if(i)return i}return t[0]}catch{return null}}),this.resolvedCommentIndex=L(()=>{try{let e=this.commentIndex();if(e!==void 0)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.resolvedComment()?.commentId;if(a!=null){let i=t.findIndex(c=>c?.commentId?.toString()===a.toString());if(i>=0)return i}return 0}catch{return}})}get imageWireframe(){return this._imageWireframe}set imageWireframe(e){this._imageWireframe=e,ye(this.imageWireframe)?this.template=null:this.template=this.domService.deepCloneElement(this.imageWireframe)}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsImageComponent ngOnInit:",e)}}setupA11yAttributes(){try{FD(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-image-internal"]],inputs:{imageWireframe:"imageWireframe",attachment:[1,"attachment"],commentObj:[1,"commentObj"],commentIndex:[1,"commentIndex"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["velt-ignore-change-detection","true","role","group",1,"comment-attachment","velt-comment-attachment--image"],["height","20px","width","200px","borderRadius","20px",1,"velt-thread-card--message"],["role","group",1,"comment-attachment-actions","velt-comment-attachment--image-actions"],["role","img",3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","attachmentIndex"],[3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","attachmentIndex"],[3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","commentIndex","attachmentIndex"]],template:function(t,a){if(t&1&&y(0,PD,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Yr,Jo,Yo,Ko,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-comment-attachment--image[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-sm);overflow:hidden;line-height:0;position:relative;max-width:400px}.velt-comment-attachment--image[_ngcontent-%COMP%] .velt-comment-attachment--image-actions[_ngcontent-%COMP%]{position:absolute;bottom:8px;right:8px;display:flex;opacity:0}.velt-comment-attachment--image[_ngcontent-%COMP%]:hover .velt-comment-attachment--image-actions[_ngcontent-%COMP%]{opacity:1}.velt-comment-attachment--image[_ngcontent-%COMP%]:not(:last-child){margin-bottom:var(--velt-spacing-lg)}"],changeDetection:0});let r=o;return r})();function FD(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","group")}catch{}}var cC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,attachmentIndex:e,attachment:t}),RD=(r,o)=>({condition:r,data:o}),UD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-delete-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function LD(r,o){if(r&1&&(u(0),b(1,"div",4),de(),b(2,"svg",5),E(3,"path",6),x()(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-icon")}}function BD(r,o){if(r&1){let n=Y();b(0,"button",2),F(1,"translate"),z("click",function(t){return B(n),l(3).onDeleteClick(),V(t.stopPropagation())}),s(2,LD,4,1,"ng-container",3),x()}if(r&2){let n=l(2),e=l();k("aria-label",R(1,3,"Delete attachment"))("data-testid",e.componentId),d(2),v("veltDynamicTemplate",O(11,UD,e.template,O(5,cC,e.componentConfigSignal,e.localUIStateSignal,e.commentObj(),e.attachmentIndex(),e.resolvedAttachment()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function VD(r,o){if(r&1&&(u(0),y(1,BD,3,17,"button",1),p()),r&2){let n=l(2);d(),w(n.shouldShowDeleteButton()?1:-1)}}function $D(r,o){if(r&1&&s(0,VD,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,RD,n.conditionSignal(),O(1,cC,n.componentConfigSignal,n.localUIStateSignal,n.commentObj(),n.attachmentIndex(),n.resolvedAttachment())))}}var Xo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-other-delete-internal",this.attachment=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentIndex=Q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.attachmentIndex=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return gr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}}),this.shouldShowDeleteButton=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal();if(!e)return!1;let t=e.uiState?.disabled,a=e.featureState?.isPlanExpired,i=e.appState?.user?.userId,c=this.resolveComment()?.from?.userId;return!t&&!a&&i===c}catch(e){return this.loggingService.catch("Error in shouldShowDeleteButton:",e),!1}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherDeleteComponent ngOnInit:",e)}}resolveComment(){try{let e=this.commentObj();if(e)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.getContextCommentId();if(a!=null){let i=t.find(c=>c?.commentId?.toString()===a.toString());if(i)return i}return t[0]}catch(e){this.loggingService.catch("Error in resolveComment:",e);return}}onDeleteClick(){try{let e=this.getAnnotationId();if(!e)return;let t=this.resolveCommentIndex();if(t===void 0)return;let a=this.attachmentIndex();this.actionService.deleteCommentAttachment(e,t,a)}catch(e){this.loggingService.catch("Error in onDeleteClick:",e)}}resolveCommentIndex(){try{let e=this.commentIndex();if(e!==void 0)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.getContextCommentId();if(a!=null){let i=t.findIndex(c=>c?.commentId?.toString()===a.toString());if(i>=0)return i}return 0}catch(e){this.loggingService.catch("Error in resolveCommentIndex:",e);return}}setupA11yAttributes(){try{jD(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-delete-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],commentIndex:[1,"commentIndex"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["type","button"],["type","button",3,"click"],[4,"veltDynamicTemplate"],[1,"attachment-icon-btn","velt-comment-attachment--action-btn"],["width","18","height","19","viewBox","0 0 18 19","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["d","M3 5.75H15M7.5 8.75V13.25M10.5 8.75V13.25M3.75 5.75L4.5 14.75C4.5 15.1478 4.65804 15.5294 4.93934 15.8107C5.22064 16.092 5.60218 16.25 6 16.25H12C12.3978 16.25 12.7794 16.092 13.0607 15.8107C13.342 15.5294 13.5 15.1478 13.5 14.75L14.25 5.75M6.75 5.75V3.5C6.75 3.30109 6.82902 3.11032 6.96967 2.96967C7.11032 2.82902 7.30109 2.75 7.5 2.75H10.5C10.6989 2.75 10.8897 2.82902 11.0303 2.96967C11.171 3.11032 11.25 3.30109 11.25 3.5V5.75","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,a){if(t&1&&y(0,$D,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);display:flex;align-items:center}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}button[_ngcontent-%COMP%]{background:transparent;border:0;display:flex;margin:0;padding:0}.velt-comment-attachment--action-btn[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-sm);cursor:pointer;align-items:center;color:var(--velt-error)}"],changeDetection:0});let r=o;return r})();function jD(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var mC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,attachmentIndex:e,attachment:t}),zD=(r,o)=>({condition:r,data:o}),HD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-download-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function WD(r,o){if(r&1&&(u(0),b(1,"div",3),de(),b(2,"svg",4),E(3,"path",5),x()(),p()),r&2){let n=l(3);d(),k("data-testid",n.componentId+"-icon")}}function JD(r,o){if(r&1){let n=Y();u(0),b(1,"button",1),F(2,"translate"),F(3,"translate"),z("click",function(t){return B(n),l(2).onDownloadClick(),V(t.stopPropagation())}),s(4,WD,4,1,"ng-container",2),x(),p()}if(r&2){let n=l(),e=l();d(),k("title",R(2,4,"Download attachment"))("aria-label",R(3,6,"Download attachment"))("data-testid",e.componentId),d(3),v("veltDynamicTemplate",O(14,HD,e.template,O(8,mC,e.componentConfigSignal,e.localUIStateSignal,e.commentObj(),e.attachmentIndex(),e.resolvedAttachment()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function YD(r,o){if(r&1&&s(0,JD,5,20,"ng-container",0),r&2){let n=l();v("veltIf",C(7,zD,n.conditionSignal(),O(1,mC,n.componentConfigSignal,n.localUIStateSignal,n.commentObj(),n.attachmentIndex(),n.resolvedAttachment())))}}var qo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-other-download-internal",this.attachment=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return gr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.resolvedAttachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherDownloadComponent ngOnInit:",e)}}onDownloadClick(){try{let e=this.getAnnotationId();if(!e)return;let t=this.resolvedAttachment();if(!t){this.loggingService.catch("Cannot download: No attachment found",new Error("Missing attachment"));return}this.actionService.downloadAttachment(e,t)}catch(e){this.loggingService.catch("Error in onDownloadClick:",e)}}setupA11yAttributes(){try{KD(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-download-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["type","button",3,"click"],[4,"veltDynamicTemplate"],[1,"attachment-icon-btn","velt-comment-attachment--action-btn"],["width","18","height","19","viewBox","0 0 18 19","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false"],["d","M3 13.25V14.75C3 15.1478 3.15804 15.5294 3.43934 15.8107C3.72064 16.092 4.10218 16.25 4.5 16.25H13.5C13.8978 16.25 14.2794 16.092 14.5607 15.8107C14.842 15.5294 15 15.1478 15 14.75V13.25M5.25 8.75L9 12.5M9 12.5L12.75 8.75M9 12.5V3.5","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,a){if(t&1&&y(0,YD,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);display:flex;align-items:center}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}button[_ngcontent-%COMP%]{background:transparent;border:0;display:flex;margin:0;padding:0}.velt-comment-attachment--action-btn[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-sm);cursor:pointer;align-items:center;color:var(--velt-accent)}"],changeDetection:0});let r=o;return r})();function KD(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var sC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,attachmentIndex:e,commentObj:t}),qD=(r,o)=>({condition:r,data:o}),QD=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-icon-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function e4(r,o){if(r&1&&(u(0),E(1,"velt-file-icon-internal",2),p()),r&2){let n,e=l(3);d(),v("type",(n=e.resolvedAttachment())==null?null:n.mimeType),k("data-testid",e.componentId)}}function t4(r,o){if(r&1&&(u(0),s(1,e4,2,2,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,QD,e.template,O(1,sC,e.componentConfigSignal,e.localUIStateSignal,e.attachment(),e.attachmentIndex(),e.commentObj()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function r4(r,o){if(r&1&&s(0,t4,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,qD,n.conditionSignal(),O(1,sC,n.componentConfigSignal,n.localUIStateSignal,n.attachment(),n.attachmentIndex(),n.commentObj())))}}var Qo=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-other-icon-internal",this.attachment=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return gr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.attachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherIconComponent ngOnInit:",e)}}setupA11yAttributes(){try{n4(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-icon-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"type"]],template:function(t,a){if(t&1&&y(0,r4,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Gg],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{display:flex;color:var(--velt-accent)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function n4(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var gC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,attachmentIndex:e,commentObj:t}),a4=(r,o)=>({condition:r,data:o}),i4=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-name-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function l4(r,o){if(r&1&&(u(0),b(1,"span",2),F(2,"translate"),ie(3),F(4,"translate"),x(),p()),r&2){let n,e,t=l(3);d(),k("data-testid",t.componentId)("aria-label","File name: "+R(2,3,((n=t.resolvedAttachment())==null?null:n.name)||"")),d(2),fe(" ",R(4,5,(e=t.resolvedAttachment())==null?null:e.name)," ")}}function d4(r,o){if(r&1&&(u(0),s(1,l4,5,7,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,i4,e.template,O(1,gC,e.componentConfigSignal,e.localUIStateSignal,e.attachment(),e.attachmentIndex(),e.commentObj()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function v4(r,o){if(r&1&&s(0,d4,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,a4,n.conditionSignal(),O(1,gC,n.componentConfigSignal,n.localUIStateSignal,n.attachment(),n.attachmentIndex(),n.commentObj())))}}var ea=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-other-name-internal",this.attachment=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return gr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.attachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherNameComponent ngOnInit:",e)}}setupA11yAttributes(){try{c4(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-name-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"attachment-name","velt-comment-attachment--name"]],template:function(t,a){if(t&1&&y(0,v4,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{line-height:normal}.velt-comment-attachment--name[_ngcontent-%COMP%]{overflow:hidden;color:var(--velt-text-3);text-overflow:ellipsis;font-size:var(--velt-font-size-xs);font-style:normal;font-weight:600;line-height:normal;white-space:nowrap}"],changeDetection:0});let r=o;return r})();function c4(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var uC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,attachmentIndex:e,commentObj:t}),g4=(r,o)=>({condition:r,data:o}),u4=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-size-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function p4(r,o){if(r&1&&(u(0),b(1,"span",2),F(2,"translate"),F(3,"fileSize"),ie(4),F(5,"fileSize"),x(),p()),r&2){let n,e,t=l(3);d(),k("data-testid",t.componentId)("aria-label",R(2,3,"File size:")+" "+R(3,5,(n=t.resolvedAttachment())==null?null:n.size)),d(3),fe(" ",R(5,7,(e=t.resolvedAttachment())==null?null:e.size)," ")}}function h4(r,o){if(r&1&&(u(0),s(1,p4,6,9,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,u4,e.template,O(1,uC,e.componentConfigSignal,e.localUIStateSignal,e.attachment(),e.attachmentIndex(),e.commentObj()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function b4(r,o){if(r&1&&s(0,h4,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,g4,n.conditionSignal(),O(1,uC,n.componentConfigSignal,n.localUIStateSignal,n.attachment(),n.attachmentIndex(),n.commentObj())))}}var ta=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-attachments-other-size-internal",this.attachment=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.attachmentIndex=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return gr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch(e){return this.loggingService.catch("Error in resolvedAttachment:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.attachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherSizeComponent ngOnInit:",e)}}setupA11yAttributes(){try{f4(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-size-internal"]],inputs:{attachment:[1,"attachment"],commentObj:[1,"commentObj"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"attachment-size","velt-comment-attachment--size"]],template:function(t,a){if(t&1&&y(0,b4,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W,Wg],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[_nghost-%COMP%]{line-height:normal}.velt-comment-attachment--size[_ngcontent-%COMP%]{overflow:hidden;color:var(--velt-text-7);text-overflow:ellipsis;font-size:var(--velt-font-size-2xs);font-style:normal;font-weight:500;line-height:normal}"],changeDetection:0});let r=o;return r})();function f4(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var k4=(r,o,n,e,t,a)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,attachmentIndex:e,commentObj:t,commentIndex:a}),x4=(r,o)=>({condition:r,data:o}),_4=(r,o,n,e,t,a)=>({componentConfigSignal:r,parentLocalUIState:o,attachment:n,commentObj:e,commentIndex:t,attachmentIndex:a}),S4=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-other-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function y4(r,o){if(r&1&&(b(0,"div",7),F(1,"translate"),F(2,"translate"),E(3,"velt-comment-dialog-thread-card-attachments-other-download-internal",8),F(4,"translate"),F(5,"translate"),E(6,"velt-comment-dialog-thread-card-attachments-other-delete-internal",9),F(7,"translate"),F(8,"translate"),x()),r&2){let n,e,t,a=l(5);k("aria-label",R(1,17,"Actions for file:")+" "+R(2,19,((n=a.resolvedAttachment())==null?null:n.name)||"unnamed file"))("data-testid",a.componentId+"-attachment-actions"),d(3),v("componentConfigSignal",a.componentConfigSignal)("parentLocalUIState",a.localUIStateSignal)("attachment",a.resolvedAttachment())("commentObj",a.commentObj())("attachmentIndex",a.attachmentIndex()),k("aria-label",R(4,21,"Download file:")+" "+R(5,23,((e=a.resolvedAttachment())==null?null:e.name)||"unnamed file"))("data-testid",a.componentId+"-download-attachment"),d(3),v("componentConfigSignal",a.componentConfigSignal)("parentLocalUIState",a.localUIStateSignal)("attachment",a.resolvedAttachment())("commentObj",a.resolvedComment())("commentIndex",a.resolvedCommentIndex())("attachmentIndex",a.attachmentIndex()),k("aria-label",R(7,25,"Remove file:")+" "+R(8,27,((t=a.resolvedAttachment())==null?null:t.name)||"unnamed file"))("data-testid",a.componentId+"-delete-attachment")}}function w4(r,o){if(r&1&&(b(0,"div",2),F(1,"translate"),F(2,"translate"),b(3,"div",4),F(4,"translate"),F(5,"translate"),E(6,"velt-comment-dialog-thread-card-attachments-other-icon-internal",5),x(),b(7,"div",6),F(8,"translate"),F(9,"translate"),E(10,"velt-comment-dialog-thread-card-attachments-other-name-internal",5),F(11,"translate"),F(12,"translate"),E(13,"velt-comment-dialog-thread-card-attachments-other-size-internal",5),F(14,"translate"),F(15,"translate"),x(),y(16,y4,9,29,"div",7),x()),r&2){let n,e,t,a,i,c=l(3),m=l();k("aria-label",R(1,26,"File attachment:")+" "+R(2,28,((n=m.resolvedAttachment())==null?null:n.name)||"unnamed file"))("data-testid",m.componentId+"-attachment"),d(3),k("aria-label",R(4,30,"File type icon for")+" "+R(5,32,((e=m.resolvedAttachment())==null?null:e.name)||"unnamed file"))("data-testid",m.componentId+"-attachment-icon"),d(3),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("attachment",m.resolvedAttachment())("commentObj",m.commentObj())("attachmentIndex",m.attachmentIndex()),d(),k("aria-label",R(8,34,"Details for file:")+" "+R(9,36,((t=m.resolvedAttachment())==null?null:t.name)||"unnamed file"))("data-testid",m.componentId+"-attachment-details"),d(3),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("attachment",m.resolvedAttachment())("commentObj",m.commentObj())("attachmentIndex",m.attachmentIndex()),k("aria-label",R(11,38,"Filename:")+" "+R(12,40,((a=m.resolvedAttachment())==null?null:a.name)||"unnamed file"))("data-testid",m.componentId+"-attachment-name"),d(3),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("attachment",m.resolvedAttachment())("commentObj",m.commentObj())("attachmentIndex",m.attachmentIndex()),k("aria-label",R(14,42,"File size:")+" "+R(15,44,((i=m.resolvedAttachment())==null?null:i.size)||"unknown size"))("data-testid",m.componentId+"-attachment-size"),d(3),w(c.uiState!=null&&c.uiState.readOnly?-1:16)}}function I4(r,o){r&1&&E(0,"velt-skeleton-loader-internal",3)}function D4(r,o){if(r&1&&(u(0),y(1,w4,17,46,"div",2)(2,I4,1,0,"velt-skeleton-loader-internal",3),p()),r&2){let n=l(3);d(),w(n.showLoadingTemplate()?2:1)}}function T4(r,o){if(r&1&&(u(0),s(1,D4,3,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(8,S4,e.template,yt(1,_4,e.componentConfigSignal,e.localUIStateSignal,e.resolvedAttachment(),e.commentObj(),e.commentIndex(),e.attachmentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function O4(r,o){if(r&1&&s(0,T4,2,14,"ng-container",0),r&2){let n=l();v("veltIf",C(8,x4,n.conditionSignal(),yt(1,k4,n.componentConfigSignal,n.localUIStateSignal,n.resolvedAttachment(),n.attachmentIndex(),n.commentObj(),n.commentIndex())))}}var ra=(()=>{let o=class o extends te{get otherWireframe(){return this._otherWireframe}set otherWireframe(e){this._otherWireframe=e,ye(this.otherWireframe)?this.template=null:this.template=this.domService.deepCloneElement(this.otherWireframe)}constructor(){super(),this.componentId="velt-comment-dialog-thread-card-attachments-other-internal",this.domService=ge(Ne),this.attachment=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentIndex=Q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.attachmentIndex=Q(0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?0:t}return e}catch{return 0}}}),this.resolvedAttachment=L(()=>{try{return gr({attachment:this.attachment(),commentObj:this.commentObj(),attachmentIndex:this.attachmentIndex(),config:this.componentConfigSignal(),contextAttachmentId:this.getContextValue("attachment-id"),contextCommentId:this.getContextCommentId()})}catch{return null}}),this.showLoadingTemplate=L(()=>{try{let e=this.resolvedAttachment();return e?.isAttachmentResolverUsed===!0&&!e?.url}catch{return!1}}),this.resolvedComment=L(()=>{try{let e=this.commentObj();if(e)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return null;let a=this.getContextCommentId();if(a!=null){let i=t.find(c=>c?.commentId?.toString()===a.toString());if(i)return i}return t[0]}catch{return null}}),this.resolvedCommentIndex=L(()=>{try{let e=this.commentIndex();if(e!==void 0)return e;let t=this.componentConfigSignal()?.data?.annotation?.comments;if(!Array.isArray(t)||t.length===0)return;let a=this.resolvedComment()?.commentId;if(a!=null){let i=t.findIndex(c=>c?.commentId?.toString()===a.toString());if(i>=0)return i}return 0}catch{return}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,attachmentIndex:this.attachmentIndex(),attachment:this.attachment(),commentObj:this.commentObj()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsOtherComponent ngOnInit:",e)}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-other-internal"]],inputs:{otherWireframe:"otherWireframe",attachment:[1,"attachment"],commentObj:[1,"commentObj"],commentIndex:[1,"commentIndex"],attachmentIndex:[1,"attachmentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","region",1,"comment-pdf-attachment","velt-comment-attachment"],["height","20px","width","200px","borderRadius","20px",1,"velt-thread-card--message"],["role","img",1,"attachment-icon","velt-comment-attachment--icon"],[3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","attachmentIndex"],["role","group",1,"attachment-details","velt-comment-attachment--details"],["role","group",1,"attachment-actions","velt-comment-attachment--actions"],["role","button","tabindex","0",3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","attachmentIndex"],["role","button","tabindex","0",3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","commentIndex","attachmentIndex"]],template:function(t,a){if(t&1&&y(0,O4,1,11,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Yr,Xo,qo,Qo,ea,ta,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);width:100%}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-comment-attachment[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-sm) var(--velt-spacing-xs) var(--velt-spacing-sm) var(--velt-spacing-md);justify-content:space-between;gap:var(--velt-spacing-sm);align-items:center;align-self:stretch;width:100%;border-radius:var(--velt-border-radius-sm);border:1px solid var(--velt-border-4);box-sizing:border-box}.velt-comment-attachment[_ngcontent-%COMP%] .velt-comment-attachment--icon[_ngcontent-%COMP%]{display:flex}.velt-comment-attachment[_ngcontent-%COMP%] .velt-comment-attachment--details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-xs);flex:1;overflow:hidden}.velt-comment-attachment[_ngcontent-%COMP%] .velt-comment-attachment--actions[_ngcontent-%COMP%]{display:flex;width:0;overflow:hidden}.velt-comment-attachment[_ngcontent-%COMP%]:not(:last-child){margin-bottom:var(--velt-spacing-lg)}.velt-comment-attachment[_ngcontent-%COMP%]:hover .velt-comment-attachment--actions[_ngcontent-%COMP%]{width:auto}"],changeDetection:0});let r=o;return r})();var pC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,commentIndex:e,i:t}),M4=(r,o)=>({condition:r,data:o}),A4=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-attachments-wireframe",variant:n,setIfCondition:e,componentElementRef:t,replaceTemplate:!1}),P4=(r,o)=>o==null?null:o.attachmentId;function F4(r,o){if(r&1&&E(0,"velt-comment-dialog-thread-card-attachments-image-internal",3),r&2){let n=l(),e=n.$implicit,t=n.$index,a=l(5);v("componentConfigSignal",a.componentConfigSignal)("parentLocalUIState",a.localUIStateSignal)("attachment",e)("commentObj",a.resolvedComment())("commentIndex",a.commentIndex())("attachmentIndex",t)("imageWireframe",a.imageWireframe)}}function N4(r,o){if(r&1&&E(0,"velt-comment-dialog-thread-card-attachments-other-internal",4),r&2){let n=l(),e=n.$implicit,t=n.$index,a=l(5);v("componentConfigSignal",a.componentConfigSignal)("parentLocalUIState",a.localUIStateSignal)("attachment",e)("commentObj",a.resolvedComment())("commentIndex",a.commentIndex())("attachmentIndex",t)("otherWireframe",a.otherWireframe)}}function R4(r,o){if(r&1&&y(0,F4,1,7,"velt-comment-dialog-thread-card-attachments-image-internal",3)(1,N4,1,7,"velt-comment-dialog-thread-card-attachments-other-internal",4),r&2){let n=o.$implicit,e=l(5);w(e.isImageAttachment(n)?0:1)}}function U4(r,o){if(r&1&&(b(0,"div",2),F(1,"translate"),et(2,R4,2,1,null,null,P4),x()),r&2){let n=l(4);k("data-testid",n.componentId)("aria-label",R(1,2,"Attachments")+"("+n.resolvedAttachments().length+")"),d(2),tt(n.resolvedAttachments())}}function L4(r,o){if(r&1&&(u(0),y(1,U4,4,4,"div",2),p()),r&2){let n=l(3);d(),w(n.resolvedAttachments().length?1:-1)}}function B4(r,o){if(r&1&&(u(0),s(1,L4,2,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,A4,e.template,O(1,pC,e.componentConfigSignal,e.localUIStateSignal,e.resolvedComment(),e.commentIndex(),e.commentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function V4(r,o){if(r&1&&s(0,B4,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,M4,n.conditionSignal(),O(1,pC,n.componentConfigSignal,n.localUIStateSignal,n.resolvedComment(),n.commentIndex(),n.commentIndex())))}}var na=(()=>{let o=class o extends te{constructor(){super(),this.componentId="velt-comment-dialog-thread-card-attachments-internal",this.domService=ge(Ne),this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentId=Q(""),this.attachmentId=Q(""),this.commentIndex=Q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.resolvedComment=L(()=>{try{let e=this.commentObj();if(e)return e;let a=this.componentConfigSignal()?.data?.annotation?.comments,i=this.commentId();if(i&&a&&Array.isArray(a)){let h=a.find(_=>_.commentId?.toString()===i);if(h)return h}let c=this.getContextCommentId();if(c!==void 0&&a&&Array.isArray(a)){let h=a.find(_=>_?.commentId===c);if(h)return h}let m=this.commentIndex();return a&&Array.isArray(a)&&m!==void 0&&m>=0?a[m]:null}catch(e){return this.loggingService.catch("Error in resolvedComment:",e),null}}),this.resolvedAttachments=L(()=>{try{let e=this.resolvedComment(),t=this.attachmentId();return!e?.attachments||!Array.isArray(e.attachments)?[]:t?e.attachments.filter(i=>i.attachmentId?.toString()===t):e.attachments}catch(e){return this.loggingService.catch("Error in resolvedAttachments:",e),[]}})}ngOnInit(){try{if(super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,commentObj:this.commentObj(),i:this.commentIndex()}),!this.imageWireframe){let e=this.template?.querySelector("velt-comment-dialog-thread-card-attachments-image-wireframe");ye(e)||(this.imageWireframe=e)}if(!this.otherWireframe){let e=this.template?.querySelector("velt-comment-dialog-thread-card-attachments-other-wireframe");ye(e)||(this.otherWireframe=e)}}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAttachmentsComponent ngOnInit:",e)}}isImageAttachment(e){try{return e?.mimeType?.includes("image")||!1}catch{return!1}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-attachments-internal"]],inputs:{commentObj:[1,"commentObj"],commentId:[1,"commentId"],attachmentId:[1,"attachmentId"],commentIndex:[1,"commentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["velt-ignore-change-detection","true","role","region",1,"comment-attachments","velt-comment-attachments"],[3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","commentIndex","attachmentIndex","imageWireframe"],[3,"componentConfigSignal","parentLocalUIState","attachment","commentObj","commentIndex","attachmentIndex","otherWireframe"]],template:function(t,a){if(t&1&&y(0,V4,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Zo,ra,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-comment-attachments[_ngcontent-%COMP%]{gap:var(--velt-spacing-sm);display:flex;flex-direction:column}.velt-comment-attachments[_ngcontent-%COMP%]:not(:empty){margin:var(--velt-spacing-lg) 0 var(--velt-spacing-sm);padding-left:calc((3rem + 0px) * var(--velt-base-rem-unit))}"],changeDetection:0});let r=o;return r})();var hC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,commentIndex:e,i:t}),j4=(r,o)=>({condition:r,data:o}),G4=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-avatar-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function z4(r,o){if(r&1&&(E(0,"snippyly-user-avatar",2),F(1,"translate"),F(2,"translate")),r&2){let n,e,t=l(4);v("size",32)("user",(n=t.comment())==null?null:n.from),k("data-testid",t.componentId)("aria-label",R(1,4,"Avatar for")+" "+R(2,6,((e=t.comment())==null||e.from==null?null:e.from.name)||((e=t.comment())==null||e.from==null?null:e.from.email)||"user"))}}function H4(r,o){if(r&1&&(u(0),y(1,z4,3,8,"snippyly-user-avatar",2),p()),r&2){let n=l(3);d(),w(n.comment()?1:-1)}}function W4(r,o){if(r&1&&(u(0),s(1,H4,2,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,G4,e.template,O(1,hC,e.componentConfigSignal,e.localUIStateSignal,e.comment(),e.commentIndex(),e.commentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function J4(r,o){if(r&1&&s(0,W4,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,j4,n.conditionSignal(),O(1,hC,n.componentConfigSignal,n.localUIStateSignal,n.comment(),n.commentIndex(),n.commentIndex())))}}var oa=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-avatar-internal",this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentId=Q(void 0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.commentIndex=Q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.comment=L(()=>{try{let e=this.commentObj();if(e)return e;let a=this.componentConfigSignal()?.data?.annotation?.comments,i=this.commentId();if(i!==void 0&&a&&Array.isArray(a)){let h=a.find(_=>_?.commentId===i);if(h)return h}let c=this.getContextCommentId();if(c!==void 0&&a&&Array.isArray(a)){let h=a.find(_=>_?.commentId===c);if(h)return h}let m=this.commentIndex();return m!==void 0&&a&&Array.isArray(a)?a[m]:null}catch(e){return this.loggingService.catch("Error in comment computed:",e),null}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,commentObj:this.comment(),i:this.commentIndex()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardAvatarComponent ngOnInit:",e)}}setupA11yAttributes(){try{Y4(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-avatar-internal"]],inputs:{commentObj:[1,"commentObj"],commentId:[1,"commentId"],commentIndex:[1,"commentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"comment-dialog-user-avatar",3,"size","user"]],template:function(t,a){if(t&1&&y(0,J4,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Lt,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function Y4(r,o){try{r.setAttribute("role","presentation"),r.setAttribute("data-testid",o+"-container")}catch{}}function Z4(r,o){if(r&1&&(b(0,"div",1),de(),b(1,"svg",2)(2,"g"),E(3,"path",3),x(),E(4,"path",4),x()()),r&2){let n=l();k("data-testid",n.componentId+"-mobile")}}function X4(r,o){if(r&1&&(b(0,"div",1),de(),b(1,"svg",5)(2,"g"),E(3,"path",3)(4,"path",6),x(),E(5,"path",7),x()()),r&2){let n=l();k("data-testid",n.componentId+"-tablet")}}function q4(r,o){if(r&1&&(b(0,"div",1),de(),b(1,"svg",8),E(2,"path",9)(3,"path",10)(4,"path",11),x()()),r&2){let n=l();k("data-testid",n.componentId+"-desktop")}}function Q4(r,o){if(r&1&&(b(0,"div",1),de(),b(1,"svg",12),E(2,"path",13)(3,"path",14)(4,"path",15),x()()),r&2){let n=l();k("data-testid",n.componentId+"-monitor")}}var Cp=(()=>{let o=class o{constructor(e,t){this.elementRef=e,this.loggingService=t,this.deviceType="",this.componentId="velt-device-type-icons"}ngOnInit(){try{this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in DeviceTypeIconsComponent ngOnInit:",e)}}setupA11yAttributes(){try{eT(this.elementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in DeviceTypeIconsComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(G(me),G(A))},o.\u0275cmp=T({type:o,selectors:[["app-device-type-icons"]],inputs:{deviceType:"deviceType"},standalone:!1,decls:5,vars:3,consts:[["role","status",1,"devide-type-container","velt-device-type-icons"],[1,"s-flex","velt-device-type-icons--flex"],["width","53","height","17","viewBox","0 0 53 17","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img",1,"skip-reset"],["fill-rule","evenodd","clip-rule","evenodd","d","M8.5 3.5H3.5C3.22386 3.5 3 3.72386 3 4V13C3 13.2761 3.22386 13.5 3.5 13.5H8.5C8.77614 13.5 9 13.2761 9 13V4C9 3.72386 8.77614 3.5 8.5 3.5ZM3.5 2.5C2.67157 2.5 2 3.17157 2 4V13C2 13.8284 2.67157 14.5 3.5 14.5H8.5C9.32843 14.5 10 13.8284 10 13V4C10 3.17157 9.32843 2.5 8.5 2.5H3.5Z","fill","currentColor"],["d","M24.624 4.388V12H23.623V6.324L21.093 12H20.389L17.848 6.313V12H16.847V4.388H17.925L20.741 10.68L23.557 4.388H24.624ZM29.0606 12.099C28.4959 12.099 27.9826 11.9707 27.5206 11.714C27.0659 11.4573 26.7066 11.0943 26.4426 10.625C26.1859 10.1483 26.0576 9.59833 26.0576 8.975C26.0576 8.359 26.1896 7.81633 26.4536 7.347C26.7249 6.87033 27.0916 6.50733 27.5536 6.258C28.0156 6.00133 28.5326 5.873 29.1046 5.873C29.6766 5.873 30.1936 6.00133 30.6556 6.258C31.1176 6.50733 31.4806 6.86667 31.7446 7.336C32.0159 7.80533 32.1516 8.35167 32.1516 8.975C32.1516 9.59833 32.0123 10.1483 31.7336 10.625C31.4623 11.0943 31.0919 11.4573 30.6226 11.714C30.1533 11.9707 29.6326 12.099 29.0606 12.099ZM29.0606 11.219C29.4199 11.219 29.7573 11.1347 30.0726 10.966C30.3879 10.7973 30.6409 10.5443 30.8316 10.207C31.0296 9.86967 31.1286 9.459 31.1286 8.975C31.1286 8.491 31.0333 8.08033 30.8426 7.743C30.6519 7.40567 30.4026 7.15633 30.0946 6.995C29.7866 6.82633 29.4529 6.742 29.0936 6.742C28.7269 6.742 28.3896 6.82633 28.0816 6.995C27.7809 7.15633 27.5389 7.40567 27.3556 7.743C27.1723 8.08033 27.0806 8.491 27.0806 8.975C27.0806 9.46633 27.1686 9.88067 27.3446 10.218C27.5279 10.5553 27.7699 10.8083 28.0706 10.977C28.3713 11.1383 28.7013 11.219 29.0606 11.219ZM34.5787 7.094C34.7841 6.73467 35.0847 6.44133 35.4807 6.214C35.8767 5.98667 36.3277 5.873 36.8337 5.873C37.3764 5.873 37.8641 6.00133 38.2967 6.258C38.7294 6.51467 39.0704 6.87767 39.3197 7.347C39.5691 7.809 39.6937 8.348 39.6937 8.964C39.6937 9.57267 39.5691 10.1153 39.3197 10.592C39.0704 11.0687 38.7257 11.439 38.2857 11.703C37.8531 11.967 37.3691 12.099 36.8337 12.099C36.3131 12.099 35.8547 11.9853 35.4587 11.758C35.0701 11.5307 34.7767 11.241 34.5787 10.889V12H33.5777V3.86H34.5787V7.094ZM38.6707 8.964C38.6707 8.50933 38.5791 8.11333 38.3957 7.776C38.2124 7.43867 37.9631 7.182 37.6477 7.006C37.3397 6.83 36.9987 6.742 36.6247 6.742C36.2581 6.742 35.9171 6.83367 35.6017 7.017C35.2937 7.193 35.0444 7.45333 34.8537 7.798C34.6704 8.13533 34.5787 8.52767 34.5787 8.975C34.5787 9.42967 34.6704 9.82933 34.8537 10.174C35.0444 10.5113 35.2937 10.7717 35.6017 10.955C35.9171 11.131 36.2581 11.219 36.6247 11.219C36.9987 11.219 37.3397 11.131 37.6477 10.955C37.9631 10.7717 38.2124 10.5113 38.3957 10.174C38.5791 9.82933 38.6707 9.426 38.6707 8.964ZM41.6383 4.993C41.4477 4.993 41.2863 4.927 41.1543 4.795C41.0223 4.663 40.9563 4.50167 40.9563 4.311C40.9563 4.12033 41.0223 3.959 41.1543 3.827C41.2863 3.695 41.4477 3.629 41.6383 3.629C41.8217 3.629 41.9757 3.695 42.1003 3.827C42.2323 3.959 42.2983 4.12033 42.2983 4.311C42.2983 4.50167 42.2323 4.663 42.1003 4.795C41.9757 4.927 41.8217 4.993 41.6383 4.993ZM42.1223 5.972V12H41.1213V5.972H42.1223ZM44.9394 3.86V12H43.9384V3.86H44.9394ZM52.2554 8.755C52.2554 8.94567 52.2444 9.14733 52.2224 9.36H47.4044C47.4411 9.954 47.6427 10.4197 48.0094 10.757C48.3834 11.087 48.8344 11.252 49.3624 11.252C49.7951 11.252 50.1544 11.153 50.4404 10.955C50.7337 10.7497 50.9391 10.4783 51.0564 10.141H52.1344C51.9731 10.7203 51.6504 11.1933 51.1664 11.56C50.6824 11.9193 50.0811 12.099 49.3624 12.099C48.7904 12.099 48.2771 11.9707 47.8224 11.714C47.3751 11.4573 47.0231 11.0943 46.7664 10.625C46.5097 10.1483 46.3814 9.59833 46.3814 8.975C46.3814 8.35167 46.5061 7.80533 46.7554 7.336C47.0047 6.86667 47.3531 6.50733 47.8004 6.258C48.2551 6.00133 48.7757 5.873 49.3624 5.873C49.9344 5.873 50.4404 5.99767 50.8804 6.247C51.3204 6.49633 51.6577 6.841 51.8924 7.281C52.1344 7.71367 52.2554 8.205 52.2554 8.755ZM51.2214 8.546C51.2214 8.16467 51.1371 7.83833 50.9684 7.567C50.7997 7.28833 50.5687 7.07933 50.2754 6.94C49.9894 6.79333 49.6704 6.72 49.3184 6.72C48.8124 6.72 48.3797 6.88133 48.0204 7.204C47.6684 7.52667 47.4667 7.974 47.4154 8.546H51.2214Z","fill","currentColor"],["width","51","height","17","viewBox","0 0 51 17","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M6.5 12C6.5 12.2761 6.27614 12.5 6 12.5C5.72386 12.5 5.5 12.2761 5.5 12C5.5 11.7239 5.72386 11.5 6 11.5C6.27614 11.5 6.5 11.7239 6.5 12Z","fill","currentColor"],["d","M21.566 4.333V5.147H19.476V12H18.475V5.147H16.374V4.333H21.566ZM22.5342 8.964C22.5342 8.348 22.6588 7.809 22.9082 7.347C23.1575 6.87767 23.4985 6.51467 23.9312 6.258C24.3712 6.00133 24.8588 5.873 25.3942 5.873C25.9222 5.873 26.3805 5.98667 26.7692 6.214C27.1578 6.44133 27.4475 6.72733 27.6382 7.072V5.972H28.6502V12H27.6382V10.878C27.4402 11.23 27.1432 11.5233 26.7472 11.758C26.3585 11.9853 25.9038 12.099 25.3832 12.099C24.8478 12.099 24.3638 11.967 23.9312 11.703C23.4985 11.439 23.1575 11.0687 22.9082 10.592C22.6588 10.1153 22.5342 9.57267 22.5342 8.964ZM27.6382 8.975C27.6382 8.52033 27.5465 8.12433 27.3632 7.787C27.1798 7.44967 26.9305 7.193 26.6152 7.017C26.3072 6.83367 25.9662 6.742 25.5922 6.742C25.2182 6.742 24.8772 6.83 24.5692 7.006C24.2612 7.182 24.0155 7.43867 23.8322 7.776C23.6488 8.11333 23.5572 8.50933 23.5572 8.964C23.5572 9.426 23.6488 9.82933 23.8322 10.174C24.0155 10.5113 24.2612 10.7717 24.5692 10.955C24.8772 11.131 25.2182 11.219 25.5922 11.219C25.9662 11.219 26.3072 11.131 26.6152 10.955C26.9305 10.7717 27.1798 10.5113 27.3632 10.174C27.5465 9.82933 27.6382 9.42967 27.6382 8.975ZM31.4528 7.094C31.6581 6.73467 31.9588 6.44133 32.3548 6.214C32.7508 5.98667 33.2018 5.873 33.7078 5.873C34.2504 5.873 34.7381 6.00133 35.1708 6.258C35.6034 6.51467 35.9444 6.87767 36.1938 7.347C36.4431 7.809 36.5678 8.348 36.5678 8.964C36.5678 9.57267 36.4431 10.1153 36.1938 10.592C35.9444 11.0687 35.5998 11.439 35.1598 11.703C34.7271 11.967 34.2431 12.099 33.7078 12.099C33.1871 12.099 32.7288 11.9853 32.3328 11.758C31.9441 11.5307 31.6508 11.241 31.4528 10.889V12H30.4518V3.86H31.4528V7.094ZM35.5448 8.964C35.5448 8.50933 35.4531 8.11333 35.2698 7.776C35.0864 7.43867 34.8371 7.182 34.5218 7.006C34.2138 6.83 33.8728 6.742 33.4988 6.742C33.1321 6.742 32.7911 6.83367 32.4758 7.017C32.1678 7.193 31.9184 7.45333 31.7278 7.798C31.5444 8.13533 31.4528 8.52767 31.4528 8.975C31.4528 9.42967 31.5444 9.82933 31.7278 10.174C31.9184 10.5113 32.1678 10.7717 32.4758 10.955C32.7911 11.131 33.1321 11.219 33.4988 11.219C33.8728 11.219 34.2138 11.131 34.5218 10.955C34.8371 10.7717 35.0864 10.5113 35.2698 10.174C35.4531 9.82933 35.5448 9.426 35.5448 8.964ZM38.9964 3.86V12H37.9954V3.86H38.9964ZM46.3124 8.755C46.3124 8.94567 46.3014 9.14733 46.2794 9.36H41.4614C41.4981 9.954 41.6997 10.4197 42.0664 10.757C42.4404 11.087 42.8914 11.252 43.4194 11.252C43.8521 11.252 44.2114 11.153 44.4974 10.955C44.7907 10.7497 44.9961 10.4783 45.1134 10.141H46.1914C46.0301 10.7203 45.7074 11.1933 45.2234 11.56C44.7394 11.9193 44.1381 12.099 43.4194 12.099C42.8474 12.099 42.3341 11.9707 41.8794 11.714C41.4321 11.4573 41.0801 11.0943 40.8234 10.625C40.5667 10.1483 40.4384 9.59833 40.4384 8.975C40.4384 8.35167 40.5631 7.80533 40.8124 7.336C41.0617 6.86667 41.4101 6.50733 41.8574 6.258C42.3121 6.00133 42.8327 5.873 43.4194 5.873C43.9914 5.873 44.4974 5.99767 44.9374 6.247C45.3774 6.49633 45.7147 6.841 45.9494 7.281C46.1914 7.71367 46.3124 8.205 46.3124 8.755ZM45.2784 8.546C45.2784 8.16467 45.1941 7.83833 45.0254 7.567C44.8567 7.28833 44.6257 7.07933 44.3324 6.94C44.0464 6.79333 43.7274 6.72 43.3754 6.72C42.8694 6.72 42.4367 6.88133 42.0774 7.204C41.7254 7.52667 41.5237 7.974 41.4724 8.546H45.2784ZM48.9647 6.797V10.35C48.9647 10.6433 49.027 10.8523 49.1517 10.977C49.2763 11.0943 49.4927 11.153 49.8007 11.153H50.5377V12H49.6357C49.0783 12 48.6603 11.8717 48.3817 11.615C48.103 11.3583 47.9637 10.9367 47.9637 10.35V6.797H47.1827V5.972H47.9637V4.454H48.9647V5.972H50.5377V6.797H48.9647Z","fill","currentColor"],["width","62","height","17","viewBox","0 0 62 17","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["fill-rule","evenodd","clip-rule","evenodd","d","M2.5 5.5L2.5 10L9.5 10L9.5 5.5C9.5 5.22386 9.27614 5 9 5L3 5C2.72386 5 2.5 5.22386 2.5 5.5ZM1.5 11L10.5 11L10.5 5.5C10.5 4.67157 9.82843 4 9 4L3 4C2.17157 4 1.5 4.67157 1.5 5.5L1.5 11Z","fill","currentColor"],["fill-rule","evenodd","clip-rule","evenodd","d","M1.5 11L1.5 11.5C1.5 11.7761 1.72386 12 2 12L10 12C10.2761 12 10.5 11.7761 10.5 11.5L10.5 11L1.5 11ZM0.5 11.5C0.5 12.3284 1.17157 13 2 13L10 13C10.8284 13 11.5 12.3284 11.5 11.5L11.5 10.5C11.5 10.2239 11.2761 10 11 10L1 10C0.723858 10 0.5 10.2239 0.5 10.5L0.5 11.5Z","fill","currentColor"],["d","M19.234 4.333C20.07 4.333 20.7923 4.49067 21.401 4.806C22.017 5.114 22.4863 5.55767 22.809 6.137C23.139 6.71633 23.304 7.39833 23.304 8.183C23.304 8.96767 23.139 9.64967 22.809 10.229C22.4863 10.801 22.017 11.241 21.401 11.549C20.7923 11.8497 20.07 12 19.234 12H16.847V4.333H19.234ZM19.234 11.175C20.224 11.175 20.9793 10.9147 21.5 10.394C22.0207 9.866 22.281 9.129 22.281 8.183C22.281 7.22967 22.017 6.48533 21.489 5.95C20.9683 5.41467 20.2167 5.147 19.234 5.147H17.848V11.175H19.234ZM30.2343 8.755C30.2343 8.94567 30.2233 9.14733 30.2013 9.36H25.3833C25.42 9.954 25.6217 10.4197 25.9883 10.757C26.3623 11.087 26.8133 11.252 27.3413 11.252C27.774 11.252 28.1333 11.153 28.4193 10.955C28.7127 10.7497 28.918 10.4783 29.0353 10.141H30.1133C29.952 10.7203 29.6293 11.1933 29.1453 11.56C28.6613 11.9193 28.06 12.099 27.3413 12.099C26.7693 12.099 26.256 11.9707 25.8013 11.714C25.354 11.4573 25.002 11.0943 24.7453 10.625C24.4887 10.1483 24.3603 9.59833 24.3603 8.975C24.3603 8.35167 24.485 7.80533 24.7343 7.336C24.9837 6.86667 25.332 6.50733 25.7793 6.258C26.234 6.00133 26.7547 5.873 27.3413 5.873C27.9133 5.873 28.4193 5.99767 28.8593 6.247C29.2993 6.49633 29.6367 6.841 29.8713 7.281C30.1133 7.71367 30.2343 8.205 30.2343 8.755ZM29.2003 8.546C29.2003 8.16467 29.116 7.83833 28.9473 7.567C28.7787 7.28833 28.5477 7.07933 28.2543 6.94C27.9683 6.79333 27.6493 6.72 27.2973 6.72C26.7913 6.72 26.3587 6.88133 25.9993 7.204C25.6473 7.52667 25.4457 7.974 25.3943 8.546H29.2003ZM33.7996 12.099C33.3376 12.099 32.9233 12.022 32.5566 11.868C32.19 11.7067 31.9003 11.4867 31.6876 11.208C31.475 10.922 31.3576 10.5957 31.3356 10.229H32.3696C32.399 10.5297 32.5383 10.7753 32.7876 10.966C33.0443 11.1567 33.378 11.252 33.7886 11.252C34.17 11.252 34.4706 11.1677 34.6906 10.999C34.9106 10.8303 35.0206 10.6177 35.0206 10.361C35.0206 10.097 34.9033 9.90267 34.6686 9.778C34.434 9.646 34.071 9.51767 33.5796 9.393C33.1323 9.27567 32.7656 9.15833 32.4796 9.041C32.201 8.91633 31.959 8.73667 31.7536 8.502C31.5556 8.26 31.4566 7.94467 31.4566 7.556C31.4566 7.248 31.5483 6.96567 31.7316 6.709C31.915 6.45233 32.1753 6.25067 32.5126 6.104C32.85 5.95 33.235 5.873 33.6676 5.873C34.335 5.873 34.874 6.04167 35.2846 6.379C35.6953 6.71633 35.9153 7.17833 35.9446 7.765H34.9436C34.9216 7.44967 34.7933 7.19667 34.5586 7.006C34.3313 6.81533 34.0233 6.72 33.6346 6.72C33.2753 6.72 32.9893 6.797 32.7766 6.951C32.564 7.105 32.4576 7.30667 32.4576 7.556C32.4576 7.754 32.52 7.919 32.6446 8.051C32.7766 8.17567 32.938 8.27833 33.1286 8.359C33.3266 8.43233 33.598 8.51667 33.9426 8.612C34.3753 8.72933 34.7273 8.84667 34.9986 8.964C35.27 9.074 35.501 9.24267 35.6916 9.47C35.8896 9.69733 35.9923 9.99433 35.9996 10.361C35.9996 10.691 35.908 10.988 35.7246 11.252C35.5413 11.516 35.281 11.725 34.9436 11.879C34.6136 12.0257 34.2323 12.099 33.7996 12.099ZM40.8887 12L38.5237 9.338V12H37.5227V3.86H38.5237V8.645L40.8447 5.972H42.2417L39.4037 8.975L42.2527 12H40.8887ZM44.5148 6.797V10.35C44.5148 10.6433 44.5772 10.8523 44.7018 10.977C44.8265 11.0943 45.0428 11.153 45.3508 11.153H46.0878V12H45.1858C44.6285 12 44.2105 11.8717 43.9318 11.615C43.6532 11.3583 43.5138 10.9367 43.5138 10.35V6.797H42.7328V5.972H43.5138V4.454H44.5148V5.972H46.0878V6.797H44.5148ZM50.0397 12.099C49.475 12.099 48.9617 11.9707 48.4997 11.714C48.045 11.4573 47.6857 11.0943 47.4217 10.625C47.165 10.1483 47.0367 9.59833 47.0367 8.975C47.0367 8.359 47.1687 7.81633 47.4327 7.347C47.704 6.87033 48.0707 6.50733 48.5327 6.258C48.9947 6.00133 49.5117 5.873 50.0837 5.873C50.6557 5.873 51.1727 6.00133 51.6347 6.258C52.0967 6.50733 52.4597 6.86667 52.7237 7.336C52.995 7.80533 53.1307 8.35167 53.1307 8.975C53.1307 9.59833 52.9913 10.1483 52.7127 10.625C52.4413 11.0943 52.071 11.4573 51.6017 11.714C51.1323 11.9707 50.6117 12.099 50.0397 12.099ZM50.0397 11.219C50.399 11.219 50.7363 11.1347 51.0517 10.966C51.367 10.7973 51.62 10.5443 51.8107 10.207C52.0087 9.86967 52.1077 9.459 52.1077 8.975C52.1077 8.491 52.0123 8.08033 51.8217 7.743C51.631 7.40567 51.3817 7.15633 51.0737 6.995C50.7657 6.82633 50.432 6.742 50.0727 6.742C49.706 6.742 49.3687 6.82633 49.0607 6.995C48.76 7.15633 48.518 7.40567 48.3347 7.743C48.1513 8.08033 48.0597 8.491 48.0597 8.975C48.0597 9.46633 48.1477 9.88067 48.3237 10.218C48.507 10.5553 48.749 10.8083 49.0497 10.977C49.3503 11.1383 49.6803 11.219 50.0397 11.219ZM55.5578 7.083C55.7558 6.73833 56.0491 6.45233 56.4378 6.225C56.8338 5.99033 57.2921 5.873 57.8128 5.873C58.3481 5.873 58.8321 6.00133 59.2648 6.258C59.7048 6.51467 60.0495 6.87767 60.2988 7.347C60.5481 7.809 60.6728 8.348 60.6728 8.964C60.6728 9.57267 60.5481 10.1153 60.2988 10.592C60.0495 11.0687 59.7048 11.439 59.2648 11.703C58.8321 11.967 58.3481 12.099 57.8128 12.099C57.2995 12.099 56.8448 11.9853 56.4488 11.758C56.0601 11.5233 55.7631 11.2337 55.5578 10.889V14.86H54.5568V5.972H55.5578V7.083ZM59.6498 8.964C59.6498 8.50933 59.5581 8.11333 59.3748 7.776C59.1915 7.43867 58.9421 7.182 58.6268 7.006C58.3188 6.83 57.9778 6.742 57.6038 6.742C57.2371 6.742 56.8961 6.83367 56.5808 7.017C56.2728 7.193 56.0235 7.45333 55.8328 7.798C55.6495 8.13533 55.5578 8.52767 55.5578 8.975C55.5578 9.42967 55.6495 9.82933 55.8328 10.174C56.0235 10.5113 56.2728 10.7717 56.5808 10.955C56.8961 11.131 57.2371 11.219 57.6038 11.219C57.9778 11.219 58.3188 11.131 58.6268 10.955C58.9421 10.7717 59.1915 10.5113 59.3748 10.174C59.5581 9.82933 59.6498 9.426 59.6498 8.964Z","fill","currentColor"],["width","59","height","17","viewBox","0 0 59 17","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M4.5 11.5H5.5V12.5H6.5V11.5H7.5V12.5H8C8.27614 12.5 8.5 12.7239 8.5 13C8.5 13.2761 8.27614 13.5 8 13.5H4C3.72386 13.5 3.5 13.2761 3.5 13C3.5 12.7239 3.72386 12.5 4 12.5H4.5V11.5Z","fill","currentColor"],["fill-rule","evenodd","clip-rule","evenodd","d","M2 5.5L2 9.5C2 10.0523 2.44772 10.5 3 10.5L9 10.5C9.55229 10.5 10 10.0523 10 9.5L10 5.5C10 4.94772 9.55228 4.5 9 4.5L3 4.5C2.44771 4.5 2 4.94772 2 5.5ZM1 9.5C1 10.6046 1.89543 11.5 3 11.5L9 11.5C10.1046 11.5 11 10.6046 11 9.5L11 5.5C11 4.39543 10.1046 3.5 9 3.5L3 3.5C1.89543 3.5 1 4.39543 1 5.5L1 9.5Z","fill","currentColor"],["d","M24.624 4.388V12H23.623V6.324L21.093 12H20.389L17.848 6.313V12H16.847V4.388H17.925L20.741 10.68L23.557 4.388H24.624ZM29.0606 12.099C28.4959 12.099 27.9826 11.9707 27.5206 11.714C27.0659 11.4573 26.7066 11.0943 26.4426 10.625C26.1859 10.1483 26.0576 9.59833 26.0576 8.975C26.0576 8.359 26.1896 7.81633 26.4536 7.347C26.7249 6.87033 27.0916 6.50733 27.5536 6.258C28.0156 6.00133 28.5326 5.873 29.1046 5.873C29.6766 5.873 30.1936 6.00133 30.6556 6.258C31.1176 6.50733 31.4806 6.86667 31.7446 7.336C32.0159 7.80533 32.1516 8.35167 32.1516 8.975C32.1516 9.59833 32.0123 10.1483 31.7336 10.625C31.4623 11.0943 31.0919 11.4573 30.6226 11.714C30.1533 11.9707 29.6326 12.099 29.0606 12.099ZM29.0606 11.219C29.4199 11.219 29.7573 11.1347 30.0726 10.966C30.3879 10.7973 30.6409 10.5443 30.8316 10.207C31.0296 9.86967 31.1286 9.459 31.1286 8.975C31.1286 8.491 31.0333 8.08033 30.8426 7.743C30.6519 7.40567 30.4026 7.15633 30.0946 6.995C29.7866 6.82633 29.4529 6.742 29.0936 6.742C28.7269 6.742 28.3896 6.82633 28.0816 6.995C27.7809 7.15633 27.5389 7.40567 27.3556 7.743C27.1723 8.08033 27.0806 8.491 27.0806 8.975C27.0806 9.46633 27.1686 9.88067 27.3446 10.218C27.5279 10.5553 27.7699 10.8083 28.0706 10.977C28.3713 11.1383 28.7013 11.219 29.0606 11.219ZM36.5147 5.862C37.2481 5.862 37.8421 6.08567 38.2967 6.533C38.7514 6.973 38.9787 7.611 38.9787 8.447V12H37.9887V8.59C37.9887 7.98867 37.8384 7.53033 37.5377 7.215C37.2371 6.89233 36.8264 6.731 36.3057 6.731C35.7777 6.731 35.3561 6.896 35.0407 7.226C34.7327 7.556 34.5787 8.03633 34.5787 8.667V12H33.5777V5.972H34.5787V6.83C34.7767 6.522 35.0444 6.28367 35.3817 6.115C35.7264 5.94633 36.1041 5.862 36.5147 5.862ZM41.2409 4.993C41.0502 4.993 40.8889 4.927 40.7569 4.795C40.6249 4.663 40.5589 4.50167 40.5589 4.311C40.5589 4.12033 40.6249 3.959 40.7569 3.827C40.8889 3.695 41.0502 3.629 41.2409 3.629C41.4242 3.629 41.5782 3.695 41.7029 3.827C41.8349 3.959 41.9009 4.12033 41.9009 4.311C41.9009 4.50167 41.8349 4.663 41.7029 4.795C41.5782 4.927 41.4242 4.993 41.2409 4.993ZM41.7249 5.972V12H40.7239V5.972H41.7249ZM44.7619 6.797V10.35C44.7619 10.6433 44.8242 10.8523 44.9489 10.977C45.0736 11.0943 45.2899 11.153 45.5979 11.153H46.3349V12H45.4329C44.8756 12 44.4576 11.8717 44.1789 11.615C43.9002 11.3583 43.7609 10.9367 43.7609 10.35V6.797H42.9799V5.972H43.7609V4.454H44.7619V5.972H46.3349V6.797H44.7619ZM50.2867 12.099C49.7221 12.099 49.2087 11.9707 48.7467 11.714C48.2921 11.4573 47.9327 11.0943 47.6687 10.625C47.4121 10.1483 47.2837 9.59833 47.2837 8.975C47.2837 8.359 47.4157 7.81633 47.6797 7.347C47.9511 6.87033 48.3177 6.50733 48.7797 6.258C49.2417 6.00133 49.7587 5.873 50.3307 5.873C50.9027 5.873 51.4197 6.00133 51.8817 6.258C52.3437 6.50733 52.7067 6.86667 52.9707 7.336C53.2421 7.80533 53.3777 8.35167 53.3777 8.975C53.3777 9.59833 53.2384 10.1483 52.9597 10.625C52.6884 11.0943 52.3181 11.4573 51.8487 11.714C51.3794 11.9707 50.8587 12.099 50.2867 12.099ZM50.2867 11.219C50.6461 11.219 50.9834 11.1347 51.2987 10.966C51.6141 10.7973 51.8671 10.5443 52.0577 10.207C52.2557 9.86967 52.3547 9.459 52.3547 8.975C52.3547 8.491 52.2594 8.08033 52.0687 7.743C51.8781 7.40567 51.6287 7.15633 51.3207 6.995C51.0127 6.82633 50.6791 6.742 50.3197 6.742C49.9531 6.742 49.6157 6.82633 49.3077 6.995C49.0071 7.15633 48.7651 7.40567 48.5817 7.743C48.3984 8.08033 48.3067 8.491 48.3067 8.975C48.3067 9.46633 48.3947 9.88067 48.5707 10.218C48.7541 10.5553 48.9961 10.8083 49.2967 10.977C49.5974 11.1383 49.9274 11.219 50.2867 11.219ZM55.8049 6.951C55.9809 6.60633 56.2302 6.33867 56.5529 6.148C56.8829 5.95733 57.2825 5.862 57.7519 5.862V6.896H57.4879C56.3659 6.896 55.8049 7.50467 55.8049 8.722V12H54.8039V5.972H55.8049V6.951Z","fill","currentColor"]],template:function(t,a){if(t&1&&(b(0,"div",0),y(1,Z4,5,1,"div",1)(2,X4,6,1,"div",1)(3,q4,5,1,"div",1)(4,Q4,5,1,"div",1),x()),t&2){let i;k("data-testid",a.componentId)("aria-label","Viewing on"+a.deviceType),d(),w((i=a.deviceType)==="Mobile"?1:i==="Tablet"?2:i==="Desktop"?3:i==="Monitor"?4:-1)}},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-device-type-icons--flex[_ngcontent-%COMP%]{display:flex;cursor:pointer;color:var(--velt-text-4)}"],changeDetection:0});let r=o;return r})();function eT(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var bC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,commentIndex:e,i:t}),nT=(r,o)=>({condition:r,data:o}),oT=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-device-type-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function aT(r,o){if(r&1&&E(0,"app-device-type-icons",6),r&2){let n=l(5);v("deviceType",n.deviceType()),k("data-testid",n.componentId+"-icons")}}function iT(r,o){if(r&1&&(b(0,"div",7)(1,"div"),ie(2),F(3,"translate"),x(),b(4,"div"),ie(5),F(6,"translate"),x()()),r&2){let n=l(4),e=l();pe("dark",n==null||n.uiState==null?null:n.uiState.darkMode),k("data-testid",e.componentId+"-info"),d(2),Vh(" ",R(3,7,n==null||n.data==null||n.data.annotation==null||n.data.annotation.pageInfo==null||n.data.annotation.pageInfo.deviceInfo==null?null:n.data.annotation.pageInfo.deviceInfo.osName)," \u2022 ",n==null||n.data==null||n.data.annotation==null||n.data.annotation.pageInfo==null||n.data.annotation.pageInfo.deviceInfo==null?null:n.data.annotation.pageInfo.deviceInfo.screenWidth,"x",n==null||n.data==null||n.data.annotation==null||n.data.annotation.pageInfo==null||n.data.annotation.pageInfo.deviceInfo==null?null:n.data.annotation.pageInfo.deviceInfo.screenHeight," "),d(3),fe(" Using ",R(6,9,n==null||n.data==null||n.data.annotation==null||n.data.annotation.pageInfo==null||n.data.annotation.pageInfo.deviceInfo==null?null:n.data.annotation.pageInfo.deviceInfo.browserName)," ")}}function lT(r,o){if(r&1&&(u(0),b(1,"div",4)(2,"app-overlay-tooltip",5),s(3,aT,1,2,"ng-template",null,0,je)(5,iT,7,11,"ng-template",null,1,je),x()(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId),d(),v("positions",n.deviceInfoTooltipPositions),k("data-testid",n.componentId+"-tooltip")}}function dT(r,o){if(r&1&&s(0,lT,7,3,"ng-container",3),r&2){let n=l(2),e=l();v("veltDynamicTemplate",O(7,oT,e.template,O(1,bC,e.componentConfigSignal,e.localUIStateSignal,e.comment(),e.commentIndex(),e.commentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function vT(r,o){if(r&1&&(u(0),y(1,dT,1,13,"ng-container"),p()),r&2){let n=l(2);d(),w(n.shouldShow()?1:-1)}}function cT(r,o){if(r&1&&s(0,vT,2,1,"ng-container",2),r&2){let n=l();v("veltIf",C(7,nT,n.conditionSignal(),O(1,bC,n.componentConfigSignal,n.localUIStateSignal,n.comment(),n.commentIndex(),n.commentIndex())))}}var aa=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-device-type-internal",this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentId=Q(void 0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.commentIndex=Q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.comment=L(()=>{try{let e=this.commentObj();if(e)return e;let a=this.componentConfigSignal()?.data?.annotation?.comments,i=this.commentId();if(i!==void 0&&a&&Array.isArray(a)){let h=a.find(_=>_?.commentId===i);if(h)return h}let c=this.getContextCommentId();if(c!==void 0&&a&&Array.isArray(a)){let h=a.find(_=>_?.commentId===c);if(h)return h}let m=this.commentIndex();return m!==void 0&&a&&Array.isArray(a)?a[m]:null}catch(e){return this.loggingService.catch("Error in comment computed:",e),null}}),this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal(),t=this.commentIndex(),a=e?.uiState?.showScreenSizeInfo||!1;return t===0&&a}catch(e){return this.loggingService.catch("Error in shouldShow:",e),!1}}),this.deviceType=L(()=>{try{let e=this.componentConfigSignal(),t=e?.data?.annotation;return e?.uiState?.deviceType||t?.pageInfo?.deviceInfo?.deviceType||(t?.screenWidth?Ob(t.screenWidth):"")}catch(e){return this.loggingService.catch("Error in deviceType:",e),""}}),this.deviceInfoTooltipPositions=[{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"}]}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,commentObj:this.comment(),i:this.commentIndex()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardDeviceTypeComponent ngOnInit:",e)}}setupA11yAttributes(){try{mT(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-device-type-internal"]],inputs:{commentObj:[1,"commentObj"],commentId:[1,"commentId"],commentIndex:[1,"commentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[["triggerTemplate",""],["tooltipTemplate",""],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"modal-device__type"],[3,"positions"],[3,"deviceType"],["role","tooltip",1,"v-device-info-tooltip-container"]],template:function(t,a){if(t&1&&y(0,cT,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Hg,Cp,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function mT(r,o){try{r.setAttribute("role","status"),r.setAttribute("data-testid",o+"-container")}catch{}}var fC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,commentObj:n,commentIndex:e,i:t}),gT=(r,o)=>({condition:r,data:o}),uT=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-thread-card-draft-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function pT(r,o){if(r&1&&(u(0),b(1,"span",2),F(2,"translate"),ie(3),F(4,"translate"),x(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId)("aria-label",R(2,3,"Draft comment status")),d(2),fe(" ",R(4,5,"Draft")," ")}}function hT(r,o){if(r&1&&s(0,pT,5,7,"ng-container",1),r&2){let n=l(2),e=l();v("veltDynamicTemplate",O(7,uT,e.template,O(1,fC,e.componentConfigSignal,e.localUIStateSignal,e.comment(),e.commentIndex(),e.commentIndex()),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function bT(r,o){if(r&1&&(u(0),y(1,hT,1,13,"ng-container"),p()),r&2){let n=l(2);d(),w(n.shouldShow()?1:-1)}}function fT(r,o){if(r&1&&s(0,bT,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,gT,n.conditionSignal(),O(1,fC,n.componentConfigSignal,n.localUIStateSignal,n.comment(),n.commentIndex(),n.commentIndex())))}}var ia=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-thread-card-draft-internal",this.commentObj=Q(null,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return null}}}),this.commentId=Q(void 0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.commentIndex=Q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.comment=L(()=>{try{let e=this.commentObj();if(e)return e;let t=this.commentId();if(t!==void 0){let m=this.componentConfigSignal()?.data?.annotation?.comments;if(m&&Array.isArray(m)){let h=m.find(_=>_?.commentId===t);if(h)return h}}let a=this.commentIndex();if(a!==void 0){let m=this.componentConfigSignal()?.data?.annotation?.comments;if(m&&Array.isArray(m))return m[a]}let i=this.getContextValue("comment-id");if(i){let m=this.componentConfigSignal()?.data?.annotation?.comments;if(m&&Array.isArray(m)){let h=m.find(_=>_?.commentId?.toString()===i);if(h)return h}}return null}catch(e){return this.loggingService.catch("Error in comment computed:",e),null}}),this.shouldShow=L(()=>{try{return this.defaultCondition()?this.comment()?.isDraft===!0:!0}catch(e){return this.loggingService.catch("Error in shouldShow:",e),!1}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,parentLocalUIState:this.localUIStateSignal,commentObj:this.comment(),i:this.commentIndex()})}catch(e){this.loggingService.catch("Error in CommentDialogThreadCardDraftComponent ngOnInit:",e)}}setupA11yAttributes(){try{CT(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-thread-card-draft-internal"]],inputs:{commentObj:[1,"commentObj"],commentId:[1,"commentId"],commentIndex:[1,"commentIndex"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","status","aria-live","polite",1,"velt-thread-card--draft"]],template:function(t,a){if(t&1&&y(0,fT,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{display:block}[_nghost-%COMP%]:empty{display:none}.velt-thread-card--draft[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-xs) var(--velt-spacing-sm) var(--velt-spacing-xs) 6px;justify-content:center;align-items:center;gap:var(--velt-spacing-xs);border-radius:var(--velt-border-radius-xl);background:var(--velt-background-2);margin-left:var(--velt-spacing-xs);color:var(--velt-text-9);font-size:var(--velt-font-size-xs);font-style:normal;font-weight:600;line-height:100%;text-transform:uppercase}"],changeDetection:0});let r=o;return r})();function CT(r,o){try{r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.setAttribute("data-testid",o+"-container")}catch{}}var la=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),xT=(r,o)=>({condition:r,data:o}),Xv=(r,o)=>({componentName:"velt-comment-dialog-composer-action-button-wireframe",variant:r,suffix:o}),qv=(r,o,n,e,t,a)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-action-button-wireframe",variant:n,suffix:e,setIfCondition:t,componentElementRef:a});function _T(r,o){if(r&1){let n=Y();b(0,"velt-autocomplete-tool-internal",3),F(1,"translate"),z("buttonClick",function(){B(n);let t=l(4);return V(t.uiState==null||t.uiState.onAtClick==null?null:t.uiState.onAtClick(t.uiState==null||t.uiState.newCommentTextArea==null?null:t.uiState.newCommentTextArea.nativeElement))}),x()}if(r&2){let n=l(4),e=l();v("hotkey",e.getHotkeyValue())("template",e.template)("componentMeta",C(9,Xv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("triggerElement",n.uiState==null||n.uiState.newCommentTextArea==null?null:n.uiState.newCommentTextArea.nativeElement),k("aria-label",R(1,7,"Mention someone using @ symbol"))("data-testid",e.componentId+"-autocomplete-new")}}function ST(r,o){if(r&1){let n=Y();b(0,"velt-autocomplete-tool-internal",3),F(1,"translate"),z("buttonClick",function(){B(n);let t=l(4);return V(t.uiState==null||t.uiState.onAtClick==null?null:t.uiState.onAtClick(t.uiState==null||t.uiState.editCommentTextArea==null?null:t.uiState.editCommentTextArea.nativeElement))}),x()}if(r&2){let n=l(4),e=l();v("hotkey",e.getHotkeyValue())("template",e.template)("componentMeta",C(9,Xv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("triggerElement",n.uiState==null||n.uiState.editCommentTextArea==null?null:n.uiState.editCommentTextArea.nativeElement),k("aria-label",R(1,7,"Mention someone using @ symbol while editing"))("data-testid",e.componentId+"-autocomplete-edit")}}function yT(r,o){if(r&1&&(y(0,_T,2,12,"velt-autocomplete-tool-internal",2),y(1,ST,2,12,"velt-autocomplete-tool-internal",2)),r&2){let n=l(4);w(n.getEditModeValue()?-1:0),d(),w(n.getEditModeValue()?1:-1)}}function wT(r,o){if(r&1&&y(0,yT,2,2),r&2){let n=l(2);w(n.featureState!=null&&n.featureState.userMentions?0:-1)}}function IT(r,o){if(r&1){let n=Y();b(0,"velt-autocomplete-tool-internal",3),F(1,"translate"),z("buttonClick",function(){B(n);let t=l(4);return V(t.uiState==null||t.uiState.onAtClick==null?null:t.uiState.onAtClick(t.uiState==null||t.uiState.newCommentTextArea==null?null:t.uiState.newCommentTextArea.nativeElement))}),x()}if(r&2){let n=l(4),e=l();v("hotkey",e.getHotkeyValue())("template",e.template)("componentMeta",C(9,Xv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("triggerElement",n.uiState==null||n.uiState.newCommentTextArea==null?null:n.uiState.newCommentTextArea.nativeElement),k("aria-label",R(1,7,"Type @ to mention someone"))("data-testid",e.componentId+"-autocomplete-tool-new")}}function DT(r,o){if(r&1){let n=Y();b(0,"velt-autocomplete-tool-internal",3),F(1,"translate"),z("buttonClick",function(){B(n);let t=l(4);return V(t.uiState==null||t.uiState.onAtClick==null?null:t.uiState.onAtClick(t.uiState==null||t.uiState.editCommentTextArea==null?null:t.uiState.editCommentTextArea.nativeElement))}),x()}if(r&2){let n=l(4),e=l();v("hotkey",e.getHotkeyValue())("template",e.template)("componentMeta",C(9,Xv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("triggerElement",n.uiState==null||n.uiState.editCommentTextArea==null?null:n.uiState.editCommentTextArea.nativeElement),k("aria-label",R(1,7,"Type @ to mention someone while editing"))("data-testid",e.componentId+"-autocomplete-tool-edit")}}function TT(r,o){if(r&1&&(y(0,IT,2,12,"velt-autocomplete-tool-internal",2),y(1,DT,2,12,"velt-autocomplete-tool-internal",2)),r&2){let n=l(4);w(n.getEditModeValue()?-1:0),d(),w(n.getEditModeValue()?1:-1)}}function OT(r,o){if(r&1&&y(0,TT,2,2),r&2){let n=l(2);w(n.featureState!=null&&n.featureState.userMentions?0:-1)}}function ET(r,o){if(r&1){let n=Y();b(0,"app-attachment-button",5),F(1,"translate"),z("clicked",function(){B(n);let t=l(3);return V(t.uiState==null||t.uiState.onAttachmentButtonClick==null?null:t.uiState.onAttachmentButtonClick())})("selectFiles",function(t){B(n);let a=l(4);return V(a.handleFilesSelected(t))})("setIfConditionEvent",function(t){B(n);let a=l(4);return V(a.setIfCondition(t))}),x()}if(r&2){let n=l(3),e=l();v("template",e.template)("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("componentMeta",C(8,Xv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("allowedFileTypes",n.featureState==null?null:n.featureState.allowedFileTypes),k("aria-label",R(1,6,"Add file attachment to comment"))("data-testid",e.componentId+"-attachment-button")}}function MT(r,o){if(r&1&&y(0,ET,2,11,"app-attachment-button",4),r&2){let n=l(2);w(n.featureState!=null&&n.featureState.enableAttachment?0:-1)}}function AT(r,o){if(r&1){let n=Y();b(0,"app-attachment-button",5),F(1,"translate"),z("clicked",function(){B(n);let t=l(3);return V(t.uiState==null||t.uiState.onAttachmentButtonClick==null?null:t.uiState.onAttachmentButtonClick())})("selectFiles",function(t){B(n);let a=l(4);return V(a.handleFilesSelected(t))})("setIfConditionEvent",function(t){B(n);let a=l(4);return V(a.setIfCondition(t))}),x()}if(r&2){let n=l(3),e=l();v("template",e.template)("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("componentMeta",C(8,Xv,n.uiState==null?null:n.uiState.variant,e.getTypeValue()))("allowedFileTypes",n.featureState==null?null:n.featureState.allowedFileTypes),k("aria-label",R(1,6,"Add file attachment to comment"))("data-testid",e.componentId+"-attachment-button")}}function PT(r,o){if(r&1&&y(0,AT,2,11,"app-attachment-button",4),r&2){let n=l(2);w(n.featureState!=null&&n.featureState.enableAttachment?0:-1)}}function FT(r,o){if(r&1&&(u(0),b(1,"app-action-button",9),F(2,"translate"),F(3,"translate"),de(),b(4,"svg",10),E(5,"path",11)(6,"path",12),x()(),p()),r&2){let n=l(4),e=l();d(),v("title",R(2,4,"Record voice"))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(3,6,"Record voice message"))("data-testid",e.componentId+"-audio-record")}}function NT(r,o){if(r&1){let n=Y();b(0,"app-device-permission-button",6),F(1,"translate"),b(2,"div",7),F(3,"translate"),z("click",function(){B(n);let t=l(3),a=l();return V(t.uiState!=null&&t.uiState.recorderInitConfig?null:a.handleRecordingStart("audio"))}),s(4,FT,7,8,"ng-container",8),x()()}if(r&2){let n=l(3),e=l();v("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(1,6,"Record voice message"))("data-testid",e.componentId+"-audio-button"),d(2),k("aria-label",R(3,8,"Click to start voice recording"))("data-testid",e.componentId+"-audio-record"),d(2),v("veltDynamicTemplate",yt(13,qv,e.template,C(10,la,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function RT(r,o){if(r&1&&y(0,NT,5,20,"app-device-permission-button",6),r&2){let n=l(2);w(!(n.featureState==null||n.featureState.allowedRecordings==null)&&n.featureState.allowedRecordings.includes("audio")?0:-1)}}function UT(r,o){if(r&1&&(u(0),b(1,"app-action-button",9),F(2,"translate"),F(3,"translate"),de(),b(4,"svg",14),E(5,"path",15),x()(),p()),r&2){let n=l(4),e=l();d(),v("title",R(2,4,"Record video"))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(3,6,"Record video message"))("data-testid",e.componentId+"-video-record")}}function LT(r,o){if(r&1){let n=Y();b(0,"app-device-permission-button",13),F(1,"translate"),b(2,"div",7),F(3,"translate"),z("click",function(){B(n);let t=l(3),a=l();return V(t.uiState!=null&&t.uiState.recorderInitConfig?null:a.handleRecordingStart("video"))}),s(4,UT,6,8,"ng-container",8),x()()}if(r&2){let n=l(3),e=l();v("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(1,6,"Record video message"))("data-testid",e.componentId+"-video-button"),d(2),k("aria-label",R(3,8,"Click to start video recording"))("data-testid",e.componentId+"-video-record"),d(2),v("veltDynamicTemplate",yt(13,qv,e.template,C(10,la,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function BT(r,o){if(r&1&&y(0,LT,5,20,"app-device-permission-button",13),r&2){let n=l(2);w(!(n.featureState==null||n.featureState.allowedRecordings==null)&&n.featureState.allowedRecordings.includes("video")?0:-1)}}function VT(r,o){if(r&1&&(u(0),b(1,"app-action-button",9),F(2,"translate"),F(3,"translate"),de(),b(4,"svg",17),E(5,"path",18)(6,"path",19)(7,"path",20)(8,"path",21),x()(),p()),r&2){let n=l(4),e=l();d(),v("title",R(2,4,"Record screen"))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(3,6,"Record your screen"))("data-testid",e.componentId+"-screen-record")}}function $T(r,o){if(r&1){let n=Y();b(0,"div",7),F(1,"translate"),z("click",function(){B(n);let t=l(3),a=l();return V(t.uiState!=null&&t.uiState.recorderInitConfig?null:a.handleRecordingStart("screen"))}),s(2,VT,9,8,"ng-container",8),x()}if(r&2){let n=l(3),e=l();k("aria-label",R(1,3,"Click to start screen recording"))("data-testid",e.componentId+"-screen-record"),d(2),v("veltDynamicTemplate",yt(8,qv,e.template,C(5,la,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function jT(r,o){if(r&1&&y(0,$T,3,15,"div",16),r&2){let n=l(2);w(!(n.featureState==null||n.featureState.allowedRecordings==null)&&n.featureState.allowedRecordings.includes("screen")&&(n.featureState!=null&&n.featureState.screenSharingSupported)?0:-1)}}function GT(r,o){if(r&1&&(u(0),b(1,"app-action-button",9),F(2,"translate"),F(3,"translate"),de(),b(4,"svg",24),E(5,"path",25),x()(),p()),r&2){let n=l(4),e=l();d(),v("title",R(2,4,"Format text"))("darkMode",!!(n.uiState!=null&&n.uiState.darkMode)),k("aria-label",R(3,6,"Format text options"))("data-testid",e.componentId+"-format")}}function zT(r,o){if(r&1){let n=Y();b(0,"div",23),F(1,"translate"),z("click",function(){B(n);let t=l(4);return V(t.handleFormatToggle())})("mousedown",function(t){return B(n),V(t.preventDefault())}),s(2,GT,6,8,"ng-container",8),x()}if(r&2){let n=l(3),e=l();pe("velt-composer-action-button--selected",n.uiState==null?null:n.uiState.formatToolbarOpen),k("aria-label",R(1,5,"Toggle format options"))("data-testid",e.componentId+"-format"),d(2),v("veltDynamicTemplate",yt(10,qv,e.template,C(7,la,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function HT(r,o){if(r&1&&y(0,zT,3,17,"div",22),r&2){let n=l(2);w(n.featureState!=null&&n.featureState.enableFormatOptions?0:-1)}}function WT(r,o){r&1&&(b(0,"div",29),de(),b(1,"svg",30),E(2,"path",31),x()())}function JT(r,o){if(r&1){let n=Y();b(0,"button",27),F(1,"translate"),z("click",function(t){return B(n),l(4).handleSubmit(),V(t.stopPropagation())}),s(2,WT,3,0,"div",28),x()}if(r&2){let n=l(3),e=l();v("disabled",!e.hasComposerText()&&!e.hasSelectedAttachments()&&!e.hasLocalRecordedData()||(n.uiState==null?null:n.uiState.uploadingAttachments)),k("aria-label",R(1,4,"Save new comment"))("data-testid",e.componentId+"-submit-new"),d(2),v("veltDynamicTemplate",yt(9,qv,e.template,C(6,la,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function YT(r,o){r&1&&(b(0,"div",29),de(),b(1,"svg",30),E(2,"path",32),x()())}function KT(r,o){if(r&1){let n=Y();b(0,"button",27),F(1,"translate"),z("click",function(t){return B(n),l(4).handleSubmit(),V(t.stopPropagation())}),s(2,YT,3,0,"div",28),x()}if(r&2){let n=l(3),e=l();v("disabled",!e.hasComposerText()&&!e.hasSelectedAttachments()&&!e.hasAttachmentsToDelete()&&!e.hasLocalRecordedData()||(n.uiState==null?null:n.uiState.uploadingAttachments)),k("aria-label",R(1,4,"Save edited comment"))("data-testid",e.componentId+"-submit-edit"),d(2),v("veltDynamicTemplate",yt(9,qv,e.template,C(6,la,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function ZT(r,o){if(r&1&&(y(0,JT,3,16,"button",26),y(1,KT,3,16,"button",26)),r&2){let n=l(3);w(n.getEditModeValue()?-1:0),d(),w(n.getEditModeValue()?1:-1)}}function XT(r,o){if(r&1){let n=Y();u(0),b(1,"div",1),F(2,"translate"),z("click",function(t){return B(n),V(t.stopPropagation())}),y(3,wT,1,1)(4,OT,1,1)(5,MT,1,1)(6,PT,1,1)(7,RT,1,1)(8,BT,1,1)(9,jT,1,1)(10,HT,1,1)(11,ZT,2,2),x(),p()}if(r&2){let n,e=l(2);d(),k("aria-label",R(2,3,"Comment tools and actions"))("data-testid",e.componentId),d(2),w((n=e.getTypeValue())==="userMentions"?3:n==="autocomplete"?4:n==="file"?5:n==="attachments"?6:n==="audio"?7:n==="video"?8:n==="screen"?9:n==="format"?10:n==="submit"?11:-1)}}function qT(r,o){if(r&1&&s(0,XT,12,5,"ng-container",0),r&2){let n=l();v("veltIf",C(4,xT,n.conditionSignal(),C(1,la,n.componentConfigSignal,n.localUIStateSignal)))}}var da=(()=>{let o=class o extends te{ngOnInit(){if(super.ngOnInit(),this.isLocalUIStateOwner){let e=this.localUIStateSignal()?.dialogInstanceId;e&&(this.coreService.registerLocalUIState(e,this.localUIStateSignal),this.coreService.markStandaloneComposerOwner(e))}}ngOnDestroy(){if(this.isLocalUIStateOwner){let e=this.localUIStateSignal()?.dialogInstanceId;e&&(this.coreService.unregisterLocalUIState(e),this.coreService.unmarkStandaloneComposerOwner(e))}super.ngOnDestroy()}constructor(){super(),this.componentId="velt-comment-dialog-composer-action-button-internal",this.hasComposerText=L(()=>{let e=this.localUIStateSignal()?.composerContent;if(e&&e.trim().length>0)return!0;if(this.isLocalUIStateOwner){let t=this.getAnnotationId();if(t){let a=this.coreService.getOrCreateComposerDraft(t)();return!!(a?.composerContent&&a.composerContent.trim().length>0)}}return!1}),this.hasSelectedAttachments=L(()=>{if(CC(this.localUIStateSignal()))return!0;if(this.isLocalUIStateOwner){let e=this.getAnnotationId();if(e)return CC(this.coreService.getOrCreateComposerDraft(e)())}return!1}),this.hasLocalRecordedData=L(()=>{if(this.localUIStateSignal()?.localRecordedData?.length)return!0;if(this.isLocalUIStateOwner){let e=this.getAnnotationId();if(e)return!!this.coreService.getOrCreateComposerDraft(e)()?.localRecordedData?.length}return!1}),this.hasAttachmentsToDelete=L(()=>!!this.localUIStateSignal()?.attachmentsToDelete?.length),this.type=Q.required({transform:e=>{try{return e||""}catch{return""}}}),this.editMode=Q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true"||e==="1":e}catch{return!1}}}),this.commentIndex=Q(void 0,{transform:e=>{try{if(e==null)return;if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.hotkey=Q("@",{transform:e=>{try{return e||"@"}catch{return"@"}}})}getTypeValue(){try{return typeof this.type=="function"?this.type():this.type||""}catch(e){return this.loggingService.catch("Error in CommentDialogComposerActionButtonComponent getTypeValue:",e),""}}getEditModeValue(){try{return typeof this.editMode=="function"?this.editMode():this.editMode||!1}catch(e){return this.loggingService.catch("Error in CommentDialogComposerActionButtonComponent getEditModeValue:",e),!1}}getHotkeyValue(){try{return typeof this.hotkey=="function"?this.hotkey():this.hotkey||"@"}catch(e){return this.loggingService.catch("Error in CommentDialogComposerActionButtonComponent getHotkeyValue:",e),"@"}}setupA11yAttributes(){try{eO(this.hostElementRef.nativeElement,this.componentId,this.getTypeValue())}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}handleFilesSelected(e){try{let t=this.getAnnotationId();if(!t){this.loggingService.catch("No annotation ID for file selection",new Error("Missing annotationId"));return}let a=[];if(e?.target?.files?.length){for(let i=0;i<e.target.files.length;i++){let c=e.target.files[i];c&&a.push(c)}e.target.value=""}a.length>0&&this.actionService.addFiles(t,a,this.localUIStateSignal()?.dialogInstanceId)}catch(t){this.loggingService.catch("Error in handleFilesSelected:",t)}}handleFormatToggle(){try{let e=this.getAnnotationId();if(e)this.actionService.toggleFormatToolbar(e);else{let t=this.componentConfigSignal;t&&typeof t.update=="function"&&t.update(a=>f(g({},a),{uiState:f(g({},a.uiState),{formatToolbarOpen:!a.uiState?.formatToolbarOpen})}))}}catch(e){this.loggingService.catch("Error in handleFormatToggle:",e)}}handleRecordingStart(e){try{let t=this.getAnnotationId();if(!t){this.loggingService.catch("No annotation ID for recording start",new Error("Missing annotationId"));return}let a=this.isLocalUIStateOwner?this.coreService.getStandaloneRecorderPanelId(t):this.localUIStateSignal()?.dialogInstanceId;this.actionService.startRecording(t,e,a)}catch(t){this.loggingService.catch("Error in handleRecordingStart:",t)}}handleSubmit(){return Ae(this,null,function*(){try{let e=this.getAnnotationId();if(e)if(this.editMode()){let t=this.commentIndex();if(t===void 0){this.loggingService.catch("Edit mode requires commentIndex",new Error("Missing commentIndex"));return}this.actionService.updateComment(e,t,this.localUIStateSignal()?.dialogInstanceId)}else{if(this.isLocalUIStateOwner){let t=this.coreService.getOrCreateComposerDraft(e)();this.localUIStateSignal.update(a=>g(g({},a),QT(a,t)))}yield this.actionService.addComment(e,!1,this.localUIStateSignal()?.dialogInstanceId),this.isLocalUIStateOwner&&this.coreService.clearComposerDraft(e)}else{let t=this.componentConfigSignal();if(!t)return;let a=this.localUIStateSignal(),i=a?.composerContent||"",m=t.uiState?.newCommentTextArea?.nativeElement?.innerHTML||a?.composerContentHTML||"";if(!i.trim())return;let h={commentText:i.trim(),commentHtml:m,from:t.appState?.user,taggedUserContacts:t.data?.taggedUserContacts||[],attachments:a?.selectedAttachments||[],recorders:a?.localRecordedData||[],createdAt:new Date,lastUpdated:new Date},_={annotation:t.data?.annotation,updatedComment:h,type:"NEWLY_ADDED"},I=this.componentConfigSignal;I&&typeof I.update=="function"&&I.update(S=>f(g({},S),{uiState:f(g({},S.uiState),{pendingSaveComment:_,formatToolbarOpen:!1})})),this.localUIStateSignal.update(S=>f(g({},S),{composerContent:"",composerContentHTML:"",composerInOpenState:!1}))}}catch(e){this.loggingService.catch("Error in handleSubmit:",e)}})}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-action-button-internal"]],inputs:{type:[1,"type"],editMode:[1,"editMode"],commentIndex:[1,"commentIndex"],hotkey:[1,"hotkey"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","group",1,"velt-comment-dialog-composer-action-button",3,"click"],[3,"hotkey","template","componentMeta","darkMode","triggerElement"],[3,"buttonClick","hotkey","template","componentMeta","darkMode","triggerElement"],[3,"template","darkMode","componentMeta","allowedFileTypes"],[3,"clicked","selectFiles","setIfConditionEvent","template","darkMode","componentMeta","allowedFileTypes"],["type","audio","mode","thread",3,"darkMode"],["role","button","tabindex","0",3,"click"],[4,"veltDynamicTemplate"],[3,"title","darkMode"],["icon","","width","14","height","20","viewBox","0 0 14 20","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["fill-rule","evenodd","clip-rule","evenodd","d","M0.833333 7.5C1.29357 7.5 1.66667 7.8731 1.66667 8.33333V9.16667C1.66667 11.9281 3.90524 14.1667 6.66667 14.1667C9.42809 14.1667 11.6667 11.9281 11.6667 9.16667V8.33333C11.6667 7.8731 12.0398 7.5 12.5 7.5C12.9602 7.5 13.3333 7.8731 13.3333 8.33333V9.16667C13.3333 12.5663 10.7886 15.3717 7.5 15.7818V18.3333H10C10.4602 18.3333 10.8333 18.7064 10.8333 19.1667C10.8333 19.6269 10.4602 20 10 20H3.33333C2.8731 20 2.5 19.6269 2.5 19.1667C2.5 18.7064 2.8731 18.3333 3.33333 18.3333H5.83333V15.7818C2.54474 15.3717 0 12.5663 0 9.16667V8.33333C0 7.8731 0.373096 7.5 0.833333 7.5Z","fill","currentColor"],["fill-rule","evenodd","clip-rule","evenodd","d","M8.33203 9.16667V3.33333C8.33203 2.41286 7.58584 1.66667 6.66536 1.66667C5.74489 1.66667 4.9987 2.41286 4.9987 3.33333V9.16667C4.9987 10.0871 5.74489 10.8333 6.66536 10.8333C7.58584 10.8333 8.33203 10.0871 8.33203 9.16667ZM6.66536 0C4.82442 0 3.33203 1.49238 3.33203 3.33333V9.16667C3.33203 11.0076 4.82442 12.5 6.66536 12.5C8.50631 12.5 9.9987 11.0076 9.9987 9.16667V3.33333C9.9987 1.49238 8.50631 0 6.66536 0Z","fill","currentColor"],["type","video","mode","thread",3,"darkMode"],["icon","","width","19","height","11","viewBox","0 0 19 11","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["fill-rule","evenodd","clip-rule","evenodd","d","M2.55139 0.230077C1.68754 0.453772 1.06855 1.02195 0.766641 1.86822L0.666016 2.15026V5.58765V9.02505L0.766892 9.30709C1.0535 10.1083 1.64038 10.6731 2.43987 10.9173L2.70863 10.9993H7.1343H11.56L11.8467 10.9033C12.6234 10.6431 13.2099 10.0635 13.47 9.29927C13.56 9.03464 13.5637 8.99015 13.5769 8.02909C13.5844 7.48129 13.6004 7.03312 13.6125 7.03312C13.661 7.03312 15.0857 7.85517 15.8518 8.3252C16.7188 8.85713 16.9126 8.93691 17.338 8.93691C18.0692 8.93691 18.7509 8.40671 18.947 7.68535C19.0174 7.42654 19.0165 3.74584 18.946 3.48531C18.7883 2.90254 18.278 2.40649 17.7016 2.27577C17.4483 2.2183 17.0895 2.23195 16.8373 2.30859C16.6848 2.35492 16.3699 2.52421 15.9107 2.80671C15.3288 3.1648 13.6405 4.14219 13.6039 4.14219C13.5979 4.14219 13.5847 3.70988 13.5747 3.18148C13.5543 2.10348 13.5363 1.99704 13.2916 1.506C13.0166 0.954081 12.475 0.492835 11.8467 0.275239L11.56 0.17596L7.18806 0.168733C2.95948 0.161752 2.80747 0.163762 2.55139 0.230077ZM11.3211 1.83448C11.5404 1.89857 11.7306 2.05186 11.8398 2.25268L11.9183 2.39705V5.57098V8.74488L11.8268 8.91988C11.7122 9.13896 11.4929 9.30656 11.2552 9.35673C11.0123 9.40799 3.20786 9.40919 2.98224 9.35804C2.74243 9.30364 2.53297 9.14287 2.42553 8.93071L2.33236 8.74678V5.58765V2.42853L2.42553 2.2446C2.52985 2.03864 2.7435 1.8703 2.96604 1.81882C3.04208 1.80123 4.88581 1.78558 7.11882 1.7836C10.641 1.7805 11.1578 1.78678 11.3211 1.83448ZM17.3116 5.59171V7.28802L17.2309 7.23605C16.8358 6.98144 15.6936 6.30232 15.1359 5.99038C14.7573 5.77856 14.4468 5.59675 14.4461 5.58635C14.4453 5.57591 14.7874 5.37341 15.2062 5.13632C15.6251 4.89919 16.258 4.52439 16.6128 4.30341C16.9675 4.08243 17.2699 3.90019 17.2847 3.8985C17.2995 3.89681 17.3116 4.65875 17.3116 5.59171Z","fill","currentColor"],["role","button","tabindex","0"],["icon","","width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M7.4987 15H9.16536V16.6667H10.832V15H12.4987V16.6667H13.332C13.7923 16.6667 14.1654 17.0398 14.1654 17.5C14.1654 17.9602 13.7923 18.3333 13.332 18.3333H6.66536C6.20513 18.3333 5.83203 17.9602 5.83203 17.5C5.83203 17.0398 6.20513 16.6667 6.66536 16.6667H7.4987V15Z","fill","currentColor"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.33464 5L3.33464 11.6667C3.33464 12.5871 4.08083 13.3333 5.0013 13.3333L15.0013 13.3333C15.9218 13.3333 16.668 12.5871 16.668 11.6667L16.668 5C16.668 4.07953 15.9218 3.33333 15.0013 3.33333L5.0013 3.33333C4.08083 3.33333 3.33464 4.07953 3.33464 5ZM1.66797 11.6667C1.66797 13.5076 3.16035 15 5.0013 15L15.0013 15C16.8423 15 18.3346 13.5076 18.3346 11.6667L18.3346 5C18.3346 3.15905 16.8423 1.66667 15.0013 1.66667L5.0013 1.66667C3.16035 1.66667 1.66797 3.15905 1.66797 5L1.66797 11.6667Z","fill","currentColor"],["d","M5.83333 5C5.3731 5 5 5.3731 5 5.83333C5 6.29357 5.3731 6.66667 5.83333 6.66667H11.6667C12.1269 6.66667 12.5 6.29357 12.5 5.83333C12.5 5.3731 12.1269 5 11.6667 5H5.83333Z","fill","currentColor"],["d","M5.83333 8.33333C5.3731 8.33333 5 8.70643 5 9.16667C5 9.6269 5.3731 10 5.83333 10H7.5C7.96024 10 8.33333 9.6269 8.33333 9.16667C8.33333 8.70643 7.96024 8.33333 7.5 8.33333H5.83333Z","fill","currentColor"],["role","button","tabindex","0",3,"velt-composer-action-button--selected"],["role","button","tabindex","0",3,"click","mousedown"],["icon","","width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M9 15V8C9 7.20435 9.31607 6.44129 9.87868 5.87868C10.4413 5.31607 11.2044 5 12 5C12.7956 5 13.5587 5.31607 14.1213 5.87868C14.6839 6.44129 15 7.20435 15 8V15M9 11H15M5 19H19","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],[1,"velt-composer--submit-button",3,"disabled"],[1,"velt-composer--submit-button",3,"click","disabled"],["class","velt-composer--input-button",4,"veltDynamicTemplate"],[1,"velt-composer--input-button"],["width","14","height","14","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","role","img"],["d","M20.8089 10.1394L4.6724 3.15546C3.9926 2.8612 3.22459 2.99065 2.66814 3.49311C2.1117 3.99565 1.87896 4.76995 2.06084 5.51382L3.49713 11.3888H10.5294C10.853 11.3888 11.1154 11.6625 11.1154 12C11.1154 12.3375 10.853 12.6112 10.5294 12.6112H3.49713L2.06084 18.4862C1.87896 19.2301 2.11166 20.0044 2.66814 20.5069C3.22572 21.0104 3.99381 21.1382 4.67244 20.8445L20.8089 13.8606C21.5436 13.5426 22 12.8297 22 12C22 11.1703 21.5436 10.4574 20.8089 10.1394Z","fill","currentColor"],["d","M20.8089 10.1394L4.6724 3.15546C3.9926 2.8612 3.22459 2.99065 2.66814 3.49311C2.1117 3.99565 1.87896 4.76995 2.06084 5.51382L3.49713 11.3888H10.5294C10.853 11.3888 11.1154 11.6625 11.1154 12C11.1154 12.3375 10.853 12.6112 10.5294 12.6112H3.49713L2.06084 18.4862C1.87896 19.2301 2.11166 20.0044 2.66814 20.5069C3.22572 21.0104 3.99381 21.1382 4.67244 20.8445L20.8089 13.8606C21.5436 13.5426 22 12.8297 22 12C22 11.1703 21.5436 10.4574 20.8089 10.1394Z","fill","white"]],template:function(t,a){if(t&1&&y(0,qT,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,zg,df,of,up,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-comment-dialog-composer-action-button[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.velt-composer-action-button--selected[_ngcontent-%COMP%] app-action-button button.action__button.velt-action-button{background:color-mix(in srgb,var(--velt-accent) 12%,transparent);color:var(--velt-accent)}.velt-composer-action-button--selected[_ngcontent-%COMP%] app-action-button button.action__button.velt-action-button:hover{background:color-mix(in srgb,var(--velt-accent) 18%,transparent);color:var(--velt-accent)}.velt-composer--submit-button[_ngcontent-%COMP%]{background:transparent;border:0;outline:0}.velt-composer--submit-button[_ngcontent-%COMP%] .velt-composer--input-button[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;width:2.4em;height:2.4em;border:0;border-radius:var(--velt-border-radius-3xl);background:var(--velt-accent);color:var(--velt-accent-foreground);cursor:pointer}.velt-composer--submit-button[_ngcontent-%COMP%]:disabled .velt-composer--input-button[_ngcontent-%COMP%]{opacity:.4;pointer-events:none;cursor:not-allowed}.velt-composer--submit-button[_ngcontent-%COMP%]:hover .velt-composer--input-button[_ngcontent-%COMP%]{background:var(--velt-accent-hover);color:var(--velt-accent-foreground)}.velt-composer--submit-button[_ngcontent-%COMP%]:focus .velt-composer--input-button[_ngcontent-%COMP%]{background:var(--velt-accent-hover);color:var(--velt-accent-foreground);outline:0}.velt-composer--submit-button[_ngcontent-%COMP%]:active .velt-composer--input-button[_ngcontent-%COMP%]{background:var(--velt-accent-hover);color:var(--velt-accent-foreground)}"],changeDetection:0});let r=o;return r})();function CC(r){return!!r?.selectedAttachments?.length}function QT(r,o){return{composerContent:r?.composerContent||o?.composerContent||"",composerContentHTML:r?.composerContentHTML||o?.composerContentHTML||"",localRecordedData:o?.localRecordedData||[],selectedFiles:o?.selectedFiles||[],invalidSelectedFiles:o?.invalidSelectedFiles||[],selectedAttachments:o?.selectedAttachments||[]}}function eO(r,o,n){try{switch(r.setAttribute("data-testid",o+"-container"),n){case"attachment":r.setAttribute("role","button"),r.setAttribute("aria-label","Attach file");break;case"giphy":r.setAttribute("role","button"),r.setAttribute("aria-label","Search GIFs");break;case"emoji":r.setAttribute("role","button"),r.setAttribute("aria-label","Insert emoji");break;case"video":r.setAttribute("role","button"),r.setAttribute("aria-label","Record video message");break;case"screen":r.setAttribute("role","button"),r.setAttribute("aria-label","Record screen");break;case"userMentions":r.setAttribute("role","button"),r.setAttribute("aria-label","Mention user with @ symbol");break;case"format":r.setAttribute("role","button"),r.setAttribute("aria-label","Show format options");break;default:r.setAttribute("role","group"),r.setAttribute("aria-label","Composer action button")}}catch{}}var kC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),rO=(r,o)=>({condition:r,data:o}),nO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-assign-user-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function oO(r,o){if(r&1){let n=Y();u(0),b(1,"app-assign-dropdown",2),F(2,"translate"),z("setAssignTo",function(t){B(n);let a=l(4);return V(a.onSetAssignTo(t))})("toggleCheckbox",function(){B(n);let t=l(4);return V(t.onToggleCheckbox())}),x(),p()}if(r&2){let n=l(3),e=l();d(),v("darkMode",!!(n.uiState!=null&&n.uiState.darkMode))("assignTo",n.data==null?null:n.data.assignTo)("selectedUserContacts",n.data==null?null:n.data.selectedUserContacts)("assignToType",(n.featureState==null?null:n.featureState.assignToType)||"dropdown")("isAssignedCheckbox",!!(n.data!=null&&n.data.isAssignedCheckbox)),k("data-testid",e.componentId+"-dropdown")("aria-label",R(2,7,"Assign user"))}}function aO(r,o){if(r&1&&(u(0),s(1,oO,3,9,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,nO,e.template,C(1,kC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function iO(r,o){if(r&1&&s(0,aO,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,rO,n.conditionSignal(),C(1,kC,n.componentConfigSignal,n.localUIStateSignal)))}}function lO(r,o){if(r&1&&y(0,iO,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var va=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-assign-user-internal",this.shouldShow=L(()=>{try{return this.defaultCondition()?this.componentConfigSignal()?.featureState?.userMentions===!0:!0}catch(e){return this.loggingService.catch("Error in shouldShow:",e),!1}})}onSetAssignTo(e){try{let t=this.getAnnotationId();if(!t)return;this.actionService.setAssignTo(t,e.assignTo)}catch(t){this.loggingService.catch("Error in onSetAssignTo:",t)}}onToggleCheckbox(){try{let e=this.getAnnotationId();if(!e)return;this.actionService.toggleAssignToCheckbox(e)}catch(e){this.loggingService.catch("Error in onToggleCheckbox:",e)}}setupA11yAttributes(){try{dO(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-assign-user-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[3,"setAssignTo","toggleCheckbox","darkMode","assignTo","selectedUserContacts","assignToType","isAssignedCheckbox"]],template:function(t,a){if(t&1&&y(0,lO,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,gp,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{width:100%}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function dO(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region"),r.setAttribute("aria-label","Assign user")}catch{}}function cO(r){try{return typeof r=="string"?JSON.parse(r):r}catch{return null}}function mO(r){try{if(typeof r=="string"){let o=parseInt(r,10);return isNaN(o)?0:o}return r??0}catch{return 0}}function sO(r){try{if(r==null||r==="")return;if(typeof r=="string"){let o=parseInt(r,10);return isNaN(o)?void 0:o}return r}catch{return}}function xC(r){try{if(typeof r=="string"){let o=r.toLowerCase();return o==="true"||o===""}return!!r}catch{return!1}}function gO(r,o){return r??o??0}function uO(r){return!!(r&&(r.url||r.file||r.name||r.fileType||r.mimeType||r.errorMessage))}function pO(r,o,n){return uO(r)?r:Array.isArray(o)&&n!=null&&n>=0&&n<o.length?o[n]:r??null}function hO(r){return r?.url??r?.downloadUrl??r?.file?.url}var Ft=(()=>{let o=class o extends te{constructor(){super(...arguments),this.file=Q(null,{transform:cO}),this.fileIndex=Q(0,{transform:mO}),this.index=Q(void 0,{transform:sO}),this.isEditMode=Q(!1,{transform:xC}),this.loading=Q(!1,{transform:xC}),this.resolvedIndex=L(()=>gO(this.index(),this.fileIndex())),this.composerDraftFileKey="selectedFiles",this.resolvedFile=L(()=>{try{return pO(this.file(),this.composerDraft()?.[this.composerDraftFileKey],this.resolvedIndex())}catch(e){return this.loggingService.catch("Error in ComposerAttachmentFileComponent resolvedFile:",e),null}})}openAttachmentInNewTab(e){try{e?.stopPropagation();let t=hO(this.resolvedFile());typeof t=="string"&&t&&window.open(t,"_blank","noopener,noreferrer")}catch(t){this.loggingService.catch("Error in openAttachmentInNewTab:",t)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["app-composer-attachment-file-base"]],inputs:{file:[1,"file"],fileIndex:[1,"fileIndex"],index:[1,"index"],isEditMode:[1,"isEditMode"],loading:[1,"loading"]},standalone:!1,features:[M],decls:0,vars:0,template:function(t,a){},encapsulation:2});let r=o;return r})();var _C=(r,o,n,e)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e}),bO=(r,o)=>({condition:r,data:o}),fO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-invalid-item-delete-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function CO(r,o){r&1&&(u(0),de(),b(1,"svg",3),E(2,"path",4)(3,"path",5),x(),p())}function kO(r,o){if(r&1){let n=Y();u(0),b(1,"button",1),z("click",function(){B(n);let t=l(2);return V(t.onDeleteClick())}),s(2,CO,4,0,"ng-container",2),x(),p()}if(r&2){let n,e=l(),t=l();d(),k("aria-label","Remove invalid file: "+(((n=t.resolvedFile())==null||n.file==null?null:n.file.name)||"unnamed file"))("data-testid",t.componentId+"-button"),d(),v("veltDynamicTemplate",O(8,fO,t.template,Ke(3,_C,t.componentConfigSignal,t.localUIStateSignal,t.resolvedFile(),t.resolvedIndex()),e.uiState==null?null:e.uiState.variant,t.setIfCondition.bind(t),t.hostElementRef))}}function xO(r,o){if(r&1&&s(0,kO,3,14,"ng-container",0),r&2){let n=l();v("veltIf",C(6,bO,n.conditionSignal(),Ke(1,_C,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex())))}}var ca=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-invalid-item-delete-internal",this.composerDraftFileKey="invalidSelectedFiles",this.deleteClicked=or()}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemDeleteComponent ngOnInit:",e)}}onDeleteClick(){try{let e=this.resolvedIndex(),t=this.resolvedFile();this.deleteClicked.emit(e);let a=this.getAnnotationId();a&&this.actionService.removeInvalidFile(a,e,this.localUIStateSignal()?.dialogInstanceId),this.loggingService.log("Invalid file delete clicked:",{fileIndex:e,fileName:t?.file?.name||"unknown",mode:a?"context":"standalone"})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemDeleteComponent onDeleteClick:",e)}}setupA11yAttributes(){try{_O(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-invalid-item-delete-internal"]],outputs:{deleteClicked:"deleteClicked"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["title","Remove File",1,"velt-composer--icon-button",3,"click"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","role","img"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"]],template:function(t,a){if(t&1&&y(0,xO,1,9,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-composer--icon-button[_ngcontent-%COMP%]{background:var(--velt-white);display:flex;align-items:center;border-radius:var(--velt-border-radius-3xl);width:40px;height:40px;justify-content:center;margin:var(--velt-spacing-xs);color:var(--velt-black)}"],changeDetection:0});let r=o;return r})();function _O(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","button"),r.setAttribute("aria-label","Remove invalid file")}catch{}}var yO=(r,o,n,e)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e}),wO=(r,o)=>({condition:r,data:o}),IO=(r,o,n,e)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e}),DO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-invalid-item-message-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function TO(r,o){if(r&1&&(u(0),b(1,"span",2),ie(2),x(),p()),r&2){let n,e,t=l(3);d(),k("data-testid",t.componentId)("aria-label","Error message: "+(((n=t.resolvedFile())==null?null:n.errorMessage)||"")),d(),fe(" ",(e=t.resolvedFile())==null?null:e.errorMessage," ")}}function OO(r,o){if(r&1&&(u(0),s(1,TO,3,3,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(6,DO,e.template,Ke(1,IO,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function EO(r,o){if(r&1&&s(0,OO,2,12,"ng-container",0),r&2){let n=l();v("veltIf",C(6,wO,n.conditionSignal(),Ke(1,yO,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex())))}}var ma=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-invalid-item-message-internal",this.composerDraftFileKey="invalidSelectedFiles"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemMessageComponent ngOnInit:",e)}}setupA11yAttributes(){try{MO(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-invalid-item-message-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-composer--error-message"]],template:function(t,a){if(t&1&&y(0,EO,1,9,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-composer--error-message[_ngcontent-%COMP%]{font-size:var(--velt-font-size-xs);text-align:center;margin-top:var(--velt-spacing-xs);color:var(--velt-text-primary)}"],changeDetection:0});let r=o;return r})();function MO(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var SC=(r,o,n,e)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e}),PO=(r,o)=>({condition:r,data:o}),FO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-invalid-item-preview-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function NO(r,o){if(r&1&&E(0,"img",2),r&2){let n,e=l(4);v("src",(n=e.resolvedFile())==null?null:n.url,vr)}}function RO(r,o){if(r&1&&(u(0),y(1,NO,1,1,"img",2),p()),r&2){let n,e=l(3);d(),w(!((n=e.resolvedFile())==null||n.file==null||n.file.type==null)&&n.file.type.includes("image")?1:-1)}}function UO(r,o){if(r&1&&(u(0),s(1,RO,2,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(6,FO,e.template,Ke(1,SC,e.componentConfigSignal,e.localUIStateSignal,e.resolvedFile(),e.resolvedIndex()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function LO(r,o){if(r&1&&s(0,UO,2,12,"ng-container",0),r&2){let n=l();v("veltIf",C(6,PO,n.conditionSignal(),Ke(1,SC,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex())))}}var sa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-invalid-item-preview-internal",this.composerDraftFileKey="invalidSelectedFiles"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemPreviewComponent ngOnInit:",e)}}setupA11yAttributes(){try{BO(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-invalid-item-preview-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["velt-ignore-change-detection","true","aria-hidden","true","role","img",3,"src"]],template:function(t,a){if(t&1&&y(0,LO,1,9,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}img[_ngcontent-%COMP%]{width:100%;object-fit:cover;height:100%}.velt-composer--invalid-file-icon[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;align-items:center;justify-content:center}"],changeDetection:0});let r=o;return r})();function BO(r,o){try{r.setAttribute("data-testid",o+"-container")}catch{}}var yC=(r,o,n,e)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e}),$O=(r,o)=>({condition:r,data:o}),jO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-invalid-item-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function GO(r,o){if(r&1){let n=Y();u(0),b(1,"div",2)(2,"div",3)(3,"velt-comment-dialog-composer-attachments-invalid-item-delete-internal",4),z("deleteClicked",function(t){B(n);let a=l(3);return V(a.handleDeleteClick(t))}),x()(),b(4,"div",5),de(),b(5,"svg",6),E(6,"path",7),x(),xt(),E(7,"velt-comment-dialog-composer-attachments-invalid-item-message-internal",8),x(),E(8,"velt-comment-dialog-composer-attachments-invalid-item-preview-internal",9),x(),p()}if(r&2){let n,e,t,a,i,c=l(3);d(),k("aria-label","Invalid file: "+(((n=c.resolvedFile())==null||n.file==null?null:n.file.name)||"unnamed file"))("data-testid",c.componentId),d(),k("aria-label","Actions for invalid file: "+(((e=c.resolvedFile())==null||e.file==null?null:e.file.name)||"unnamed file"))("data-testid",c.componentId+"-file-actions"),d(),v("componentConfigSignal",c.componentConfigSignal)("parentLocalUIState",c.localUIStateSignal)("file",c.resolvedFile())("fileIndex",c.resolvedIndex()),k("aria-label","Remove invalid file: "+(((t=c.resolvedFile())==null||t.file==null?null:t.file.name)||"unnamed file"))("data-testid",c.componentId+"-delete-file"),d(),k("aria-label","File error: "+(((a=c.resolvedFile())==null?null:a.errorMessage)||"File cannot be uploaded"))("data-testid",c.componentId+"-error-message"),d(3),v("componentConfigSignal",c.componentConfigSignal)("parentLocalUIState",c.localUIStateSignal)("file",c.resolvedFile())("fileIndex",c.resolvedIndex()),k("data-testid",c.componentId+"-error-message-text"),d(),v("componentConfigSignal",c.componentConfigSignal)("parentLocalUIState",c.localUIStateSignal)("file",c.resolvedFile())("fileIndex",c.resolvedIndex()),k("aria-label","Preview of invalid file: "+(((i=c.resolvedFile())==null||i.file==null?null:i.file.name)||"unnamed file"))("data-testid",c.componentId+"-preview-file")}}function zO(r,o){if(r&1&&(u(0),s(1,GO,9,23,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(6,jO,e.template,Ke(1,yC,e.componentConfigSignal,e.localUIStateSignal,e.resolvedFile(),e.resolvedIndex()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function HO(r,o){if(r&1&&s(0,zO,2,12,"ng-container",0),r&2){let n=l();v("veltIf",C(6,$O,n.conditionSignal(),Ke(1,yC,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex())))}}var ga=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-invalid-item-internal",this.composerDraftFileKey="invalidSelectedFiles",this.deleteFile=or()}set itemWireframe(e){e&&(this.template=e.cloneNode(!0))}handleDeleteClick(e){try{this.deleteFile.emit(e),this.loggingService.log("Invalid item delete clicked for index:",e)}catch(t){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemComponent handleDeleteClick:",t)}}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidItemComponent ngOnInit:",e)}}setupA11yAttributes(){try{WO(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-invalid-item-internal"]],inputs:{itemWireframe:"itemWireframe"},outputs:{deleteFile:"deleteFile"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","region",1,"velt-composer--invalid-selected-file"],["role","group",1,"velt-composer--selected-file-actions"],["role","button","tabindex","0",3,"deleteClicked","componentConfigSignal","parentLocalUIState","file","fileIndex"],["role","alert","aria-live","polite",1,"velt-composer--error-message"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","role","img",1,"velt-composer--error-message-icon"],["d","M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"],[3,"componentConfigSignal","parentLocalUIState","file","fileIndex"],["role","img",3,"componentConfigSignal","parentLocalUIState","file","fileIndex"]],template:function(t,a){if(t&1&&y(0,HO,1,9,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,ca,ma,sa],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-composer--invalid-selected-file[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-sm);overflow:hidden;line-height:0;position:relative;height:72px;width:85px;flex:0 0 30%;border:4px solid var(--velt-error)}.velt-composer--invalid-selected-file[_ngcontent-%COMP%] .velt-composer--error-message[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;background:color-mix(in srgb,var(--velt-surface-0) 52%,transparent);display:flex;flex-direction:column;padding:var(--velt-spacing-xs);align-items:center;justify-content:center;color:var(--velt-white);box-sizing:border-box;gap:var(--velt-spacing-md)}.velt-composer--invalid-selected-file[_ngcontent-%COMP%] .velt-composer--error-message[_ngcontent-%COMP%] .velt-composer--error-message-icon[_ngcontent-%COMP%]{height:24px;color:var(--velt-white)}.velt-composer--invalid-selected-file[_ngcontent-%COMP%] .velt-composer--selected-file-actions[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;background:color-mix(in srgb,var(--velt-surface-0) 32%,transparent);align-items:center;justify-content:center;display:none}.velt-composer--invalid-selected-file[_ngcontent-%COMP%]:hover .velt-composer--selected-file-actions[_ngcontent-%COMP%], .velt-composer--invalid-selected-file.loading[_ngcontent-%COMP%] .velt-composer--selected-file-actions[_ngcontent-%COMP%]{display:flex}.velt-composer--invalid-selected-file[_ngcontent-%COMP%]:hover .velt-composer--error-message[_ngcontent-%COMP%]{display:none}"],changeDetection:0});let r=o;return r})();function WO(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region"),r.setAttribute("aria-label","Composer invalid attachment actions")}catch{}}var wC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),YO=(r,o)=>({condition:r,data:o}),KO=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-invalid-wireframe",variant:n,setIfCondition:e,componentElementRef:t,replaceTemplate:!1}),ZO=(r,o)=>(o==null||o.file==null?null:o.file.name)||r;function XO(r,o){if(r&1){let n=Y();b(0,"div",2)(1,"velt-comment-dialog-composer-attachments-invalid-item-internal",3),z("deleteFile",function(t){B(n);let a=l(4);return V(a.handleDelete(t))}),x()()}if(r&2){let n=o.$implicit,e=o.$index,t=l(4);k("aria-label","Invalid file "+((n==null||n.file==null?null:n.file.name)||"unknown"))("data-testid",t.componentId+"-invalid-file-"+e),d(),v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("itemWireframe",t.itemTemplate)("file",n)("fileIndex",e)}}function qO(r,o){if(r&1&&(u(0),et(1,XO,2,7,"div",2,ZO),p()),r&2){let n=l(3);d(),tt(n.filesToDisplay())}}function QO(r,o){if(r&1&&(u(0),s(1,qO,3,0,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,KO,e.template,C(1,wC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function eE(r,o){if(r&1&&s(0,QO,2,10,"ng-container",0),r&2){let n=l();v("veltIf",C(4,YO,n.conditionSignal(),C(1,wC,n.componentConfigSignal,n.localUIStateSignal)))}}var ua=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-invalid-internal",this.filesChanged=or(),this.files=Q([],{transform:e=>{try{return typeof e=="string"?JSON.parse(e):Array.isArray(e)?e:[]}catch{return[]}}}),this.filesToDisplay=L(()=>{try{let e=this.files();if(e&&e.length>0)return e;let t=this.composerDraft();return t?.invalidSelectedFiles?.length?t.invalidSelectedFiles:this.localUIStateSignal()?.invalidSelectedFiles||[]}catch(e){return this.loggingService.catch("Error in filesToDisplay:",e),[]}})}handleDelete(e){try{let t=this.files();if(t&&t.length>0){let a=t.filter((i,c)=>c!==e);this.filesChanged.emit(a),this.loggingService.log("Invalid file deleted at index:",e,"Remaining files:",a.length)}}catch(t){this.loggingService.catch("Error in ComposerAttachmentsInvalidComponent handleDelete:",t)}}ngOnInit(){try{if(super.ngOnInit(),!this.itemTemplate){let e=this.template?.querySelector("velt-comment-dialog-composer-attachments-invalid-item-wireframe");ye(e)||(this.itemTemplate=e)}}catch(e){this.loggingService.catch("Error in ComposerAttachmentsInvalidComponent ngOnInit:",e)}}setupA11yAttributes(){try{tE(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-invalid-internal"]],inputs:{files:[1,"files"]},outputs:{filesChanged:"filesChanged"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","listitem"],[3,"deleteFile","componentConfigSignal","parentLocalUIState","itemWireframe","file","fileIndex"]],template:function(t,a){if(t&1&&y(0,eE,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,ga],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-sm)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function tE(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","list"),r.setAttribute("aria-label","List of invalid files")}catch{}}var nE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),oE=(r,o)=>({condition:r,data:o}),aE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),iE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-image-delete-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function lE(r,o){r&1&&(u(0),de(),b(1,"svg",4),E(2,"path",5)(3,"path",6),x(),p())}function dE(r,o){if(r&1){let n=Y();b(0,"button",2),F(1,"translate"),F(2,"translate"),z("click",function(t){return B(n),l(3).onDeleteClick(),V(t.stopPropagation())}),s(3,lE,4,0,"ng-container",3),x()}if(r&2){let n=l(2),e=l();v("title",R(1,4,"Remove File")),k("data-testid",e.componentId)("aria-label",R(2,6,"Remove file")),d(3),v("veltDynamicTemplate",O(14,iE,e.template,O(8,aE,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function vE(r,o){if(r&1&&(u(0),y(1,dE,4,20,"button",1),p()),r&2){let n=l(),e=l();d(),w(n.uiState!=null&&n.uiState.uploadingAttachments||e.loading()?-1:1)}}function cE(r,o){if(r&1&&s(0,vE,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,oE,n.conditionSignal(),O(1,nE,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var pa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-image-delete-internal",this.deleteFile=or()}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsImageDeleteComponent ngOnInit:",e)}}onDeleteClick(){try{let e=this.getAnnotationId();if(!e)return;this.actionService.deleteAttachment(e,this.resolvedIndex(),this.isEditMode(),this.localUIStateSignal()?.dialogInstanceId),this.deleteFile.emit(this.resolvedIndex())}catch(e){this.loggingService.catch("Error in onDeleteClick:",e)}}setupA11yAttributes(){try{mE(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-image-delete-internal"]],outputs:{deleteFile:"deleteFile"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[1,"velt-composer--icon-button",3,"title"],[1,"velt-composer--icon-button",3,"click","title"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","role","img"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"]],template:function(t,a){if(t&1&&y(0,cE,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-composer--icon-button[_ngcontent-%COMP%]{background:var(--velt-white);display:flex;align-items:center;border-radius:var(--velt-border-radius-3xl);width:40px;height:40px;justify-content:center;margin:var(--velt-spacing-xs);color:var(--velt-black)}"],changeDetection:0});let r=o;return r})();function mE(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","button"),r.setAttribute("aria-label","Delete attachment")}catch{}}var gE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),uE=(r,o)=>({condition:r,data:o}),pE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),hE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-image-download-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function bE(r,o){r&1&&(u(0),de(),b(1,"svg",4)(2,"g"),E(3,"rect",5),x(),b(4,"g"),E(5,"path",6),x()(),p())}function fE(r,o){if(r&1){let n=Y();b(0,"button",2),F(1,"translate"),F(2,"translate"),z("click",function(t){return B(n),l(3).onDownloadClick(),V(t.stopPropagation())}),s(3,bE,6,0,"ng-container",3),x()}if(r&2){let n=l(2),e=l();v("title",R(1,4,"Download attachment")),k("data-testid",e.componentId)("aria-label",R(2,6,"Download attachment")),d(3),v("veltDynamicTemplate",O(14,hE,e.template,O(8,pE,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function CE(r,o){if(r&1&&(u(0),y(1,fE,4,20,"button",1),p()),r&2){let n=l(),e=l();d(),w(n.uiState!=null&&n.uiState.uploadingAttachments||e.loading()?-1:1)}}function kE(r,o){if(r&1&&s(0,CE,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,uE,n.conditionSignal(),O(1,gE,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var ha=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-image-download-internal"}onDownloadClick(){try{let e=this.getAnnotationId();kp(this.actionService,e,this.resolvedFile())}catch(e){this.loggingService.catch("Error in onDownloadClick:",e)}}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsImageDownloadComponent ngOnInit:",e)}}setupA11yAttributes(){try{xE(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-image-download-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["type","button",1,"velt-composer--icon-button",3,"title"],["type","button",1,"velt-composer--icon-button",3,"click","title"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","currentColor","aria-hidden","true","role","img"],["fill","none","height","24","width","24"],["d","M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z"]],template:function(t,a){if(t&1&&y(0,kE,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-composer--icon-button[_ngcontent-%COMP%]{background:var(--velt-white);display:flex;align-items:center;border-radius:var(--velt-border-radius-3xl);width:40px;height:40px;justify-content:center;margin:var(--velt-spacing-xs);color:var(--velt-black);border:0;cursor:pointer;padding:0}"],changeDetection:0});let r=o;return r})();function xE(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}function kp(r,o,n){try{if(!r||typeof r.downloadAttachment!="function"||!o||!n)return!1;let e=n.name??n.file?.name??n.fileName,t=n.url??n.downloadUrl??n.file?.url,a=e||t?f(g({},n),{name:e,url:t}):n;return r.downloadAttachment(o,a),!0}catch{return!1}}var IC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),SE=(r,o)=>({condition:r,data:o}),yE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-image-loading-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function wE(r,o){r&1&&(u(0),de(),b(1,"svg",2)(2,"circle",3),E(3,"animateTransform",4),x()(),p())}function IE(r,o){if(r&1&&(u(0),s(1,wE,4,0,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(7,yE,e.template,O(1,IC,e.componentConfigSignal,e.localUIStateSignal,e.resolvedFile(),e.resolvedIndex(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function DE(r,o){if(r&1&&s(0,IE,2,13,"ng-container",0),r&2){let n=l(2);v("veltIf",C(7,SE,n.conditionSignal(),O(1,IC,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}function TE(r,o){if(r&1&&y(0,DE,1,10,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var ba=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-image-loading-internal",this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal(),t=this.resolvedFile(),a=this.isEditMode();return(e?.uiState?.uploadingAttachments||this.loading())&&!a&&!t?.uploaded}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsImageLoadingComponent shouldShow:",e),!1}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsImageLoadingComponent ngOnInit:",e)}}setupA11yAttributes(){try{OE(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-image-loading-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","width","48px","height","48px","viewBox","0 0 100 100","preserveAspectRatio","xMidYMid","aria-hidden","true","role","img",2,"margin","auto","display","block"],["cx","50","cy","50","fill","none","stroke","currentColor","stroke-width","7","r","34","stroke-dasharray","160.22122533307947 55.40707511102649"],["attributeName","transform","type","rotate","repeatCount","indefinite","dur","1s","values","0 50 50;360 50 50","keyTimes","0;1"]],template:function(t,a){if(t&1&&y(0,TE,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}svg[_ngcontent-%COMP%]{color:var(--velt-white)}"],changeDetection:0});let r=o;return r})();function OE(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","status"),r.setAttribute("aria-label","Uploading image")}catch{}}var ME=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),AE=(r,o)=>({condition:r,data:o}),PE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),FE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-image-preview-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function NE(r,o){if(r&1&&(u(0),E(1,"img",2),p()),r&2){let n,e=l(3);d(),v("src",(n=e.resolvedFile())==null?null:n.url,vr)}}function RE(r,o){if(r&1&&(u(0),s(1,NE,2,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,FE,e.template,O(1,PE,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function UE(r,o){if(r&1&&s(0,RE,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,AE,n.conditionSignal(),O(1,ME,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var fa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-image-preview-internal"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsImagePreviewComponent ngOnInit:",e)}}setupA11yAttributes(){try{LE(this.hostElementRef.nativeElement,this.componentId,this.resolvedFile())}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-image-preview-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["velt-ignore-change-detection","true","aria-hidden","true","role","img",3,"src"]],template:function(t,a){if(t&1&&y(0,UE,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}img[_ngcontent-%COMP%]{width:100%;object-fit:cover;height:100%}"],changeDetection:0});let r=o;return r})();function LE(r,o,n){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","img");let e=n?.file?.name||n?.name||"Attachment image";r.setAttribute("aria-label",`Preview of ${e}`)}catch{}}var DC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),VE=(r,o)=>({condition:r,data:o}),$E=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-image-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function jE(r,o){if(r&1){let n=Y();u(0),b(1,"div",3),z("click",function(t){B(n);let a=l(4);return V(a.openAttachmentInNewTab(t))}),b(2,"div",4),E(3,"velt-comment-dialog-composer-attachments-image-loading-internal",5)(4,"velt-comment-dialog-composer-attachments-image-download-internal",6),b(5,"velt-comment-dialog-composer-attachments-image-delete-internal",7),z("deleteFile",function(t){B(n);let a=l(4);return V(a.handleDelete(t))}),x()(),E(6,"velt-comment-dialog-composer-attachments-image-preview-internal",8),x(),p()}if(r&2){let n,e,t,a,i,c,m=l(4);d(),k("aria-label","Image attachment: "+(((n=m.resolvedFile())==null||n.file==null?null:n.file.name)||((n=m.resolvedFile())==null?null:n.name)||"unnamed image"))("data-testid",m.componentId+"-selected-file"),d(),k("aria-label","Actions for image: "+(((e=m.resolvedFile())==null||e.file==null?null:e.file.name)||((e=m.resolvedFile())==null?null:e.name)||"unnamed image"))("data-testid",m.componentId+"-file-actions"),d(),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("file",m.resolvedFile())("fileIndex",m.resolvedIndex())("isEditMode",m.isEditMode())("loading",m.loading()),k("aria-label","Uploading image: "+(((t=m.resolvedFile())==null||t.file==null?null:t.file.name)||((t=m.resolvedFile())==null?null:t.name)||"unnamed image"))("data-testid",m.componentId+"-file-loading"),d(),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("file",m.resolvedFile())("fileIndex",m.resolvedIndex())("isEditMode",m.isEditMode())("loading",m.loading()),k("aria-label","Download image: "+(((a=m.resolvedFile())==null||a.file==null?null:a.file.name)||((a=m.resolvedFile())==null?null:a.name)||"unnamed image"))("data-testid",m.componentId+"-file-download"),d(),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("file",m.resolvedFile())("fileIndex",m.resolvedIndex())("isEditMode",m.isEditMode())("loading",m.loading()),k("aria-label","Delete image: "+(((i=m.resolvedFile())==null||i.file==null?null:i.file.name)||((i=m.resolvedFile())==null?null:i.name)||"unnamed image"))("data-testid",m.componentId+"-file-delete"),d(),v("componentConfigSignal",m.componentConfigSignal)("parentLocalUIState",m.localUIStateSignal)("file",m.resolvedFile())("fileIndex",m.resolvedIndex())("isEditMode",m.isEditMode()),k("aria-label","Preview of image: "+(((c=m.resolvedFile())==null||c.file==null?null:c.file.name)||((c=m.resolvedFile())==null?null:c.name)||"unnamed image"))("data-testid",m.componentId+"-file-preview")}}function GE(r,o){if(r&1&&(u(0),b(1,"div",1),s(2,jE,7,35,"ng-container",2),x(),p()),r&2){let n=l(2),e=l();d(),pe("velt-composer-attachment--loading",e.isLoading()),d(),v("veltDynamicTemplate",O(9,$E,e.template,O(3,DC,e.componentConfigSignal,e.localUIStateSignal,e.resolvedFile(),e.resolvedIndex(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function zE(r,o){if(r&1&&s(0,GE,3,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(7,VE,n.conditionSignal(),O(1,DC,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}function HE(r,o){if(r&1&&y(0,zE,1,10,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Ca=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-image-internal",this.domService=ge(Ne),this.deleteFile=or(),this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.resolvedFile();return this.isEditMode()?e?.mimeType?.includes("image")??!1:e?.fileType?.includes("image")??!1}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsImageComponent shouldShow:",e),!1}}),this.isLoading=L(()=>{try{let e=this.componentConfigSignal(),t=this.resolvedFile(),a=this.isEditMode(),i=this.loading();return(e?.uiState?.uploadingAttachments||i)&&!a&&!t?.uploaded}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsImageComponent isLoading:",e),!1}})}get imageWireframe(){return this._imageWireframe}set imageWireframe(e){this._imageWireframe=e,this._imageWireframe?this.template=this.domService.deepCloneElement(this._imageWireframe):this.template=null}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsImageComponent ngOnInit:",e)}}handleDelete(e){try{this.deleteFile.emit(e)}catch(t){this.loggingService.catch("Error in ComposerAttachmentsImageComponent handleDelete:",t)}}setupA11yAttributes(){try{WE(this.hostElementRef.nativeElement,this.componentId,this.resolvedFile())}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-image-internal"]],inputs:{imageWireframe:"imageWireframe"},outputs:{deleteFile:"deleteFile"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[1,"velt-composer-attachment-container"],[4,"veltDynamicTemplate"],["role","region",1,"velt-composer--selected-file",3,"click"],["role","group",1,"velt-composer--selected-file-actions"],[3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"],["role","button","tabindex","0",3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"],["role","button","tabindex","0",3,"deleteFile","componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"],["role","img",3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode"]],template:function(t,a){if(t&1&&y(0,HE,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,pa,ha,ba,fa],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}.velt-composer--selected-file[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-sm);overflow:hidden;line-height:0;position:relative;height:80px;width:93px;flex:0 0 30%}.velt-composer--selected-file[_ngcontent-%COMP%] .velt-composer--selected-file-actions[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;background:color-mix(in srgb,var(--velt-surface-0) 32%,transparent);align-items:center;justify-content:center;display:none}.velt-composer--selected-file[_ngcontent-%COMP%]:hover .velt-composer--selected-file-actions[_ngcontent-%COMP%], .velt-composer-attachment--loading[_ngcontent-%COMP%] .velt-composer--selected-file[_ngcontent-%COMP%] .velt-composer--selected-file-actions[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let r=o;return r})();function WE(r,o,n){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","group");let e=n?.file?.name||n?.name||"unnamed image";r.setAttribute("aria-label",`Image attachment: ${e}`)}catch{}}var YE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),KE=(r,o)=>({condition:r,data:o}),ZE=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),XE=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-delete-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function qE(r,o){r&1&&(u(0),de(),b(1,"svg",4),E(2,"path",5),x(),p())}function QE(r,o){if(r&1){let n=Y();b(0,"button",2),F(1,"translate"),F(2,"translate"),z("click",function(t){return B(n),l(3).onDeleteClick(),V(t.stopPropagation())}),s(3,qE,3,0,"ng-container",3),x()}if(r&2){let n,e=l(2),t=l();k("data-testid",t.componentId+"-button")("aria-label",R(1,3,"Delete file")+" "+R(2,5,((n=t.resolvedFile())==null||n.file==null?null:n.file.name)||"unknown")),d(3),v("veltDynamicTemplate",O(13,XE,t.template,O(7,ZE,t.componentConfigSignal,t.localUIStateSignal,t.resolvedIndex(),t.resolvedFile(),t.isEditMode()),e.uiState==null?null:e.uiState.variant,t.setIfCondition.bind(t),t.elementRef))}}function eM(r,o){if(r&1&&(u(0),y(1,QE,4,19,"button",1),p()),r&2){let n=l(),e=l();d(),w(n.uiState!=null&&n.uiState.uploadingAttachments||e.loading()?-1:1)}}function tM(r,o){if(r&1&&s(0,eM,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,KE,n.conditionSignal(),O(1,YE,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var ka=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-delete-internal",this.deleteFile=or()}onDeleteClick(){try{let e=this.getAnnotationId();if(!e)return;this.actionService.deleteAttachment(e,this.resolvedIndex(),this.isEditMode(),this.localUIStateSignal()?.dialogInstanceId),this.deleteFile.emit(this.resolvedIndex())}catch(e){this.loggingService.catch("Error in onDeleteClick:",e)}}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherDeleteComponent ngOnInit:",e)}}setupA11yAttributes(){try{rM(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-delete-internal"]],outputs:{deleteFile:"deleteFile"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[1,"velt-composer--attachment-icon-btn"],[1,"velt-composer--attachment-icon-btn",3,"click"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg","width","18","height","19","viewBox","0 0 18 19","fill","none","aria-hidden","true","role","img"],["d","M13.5 5L4.5 14M4.5 5L13.5 14","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,a){if(t&1&&y(0,tM,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-composer--attachment-icon-btn[_ngcontent-%COMP%]{display:flex;background:transparent;border:0;padding:var(--velt-spacing-sm);cursor:pointer;color:var(--velt-error)}"],changeDetection:0});let r=o;return r})();function rM(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","button"),r.setAttribute("aria-label","Delete attachment")}catch{}}var oM=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),aM=(r,o)=>({condition:r,data:o}),iM=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),lM=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-download-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function dM(r,o){r&1&&(u(0),de(),b(1,"svg",4),E(2,"path",5),x(),p())}function vM(r,o){if(r&1){let n=Y();b(0,"button",2),F(1,"translate"),F(2,"translate"),z("click",function(t){return B(n),l(3).onDownloadClick(),V(t.stopPropagation())}),s(3,dM,3,0,"ng-container",3),x()}if(r&2){let n=l(2),e=l();k("title",R(1,4,"Download attachment"))("data-testid",e.componentId+"-button")("aria-label",R(2,6,"Download attachment")),d(3),v("veltDynamicTemplate",O(14,lM,e.template,O(8,iM,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function cM(r,o){if(r&1&&(u(0),y(1,vM,4,20,"button",1),p()),r&2){let n=l(),e=l();d(),w(n.uiState!=null&&n.uiState.uploadingAttachments||e.loading()?-1:1)}}function mM(r,o){if(r&1&&s(0,cM,2,1,"ng-container",0),r&2){let n=l();v("veltIf",C(7,aM,n.conditionSignal(),O(1,oM,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var xa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-download-internal"}onDownloadClick(){try{let e=this.getAnnotationId();kp(this.actionService,e,this.resolvedFile())}catch(e){this.loggingService.catch("Error in onDownloadClick:",e)}}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherDownloadComponent ngOnInit:",e)}}setupA11yAttributes(){try{sM(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-download-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["type","button",1,"velt-composer--attachment-icon-btn"],["type","button",1,"velt-composer--attachment-icon-btn",3,"click"],[4,"veltDynamicTemplate"],["width","18","height","19","viewBox","0 0 18 19","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false","role","img"],["d","M3 13.25V14.75C3 15.1478 3.15804 15.5294 3.43934 15.8107C3.72064 16.092 4.10218 16.25 4.5 16.25H13.5C13.8978 16.25 14.2794 16.092 14.5607 15.8107C14.842 15.5294 15 15.1478 15 14.75V13.25M5.25 8.75L9 12.5M9 12.5L12.75 8.75M9 12.5V3.5","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,a){if(t&1&&y(0,mM,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-composer--attachment-icon-btn[_ngcontent-%COMP%]{display:flex;background:transparent;border:0;padding:var(--velt-spacing-sm);cursor:pointer;color:var(--velt-accent)}"],changeDetection:0});let r=o;return r})();function sM(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var uM=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),pM=(r,o)=>({condition:r,data:o}),hM=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),bM=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-icon-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function fM(r,o){if(r&1&&(u(0),b(1,"div",2),E(2,"velt-file-icon-internal",3),x(),p()),r&2){let n,e=l(3);d(),k("data-testid",e.componentId),d(),v("type",e.isEditMode()?(n=e.resolvedFile())==null?null:n.mimeType:(n=e.resolvedFile())==null?null:n.fileType),k("data-testid",e.componentId+"-file-icon-internal")}}function CM(r,o){if(r&1&&(u(0),s(1,fM,3,3,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,bM,e.template,O(1,hM,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function kM(r,o){if(r&1&&s(0,CM,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,pM,n.conditionSignal(),O(1,uM,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var _a=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-icon-internal"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherIconComponent ngOnInit:",e)}}setupA11yAttributes(){try{xM(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-icon-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-composer--attachment-icon"],[3,"type"]],template:function(t,a){if(t&1&&y(0,kM,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Gg],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-composer--attachment-icon[_ngcontent-%COMP%]{display:flex;color:var(--velt-accent)}"],changeDetection:0});let r=o;return r})();function xM(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","img"),r.setAttribute("aria-label","File type icon")}catch{}}var SM=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),yM=(r,o)=>({condition:r,data:o}),wM=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),IM=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-loading-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function DM(r,o){if(r&1&&(u(0),de(),b(1,"svg",2)(2,"circle",3),E(3,"animateTransform",4),x()(),p()),r&2){let n=l(4);d(),k("data-testid",n.componentId+"-svg")}}function TM(r,o){if(r&1&&(u(0),s(1,DM,4,1,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(7,IM,e.template,O(1,wM,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function OM(r,o){if(r&1&&s(0,TM,2,13,"ng-container",0),r&2){let n=l(2);v("veltIf",C(7,yM,n.conditionSignal(),O(1,SM,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}function EM(r,o){if(r&1&&y(0,OM,1,10,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Sa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-loading-internal",this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal(),t=this.resolvedFile(),a=this.isEditMode();return(e?.uiState?.uploadingAttachments||this.loading())&&!a&&!t?.uploaded}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsOtherLoadingComponent shouldShow:",e),!1}})}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherLoadingComponent ngOnInit:",e)}}setupA11yAttributes(){try{MM(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-loading-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","width","32px","height","32px","viewBox","0 0 100 100","preserveAspectRatio","xMidYMid","aria-hidden","true","role","img",2,"margin","auto","display","block"],["cx","50","cy","50","fill","none","stroke","currentColor","stroke-width","7","r","34","stroke-dasharray","160.22122533307947 55.40707511102649"],["attributeName","transform","type","rotate","repeatCount","indefinite","dur","1s","values","0 50 50;360 50 50","keyTimes","0;1"]],template:function(t,a){if(t&1&&y(0,EM,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}svg[_ngcontent-%COMP%]{color:var(--velt-accent)}"],changeDetection:0});let r=o;return r})();function MM(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","status"),r.setAttribute("aria-label","Uploading file")}catch{}}var PM=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),FM=(r,o)=>({condition:r,data:o}),NM=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),RM=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-name-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function UM(r,o){if(r&1&&(u(0),b(1,"span",2),F(2,"translate"),ie(3),F(4,"translate"),x(),p()),r&2){let n,e,t=l(3);d(),k("data-testid",t.componentId)("aria-label",t.isEditMode()?(n=t.resolvedFile())==null?null:n.name:R(2,3,(n=t.resolvedFile())==null||n.file==null?null:n.file.name)),d(2),fe(" ",t.isEditMode()?(e=t.resolvedFile())==null?null:e.name:R(4,5,(e=t.resolvedFile())==null||e.file==null?null:e.file.name)," ")}}function LM(r,o){if(r&1&&(u(0),s(1,UM,5,7,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,RM,e.template,O(1,NM,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function BM(r,o){if(r&1&&s(0,LM,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,FM,n.conditionSignal(),O(1,PM,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var ya=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-name-internal"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherNameComponent ngOnInit:",e)}}setupA11yAttributes(){try{VM(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-name-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-composer--attachment-name"]],template:function(t,a){if(t&1&&y(0,BM,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);line-height:normal}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-composer--attachment-name[_ngcontent-%COMP%]{overflow:hidden;color:var(--velt-text-3);text-overflow:ellipsis;font-size:var(--velt-font-size-xs);font-style:normal;font-weight:600;line-height:normal;white-space:nowrap}"],changeDetection:0});let r=o;return r})();function VM(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var jM=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),GM=(r,o)=>({condition:r,data:o}),zM=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,fileIndex:n,file:e,isEditMode:t}),HM=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-size-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function WM(r,o){if(r&1&&(u(0),b(1,"span",2),F(2,"fileSize"),ie(3),F(4,"fileSize"),x(),p()),r&2){let n,e,t=l(3);d(),k("data-testid",t.componentId)("aria-label",t.isEditMode()?(n=t.resolvedFile())==null?null:n.size:R(2,3,(n=t.resolvedFile())==null||n.file==null?null:n.file.size)),d(2),fe(" ",t.isEditMode()?(e=t.resolvedFile())==null?null:e.size:R(4,5,(e=t.resolvedFile())==null||e.file==null?null:e.file.size)," ")}}function JM(r,o){if(r&1&&(u(0),s(1,WM,5,7,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(7,HM,e.template,O(1,zM,e.componentConfigSignal,e.localUIStateSignal,e.resolvedIndex(),e.resolvedFile(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function YM(r,o){if(r&1&&s(0,JM,2,13,"ng-container",0),r&2){let n=l();v("veltIf",C(7,GM,n.conditionSignal(),O(1,jM,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}var wa=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-size-internal"}ngOnInit(){try{super.ngOnInit(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef.nativeElement,{componentConfigSignal:this.componentConfigSignal,file:this.resolvedFile(),fileIndex:this.resolvedIndex(),isEditMode:this.isEditMode()})}catch(e){this.loggingService.catch("Error in ComposerAttachmentsOtherSizeComponent ngOnInit:",e)}}setupA11yAttributes(){try{KM(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-size-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-composer--attachment-size"]],template:function(t,a){if(t&1&&y(0,YM,1,10,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Wg],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);line-height:normal}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-composer--attachment-size[_ngcontent-%COMP%]{overflow:hidden;color:var(--velt-text-7);text-overflow:ellipsis;font-size:var(--velt-font-size-2xs);font-style:normal;font-weight:500;line-height:normal}"],changeDetection:0});let r=o;return r})();function KM(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","presentation")}catch{}}var TC=(r,o,n,e,t)=>({componentConfigSignal:r,parentLocalUIState:o,file:n,fileIndex:e,isEditMode:t}),XM=(r,o)=>({condition:r,data:o}),qM=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-other-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function QM(r,o){if(r&1){let n=Y();u(0),b(1,"div",3),F(2,"translate"),F(3,"translate"),z("click",function(t){B(n);let a=l(4);return V(a.openAttachmentInNewTab(t))}),E(4,"velt-comment-dialog-composer-attachments-other-icon-internal",4),F(5,"translate"),F(6,"translate"),b(7,"div",5),F(8,"translate"),F(9,"translate"),E(10,"velt-comment-dialog-composer-attachments-other-name-internal",6),F(11,"translate"),F(12,"translate"),E(13,"velt-comment-dialog-composer-attachments-other-size-internal",6),F(14,"translate"),F(15,"translate"),x(),E(16,"velt-comment-dialog-composer-attachments-other-loading-internal",7),F(17,"translate"),F(18,"translate"),b(19,"div",8),F(20,"translate"),F(21,"translate"),E(22,"velt-comment-dialog-composer-attachments-other-download-internal",9),F(23,"translate"),F(24,"translate"),b(25,"velt-comment-dialog-composer-attachments-other-delete-internal",10),F(26,"translate"),F(27,"translate"),z("deleteFile",function(t){B(n);let a=l(4);return V(a.handleDelete(t))}),x()()(),p()}if(r&2){let n,e,t,a,i,c,m,h,_,I=l(4);d(),k("aria-label",R(2,51,"File attachment:")+" "+R(3,53,((n=I.resolvedFile())==null?null:n.name)||((n=I.resolvedFile())==null||n.file==null?null:n.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode()),k("aria-label",R(5,55,"File type icon for")+" "+R(6,57,((e=I.resolvedFile())==null?null:e.name)||((e=I.resolvedFile())==null||e.file==null?null:e.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment-icon"),d(3),k("aria-label",R(8,59,"Details for file:")+" "+R(9,61,((t=I.resolvedFile())==null?null:t.name)||((t=I.resolvedFile())==null||t.file==null?null:t.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment-details"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode()),k("aria-label",R(11,63,"Filename:")+" "+R(12,65,((a=I.resolvedFile())==null?null:a.name)||((a=I.resolvedFile())==null||a.file==null?null:a.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment-name"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode()),k("aria-label",R(14,67,"File size:")+" "+R(15,69,((i=I.resolvedFile())==null?null:i.size)||((i=I.resolvedFile())==null||i.file==null?null:i.file.size)||"unknown size"))("data-testid",I.componentId+"-attachment-size"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode())("loading",I.loading()),k("aria-label",R(17,71,"Uploading file:")+" "+R(18,73,((c=I.resolvedFile())==null?null:c.name)||((c=I.resolvedFile())==null||c.file==null?null:c.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment-loading"),d(3),k("aria-label",R(20,75,"Actions for file:")+" "+R(21,77,((m=I.resolvedFile())==null?null:m.name)||((m=I.resolvedFile())==null||m.file==null?null:m.file.name)||"unnamed file"))("data-testid",I.componentId+"-attachment-actions"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode())("loading",I.loading()),k("aria-label",R(23,79,"Download file:")+" "+R(24,81,((h=I.resolvedFile())==null?null:h.name)||((h=I.resolvedFile())==null||h.file==null?null:h.file.name)||"unnamed file"))("data-testid",I.componentId+"-download-attachment"),d(3),v("componentConfigSignal",I.componentConfigSignal)("parentLocalUIState",I.localUIStateSignal)("file",I.resolvedFile())("fileIndex",I.resolvedIndex())("isEditMode",I.isEditMode())("loading",I.loading()),k("aria-label",R(26,83,"Remove file:")+" "+R(27,85,((_=I.resolvedFile())==null?null:_.name)||((_=I.resolvedFile())==null||_.file==null?null:_.file.name)||"unnamed file"))("data-testid",I.componentId+"-delete-attachment")}}function e5(r,o){if(r&1&&(u(0),b(1,"div",1),s(2,QM,28,87,"ng-container",2),x(),p()),r&2){let n=l(2),e=l();d(),pe("velt-composer-attachment--loading",e.isLoading()),d(),v("veltDynamicTemplate",O(9,qM,e.template,O(3,TC,e.componentConfigSignal,e.localUIStateSignal,e.resolvedFile(),e.resolvedIndex(),e.isEditMode()),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function t5(r,o){if(r&1&&s(0,e5,3,15,"ng-container",0),r&2){let n=l(2);v("veltIf",C(7,XM,n.conditionSignal(),O(1,TC,n.componentConfigSignal,n.localUIStateSignal,n.resolvedFile(),n.resolvedIndex(),n.isEditMode())))}}function r5(r,o){if(r&1&&y(0,t5,1,10,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Ia=(()=>{let o=class o extends Ft{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-other-internal",this.domService=ge(Ne),this.deleteFile=or(),this.isLoading=L(()=>{try{let e=this.componentConfigSignal(),t=this.resolvedFile(),a=this.isEditMode(),i=this.loading();return(e?.uiState?.uploadingAttachments||i)&&!a&&!t?.uploaded}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsOtherComponent isLoading:",e),!1}}),this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.resolvedFile();return this.isEditMode()?!e?.mimeType?.includes("image"):!e?.fileType?.includes("image")}catch(e){return this.loggingService.catch("Error in ComposerAttachmentsOtherComponent shouldShow:",e),!1}})}get otherWireframe(){return this._otherWireframe}set otherWireframe(e){this._otherWireframe=e,this._otherWireframe?this.template=this.domService.deepCloneElement(this._otherWireframe):this.template=null}handleDelete(e){try{this.deleteFile.emit(e)}catch(t){this.loggingService.catch("Error in ComposerAttachmentsOtherComponent handleDelete:",t)}}setupA11yAttributes(){try{n5(this.hostElementRef.nativeElement,this.componentId,this.resolvedFile())}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-other-internal"]],inputs:{otherWireframe:"otherWireframe"},outputs:{deleteFile:"deleteFile"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[1,"velt-composer-attachment-container"],[4,"veltDynamicTemplate"],["role","region",1,"velt-composer--other-attachment",3,"click"],["role","img",3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode"],["role","group",1,"velt-composer--attachment-details"],[3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode"],["role","status","aria-live","polite",3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"],["role","group",1,"velt-composer--attachment-actions"],["role","button","tabindex","0",3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"],["role","button","tabindex","0",3,"deleteFile","componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading"]],template:function(t,a){if(t&1&&y(0,r5,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,ka,xa,_a,Sa,ya,wa,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);width:100%}[_nghost-%COMP%]:empty{display:none}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}.velt-composer--other-attachment[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-sm) var(--velt-spacing-xs) var(--velt-spacing-sm) var(--velt-spacing-md);justify-content:space-between;gap:var(--velt-spacing-sm);align-items:center;align-self:stretch;width:100%;border-radius:var(--velt-border-radius-sm);border:1px solid var(--velt-border-4);box-sizing:border-box}.velt-composer--other-attachment[_ngcontent-%COMP%] .velt-composer--attachment-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-xs);flex:1;overflow:hidden}.velt-composer--other-attachment[_ngcontent-%COMP%] .velt-composer--attachment-actions[_ngcontent-%COMP%]{display:flex;width:0;overflow:hidden}.velt-composer--other-attachment[_ngcontent-%COMP%]:not(:last-child){margin-bottom:var(--velt-spacing-lg)}.velt-composer--other-attachment[_ngcontent-%COMP%]:hover .velt-composer--attachment-actions[_ngcontent-%COMP%]{width:auto}"],changeDetection:0});let r=o;return r})();function n5(r,o,n){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region");let e=n?.file?.name||n?.name||"unnamed file";r.setAttribute("aria-label",`File attachment: ${e}`)}catch{}}var OC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),a5=(r,o)=>({condition:r,data:o}),i5=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-selected-wireframe",variant:n,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function l5(r,o){return(this.isEditMode()?o==null?null:o.attachmentId:o==null?null:o.url)||r}var d5=(r,o)=>(o==null?null:o.attachmentId)||r,v5=(r,o)=>(o==null?null:o.url)||r;function c5(r,o){if(r&1){let n=Y();b(0,"velt-comment-dialog-composer-attachments-image-internal",3),z("deleteFile",function(t){B(n);let a=l(5);return V(a.handleDelete(t))}),x(),b(1,"velt-comment-dialog-composer-attachments-other-internal",4),z("deleteFile",function(t){B(n);let a=l(5);return V(a.handleDelete(t))}),x()}if(r&2){let n=o.$implicit,e=o.$index,t=l(5);v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",t.isEditMode())("loading",t.loading())("imageWireframe",t.imageTemplate),d(),v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",t.isEditMode())("loading",t.loading())("otherWireframe",t.otherTemplate)}}function m5(r,o){if(r&1&&(b(0,"div",2),et(1,c5,2,14,null,null,l5,!0),x()),r&2){let n=l(4);k("aria-label","Attached files - "+n.files().length+" total attachments")("data-testid",n.componentId+"-attachments-list"),d(),tt(n.files())}}function s5(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-attachments-image-internal",5)(1,"velt-comment-dialog-composer-attachments-other-internal",6),r&2){let n=o.$implicit,e=o.$index,t=l(6);v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",!0)("imageWireframe",t.imageTemplate),d(),v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",!0)("otherWireframe",t.otherTemplate)}}function g5(r,o){if(r&1&&et(0,s5,2,12,null,null,d5),r&2){let n,e=l(5);tt((n=e.editComment())==null?null:n.attachments)}}function u5(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-attachments-image-internal",5)(1,"velt-comment-dialog-composer-attachments-other-internal",6),r&2){let n=o.$implicit,e=o.$index,t=l(6);v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",!1)("imageWireframe",t.imageTemplate),d(),v("componentConfigSignal",t.componentConfigSignal)("parentLocalUIState",t.localUIStateSignal)("file",n)("fileIndex",e)("isEditMode",!1)("otherWireframe",t.otherTemplate)}}function p5(r,o){if(r&1&&et(0,u5,2,12,null,null,v5),r&2){let n=l(5);tt(n.selectedFiles())}}function h5(r,o){if(r&1&&(b(0,"div",2),y(1,g5,2,0),y(2,p5,2,0),x()),r&2){let n,e,t,a=l(4);k("aria-label","Attached files - "+((((n=a.editComment())==null||n.attachments==null?null:n.attachments.length)||0)+(((n=a.selectedFiles())==null?null:n.length)||0))+" total attachments")("data-testid",a.componentId+"-attachments-list"),d(),w((e=a.editComment())!=null&&e.attachments?1:-1),d(),w((t=a.selectedFiles())!=null&&t.length?2:-1)}}function b5(r,o){if(r&1&&(u(0),y(1,m5,3,2,"div",2)(2,h5,3,4,"div",2),p()),r&2){let n,e=l(3);d(),w(e.files()&&e.files().length>0?1:!((n=e.editComment())==null||n.attachments==null)&&n.attachments.length||(n=e.selectedFiles())!=null&&n.length?2:-1)}}function f5(r,o){if(r&1&&(u(0),s(1,b5,3,1,"ng-container",1),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,i5,e.template,C(1,OC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.hostElementRef))}}function C5(r,o){if(r&1&&s(0,f5,2,10,"ng-container",0),r&2){let n=l();v("veltIf",C(4,a5,n.conditionSignal(),C(1,OC,n.componentConfigSignal,n.localUIStateSignal)))}}var Da=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-selected-internal",this.domService=ge(Ne),this.editComment=L(()=>this.localUIStateSignal()?.editComment??null),this.selectedFiles=L(()=>this.composerDraft()?.selectedFiles??this.localUIStateSignal()?.selectedFiles??[]),this.filesChanged=or(),this.files=Q([],{transform:e=>{try{return typeof e=="string"?JSON.parse(e):Array.isArray(e)?e:[]}catch{return[]}}}),this.isEditMode=Q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true":e}catch{return!1}}}),this.loading=Q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true":e}catch{return!1}}})}handleDelete(e){try{let t=this.files();if(t&&t.length>0){let a=t.filter((i,c)=>c!==e);this.filesChanged.emit(a),this.loggingService.log("File deleted at index:",e,"Remaining files:",a.length)}}catch(t){this.loggingService.catch("Error in ComposerAttachmentsSelectedComponent handleDelete:",t)}}ngOnInit(){try{if(super.ngOnInit(),!this.imageTemplate){let e=this.template?.querySelector("velt-comment-dialog-composer-attachments-image-wireframe");ye(e)||(this.imageTemplate=e)}if(!this.otherTemplate){let e=this.template?.querySelector("velt-comment-dialog-composer-attachments-other-wireframe");ye(e)||(this.otherTemplate=e)}}catch(e){this.loggingService.catch("Error in ComposerAttachmentsSelectedComponent ngOnInit:",e)}}setupA11yAttributes(){try{k5(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-selected-internal"]],inputs:{files:[1,"files"],isEditMode:[1,"isEditMode"],loading:[1,"loading"]},outputs:{filesChanged:"filesChanged"},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","list",1,"velt-comment-dialog-composer-attachments--selected"],[3,"deleteFile","componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading","imageWireframe"],[3,"deleteFile","componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","loading","otherWireframe"],[3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","imageWireframe"],[3,"componentConfigSignal","parentLocalUIState","file","fileIndex","isEditMode","otherWireframe"]],template:function(t,a){if(t&1&&y(0,C5,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Ca,Ia],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{width:100%}[_nghost-%COMP%]:empty{display:none}.velt-comment-dialog-composer-attachments--selected[_ngcontent-%COMP%]{width:100%;display:flex;flex-wrap:wrap;gap:var(--velt-spacing-sm);flex-direction:row;padding:var(--velt-spacing-xs);box-sizing:border-box}"],changeDetection:0});let r=o;return r})();function k5(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","list"),r.setAttribute("aria-label","List of selected attachments")}catch{}}var EC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),_5=(r,o)=>({condition:r,data:o}),S5=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-attachments-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function y5(r,o){if(r&1&&(u(0),b(1,"div",2),F(2,"translate"),F(3,"translate"),F(4,"translate"),E(5,"velt-comment-dialog-composer-attachments-selected-internal",3)(6,"velt-comment-dialog-composer-attachments-invalid-internal",3),x(),p()),r&2){let n=l(4);d(),k("aria-label",R(2,6,"File attachments")+" - "+n.selectedFilesCount()+" "+R(3,8,"valid")+", "+n.invalidFilesCount()+" "+R(4,10,"invalid files"))("data-testid",n.componentId),d(4),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal),d(),v("componentConfigSignal",n.componentConfigSignal)("parentLocalUIState",n.localUIStateSignal)}}function w5(r,o){if(r&1&&(u(0),s(1,y5,7,12,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,S5,e.template,C(1,EC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function I5(r,o){if(r&1&&s(0,w5,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,_5,n.conditionSignal(),C(1,EC,n.componentConfigSignal,n.localUIStateSignal)))}}function D5(r,o){if(r&1&&y(0,I5,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Ta=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-attachments-internal",this.selectedFilesCount=L(()=>(this.composerDraft()?.selectedFiles??this.localUIStateSignal()?.selectedFiles)?.length||0),this.invalidFilesCount=L(()=>(this.composerDraft()?.invalidSelectedFiles??this.localUIStateSignal()?.invalidSelectedFiles)?.length||0),this.shouldShow=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.composerDraft(),t=this.localUIStateSignal();return!!(t?.editComment||(e?.selectedFiles??t?.selectedFiles)?.length||(e?.invalidSelectedFiles??t?.invalidSelectedFiles)?.length)}catch(e){return this.loggingService.catch("Error in shouldShow:",e),!1}})}setupA11yAttributes(){try{T5(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-attachments-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","region",1,"velt-composer--attachments"],[3,"componentConfigSignal","parentLocalUIState"]],template:function(t,a){if(t&1&&y(0,D5,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,ua,Da,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{width:100%}[_nghost-%COMP%]:empty{display:none}.velt-composer--attachments[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;width:100%;gap:var(--velt-spacing-sm);flex-direction:row;max-height:200px;overflow:auto}"],changeDetection:0});let r=o;return r})();function T5(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","region"),r.setAttribute("aria-label","Attachments section")}catch{}}var MC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),E5=(r,o)=>({condition:r,data:o}),M5=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-avatar-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function A5(r,o){if(r&1&&(u(0),E(1,"snippyly-user-avatar",2),p()),r&2){let n=l(3),e=l();d(),v("size",32)("user",n.appState.user),k("aria-label","User avatar for "+((n.appState.user==null?null:n.appState.user.name)||"unknown user"))("data-testid",e.componentId)}}function P5(r,o){if(r&1&&(u(0),s(1,A5,2,4,"ng-container",1),p()),r&2){let n=l(2),e=l();d(),v("veltDynamicTemplate",O(4,M5,e.template,C(1,MC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function F5(r,o){if(r&1&&s(0,P5,2,10,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,E5,n.conditionSignal(),C(1,MC,n.componentConfigSignal,n.localUIStateSignal)))}}function N5(r,o){if(r&1&&y(0,F5,1,7,"ng-container"),r&2){let n=l();w(n.shouldShow()?0:-1)}}var Oa=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-avatar-internal",this.shouldShow=L(()=>!0)}setupA11yAttributes(){try{R5(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-avatar-internal"]],standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],[4,"veltDynamicTemplate"],["role","img",1,"comment-dialog-user-avatar",3,"size","user"]],template:function(t,a){if(t&1&&y(0,N5,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Lt],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let r=o;return r})();function R5(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","img"),r.setAttribute("aria-label","User avatar")}catch{}}var AC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),L5=(r,o)=>({condition:r,data:o}),B5=(r,o,n,e,t,a)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-format-toolbar-button-wireframe",variant:n,suffix:e,setIfCondition:t,componentElementRef:a});function V5(r,o){r&1&&(de(),b(0,"svg",3),E(1,"path",4),x())}function $5(r,o){r&1&&(de(),b(0,"svg",3),E(1,"path",5),x())}function j5(r,o){r&1&&(de(),b(0,"svg",3),E(1,"path",6),x())}function G5(r,o){r&1&&(de(),b(0,"svg",3),E(1,"path",7),x())}function z5(r,o){if(r&1&&(u(0),y(1,V5,2,0,":svg:svg",3)(2,$5,2,0,":svg:svg",3)(3,j5,2,0,":svg:svg",3)(4,G5,2,0,":svg:svg",3),p()),r&2){let n,e=l(3);d(),w((n=e.getTypeValue())==="bold"?1:n==="italic"?2:n==="underline"?3:n==="strikethrough"?4:-1)}}function H5(r,o){if(r&1){let n=Y();u(0),b(1,"div",1),F(2,"translate"),z("click",function(t){return B(n),l(2).handleClick(),t.stopPropagation(),V(t.preventDefault())})("mousedown",function(t){return B(n),V(t.preventDefault())}),s(3,z5,5,1,"ng-container",2),x(),p()}if(r&2){let n=l(),e=l();d(),k("data-testid",e.componentId+"-"+e.getTypeValue())("data-type",e.getTypeValue())("aria-label",R(2,5,e.getTypeValue()+" formatting"))("aria-pressed",e.hostElementRef.nativeElement.getAttribute("data-active")==="true"),d(2),v("veltDynamicTemplate",yt(10,B5,e.template,C(7,AC,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.getTypeValue(),e.setIfCondition.bind(e),e.elementRef))}}function W5(r,o){if(r&1&&s(0,H5,4,17,"ng-container",0),r&2){let n=l();v("veltIf",C(4,L5,n.conditionSignal(),C(1,AC,n.componentConfigSignal,n.localUIStateSignal)))}}var Ea=(()=>{let o=class o extends te{constructor(){super(...arguments),this.componentId="velt-comment-dialog-composer-format-toolbar-button-internal",this.editMode=Q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true"||e==="1":e}catch{return!1}}}),this.type=Q.required({transform:e=>{try{return e||""}catch{return""}}})}ngOnInit(){super.ngOnInit(),this.selectionChangeHandler=()=>this.refreshActiveState(),document.addEventListener("selectionchange",this.selectionChangeHandler),this.refreshActiveState()}ngOnDestroy(){this.selectionChangeHandler&&(document.removeEventListener("selectionchange",this.selectionChangeHandler),this.selectionChangeHandler=void 0),super.ngOnDestroy()}commandForType(){return{bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"}[this.getTypeValue()]}refreshActiveState(){try{let e=this.commandForType();if(!e)return;let t=document.queryCommandState(e);this.hostElementRef.nativeElement.setAttribute("data-active",t?"true":"false")}catch{}}getTypeValue(){try{let e=this.type;return typeof e=="function"?e():e}catch{return""}}setupA11yAttributes(){try{J5(this.hostElementRef.nativeElement,this.componentId,this.getTypeValue())}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}handleClick(){try{let e=this.getTypeValue(),a={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"}[e];if(a){document.execCommand(a,!1);let i=this.componentConfigSignal(),m=this.editMode()?i?.uiState?.editCommentTextArea?.nativeElement:i?.uiState?.newCommentTextArea?.nativeElement;m&&m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),this.hostElementRef.nativeElement.dispatchEvent(new CustomEvent("velt-format-applied",{bubbles:!0,composed:!0})),this.refreshActiveState()}}catch(e){this.loggingService.catch("Error in handleClick:",e)}}};o.\u0275fac=(()=>{let e;return function(a){return(e||(e=J(o)))(a||o)}})(),o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-format-toolbar-button-internal"]],inputs:{editMode:[1,"editMode"],type:[1,"type"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","button","tabindex","0",1,"velt-format-toolbar-button",3,"click","mousedown"],[4,"veltDynamicTemplate"],["width","16","height","16","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true"],["d","M8.66663 7.9987C9.28546 7.9987 9.87896 7.75286 10.3165 7.31528C10.7541 6.8777 11 6.2842 11 5.66536C11 5.04653 10.7541 4.45303 10.3165 4.01545C9.87896 3.57786 9.28546 3.33203 8.66663 3.33203H4.66663V7.9987M8.66663 7.9987H4.66663M8.66663 7.9987H9.33329C9.95213 7.9987 10.5456 8.24453 10.9832 8.68212C11.4208 9.1197 11.6666 9.71319 11.6666 10.332C11.6666 10.9509 11.4208 11.5444 10.9832 11.9819C10.5456 12.4195 9.95213 12.6654 9.33329 12.6654H4.66663V7.9987","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M7.33329 3.33203H11.3333M4.66663 12.6654H8.66663M9.33329 3.33203L6.66663 12.6654","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M4.66671 3.33203V6.66536C4.66671 7.54942 5.0179 8.39727 5.64302 9.02239C6.26814 9.64751 7.11599 9.9987 8.00004 9.9987C8.8841 9.9987 9.73194 9.64751 10.3571 9.02239C10.9822 8.39727 11.3334 7.54942 11.3334 6.66536V3.33203M3.33337 12.6654H12.6667","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"],["d","M3.33337 7.9987H12.6667M10.6667 4.3327C10.5155 4.03934 10.1691 3.78046 9.68437 3.5987C9.19967 3.41693 8.60562 3.32312 8.00004 3.3327H7.33337C6.71454 3.3327 6.12104 3.57853 5.68346 4.01612C5.24587 4.4537 5.00004 5.04719 5.00004 5.66603C5.00004 6.28487 5.24587 6.87836 5.68346 7.31595C6.12104 7.75353 6.71454 7.99936 7.33337 7.99936H8.66671C9.28555 7.99936 9.87904 8.2452 10.3166 8.68278C10.7542 9.12037 11 9.71386 11 10.3327C11 10.9515 10.7542 11.545 10.3166 11.9826C9.87904 12.4202 9.28555 12.666 8.66671 12.666H7.66671C7.06113 12.6756 6.46708 12.5818 5.98237 12.4C5.49767 12.2183 5.15121 11.9594 5.00004 11.666","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,a){if(t&1&&y(0,W5,1,7,"ng-container"),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-format-toolbar-button[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:.3em;border-radius:var(--velt-border-radius-sm);cursor:pointer;color:var(--velt-text-2);transition:background .15s ease,color .15s ease}.velt-format-toolbar-button[_ngcontent-%COMP%]:hover{background:var(--velt-bg-3);color:var(--velt-text-1)}.velt-format-toolbar-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:16px;height:16px}[data-active=true][_nghost-%COMP%] .velt-format-toolbar-button[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--velt-accent) 12%,transparent);color:var(--velt-accent)}[data-active=true][_nghost-%COMP%] .velt-format-toolbar-button[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--velt-accent) 18%,transparent)}"],changeDetection:0});let r=o;return r})();function J5(r,o,n){try{r.setAttribute("data-testid",o+"-"+(n||"")),r.setAttribute("role","button"),r.setAttribute("aria-label",`Apply ${n||""} formatting`)}catch{}}var PC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),K5=(r,o)=>({condition:r,data:o}),Z5=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-format-toolbar-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function X5(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-format-toolbar-button-internal",3),r&2){let n=l(5);v("componentConfigSignal",n.componentConfigSignal)("editMode",n.editMode()),k("data-active",n.boldActive())}}function q5(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-format-toolbar-button-internal",4),r&2){let n=l(5);v("componentConfigSignal",n.componentConfigSignal)("editMode",n.editMode()),k("data-active",n.italicActive())}}function Q5(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-format-toolbar-button-internal",5),r&2){let n=l(5);v("componentConfigSignal",n.componentConfigSignal)("editMode",n.editMode()),k("data-active",n.underlineActive())}}function e6(r,o){if(r&1&&E(0,"velt-comment-dialog-composer-format-toolbar-button-internal",6),r&2){let n=l(5);v("componentConfigSignal",n.componentConfigSignal)("editMode",n.editMode()),k("data-active",n.strikethroughActive())}}function t6(r,o){if(r&1&&(u(0),y(1,X5,1,3,"velt-comment-dialog-composer-format-toolbar-button-internal",3),y(2,q5,1,3,"velt-comment-dialog-composer-format-toolbar-button-internal",4),y(3,Q5,1,3,"velt-comment-dialog-composer-format-toolbar-button-internal",5),y(4,e6,1,3,"velt-comment-dialog-composer-format-toolbar-button-internal",6),p()),r&2){let n=l(4);d(),w(n.boldEnabled()?1:-1),d(),w(n.italicEnabled()?2:-1),d(),w(n.underlineEnabled()?3:-1),d(),w(n.strikethroughEnabled()?4:-1)}}function r6(r,o){if(r&1){let n=Y();u(0),b(1,"div",1),F(2,"translate"),z("mousedown",function(t){return B(n),V(t.preventDefault())})("click",function(t){B(n);let a=l(3);return V(a.handleToolbarClick(t))}),s(3,t6,5,4,"ng-container",2),x(),p()}if(r&2){let n=l(2),e=l();d(),k("data-testid",e.componentId)("aria-label",R(2,3,"Text formatting options")),d(2),v("veltDynamicTemplate",O(8,Z5,e.template,C(5,PC,e.componentConfigSignal,e.localUIStateSignal),n==null||n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function n6(r,o){if(r&1&&s(0,r6,4,14,"ng-container",0),r&2){let n=l(2);v("veltIf",C(4,K5,n.conditionSignal(),C(1,PC,n.componentConfigSignal,n.localUIStateSignal)))}}function o6(r,o){if(r&1&&y(0,n6,1,7,"ng-container"),r&2){let n=l();w(n.isVisible()?0:-1)}}var Ma=(()=>{let o=class o extends te{constructor(){super(),this.componentId="velt-comment-dialog-composer-format-toolbar-internal",this.editMode=Q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true"||e==="1":e}catch{return!1}}}),this.selectionChangeHandler=null,this.formatAppliedHandler=null,this.isVisible=L(()=>{try{if(!this.defaultCondition())return!0;let e=this.componentConfigSignal();return e?.uiState?.formatToolbarOpen===!0&&e?.featureState?.enableFormatOptions===!0}catch(e){return this.loggingService.catch("Error in isVisible:",e),!1}}),this.formatConfig=L(()=>{try{return this.componentConfigSignal()?.featureState?.formatConfig||null}catch(e){return this.loggingService.catch("Error in formatConfig:",e),null}}),this.boldEnabled=L(()=>this.isFormatEnabledByConfig("bold")),this.italicEnabled=L(()=>this.isFormatEnabledByConfig("italic")),this.underlineEnabled=L(()=>this.isFormatEnabledByConfig("underline")),this.strikethroughEnabled=L(()=>this.isFormatEnabledByConfig("strikethrough")),this.boldActive=Me(!1),this.italicActive=Me(!1),this.underlineActive=Me(!1),this.strikethroughActive=Me(!1),this.ngZone=ge(cg),_t(()=>{this.isVisible()?this.startSelectionChangeListener():this.stopSelectionChangeListener()})}ngOnInit(){super.ngOnInit(),this.setupFormatAppliedListener()}ngOnDestroy(){super.ngOnDestroy(),this.cleanupEventListeners()}startSelectionChangeListener(){try{if(this.selectionChangeHandler)return;this.selectionChangeHandler=()=>{this.ngZone.run(()=>{this.refreshActiveStates()})},document.addEventListener("selectionchange",this.selectionChangeHandler),this.refreshActiveStates()}catch(e){this.loggingService.catch("Error in startSelectionChangeListener:",e)}}stopSelectionChangeListener(){try{this.selectionChangeHandler&&(document.removeEventListener("selectionchange",this.selectionChangeHandler),this.selectionChangeHandler=null)}catch(e){this.loggingService.catch("Error in stopSelectionChangeListener:",e)}}setupFormatAppliedListener(){try{this.formatAppliedHandler=()=>{this.ngZone.run(()=>{this.refreshActiveStates()})},this.hostElementRef.nativeElement.addEventListener("velt-format-applied",this.formatAppliedHandler)}catch(e){this.loggingService.catch("Error in setupFormatAppliedListener:",e)}}cleanupEventListeners(){try{this.stopSelectionChangeListener(),this.formatAppliedHandler&&(this.hostElementRef.nativeElement.removeEventListener("velt-format-applied",this.formatAppliedHandler),this.formatAppliedHandler=null)}catch(e){this.loggingService.catch("Error in cleanupEventListeners:",e)}}setupA11yAttributes(){try{a6(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}isFormatEnabledByConfig(e){try{let t=this.formatConfig();if(!t)return!0;let a=t[e];return!(a&&a.enable===!1)}catch(t){return this.loggingService.catch("Error in isFormatEnabledByConfig:",t),!0}}handleToolbarClick(e){try{let t=e.target,a=t.closest("velt-comment-dialog-composer-format-toolbar-button-wireframe"),i=a?null:t.closest("velt-comment-dialog-composer-format-toolbar-button-internal"),c=a||i;if(!c||i)return;let m=c.getAttribute("type");if(!m)return;let h=o.COMMAND_MAP[m];if(!h)return;document.execCommand(h,!1);let _=this.componentConfigSignal(),S=this.editMode()?_?.uiState?.editCommentTextArea?.nativeElement:_?.uiState?.newCommentTextArea?.nativeElement;S&&S.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),this.refreshActiveStates()}catch(t){this.loggingService.catch("Error in handleToolbarClick:",t)}}refreshActiveStates(){try{this.boldActive.set(document.queryCommandState("bold")),this.italicActive.set(document.queryCommandState("italic")),this.underlineActive.set(document.queryCommandState("underline")),this.strikethroughActive.set(document.queryCommandState("strikeThrough"))}catch{}}};o.COMMAND_MAP={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=T({type:o,selectors:[["velt-comment-dialog-composer-format-toolbar-internal"]],inputs:{editMode:[1,"editMode"]},standalone:!1,features:[U([D]),M],decls:1,vars:1,consts:[[4,"veltIf"],["role","toolbar",1,"velt-format-toolbar",3,"mousedown","click"],[4,"veltDynamicTemplate"],["type","bold",3,"componentConfigSignal","editMode"],["type","italic",3,"componentConfigSignal","editMode"],["type","underline",3,"componentConfigSignal","editMode"],["type","strikethrough",3,"componentConfigSignal","editMode"]],template:function(t,a){if(t&1&&y(0,o6,1,1),t&2){let i;w((i=a.componentConfigSignal())?0:-1,i)}},dependencies:[N,P,Ea,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent);width:100%}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)}[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]:empty{display:none}.velt-format-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.2em;padding:.3em .4em;border-radius:var(--velt-border-radius-md);background:var(--velt-bg-2);border:1px solid var(--velt-border);width:100%;box-sizing:border-box}"],changeDetection:0});let r=o;return r})();function a6(r,o){try{r.setAttribute("data-testid",o+"-container"),r.setAttribute("role","toolbar"),r.setAttribute("aria-label","Text formatting options")}catch{}}var l6=["newCommentTextArea"],d6=["editCommentTextArea"],v6=["userSelector"],FC=(r,o)=>({componentConfigSignal:r,parentLocalUIState:o}),c6=(r,o)=>({condition:r,data:o}),m6=(r,o,n,e,t)=>({template:r,context:o,componentName:"velt-comment-dialog-composer-input-wireframe",variant:n,setIfCondition:e,componentElementRef:t});function s6(r,o){if(r&1){let n=Y();b(0,"velt-autocomplete-panel-internal",10,1),z("userContactOptionSelected",function(t){B(n);let a=l(5);return V(a.onUserContactSelected(t))})("customOptionSelected",function(t){B(n);let a=l(5);return V(a.onCustomOptionSelected(t))})("groupOptionSelected",function(t){B(n);let a=l(5);return V(a.onGroupSelected(t))})("atHereSelected",function(t){B(n);let a=l(5);return V(a.onAtHereSelected(t))})("enterPressed",function(){B(n);let t=l(5);return V(t.onEnterPressInAutocompletePanel())})("autocompleteStateChanged",function(t){B(n);let a=l(5);return V(a.onAutocompleteStateChanged(t))}),x()}if(r&2){l();let n=we(4),e=l(3);v("darkMode",!!(!(e==null||e.uiState==null)&&e.uiState.darkMode))("hideInput",!0)("showAtHere",!0)("metadata",e==null||e.data==null||e.data.annotation==null?null:e.data.annotation.metadata)("autocompletePanelTrigger",n)("type","generic")("autocompletePanelPosition",!(e==null||e.uiState==null)&&e.uiState.bottomSheetMode?"above":"auto")}}function g6(r,o){if(r&1){let n=Y();b(0,"div",6),z("click",function(t){B(n);let a=l(3);return!(a==null||a.data==null)&&a.data.annotation,V(t.stopPropagation())}),b(1,"div",7)(2,"div",8,0),z("input",function(t){B(n);let a=l(4);return V(a.onInput(t))})("paste",function(t){B(n);let a=l(4);return V(a.onPaste(t))})("copy",function(t){B(n);let a=l(4);return V(a.stopPropagation(t))})("dragover",function(t){B(n);let a=l(4);return V(a.onDragOver(t))})("dragenter",function(t){B(n);let a=l(4);return V(a.onDragEnter(t))})("drop",function(t){B(n);let a=l(4);return V(a.onDrop(t))})("click",function(){B(n);let t=l(4);return V(t.onCombinedClick())}),x()(),y(5,s6,2,7,"velt-autocomplete-panel-internal",9),x()}if(r&2){let n=l(3),e=l();k("aria-label","New comment composer")("data-testid",e.componentId+"-section"),d(2),v("matAutocompleteDisabled",!(!(n==null||n.featureState==null)&&n.featureState.userMentions)),k("data-testid",e.componentId+"-new-textarea")("placeholder",e.newCommentPlaceholder()),d(3),w(!(n==null||n.featureState==null)&&n.featureState.userMentions?5:-1)}}function u6(r,o){if(r&1){let n=Y();b(0,"velt-autocomplete-panel-internal",10,1),z("userContactOptionSelected",function(t){B(n);let a=l(5);return V(a.onUserContactSelected(t))})("customOptionSelected",function(t){B(n);let a=l(5);return V(a.onCustomOptionSelected(t))})("groupOptionSelected",function(t){B(n);let a=l(5);return V(a.onGroupSelected(t))})("atHereSelected",function(t){B(n);let a=l(5);return V(a.onAtHereSelected(t))})("enterPressed",function(){B(n);let t=l(5);return V(t.onEnterPressInAutocompletePanel())})("autocompleteStateChanged",function(t){B(n);let a=l(5);return V(a.onAutocompleteStateChanged(t))}),x()}if(r&2){l();let n=we(4),e=l(3);v("darkMode",!!(!(e==null||e.uiState==null)&&e.uiState.darkMode))("hideInput",!0)("showAtHere",!0)("metadata",e==null||e.data==null||e.data.annotation==null?null:e.data.annotation.metadata)("autocompletePanelTrigger",n)("type","generic")("autocompletePanelPosition",!(e==null||e.uiState==null)&&e.uiState.bottomSheetMode?"above":"auto")}}function p6(r,o){if(r&1){let n=Y();b(0,"div",6),z("click",function(t){return B(n),V(t.stopPropagation())}),b(1,"div",7)(2,"div",8,2),z("input",function(t){B(n);let a=l(4);return V(a.onInput(t))})("paste",function(t){B(n);let a=l(4);return V(a.onPaste(t))})("copy",function(t){B(n);let a=l(4);return V(a.stopPropagation(t))})("dragover",function(t){B(n);let a=l(4);return V(a.onDragOver(t))})("dragenter",function(t){B(n);let a=l(4);return V(a.onDragEnter(t))})("drop",function(t){B(n);let a=l(4);return V(a.onDrop(t))})("click",function(){B(n);let t=l(4);return V(t.onInputClick())}),x(),y(5,u6,2,7,"velt-autocomplete-panel-internal",9),x()()}if(r&2){let n=l(3),e=l();k("aria-label","Edit comment composer")("data-testid",e.componentId+"-edit-section"),d(2),v("matAutocompleteDisabled",!(!(n==null||n.featureState==null)&&n.featureState.userMentions)),k("data-testid",e.componentId+"-edit-textarea")("placeholder",e.editCommentPlaceholder()),d(3),w(!(n==null||n.featureState==null)&&n.featureState.userMentions?5:-1)}}function h6(r,o){if(r&1&&(u(0),y(1,g6,6,6,"div",5),y(2,p6,6,6,"div",5),p()),r&2){let n=l(3);d(),w(!n.editMode()&&!n.isRecordingActive()?1:-1),d(),w(n.editMode()&&n.commentObj()&&!n.isRecordingActive()?2:-1)}}function b6(r,o){if(r&1&&(u(0),s(1,h6,3,2,"ng-container",4),p()),r&2){let n=l(),e=l();d(),v("veltDynamicTemplate",O(4,m6,e.template,C(1,FC,e.componentConfigSignal,e.localUIStateSignal),n.uiState==null?null:n.uiState.variant,e.setIfCondition.bind(e),e.elementRef))}}function f6(r,o){if(r&1&&s(0,b6,2,10,"ng-container",3),r&2){let n=l();v("veltIf",C(4,c6,n.conditionSignal(),C(1,FC,n.componentConfigSignal,n.localUIStateSignal)))}}var Aa=(()=>{let o=class o extends te{constructor(){super(),this.componentId="velt-comment-dialog-composer-input-internal",this.isRecordingActive=L(()=>{try{let e=this.componentConfigSignal(),t=e?.uiState?.recorderInitConfig;if(!t)return!1;let a=this.localUIStateSignal()?.dialogInstanceId;return t.panelId===a||t.commentAnnotationId===e?.data?.annotation?.annotationId}catch(e){return this.loggingService.catch("Error in isRecordingActive:",e),!1}}),this.hasPrefilledEditTextarea=!1,this.lastEditCommentId=void 0,this.editMode=Q(!1,{transform:e=>{try{return typeof e=="string"?e.toLowerCase()==="true":e}catch{return!1}}}),this.commentObj=Q(void 0,{transform:e=>{try{return typeof e=="string"?JSON.parse(e):e}catch{return}}}),this.commentIndex=Q(void 0,{transform:e=>{try{if(typeof e=="string"){let t=parseInt(e,10);return isNaN(t)?void 0:t}return e}catch{return}}}),this.placeholder=Q(void 0,{transform:e=>{try{return e}catch{return}}}),this.commentplaceholder=Q(void 0,{transform:e=>{try{return e}catch{return}}}),this.replyplaceholder=Q(void 0,{transform:e=>{try{return e}catch{return}}}),this.editplaceholder=Q(void 0,{transform:e=>{try{return e}catch{return}}}),this.editcommentplaceholder=Q(void 0,{transform:e=>{try{return e}catch{return}}}),this.editreplyplaceholder=Q(void 0,{transform:e=>{try{return e}catch{return}}}),this.newCommentTextArea=On("newCommentTextArea"),this.editCommentTextArea=On("editCommentTextArea"),this.userSelector=On("userSelector"),this.activeTextArea=L(()=>{try{return this.editMode()?this.editCommentTextArea():this.newCommentTextArea()}catch(e){return this.loggingService.catch("Error in activeTextArea computed:",e),null}}),this.newCommentPlaceholder=L(()=>{try{return this.coreService.computeNewCommentPlaceholder(this.componentConfigSignal(),this.placeholder(),this.replyplaceholder(),this.commentplaceholder())}catch(e){return this.loggingService.catch("Error in newCommentPlaceholder computed:",e),"Write a comment..."}}),this.editCommentPlaceholder=L(()=>{try{return x6(this.coreService,this.componentConfigSignal(),this.placeholder(),this.editplaceholder(),this.editcommentplaceholder(),this.editreplyplaceholder(),this.commentIndex())}catch(e){return this.loggingService.catch("Error in editCommentPlaceholder computed:",e),"Edit comment..."}}),this.isAutocompleteOpen=L(()=>{try{let e=this.userSelector();return e?.trigger?.panelOpen||e?.matAutocompleteTrigger?.panelOpen||!1}catch(e){return this.loggingService.catch("Error in isAutocompleteOpen computed:",e),!1}}),this.allowKeydown=!0,this.domService=ge(Ne),this.commentActionsService=ge(at),this.deviceInfo=new Tg,this.lastValidAbsoluteOffset=-1,this.oldText="",this.newText="",this.wordIndex=-1,_t(()=>{let e=this.getAnnotationId(),t=this.newCommentTextArea(),a=this.editCommentTextArea();this.editMode(),e&&(t||a)&&(this.setupTextAreaTimeout&&clearTimeout(this.setupTextAreaTimeout),this.setupTextAreaTimeout=setTimeout(()=>{this.setupTextAreaReferences(e)}))}),_t(()=>{let e=this.editMode(),t=this.localUIStateSignal()?.editComment,a=this.editCommentTextArea();if(e&&t&&a?.nativeElement){let i=t.commentId;this.lastEditCommentId!==i&&(this.hasPrefilledEditTextarea=!1,this.lastEditCommentId=i),this.hasPrefilledEditTextarea||(this.prefillEditTimeout&&clearTimeout(this.prefillEditTimeout),this.prefillEditTimeout=setTimeout(()=>{let c=a.nativeElement;if(!c.innerHTML||c.innerHTML===""||c.innerText.trim()===""){let m=this.localUIStateSignal()?.composerContentHTML,h=this.localUIStateSignal()?.composerContent,_=k6(m,h,t.commentHtml,t.commentText);c.innerHTML=_,this.setCursorToEndOfContenteditable(c)}this.hasPrefilledEditTextarea=!0},50))}else e||(this.hasPrefilledEditTextarea=!1,this.lastEditCommentId=void 0)}),_t(()=>{if(this.localUIStateSignal()?.composerContent===""&&!this.editMode()){let t=this.newCommentTextArea();t?.nativeElement&&(t.nativeElement.innerText||"").trim()!==""&&(t.nativeElement.innerHTML="")}}),_t(()=>{if(!this.isLocalUIStateOwner||this.editMode())return;let e=this.getAnnotationId();if(!e)return;!this.coreService.getOrCreateComposerDraft(e)()?.composerContent&&(this.localUIStateSignal()?.composerContent??"")!==""&&this.localUIStateSignal.update(a=>f(g({},a),{composerContent:"",composerContentHTML:""}))})}setCursorToEndOfContenteditable(e){try{if(!e||!e.isConnected)return;let t=document.createRange(),a=window.getSelection();t.selectNodeContents(e),t.collapse(!1),a?.removeAllRanges(),a?.addRange(t),e.focus()}catch(t){this.loggingService.catch("Error in setCursorToEndOfContenteditable:",t)}}autoScrollToBottom(e){try{if(e&&e.isConnected){let t=e.closest(".velt-composer-input");if(t){let a=t.offsetHeight;t.scrollHeight>t.clientHeight&&(t.scrollTop=t.scrollHeight,requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight}))}}}catch(t){this.loggingService.catch("Error in autoScrollToBottom:",t)}}getSelectionFromContext(e){try{let t=null;try{if(e.getRootNode()instanceof ShadowRoot){let a=e.getRootNode();a.getSelection?t=a.getSelection():this.hostElementRef?.nativeElement?.shadowRoot?.getSelection&&(t=this.hostElementRef.nativeElement.shadowRoot.getSelection())}}catch{}return t||window.getSelection()}catch(t){return this.loggingService.catch("Error in getSelectionFromContext:",t),window.getSelection()}}ngOnInit(){try{super.ngOnInit()}catch(e){this.loggingService.catch("Error in CommentDialogComposerInputComponent ngOnInit:",e)}}ngOnDestroy(){try{this.setupTextAreaTimeout&&clearTimeout(this.setupTextAreaTimeout),this.prefillEditTimeout&&clearTimeout(this.prefillEditTimeout),this.overlayPositionTimeout&&clearTimeout(this.overlayPositionTimeout),super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in CommentDialogComposerInputComponent ngOnDestroy:",e)}}setupTextAreaReferences(e){try{let t=this.newCommentTextArea(),a=this.editCommentTextArea();if(!_6(t,a))return;let i=this.coreService.getContextConfig(e);if(!i)return;i.update(c=>{let m=f(g({},c.uiState),{onAtClick:h=>this.actionService.onAtClick(e,h,this.localUIStateSignal()?.dialogInstanceId),onAttachmentButtonClick:()=>this.actionService.onAttachmentButtonClick(e)});return t&&(m.newCommentTextArea=t),a&&(m.editCommentTextArea=a),f(g({},c),{uiState:m})})}catch(t){this.loggingService.catch("Error in setupTextAreaReferences:",t)}}setupA11yAttributes(){try{C6(this.hostElementRef.nativeElement,this.componentId)}catch(e){this.loggingService.catch("Error in setupA11yAttributes:",e)}}handleKeyDown(e){try{if(this.isAutocompleteOpen())return;switch(xp(e.code)&&e.stopPropagation(),e.key){case"Enter":this.handleEnterKey(e);break;case"Escape":this.handleEscapeKey(e);break;case"Backspace":case"Delete":this.handleDeleteKey(e);break}}catch(t){this.loggingService.catch("Error in handleKeyDown:",t)}}handleKeyPress(e){try{xp(e.code)&&e.stopPropagation()}catch(t){this.loggingService.catch("Error in handleKeyPress:",t)}}handleKeyUp(e){try{if(xp(e.code)&&e.stopPropagation(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=this.activeTextArea()?.nativeElement;t&&this.updateCursorOffset(t)}}catch(t){this.loggingService.catch("Error in handleKeyUp:",t)}}handleEnterKey(e){try{if(!this.allowKeydown){this.allowKeydown=!0;return}let t=this.componentConfigSignal();if(!t)return;t.featureState?.enterKeyToSubmit?e.shiftKey||e.metaKey||(e.preventDefault(),this.submitComment(e)):(e.shiftKey||e.metaKey)&&(e.preventDefault(),this.submitComment(e))}catch(t){this.loggingService.catch("Error in handleEnterKey:",t)}}submitComment(e){try{let t=this.getAnnotationId(),a=e.target,i=a.innerText||"",c=a.innerHTML||"";if(t)if(this.editMode()){let m=this.commentIndex();m!==void 0&&(this.actionService.updateComment(t,m,this.localUIStateSignal()?.dialogInstanceId),a.innerHTML="")}else this.actionService.addComment(t,!1,this.localUIStateSignal()?.dialogInstanceId),a.innerHTML="";else{if(!i.trim())return;let m=this.componentConfigSignal();if(m){let h={commentText:i,commentHtml:c,user:m.appState?.user,taggedUserContacts:m.data?.taggedUserContacts||[],selectedFiles:this.localUIStateSignal()?.selectedFiles||[],localRecordedData:this.localUIStateSignal()?.localRecordedData||[]},_=this.componentConfigSignal;_&&typeof _.update=="function"&&_.update(I=>f(g({},I),{uiState:f(g({},I.uiState),{pendingSaveComment:h})})),this.localUIStateSignal.update(I=>f(g({},I),{composerContent:"",composerContentHTML:"",composerInOpenState:!1})),a.innerHTML=""}}}catch(t){this.loggingService.catch("Error in submitComment:",t)}}handleEscapeKey(e){try{let t=this.userSelector();if(t?.trigger?.panelOpen||t?.matAutocompleteTrigger?.panelOpen){t?.closePanel();let i=e.target;if(i&&i.hasAttribute("contenteditable")){let c=["@","#","$"];if(Oo(i,c)){let h=window.getSelection();if(h&&h.rangeCount>0){let _=h.getRangeAt(0),I=_.startOffset,S=_.commonAncestorContainer?.textContent||"",H=-1;for(let $ of c){let j=S.lastIndexOf($,I);j>H&&(H=j)}H!==-1&&t&&t.disableAutocompleteAtPosition(H)}}}e.preventDefault(),e.stopPropagation();return}if(this.editMode()){let i=this.getAnnotationId();if(i){let c=this.localUIStateSignal()?.editComment?.commentId;c&&this.actionService.clearEditDraftFromSession(i,c),this.actionService.cancelEdit(i,this.localUIStateSignal()?.dialogInstanceId)}e.preventDefault(),e.stopPropagation();return}}catch(t){this.loggingService.catch("Error in handleEscapeKey:",t)}}handleDeleteKey(e){try{let t=this.activeTextArea()?.nativeElement;if(!t)return;if(!(t.innerText||"")&&this.componentConfigSignal()?.featureState?.deleteOnBackspace){let c=this.getAnnotationId();c&&this.actionService.deleteAnnotation(c,e.key==="Backspace"?"keydownBackspace":"keydownDelete")}}catch(t){this.loggingService.catch("Error in handleDeleteKey:",t)}}handleFocusIn(e){try{let t=this.newCommentTextArea(),a=this.editCommentTextArea();if(t&&t.nativeElement.contains(e.target)||a&&a.nativeElement.contains(e.target)){let i=this.getAnnotationId();if(i){let m=this.coreService.getContextConfig(i);if(m){m.update(h=>f(g({},h),{uiState:f(g({},h.uiState),{isInputFocused:!0})}));return}}let c=this.componentConfigSignal;c&&typeof c.update=="function"&&c.update(m=>f(g({},m),{uiState:f(g({},m.uiState),{isInputFocused:!0})}))}}catch(t){this.loggingService.catch("Error in handleFocusIn:",t)}}handleFocusOut(e){try{let t=this.newCommentTextArea(),a=this.editCommentTextArea();if(t&&t.nativeElement.contains(e.target)||a&&a.nativeElement.contains(e.target)){let i=this.getAnnotationId();if(i){let m=this.coreService.getContextConfig(i);if(m){m.update(h=>f(g({},h),{uiState:f(g({},h.uiState),{isInputFocused:!1})}));return}}let c=this.componentConfigSignal;c&&typeof c.update=="function"&&c.update(m=>f(g({},m),{uiState:f(g({},m.uiState),{isInputFocused:!1})}))}}catch(t){this.loggingService.catch("Error in handleFocusOut:",t)}}onInput(e){try{e instanceof InputEvent&&this.actionService.handleBackspaceOnMentionSpan(e);let t=e.target,a=t.innerHTML,i=t.innerText;(!i||!i.trim())&&(t.innerHTML="",a="",i="");let c=this.getAnnotationId();c?this.coreService.getContextConfig(c)?(this.localUIStateSignal.update(h=>f(g({},h),{composerContent:i,composerContentHTML:a,composerInOpenState:!0})),this.isLocalUIStateOwner&&!this.editMode()&&this.coreService.getOrCreateComposerDraft(c).update(h=>f(g({},h),{composerContent:i,composerContentHTML:a})),this.actionService.checkTaggedUserContacts(c,i),this.actionService.extractContacts(c,i),this.actionService.detectEmailAfterAt(c,e,i,t,this.localUIStateSignal()?.dialogInstanceId),this.actionService.checkGetAnnotationDraftAttribute(c,this.localUIStateSignal()?.dialogInstanceId),this.editMode()&&this.actionService.saveEditDraftToSession(c,this.localUIStateSignal()?.dialogInstanceId)):this.localUIStateSignal.update(h=>f(g({},h),{composerContent:i,composerContentHTML:a,composerInOpenState:!0})):this.localUIStateSignal.update(m=>f(g({},m),{composerContent:i,composerContentHTML:a,composerInOpenState:!0}))}catch(t){this.loggingService.catch("Error in onInput:",t)}try{this.componentConfigSignal()?.featureState?.userMentions&&this.handleAutocompleteInput(e)}catch(t){this.loggingService.catch("Error in onInput autocomplete handling:",t)}}onPaste(e){try{let t=this.getAnnotationId();if(t){let i=this.coreService.getContextConfig(t);if(i){let c=i(),m=this.localUIStateSignal()?.composerInOpenState;(!c.uiState?.showCommentButtons||!m)&&(i.update(h=>f(g({},h),{uiState:f(g({},h.uiState),{showCommentButtons:!0})})),this.localUIStateSignal.update(h=>f(g({},h),{composerInOpenState:!0})),this.overlayPositionTimeout&&clearTimeout(this.overlayPositionTimeout),this.overlayPositionTimeout=setTimeout(()=>{let h=this.coreService.getContextConfig(t);h&&h()?.uiState?.updateOverlayPositionEmit?.()},300))}}let a=e.clipboardData?.items;if(a){let i=[];for(let c=0;c<a.length;c++){let m=a[c];if(m.type.indexOf("image")===0){let h=m.getAsFile();if(h){let _=Ht(),I=new File([h],`${_}.png`,{type:h.type});i.push(I)}}}if(i.length>0){t&&this.actionService.addFiles(t,i,this.localUIStateSignal()?.dialogInstanceId),e.preventDefault();return}}if(e?.clipboardData){let i=e.clipboardData.getData("text/plain"),c=e.clipboardData.getData("text/html");if(!i&&!c)return;e.preventDefault();let m=null;if(this.editMode()?m=this.editCommentTextArea()?.nativeElement||null:m=this.newCommentTextArea()?.nativeElement||null,m){let h=this.getSelectionFromContext(m);if(h&&h.rangeCount>0){let _=h.getRangeAt(0);m.contains(_.commonAncestorContainer)||(_=document.createRange(),_.selectNodeContents(m),_.collapse(!1));let I=i?X.REGEX_URL.test(i.trim()):!1,S=_.toString().trim();if(I&&S&&S.length>0){let H=document.createElement("a");H.className="velt-comment-dialog--comment-link",H.target="_blank",H.rel="noopener noreferrer";let $=i?.trim()||"",j=$.match(/^[a-zA-Z][a-zA-Z\d+\-.]*:/)?$:`https://${$}`;H.href=j,H.textContent=S,_.deleteContents(),_.insertNode(H),_.setStartAfter(H),_.setEndAfter(H)}else if(c){let H=this.domService.sanitizeHtmlForPaste(c);if(H){_.deleteContents();let $=document.createElement("div");$.innerHTML=H;let j=document.createDocumentFragment(),Z=null;for(;$.firstChild;)Z=j.appendChild($.firstChild);_.insertNode(j),Z&&(_.setStartAfter(Z),_.collapse(!0))}else this.insertPlainText(_,i||"")}else this.insertPlainText(_,i||"");h.removeAllRanges(),h.addRange(_),this.localUIStateSignal.update(H=>f(g({},H),{composerContent:m.innerText,composerContentHTML:this.domService.sanitizeHtml(m.innerHTML)})),setTimeout(()=>{this.autoScrollToBottom(m)},50)}t&&this.actionService.checkGetAnnotationDraftAttribute(t,this.localUIStateSignal()?.dialogInstanceId)}}}catch(t){this.loggingService.catch("Error in onPaste:",t)}}insertPlainText(e,t){try{let a=this.domService.sanitizeHtml(t).replace(/&#10;/g,`
4
4
  `).replace(/&nbsp;/g," ");e.deleteContents();let i=a.split(`