@veltdev/sdk 6.0.31 → 6.0.32
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/{chunk-N7HBSHMG.js → chunk-2GMFNHOT.js} +1 -1
- package/{chunk-DEX3ZQW4.js → chunk-2MJAK5A5.js} +1 -1
- package/{chunk-SKSZYHHP.js → chunk-3BDGQ5BH.js} +23 -23
- package/{chunk-XLPYUWJX.js → chunk-4IZOBQPA.js} +1 -1
- package/{chunk-YC3Z7OAA.js → chunk-4R5WJWJ4.js} +1 -1
- package/{chunk-IYLU72I4.js → chunk-4WR2GOXI.js} +1 -1
- package/chunk-57BIEQT2.js +1 -0
- package/{chunk-CE2EVKCW.js → chunk-5N6FRMDY.js} +1 -1
- package/{chunk-CNWBCCFP.js → chunk-5ZT4SI4Q.js} +1 -1
- package/{chunk-7LGRH5L7.js → chunk-65JXF5ID.js} +1 -1
- package/{chunk-SQZF6W7N.js → chunk-6GBHUA6N.js} +1 -1
- package/{chunk-WZXMZ7R7.js → chunk-6MMBTBVW.js} +1 -1
- package/{chunk-BPUKSXKL.js → chunk-B4LHJYNG.js} +1 -1
- package/{chunk-TUMTL6R6.js → chunk-B6ADFKWY.js} +1 -1
- package/{chunk-PPOB3N6B.js → chunk-BSCQ2SIU.js} +1 -1
- package/{chunk-GLYC5MOA.js → chunk-DXZHCUKV.js} +1 -1
- package/{chunk-PQKCFO3O.js → chunk-EDLKBBGZ.js} +1 -1
- package/{chunk-VTGJS3GT.js → chunk-FJSQLT27.js} +1 -1
- package/{chunk-VE4MHD5D.js → chunk-FTIJIX6Y.js} +1 -1
- package/{chunk-OSQH62D7.js → chunk-FUFU46AG.js} +1 -1
- package/{chunk-QFOISMJE.js → chunk-HQ4N7XMQ.js} +1 -1
- package/{chunk-EB73L6PP.js → chunk-I5XISXO3.js} +1 -1
- package/chunk-LFIJYWMO.js +1 -0
- package/{chunk-HS6DKXTG.js → chunk-LMYG4KLY.js} +1 -1
- package/{chunk-FKN7LIYH.js → chunk-N4LOLZ2Y.js} +1 -1
- package/{chunk-BLQFOUHF.js → chunk-NFTOH2HZ.js} +1 -1
- package/{chunk-ZKZLKVGF.js → chunk-SA7JZYBN.js} +1 -1
- package/{chunk-SLCZA7OJ.js → chunk-SCVFCERC.js} +1 -1
- package/{chunk-PUTCGYJV.js → chunk-TGWSCIG4.js} +1 -1
- package/{chunk-3MKOFVA4.js → chunk-TWY3X34A.js} +1 -1
- package/{chunk-SO3O7X5P.js → chunk-UMRM6GQA.js} +1 -1
- package/{chunk-CWIAV54H.js → chunk-URL5KBFL.js} +1 -1
- package/{chunk-2NF5H2TO.js → chunk-WCQZBPSI.js} +1 -1
- package/{chunk-XYFA3Q6A.js → chunk-WL25NQ5T.js} +1 -1
- package/{chunk-K77GW65W.js → chunk-WR5LVHSG.js} +1 -1
- package/{chunk-33RB7RGI.js → chunk-YTMFAPO3.js} +1 -1
- package/package.json +1 -1
- package/velt-activity-log.js +1 -1
- package/velt-area.js +1 -1
- package/velt-arrow.js +1 -1
- package/velt-comment.js +7 -7
- package/velt-crdt.js +1 -1
- package/velt-cursor.js +1 -1
- package/velt-huddle.js +1 -1
- package/velt-live-state-sync.js +1 -1
- package/velt-notification.js +1 -1
- package/velt-portable.js +1 -1
- package/velt-presence.js +1 -1
- package/velt-reaction.js +1 -1
- package/velt-recorder.js +1 -1
- package/velt-rewriter.js +1 -1
- package/velt-selection.js +1 -1
- package/velt-tag.js +1 -1
- package/velt-user-invite.js +1 -1
- package/velt-user-request.js +1 -1
- package/velt-video-player.js +1 -1
- package/velt-views.js +1 -1
- package/velt.js +6 -6
- package/chunk-O5LVBWUD.js +0 -1
- package/chunk-P7BCV4ME.js +0 -1
package/velt-reaction.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as yn,b as kn}from"./chunk-TUMTL6R6.js";import{j as Cn,l as Re,m as pt,t as Sn}from"./chunk-DEX3ZQW4.js";import"./chunk-N7HBSHMG.js";import{x as fn}from"./chunk-3MKOFVA4.js";import{a as Rn}from"./chunk-FKN7LIYH.js";import{a as ke}from"./chunk-CNWBCCFP.js";import{a as _n}from"./chunk-K77GW65W.js";import{E as hn,G as F,H as V}from"./chunk-YC3Z7OAA.js";import{a as me}from"./chunk-IYLU72I4.js";import{b as H,c as gt,d as bn}from"./chunk-2NF5H2TO.js";import{a as In}from"./chunk-XLPYUWJX.js";import{a as Kt}from"./chunk-7LGRH5L7.js";import{A as Gt,G as Xt,Ga as f,H as Jt,Ha as fe,I as Qt,Ia as $,Ja as _e}from"./chunk-OSQH62D7.js";import{a as xn}from"./chunk-GLYC5MOA.js";import{E as un,F as Ne,f as Rt}from"./chunk-O5LVBWUD.js";import{$h as xe,Bb as c,Bj as kt,Ca as Oe,E as Pe,Fb as _t,G as Mt,Gb as Ct,Gd as Zt,Gj as he,Ha as s,Hb as bt,Hc as je,He as le,Ia as be,Ic as j,Ii as dt,Jc as Wt,Jg as cn,Jj as pn,K as Ae,Kb as J,Kc as $t,Lc as Ht,M as ct,Mb as Se,Nc as ue,Nf as en,Pb as We,Qb as Lt,Ra as v,Rb as st,Rc as Yt,Rj as gn,Tg as ln,V as G,Va as Bt,Wa as P,Xa as Ut,Zf as St,_ as lt,_a as A,_i as yt,a as y,ab as d,ac as M,b as D,ba as jt,bi as xt,ca as Ft,cc as Vt,dc as k,di as sn,ea as se,ec as E,fb as R,fi as mt,g as Ce,gj as mn,hc as L,ig as It,ja as K,jg as tn,ka as Z,l as at,la as Nt,mc as T,nb as l,nc as O,ob as S,oc as $e,oj as vt,pb as I,pj as dn,q as Pt,qb as N,qg as nn,qj as x,r as W,rc as ce,re as qt,rg as on,rj as vn,sa as Me,th as He,ub as g,uc as zt,ug as rn,v as B,vb as u,w as ft,wa as Ie,wb as ge,x as At,xb as te,ya as w,yg as an,yk as ye,zb as ne,zk as Fe}from"./chunk-SKSZYHHP.js";var de=(()=>{let o=class o{constructor(e,t,r,a,m,C,h,_,p,b,U,De,Y){this.afAuth=e,this.analyticsService=t,this.authService=r,this.configService=a,this.databaseService=m,this.commonDbService=C,this.docService=h,this.domService=_,this.emojiService=p,this.iamService=b,this.loggingService=U,this.userPermissionService=De,this.serviceBook=Y,this.documentPaths=null,this.reactionAnnotationById$=new at({}),this.customReactions$=new at({}),this.commentService=null,this.darkMode$=new at(null),this.loggingService.log("%c[WB] Creating CLASS: ReactionService","color: blue;"),this.serviceBook.observe(yt).subscribe(X=>{this.commentService=X}),this.subscribeReactionFeedOnReady()}setCommentService(e){this.loggingService.log("%c[WB] Calling FUNCTION: setCommentService","color: green;");try{this.commentService=e}catch(t){this.loggingService.catch("Error in ReactionService setCommentService: ",t)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in ReactionService","color: green;");try{this.reactionAnnotationById$.next({}),this.customReactions$.next({}),this.documentPaths=null}catch(e){this.loggingService.catch("Error in ReactionService clearCache: ",e)}}getAllReactionAnnotations(e,t,r,a,m){this.loggingService.log("%c[WB] Calling FUNCTION: getAllReactionAnnotations","color: green;");let C,h;try{if(e&&(h=`${St(e)}`),t&&typeof t=="object"){let _=an(t);C=St(JSON.stringify(_))}}catch(_){this.loggingService.catch("Error in ReactionService getAllReactionAnnotations: ",_)}return this.authService.getAuthState$().pipe(Pe(_=>!!_),G(_=>this.isFeatureAllowed({firebaseUser:_,annotations:[],filteredAnnotations:[]})),G(_=>_.featureAllowed?this.iamService.isUserAllowed$().pipe(B(p=>(_.featureAllowed=p,_))):W(_)),G(_=>_.featureAllowed?W(_).pipe(G(p=>this.docService.getDocumentPaths$().pipe(B(b=>(this.documentPaths=b,p.documentPaths=b,p)))),G(p=>h?this.getDataFromDocumentIds([h]).pipe(B(b=>(p.annotations=b||[],y({},p)))):this.docService.getDocumentIds$().pipe(G(b=>{let U=b?.length>0?b.map(De=>De.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds(U).pipe(B(De=>(p.annotations=De||[],y({},p))))}))),G(p=>this.docService.getLocation$().pipe(B(b=>(p.location=b,p)))),G(p=>this.docService.getLocations$().pipe(B(b=>(p.customLocations=b,p)))),B(p=>{if(p.filteredAnnotations=[],h&&!C)return p.filteredAnnotations=p.annotations?.slice(),p;{let b=[];return C?b.push(C):(b.push(p?.location?.locationId),b.push(...Object.values(p?.customLocations||[]).map(U=>U.locationId))),p.filteredAnnotations=this.filterAnnotationsByLocationIds(p?.annotations,b),p}}),G(p=>r?W(p):p?.annotations?.length?this.domService.onWindowResize$().pipe(B(()=>p)):W(p)),G(p=>r?W(p):W(p)),B(p=>p),G(p=>p?.filteredAnnotations?W(p?.filteredAnnotations||[]):W([]))):W([])),ct(sn))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(Pe(t=>!!t),B(t=>D(y({},e),{config:t})),G(t=>this.authService.getUser$().pipe(B(r=>D(y({},t),{user:r})))),G(t=>rn(t.config,t.user,qt.REACTION)?W(D(y({},t),{featureAllowed:!0})):(this.loggingService.warn("Reaction feature is not allowed."),W(D(y({},t),{featureAllowed:!1})))),ct((t,r)=>t?.featureAllowed===r?.featureAllowed))}getDataFromDocumentIds(e,t){return this.getDataFromDocuments({documentIds:e,filters:t})}getDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:t,filters:r}=e;return t?.some(a=>!a)||!this.documentPaths?W([]):At(()=>{let a=this.authService.getUser()?.userId;return a?this.serviceBook.observe(yt).pipe(B(m=>!!m?.buildVisibilityTokens),ct(),G(()=>Pt(this.buildReactionVisibilityTokens(a))),G(m=>this.buildReactionAnnotationsListener({documentIds:t,filters:r,visibilityTokens:m,currentUserId:a}))):W([])})}else return W([])}subscribeReactionFeedOnReady(){this.reactionDbReadyGate$().pipe(Ae(1)).subscribe(()=>{this.getAllReactionAnnotations(void 0,void 0,!0).subscribe()},e=>{this.loggingService.catch("Error in ReactionService getDb subscription: ",e)})}reactionDbReadyGate$(){return gn({isPortableFeedActive:()=>this.commonDbService?.usesPortableChannelFeed(Rt),firebaseDb$:()=>this.databaseService.getDb(),onError:(e,t)=>this.loggingService.catch(`Error in ReactionService reactionDbReadyGate$ ${e}: `,t)})}buildReactionAnnotationsListener({documentIds:e,filters:t,visibilityTokens:r,currentUserId:a}){let m=this.docService.getDocumentPaths()?.veltFolderId,C=W([]),h={useCollectionGroup:!0,isCollection:!0,useQuery:!0};this.commonDbService.shouldUseFirestore()||(h.documentId=e?.length?e[0]:void 0,h.organizationId=this.documentPaths?.organizationId);let _=this.userPermissionService?.getIsContextEnabled(),p=this.authService.getIsPrivateCommentsEnabled()?r:[le.DEFAULT_VELT_CONTEXT],b=_?this.docService.getProcessedDocContext():[],U=this.commonDbService.usesPortableChannelFeed(Rt),De=U?yn():null;if(U)C=this.commonDbService.dbListener({feature:"allReactions",properties:D(y({},h),{organizationId:this.documentPaths?.organizationId,documentIds:e})}).pipe(lt(),B(Y=>mt(JSON.parse(JSON.stringify([Y])))));else if(_){let Y=[...p,...b],X=Math.max(1,Math.min(le.LISTENER_CONTEXT_BATCH_SIZE,Math.floor(le.FIRESTORE_MAX_DISJUNCTIONS/Math.max(1,e?.length??1)))),ee=[];for(let z=0;z<(Y?.length??0);z+=X)ee.push(Y?.slice(z,z+X)??[]);C=ft(ee.map(z=>this.commonDbService.dbListener({feature:"allReactions",properties:D(y({},h),{firestoreQuery:[kt(he("metadata.apiKey","==",this.configService?.getApiKey()),he("metadata.documentId","in",e),he("metadata.organizationId","==",this.documentPaths?.organizationId),...m?[he("metadata.veltFolderId","==",m)]:[],...z?.length?[he("context.accessFields","array-contains-any",z)]:[])]})}).pipe(lt()))).pipe(B(z=>mt(z)))}else{let Y=[];for(let X=0;X<(e?.length??0);X+=le.LISTENER_BATCH_SIZE)Y.push(e?.slice(X,X+le.LISTENER_BATCH_SIZE)??[]);C=ft(Y.map(X=>this.commonDbService.dbListener({feature:"allReactions",properties:D(y({},h),{firestoreQuery:[kt(he("metadata.apiKey","==",this.configService?.getApiKey()),he("metadata.documentId","in",X),he("metadata.organizationId","==",this.documentPaths?.organizationId),...m?[he("metadata.veltFolderId","==",m)]:[])]})}).pipe(lt()))).pipe(B(X=>mt(X)))}return C.pipe(B(Y=>({data:Y?.data,operation:Y?.operation})),B(({data:Y,operation:X})=>{let ee=[];return Y&&(ee=Object.values(Y??{}).filter(z=>typeof z=="object")),ee?.forEach(z=>{this.sanitizeReactionAnnotation(z)}),ee=this.applyPortableQueryScopeFilter(ee,{isPortableFeed:U,scope:{veltFolderId:m},evictDropped:!t,resultSet:De}),ee=this.applyReactionVisibilityPostFilter(ee,r,a,_?b:null),{data:ee,operation:X}}),B(({data:Y,operation:X})=>{if(!e)return{data:Y,documentMap:{},operation:X};let ee=Y.reduce((z,we)=>{let rt=we.metadata?.documentId;return rt&&(z[rt]||(z[rt]=[]),z[rt].push(we)),z},{});return{data:Y,documentMap:ee,operation:X}}),B(({data:Y,documentMap:X,operation:ee})=>{if(!t)if(ee?.type==="removed"){if(ee?.ids?.length){let z=this.reactionAnnotationById$.value;ee?.ids?.forEach(we=>{delete z?.[we]}),this.reactionAnnotationById$.next(z)}}else Object.entries(X??{}).forEach(([z,we])=>{this.setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:z,annotations:we})});return Y}),Mt(Y=>(this.loggingService.catch("Error in ReactionService getDataFromDocumentId: ",Y),W([]))))}buildReactionVisibilityTokens(e){return Ce(this,null,function*(){try{return this.commentService?.buildVisibilityTokens?yield this.commentService.buildVisibilityTokens(e):It({userId:e})}catch(t){return this.loggingService.catch("Error in ReactionService buildReactionVisibilityTokens: ",t),It({userId:e})}})}applyReactionVisibilityPostFilter(e,t,r,a){try{let m=tn(e,{userId:r,tokens:t});a&&(m=nn(m,a));let C=new Set(m),h=(e||[]).filter(_=>!C.has(_));return h.length&&this.evictReactionAnnotationsFromLocalCache(h.map(_=>_?.annotationId).filter(_=>!!_)),m}catch(m){return this.loggingService.catch("Error in ReactionService applyReactionVisibilityPostFilter: ",m),e}}applyPortableQueryScopeFilter(e,t){try{let{kept:r,departed:a}=kn(e,t,m=>on(m,t.scope));return a.length&&this.evictReactionAnnotationsFromLocalCache(a),r}catch(r){return this.loggingService.catch("Error in ReactionService applyPortableQueryScopeFilter: ",r),e}}evictReactionAnnotationsFromLocalCache(e){try{if(!e?.length)return;let t=this.reactionAnnotationById$?.value;if(t&&e.some(r=>r in t)){let r=y({},t);e.forEach(a=>{delete r[a]}),this.reactionAnnotationById$.next(r)}}catch(t){this.loggingService.catch("Error in ReactionService evictReactionAnnotationsFromLocalCache: ",t)}}setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:r,queryHash:a}){try{if(t){e||(e=le.NO_ORGANIZATION_ID),a||(a=le.DEFAULT_QUERY_HASH);let m={};r?.forEach(h=>{h?.annotationId&&(m[h?.annotationId]=h)});let C=y(y({},this.reactionAnnotationById$.value),m);this.reactionAnnotationById$.next(C)}}catch(m){this.loggingService.catch("Error in ReactionService setReactionAnnotationsByOrganizationIdAndDocumentId:",m)}}getReactionAnnotationsByOrganizationIdAndDocumentIds({organizationId:e,documentIds:t}){try{let r=new Set((t||[]).map(a=>String(a)));return Object.values(this.reactionAnnotationById$.value??{}).filter(a=>a?.metadata?.documentId!=null&&r.has(String(a.metadata.documentId))&&a?.metadata?.organizationId==e)}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsByOrganizationIdAndDocumentIds:",r),[]}}getSectionWriteReactionIds(e,t){try{let r=t?He(t,["id","data-id"]):null,a=this.docService.getBaseMetadata("reaction",{element:r})?.documentId;return(e||[]).filter(m=>!a||!m?.metadata?.documentId||String(m.metadata.documentId)===String(a)).map(m=>m?.annotationId).filter(m=>!!m)}catch(r){return this.loggingService.catch("Error in ReactionService getSectionWriteReactionIds:",r),(e||[]).map(a=>a?.annotationId).filter(a=>!!a)}}groupReactionsByIcon(e){try{let t=[],r=new Map;return(e||[]).forEach(a=>{if(!a?.annotationId)return;let m=a.icon?r.get(a.icon):void 0;if(m){m.annotationIds.push(a.annotationId);return}let C={annotationId:a.annotationId,annotationIds:[a.annotationId]};t.push(C),a.icon&&r.set(a.icon,C)}),t}catch(t){return this.loggingService.catch("Error in ReactionService groupReactionsByIcon:",t),(e||[]).filter(r=>!!r?.annotationId).map(r=>({annotationId:r.annotationId,annotationIds:[r.annotationId]}))}}mergeReactionAnnotations(e){try{let t=(e||[]).filter(m=>!!m);if(t.length<=1)return t[0];let r=new Set,a=[];return t.forEach(m=>{(m.reactions||[]).forEach(C=>{let h=C?.from?.userId;if(h){if(r.has(h))return;r.add(h)}a.push(C)})}),D(y({},t[0]),{reactions:a})}catch(t){return this.loggingService.catch("Error in ReactionService mergeReactionAnnotations:",t),e?.find(r=>!!r)||void 0}}getMergedReactionAnnotation$(e,t){try{return this.reactionAnnotationById$.pipe(B(()=>this.mergeReactionAnnotations((e||[]).map(r=>this.getAnnotationById(r,t)))))}catch(r){return this.loggingService.catch("Error in ReactionService getMergedReactionAnnotation$:",r),W(void 0)}}toggleSectionReaction(e,t,r){return Ce(this,null,function*(){try{let a=this.authService?.getUser()?.userId,m=(t||[]).filter(h=>h?.icon===e&&!!h?.annotationId),C=a?m.filter(h=>(h.reactions||[]).some(_=>_?.from?.userId===a)):[];if(C.length){for(let h of C)((this.getAnnotationById(h.annotationId)??h).reactions||[]).some(p=>p?.from?.userId===a)&&(yield this.addOrUpdateReaction(e,[h.annotationId],void 0,r));return}yield this.addOrUpdateReaction(e,this.getSectionWriteReactionIds(m,r),void 0,r)}catch(a){this.loggingService.catch("Error in ReactionService toggleSectionReaction:",a)}})}getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let r={};return Object.values(this.reactionAnnotationById$.value??{}).forEach(a=>{a?.metadata?.documentId==t&&a?.metadata?.organizationId==e&&(r[a?.annotationId]=a)}),Object.values(r)}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsByOrganizationIdAndDocumentId:",r),[]}}getLocations$(){return this.docService.getLocation$().pipe(G(e=>this.docService.getLocations$().pipe(B(t=>({location:e,locations:t})))),B(e=>{let t=[];return t.push(e?.location?.locationId),t.push(...Object.values(e.locations||[]).map(r=>r.locationId)),t||[]}))}filterAnnotationsByLocationIds(e,t){try{return e.filter(r=>t.includes(r.locationId))}catch(r){return this.loggingService.catch("Error in ReactionService filterAnnotationsByLocations:",r),[]}}getAnnotationById(e,t){try{let r=this.reactionAnnotationById$.value?.[e];if(r){let{documentId:a,organizationId:m}=t||{};if(a&&r.metadata?.documentId!==a||m&&r.metadata?.organizationId!==m)return}return r}catch(r){this.loggingService.catch("Error in ReactionService getAnnotationById: ",r);return}}getBaseMetadataFromReactionAnnotationId(e){try{let t=this.reactionAnnotationById$.value?.[e];return t?t.metadata:void 0}catch(t){this.loggingService.catch("Error in ReactionService getBaseMetadataFromReactionAnnotationId: ",t);return}}getReactionAnnotationByAnnotationId(e,t){try{return this.reactionAnnotationById$.pipe(B(()=>this.getAnnotationById(e,t)),G(r=>r?W(r):W(r)))}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationByAnnotationId: ",r),W(void 0)}}getReactionAnnotationsBySectionId(e){try{return this.reactionAnnotationById$.pipe(G(t=>this.docService.getDocumentPaths$().pipe(B(r=>({documentPaths:r,sectionId:e,reactionAnnotationsMap:t})))),G(t=>this.docService.getAreaChanges$().pipe(B(()=>t))),G(t=>{let r=He(e,["id","data-id"]);if(r){let a=this.docService.getAdditionLocationFromElement(r);if(a){let m=this.docService.genarateLocationId(a);return this.docService.getLocations$().pipe(B(C=>{let _=Object.values(C||{}).find(p=>p.locationId===m||a?.id&&p.location.id===a.id);return D(y({},t),{additionalLocation:_,locationOnElement:!!a,element:r})}))}}return W(D(y({},t),{additionalLocation:null,element:r}))}),G(t=>t?.locationOnElement?W(t):this.docService.getLocation$().pipe(B(r=>D(y({},t),{location:r})))),B(({documentPaths:t,location:r,additionalLocation:a,locationOnElement:m,element:C})=>{let h=null,_=this.docService.getAreaDocumentIds(C),p=t?.organizationId;if(_.length){let b=this.getReactionAnnotationsByOrganizationIdAndDocumentIds({organizationId:p,documentIds:_});if(b){h=[];for(let U of b)U?.targetElementId===e&&(m?a&&xt({location:a?.location,locationId:a?.locationId},{location:U.location,locationId:U.locationId})&&h.push(U):r?xt({location:r?.location,locationId:r?.locationId},{location:U.location,locationId:U.locationId})&&h.push(U):U?.locationId||h.push(U))}}return h}))}catch(t){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsBySectionId: ",t),W(null)}}addOrUpdateReaction(e,t,r,a,m,C,h,_){return Ce(this,null,function*(){try{let p=t?.map(b=>this.getAnnotationById(b)).find(b=>b?.icon===e);if(p){if(!h||h==="delete")return yield this.updateUserInReaction(p)}else if(!h||h==="add")return yield this.addReaction(void 0,e,r,a,m,C,_)}catch(p){this.loggingService.catch("Error in ReactionService addOrUpdateReaction: ",p)}})}addReaction(e,t,r,a,m,C,h){return Ce(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: addReaction","color: green;");try{let _=this.authService.getUser();if(_)if(_.isReadOnly||_.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add reactions.");else{let p=new en;if(p.from=_,p.lastUpdated=this.timestamp,p.reactions=[],p.reactions.push({from:_,lastUpdated:this.timestamp}),a&&(p.targetElementId=a),m){p.commentAnnotationId=m;let b=this.commentService?.getAnnotationById(m);b||this.loggingService.warn("addReaction: parent comment annotation not in local cache \u2014 reaction written without inherited access gate.",m);let U=b?.context?.accessFields;if(U?.length){if(!this.userPermissionService?.hasUserContextAccess({userId:_.userId,accessFields:U})){this.loggingService.catch("User does not have context access to add reaction annotation.",void 0,void 0,!0);return}p.context=D(y({},b?.context?.access?{access:b.context.access}:{}),{accessFields:U})}}if(this.setLocationToReactionAnnotation(p),p.pageInfo=ln(),p.pageInfo&&(p.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth),t)if(p.icon=t,C)p.iconUrl=C?.url,p.iconEmoji=C?.emoji;else{let b=this.customReactions$.value;if(b){let U=b[t];U?.url&&(p.iconUrl=U?.url),U?.emoji&&(p.iconEmoji=U?.emoji)}}return r&&(p.location={},p.location=y({},r),p.locationId=this.docService.genarateLocationId(p.location)),yield this.saveReactionToDb(p)}}catch(_){this.loggingService.catch("Error in ReactionService addReaction: ",_)}})}setLocationToReactionAnnotation(e){try{let t=this.docService.getLocation();t?(e.locationId=t.locationId,e.location=t.location):(delete e.locationId,delete e.location);try{let r;e.targetElement?.xpath?r=this.domService.getElementFromXPath(e.targetElement.xpath):e.targetElementId&&(r=He(e.targetElementId,["id","data-id"]));let a=this.docService.getAdditionLocationFromElement(r);if(a){let m=this.docService.addLocation({location:a,source:"internal"});m?.[0]&&(e.locationId=m[0].locationId,e.location=m[0].location)}}catch{}}catch(t){this.loggingService.catch("Error in ReactionService setLocationToReactionAnnotation:",t)}}getElementForReactionAnnotation(e){try{let t;return e.targetElementId&&(t=He(e.targetElementId,["id","data-id"])),t}catch(t){return this.loggingService.catch("Error in ReactionService getElementForReactionAnnotation: ",t),null}}saveReactionToDb(e){return Ce(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: saveReactionToDb","color: green;");try{if(this.authService.getUser()){let t=yield this.docService.getDocumentPaths$().pipe(Pe(r=>!!r),Ae(1)).toPromise();if(!t)throw new Error("Document paths not found.");if(this.documentPaths=t,this.loggingService.log(this.documentPaths),yield this.reactionDbReadyGate$().pipe(Ae(1)).toPromise(),this.documentPaths?.reaction){if(e.annotationId=this.commonDbService.generateDocumentId(),e.pageInfo,!e?.metadata?.documentId){e?.metadata||(e.metadata={});let h=this.getElementForReactionAnnotation(e),_=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId,element:h});e.metadata=y(y({},e?.metadata),_)}let r=JSON.parse(JSON.stringify(e));r.position=null;let{documentId:a,organizationId:m}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(e),C=e.commentAnnotationId?void 0:{annotationData:r,actionType:"add",notificationSource:"reaction"};return yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:a,organizationId:m},data:r,extraData:C}),r}else return}}catch(t){this.loggingService.catch("Error in ReactionService saveReactionToDb: ",t)}})}getDocumentIdAndOrganizationIdFromReactionAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in ReactionService getDocumentIdAndOrganizationIdFromReactionAnnotation: ",t),{}}}updateUserInReaction(e){return Ce(this,null,function*(){try{let t=this.authService.getUser();if(t)return e?.reactions||(e.reactions=[]),e?.reactions?.find(a=>a?.from?.userId===t?.userId)?e.reactions=e?.reactions?.filter(a=>a?.from?.userId!==t?.userId):e.reactions.push({from:t,lastUpdated:this.timestamp}),e.reactions.length?yield this.updateReaction(e):yield this.deleteReactionPinAnnotation(e?.annotationId),e}catch(t){this.loggingService.catch("Error in ReactionService updateUserInReaction: ",t)}})}removeUserFromReaction(e){this.loggingService.log("%c[WB] Calling FUNCTION: removeUserFromReaction","color: green;");try{let t=this.authService.getUser();t&&(e?.reactions||(e.reactions=[]),e.reactions=e?.reactions?.filter(r=>r?.from?.userId!==t?.userId),this.updateReaction(e))}catch(t){this.loggingService.catch("Error in ReactionService removeUserFromReaction: ",t)}}updateReaction(e,t,r){return Ce(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateReaction","color: green;");try{if(this.authService.getUser()){if(e?.targetElement?.xpath){let h=this.domService.getXPath(e.targetElement.xpath);if(h){let _=h.iterateNext();_&&(cn(_)||(e.targetElement=null))}}let a=JSON.parse(JSON.stringify(e));if(a.position=null,a.lastUpdated=this.timestamp,!a?.metadata?.documentId){a?.metadata||(a.metadata={});let h=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId});a.metadata=y(y({},a?.metadata),h)}let{documentId:m,organizationId:C}=a?.metadata||{};return r?yield this.commonDbService.updateData({feature:"reaction",properties:{id:e.annotationId,documentId:m,organizationId:C},data:JSON.parse(JSON.stringify(a))}):yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:m,organizationId:C},data:JSON.parse(JSON.stringify(a))}),a}}catch(a){this.loggingService.catch("Error in ReactionService updateReaction: ",a)}})}deleteReactionPinAnnotation(e,t){return Ce(this,null,function*(){try{let r=this.getAnnotationById(e),{documentId:a,organizationId:m}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(r),C=r&&!r.commentAnnotationId?{annotationData:r,actionType:"delete",notificationSource:"reaction"}:void 0;yield this.commonDbService.deleteData({feature:"reaction",properties:{id:e,documentId:a,organizationId:m},extraData:C})}catch(r){this.loggingService.catch("Error in ReactionService deleteReactionPinAnnotation: ",r)}})}setCustomReactions(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;"),this.customReactions$.next(e),this.emojiService.setEmojiList(e)}catch(t){this.loggingService.catch("Error in ReactionService setCustomReactions: ",t)}}enableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;"),this.darkMode$.value===!0)return;this.darkMode$.next(!0)}catch(e){this.loggingService.catch("Error in ReactionService enableDarkMode: ",e)}}disableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;"),this.darkMode$.value===!1)return;this.darkMode$.next(!1)}catch(e){this.loggingService.catch("Error in ReactionService disableDarkMode: ",e)}}getDarkMode(){return this.darkMode$.value}getDarkMode$(){return this.darkMode$.asObservable()}sanitizeReactionAnnotation(e){try{e&&(e.iconUrl&&(e.iconUrl=this.domService.sanitizeHtml(e.iconUrl)),e.iconEmoji&&(e.iconEmoji=this.domService.sanitizeHtml(e.iconEmoji)),e.icon&&(e.icon=this.domService.sanitizeHtml(e.icon)))}catch(t){this.loggingService.catch("Error in ReactionService sanitizeReactionAnnotation: ",t)}}get timestamp(){return this.commonDbService.getServerTimestamp()}getReactionAnnotationForClient(e){try{let t=["isReactionResolverUsed","pageInfo","from","involvedUserIds","position"],r=JSON.parse(JSON.stringify(e)),a={};return Object.keys(r).forEach(m=>{t.includes(m)||(m==="reactions"?a.fromUsers=r[m]:a[m]=r[m])}),a}catch(t){return this.loggingService.catch("Error in ReactionService getReactionAnnotationForClient: ",t),e}}};o.\u0275fac=function(t){return new(t||o)(se(Zt),se(dn),se(Fe),se(vn),se(pn),se(un),se(Ne),se(ye),se(Re),se(In),se(x),se(Rn),se(vt))},o.\u0275prov=jt({token:o,factory:o.\u0275fac,providedIn:"root"});let n=o;return n})();var Te=class{constructor(){this.annotations=[],this.reactionGroups=[],this.skeletonLoading=!0,this.darkMode=!1}};var ie=class{constructor(){this.type="comment",this.disableTooltip=!1,this.isReactionSelectedByCurrentUser=!1,this.tooltipVisible=!1,this.shadowDom=!1}};var Dn=n=>({componentConfigSignal:n}),Hn=(n,o)=>({condition:n,data:o}),Yn=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-emoji-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function Gn(n,o){if(n&1&&(g(0),N(1,"div",3),T(2,"emoji"),T(3,"translate"),u()),n&2){let i=c(3).ngIf,e=c();s(),l("innerHTML",$e(2,3,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Oe),R("data-testid",e.componentId)("aria-label",O(3,6,"Reaction with")+" "+((i==null||i.annotation==null?null:i.annotation.icon)||"emoji"))}}function Xn(n,o){if(n&1&&(g(0),d(1,Gn,4,8,"ng-container",0),u()),n&2){let i=c(2).ngIf;s(),l("ngIf",i==null?null:i.annotation)}}function Jn(n,o){if(n&1&&(g(0),d(1,Xn,2,1,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,Yn,e.template,k(1,Dn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Qn(n,o){if(n&1&&(g(0),d(1,Jn,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,Hn,i.conditionSignal(),k(1,Dn,i.componentConfigSignal)))}}var Ye=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reaction-pin-emoji",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-emoji-internal"]],standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","img",1,"velt-reaction-pin--emoji",3,"innerHTML"]],template:function(t,r){t&1&&d(0,Qn,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,pt,H],styles:["[_nghost-%COMP%]{display:inline-flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=o;return n})();var On=n=>({componentConfigSignal:n}),Zn=(n,o)=>({condition:n,data:o}),qn=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-count-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function ei(n,o){if(n&1&&(S(0,"div",4),T(1,"translate"),We(2),I()),n&2){let i=c(3).ngIf,e=c();R("data-testid",e.componentId)("aria-label",O(1,3,"Reaction count")+" "+((i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)||0)),s(2),st(" ",i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length," ")}}function ti(n,o){if(n&1&&(g(0),d(1,ei,3,5,"div",3),u()),n&2){let i=c(2).ngIf;s(),l("ngIf",i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)}}function ni(n,o){if(n&1&&(g(0),d(1,ti,2,1,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,qn,e.template,k(1,On,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function ii(n,o){if(n&1&&(g(0),d(1,ni,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,Zn,i.conditionSignal(),k(1,On,i.componentConfigSignal)))}}var Ge=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reaction-pin-count",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-count-internal"]],standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["class","velt-reaction-pin--count","role","status",4,"ngIf"],["role","status",1,"velt-reaction-pin--count"]],template:function(t,r){t&1&&d(0,ii,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,H],styles:["[_nghost-%COMP%]{display:inline-flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=o;return n})();var wn=n=>({componentConfigSignal:n}),ri=(n,o)=>({condition:n,data:o}),ai=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-tooltip-user-avatar-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function ci(n,o){if(n&1&&(g(0),N(1,"snippyly-user-avatar",3),T(2,"translate"),T(3,"translate"),u()),n&2){let i=c(4);s(),l("size",24)("user",i.reaction==null?null:i.reaction.from),R("data-testid",i.componentId+"-avatar")("aria-label",O(2,4,"Avatar for")+" "+O(3,6,(i.reaction==null||i.reaction.from==null?null:i.reaction.from.name)||(i.reaction==null||i.reaction.from==null?null:i.reaction.from.email)||"user"))}}function li(n,o){if(n&1&&(g(0),d(1,ci,4,8,"ng-container",0),u()),n&2){let i=c(3);s(),l("ngIf",i.reaction)}}function si(n,o){if(n&1&&(g(0),d(1,li,2,1,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,ai,e.template,k(1,wn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function mi(n,o){if(n&1&&(g(0),d(1,si,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,ri,i.conditionSignal(),k(1,wn,i.componentConfigSignal)))}}var Xe=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-avatar",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-tooltip-user-avatar-internal"]],inputs:{reaction:"reaction"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-reaction-pin-tooltip-user-avatar",3,"size","user"]],template:function(t,r){t&1&&d(0,mi,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,bn,H],styles:["[_nghost-%COMP%]:empty{display:none}snippyly-user-avatar[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let n=o;return n})();var Pn=n=>({componentConfigSignal:n}),pi=(n,o)=>({condition:n,data:o}),gi=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-tooltip-user-name-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function ui(n,o){if(n&1&&(S(0,"span",7),We(1),T(2,"translate"),I()),n&2){let i=c(6);R("data-testid",i.componentId+"-suffix"),s(),st("(",O(2,2,"You"),")")}}function hi(n,o){if(n&1&&(g(0),S(1,"span",5),We(2),T(3,"translate"),I(),d(4,ui,3,4,"span",6),u()),n&2){let i=c(4).ngIf,e=c();s(),R("data-testid",e.componentId+"-name"),s(),Lt(O(3,3,(e.reaction==null||e.reaction.from==null?null:e.reaction.from.name)||(e.reaction==null||e.reaction.from==null?null:e.reaction.from.email))),s(2),l("ngIf",(e.reaction==null||e.reaction.from==null?null:e.reaction.from.userId)===(i==null||i.user==null?null:i.user.userId))}}function fi(n,o){if(n&1&&(g(0),d(1,hi,5,5,"ng-container",4),u()),n&2){c(2);let i=J(3),e=c(2);s(),l("ngIf",(e.reaction==null||e.reaction.from==null?null:e.reaction.from.name)||(e.reaction==null||e.reaction.from==null?null:e.reaction.from.email))("ngIfElse",i)}}function _i(n,o){if(n&1&&(g(0),d(1,fi,2,2,"ng-container",1),u()),n&2){let i=c(3);s(),l("ngIf",i.reaction)}}function Ci(n,o){n&1&&N(0,"velt-skeleton-loader-internal",8)}function bi(n,o){if(n&1&&(g(0),d(1,_i,2,1,"ng-container",3)(2,Ci,1,0,"ng-template",null,0,ce),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,gi,e.template,k(1,Pn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Si(n,o){if(n&1&&(g(0),d(1,bi,4,9,"ng-container",2),u()),n&2){let i=c();s(),l("veltIf",E(3,pi,i.conditionSignal(),k(1,Pn,i.componentConfigSignal)))}}var Je=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-name",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-tooltip-user-name-internal"]],inputs:{reaction:"reaction"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[["loadingTemplateRef",""],[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngIf","ngIfElse"],[1,"velt-reaction-pin-tooltip-user-name"],["class","velt-reaction-pin-tooltip-user-name-suffix",4,"ngIf"],[1,"velt-reaction-pin-tooltip-user-name-suffix"],["height","20px","width","64px","borderRadius","20px"]],template:function(t,r){t&1&&d(0,Si,2,6,"ng-container",1),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,gt,H],styles:["[_nghost-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=o;return n})();var An=(n,o)=>({componentConfigSignal:n,reaction:o}),xi=(n,o)=>({condition:n,data:o}),yi=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-tooltip-user-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function ki(n,o){if(n&1&&(S(0,"div",3),T(1,"translate"),T(2,"translate"),N(3,"velt-reaction-pin-tooltip-user-avatar-internal",4)(4,"velt-reaction-pin-tooltip-user-name-internal",5),I()),n&2){let i=c(3);R("data-testid",i.componentId)("aria-label",O(1,5,"Reaction by")+" "+O(2,7,(i.reaction==null||i.reaction.from==null?null:i.reaction.from.name)||(i.reaction==null||i.reaction.from==null?null:i.reaction.from.email)||"user")),s(3),l("reaction",i.reaction),s(),l("reaction",i.reaction)("componentConfigSignal",i.componentConfigSignal)}}function Ri(n,o){if(n&1&&(g(0),d(1,ki,5,9,"div",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(4,yi,e.template,E(1,An,e.componentConfigSignal,e.reaction),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Ti(n,o){if(n&1&&(g(0),d(1,Ri,2,10,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(4,xi,i.conditionSignal(),E(1,An,i.componentConfigSignal,i.reaction)))}}var Qe=(()=>{let o=class o extends ${set _userWireframe(e){try{this.userWireframe=e,this.userWireframe?this.template=this.domService.deepCloneElement(this.userWireframe):this.template=null}catch{}}constructor(e,t,r,a){super(t,a,r),this.domService=e,this.elementRef=t,this.loggingService=r,this.dynamicDataService=a,this.componentId="velt-reaction-pin-tooltip-user",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(ye),v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-tooltip-user-internal"]],inputs:{reaction:"reaction",_userWireframe:[0,"userWireframe","_userWireframe"]},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["class","v-tooltip-reaction-user velt-reaction-pin-tooltip-user","role","listitem",4,"veltDynamicTemplate"],["role","listitem",1,"v-tooltip-reaction-user","velt-reaction-pin-tooltip-user"],[3,"reaction"],[3,"reaction","componentConfigSignal"]],template:function(t,r){t&1&&d(0,Ti,2,7,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,Xe,Je,H],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reaction-pin-tooltip-user[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm);padding:var(--velt-spacing-sm)}"],changeDetection:0});let n=o;return n})();var Mn=n=>({componentConfigSignal:n}),Di=(n,o)=>({condition:n,data:o}),Oi=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-tooltip-users-wireframe",variant:i,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function wi(n,o){if(n&1&&(S(0,"div",5),N(1,"velt-reaction-pin-tooltip-user-internal",6),I()),n&2){let i=o.$implicit,e=o.index,t=c(4);R("data-testid",t.componentId+"-item-"+e),s(),l("userWireframe",t.userTemplate)("reaction",i)("componentConfigSignal",t.componentConfigSignal)}}function Pi(n,o){if(n&1&&(g(0),S(1,"div",3),T(2,"translate"),d(3,wi,2,4,"div",4),I(),u()),n&2){let i=c(2).ngIf,e=c();s(),R("data-testid",e.componentId)("aria-label",O(2,3,"Users who reacted")),s(2),l("ngForOf",i==null||i.annotation==null?null:i.annotation.reactions)}}function Ai(n,o){if(n&1&&(g(0),d(1,Pi,4,5,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,Oi,e.template,k(1,Mn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Mi(n,o){if(n&1&&(g(0),d(1,Ai,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,Di,i.conditionSignal(),k(1,Mn,i.componentConfigSignal)))}}var Ke=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-users",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{if(super.ngOnInit(),this.setupA11yAttributes(),!this.userTemplate){let e=this.template?.querySelector("velt-reaction-pin-tooltip-user-wireframe");xe(e)||(this.userTemplate=e)}}catch{}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUsersComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUsersComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-tooltip-users-internal"]],standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","list",1,"velt-reaction-pin-tooltip-users"],["role","presentation",4,"ngFor","ngForOf"],["role","presentation"],[3,"userWireframe","reaction","componentConfigSignal"]],template:function(t,r){t&1&&d(0,Mi,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[je,j,F,V,Qe,H],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reaction-pin-tooltip-users[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-xs)}"],changeDetection:0});let n=o;return n})();var Fi=n=>({componentConfigSignal:n}),Ni=(n,o)=>({template:n,context:o});function Bi(n,o){n&1&&ge(0)}function Ui(n,o){if(n&1&&(S(0,"velt-shadow-dom-internal"),d(1,Bi,1,0,"ng-container",3),I()),n&2){c();let i=J(3);s(),l("ngTemplateOutlet",i)}}function Li(n,o){if(n&1&&(S(0,"div",5),T(1,"translate"),N(2,"velt-reaction-pin-tooltip-users-internal",6),I()),n&2){let i=c(3);R("data-testid",i.componentId)("aria-label",O(1,4,"Reaction details")),s(2),l("componentConfigSignal",i.componentConfigSignal),R("data-testid",i.componentId+"-users")}}function Vi(n,o){if(n&1&&d(0,Li,3,6,"div",4),n&2){let i=c(2);l("veltDynamicTemplate",E(3,Ni,i.template,k(1,Fi,i.componentConfigSignal)))}}function zi(n,o){if(n&1&&(g(0),d(1,Ui,2,1,"velt-shadow-dom-internal",2)(2,Vi,1,6,"ng-template",null,0,ce),u()),n&2){let i=J(3),e=c();s(),l("ngIf",e.shadowDom&&!e.template||e.template&&e.isExplicitShadowDom)("ngIfElse",i)}}var Ze=(()=>{let o=class o extends _e{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}constructor(e,t,r,a,m){super(r,a,void 0,void 0,void 0,m,e),this.loggingService=e,this.wireframeService=t,this.elementRef=r,this.themeService=a,this.dynamicDataService=m,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.componentId="velt-reaction-pin-tooltip",this.subscriptions=[]}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let e=this.elementRef.nativeElement,t=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=t!==null&&t!=="false",this.setupA11yAttributes();let r="velt-reaction-pin-tooltip-wireframe";this.variant&&(r+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(r).subscribe(a=>{if(a){let m=document.createElement(a.tagName);m.innerHTML=a.innerHTML,this.template=m}}))}catch(e){this.catchError("Error in ReactionPinTooltipComponent OnInit: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.catchError("Error in ReactionPinTooltipComponent ondestroy: ",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("role","tooltip"),e.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipComponent setupA11yAttributes:",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 ReactionPinTooltipComponent unsubscribe: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(y({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(v(x),v(me),v(w),v(fe),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-tooltip-internal"]],inputs:{shadowDom:"shadowDom",variant:"variant"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[["reactionPinTooltipRef",""],[4,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","velt-reaction-pin-tooltip","role","tooltip",4,"veltDynamicTemplate"],["role","tooltip",1,"velt-reaction-pin-tooltip"],[3,"componentConfigSignal"]],template:function(t,r){t&1&&d(0,zi,4,2,"ng-container",1),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ue,ke,F,Ke,H],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-reaction-pin-tooltip[_ngcontent-%COMP%]{margin-block:8px;opacity:1;padding:4px;border-radius:var(--velt-border-radius-md);background:var(--velt-background-0);box-shadow:0 4px 21px #00000014;display:flex;flex-direction:column;gap:var(--velt-spacing-xs);color:var(--velt-text-0);font-size:var(--velt-font-size-xs);font-style:normal;font-weight:500;line-height:normal}.velt-reaction-pin-tooltip[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0});let n=o;return n})();var $i=["trigger"],Hi=["overlay"],jn=n=>({componentConfigSignal:n}),Fn=(n,o)=>({template:n,context:o}),Yi=(n,o)=>({reactionAnnotation:n,user:o});function Gi(n,o){if(n&1){let i=te();S(0,"div",8)(1,"div",9),T(2,"translate"),T(3,"translate"),ne("click",function(t){return K(i),c(4).onReactionClick(),Z(t.stopPropagation())}),N(4,"div",10),T(5,"emoji"),I()()}if(n&2){let i=c(3).ngIf,e=c();R("data-testid",e.componentId+"-timeline"),s(),R("data-testid",e.componentId+"-timeline-item")("aria-label",O(2,4,"React with")+" "+O(3,6,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("innerHTML",$e(5,8,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Oe)}}function Xi(n,o){if(n&1&&(g(0),N(1,"velt-reaction-pin-emoji-internal",13)(2,"velt-reaction-pin-count-internal",13),u()),n&2){let i=c(5);s(),l("componentConfigSignal",i.componentConfigSignal),s(),l("componentConfigSignal",i.componentConfigSignal)}}function Ji(n,o){if(n&1){let i=te();S(0,"div")(1,"div",11),T(2,"translate"),T(3,"translate"),ne("click",function(t){return K(i),c(4).onReactionClick(),Z(t.stopPropagation())}),d(4,Xi,3,2,"ng-container",12),I()()}if(n&2){let i=c(3).ngIf,e=c();s(),Se("velt-reaction-pin--default",!e.template)("velt-reaction-pin--no-reactions",!(!(i==null||i.annotation==null||i.annotation.reactions==null)&&i.annotation.reactions.length)),R("data-testid",e.componentId+"-default")("aria-label",O(2,7,"React with")+" "+O(3,9,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("veltDynamicTemplate",E(13,Fn,e.template,k(11,jn,e.componentConfigSignal)))}}function Qi(n,o){if(n&1&&(g(0),S(1,"div",5),d(2,Gi,6,11,"div",6)(3,Ji,5,16,"div",7),I(),u()),n&2){let i=c(3);s(),l("ngSwitch",i.type),s(),l("ngSwitchCase","timeline")}}function Ki(n,o){if(n&1){let i=te();S(0,"div",9),T(1,"translate"),T(2,"translate"),ne("click",function(t){return K(i),c(6).onReactionClick(),Z(t.stopPropagation())}),N(3,"div",10),T(4,"emoji"),I()}if(n&2){let i=c(5).ngIf,e=c();Se("active",i==null?null:i.isReactionSelectedByCurrentUser),R("data-testid",e.componentId+"-timeline-item")("aria-pressed",i==null?null:i.isReactionSelectedByCurrentUser)("aria-label",O(1,6,"React with")+" "+O(2,8,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("innerHTML",$e(4,10,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Oe)}}function Zi(n,o){if(n&1&&(S(0,"div",8),d(1,Ki,5,13,"div",15),I()),n&2){let i=c(4).ngIf,e=c();R("data-testid",e.componentId+"-timeline"),s(),l("ngIf",i==null||i.annotation==null?null:i.annotation.icon)}}function qi(n,o){n&1&&N(0,"velt-skeleton-loader-internal",18)}function eo(n,o){if(n&1&&(g(0),N(1,"velt-reaction-pin-emoji-internal",13)(2,"velt-reaction-pin-count-internal",13),u()),n&2){let i=c(7);s(),l("componentConfigSignal",i.componentConfigSignal),s(),l("componentConfigSignal",i.componentConfigSignal)}}function to(n,o){if(n&1){let i=te();S(0,"div",11),T(1,"translate"),T(2,"translate"),ne("click",function(t){return K(i),c(6).onReactionClick(),Z(t.stopPropagation())}),d(3,eo,3,2,"ng-container",12),I()}if(n&2){let i=c(5).ngIf,e=c();Se("velt-reaction-pin--default",!e.template)("active",i==null?null:i.isReactionSelectedByCurrentUser)("velt-reaction-pin--no-reactions",!(!(i==null||i.annotation==null||i.annotation.reactions==null)&&i.annotation.reactions.length)),R("data-testid",e.componentId+"-default")("aria-pressed",i==null?null:i.isReactionSelectedByCurrentUser)("aria-label",O(1,10,"React with")+" "+O(2,12,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("veltDynamicTemplate",E(16,Fn,e.template,k(14,jn,e.componentConfigSignal)))}}function no(n,o){if(n&1&&(S(0,"div"),d(1,qi,1,0,"velt-skeleton-loader-internal",16)(2,to,4,19,"div",17),I()),n&2){let i=c(4).ngIf,e=c();s(),l("ngIf",e.showLoadingTemplate),s(),l("ngIf",i==null||i.annotation==null?null:i.annotation.icon)}}function io(n,o){if(n&1&&(S(0,"div",5),d(1,Zi,2,2,"div",6)(2,no,3,2,"div",7),I()),n&2){let i=c(4);l("ngSwitch",i.type),s(),l("ngSwitchCase","timeline")}}function oo(n,o){n&1&&ge(0)}function ro(n,o){if(n&1&&(g(0),d(1,oo,1,0,"ng-container",20),u()),n&2){let i=c(4).ngIf,e=c();s(),l("ngTemplateOutlet",e.customTooltipTemplate)("ngTemplateOutletContext",E(2,Yi,i==null?null:i.annotation,i==null?null:i.user))}}function ao(n,o){if(n&1&&N(0,"velt-reaction-pin-tooltip-internal",21),n&2){let i=c(5);l("shadowDom",!!i.shadowDom)("variant",i.variant)("componentConfigSignal",i.componentConfigSignal)("darkMode",i.darkMode)}}function co(n,o){if(n&1&&d(0,ro,2,5,"ng-container",19)(1,ao,1,4,"ng-template",null,2,ce),n&2){let i=J(2),e=c(4);l("ngIf",e.customTooltipTemplate)("ngIfElse",i)}}function lo(n,o){if(n&1&&(S(0,"app-overlay-tooltip",14),d(1,io,3,2,"ng-template",null,0,ce)(3,co,3,2,"ng-template",null,1,ce),I()),n&2){let i=c(3);l("positions",i.positions)("disabled",i.disableTooltip),R("data-testid",i.componentId+"-tooltip")}}function so(n,o){if(n&1&&(g(0),d(1,Qi,4,2,"ng-container",3)(2,lo,5,3,"app-overlay-tooltip",4),u()),n&2){let i=c().ngIf,e=c();s(),l("ngIf",e.reactionId&&!e.annotationId&&(i==null||i.annotation==null?null:i.annotation.icon)&&e.type!=="standalone"),s(),l("ngIf",(i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)||e.type==="standalone")}}function mo(n,o){if(n&1&&(g(0),d(1,so,3,2,"ng-container",3),u()),n&2){let i=c();s(),l("ngIf",!i.isExcludedValue)}}var Ue=(()=>{let o=class o extends _e{set reactionId(e){this._reactionId=e}get reactionId(){return this._reactionId}set"reaction-id"(e){this._reactionId=e}get isExcludedValue(){try{let e=this.componentConfigSignal(),t=e?.annotation?.icon,r=this.excludeReactionIds||e?.excludeReactionIds||[];return!t||!r?.length?!1:r.includes(t)}catch{return!1}}constructor(e,t,r,a,m,C,h){super(m,C,void 0,void 0,void 0,h,t),this.authService=e,this.loggingService=t,this.reactionService=r,this.wireframeService=a,this.elementRef=m,this.themeService=C,this.dynamicDataService=h,this.type="comment",this.disableTooltip=!1,this.shadowDom=!1,this.excludeReactionIds=[],this.commentReactionAnnotationIds=[],this.positions=[{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}],this.componentConfigSignal=Me(new ie),this.click=new be,this.showLoadingTemplate=!1,this.subscriptions=[],this.commentReactionSubscriptions=[],this.componentId="velt-reaction-pin",this.loggingService.log("%c[WB] Creating CLASS: ReactionPinComponent","color: blue;")}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit(),this.setupA11yAttributes(),this.setShowLoadingTemplate(),this.reactionId&&!this.annotationId&&(this.setDefaultReaction(this.reactionId),this.commentReactionAnnotationIds?.length&&this.findMatchingAnnotationFromCommentReactions());let e="velt-reaction-pin-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r}}))}catch(e){this.catchError("Error in ReactionPinComponent OnInit: ",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Reaction section")}catch(e){this.loggingService.catch("Error in ReactionPinComponent setupA11yAttributes:",e)}}ngAfterViewInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngAfterViewInit","color: green;");try{this.subscriptions.push(this.authService.getUser$().pipe(Pe(e=>!!e),Ae(1)).subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(y({},t),{user:e}),t)),this.checkIfReactionSelectedByCurrentUser()}))}catch(e){this.catchError("Error in ReactionPinComponent ngAfterViewInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(y({},r),{[t]:e[t].currentValue}),r))}),this.shouldResubscribeToAnnotation(e)&&(this.annotationSubscription?.unsubscribe(),this.annotationSubscription=void 0,this.annotationId&&this.getReactionByAnnotationId(this.annotationId)),e.reactionId&&this.reactionId&&!this.annotationId&&this.setDefaultReaction(this.reactionId),(e.commentReactionAnnotationIds||e.reactionId)&&this.reactionId&&!this.annotationId&&this.commentReactionAnnotationIds?.length&&this.findMatchingAnnotationFromCommentReactions()}catch(t){this.catchError("Error in ReactionPinComponent ngOnChanges: ",t)}}shouldResubscribeToAnnotation(e){if(e.annotationId)return!0;let t=e.mergedAnnotationIds;if(!t)return!1;let r=t.previousValue,a=t.currentValue;return!r||!a?r!==a:r.length!==a.length||r.some((m,C)=>m!==a[C])}setDefaultReaction(e){try{let t={icon:e,reactions:[]};this.componentConfigSignal.update(r=>(r=D(y({},r),{annotation:t}),r))}catch(t){this.catchError("Error in ReactionPinComponent setDefaultReaction: ",t)}}findMatchingAnnotationFromCommentReactions(){try{if(this.commentReactionSubscriptions.forEach(e=>e.unsubscribe()),this.commentReactionSubscriptions=[],!this.commentReactionAnnotationIds?.length||!this.reactionId)return;for(let e of this.commentReactionAnnotationIds){let t=this.reactionService.getReactionAnnotationByAnnotationId(e,this.parentMetadata).subscribe(r=>{r?.icon===this.reactionId&&(this.componentConfigSignal.update(a=>(a=D(y({},a),{annotation:r}),a)),this.checkIfReactionSelectedByCurrentUser())});this.commentReactionSubscriptions.push(t)}}catch(e){this.catchError("Error in ReactionPinComponent findMatchingAnnotationFromCommentReactions: ",e)}}getReactionByAnnotationId(e){this.loggingService.log("%c[WB] Calling FUNCTION: getReactionByAnnotationId","color: green;");try{let t=(this.mergedAnnotationIds?.length??0)>1?this.reactionService.getMergedReactionAnnotation$(this.mergedAnnotationIds,this.parentMetadata):this.reactionService.getReactionAnnotationByAnnotationId(e,this.parentMetadata);this.annotationSubscription=t.subscribe(r=>{this.componentConfigSignal.update(a=>(a=D(y({},a),{annotation:r}),a)),this.checkIfReactionSelectedByCurrentUser(),this.setShowLoadingTemplate(),this.componentConfigSignal().tooltipVisible&&!this.componentConfigSignal().annotation?.reactions?.length&&this.hideTooltip(),this.overlay?.overlayRef?.updatePosition()})}catch(t){this.catchError("Error in ReactionPinComponent getReactionByAnnotationId: ",t)}}checkIfReactionSelectedByCurrentUser(){this.loggingService.log("%c[WB] Calling FUNCTION: checkIfReactionSelectedByCurrentUser","color: green;");try{this.componentConfigSignal.update(e=>(e=D(y({},e),{isReactionSelectedByCurrentUser:!!e.annotation?.reactions?.find(t=>t?.from?.userId===e.user?.userId)}),e))}catch(e){this.catchError("Error in ReactionPinComponent checkIfReactionSelectedByCurrentUser: ",e)}}setShowLoadingTemplate(){try{!this.componentConfigSignal()?.annotation?.icon&&this.componentConfigSignal()?.annotation?.isReactionResolverUsed?this.showLoadingTemplate=!0:this.showLoadingTemplate=!1}catch(e){this.catchError("Error in ReactionPinComponent setShowLoadingTemplate: ",e)}}onReactionClick(){this.loggingService.log("%c[WB] Calling FUNCTION: onReactionClick","color: green;");try{this.click.emit(this.componentConfigSignal().annotation)}catch(e){this.catchError("Error in ReactionPinComponent onReactionClick: ",e)}}showTooltip(){try{this.componentConfigSignal.update(e=>(e=D(y({},e),{tooltipVisible:!0}),e))}catch(e){this.catchError("Error in ReactionPinComponent showTooltip: ",e)}}hideTooltip(){try{this.componentConfigSignal.update(e=>(e=D(y({},e),{tooltipVisible:!1}),e))}catch(e){this.catchError("Error in ReactionPinComponent hideTooltip: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.catchError("Error in ReactionPinComponent ngOnDestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.forEach(e=>{e.unsubscribe()}),this.subscriptions=[],this.commentReactionSubscriptions.forEach(e=>{e.unsubscribe()}),this.commentReactionSubscriptions=[],this.annotationSubscription?.unsubscribe(),this.annotationSubscription=void 0}catch(e){this.catchError("Error in ReactionPinComponent unsubscribe: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(y({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(v(Fe),v(x),v(de),v(me),v(w),v(fe),v(f))},o.\u0275cmp=P({type:o,selectors:[["app-reaction-pin"]],viewQuery:function(t,r){if(t&1&&(_t($i,5),_t(Hi,5)),t&2){let a;Ct(a=bt())&&(r.trigger=a.first),Ct(a=bt())&&(r.overlay=a.first)}},inputs:{type:"type",annotationId:"annotationId",disableTooltip:"disableTooltip",customTooltipTemplate:[0,"tooltipTemplate","customTooltipTemplate"],variant:"variant",shadowDom:"shadowDom",parentMetadata:"parentMetadata",excludeReactionIds:"excludeReactionIds",mergedAnnotationIds:"mergedAnnotationIds",commentReactionAnnotationIds:"commentReactionAnnotationIds",reactionId:[0,"reaction-id","reactionId"]},outputs:{click:"click"},standalone:!1,features:[M([f]),A,Ie],decls:1,vars:1,consts:[["triggerTemplate",""],["tooltipTemplate",""],["defaultTooltipTemplate",""],[4,"ngIf"],[3,"positions","disabled",4,"ngIf"],[3,"ngSwitch"],["class","s-emoji-block_timeline",4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"s-emoji-block_timeline"],["role","button",1,"s-emoji-block__item",3,"click"],["role","img","aria-hidden","true",1,"s-emoji-block__item__emoji",3,"innerHTML"],["role","button",1,"velt-reaction-pin",3,"click"],[4,"veltDynamicTemplate"],[3,"componentConfigSignal"],[3,"positions","disabled"],["class","s-emoji-block__item","role","button",3,"active","click",4,"ngIf"],["height","34px","width","51px","borderRadius","8px",4,"ngIf"],["class","velt-reaction-pin","role","button",3,"velt-reaction-pin--default","active","velt-reaction-pin--no-reactions","click",4,"ngIf"],["height","34px","width","51px","borderRadius","8px"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"shadowDom","variant","componentConfigSignal","darkMode"]],template:function(t,r){t&1&&d(0,mo,2,1,"ng-container",3),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ue,Wt,$t,Ht,Cn,F,gt,Ye,Ge,Ze,pt,H],styles:["[_nghost-%COMP%]:empty{display:none}.s-emoji-block_timeline[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--velt-spacing-sm);width:18px;height:18px}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item[_ngcontent-%COMP%]{display:flex;align-items:center}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__count[_ngcontent-%COMP%]{display:none}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__emoji{display:flex;align-items:center;justify-content:center}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__emoji svg, .s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__emoji img{width:16px!important;height:16px!important} .snippyly-reaction-dialog-overlay-panel{z-index:2147483577}"],changeDetection:0});let n=o;return n})();var Nn=n=>({componentConfigSignal:n}),po=(n,o)=>({condition:n,data:o}),go=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-inline-reactions-section-list-wireframe",variant:i,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function uo(n,o){if(n&1){let i=te();g(0),S(1,"div",6)(2,"app-reaction-pin",7),ne("click",function(t){K(i);let r=c(4).ngIf;return Z(r==null?null:r.onReactionClick(t))}),I()(),u()}if(n&2){let i=o.$implicit,e=c(4).ngIf,t=c();s(2),l("annotationId",i==null?null:i.annotationId)("mergedAnnotationIds",i==null?null:i.annotationIds)("shadowDom",!!(e!=null&&e.shadowDom))("variant",e==null?null:e.variant)("darkMode",!!(e!=null&&e.darkMode))("template",t.pinTemplate)}}function ho(n,o){if(n&1&&(S(0,"div",4),d(1,uo,3,6,"ng-container",5),I()),n&2){let i=c(3).ngIf;s(),l("ngForOf",i==null?null:i.reactionGroups)("ngForTrackBy",i.reactionAnnotationsTrackByFn)}}function fo(n,o){if(n&1&&(g(0),d(1,ho,2,2,"div",3),u()),n&2){let i=c(2).ngIf;s(),l("ngIf",(i==null||i.reactionGroups==null?null:i.reactionGroups.length)>0)}}function _o(n,o){if(n&1&&(g(0),d(1,fo,2,1,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,go,e.template,k(1,Nn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Co(n,o){if(n&1&&(g(0),d(1,_o,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,po,i.conditionSignal(),k(1,Nn,i.componentConfigSignal)))}}var qe=(()=>{let o=class o extends ${constructor(e,t,r,a){super(e,r,a),this.elementRef=e,this.wireframeService=t,this.dynamicDataService=r,this.loggingService=a,this.subscriptions=[],super.initializeComponentConfigSignal(new Te)}ngOnInit(){try{if(super.ngOnInit(),!this.template){let e="velt-inline-reactions-section-list-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r,this.getChildTemplate()}}))}this.getChildTemplate()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionListComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.loggingService.catch("Error in InlineReactionsSectionListComponent ngOnDestroy:",e)}}getChildTemplate(){try{if(!this.pinTemplate&&this.template){let e=this.template.querySelector("velt-reaction-pin-wireframe");xe(e)||(this.pinTemplate=e)}}catch(e){this.loggingService.catch("Error in InlineReactionsSectionListComponent getChildTemplate:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(me),v(f),v(x))},o.\u0275cmp=P({type:o,selectors:[["app-inline-reactions-section-list"]],inputs:{variant:"variant"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["class","velt-inline-reactions-section--reactions",4,"ngIf"],[1,"velt-inline-reactions-section--reactions"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"velt-inline-reactions-section--reaction"],[3,"click","annotationId","mergedAnnotationIds","shadowDom","variant","darkMode","template"]],template:function(t,r){t&1&&d(0,Co,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[je,j,F,V,Ue],styles:[".velt-inline-reactions-section--reactions[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--velt-spacing-xs)}[_nghost-%COMP%] .velt-reaction-pin--default{display:inline-flex;height:28px;padding:var(--velt-spacing-2xs) var(--velt-spacing-sm);align-items:center;gap:var(--velt-spacing-xs);flex-shrink:0;border-radius:var(--velt-border-radius-2xl);border:1px solid var(--velt-border-0);background:var(--velt-background-0);color:var(--velt-text-0);box-sizing:border-box;cursor:pointer}[_nghost-%COMP%] .velt-reaction-pin--default.active{border-radius:var(--velt-border-radius-2xl);border:1px solid var(--velt-accent);background:var(--velt-accent-transparent);color:var(--velt-accent)}[_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji{line-height:1;display:flex}[_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji svg, [_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji img, [_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji span{width:14px;height:14px;margin:0;font-size:14px;line-height:1}[_nghost-%COMP%] .velt-reaction-pin--default .s-emoji-block__item__count{font-size:var(--velt-font-size-sm);color:var(--velt-text-3)}"],changeDetection:0});let n=o;return n})();var Ee=class{};var Bn=n=>({componentConfigSignal:n}),So=(n,o)=>({condition:n,data:o}),Io=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reactions-panel-item-emoji-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function xo(n,o){if(n&1&&(g(0),N(1,"div",3),u()),n&2){let i=c(4);s(),l("innerHTML",i.emoji.value,Oe),R("data-testid",i.componentId+"-emoji")}}function yo(n,o){if(n&1&&(g(0),d(1,xo,2,2,"ng-container",0),u()),n&2){let i=c(3);s(),l("ngIf",i.emoji)}}function ko(n,o){if(n&1&&(g(0),d(1,yo,2,1,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,Io,e.template,k(1,Bn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Ro(n,o){if(n&1&&(g(0),d(1,ko,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,So,i.conditionSignal(),k(1,Bn,i.componentConfigSignal)))}}var et=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reactions-panel-item-emoji",super.initializeComponentConfigSignal(new Ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemEmojiComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemEmojiComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;this.emoji?.key&&e.setAttribute("aria-label",this.emoji.key),e.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelItemEmojiComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reactions-panel-item-emoji-internal"]],inputs:{emoji:"emoji"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-reactions-panel-item-emoji",3,"innerHTML"]],template:function(t,r){t&1&&d(0,Ro,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V],styles:["[_nghost-%COMP%] .velt-reactions-panel-item-emoji{display:flex;height:24px;width:24px;max-width:unset;margin:0;font-size:var(--velt-font-size-lg);line-height:1}[_nghost-%COMP%] .velt-reactions-panel-item-emoji svg, [_nghost-%COMP%] .velt-reactions-panel-item-emoji img, [_nghost-%COMP%] .velt-reactions-panel-item-emoji span{height:100%;width:100%;max-width:unset;margin:0;font-size:var(--velt-font-size-lg);line-height:1}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=o;return n})();var Eo=n=>({componentConfigSignal:n}),Do=(n,o)=>({condition:n,data:o}),Oo=(n,o)=>({emoji:n,componentConfigSignal:o}),wo=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reactions-panel-item-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function Po(n,o){if(n&1&&(g(0),N(1,"velt-reactions-panel-item-emoji-internal",4),u()),n&2){let i=c(4);s(),l("emoji",i.emoji),R("data-testid",i.componentId+"-emoji")}}function Ao(n,o){if(n&1){let i=te();g(0),S(1,"div",2),T(2,"translate"),ne("click",function(){K(i);let t=c(2).ngIf,r=c();return Z(t==null?null:t.handleEmojiSelected(r.emoji.key))}),d(3,Po,2,2,"ng-container",3),I(),u()}if(n&2){let i=c(2).ngIf,e=c();s(),R("aria-label",O(2,3,e.ariaLabel))("data-testid",e.componentId+"-item"),s(2),l("veltDynamicTemplate",L(8,wo,e.template,E(5,Oo,e.emoji,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Mo(n,o){if(n&1&&(g(0),d(1,Ao,4,14,"ng-container",0),u()),n&2){let i=c().ngIf,e=c();s(),l("ngIf",i&&e.emoji)}}function jo(n,o){if(n&1&&(g(0),d(1,Mo,2,1,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,Do,i.conditionSignal(),k(1,Eo,i.componentConfigSignal)))}}var tt=(()=>{let o=class o extends ${set _itemWireframe(e){this.itemWireframe=e,this.itemWireframe?this.template=this.domService.deepCloneElement(this.itemWireframe):this.template=null}constructor(e,t,r,a){super(t,a,r),this.domService=e,this.elementRef=t,this.loggingService=r,this.dynamicDataService=a,this.componentId="velt-reactions-panel-item",super.initializeComponentConfigSignal(new Ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemComponent ngOnDestroy:",e)}}get ariaLabel(){return this.emoji?.key||"Emoji"}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelItemComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(ye),v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reactions-panel-item-internal"]],inputs:{emoji:"emoji",_itemWireframe:[0,"itemWireframe","_itemWireframe"]},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[1,"velt-reactions-panel-item",3,"click"],[4,"veltDynamicTemplate"],[3,"emoji"]],template:function(t,r){t&1&&d(0,jo,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,et,H],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reactions-panel-item[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-2xs) var(--velt-spacing-xs);border-radius:var(--velt-border-radius-sm);background:transparent;cursor:pointer}.velt-reactions-panel-item[_ngcontent-%COMP%]:hover{background:var(--legacy-velt-border-color)}"],changeDetection:0});let n=o;return n})();var Un=n=>({componentConfigSignal:n}),No=(n,o)=>({condition:n,data:o}),Bo=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reactions-panel-items-wireframe",variant:i,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function Uo(n,o){if(n&1&&(g(0),N(1,"velt-reactions-panel-item-internal",5),u()),n&2){let i=o.$implicit,e=c(4);s(),l("itemWireframe",e.itemTemplate)("componentConfigSignal",e.componentConfigSignal)("emoji",i),R("data-testid",e.componentId+"-item-"+i.key)}}function Lo(n,o){if(n&1&&(g(0),S(1,"div",3),T(2,"translate"),d(3,Uo,2,4,"ng-container",4),I(),u()),n&2){let i=c(3);s(),R("aria-label",O(2,4,"Choose a reaction"))("data-testid",i.componentId+"-list"),s(2),l("ngForOf",i.filteredEmojis())("ngForTrackBy",i.trackByEmojiKey)}}function Vo(n,o){if(n&1&&(g(0),d(1,Lo,4,6,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,Bo,e.template,k(1,Un,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function zo(n,o){if(n&1&&(g(0),d(1,Vo,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,No,i.conditionSignal(),k(1,Un,i.componentConfigSignal)))}}var nt=(()=>{let o=class o extends ${constructor(e,t,r,a){super(r,a,t),this.emojiService=e,this.loggingService=t,this.elementRef=r,this.dynamicDataService=a,this.componentId="velt-reactions-panel-items",this.filteredEmojis=zt(()=>{try{let m=this.componentConfigSignal()?.excludeReactionIds||[],C=this.emojiService.emojisSignal();return m.length?Object.entries(C).filter(([h])=>!m.includes(h)).map(([h,_])=>({key:h,value:_})):Object.entries(C).map(([h,_])=>({key:h,value:_}))}catch(m){return this.loggingService.catch("Error in ReactionsPanelItemsComponent filteredEmojis:",m),[]}}),super.initializeComponentConfigSignal(new Ee)}ngOnInit(){try{if(super.ngOnInit(),this.setupA11yAttributes(),!this.itemTemplate){let e=this.template?.querySelector("velt-reactions-panel-item-wireframe");xe(e)||(this.itemTemplate=e)}}catch{}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemsComponent ngOnDestroy:",e)}}trackByEmojiKey(e,t){return t?.key||e}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelItemsComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(Re),v(x),v(w),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reactions-panel-items-internal"]],standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","list",1,"velt-reactions-panel-items"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"itemWireframe","componentConfigSignal","emoji"]],template:function(t,r){t&1&&d(0,zo,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[je,j,F,V,tt,H],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reactions-panel-items[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-xs);flex-wrap:wrap}"],changeDetection:0});let n=o;return n})();var $o=n=>({componentConfigSignal:n}),Ho=(n,o)=>({template:n,context:o});function Yo(n,o){n&1&&ge(0)}function Go(n,o){if(n&1&&(S(0,"velt-shadow-dom-internal"),d(1,Yo,1,0,"ng-container",3),I()),n&2){c();let i=J(3),e=c();R("data-testid",e.componentId+"-shadow-dom"),s(),l("ngTemplateOutlet",i)}}function Xo(n,o){if(n&1&&(g(0),N(1,"velt-reactions-panel-items-internal",6),u()),n&2){let i=c(3);s(),l("componentConfigSignal",i.componentConfigSignal),R("data-testid",i.componentId+"-items")}}function Jo(n,o){if(n&1){let i=te();S(0,"div",4),T(1,"translate"),ne("clickOutside",function(){K(i);let t=c(2);return Z(t.onClickOutside())}),d(2,Xo,2,2,"ng-container",5),I()}if(n&2){let i=c(2);Se("velt-reactions-panel--inline-section-mode",i.isInlineSectionMode)("velt-reactions-panel--default",!i.template)("dark",i.darkMode),R("aria-label",O(1,9,"Available reactions"))("data-testid",i.componentId+"-panel"),s(2),l("veltDynamicTemplate",E(13,Ho,i.template,k(11,$o,i.componentConfigSignal)))}}function Qo(n,o){if(n&1&&(g(0),d(1,Go,2,2,"velt-shadow-dom-internal",2)(2,Jo,3,16,"ng-template",null,0,ce),u()),n&2){let i=J(3),e=c();s(),l("ngIf",e.shadowDom&&!e.template||e.template&&e.isExplicitShadowDom)("ngIfElse",i)}}var wt=(()=>{let o=class o extends _e{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}constructor(e,t,r,a,m,C){super(r,a,void 0,void 0,void 0,C,t),this.emojiService=e,this.loggingService=t,this.elementRef=r,this.themeService=a,this.wireframeService=m,this.dynamicDataService=C,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.isInlineSectionMode=!1,this.excludeReactionIds=[],this.emojiSelected=new be,this.hideTooltip=new be,this.componentConfigSignal=Me({variant:this.variant,onClickOutside:this.onClickOutside.bind(this),handleEmojiSelected:this.handleEmojiSelected.bind(this),excludeReactionIds:this.excludeReactionIds}),this.subscriptions=[],this.componentId="velt-reactions-panel"}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let e=this.elementRef.nativeElement,t=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=t!==null&&t!=="false",this.setupA11yAttributes();let r="velt-reactions-panel-wireframe";this.variant&&(r+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(r).subscribe(a=>{if(a){let m=document.createElement(a.tagName);m.innerHTML=a.innerHTML,this.template=m}}))}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent OnInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(y({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in ReactionsPanelComponent ngOnChanges: ",t)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent setupA11yAttributes:",e)}}trackByEmojiKey(e,t){return t?.key||e}onClickOutside(){try{this.hideTooltip.emit()}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent onClickOutside: ",e)}}handleEmojiSelected(e){try{this.emojiSelected.emit(e),this.hideTooltip.emit()}catch(t){this.loggingService.catch("Error in ReactionsPanelComponent handleEmojiSelected: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent 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.loggingService.catch("Error in ReactionsPanelComponent unsubscribe: ",e)}}};o.\u0275fac=function(t){return new(t||o)(v(Re),v(x),v(w),v(fe),v(me),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reactions-panel-internal"]],inputs:{shadowDom:"shadowDom",variant:"variant",isInlineSectionMode:"isInlineSectionMode",excludeReactionIds:"excludeReactionIds"},outputs:{emojiSelected:"emojiSelected",hideTooltip:"hideTooltip"},standalone:!1,features:[M([f]),A,Ie],decls:1,vars:1,consts:[["reactionsPanelRef",""],[4,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["snippylyClickOutside","","role","list",1,"velt-reactions-panel",3,"clickOutside"],[4,"veltDynamicTemplate"],[3,"componentConfigSignal"]],template:function(t,r){t&1&&d(0,Qo,4,2,"ng-container",1),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ue,ke,F,_n,nt,H],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-reactions-panel[_ngcontent-%COMP%]{max-width:100%;overflow:visible;border:1px solid var(--velt-border-5);border-radius:var(--velt-border-radius-md);transition:opacity .5s;padding:var(--velt-spacing-sm) var(--velt-spacing-md);background-color:var(--velt-background-0);font-style:normal;font-weight:400;font-size:var(--velt-font-size-xs);line-height:calc((2rem + 0px) * var(--velt-base-rem-unit));box-shadow:0 8px 16px -8px #0f0f0f1a}.velt-reactions-panel--inline-section-mode[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-2xl)}"],changeDetection:0});let n=o;return n})();var Zo=n=>({template:n}),qo=()=>["snippyly-overlay-panel","snippyly-reaction-dialog-overlay-panel","velt-overlay-panel"];function er(n,o){n&1&&ge(0)}function tr(n,o){if(n&1&&(S(0,"velt-shadow-dom-internal"),d(1,er,1,0,"ng-container",4),I()),n&2){c();let i=J(2);s(),l("ngTemplateOutlet",i)}}function nr(n,o){if(n&1&&(g(0),S(1,"div",8),Nt(),S(2,"svg",9),N(3,"path",10)(4,"path",11)(5,"path",12),I()(),u()),n&2){let i=c(2);s(),Se("active",i.tooltipVisible)("no-padding",i.noPadding),R("data-testid",i.componentId+"-button"),s(),R("data-testid",i.componentId+"-icon")}}function ir(n,o){if(n&1){let i=te();S(0,"velt-reactions-panel-internal",13),T(1,"translate"),ne("emojiSelected",function(t){K(i);let r=c(2);return Z(r.handleEmojiSelected(t))})("hideTooltip",function(){K(i);let t=c(2);return Z(t.hideTooltip())}),I()}if(n&2){let i=c(2);l("darkMode",i.darkMode)("shadowDom",i.shadowDom)("variant",i.variant)("isInlineSectionMode",i.isInlineSectionMode)("excludeReactionIds",i.excludeReactionIds),R("data-testid",i.componentId+"-panel")("aria-label",O(1,7,"Reaction selector"))}}function or(n,o){if(n&1){let i=te();S(0,"div",5,1),T(2,"translate"),ne("pointerdown",function(){K(i);let t=c();return Z(t.showTooltip())}),d(3,nr,6,6,"ng-container",6),I(),d(4,ir,2,9,"ng-template",7,2,ce)}if(n&2){let i=J(1),e=J(5),t=c();Se("velt-reaction-btn-container--inline-section-mode",t.isInlineSectionMode),R("data-testid",t.componentId)("aria-expanded",t.tooltipVisible)("aria-haspopup",!0)("aria-label",O(2,14,"Add reaction")),s(3),l("veltDynamicTemplate",k(16,Zo,t.template)),s(),l("cdkConnectedOverlayOrigin",i)("cdkConnectedOverlayOpen",t.tooltipVisible)("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",Vt(18,qo))("cdkConnectedOverlayPositions",t.positions)("snippylyOverlay",e)("snippylyOverlayZIndex",2147483627)}}var Le=(()=>{let o=class o extends _e{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}resolveTemplate(){this.template=rr(this.serviceWireframe,this.parentTemplate)}constructor(e,t,r,a,m,C,h,_,p){super(m,h,void 0,void 0,void 0,p,a),this.docService=e,this.domService=t,this.emojiService=r,this.loggingService=a,this.elementRef=m,this.reactionService=C,this.themeService=h,this.wireframeService=_,this.dynamicDataService=p,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.isInlineSectionMode=!1,this.noPadding=!1,this.excludeReactionIds=[],this.onReactionToolClick=new be,this.emojiSelected=new be,this.reactionToolOpen=new be,this.tooltipVisible=!1,this.customButtonAdded=!1,this.positions=[{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}].map(b=>new Gt({originX:b.originX,originY:b.originY},{overlayX:b.overlayX,overlayY:b.overlayY})),this.subscriptions=[],this.veltElement=!0,this.componentId="velt-reaction-tool"}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let e=this.elementRef.nativeElement,t=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=t!==null&&t!=="false",this.setupA11yAttributes();let r="velt-reaction-tool-wireframe";this.variant&&(r+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(r).subscribe(a=>{if(a){let m=document.createElement(a.tagName);m.innerHTML=a.innerHTML,this.serviceWireframe=m,this.resolveTemplate()}}))}catch(e){this.loggingService.catch("Error in ReactionToolComponent OnInit: ",e)}}ngOnChanges(e){super.ngOnChanges(e),e.template&&(this.parentTemplate=e.template.currentValue,this.resolveTemplate())}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("role","button"),e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false")}catch(e){this.loggingService.catch("Error in ReactionToolComponent setupA11yAttributes:",e)}}trackByEmojiKey(e,t){return t?.key||e}onButtonSlotChange(){this.customButtonAdded=!0}showTooltip(){try{this.tooltipVisible=!0,this.toggleHostClass(),this.onReactionToolClick.emit()}catch(e){this.loggingService.catch("Error in ReactionToolComponent showTooltip: ",e)}}hideTooltip(){try{this.tooltipVisible=!1,this.toggleHostClass()}catch(e){this.loggingService.catch("Error in ReactionToolComponent hideTooltip: ",e)}}toggleHostClass(){try{this.tooltipVisible?(this.reactionToolOpen.emit(!0),this.domService.addClassToElement(this.elementRef.nativeElement,"reaction-tool-active"),this.domService.addClassToElement(this.elementRef.nativeElement,"velt-reaction-tool-open")):(this.reactionToolOpen.emit(!1),this.domService.removeClassFromElement(this.elementRef.nativeElement,"reaction-tool-active"),this.domService.removeClassFromElement(this.elementRef.nativeElement,"velt-reaction-tool-open"))}catch(e){this.loggingService.catch("Error in ReactionToolComponent toggleHostClass: ",e)}}handleEmojiSelected(e){try{this.emojiSelected.emit(e),this.hideTooltip(),this.videoPlayerId&&this.addReaction(e)}catch(t){this.loggingService.catch("Error in ReactionToolComponent handleEmojiSelected: ",t)}}addReaction(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: addReaction","color: green;"),this.videoPlayerId){let t=this.docService.getLocation()?.locationId,r=this.docService.getLocation()?.location;if(t){let a=document.getElementById(this.videoPlayerId);a&&a instanceof HTMLVideoElement&&(a.paused||a.pause());let m=this.docService.getDocumentPaths(),h=this.reactionService.getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:m?.organizationId,documentId:m?.documentId??""}).find(_=>_.locationId===t);this.reactionService.addOrUpdateReaction(e,h?[h.annotationId]:[],r)}}}catch(t){this.loggingService.catch("Error in VeltVideoPlayerComponent addReaction: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.loggingService.catch("Error in ReactionToolComponent 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.loggingService.catch("Error in ReactionToolComponent unsubscribe: ",e)}}};o.\u0275fac=function(t){return new(t||o)(v(Ne),v(ye),v(Re),v(x),v(w),v(de),v(fe),v(me),v(f))},o.\u0275cmp=P({type:o,selectors:[["app-reaction-tool"]],hostVars:1,hostBindings:function(t,r){t&2&&R("data-velt-element",r.veltElement)},inputs:{shadowDom:"shadowDom",variant:"variant",isInlineSectionMode:"isInlineSectionMode",videoPlayerId:"videoPlayerId",noPadding:"noPadding",excludeReactionIds:"excludeReactionIds"},outputs:{onReactionToolClick:"onReactionToolClick",emojiSelected:"emojiSelected",reactionToolOpen:"reactionToolOpen"},standalone:!1,features:[M([f]),A,Ie],decls:3,vars:2,consts:[["reactionToolRefRef",""],["trigger","cdkOverlayOrigin"],["overlay","cdkConnectedOverlay"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["part","container","cdkOverlayOrigin","","role","button",1,"v-reaction-btn-container",3,"pointerdown"],[4,"veltDynamicTemplate"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayPositions","snippylyOverlay","snippylyOverlayZIndex"],["part","button-container",1,"action-btn"],["part","button-icon","width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false",1,"action-btn-icon"],["d","M18.699 12.0222C18.7836 10.5835 18.4287 9.15318 17.6815 7.92091C16.9342 6.68864 15.83 5.71271 14.5152 5.1226C13.2004 4.5325 11.7373 4.35612 10.32 4.61687C8.90263 4.87762 7.59808 5.56317 6.57941 6.58257C5.56074 7.60196 4.87612 8.907 4.61637 10.3245C4.35663 11.742 4.53404 13.205 5.12508 14.5194C5.71612 15.8337 6.69284 16.9373 7.92564 17.6837C9.15844 18.43 10.589 18.7839 12.0276 18.6983M14.7629 17.1318H19.5M17.1315 14.7633V19.5004M9.23631 10.0262H9.24421M13.9734 10.0262H13.9813M9.63107 13.9738C10.1506 14.479 10.8627 14.7633 11.6049 14.7633C12.347 14.7633 13.0591 14.479 13.5786 13.9738","stroke","currentColor","stroke-width","1.33929","stroke-linecap","round","stroke-linejoin","round"],["d","M15.3496 10.6504C15.3496 11.2027 14.9019 11.6504 14.3496 11.6504C13.7973 11.6504 13.3496 11.2027 13.3496 10.6504C13.3496 10.0981 13.7973 9.65039 14.3496 9.65039C14.9019 9.65039 15.3496 10.0981 15.3496 10.6504Z","fill","currentColor"],["d","M10.9004 10.6504C10.9004 11.2027 10.4527 11.6504 9.90039 11.6504C9.34811 11.6504 8.90039 11.2027 8.90039 10.6504C8.90039 10.0981 9.34811 9.65039 9.90039 9.65039C10.4527 9.65039 10.9004 10.0981 10.9004 10.6504Z","fill","currentColor"],[3,"emojiSelected","hideTooltip","darkMode","shadowDom","variant","isInlineSectionMode","excludeReactionIds"]],template:function(t,r){if(t&1&&d(0,tr,2,1,"velt-shadow-dom-internal",3)(1,or,6,19,"ng-template",null,0,ce),t&2){let a=J(2);l("ngIf",!r.template&&r.shadowDom||r.template&&r.isExplicitShadowDom)("ngIfElse",a)}},dependencies:[j,ue,Jt,Xt,ke,F,fn,wt,H],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%]{display:flex;--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)}.v-reaction-btn-container[_ngcontent-%COMP%]{display:flex}.action-btn[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;padding:calc(var(--velt-spacing-md) / 2);border-radius:var(--velt-border-radius-full);border:2px solid transparent;background-color:transparent;color:var(--velt-text-4);cursor:pointer}.action-btn.no-padding[_ngcontent-%COMP%]{padding:0}.action-btn[_ngcontent-%COMP%] .action-btn-label[_ngcontent-%COMP%]{font-size:var(--velt-font-size-sm);padding-right:var(--velt-spacing-xs);font-weight:700;color:currentColor}.action-btn[_ngcontent-%COMP%] .action-btn-icon[_ngcontent-%COMP%]{width:calc((1.5rem + 0px) * var(--velt-base-rem-unit));height:calc((1.5rem + 0px) * var(--velt-base-rem-unit));color:currentColor}.action-btn[_ngcontent-%COMP%] .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{width:16px;height:16px;color:currentColor}.action-btn[_ngcontent-%COMP%]:focus{border-radius:var(--velt-border-radius-full);border:2px solid var(--velt-border-2);background-color:transparent;color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:focus .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:hover{border-radius:var(--velt-border-radius-full);border:2px solid var(--velt-border-2);background-color:var(--velt-background-2);color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:hover .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:active, .action-btn.active[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-full);border:2px solid var(--velt-accent);background-color:var(--velt-accent);color:var(--velt-accent-foreground)}.action-btn[_ngcontent-%COMP%]:active .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%], .action-btn.active[_ngcontent-%COMP%] .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{color:var(--velt-text-4)}.velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn-icon[_ngcontent-%COMP%]{height:18px;width:18px}.velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{padding:calc(var(--velt-spacing-xs) - 1px)}.velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]:active, .velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn.active[_ngcontent-%COMP%]{border:1px solid var(--velt-accent-text);background:linear-gradient(0deg,#0006 0% 100%),var(--velt-accent)}"],changeDetection:0});let n=o;return n})();function rr(n,o){return n||o}var Ln=n=>({componentConfigSignal:n}),cr=(n,o)=>({condition:n,data:o}),lr=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-inline-reactions-section-tool-container-wireframe",variant:i,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function sr(n,o){if(n&1){let i=te();g(0),S(1,"div",3)(2,"app-reaction-tool",4),ne("emojiSelected",function(t){K(i);let r=c(2).ngIf;return Z(r.onEmojiSelected(t))}),I()(),u()}if(n&2){let i=c(2).ngIf,e=c();s(2),l("shadowDom",!1)("template",e.toolTemplate)("variant",i==null?null:i.variant)("darkMode",i.darkMode)}}function mr(n,o){if(n&1&&(g(0),d(1,sr,3,4,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,lr,e.template,k(1,Ln,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function dr(n,o){if(n&1&&(g(0),d(1,mr,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,cr,i.conditionSignal(),k(1,Ln,i.componentConfigSignal)))}}var it=(()=>{let o=class o extends ${constructor(e,t,r,a){super(e,t,r),this.elementRef=e,this.dynamicDataService=t,this.loggingService=r,this.wireframeService=a,this.subscriptions=[],super.initializeComponentConfigSignal(new Te)}ngOnInit(){try{if(super.ngOnInit(),!this.template){let e="velt-inline-reactions-section-tool-container-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r,this.getChildTemplate()}}))}this.getChildTemplate()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionToolContainerComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.loggingService.catch("Error in InlineReactionsSectionToolContainerComponent ngOnDestroy:",e)}}getChildTemplate(){try{if(!this.toolTemplate&&this.template){let e=this.template.querySelector("velt-reaction-tool-wireframe");xe(e)||(this.toolTemplate=e)}}catch(e){this.loggingService.catch("Error in InlineReactionsSectionToolContainerComponent getChildTemplate:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(f),v(x),v(me))},o.\u0275cmp=P({type:o,selectors:[["app-inline-reactions-section-tool-container"]],inputs:{variant:"variant"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-inline-reactions-section--tool-container"],[3,"emojiSelected","shadowDom","template","variant","darkMode"]],template:function(t,r){t&1&&d(0,dr,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,Le],styles:["[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn{border-radius:var(--velt-border-radius-2xl);background:var(--velt-background-0);padding:var(--velt-spacing-xs);border:none}[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn .action-btn-icon{width:20px;height:20px}[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn:hover{border-radius:var(--velt-border-radius-2xl);background:var(--velt-background-1)}[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn:hover .action-btn-icon{color:var(--velt-accent)}"],changeDetection:0});let n=o;return n})();var Vn=n=>({componentConfigSignal:n}),pr=(n,o)=>({condition:n,data:o}),gr=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-inline-reactions-section-panel-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function ur(n,o){if(n&1&&(g(0),S(1,"div",3),N(2,"app-inline-reactions-section-tool-container",4)(3,"app-inline-reactions-section-list",4),I(),u()),n&2){let i=c(3).ngIf,e=c();s(2),l("componentConfigSignal",e.componentConfigSignal)("variant",i==null?null:i.variant),s(),l("componentConfigSignal",e.componentConfigSignal)("variant",i==null?null:i.variant)}}function hr(n,o){if(n&1&&(S(0,"div"),d(1,ur,4,4,"ng-container",2),I()),n&2){let i=c(2).ngIf,e=c();s(),l("veltDynamicTemplate",L(3,gr,e.template,k(1,Vn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function fr(n,o){if(n&1&&(g(0),d(1,hr,2,9,"div",0),u()),n&2){let i=c().ngIf;s(),l("ngIf",!i.skeletonLoading)}}function _r(n,o){if(n&1&&(g(0),d(1,fr,2,1,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,pr,i.conditionSignal(),k(1,Vn,i.componentConfigSignal)))}}var ot=(()=>{let o=class o extends ${constructor(e,t,r){super(e,t,r),this.elementRef=e,this.dynamicDataService=t,this.loggingService=r,super.initializeComponentConfigSignal(new Te)}ngOnInit(){try{super.ngOnInit()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionPanelComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionPanelComponent ngOnDestroy:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(f),v(x))},o.\u0275cmp=P({type:o,selectors:[["app-inline-reactions-section-panel"]],standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-inline-reactions-section--panel"],[3,"componentConfigSignal","variant"]],template:function(t,r){t&1&&d(0,_r,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,qe,it],styles:[".velt-inline-reactions-section--panel[_ngcontent-%COMP%]{display:flex;gap:var(--velt-spacing-xs)}"],changeDetection:0});let n=o;return n})();var zn=n=>({componentConfigSignal:n}),br=(n,o)=>({condition:n,data:o}),Sr=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-inline-reactions-section-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function Ir(n,o){n&1&&ge(0)}function xr(n,o){if(n&1&&(S(0,"velt-shadow-dom-internal"),d(1,Ir,1,0,"ng-container",4),I()),n&2){c();let i=J(3);s(),l("ngTemplateOutlet",i)}}function yr(n,o){if(n&1&&(g(0),S(1,"div",6),N(2,"app-inline-reactions-section-panel",7),I(),u()),n&2){let i=c(5);s(2),l("componentConfigSignal",i.componentConfigSignal)}}function kr(n,o){if(n&1&&d(0,yr,3,1,"ng-container",5),n&2){let i=c(3).ngIf,e=c();l("veltDynamicTemplate",L(3,Sr,e.template,k(1,zn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Rr(n,o){if(n&1&&(g(0),d(1,xr,2,1,"velt-shadow-dom-internal",3)(2,kr,1,9,"ng-template",null,0,ce),u()),n&2){let i=J(3),e=c(3);s(),l("ngIf",!e.template&&e.shadowDom||e.template&&e.isExplicitShadowDom)("ngIfElse",i)}}function Tr(n,o){if(n&1&&(g(0),d(1,Rr,4,2,"ng-container",1),u()),n&2){let i=c().ngIf;s(),l("ngIf",(i==null?null:i.targetReactionElementId)&&i.user)}}function Er(n,o){if(n&1&&(g(0),d(1,Tr,2,1,"ng-container",2),u()),n&2){let i=c();s(),l("veltIf",E(3,br,i.conditionSignal(),k(1,zn,i.componentConfigSignal)))}}var Ve=(()=>{let o=class o extends _e{set _targetReactionElementId(e){try{this.componentConfigSignal.update(t=>(t=D(y({},t),{targetReactionElementId:e}),t)),this.getReactionAnnotationsBySectionId(e)}catch{}}set _shadowDom(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.shadowDom=t,this.isExplicitShadowDom=!!t,this.componentConfigSignal.update(r=>(r=D(y({},r),{shadowDom:t}),r))}catch{}}set _customReactions(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.reactionService.setCustomReactions(t)}catch{}}constructor(e,t,r,a,m,C,h,_){super(h,C,void 0,a,void 0,_,r),this.authService=e,this.docService=t,this.loggingService=r,this.reactionService=a,this.wireframeService=m,this.themeService=C,this.elementRef=h,this.dynamicDataService=_,this.shadowDom=!0,this.isExplicitShadowDom=!1,this.componentConfigSignal=Me({annotations:[],reactionGroups:[],skeletonLoading:!0,darkMode:!1,variant:"inline",shadowDom:!0,onEmojiSelected:this.onEmojiSelected.bind(this),onReactionClick:this.onReactionClick.bind(this),reactionAnnotationsTrackByFn:this.reactionAnnotationsTrackByFn.bind(this)}),this.subscriptions=[];try{this.subscriptions.push(super.onDarkModeChange().subscribe(p=>{this.componentConfigSignal.update(b=>(b=D(y({},b),{darkMode:p}),b))})),this.subscriptions.push(this.authService.getUser$().subscribe(p=>{this.componentConfigSignal.update(b=>(b=D(y({},b),{user:p}),b))}))}catch(p){this.catchError("Error in InlineReactionsSectionComponent constructor: ",p)}}ngOnInit(){try{super.ngOnInit(),this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;");let e="velt-inline-reactions-section-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r}}))}catch(e){this.catchError("Error in InlineReactionsSectionComponent OnInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(y({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.catchError("Error in InlineReactionsSectionComponent ngOnChanges: ",t)}}reactionAnnotationsTrackByFn(e,t){return t?.annotationId}getReactionAnnotationsBySectionId(e){try{this.reactionsBySectionIdSubscription?.unsubscribe(),this.reactionsBySectionIdSubscription=this.reactionService.getReactionAnnotationsBySectionId(e).subscribe(t=>{this.componentConfigSignal.update(r=>(r=D(y({},r),{annotations:t||[],reactionGroups:this.reactionService.groupReactionsByIcon(t),skeletonLoading:!1}),r))})}catch(t){this.catchError("Error in InlineReactionsSectionComponent getReactionsBySectionId: ",t)}}onEmojiSelected(e){try{let t=this.componentConfigSignal();this.reactionService.toggleSectionReaction(e,t.annotations,t.targetReactionElementId)}catch(t){this.catchError("Error in InlineReactionsSectionComponent onEmojiSelected: ",t)}}onReactionClick(e){try{if(e?.icon){let t=this.componentConfigSignal();this.reactionService.toggleSectionReaction(e.icon,t.annotations,t.targetReactionElementId)}}catch(t){this.catchError("Error in InlineReactionsSectionComponent onReactionClick: ",t)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()}),this.reactionsBySectionIdSubscription?.unsubscribe()}catch(e){this.catchError("Error in InlineReactionsSectionComponent ngOnDestroy: ",e)}}catchError(e,t,r){try{let a;this.componentConfigSignal()?.annotations?.length&&(a=this.componentConfigSignal()?.annotations[0]?.annotationId),this.loggingService.catch(e,t,D(y({},r||{}),{annotationId:a}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(v(Fe),v(Ne),v(x),v(de),v(me),v(fe),v(w),v(f))},o.\u0275cmp=P({type:o,selectors:[["app-inline-reactions-section"]],inputs:{_targetReactionElementId:[0,"targetReactionElementId","_targetReactionElementId"],_shadowDom:[0,"shadowDom","_shadowDom"],variant:"variant",_customReactions:[0,"customReactions","_customReactions"]},standalone:!1,features:[M([f]),A,Ie],decls:1,vars:1,consts:[["commentToolRefRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],[4,"veltDynamicTemplate"],[1,"velt-inline-reactions-section"],[3,"componentConfigSignal"]],template:function(t,r){t&1&&d(0,Er,2,6,"ng-container",1),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ue,ke,F,V,ot],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)}"],changeDetection:0});let n=o;return n})();var ht=class extends xn{constructor(o){super(o),this.getService(x).log("%c[WB] Creating CLASS: ReactionElement","color: blue;"),this.enableDarkMode=this._enableDarkMode,this.disableDarkMode=this._disableDarkMode,this.setCustomReactions=this._setCustomReactions}_enableDarkMode(){this.getService(x).log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;");try{this.trackEvent(dt.Events.Reactions.ENABLE_DARK_MODE_TRIGGERED),this.getService(de).enableDarkMode()}catch(o){this.getService(x).catch("Error in _enableDarkMode: ",o)}}_disableDarkMode(){this.getService(x).log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;");try{this.trackEvent(dt.Events.Reactions.DISABLE_DARK_MODE_TRIGGERED),this.getService(de).disableDarkMode()}catch(o){this.getService(x).catch("Error in _disableDarkMode: ",o)}}_setCustomReactions(o){this.getService(x).log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;");try{this.trackEvent(dt.Events.Reactions.SET_CUSTOM_REACTIONS_TRIGGERED,{payload:{reactions:o}}),this.getService(de).setCustomReactions(o)}catch(i){this.getService(x).catch("Error in _setCustomReactions: ",i)}}};var Wn=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=Ut({type:o}),o.\u0275inj=Ft({imports:[Yt,Qt,Sn]});let n=o;return n})();var Dr={"velt-reaction-pin-emoji-wireframe":Ye,"velt-reaction-pin-count-wireframe":Ge,"velt-reaction-pin-tooltip-wireframe":Ze,"velt-reaction-pin-tooltip-users-wireframe":Ke,"velt-reaction-pin-tooltip-user-wireframe":Qe,"velt-reaction-pin-tooltip-user-avatar-wireframe":Xe,"velt-reaction-pin-tooltip-user-name-wireframe":Je,"velt-reactions-panel-items-wireframe":nt,"velt-reactions-panel-item-wireframe":tt,"velt-reactions-panel-item-emoji-wireframe":et,"velt-inline-reactions-section-wireframe":Ve,"velt-inline-reactions-section-tool-container-wireframe":it,"velt-inline-reactions-section-list-wireframe":qe,"velt-inline-reactions-section-panel-wireframe":ot};Object.assign(hn,Dr);function Or(n){n.get(x).log("%c[WB] Loading reaction feature chunk","color: blue;");let i=n.get(vt),e=n.get(de);i.set(mn,e);let r=Bt(Wn,n).injector;return ze(r,le.TAGS.VELT_REACTION_TOOL,Le),ze(r,le.TAGS.SNIPPYLY_REACTION_TOOL,Le),ze(r,le.TAGS.VELT_REACTION_PIN,Ue),ze(r,le.TAGS.SNIPPYLY_REACTION_PIN,Ue),ze(r,le.TAGS.VELT_INLINE_REACTIONS_SECTION,Ve),ze(r,le.TAGS.SNIPPYLY_INLINE_REACTIONS_SECTION,Ve),new ht(n)}function ze(n,o,i){if(customElements.get(o))return;let e=Kt(i,n);customElements.define(o,e)}export{Or as default};
|
|
1
|
+
import{a as yn,b as kn}from"./chunk-B6ADFKWY.js";import{j as Cn,l as Re,m as pt,t as Sn}from"./chunk-2MJAK5A5.js";import"./chunk-2GMFNHOT.js";import{x as fn}from"./chunk-TWY3X34A.js";import{a as Rn}from"./chunk-N4LOLZ2Y.js";import{a as ke}from"./chunk-5ZT4SI4Q.js";import{a as _n}from"./chunk-WR5LVHSG.js";import{E as hn,G as F,H as V}from"./chunk-4R5WJWJ4.js";import{a as me}from"./chunk-4WR2GOXI.js";import{b as H,c as gt,d as bn}from"./chunk-WCQZBPSI.js";import{a as In}from"./chunk-4IZOBQPA.js";import{a as Kt}from"./chunk-65JXF5ID.js";import{A as Gt,G as Xt,Ga as f,H as Jt,Ha as fe,I as Qt,Ia as $,Ja as _e}from"./chunk-FUFU46AG.js";import{a as xn}from"./chunk-DXZHCUKV.js";import{D as un,E as Ne,f as Rt}from"./chunk-57BIEQT2.js";import{$h as xe,Ak as Fe,Bb as c,Bj as kt,Ca as Oe,E as Pe,Fb as _t,G as Mt,Gb as Ct,Gd as Zt,Gj as he,Ha as s,Hb as bt,Hc as je,He as le,Ia as be,Ic as j,Ii as dt,Jc as Wt,Jg as cn,Jj as pn,K as Ae,Kb as J,Kc as $t,Lc as Ht,M as ct,Mb as Se,Nc as ue,Nf as en,Pb as We,Qb as Lt,Ra as v,Rb as st,Rc as Yt,Rj as gn,Tg as ln,V as G,Va as Bt,Wa as P,Xa as Ut,Zf as St,_ as lt,_a as A,_i as yt,a as y,ab as d,ac as M,b as D,ba as jt,bi as xt,ca as Ft,cc as Vt,dc as k,di as sn,ea as se,ec as E,fb as R,fi as mt,g as Ce,gj as mn,hc as L,ig as It,ja as K,jg as tn,ka as Z,l as at,la as Nt,mc as T,nb as l,nc as O,ob as S,oc as $e,oj as vt,pb as I,pj as dn,q as Pt,qb as N,qg as nn,qj as x,r as W,rc as ce,re as qt,rg as on,rj as vn,sa as Me,th as He,ub as g,uc as zt,ug as rn,v as B,vb as u,w as ft,wa as Ie,wb as ge,x as At,xb as te,ya as w,yg as an,zb as ne,zk as ye}from"./chunk-3BDGQ5BH.js";var de=(()=>{let o=class o{constructor(e,t,r,a,m,C,h,_,p,b,U,De,Y){this.afAuth=e,this.analyticsService=t,this.authService=r,this.configService=a,this.databaseService=m,this.commonDbService=C,this.docService=h,this.domService=_,this.emojiService=p,this.iamService=b,this.loggingService=U,this.userPermissionService=De,this.serviceBook=Y,this.documentPaths=null,this.reactionAnnotationById$=new at({}),this.customReactions$=new at({}),this.commentService=null,this.darkMode$=new at(null),this.loggingService.log("%c[WB] Creating CLASS: ReactionService","color: blue;"),this.serviceBook.observe(yt).subscribe(X=>{this.commentService=X}),this.subscribeReactionFeedOnReady()}setCommentService(e){this.loggingService.log("%c[WB] Calling FUNCTION: setCommentService","color: green;");try{this.commentService=e}catch(t){this.loggingService.catch("Error in ReactionService setCommentService: ",t)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in ReactionService","color: green;");try{this.reactionAnnotationById$.next({}),this.customReactions$.next({}),this.documentPaths=null}catch(e){this.loggingService.catch("Error in ReactionService clearCache: ",e)}}getAllReactionAnnotations(e,t,r,a,m){this.loggingService.log("%c[WB] Calling FUNCTION: getAllReactionAnnotations","color: green;");let C,h;try{if(e&&(h=`${St(e)}`),t&&typeof t=="object"){let _=an(t);C=St(JSON.stringify(_))}}catch(_){this.loggingService.catch("Error in ReactionService getAllReactionAnnotations: ",_)}return this.authService.getAuthState$().pipe(Pe(_=>!!_),G(_=>this.isFeatureAllowed({firebaseUser:_,annotations:[],filteredAnnotations:[]})),G(_=>_.featureAllowed?this.iamService.isUserAllowed$().pipe(B(p=>(_.featureAllowed=p,_))):W(_)),G(_=>_.featureAllowed?W(_).pipe(G(p=>this.docService.getDocumentPaths$().pipe(B(b=>(this.documentPaths=b,p.documentPaths=b,p)))),G(p=>h?this.getDataFromDocumentIds([h]).pipe(B(b=>(p.annotations=b||[],y({},p)))):this.docService.getDocumentIds$().pipe(G(b=>{let U=b?.length>0?b.map(De=>De.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds(U).pipe(B(De=>(p.annotations=De||[],y({},p))))}))),G(p=>this.docService.getLocation$().pipe(B(b=>(p.location=b,p)))),G(p=>this.docService.getLocations$().pipe(B(b=>(p.customLocations=b,p)))),B(p=>{if(p.filteredAnnotations=[],h&&!C)return p.filteredAnnotations=p.annotations?.slice(),p;{let b=[];return C?b.push(C):(b.push(p?.location?.locationId),b.push(...Object.values(p?.customLocations||[]).map(U=>U.locationId))),p.filteredAnnotations=this.filterAnnotationsByLocationIds(p?.annotations,b),p}}),G(p=>r?W(p):p?.annotations?.length?this.domService.onWindowResize$().pipe(B(()=>p)):W(p)),G(p=>r?W(p):W(p)),B(p=>p),G(p=>p?.filteredAnnotations?W(p?.filteredAnnotations||[]):W([]))):W([])),ct(sn))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(Pe(t=>!!t),B(t=>D(y({},e),{config:t})),G(t=>this.authService.getUser$().pipe(B(r=>D(y({},t),{user:r})))),G(t=>rn(t.config,t.user,qt.REACTION)?W(D(y({},t),{featureAllowed:!0})):(this.loggingService.warn("Reaction feature is not allowed."),W(D(y({},t),{featureAllowed:!1})))),ct((t,r)=>t?.featureAllowed===r?.featureAllowed))}getDataFromDocumentIds(e,t){return this.getDataFromDocuments({documentIds:e,filters:t})}getDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:t,filters:r}=e;return t?.some(a=>!a)||!this.documentPaths?W([]):At(()=>{let a=this.authService.getUser()?.userId;return a?this.serviceBook.observe(yt).pipe(B(m=>!!m?.buildVisibilityTokens),ct(),G(()=>Pt(this.buildReactionVisibilityTokens(a))),G(m=>this.buildReactionAnnotationsListener({documentIds:t,filters:r,visibilityTokens:m,currentUserId:a}))):W([])})}else return W([])}subscribeReactionFeedOnReady(){this.reactionDbReadyGate$().pipe(Ae(1)).subscribe(()=>{this.getAllReactionAnnotations(void 0,void 0,!0).subscribe()},e=>{this.loggingService.catch("Error in ReactionService getDb subscription: ",e)})}reactionDbReadyGate$(){return gn({isPortableFeedActive:()=>this.commonDbService?.usesPortableChannelFeed(Rt),firebaseDb$:()=>this.databaseService.getDb(),onError:(e,t)=>this.loggingService.catch(`Error in ReactionService reactionDbReadyGate$ ${e}: `,t)})}buildReactionAnnotationsListener({documentIds:e,filters:t,visibilityTokens:r,currentUserId:a}){let m=this.docService.getDocumentPaths()?.veltFolderId,C=W([]),h={useCollectionGroup:!0,isCollection:!0,useQuery:!0};this.commonDbService.shouldUseFirestore()||(h.documentId=e?.length?e[0]:void 0,h.organizationId=this.documentPaths?.organizationId);let _=this.userPermissionService?.getIsContextEnabled(),p=this.authService.getIsPrivateCommentsEnabled()?r:[le.DEFAULT_VELT_CONTEXT],b=_?this.docService.getProcessedDocContext():[],U=this.commonDbService.usesPortableChannelFeed(Rt),De=U?yn():null;if(U)C=this.commonDbService.dbListener({feature:"allReactions",properties:D(y({},h),{organizationId:this.documentPaths?.organizationId,documentIds:e})}).pipe(lt(),B(Y=>mt(JSON.parse(JSON.stringify([Y])))));else if(_){let Y=[...p,...b],X=Math.max(1,Math.min(le.LISTENER_CONTEXT_BATCH_SIZE,Math.floor(le.FIRESTORE_MAX_DISJUNCTIONS/Math.max(1,e?.length??1)))),ee=[];for(let z=0;z<(Y?.length??0);z+=X)ee.push(Y?.slice(z,z+X)??[]);C=ft(ee.map(z=>this.commonDbService.dbListener({feature:"allReactions",properties:D(y({},h),{firestoreQuery:[kt(he("metadata.apiKey","==",this.configService?.getApiKey()),he("metadata.documentId","in",e),he("metadata.organizationId","==",this.documentPaths?.organizationId),...m?[he("metadata.veltFolderId","==",m)]:[],...z?.length?[he("context.accessFields","array-contains-any",z)]:[])]})}).pipe(lt()))).pipe(B(z=>mt(z)))}else{let Y=[];for(let X=0;X<(e?.length??0);X+=le.LISTENER_BATCH_SIZE)Y.push(e?.slice(X,X+le.LISTENER_BATCH_SIZE)??[]);C=ft(Y.map(X=>this.commonDbService.dbListener({feature:"allReactions",properties:D(y({},h),{firestoreQuery:[kt(he("metadata.apiKey","==",this.configService?.getApiKey()),he("metadata.documentId","in",X),he("metadata.organizationId","==",this.documentPaths?.organizationId),...m?[he("metadata.veltFolderId","==",m)]:[])]})}).pipe(lt()))).pipe(B(X=>mt(X)))}return C.pipe(B(Y=>({data:Y?.data,operation:Y?.operation})),B(({data:Y,operation:X})=>{let ee=[];return Y&&(ee=Object.values(Y??{}).filter(z=>typeof z=="object")),ee?.forEach(z=>{this.sanitizeReactionAnnotation(z)}),ee=this.applyPortableQueryScopeFilter(ee,{isPortableFeed:U,scope:{veltFolderId:m},evictDropped:!t,resultSet:De}),ee=this.applyReactionVisibilityPostFilter(ee,r,a,_?b:null),{data:ee,operation:X}}),B(({data:Y,operation:X})=>{if(!e)return{data:Y,documentMap:{},operation:X};let ee=Y.reduce((z,we)=>{let rt=we.metadata?.documentId;return rt&&(z[rt]||(z[rt]=[]),z[rt].push(we)),z},{});return{data:Y,documentMap:ee,operation:X}}),B(({data:Y,documentMap:X,operation:ee})=>{if(!t)if(ee?.type==="removed"){if(ee?.ids?.length){let z=this.reactionAnnotationById$.value;ee?.ids?.forEach(we=>{delete z?.[we]}),this.reactionAnnotationById$.next(z)}}else Object.entries(X??{}).forEach(([z,we])=>{this.setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:z,annotations:we})});return Y}),Mt(Y=>(this.loggingService.catch("Error in ReactionService getDataFromDocumentId: ",Y),W([]))))}buildReactionVisibilityTokens(e){return Ce(this,null,function*(){try{return this.commentService?.buildVisibilityTokens?yield this.commentService.buildVisibilityTokens(e):It({userId:e})}catch(t){return this.loggingService.catch("Error in ReactionService buildReactionVisibilityTokens: ",t),It({userId:e})}})}applyReactionVisibilityPostFilter(e,t,r,a){try{let m=tn(e,{userId:r,tokens:t});a&&(m=nn(m,a));let C=new Set(m),h=(e||[]).filter(_=>!C.has(_));return h.length&&this.evictReactionAnnotationsFromLocalCache(h.map(_=>_?.annotationId).filter(_=>!!_)),m}catch(m){return this.loggingService.catch("Error in ReactionService applyReactionVisibilityPostFilter: ",m),e}}applyPortableQueryScopeFilter(e,t){try{let{kept:r,departed:a}=kn(e,t,m=>on(m,t.scope));return a.length&&this.evictReactionAnnotationsFromLocalCache(a),r}catch(r){return this.loggingService.catch("Error in ReactionService applyPortableQueryScopeFilter: ",r),e}}evictReactionAnnotationsFromLocalCache(e){try{if(!e?.length)return;let t=this.reactionAnnotationById$?.value;if(t&&e.some(r=>r in t)){let r=y({},t);e.forEach(a=>{delete r[a]}),this.reactionAnnotationById$.next(r)}}catch(t){this.loggingService.catch("Error in ReactionService evictReactionAnnotationsFromLocalCache: ",t)}}setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:r,queryHash:a}){try{if(t){e||(e=le.NO_ORGANIZATION_ID),a||(a=le.DEFAULT_QUERY_HASH);let m={};r?.forEach(h=>{h?.annotationId&&(m[h?.annotationId]=h)});let C=y(y({},this.reactionAnnotationById$.value),m);this.reactionAnnotationById$.next(C)}}catch(m){this.loggingService.catch("Error in ReactionService setReactionAnnotationsByOrganizationIdAndDocumentId:",m)}}getReactionAnnotationsByOrganizationIdAndDocumentIds({organizationId:e,documentIds:t}){try{let r=new Set((t||[]).map(a=>String(a)));return Object.values(this.reactionAnnotationById$.value??{}).filter(a=>a?.metadata?.documentId!=null&&r.has(String(a.metadata.documentId))&&a?.metadata?.organizationId==e)}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsByOrganizationIdAndDocumentIds:",r),[]}}getSectionWriteReactionIds(e,t){try{let r=t?He(t,["id","data-id"]):null,a=this.docService.getBaseMetadata("reaction",{element:r})?.documentId;return(e||[]).filter(m=>!a||!m?.metadata?.documentId||String(m.metadata.documentId)===String(a)).map(m=>m?.annotationId).filter(m=>!!m)}catch(r){return this.loggingService.catch("Error in ReactionService getSectionWriteReactionIds:",r),(e||[]).map(a=>a?.annotationId).filter(a=>!!a)}}groupReactionsByIcon(e){try{let t=[],r=new Map;return(e||[]).forEach(a=>{if(!a?.annotationId)return;let m=a.icon?r.get(a.icon):void 0;if(m){m.annotationIds.push(a.annotationId);return}let C={annotationId:a.annotationId,annotationIds:[a.annotationId]};t.push(C),a.icon&&r.set(a.icon,C)}),t}catch(t){return this.loggingService.catch("Error in ReactionService groupReactionsByIcon:",t),(e||[]).filter(r=>!!r?.annotationId).map(r=>({annotationId:r.annotationId,annotationIds:[r.annotationId]}))}}mergeReactionAnnotations(e){try{let t=(e||[]).filter(m=>!!m);if(t.length<=1)return t[0];let r=new Set,a=[];return t.forEach(m=>{(m.reactions||[]).forEach(C=>{let h=C?.from?.userId;if(h){if(r.has(h))return;r.add(h)}a.push(C)})}),D(y({},t[0]),{reactions:a})}catch(t){return this.loggingService.catch("Error in ReactionService mergeReactionAnnotations:",t),e?.find(r=>!!r)||void 0}}getMergedReactionAnnotation$(e,t){try{return this.reactionAnnotationById$.pipe(B(()=>this.mergeReactionAnnotations((e||[]).map(r=>this.getAnnotationById(r,t)))))}catch(r){return this.loggingService.catch("Error in ReactionService getMergedReactionAnnotation$:",r),W(void 0)}}toggleSectionReaction(e,t,r){return Ce(this,null,function*(){try{let a=this.authService?.getUser()?.userId,m=(t||[]).filter(h=>h?.icon===e&&!!h?.annotationId),C=a?m.filter(h=>(h.reactions||[]).some(_=>_?.from?.userId===a)):[];if(C.length){for(let h of C)((this.getAnnotationById(h.annotationId)??h).reactions||[]).some(p=>p?.from?.userId===a)&&(yield this.addOrUpdateReaction(e,[h.annotationId],void 0,r));return}yield this.addOrUpdateReaction(e,this.getSectionWriteReactionIds(m,r),void 0,r)}catch(a){this.loggingService.catch("Error in ReactionService toggleSectionReaction:",a)}})}getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let r={};return Object.values(this.reactionAnnotationById$.value??{}).forEach(a=>{a?.metadata?.documentId==t&&a?.metadata?.organizationId==e&&(r[a?.annotationId]=a)}),Object.values(r)}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsByOrganizationIdAndDocumentId:",r),[]}}getLocations$(){return this.docService.getLocation$().pipe(G(e=>this.docService.getLocations$().pipe(B(t=>({location:e,locations:t})))),B(e=>{let t=[];return t.push(e?.location?.locationId),t.push(...Object.values(e.locations||[]).map(r=>r.locationId)),t||[]}))}filterAnnotationsByLocationIds(e,t){try{return e.filter(r=>t.includes(r.locationId))}catch(r){return this.loggingService.catch("Error in ReactionService filterAnnotationsByLocations:",r),[]}}getAnnotationById(e,t){try{let r=this.reactionAnnotationById$.value?.[e];if(r){let{documentId:a,organizationId:m}=t||{};if(a&&r.metadata?.documentId!==a||m&&r.metadata?.organizationId!==m)return}return r}catch(r){this.loggingService.catch("Error in ReactionService getAnnotationById: ",r);return}}getBaseMetadataFromReactionAnnotationId(e){try{let t=this.reactionAnnotationById$.value?.[e];return t?t.metadata:void 0}catch(t){this.loggingService.catch("Error in ReactionService getBaseMetadataFromReactionAnnotationId: ",t);return}}getReactionAnnotationByAnnotationId(e,t){try{return this.reactionAnnotationById$.pipe(B(()=>this.getAnnotationById(e,t)),G(r=>r?W(r):W(r)))}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationByAnnotationId: ",r),W(void 0)}}getReactionAnnotationsBySectionId(e){try{return this.reactionAnnotationById$.pipe(G(t=>this.docService.getDocumentPaths$().pipe(B(r=>({documentPaths:r,sectionId:e,reactionAnnotationsMap:t})))),G(t=>this.docService.getAreaChanges$().pipe(B(()=>t))),G(t=>{let r=He(e,["id","data-id"]);if(r){let a=this.docService.getAdditionLocationFromElement(r);if(a){let m=this.docService.genarateLocationId(a);return this.docService.getLocations$().pipe(B(C=>{let _=Object.values(C||{}).find(p=>p.locationId===m||a?.id&&p.location.id===a.id);return D(y({},t),{additionalLocation:_,locationOnElement:!!a,element:r})}))}}return W(D(y({},t),{additionalLocation:null,element:r}))}),G(t=>t?.locationOnElement?W(t):this.docService.getLocation$().pipe(B(r=>D(y({},t),{location:r})))),B(({documentPaths:t,location:r,additionalLocation:a,locationOnElement:m,element:C})=>{let h=null,_=this.docService.getAreaDocumentIds(C),p=t?.organizationId;if(_.length){let b=this.getReactionAnnotationsByOrganizationIdAndDocumentIds({organizationId:p,documentIds:_});if(b){h=[];for(let U of b)U?.targetElementId===e&&(m?a&&xt({location:a?.location,locationId:a?.locationId},{location:U.location,locationId:U.locationId})&&h.push(U):r?xt({location:r?.location,locationId:r?.locationId},{location:U.location,locationId:U.locationId})&&h.push(U):U?.locationId||h.push(U))}}return h}))}catch(t){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsBySectionId: ",t),W(null)}}addOrUpdateReaction(e,t,r,a,m,C,h,_){return Ce(this,null,function*(){try{let p=t?.map(b=>this.getAnnotationById(b)).find(b=>b?.icon===e);if(p){if(!h||h==="delete")return yield this.updateUserInReaction(p)}else if(!h||h==="add")return yield this.addReaction(void 0,e,r,a,m,C,_)}catch(p){this.loggingService.catch("Error in ReactionService addOrUpdateReaction: ",p)}})}addReaction(e,t,r,a,m,C,h){return Ce(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: addReaction","color: green;");try{let _=this.authService.getUser();if(_)if(_.isReadOnly||_.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add reactions.");else{let p=new en;if(p.from=_,p.lastUpdated=this.timestamp,p.reactions=[],p.reactions.push({from:_,lastUpdated:this.timestamp}),a&&(p.targetElementId=a),m){p.commentAnnotationId=m;let b=this.commentService?.getAnnotationById(m);b||this.loggingService.warn("addReaction: parent comment annotation not in local cache \u2014 reaction written without inherited access gate.",m);let U=b?.context?.accessFields;if(U?.length){if(!this.userPermissionService?.hasUserContextAccess({userId:_.userId,accessFields:U})){this.loggingService.catch("User does not have context access to add reaction annotation.",void 0,void 0,!0);return}p.context=D(y({},b?.context?.access?{access:b.context.access}:{}),{accessFields:U})}}if(this.setLocationToReactionAnnotation(p),p.pageInfo=ln(),p.pageInfo&&(p.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth),t)if(p.icon=t,C)p.iconUrl=C?.url,p.iconEmoji=C?.emoji;else{let b=this.customReactions$.value;if(b){let U=b[t];U?.url&&(p.iconUrl=U?.url),U?.emoji&&(p.iconEmoji=U?.emoji)}}return r&&(p.location={},p.location=y({},r),p.locationId=this.docService.genarateLocationId(p.location)),yield this.saveReactionToDb(p)}}catch(_){this.loggingService.catch("Error in ReactionService addReaction: ",_)}})}setLocationToReactionAnnotation(e){try{let t=this.docService.getLocation();t?(e.locationId=t.locationId,e.location=t.location):(delete e.locationId,delete e.location);try{let r;e.targetElement?.xpath?r=this.domService.getElementFromXPath(e.targetElement.xpath):e.targetElementId&&(r=He(e.targetElementId,["id","data-id"]));let a=this.docService.getAdditionLocationFromElement(r);if(a){let m=this.docService.addLocation({location:a,source:"internal"});m?.[0]&&(e.locationId=m[0].locationId,e.location=m[0].location)}}catch{}}catch(t){this.loggingService.catch("Error in ReactionService setLocationToReactionAnnotation:",t)}}getElementForReactionAnnotation(e){try{let t;return e.targetElementId&&(t=He(e.targetElementId,["id","data-id"])),t}catch(t){return this.loggingService.catch("Error in ReactionService getElementForReactionAnnotation: ",t),null}}saveReactionToDb(e){return Ce(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: saveReactionToDb","color: green;");try{if(this.authService.getUser()){let t=yield this.docService.getDocumentPaths$().pipe(Pe(r=>!!r),Ae(1)).toPromise();if(!t)throw new Error("Document paths not found.");if(this.documentPaths=t,this.loggingService.log(this.documentPaths),yield this.reactionDbReadyGate$().pipe(Ae(1)).toPromise(),this.documentPaths?.reaction){if(e.annotationId=this.commonDbService.generateDocumentId(),e.pageInfo,!e?.metadata?.documentId){e?.metadata||(e.metadata={});let h=this.getElementForReactionAnnotation(e),_=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId,element:h});e.metadata=y(y({},e?.metadata),_)}let r=JSON.parse(JSON.stringify(e));r.position=null;let{documentId:a,organizationId:m}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(e),C=e.commentAnnotationId?void 0:{annotationData:r,actionType:"add",notificationSource:"reaction"};return yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:a,organizationId:m},data:r,extraData:C}),r}else return}}catch(t){this.loggingService.catch("Error in ReactionService saveReactionToDb: ",t)}})}getDocumentIdAndOrganizationIdFromReactionAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in ReactionService getDocumentIdAndOrganizationIdFromReactionAnnotation: ",t),{}}}updateUserInReaction(e){return Ce(this,null,function*(){try{let t=this.authService.getUser();if(t)return e?.reactions||(e.reactions=[]),e?.reactions?.find(a=>a?.from?.userId===t?.userId)?e.reactions=e?.reactions?.filter(a=>a?.from?.userId!==t?.userId):e.reactions.push({from:t,lastUpdated:this.timestamp}),e.reactions.length?yield this.updateReaction(e):yield this.deleteReactionPinAnnotation(e?.annotationId),e}catch(t){this.loggingService.catch("Error in ReactionService updateUserInReaction: ",t)}})}removeUserFromReaction(e){this.loggingService.log("%c[WB] Calling FUNCTION: removeUserFromReaction","color: green;");try{let t=this.authService.getUser();t&&(e?.reactions||(e.reactions=[]),e.reactions=e?.reactions?.filter(r=>r?.from?.userId!==t?.userId),this.updateReaction(e))}catch(t){this.loggingService.catch("Error in ReactionService removeUserFromReaction: ",t)}}updateReaction(e,t,r){return Ce(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateReaction","color: green;");try{if(this.authService.getUser()){if(e?.targetElement?.xpath){let h=this.domService.getXPath(e.targetElement.xpath);if(h){let _=h.iterateNext();_&&(cn(_)||(e.targetElement=null))}}let a=JSON.parse(JSON.stringify(e));if(a.position=null,a.lastUpdated=this.timestamp,!a?.metadata?.documentId){a?.metadata||(a.metadata={});let h=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId});a.metadata=y(y({},a?.metadata),h)}let{documentId:m,organizationId:C}=a?.metadata||{};return r?yield this.commonDbService.updateData({feature:"reaction",properties:{id:e.annotationId,documentId:m,organizationId:C},data:JSON.parse(JSON.stringify(a))}):yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:m,organizationId:C},data:JSON.parse(JSON.stringify(a))}),a}}catch(a){this.loggingService.catch("Error in ReactionService updateReaction: ",a)}})}deleteReactionPinAnnotation(e,t){return Ce(this,null,function*(){try{let r=this.getAnnotationById(e),{documentId:a,organizationId:m}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(r),C=r&&!r.commentAnnotationId?{annotationData:r,actionType:"delete",notificationSource:"reaction"}:void 0;yield this.commonDbService.deleteData({feature:"reaction",properties:{id:e,documentId:a,organizationId:m},extraData:C})}catch(r){this.loggingService.catch("Error in ReactionService deleteReactionPinAnnotation: ",r)}})}setCustomReactions(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;"),this.customReactions$.next(e),this.emojiService.setEmojiList(e)}catch(t){this.loggingService.catch("Error in ReactionService setCustomReactions: ",t)}}enableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;"),this.darkMode$.value===!0)return;this.darkMode$.next(!0)}catch(e){this.loggingService.catch("Error in ReactionService enableDarkMode: ",e)}}disableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;"),this.darkMode$.value===!1)return;this.darkMode$.next(!1)}catch(e){this.loggingService.catch("Error in ReactionService disableDarkMode: ",e)}}getDarkMode(){return this.darkMode$.value}getDarkMode$(){return this.darkMode$.asObservable()}sanitizeReactionAnnotation(e){try{e&&(e.iconUrl&&(e.iconUrl=this.domService.sanitizeHtml(e.iconUrl)),e.iconEmoji&&(e.iconEmoji=this.domService.sanitizeHtml(e.iconEmoji)),e.icon&&(e.icon=this.domService.sanitizeHtml(e.icon)))}catch(t){this.loggingService.catch("Error in ReactionService sanitizeReactionAnnotation: ",t)}}get timestamp(){return this.commonDbService.getServerTimestamp()}getReactionAnnotationForClient(e){try{let t=["isReactionResolverUsed","pageInfo","from","involvedUserIds","position"],r=JSON.parse(JSON.stringify(e)),a={};return Object.keys(r).forEach(m=>{t.includes(m)||(m==="reactions"?a.fromUsers=r[m]:a[m]=r[m])}),a}catch(t){return this.loggingService.catch("Error in ReactionService getReactionAnnotationForClient: ",t),e}}};o.\u0275fac=function(t){return new(t||o)(se(Zt),se(dn),se(Fe),se(vn),se(pn),se(un),se(Ne),se(ye),se(Re),se(In),se(x),se(Rn),se(vt))},o.\u0275prov=jt({token:o,factory:o.\u0275fac,providedIn:"root"});let n=o;return n})();var Te=class{constructor(){this.annotations=[],this.reactionGroups=[],this.skeletonLoading=!0,this.darkMode=!1}};var ie=class{constructor(){this.type="comment",this.disableTooltip=!1,this.isReactionSelectedByCurrentUser=!1,this.tooltipVisible=!1,this.shadowDom=!1}};var Dn=n=>({componentConfigSignal:n}),Hn=(n,o)=>({condition:n,data:o}),Yn=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-emoji-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function Gn(n,o){if(n&1&&(g(0),N(1,"div",3),T(2,"emoji"),T(3,"translate"),u()),n&2){let i=c(3).ngIf,e=c();s(),l("innerHTML",$e(2,3,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Oe),R("data-testid",e.componentId)("aria-label",O(3,6,"Reaction with")+" "+((i==null||i.annotation==null?null:i.annotation.icon)||"emoji"))}}function Xn(n,o){if(n&1&&(g(0),d(1,Gn,4,8,"ng-container",0),u()),n&2){let i=c(2).ngIf;s(),l("ngIf",i==null?null:i.annotation)}}function Jn(n,o){if(n&1&&(g(0),d(1,Xn,2,1,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,Yn,e.template,k(1,Dn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Qn(n,o){if(n&1&&(g(0),d(1,Jn,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,Hn,i.conditionSignal(),k(1,Dn,i.componentConfigSignal)))}}var Ye=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reaction-pin-emoji",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinEmojiComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-emoji-internal"]],standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","img",1,"velt-reaction-pin--emoji",3,"innerHTML"]],template:function(t,r){t&1&&d(0,Qn,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,pt,H],styles:["[_nghost-%COMP%]{display:inline-flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=o;return n})();var On=n=>({componentConfigSignal:n}),Zn=(n,o)=>({condition:n,data:o}),qn=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-count-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function ei(n,o){if(n&1&&(S(0,"div",4),T(1,"translate"),We(2),I()),n&2){let i=c(3).ngIf,e=c();R("data-testid",e.componentId)("aria-label",O(1,3,"Reaction count")+" "+((i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)||0)),s(2),st(" ",i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length," ")}}function ti(n,o){if(n&1&&(g(0),d(1,ei,3,5,"div",3),u()),n&2){let i=c(2).ngIf;s(),l("ngIf",i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)}}function ni(n,o){if(n&1&&(g(0),d(1,ti,2,1,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,qn,e.template,k(1,On,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function ii(n,o){if(n&1&&(g(0),d(1,ni,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,Zn,i.conditionSignal(),k(1,On,i.componentConfigSignal)))}}var Ge=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reaction-pin-count",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinCountComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-count-internal"]],standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["class","velt-reaction-pin--count","role","status",4,"ngIf"],["role","status",1,"velt-reaction-pin--count"]],template:function(t,r){t&1&&d(0,ii,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,H],styles:["[_nghost-%COMP%]{display:inline-flex}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=o;return n})();var wn=n=>({componentConfigSignal:n}),ri=(n,o)=>({condition:n,data:o}),ai=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-tooltip-user-avatar-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function ci(n,o){if(n&1&&(g(0),N(1,"snippyly-user-avatar",3),T(2,"translate"),T(3,"translate"),u()),n&2){let i=c(4);s(),l("size",24)("user",i.reaction==null?null:i.reaction.from),R("data-testid",i.componentId+"-avatar")("aria-label",O(2,4,"Avatar for")+" "+O(3,6,(i.reaction==null||i.reaction.from==null?null:i.reaction.from.name)||(i.reaction==null||i.reaction.from==null?null:i.reaction.from.email)||"user"))}}function li(n,o){if(n&1&&(g(0),d(1,ci,4,8,"ng-container",0),u()),n&2){let i=c(3);s(),l("ngIf",i.reaction)}}function si(n,o){if(n&1&&(g(0),d(1,li,2,1,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,ai,e.template,k(1,wn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function mi(n,o){if(n&1&&(g(0),d(1,si,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,ri,i.conditionSignal(),k(1,wn,i.componentConfigSignal)))}}var Xe=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-avatar",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserAvatarComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-tooltip-user-avatar-internal"]],inputs:{reaction:"reaction"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-reaction-pin-tooltip-user-avatar",3,"size","user"]],template:function(t,r){t&1&&d(0,mi,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,bn,H],styles:["[_nghost-%COMP%]:empty{display:none}snippyly-user-avatar[_ngcontent-%COMP%]{display:flex}"],changeDetection:0});let n=o;return n})();var Pn=n=>({componentConfigSignal:n}),pi=(n,o)=>({condition:n,data:o}),gi=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-tooltip-user-name-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function ui(n,o){if(n&1&&(S(0,"span",7),We(1),T(2,"translate"),I()),n&2){let i=c(6);R("data-testid",i.componentId+"-suffix"),s(),st("(",O(2,2,"You"),")")}}function hi(n,o){if(n&1&&(g(0),S(1,"span",5),We(2),T(3,"translate"),I(),d(4,ui,3,4,"span",6),u()),n&2){let i=c(4).ngIf,e=c();s(),R("data-testid",e.componentId+"-name"),s(),Lt(O(3,3,(e.reaction==null||e.reaction.from==null?null:e.reaction.from.name)||(e.reaction==null||e.reaction.from==null?null:e.reaction.from.email))),s(2),l("ngIf",(e.reaction==null||e.reaction.from==null?null:e.reaction.from.userId)===(i==null||i.user==null?null:i.user.userId))}}function fi(n,o){if(n&1&&(g(0),d(1,hi,5,5,"ng-container",4),u()),n&2){c(2);let i=J(3),e=c(2);s(),l("ngIf",(e.reaction==null||e.reaction.from==null?null:e.reaction.from.name)||(e.reaction==null||e.reaction.from==null?null:e.reaction.from.email))("ngIfElse",i)}}function _i(n,o){if(n&1&&(g(0),d(1,fi,2,2,"ng-container",1),u()),n&2){let i=c(3);s(),l("ngIf",i.reaction)}}function Ci(n,o){n&1&&N(0,"velt-skeleton-loader-internal",8)}function bi(n,o){if(n&1&&(g(0),d(1,_i,2,1,"ng-container",3)(2,Ci,1,0,"ng-template",null,0,ce),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,gi,e.template,k(1,Pn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Si(n,o){if(n&1&&(g(0),d(1,bi,4,9,"ng-container",2),u()),n&2){let i=c();s(),l("veltIf",E(3,pi,i.conditionSignal(),k(1,Pn,i.componentConfigSignal)))}}var Je=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-name",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserNameComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-tooltip-user-name-internal"]],inputs:{reaction:"reaction"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[["loadingTemplateRef",""],[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[4,"ngIf","ngIfElse"],[1,"velt-reaction-pin-tooltip-user-name"],["class","velt-reaction-pin-tooltip-user-name-suffix",4,"ngIf"],[1,"velt-reaction-pin-tooltip-user-name-suffix"],["height","20px","width","64px","borderRadius","20px"]],template:function(t,r){t&1&&d(0,Si,2,6,"ng-container",1),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,gt,H],styles:["[_nghost-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm)}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=o;return n})();var An=(n,o)=>({componentConfigSignal:n,reaction:o}),xi=(n,o)=>({condition:n,data:o}),yi=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-tooltip-user-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function ki(n,o){if(n&1&&(S(0,"div",3),T(1,"translate"),T(2,"translate"),N(3,"velt-reaction-pin-tooltip-user-avatar-internal",4)(4,"velt-reaction-pin-tooltip-user-name-internal",5),I()),n&2){let i=c(3);R("data-testid",i.componentId)("aria-label",O(1,5,"Reaction by")+" "+O(2,7,(i.reaction==null||i.reaction.from==null?null:i.reaction.from.name)||(i.reaction==null||i.reaction.from==null?null:i.reaction.from.email)||"user")),s(3),l("reaction",i.reaction),s(),l("reaction",i.reaction)("componentConfigSignal",i.componentConfigSignal)}}function Ri(n,o){if(n&1&&(g(0),d(1,ki,5,9,"div",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(4,yi,e.template,E(1,An,e.componentConfigSignal,e.reaction),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Ti(n,o){if(n&1&&(g(0),d(1,Ri,2,10,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(4,xi,i.conditionSignal(),E(1,An,i.componentConfigSignal,i.reaction)))}}var Qe=(()=>{let o=class o extends ${set _userWireframe(e){try{this.userWireframe=e,this.userWireframe?this.template=this.domService.deepCloneElement(this.userWireframe):this.template=null}catch{}}constructor(e,t,r,a){super(t,a,r),this.domService=e,this.elementRef=t,this.loggingService=r,this.dynamicDataService=a,this.componentId="velt-reaction-pin-tooltip-user",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUserComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(ye),v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-tooltip-user-internal"]],inputs:{reaction:"reaction",_userWireframe:[0,"userWireframe","_userWireframe"]},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],["class","v-tooltip-reaction-user velt-reaction-pin-tooltip-user","role","listitem",4,"veltDynamicTemplate"],["role","listitem",1,"v-tooltip-reaction-user","velt-reaction-pin-tooltip-user"],[3,"reaction"],[3,"reaction","componentConfigSignal"]],template:function(t,r){t&1&&d(0,Ti,2,7,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,Xe,Je,H],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reaction-pin-tooltip-user[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-sm);padding:var(--velt-spacing-sm)}"],changeDetection:0});let n=o;return n})();var Mn=n=>({componentConfigSignal:n}),Di=(n,o)=>({condition:n,data:o}),Oi=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reaction-pin-tooltip-users-wireframe",variant:i,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function wi(n,o){if(n&1&&(S(0,"div",5),N(1,"velt-reaction-pin-tooltip-user-internal",6),I()),n&2){let i=o.$implicit,e=o.index,t=c(4);R("data-testid",t.componentId+"-item-"+e),s(),l("userWireframe",t.userTemplate)("reaction",i)("componentConfigSignal",t.componentConfigSignal)}}function Pi(n,o){if(n&1&&(g(0),S(1,"div",3),T(2,"translate"),d(3,wi,2,4,"div",4),I(),u()),n&2){let i=c(2).ngIf,e=c();s(),R("data-testid",e.componentId)("aria-label",O(2,3,"Users who reacted")),s(2),l("ngForOf",i==null||i.annotation==null?null:i.annotation.reactions)}}function Ai(n,o){if(n&1&&(g(0),d(1,Pi,4,5,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,Oi,e.template,k(1,Mn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Mi(n,o){if(n&1&&(g(0),d(1,Ai,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,Di,i.conditionSignal(),k(1,Mn,i.componentConfigSignal)))}}var Ke=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reaction-pin-tooltip-users",super.initializeComponentConfigSignal(new ie)}ngOnInit(){try{if(super.ngOnInit(),this.setupA11yAttributes(),!this.userTemplate){let e=this.template?.querySelector("velt-reaction-pin-tooltip-user-wireframe");xe(e)||(this.userTemplate=e)}}catch{}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUsersComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipUsersComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-tooltip-users-internal"]],standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","list",1,"velt-reaction-pin-tooltip-users"],["role","presentation",4,"ngFor","ngForOf"],["role","presentation"],[3,"userWireframe","reaction","componentConfigSignal"]],template:function(t,r){t&1&&d(0,Mi,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[je,j,F,V,Qe,H],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reaction-pin-tooltip-users[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-xs)}"],changeDetection:0});let n=o;return n})();var Fi=n=>({componentConfigSignal:n}),Ni=(n,o)=>({template:n,context:o});function Bi(n,o){n&1&&ge(0)}function Ui(n,o){if(n&1&&(S(0,"velt-shadow-dom-internal"),d(1,Bi,1,0,"ng-container",3),I()),n&2){c();let i=J(3);s(),l("ngTemplateOutlet",i)}}function Li(n,o){if(n&1&&(S(0,"div",5),T(1,"translate"),N(2,"velt-reaction-pin-tooltip-users-internal",6),I()),n&2){let i=c(3);R("data-testid",i.componentId)("aria-label",O(1,4,"Reaction details")),s(2),l("componentConfigSignal",i.componentConfigSignal),R("data-testid",i.componentId+"-users")}}function Vi(n,o){if(n&1&&d(0,Li,3,6,"div",4),n&2){let i=c(2);l("veltDynamicTemplate",E(3,Ni,i.template,k(1,Fi,i.componentConfigSignal)))}}function zi(n,o){if(n&1&&(g(0),d(1,Ui,2,1,"velt-shadow-dom-internal",2)(2,Vi,1,6,"ng-template",null,0,ce),u()),n&2){let i=J(3),e=c();s(),l("ngIf",e.shadowDom&&!e.template||e.template&&e.isExplicitShadowDom)("ngIfElse",i)}}var Ze=(()=>{let o=class o extends _e{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}constructor(e,t,r,a,m){super(r,a,void 0,void 0,void 0,m,e),this.loggingService=e,this.wireframeService=t,this.elementRef=r,this.themeService=a,this.dynamicDataService=m,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.componentId="velt-reaction-pin-tooltip",this.subscriptions=[]}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let e=this.elementRef.nativeElement,t=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=t!==null&&t!=="false",this.setupA11yAttributes();let r="velt-reaction-pin-tooltip-wireframe";this.variant&&(r+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(r).subscribe(a=>{if(a){let m=document.createElement(a.tagName);m.innerHTML=a.innerHTML,this.template=m}}))}catch(e){this.catchError("Error in ReactionPinTooltipComponent OnInit: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.catchError("Error in ReactionPinTooltipComponent ondestroy: ",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("role","tooltip"),e.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionPinTooltipComponent setupA11yAttributes:",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 ReactionPinTooltipComponent unsubscribe: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(y({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(v(x),v(me),v(w),v(fe),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reaction-pin-tooltip-internal"]],inputs:{shadowDom:"shadowDom",variant:"variant"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[["reactionPinTooltipRef",""],[4,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","velt-reaction-pin-tooltip","role","tooltip",4,"veltDynamicTemplate"],["role","tooltip",1,"velt-reaction-pin-tooltip"],[3,"componentConfigSignal"]],template:function(t,r){t&1&&d(0,zi,4,2,"ng-container",1),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ue,ke,F,Ke,H],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-reaction-pin-tooltip[_ngcontent-%COMP%]{margin-block:8px;opacity:1;padding:4px;border-radius:var(--velt-border-radius-md);background:var(--velt-background-0);box-shadow:0 4px 21px #00000014;display:flex;flex-direction:column;gap:var(--velt-spacing-xs);color:var(--velt-text-0);font-size:var(--velt-font-size-xs);font-style:normal;font-weight:500;line-height:normal}.velt-reaction-pin-tooltip[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0});let n=o;return n})();var $i=["trigger"],Hi=["overlay"],jn=n=>({componentConfigSignal:n}),Fn=(n,o)=>({template:n,context:o}),Yi=(n,o)=>({reactionAnnotation:n,user:o});function Gi(n,o){if(n&1){let i=te();S(0,"div",8)(1,"div",9),T(2,"translate"),T(3,"translate"),ne("click",function(t){return K(i),c(4).onReactionClick(),Z(t.stopPropagation())}),N(4,"div",10),T(5,"emoji"),I()()}if(n&2){let i=c(3).ngIf,e=c();R("data-testid",e.componentId+"-timeline"),s(),R("data-testid",e.componentId+"-timeline-item")("aria-label",O(2,4,"React with")+" "+O(3,6,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("innerHTML",$e(5,8,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Oe)}}function Xi(n,o){if(n&1&&(g(0),N(1,"velt-reaction-pin-emoji-internal",13)(2,"velt-reaction-pin-count-internal",13),u()),n&2){let i=c(5);s(),l("componentConfigSignal",i.componentConfigSignal),s(),l("componentConfigSignal",i.componentConfigSignal)}}function Ji(n,o){if(n&1){let i=te();S(0,"div")(1,"div",11),T(2,"translate"),T(3,"translate"),ne("click",function(t){return K(i),c(4).onReactionClick(),Z(t.stopPropagation())}),d(4,Xi,3,2,"ng-container",12),I()()}if(n&2){let i=c(3).ngIf,e=c();s(),Se("velt-reaction-pin--default",!e.template)("velt-reaction-pin--no-reactions",!(!(i==null||i.annotation==null||i.annotation.reactions==null)&&i.annotation.reactions.length)),R("data-testid",e.componentId+"-default")("aria-label",O(2,7,"React with")+" "+O(3,9,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("veltDynamicTemplate",E(13,Fn,e.template,k(11,jn,e.componentConfigSignal)))}}function Qi(n,o){if(n&1&&(g(0),S(1,"div",5),d(2,Gi,6,11,"div",6)(3,Ji,5,16,"div",7),I(),u()),n&2){let i=c(3);s(),l("ngSwitch",i.type),s(),l("ngSwitchCase","timeline")}}function Ki(n,o){if(n&1){let i=te();S(0,"div",9),T(1,"translate"),T(2,"translate"),ne("click",function(t){return K(i),c(6).onReactionClick(),Z(t.stopPropagation())}),N(3,"div",10),T(4,"emoji"),I()}if(n&2){let i=c(5).ngIf,e=c();Se("active",i==null?null:i.isReactionSelectedByCurrentUser),R("data-testid",e.componentId+"-timeline-item")("aria-pressed",i==null?null:i.isReactionSelectedByCurrentUser)("aria-label",O(1,6,"React with")+" "+O(2,8,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("innerHTML",$e(4,10,i==null||i.annotation==null?null:i.annotation.icon,i==null?null:i.annotation),Oe)}}function Zi(n,o){if(n&1&&(S(0,"div",8),d(1,Ki,5,13,"div",15),I()),n&2){let i=c(4).ngIf,e=c();R("data-testid",e.componentId+"-timeline"),s(),l("ngIf",i==null||i.annotation==null?null:i.annotation.icon)}}function qi(n,o){n&1&&N(0,"velt-skeleton-loader-internal",18)}function eo(n,o){if(n&1&&(g(0),N(1,"velt-reaction-pin-emoji-internal",13)(2,"velt-reaction-pin-count-internal",13),u()),n&2){let i=c(7);s(),l("componentConfigSignal",i.componentConfigSignal),s(),l("componentConfigSignal",i.componentConfigSignal)}}function to(n,o){if(n&1){let i=te();S(0,"div",11),T(1,"translate"),T(2,"translate"),ne("click",function(t){return K(i),c(6).onReactionClick(),Z(t.stopPropagation())}),d(3,eo,3,2,"ng-container",12),I()}if(n&2){let i=c(5).ngIf,e=c();Se("velt-reaction-pin--default",!e.template)("active",i==null?null:i.isReactionSelectedByCurrentUser)("velt-reaction-pin--no-reactions",!(!(i==null||i.annotation==null||i.annotation.reactions==null)&&i.annotation.reactions.length)),R("data-testid",e.componentId+"-default")("aria-pressed",i==null?null:i.isReactionSelectedByCurrentUser)("aria-label",O(1,10,"React with")+" "+O(2,12,(i==null||i.annotation==null?null:i.annotation.icon)||"emoji")),s(3),l("veltDynamicTemplate",E(16,Fn,e.template,k(14,jn,e.componentConfigSignal)))}}function no(n,o){if(n&1&&(S(0,"div"),d(1,qi,1,0,"velt-skeleton-loader-internal",16)(2,to,4,19,"div",17),I()),n&2){let i=c(4).ngIf,e=c();s(),l("ngIf",e.showLoadingTemplate),s(),l("ngIf",i==null||i.annotation==null?null:i.annotation.icon)}}function io(n,o){if(n&1&&(S(0,"div",5),d(1,Zi,2,2,"div",6)(2,no,3,2,"div",7),I()),n&2){let i=c(4);l("ngSwitch",i.type),s(),l("ngSwitchCase","timeline")}}function oo(n,o){n&1&&ge(0)}function ro(n,o){if(n&1&&(g(0),d(1,oo,1,0,"ng-container",20),u()),n&2){let i=c(4).ngIf,e=c();s(),l("ngTemplateOutlet",e.customTooltipTemplate)("ngTemplateOutletContext",E(2,Yi,i==null?null:i.annotation,i==null?null:i.user))}}function ao(n,o){if(n&1&&N(0,"velt-reaction-pin-tooltip-internal",21),n&2){let i=c(5);l("shadowDom",!!i.shadowDom)("variant",i.variant)("componentConfigSignal",i.componentConfigSignal)("darkMode",i.darkMode)}}function co(n,o){if(n&1&&d(0,ro,2,5,"ng-container",19)(1,ao,1,4,"ng-template",null,2,ce),n&2){let i=J(2),e=c(4);l("ngIf",e.customTooltipTemplate)("ngIfElse",i)}}function lo(n,o){if(n&1&&(S(0,"app-overlay-tooltip",14),d(1,io,3,2,"ng-template",null,0,ce)(3,co,3,2,"ng-template",null,1,ce),I()),n&2){let i=c(3);l("positions",i.positions)("disabled",i.disableTooltip),R("data-testid",i.componentId+"-tooltip")}}function so(n,o){if(n&1&&(g(0),d(1,Qi,4,2,"ng-container",3)(2,lo,5,3,"app-overlay-tooltip",4),u()),n&2){let i=c().ngIf,e=c();s(),l("ngIf",e.reactionId&&!e.annotationId&&(i==null||i.annotation==null?null:i.annotation.icon)&&e.type!=="standalone"),s(),l("ngIf",(i==null||i.annotation==null||i.annotation.reactions==null?null:i.annotation.reactions.length)||e.type==="standalone")}}function mo(n,o){if(n&1&&(g(0),d(1,so,3,2,"ng-container",3),u()),n&2){let i=c();s(),l("ngIf",!i.isExcludedValue)}}var Ue=(()=>{let o=class o extends _e{set reactionId(e){this._reactionId=e}get reactionId(){return this._reactionId}set"reaction-id"(e){this._reactionId=e}get isExcludedValue(){try{let e=this.componentConfigSignal(),t=e?.annotation?.icon,r=this.excludeReactionIds||e?.excludeReactionIds||[];return!t||!r?.length?!1:r.includes(t)}catch{return!1}}constructor(e,t,r,a,m,C,h){super(m,C,void 0,void 0,void 0,h,t),this.authService=e,this.loggingService=t,this.reactionService=r,this.wireframeService=a,this.elementRef=m,this.themeService=C,this.dynamicDataService=h,this.type="comment",this.disableTooltip=!1,this.shadowDom=!1,this.excludeReactionIds=[],this.commentReactionAnnotationIds=[],this.positions=[{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}],this.componentConfigSignal=Me(new ie),this.click=new be,this.showLoadingTemplate=!1,this.subscriptions=[],this.commentReactionSubscriptions=[],this.componentId="velt-reaction-pin",this.loggingService.log("%c[WB] Creating CLASS: ReactionPinComponent","color: blue;")}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit(),this.setupA11yAttributes(),this.setShowLoadingTemplate(),this.reactionId&&!this.annotationId&&(this.setDefaultReaction(this.reactionId),this.commentReactionAnnotationIds?.length&&this.findMatchingAnnotationFromCommentReactions());let e="velt-reaction-pin-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r}}))}catch(e){this.catchError("Error in ReactionPinComponent OnInit: ",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","region"),e.setAttribute("aria-label","Reaction section")}catch(e){this.loggingService.catch("Error in ReactionPinComponent setupA11yAttributes:",e)}}ngAfterViewInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngAfterViewInit","color: green;");try{this.subscriptions.push(this.authService.getUser$().pipe(Pe(e=>!!e),Ae(1)).subscribe(e=>{this.componentConfigSignal.update(t=>(t=D(y({},t),{user:e}),t)),this.checkIfReactionSelectedByCurrentUser()}))}catch(e){this.catchError("Error in ReactionPinComponent ngAfterViewInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(y({},r),{[t]:e[t].currentValue}),r))}),this.shouldResubscribeToAnnotation(e)&&(this.annotationSubscription?.unsubscribe(),this.annotationSubscription=void 0,this.annotationId&&this.getReactionByAnnotationId(this.annotationId)),e.reactionId&&this.reactionId&&!this.annotationId&&this.setDefaultReaction(this.reactionId),(e.commentReactionAnnotationIds||e.reactionId)&&this.reactionId&&!this.annotationId&&this.commentReactionAnnotationIds?.length&&this.findMatchingAnnotationFromCommentReactions()}catch(t){this.catchError("Error in ReactionPinComponent ngOnChanges: ",t)}}shouldResubscribeToAnnotation(e){if(e.annotationId)return!0;let t=e.mergedAnnotationIds;if(!t)return!1;let r=t.previousValue,a=t.currentValue;return!r||!a?r!==a:r.length!==a.length||r.some((m,C)=>m!==a[C])}setDefaultReaction(e){try{let t={icon:e,reactions:[]};this.componentConfigSignal.update(r=>(r=D(y({},r),{annotation:t}),r))}catch(t){this.catchError("Error in ReactionPinComponent setDefaultReaction: ",t)}}findMatchingAnnotationFromCommentReactions(){try{if(this.commentReactionSubscriptions.forEach(e=>e.unsubscribe()),this.commentReactionSubscriptions=[],!this.commentReactionAnnotationIds?.length||!this.reactionId)return;for(let e of this.commentReactionAnnotationIds){let t=this.reactionService.getReactionAnnotationByAnnotationId(e,this.parentMetadata).subscribe(r=>{r?.icon===this.reactionId&&(this.componentConfigSignal.update(a=>(a=D(y({},a),{annotation:r}),a)),this.checkIfReactionSelectedByCurrentUser())});this.commentReactionSubscriptions.push(t)}}catch(e){this.catchError("Error in ReactionPinComponent findMatchingAnnotationFromCommentReactions: ",e)}}getReactionByAnnotationId(e){this.loggingService.log("%c[WB] Calling FUNCTION: getReactionByAnnotationId","color: green;");try{let t=(this.mergedAnnotationIds?.length??0)>1?this.reactionService.getMergedReactionAnnotation$(this.mergedAnnotationIds,this.parentMetadata):this.reactionService.getReactionAnnotationByAnnotationId(e,this.parentMetadata);this.annotationSubscription=t.subscribe(r=>{this.componentConfigSignal.update(a=>(a=D(y({},a),{annotation:r}),a)),this.checkIfReactionSelectedByCurrentUser(),this.setShowLoadingTemplate(),this.componentConfigSignal().tooltipVisible&&!this.componentConfigSignal().annotation?.reactions?.length&&this.hideTooltip(),this.overlay?.overlayRef?.updatePosition()})}catch(t){this.catchError("Error in ReactionPinComponent getReactionByAnnotationId: ",t)}}checkIfReactionSelectedByCurrentUser(){this.loggingService.log("%c[WB] Calling FUNCTION: checkIfReactionSelectedByCurrentUser","color: green;");try{this.componentConfigSignal.update(e=>(e=D(y({},e),{isReactionSelectedByCurrentUser:!!e.annotation?.reactions?.find(t=>t?.from?.userId===e.user?.userId)}),e))}catch(e){this.catchError("Error in ReactionPinComponent checkIfReactionSelectedByCurrentUser: ",e)}}setShowLoadingTemplate(){try{!this.componentConfigSignal()?.annotation?.icon&&this.componentConfigSignal()?.annotation?.isReactionResolverUsed?this.showLoadingTemplate=!0:this.showLoadingTemplate=!1}catch(e){this.catchError("Error in ReactionPinComponent setShowLoadingTemplate: ",e)}}onReactionClick(){this.loggingService.log("%c[WB] Calling FUNCTION: onReactionClick","color: green;");try{this.click.emit(this.componentConfigSignal().annotation)}catch(e){this.catchError("Error in ReactionPinComponent onReactionClick: ",e)}}showTooltip(){try{this.componentConfigSignal.update(e=>(e=D(y({},e),{tooltipVisible:!0}),e))}catch(e){this.catchError("Error in ReactionPinComponent showTooltip: ",e)}}hideTooltip(){try{this.componentConfigSignal.update(e=>(e=D(y({},e),{tooltipVisible:!1}),e))}catch(e){this.catchError("Error in ReactionPinComponent hideTooltip: ",e)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.catchError("Error in ReactionPinComponent ngOnDestroy: ",e)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.forEach(e=>{e.unsubscribe()}),this.subscriptions=[],this.commentReactionSubscriptions.forEach(e=>{e.unsubscribe()}),this.commentReactionSubscriptions=[],this.annotationSubscription?.unsubscribe(),this.annotationSubscription=void 0}catch(e){this.catchError("Error in ReactionPinComponent unsubscribe: ",e)}}catchError(e,t,r){try{this.loggingService.catch(e,t,D(y({},r||{}),{annotationId:this.componentConfigSignal()?.annotation?.annotationId}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(v(Fe),v(x),v(de),v(me),v(w),v(fe),v(f))},o.\u0275cmp=P({type:o,selectors:[["app-reaction-pin"]],viewQuery:function(t,r){if(t&1&&(_t($i,5),_t(Hi,5)),t&2){let a;Ct(a=bt())&&(r.trigger=a.first),Ct(a=bt())&&(r.overlay=a.first)}},inputs:{type:"type",annotationId:"annotationId",disableTooltip:"disableTooltip",customTooltipTemplate:[0,"tooltipTemplate","customTooltipTemplate"],variant:"variant",shadowDom:"shadowDom",parentMetadata:"parentMetadata",excludeReactionIds:"excludeReactionIds",mergedAnnotationIds:"mergedAnnotationIds",commentReactionAnnotationIds:"commentReactionAnnotationIds",reactionId:[0,"reaction-id","reactionId"]},outputs:{click:"click"},standalone:!1,features:[M([f]),A,Ie],decls:1,vars:1,consts:[["triggerTemplate",""],["tooltipTemplate",""],["defaultTooltipTemplate",""],[4,"ngIf"],[3,"positions","disabled",4,"ngIf"],[3,"ngSwitch"],["class","s-emoji-block_timeline",4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"s-emoji-block_timeline"],["role","button",1,"s-emoji-block__item",3,"click"],["role","img","aria-hidden","true",1,"s-emoji-block__item__emoji",3,"innerHTML"],["role","button",1,"velt-reaction-pin",3,"click"],[4,"veltDynamicTemplate"],[3,"componentConfigSignal"],[3,"positions","disabled"],["class","s-emoji-block__item","role","button",3,"active","click",4,"ngIf"],["height","34px","width","51px","borderRadius","8px",4,"ngIf"],["class","velt-reaction-pin","role","button",3,"velt-reaction-pin--default","active","velt-reaction-pin--no-reactions","click",4,"ngIf"],["height","34px","width","51px","borderRadius","8px"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"shadowDom","variant","componentConfigSignal","darkMode"]],template:function(t,r){t&1&&d(0,mo,2,1,"ng-container",3),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ue,Wt,$t,Ht,Cn,F,gt,Ye,Ge,Ze,pt,H],styles:["[_nghost-%COMP%]:empty{display:none}.s-emoji-block_timeline[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--velt-spacing-sm);width:18px;height:18px}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item[_ngcontent-%COMP%]{display:flex;align-items:center}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__count[_ngcontent-%COMP%]{display:none}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__emoji{display:flex;align-items:center;justify-content:center}.s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__emoji svg, .s-emoji-block_timeline[_ngcontent-%COMP%] .s-emoji-block__item__emoji img{width:16px!important;height:16px!important} .snippyly-reaction-dialog-overlay-panel{z-index:2147483577}"],changeDetection:0});let n=o;return n})();var Nn=n=>({componentConfigSignal:n}),po=(n,o)=>({condition:n,data:o}),go=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-inline-reactions-section-list-wireframe",variant:i,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function uo(n,o){if(n&1){let i=te();g(0),S(1,"div",6)(2,"app-reaction-pin",7),ne("click",function(t){K(i);let r=c(4).ngIf;return Z(r==null?null:r.onReactionClick(t))}),I()(),u()}if(n&2){let i=o.$implicit,e=c(4).ngIf,t=c();s(2),l("annotationId",i==null?null:i.annotationId)("mergedAnnotationIds",i==null?null:i.annotationIds)("shadowDom",!!(e!=null&&e.shadowDom))("variant",e==null?null:e.variant)("darkMode",!!(e!=null&&e.darkMode))("template",t.pinTemplate)}}function ho(n,o){if(n&1&&(S(0,"div",4),d(1,uo,3,6,"ng-container",5),I()),n&2){let i=c(3).ngIf;s(),l("ngForOf",i==null?null:i.reactionGroups)("ngForTrackBy",i.reactionAnnotationsTrackByFn)}}function fo(n,o){if(n&1&&(g(0),d(1,ho,2,2,"div",3),u()),n&2){let i=c(2).ngIf;s(),l("ngIf",(i==null||i.reactionGroups==null?null:i.reactionGroups.length)>0)}}function _o(n,o){if(n&1&&(g(0),d(1,fo,2,1,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,go,e.template,k(1,Nn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Co(n,o){if(n&1&&(g(0),d(1,_o,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,po,i.conditionSignal(),k(1,Nn,i.componentConfigSignal)))}}var qe=(()=>{let o=class o extends ${constructor(e,t,r,a){super(e,r,a),this.elementRef=e,this.wireframeService=t,this.dynamicDataService=r,this.loggingService=a,this.subscriptions=[],super.initializeComponentConfigSignal(new Te)}ngOnInit(){try{if(super.ngOnInit(),!this.template){let e="velt-inline-reactions-section-list-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r,this.getChildTemplate()}}))}this.getChildTemplate()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionListComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.loggingService.catch("Error in InlineReactionsSectionListComponent ngOnDestroy:",e)}}getChildTemplate(){try{if(!this.pinTemplate&&this.template){let e=this.template.querySelector("velt-reaction-pin-wireframe");xe(e)||(this.pinTemplate=e)}}catch(e){this.loggingService.catch("Error in InlineReactionsSectionListComponent getChildTemplate:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(me),v(f),v(x))},o.\u0275cmp=P({type:o,selectors:[["app-inline-reactions-section-list"]],inputs:{variant:"variant"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["class","velt-inline-reactions-section--reactions",4,"ngIf"],[1,"velt-inline-reactions-section--reactions"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"velt-inline-reactions-section--reaction"],[3,"click","annotationId","mergedAnnotationIds","shadowDom","variant","darkMode","template"]],template:function(t,r){t&1&&d(0,Co,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[je,j,F,V,Ue],styles:[".velt-inline-reactions-section--reactions[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--velt-spacing-xs)}[_nghost-%COMP%] .velt-reaction-pin--default{display:inline-flex;height:28px;padding:var(--velt-spacing-2xs) var(--velt-spacing-sm);align-items:center;gap:var(--velt-spacing-xs);flex-shrink:0;border-radius:var(--velt-border-radius-2xl);border:1px solid var(--velt-border-0);background:var(--velt-background-0);color:var(--velt-text-0);box-sizing:border-box;cursor:pointer}[_nghost-%COMP%] .velt-reaction-pin--default.active{border-radius:var(--velt-border-radius-2xl);border:1px solid var(--velt-accent);background:var(--velt-accent-transparent);color:var(--velt-accent)}[_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji{line-height:1;display:flex}[_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji svg, [_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji img, [_nghost-%COMP%] .velt-reaction-pin--default .velt-reaction-pin--emoji span{width:14px;height:14px;margin:0;font-size:14px;line-height:1}[_nghost-%COMP%] .velt-reaction-pin--default .s-emoji-block__item__count{font-size:var(--velt-font-size-sm);color:var(--velt-text-3)}"],changeDetection:0});let n=o;return n})();var Ee=class{};var Bn=n=>({componentConfigSignal:n}),So=(n,o)=>({condition:n,data:o}),Io=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reactions-panel-item-emoji-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function xo(n,o){if(n&1&&(g(0),N(1,"div",3),u()),n&2){let i=c(4);s(),l("innerHTML",i.emoji.value,Oe),R("data-testid",i.componentId+"-emoji")}}function yo(n,o){if(n&1&&(g(0),d(1,xo,2,2,"ng-container",0),u()),n&2){let i=c(3);s(),l("ngIf",i.emoji)}}function ko(n,o){if(n&1&&(g(0),d(1,yo,2,1,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,Io,e.template,k(1,Bn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Ro(n,o){if(n&1&&(g(0),d(1,ko,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,So,i.conditionSignal(),k(1,Bn,i.componentConfigSignal)))}}var et=(()=>{let o=class o extends ${constructor(e,t,r){super(e,r,t),this.elementRef=e,this.loggingService=t,this.dynamicDataService=r,this.componentId="velt-reactions-panel-item-emoji",super.initializeComponentConfigSignal(new Ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemEmojiComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemEmojiComponent ngOnDestroy:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;this.emoji?.key&&e.setAttribute("aria-label",this.emoji.key),e.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelItemEmojiComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reactions-panel-item-emoji-internal"]],inputs:{emoji:"emoji"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-reactions-panel-item-emoji",3,"innerHTML"]],template:function(t,r){t&1&&d(0,Ro,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V],styles:["[_nghost-%COMP%] .velt-reactions-panel-item-emoji{display:flex;height:24px;width:24px;max-width:unset;margin:0;font-size:var(--velt-font-size-lg);line-height:1}[_nghost-%COMP%] .velt-reactions-panel-item-emoji svg, [_nghost-%COMP%] .velt-reactions-panel-item-emoji img, [_nghost-%COMP%] .velt-reactions-panel-item-emoji span{height:100%;width:100%;max-width:unset;margin:0;font-size:var(--velt-font-size-lg);line-height:1}[_nghost-%COMP%]:empty{display:none}"],changeDetection:0});let n=o;return n})();var Eo=n=>({componentConfigSignal:n}),Do=(n,o)=>({condition:n,data:o}),Oo=(n,o)=>({emoji:n,componentConfigSignal:o}),wo=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reactions-panel-item-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function Po(n,o){if(n&1&&(g(0),N(1,"velt-reactions-panel-item-emoji-internal",4),u()),n&2){let i=c(4);s(),l("emoji",i.emoji),R("data-testid",i.componentId+"-emoji")}}function Ao(n,o){if(n&1){let i=te();g(0),S(1,"div",2),T(2,"translate"),ne("click",function(){K(i);let t=c(2).ngIf,r=c();return Z(t==null?null:t.handleEmojiSelected(r.emoji.key))}),d(3,Po,2,2,"ng-container",3),I(),u()}if(n&2){let i=c(2).ngIf,e=c();s(),R("aria-label",O(2,3,e.ariaLabel))("data-testid",e.componentId+"-item"),s(2),l("veltDynamicTemplate",L(8,wo,e.template,E(5,Oo,e.emoji,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Mo(n,o){if(n&1&&(g(0),d(1,Ao,4,14,"ng-container",0),u()),n&2){let i=c().ngIf,e=c();s(),l("ngIf",i&&e.emoji)}}function jo(n,o){if(n&1&&(g(0),d(1,Mo,2,1,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,Do,i.conditionSignal(),k(1,Eo,i.componentConfigSignal)))}}var tt=(()=>{let o=class o extends ${set _itemWireframe(e){this.itemWireframe=e,this.itemWireframe?this.template=this.domService.deepCloneElement(this.itemWireframe):this.template=null}constructor(e,t,r,a){super(t,a,r),this.domService=e,this.elementRef=t,this.loggingService=r,this.dynamicDataService=a,this.componentId="velt-reactions-panel-item",super.initializeComponentConfigSignal(new Ee)}ngOnInit(){try{super.ngOnInit(),this.setupA11yAttributes()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemComponent ngOnDestroy:",e)}}get ariaLabel(){return this.emoji?.key||"Emoji"}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelItemComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(ye),v(w),v(x),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reactions-panel-item-internal"]],inputs:{emoji:"emoji",_itemWireframe:[0,"itemWireframe","_itemWireframe"]},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[1,"velt-reactions-panel-item",3,"click"],[4,"veltDynamicTemplate"],[3,"emoji"]],template:function(t,r){t&1&&d(0,jo,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,et,H],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reactions-panel-item[_ngcontent-%COMP%]{display:flex;padding:var(--velt-spacing-2xs) var(--velt-spacing-xs);border-radius:var(--velt-border-radius-sm);background:transparent;cursor:pointer}.velt-reactions-panel-item[_ngcontent-%COMP%]:hover{background:var(--legacy-velt-border-color)}"],changeDetection:0});let n=o;return n})();var Un=n=>({componentConfigSignal:n}),No=(n,o)=>({condition:n,data:o}),Bo=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-reactions-panel-items-wireframe",variant:i,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function Uo(n,o){if(n&1&&(g(0),N(1,"velt-reactions-panel-item-internal",5),u()),n&2){let i=o.$implicit,e=c(4);s(),l("itemWireframe",e.itemTemplate)("componentConfigSignal",e.componentConfigSignal)("emoji",i),R("data-testid",e.componentId+"-item-"+i.key)}}function Lo(n,o){if(n&1&&(g(0),S(1,"div",3),T(2,"translate"),d(3,Uo,2,4,"ng-container",4),I(),u()),n&2){let i=c(3);s(),R("aria-label",O(2,4,"Choose a reaction"))("data-testid",i.componentId+"-list"),s(2),l("ngForOf",i.filteredEmojis())("ngForTrackBy",i.trackByEmojiKey)}}function Vo(n,o){if(n&1&&(g(0),d(1,Lo,4,6,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,Bo,e.template,k(1,Un,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function zo(n,o){if(n&1&&(g(0),d(1,Vo,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,No,i.conditionSignal(),k(1,Un,i.componentConfigSignal)))}}var nt=(()=>{let o=class o extends ${constructor(e,t,r,a){super(r,a,t),this.emojiService=e,this.loggingService=t,this.elementRef=r,this.dynamicDataService=a,this.componentId="velt-reactions-panel-items",this.filteredEmojis=zt(()=>{try{let m=this.componentConfigSignal()?.excludeReactionIds||[],C=this.emojiService.emojisSignal();return m.length?Object.entries(C).filter(([h])=>!m.includes(h)).map(([h,_])=>({key:h,value:_})):Object.entries(C).map(([h,_])=>({key:h,value:_}))}catch(m){return this.loggingService.catch("Error in ReactionsPanelItemsComponent filteredEmojis:",m),[]}}),super.initializeComponentConfigSignal(new Ee)}ngOnInit(){try{if(super.ngOnInit(),this.setupA11yAttributes(),!this.itemTemplate){let e=this.template?.querySelector("velt-reactions-panel-item-wireframe");xe(e)||(this.itemTemplate=e)}}catch{}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in ReactionsPanelItemsComponent ngOnDestroy:",e)}}trackByEmojiKey(e,t){return t?.key||e}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelItemsComponent setupA11yAttributes:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(Re),v(x),v(w),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reactions-panel-items-internal"]],standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],["role","list",1,"velt-reactions-panel-items"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"itemWireframe","componentConfigSignal","emoji"]],template:function(t,r){t&1&&d(0,zo,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[je,j,F,V,tt,H],styles:["[_nghost-%COMP%]:empty{display:none}.velt-reactions-panel-items[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--velt-spacing-xs);flex-wrap:wrap}"],changeDetection:0});let n=o;return n})();var $o=n=>({componentConfigSignal:n}),Ho=(n,o)=>({template:n,context:o});function Yo(n,o){n&1&&ge(0)}function Go(n,o){if(n&1&&(S(0,"velt-shadow-dom-internal"),d(1,Yo,1,0,"ng-container",3),I()),n&2){c();let i=J(3),e=c();R("data-testid",e.componentId+"-shadow-dom"),s(),l("ngTemplateOutlet",i)}}function Xo(n,o){if(n&1&&(g(0),N(1,"velt-reactions-panel-items-internal",6),u()),n&2){let i=c(3);s(),l("componentConfigSignal",i.componentConfigSignal),R("data-testid",i.componentId+"-items")}}function Jo(n,o){if(n&1){let i=te();S(0,"div",4),T(1,"translate"),ne("clickOutside",function(){K(i);let t=c(2);return Z(t.onClickOutside())}),d(2,Xo,2,2,"ng-container",5),I()}if(n&2){let i=c(2);Se("velt-reactions-panel--inline-section-mode",i.isInlineSectionMode)("velt-reactions-panel--default",!i.template)("dark",i.darkMode),R("aria-label",O(1,9,"Available reactions"))("data-testid",i.componentId+"-panel"),s(2),l("veltDynamicTemplate",E(13,Ho,i.template,k(11,$o,i.componentConfigSignal)))}}function Qo(n,o){if(n&1&&(g(0),d(1,Go,2,2,"velt-shadow-dom-internal",2)(2,Jo,3,16,"ng-template",null,0,ce),u()),n&2){let i=J(3),e=c();s(),l("ngIf",e.shadowDom&&!e.template||e.template&&e.isExplicitShadowDom)("ngIfElse",i)}}var wt=(()=>{let o=class o extends _e{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}constructor(e,t,r,a,m,C){super(r,a,void 0,void 0,void 0,C,t),this.emojiService=e,this.loggingService=t,this.elementRef=r,this.themeService=a,this.wireframeService=m,this.dynamicDataService=C,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.isInlineSectionMode=!1,this.excludeReactionIds=[],this.emojiSelected=new be,this.hideTooltip=new be,this.componentConfigSignal=Me({variant:this.variant,onClickOutside:this.onClickOutside.bind(this),handleEmojiSelected:this.handleEmojiSelected.bind(this),excludeReactionIds:this.excludeReactionIds}),this.subscriptions=[],this.componentId="velt-reactions-panel"}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let e=this.elementRef.nativeElement,t=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=t!==null&&t!=="false",this.setupA11yAttributes();let r="velt-reactions-panel-wireframe";this.variant&&(r+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(r).subscribe(a=>{if(a){let m=document.createElement(a.tagName);m.innerHTML=a.innerHTML,this.template=m}}))}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent OnInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(y({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in ReactionsPanelComponent ngOnChanges: ",t)}}setupA11yAttributes(){try{this.elementRef.nativeElement.setAttribute("data-testid",this.componentId+"-container")}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent setupA11yAttributes:",e)}}trackByEmojiKey(e,t){return t?.key||e}onClickOutside(){try{this.hideTooltip.emit()}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent onClickOutside: ",e)}}handleEmojiSelected(e){try{this.emojiSelected.emit(e),this.hideTooltip.emit()}catch(t){this.loggingService.catch("Error in ReactionsPanelComponent handleEmojiSelected: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.loggingService.catch("Error in ReactionsPanelComponent 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.loggingService.catch("Error in ReactionsPanelComponent unsubscribe: ",e)}}};o.\u0275fac=function(t){return new(t||o)(v(Re),v(x),v(w),v(fe),v(me),v(f))},o.\u0275cmp=P({type:o,selectors:[["velt-reactions-panel-internal"]],inputs:{shadowDom:"shadowDom",variant:"variant",isInlineSectionMode:"isInlineSectionMode",excludeReactionIds:"excludeReactionIds"},outputs:{emojiSelected:"emojiSelected",hideTooltip:"hideTooltip"},standalone:!1,features:[M([f]),A,Ie],decls:1,vars:1,consts:[["reactionsPanelRef",""],[4,"ngIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["snippylyClickOutside","","role","list",1,"velt-reactions-panel",3,"clickOutside"],[4,"veltDynamicTemplate"],[3,"componentConfigSignal"]],template:function(t,r){t&1&&d(0,Qo,4,2,"ng-container",1),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ue,ke,F,_n,nt,H],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-reactions-panel[_ngcontent-%COMP%]{max-width:100%;overflow:visible;border:1px solid var(--velt-border-5);border-radius:var(--velt-border-radius-md);transition:opacity .5s;padding:var(--velt-spacing-sm) var(--velt-spacing-md);background-color:var(--velt-background-0);font-style:normal;font-weight:400;font-size:var(--velt-font-size-xs);line-height:calc((2rem + 0px) * var(--velt-base-rem-unit));box-shadow:0 8px 16px -8px #0f0f0f1a}.velt-reactions-panel--inline-section-mode[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-2xl)}"],changeDetection:0});let n=o;return n})();var Zo=n=>({template:n}),qo=()=>["snippyly-overlay-panel","snippyly-reaction-dialog-overlay-panel","velt-overlay-panel"];function er(n,o){n&1&&ge(0)}function tr(n,o){if(n&1&&(S(0,"velt-shadow-dom-internal"),d(1,er,1,0,"ng-container",4),I()),n&2){c();let i=J(2);s(),l("ngTemplateOutlet",i)}}function nr(n,o){if(n&1&&(g(0),S(1,"div",8),Nt(),S(2,"svg",9),N(3,"path",10)(4,"path",11)(5,"path",12),I()(),u()),n&2){let i=c(2);s(),Se("active",i.tooltipVisible)("no-padding",i.noPadding),R("data-testid",i.componentId+"-button"),s(),R("data-testid",i.componentId+"-icon")}}function ir(n,o){if(n&1){let i=te();S(0,"velt-reactions-panel-internal",13),T(1,"translate"),ne("emojiSelected",function(t){K(i);let r=c(2);return Z(r.handleEmojiSelected(t))})("hideTooltip",function(){K(i);let t=c(2);return Z(t.hideTooltip())}),I()}if(n&2){let i=c(2);l("darkMode",i.darkMode)("shadowDom",i.shadowDom)("variant",i.variant)("isInlineSectionMode",i.isInlineSectionMode)("excludeReactionIds",i.excludeReactionIds),R("data-testid",i.componentId+"-panel")("aria-label",O(1,7,"Reaction selector"))}}function or(n,o){if(n&1){let i=te();S(0,"div",5,1),T(2,"translate"),ne("pointerdown",function(){K(i);let t=c();return Z(t.showTooltip())}),d(3,nr,6,6,"ng-container",6),I(),d(4,ir,2,9,"ng-template",7,2,ce)}if(n&2){let i=J(1),e=J(5),t=c();Se("velt-reaction-btn-container--inline-section-mode",t.isInlineSectionMode),R("data-testid",t.componentId)("aria-expanded",t.tooltipVisible)("aria-haspopup",!0)("aria-label",O(2,14,"Add reaction")),s(3),l("veltDynamicTemplate",k(16,Zo,t.template)),s(),l("cdkConnectedOverlayOrigin",i)("cdkConnectedOverlayOpen",t.tooltipVisible)("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",Vt(18,qo))("cdkConnectedOverlayPositions",t.positions)("snippylyOverlay",e)("snippylyOverlayZIndex",2147483627)}}var Le=(()=>{let o=class o extends _e{set shadowDom(e){this._shadowDom=e}get shadowDom(){return this._shadowDom}resolveTemplate(){this.template=rr(this.serviceWireframe,this.parentTemplate)}constructor(e,t,r,a,m,C,h,_,p){super(m,h,void 0,void 0,void 0,p,a),this.docService=e,this.domService=t,this.emojiService=r,this.loggingService=a,this.elementRef=m,this.reactionService=C,this.themeService=h,this.wireframeService=_,this.dynamicDataService=p,this._shadowDom=!0,this.isExplicitShadowDom=!1,this.isInlineSectionMode=!1,this.noPadding=!1,this.excludeReactionIds=[],this.onReactionToolClick=new be,this.emojiSelected=new be,this.reactionToolOpen=new be,this.tooltipVisible=!1,this.customButtonAdded=!1,this.positions=[{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}].map(b=>new Gt({originX:b.originX,originY:b.originY},{overlayX:b.overlayX,overlayY:b.overlayY})),this.subscriptions=[],this.veltElement=!0,this.componentId="velt-reaction-tool"}ngOnInit(){try{this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;"),super.ngOnInit();let e=this.elementRef.nativeElement,t=e.getAttribute("shadow-dom")??e.getAttribute("shadowdom");this.isExplicitShadowDom=t!==null&&t!=="false",this.setupA11yAttributes();let r="velt-reaction-tool-wireframe";this.variant&&(r+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(r).subscribe(a=>{if(a){let m=document.createElement(a.tagName);m.innerHTML=a.innerHTML,this.serviceWireframe=m,this.resolveTemplate()}}))}catch(e){this.loggingService.catch("Error in ReactionToolComponent OnInit: ",e)}}ngOnChanges(e){super.ngOnChanges(e),e.template&&(this.parentTemplate=e.template.currentValue,this.resolveTemplate())}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("role","button"),e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false")}catch(e){this.loggingService.catch("Error in ReactionToolComponent setupA11yAttributes:",e)}}trackByEmojiKey(e,t){return t?.key||e}onButtonSlotChange(){this.customButtonAdded=!0}showTooltip(){try{this.tooltipVisible=!0,this.toggleHostClass(),this.onReactionToolClick.emit()}catch(e){this.loggingService.catch("Error in ReactionToolComponent showTooltip: ",e)}}hideTooltip(){try{this.tooltipVisible=!1,this.toggleHostClass()}catch(e){this.loggingService.catch("Error in ReactionToolComponent hideTooltip: ",e)}}toggleHostClass(){try{this.tooltipVisible?(this.reactionToolOpen.emit(!0),this.domService.addClassToElement(this.elementRef.nativeElement,"reaction-tool-active"),this.domService.addClassToElement(this.elementRef.nativeElement,"velt-reaction-tool-open")):(this.reactionToolOpen.emit(!1),this.domService.removeClassFromElement(this.elementRef.nativeElement,"reaction-tool-active"),this.domService.removeClassFromElement(this.elementRef.nativeElement,"velt-reaction-tool-open"))}catch(e){this.loggingService.catch("Error in ReactionToolComponent toggleHostClass: ",e)}}handleEmojiSelected(e){try{this.emojiSelected.emit(e),this.hideTooltip(),this.videoPlayerId&&this.addReaction(e)}catch(t){this.loggingService.catch("Error in ReactionToolComponent handleEmojiSelected: ",t)}}addReaction(e){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: addReaction","color: green;"),this.videoPlayerId){let t=this.docService.getLocation()?.locationId,r=this.docService.getLocation()?.location;if(t){let a=document.getElementById(this.videoPlayerId);a&&a instanceof HTMLVideoElement&&(a.paused||a.pause());let m=this.docService.getDocumentPaths(),h=this.reactionService.getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:m?.organizationId,documentId:m?.documentId??""}).find(_=>_.locationId===t);this.reactionService.addOrUpdateReaction(e,h?[h.annotationId]:[],r)}}}catch(t){this.loggingService.catch("Error in VeltVideoPlayerComponent addReaction: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{super.ngOnDestroy(),this.unsubscribe()}catch(e){this.loggingService.catch("Error in ReactionToolComponent 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.loggingService.catch("Error in ReactionToolComponent unsubscribe: ",e)}}};o.\u0275fac=function(t){return new(t||o)(v(Ne),v(ye),v(Re),v(x),v(w),v(de),v(fe),v(me),v(f))},o.\u0275cmp=P({type:o,selectors:[["app-reaction-tool"]],hostVars:1,hostBindings:function(t,r){t&2&&R("data-velt-element",r.veltElement)},inputs:{shadowDom:"shadowDom",variant:"variant",isInlineSectionMode:"isInlineSectionMode",videoPlayerId:"videoPlayerId",noPadding:"noPadding",excludeReactionIds:"excludeReactionIds"},outputs:{onReactionToolClick:"onReactionToolClick",emojiSelected:"emojiSelected",reactionToolOpen:"reactionToolOpen"},standalone:!1,features:[M([f]),A,Ie],decls:3,vars:2,consts:[["reactionToolRefRef",""],["trigger","cdkOverlayOrigin"],["overlay","cdkConnectedOverlay"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["part","container","cdkOverlayOrigin","","role","button",1,"v-reaction-btn-container",3,"pointerdown"],[4,"veltDynamicTemplate"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayPositions","snippylyOverlay","snippylyOverlayZIndex"],["part","button-container",1,"action-btn"],["part","button-icon","width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg","aria-hidden","true","focusable","false",1,"action-btn-icon"],["d","M18.699 12.0222C18.7836 10.5835 18.4287 9.15318 17.6815 7.92091C16.9342 6.68864 15.83 5.71271 14.5152 5.1226C13.2004 4.5325 11.7373 4.35612 10.32 4.61687C8.90263 4.87762 7.59808 5.56317 6.57941 6.58257C5.56074 7.60196 4.87612 8.907 4.61637 10.3245C4.35663 11.742 4.53404 13.205 5.12508 14.5194C5.71612 15.8337 6.69284 16.9373 7.92564 17.6837C9.15844 18.43 10.589 18.7839 12.0276 18.6983M14.7629 17.1318H19.5M17.1315 14.7633V19.5004M9.23631 10.0262H9.24421M13.9734 10.0262H13.9813M9.63107 13.9738C10.1506 14.479 10.8627 14.7633 11.6049 14.7633C12.347 14.7633 13.0591 14.479 13.5786 13.9738","stroke","currentColor","stroke-width","1.33929","stroke-linecap","round","stroke-linejoin","round"],["d","M15.3496 10.6504C15.3496 11.2027 14.9019 11.6504 14.3496 11.6504C13.7973 11.6504 13.3496 11.2027 13.3496 10.6504C13.3496 10.0981 13.7973 9.65039 14.3496 9.65039C14.9019 9.65039 15.3496 10.0981 15.3496 10.6504Z","fill","currentColor"],["d","M10.9004 10.6504C10.9004 11.2027 10.4527 11.6504 9.90039 11.6504C9.34811 11.6504 8.90039 11.2027 8.90039 10.6504C8.90039 10.0981 9.34811 9.65039 9.90039 9.65039C10.4527 9.65039 10.9004 10.0981 10.9004 10.6504Z","fill","currentColor"],[3,"emojiSelected","hideTooltip","darkMode","shadowDom","variant","isInlineSectionMode","excludeReactionIds"]],template:function(t,r){if(t&1&&d(0,tr,2,1,"velt-shadow-dom-internal",3)(1,or,6,19,"ng-template",null,0,ce),t&2){let a=J(2);l("ngIf",!r.template&&r.shadowDom||r.template&&r.isExplicitShadowDom)("ngIfElse",a)}},dependencies:[j,ue,Jt,Xt,ke,F,fn,wt,H],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%]{display:flex;--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)}.v-reaction-btn-container[_ngcontent-%COMP%]{display:flex}.action-btn[_ngcontent-%COMP%]{display:inline-flex;justify-content:center;align-items:center;padding:calc(var(--velt-spacing-md) / 2);border-radius:var(--velt-border-radius-full);border:2px solid transparent;background-color:transparent;color:var(--velt-text-4);cursor:pointer}.action-btn.no-padding[_ngcontent-%COMP%]{padding:0}.action-btn[_ngcontent-%COMP%] .action-btn-label[_ngcontent-%COMP%]{font-size:var(--velt-font-size-sm);padding-right:var(--velt-spacing-xs);font-weight:700;color:currentColor}.action-btn[_ngcontent-%COMP%] .action-btn-icon[_ngcontent-%COMP%]{width:calc((1.5rem + 0px) * var(--velt-base-rem-unit));height:calc((1.5rem + 0px) * var(--velt-base-rem-unit));color:currentColor}.action-btn[_ngcontent-%COMP%] .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{width:16px;height:16px;color:currentColor}.action-btn[_ngcontent-%COMP%]:focus{border-radius:var(--velt-border-radius-full);border:2px solid var(--velt-border-2);background-color:transparent;color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:focus .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:hover{border-radius:var(--velt-border-radius-full);border:2px solid var(--velt-border-2);background-color:var(--velt-background-2);color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:hover .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{color:var(--velt-text-4)}.action-btn[_ngcontent-%COMP%]:active, .action-btn.active[_ngcontent-%COMP%]{border-radius:var(--velt-border-radius-full);border:2px solid var(--velt-accent);background-color:var(--velt-accent);color:var(--velt-accent-foreground)}.action-btn[_ngcontent-%COMP%]:active .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%], .action-btn.active[_ngcontent-%COMP%] .toolbar-icon-dropdown-arrow[_ngcontent-%COMP%]{color:var(--velt-text-4)}.velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn-icon[_ngcontent-%COMP%]{height:18px;width:18px}.velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{padding:calc(var(--velt-spacing-xs) - 1px)}.velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]:active, .velt-reaction-btn-container--inline-section-mode[_ngcontent-%COMP%] .action-btn.active[_ngcontent-%COMP%]{border:1px solid var(--velt-accent-text);background:linear-gradient(0deg,#0006 0% 100%),var(--velt-accent)}"],changeDetection:0});let n=o;return n})();function rr(n,o){return n||o}var Ln=n=>({componentConfigSignal:n}),cr=(n,o)=>({condition:n,data:o}),lr=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-inline-reactions-section-tool-container-wireframe",variant:i,setIfCondition:e,componentElementRef:t,replaceTemplate:!1});function sr(n,o){if(n&1){let i=te();g(0),S(1,"div",3)(2,"app-reaction-tool",4),ne("emojiSelected",function(t){K(i);let r=c(2).ngIf;return Z(r.onEmojiSelected(t))}),I()(),u()}if(n&2){let i=c(2).ngIf,e=c();s(2),l("shadowDom",!1)("template",e.toolTemplate)("variant",i==null?null:i.variant)("darkMode",i.darkMode)}}function mr(n,o){if(n&1&&(g(0),d(1,sr,3,4,"ng-container",2),u()),n&2){let i=c().ngIf,e=c();s(),l("veltDynamicTemplate",L(3,lr,e.template,k(1,Ln,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function dr(n,o){if(n&1&&(g(0),d(1,mr,2,9,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,cr,i.conditionSignal(),k(1,Ln,i.componentConfigSignal)))}}var it=(()=>{let o=class o extends ${constructor(e,t,r,a){super(e,t,r),this.elementRef=e,this.dynamicDataService=t,this.loggingService=r,this.wireframeService=a,this.subscriptions=[],super.initializeComponentConfigSignal(new Te)}ngOnInit(){try{if(super.ngOnInit(),!this.template){let e="velt-inline-reactions-section-tool-container-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r,this.getChildTemplate()}}))}this.getChildTemplate()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionToolContainerComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.loggingService.catch("Error in InlineReactionsSectionToolContainerComponent ngOnDestroy:",e)}}getChildTemplate(){try{if(!this.toolTemplate&&this.template){let e=this.template.querySelector("velt-reaction-tool-wireframe");xe(e)||(this.toolTemplate=e)}}catch(e){this.loggingService.catch("Error in InlineReactionsSectionToolContainerComponent getChildTemplate:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(f),v(x),v(me))},o.\u0275cmp=P({type:o,selectors:[["app-inline-reactions-section-tool-container"]],inputs:{variant:"variant"},standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-inline-reactions-section--tool-container"],[3,"emojiSelected","shadowDom","template","variant","darkMode"]],template:function(t,r){t&1&&d(0,dr,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,Le],styles:["[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn{border-radius:var(--velt-border-radius-2xl);background:var(--velt-background-0);padding:var(--velt-spacing-xs);border:none}[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn .action-btn-icon{width:20px;height:20px}[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn:hover{border-radius:var(--velt-border-radius-2xl);background:var(--velt-background-1)}[_nghost-%COMP%] .velt-inline-reactions-section--tool-container[_ngcontent-%COMP%] .v-reaction-btn-container .action-btn:hover .action-btn-icon{color:var(--velt-accent)}"],changeDetection:0});let n=o;return n})();var Vn=n=>({componentConfigSignal:n}),pr=(n,o)=>({condition:n,data:o}),gr=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-inline-reactions-section-panel-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function ur(n,o){if(n&1&&(g(0),S(1,"div",3),N(2,"app-inline-reactions-section-tool-container",4)(3,"app-inline-reactions-section-list",4),I(),u()),n&2){let i=c(3).ngIf,e=c();s(2),l("componentConfigSignal",e.componentConfigSignal)("variant",i==null?null:i.variant),s(),l("componentConfigSignal",e.componentConfigSignal)("variant",i==null?null:i.variant)}}function hr(n,o){if(n&1&&(S(0,"div"),d(1,ur,4,4,"ng-container",2),I()),n&2){let i=c(2).ngIf,e=c();s(),l("veltDynamicTemplate",L(3,gr,e.template,k(1,Vn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function fr(n,o){if(n&1&&(g(0),d(1,hr,2,9,"div",0),u()),n&2){let i=c().ngIf;s(),l("ngIf",!i.skeletonLoading)}}function _r(n,o){if(n&1&&(g(0),d(1,fr,2,1,"ng-container",1),u()),n&2){let i=c();s(),l("veltIf",E(3,pr,i.conditionSignal(),k(1,Vn,i.componentConfigSignal)))}}var ot=(()=>{let o=class o extends ${constructor(e,t,r){super(e,t,r),this.elementRef=e,this.dynamicDataService=t,this.loggingService=r,super.initializeComponentConfigSignal(new Te)}ngOnInit(){try{super.ngOnInit()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionPanelComponent ngOnInit:",e)}}ngOnDestroy(){try{super.ngOnDestroy()}catch(e){this.loggingService.catch("Error in InlineReactionsSectionPanelComponent ngOnDestroy:",e)}}};o.\u0275fac=function(t){return new(t||o)(v(w),v(f),v(x))},o.\u0275cmp=P({type:o,selectors:[["app-inline-reactions-section-panel"]],standalone:!1,features:[M([f]),A],decls:1,vars:1,consts:[[4,"ngIf"],[4,"veltIf"],[4,"veltDynamicTemplate"],[1,"velt-inline-reactions-section--panel"],[3,"componentConfigSignal","variant"]],template:function(t,r){t&1&&d(0,_r,2,6,"ng-container",0),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,F,V,qe,it],styles:[".velt-inline-reactions-section--panel[_ngcontent-%COMP%]{display:flex;gap:var(--velt-spacing-xs)}"],changeDetection:0});let n=o;return n})();var zn=n=>({componentConfigSignal:n}),br=(n,o)=>({condition:n,data:o}),Sr=(n,o,i,e,t)=>({template:n,context:o,componentName:"velt-inline-reactions-section-wireframe",variant:i,setIfCondition:e,componentElementRef:t});function Ir(n,o){n&1&&ge(0)}function xr(n,o){if(n&1&&(S(0,"velt-shadow-dom-internal"),d(1,Ir,1,0,"ng-container",4),I()),n&2){c();let i=J(3);s(),l("ngTemplateOutlet",i)}}function yr(n,o){if(n&1&&(g(0),S(1,"div",6),N(2,"app-inline-reactions-section-panel",7),I(),u()),n&2){let i=c(5);s(2),l("componentConfigSignal",i.componentConfigSignal)}}function kr(n,o){if(n&1&&d(0,yr,3,1,"ng-container",5),n&2){let i=c(3).ngIf,e=c();l("veltDynamicTemplate",L(3,Sr,e.template,k(1,zn,e.componentConfigSignal),i==null?null:i.variant,e.setIfCondition.bind(e),e.elementRef))}}function Rr(n,o){if(n&1&&(g(0),d(1,xr,2,1,"velt-shadow-dom-internal",3)(2,kr,1,9,"ng-template",null,0,ce),u()),n&2){let i=J(3),e=c(3);s(),l("ngIf",!e.template&&e.shadowDom||e.template&&e.isExplicitShadowDom)("ngIfElse",i)}}function Tr(n,o){if(n&1&&(g(0),d(1,Rr,4,2,"ng-container",1),u()),n&2){let i=c().ngIf;s(),l("ngIf",(i==null?null:i.targetReactionElementId)&&i.user)}}function Er(n,o){if(n&1&&(g(0),d(1,Tr,2,1,"ng-container",2),u()),n&2){let i=c();s(),l("veltIf",E(3,br,i.conditionSignal(),k(1,zn,i.componentConfigSignal)))}}var Ve=(()=>{let o=class o extends _e{set _targetReactionElementId(e){try{this.componentConfigSignal.update(t=>(t=D(y({},t),{targetReactionElementId:e}),t)),this.getReactionAnnotationsBySectionId(e)}catch{}}set _shadowDom(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.shadowDom=t,this.isExplicitShadowDom=!!t,this.componentConfigSignal.update(r=>(r=D(y({},r),{shadowDom:t}),r))}catch{}}set _customReactions(e){try{let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.reactionService.setCustomReactions(t)}catch{}}constructor(e,t,r,a,m,C,h,_){super(h,C,void 0,a,void 0,_,r),this.authService=e,this.docService=t,this.loggingService=r,this.reactionService=a,this.wireframeService=m,this.themeService=C,this.elementRef=h,this.dynamicDataService=_,this.shadowDom=!0,this.isExplicitShadowDom=!1,this.componentConfigSignal=Me({annotations:[],reactionGroups:[],skeletonLoading:!0,darkMode:!1,variant:"inline",shadowDom:!0,onEmojiSelected:this.onEmojiSelected.bind(this),onReactionClick:this.onReactionClick.bind(this),reactionAnnotationsTrackByFn:this.reactionAnnotationsTrackByFn.bind(this)}),this.subscriptions=[];try{this.subscriptions.push(super.onDarkModeChange().subscribe(p=>{this.componentConfigSignal.update(b=>(b=D(y({},b),{darkMode:p}),b))})),this.subscriptions.push(this.authService.getUser$().subscribe(p=>{this.componentConfigSignal.update(b=>(b=D(y({},b),{user:p}),b))}))}catch(p){this.catchError("Error in InlineReactionsSectionComponent constructor: ",p)}}ngOnInit(){try{super.ngOnInit(),this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;");let e="velt-inline-reactions-section-wireframe";this.variant&&(e+=`---${this.variant}`),this.subscriptions.push(this.wireframeService.getWireframe$(e).subscribe(t=>{if(t){let r=document.createElement(t.tagName);r.innerHTML=t.innerHTML,this.template=r}}))}catch(e){this.catchError("Error in InlineReactionsSectionComponent OnInit: ",e)}}ngOnChanges(e){try{super.ngOnChanges(e),e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(y({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.catchError("Error in InlineReactionsSectionComponent ngOnChanges: ",t)}}reactionAnnotationsTrackByFn(e,t){return t?.annotationId}getReactionAnnotationsBySectionId(e){try{this.reactionsBySectionIdSubscription?.unsubscribe(),this.reactionsBySectionIdSubscription=this.reactionService.getReactionAnnotationsBySectionId(e).subscribe(t=>{this.componentConfigSignal.update(r=>(r=D(y({},r),{annotations:t||[],reactionGroups:this.reactionService.groupReactionsByIcon(t),skeletonLoading:!1}),r))})}catch(t){this.catchError("Error in InlineReactionsSectionComponent getReactionsBySectionId: ",t)}}onEmojiSelected(e){try{let t=this.componentConfigSignal();this.reactionService.toggleSectionReaction(e,t.annotations,t.targetReactionElementId)}catch(t){this.catchError("Error in InlineReactionsSectionComponent onEmojiSelected: ",t)}}onReactionClick(e){try{if(e?.icon){let t=this.componentConfigSignal();this.reactionService.toggleSectionReaction(e.icon,t.annotations,t.targetReactionElementId)}}catch(t){this.catchError("Error in InlineReactionsSectionComponent onReactionClick: ",t)}}ngOnDestroy(){try{super.ngOnDestroy(),this.subscriptions.forEach(e=>{e.unsubscribe()}),this.reactionsBySectionIdSubscription?.unsubscribe()}catch(e){this.catchError("Error in InlineReactionsSectionComponent ngOnDestroy: ",e)}}catchError(e,t,r){try{let a;this.componentConfigSignal()?.annotations?.length&&(a=this.componentConfigSignal()?.annotations[0]?.annotationId),this.loggingService.catch(e,t,D(y({},r||{}),{annotationId:a}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(v(Fe),v(Ne),v(x),v(de),v(me),v(fe),v(w),v(f))},o.\u0275cmp=P({type:o,selectors:[["app-inline-reactions-section"]],inputs:{_targetReactionElementId:[0,"targetReactionElementId","_targetReactionElementId"],_shadowDom:[0,"shadowDom","_shadowDom"],variant:"variant",_customReactions:[0,"customReactions","_customReactions"]},standalone:!1,features:[M([f]),A,Ie],decls:1,vars:1,consts:[["commentToolRefRef",""],[4,"ngIf"],[4,"veltIf"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],[4,"veltDynamicTemplate"],[1,"velt-inline-reactions-section"],[3,"componentConfigSignal"]],template:function(t,r){t&1&&d(0,Er,2,6,"ng-container",1),t&2&&l("ngIf",r.componentConfigSignal())},dependencies:[j,ue,ke,F,V,ot],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)}"],changeDetection:0});let n=o;return n})();var ht=class extends xn{constructor(o){super(o),this.getService(x).log("%c[WB] Creating CLASS: ReactionElement","color: blue;"),this.enableDarkMode=this._enableDarkMode,this.disableDarkMode=this._disableDarkMode,this.setCustomReactions=this._setCustomReactions}_enableDarkMode(){this.getService(x).log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;");try{this.trackEvent(dt.Events.Reactions.ENABLE_DARK_MODE_TRIGGERED),this.getService(de).enableDarkMode()}catch(o){this.getService(x).catch("Error in _enableDarkMode: ",o)}}_disableDarkMode(){this.getService(x).log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;");try{this.trackEvent(dt.Events.Reactions.DISABLE_DARK_MODE_TRIGGERED),this.getService(de).disableDarkMode()}catch(o){this.getService(x).catch("Error in _disableDarkMode: ",o)}}_setCustomReactions(o){this.getService(x).log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;");try{this.trackEvent(dt.Events.Reactions.SET_CUSTOM_REACTIONS_TRIGGERED,{payload:{reactions:o}}),this.getService(de).setCustomReactions(o)}catch(i){this.getService(x).catch("Error in _setCustomReactions: ",i)}}};var Wn=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=Ut({type:o}),o.\u0275inj=Ft({imports:[Yt,Qt,Sn]});let n=o;return n})();var Dr={"velt-reaction-pin-emoji-wireframe":Ye,"velt-reaction-pin-count-wireframe":Ge,"velt-reaction-pin-tooltip-wireframe":Ze,"velt-reaction-pin-tooltip-users-wireframe":Ke,"velt-reaction-pin-tooltip-user-wireframe":Qe,"velt-reaction-pin-tooltip-user-avatar-wireframe":Xe,"velt-reaction-pin-tooltip-user-name-wireframe":Je,"velt-reactions-panel-items-wireframe":nt,"velt-reactions-panel-item-wireframe":tt,"velt-reactions-panel-item-emoji-wireframe":et,"velt-inline-reactions-section-wireframe":Ve,"velt-inline-reactions-section-tool-container-wireframe":it,"velt-inline-reactions-section-list-wireframe":qe,"velt-inline-reactions-section-panel-wireframe":ot};Object.assign(hn,Dr);function Or(n){n.get(x).log("%c[WB] Loading reaction feature chunk","color: blue;");let i=n.get(vt),e=n.get(de);i.set(mn,e);let r=Bt(Wn,n).injector;return ze(r,le.TAGS.VELT_REACTION_TOOL,Le),ze(r,le.TAGS.SNIPPYLY_REACTION_TOOL,Le),ze(r,le.TAGS.VELT_REACTION_PIN,Ue),ze(r,le.TAGS.SNIPPYLY_REACTION_PIN,Ue),ze(r,le.TAGS.VELT_INLINE_REACTIONS_SECTION,Ve),ze(r,le.TAGS.SNIPPYLY_INLINE_REACTIONS_SECTION,Ve),new ht(n)}function ze(n,o,i){if(customElements.get(o))return;let e=Kt(i,n);customElements.define(o,e)}export{Or as default};
|