@veltdev/sdk-staging 6.0.0-beta.13 → 6.0.0-beta.15

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.
Files changed (57) hide show
  1. package/app/models/data/config.data.model.d.ts +38 -5
  2. package/app/utils/enums.d.ts +1 -1
  3. package/{chunk-5JIXRA34.js → chunk-54BT4NQJ.js} +1 -1
  4. package/{chunk-N3AV6IGG.js → chunk-5EO5WTC7.js} +1 -1
  5. package/{chunk-Z77RD4H5.js → chunk-5I3MKJ2F.js} +1 -1
  6. package/{chunk-UF2D32ZI.js → chunk-5NMVUDFG.js} +1 -1
  7. package/{chunk-SXYSM6QP.js → chunk-62RN7JJN.js} +1 -1
  8. package/{chunk-JDZOVFS3.js → chunk-6K2VWE4K.js} +1 -1
  9. package/{chunk-SAPJAJDB.js → chunk-6OW5GJ3E.js} +1 -1
  10. package/{chunk-OHH7LESC.js → chunk-7PEWZDFC.js} +1 -1
  11. package/{chunk-YFZUZKVN.js → chunk-APPJN3VX.js} +1 -1
  12. package/{chunk-VMH5N5PO.js → chunk-B7JPRLBQ.js} +1 -1
  13. package/{chunk-TVX75U2C.js → chunk-CZWARF5M.js} +1 -1
  14. package/{chunk-P54MO3GU.js → chunk-ELEMLDFM.js} +1 -1
  15. package/{chunk-SG6UCHMH.js → chunk-EYPJC34Q.js} +1 -1
  16. package/{chunk-3H5W2TGU.js → chunk-HLPJRWIY.js} +1 -1
  17. package/{chunk-55YE7G6I.js → chunk-HNT7HKW3.js} +1 -1
  18. package/{chunk-DUIGMOMV.js → chunk-HPRUJRZF.js} +1 -1
  19. package/{chunk-XM2SXO32.js → chunk-IY3WJ7XZ.js} +1 -1
  20. package/{chunk-MLCIQM44.js → chunk-JAOM3JHX.js} +1 -1
  21. package/{chunk-N2SSZ74J.js → chunk-K5BJ5DAO.js} +1 -1
  22. package/{chunk-YEQZ76RF.js → chunk-KYEMQS6S.js} +1 -1
  23. package/{chunk-GHVMD37V.js → chunk-LHTLQZLP.js} +1 -1
  24. package/{chunk-JXMMR7DC.js → chunk-MRAZ6ENQ.js} +1 -1
  25. package/{chunk-T4D6QD4H.js → chunk-MZ2HKBWF.js} +1 -1
  26. package/{chunk-7MOQQG4Z.js → chunk-NLVNX52N.js} +1 -1
  27. package/chunk-O4F37U67.js +167 -0
  28. package/{chunk-JPM7CIV3.js → chunk-OEYWDDK3.js} +1 -1
  29. package/{chunk-GJ55RHPP.js → chunk-OK5VRMUL.js} +1 -1
  30. package/{chunk-AIQ4EOVH.js → chunk-POME7PZR.js} +1 -1
  31. package/{chunk-OWD3J56P.js → chunk-RD2BRSWO.js} +1 -1
  32. package/{chunk-GNMKNWD5.js → chunk-S4APJ64C.js} +1 -1
  33. package/{chunk-Q2QL77LS.js → chunk-TMYAQS7C.js} +1 -1
  34. package/{chunk-XM56PHBZ.js → chunk-WJFVURTP.js} +1 -1
  35. package/{chunk-CZTTDJFW.js → chunk-XYR7TNZL.js} +1 -1
  36. package/package.json +1 -1
  37. package/velt-activity-log.js +1 -1
  38. package/velt-area.js +1 -1
  39. package/velt-arrow.js +1 -1
  40. package/velt-comment.js +1 -1
  41. package/velt-crdt.js +1 -1
  42. package/velt-cursor.js +1 -1
  43. package/velt-huddle.js +1 -1
  44. package/velt-live-state-sync.js +1 -1
  45. package/velt-notification.js +1 -1
  46. package/velt-presence.js +1 -1
  47. package/velt-reaction.js +1 -1
  48. package/velt-recorder.js +1 -1
  49. package/velt-rewriter.js +1 -1
  50. package/velt-selection.js +1 -1
  51. package/velt-tag.js +1 -1
  52. package/velt-user-invite.js +1 -1
  53. package/velt-user-request.js +1 -1
  54. package/velt-video-player.js +1 -1
  55. package/velt-views.js +1 -1
  56. package/velt.js +2 -2
  57. package/chunk-NFOSJ24G.js +0 -167
package/velt-tag.js CHANGED
@@ -1 +1 @@
1
- import{a as we}from"./chunk-3H5W2TGU.js";import"./chunk-Q2QL77LS.js";import{b as Xt,c as Kt,d as Jt}from"./chunk-SAPJAJDB.js";import{b as ye,t as Ie}from"./chunk-N3AV6IGG.js";import"./chunk-P54MO3GU.js";import"./chunk-JDZOVFS3.js";import"./chunk-YFZUZKVN.js";import"./chunk-SG6UCHMH.js";import"./chunk-CZTTDJFW.js";import{b as be}from"./chunk-7MOQQG4Z.js";import{b as Ce,d as Ee}from"./chunk-GNMKNWD5.js";import{a as Oe}from"./chunk-5JIXRA34.js";import{a as Ae}from"./chunk-SXYSM6QP.js";import{a as ie}from"./chunk-AIQ4EOVH.js";import{A as Zt,G as te,H as ee,I as ne,Y as re,ca as Pe,r as Qt,t as qt}from"./chunk-N2SSZ74J.js";import{$ as rt,Ab as Ft,Af as Pt,Bb as Ht,Bg as de,Db as Z,Dd as oe,De as d,E as D,Eb as tt,Ec as Wt,Fa as v,Fb as et,Ga as at,Gc as H,Hi as _e,Ib as N,J as $,Jb as Vt,Kb as st,Lc as zt,Ma as Dt,Mf as se,Nb as Q,Nf as ce,Ob as Tt,Pa as m,Pb as St,Pc as Yt,Qb as Ut,Qf as le,T as C,Ta as Mt,Ua as k,Va as kt,Ye as ae,Yg as pe,Zg as me,_a as O,_f as lt,a as G,aa as wt,ac as jt,ai as ue,b as K,bb as Bt,bi as B,ca as f,cc as Gt,ci as p,db as M,di as ve,fe as ct,g as ot,ha as T,hi as fe,ia as S,ig as Ct,ja as W,kc as R,kg as bt,ki as L,l as J,la as xt,lb as u,lc as F,li as U,mb as _,nb as P,ne as V,ob as z,pc as nt,pf as _t,pg as ge,r as E,sb as Lt,si as Te,tb as Nt,ub as ft,uh as b,v as I,vb as x,wb as Rt,xb as A,xc as $t,xh as he,xi as Se,zb as h}from"./chunk-NFOSJ24G.js";var w=(()=>{let r=class r{constructor(t,e,n,i,l,s,c,y,X,Me,ke,Be,Le,Ne,Re){this.analyticsService=t,this.configService=e,this.docService=n,this.databaseService=i,this.authService=l,this.domService=s,this.afAuth=c,this.iamService=y,this.avatarService=X,this.contactService=Me,this.storageService=ke,this.dialog=Be,this.loggingService=Le,this.serviceBook=Ne,this.commonDbService=Re,this.tagAnnotations$=new J({}),this.tagAnnotationsByDocumentId$=new J({}),this.documentPaths=null,this.allowedElementIds$=new J([]),this.addTagMode$=new J(!1),this.enableTextTags$=new J(!1),this.notificationService=null,this.loggingService.log("%c[WB] Creating CLASS: TagService","color: blue;"),this.serviceBook.observe(he).subscribe(g=>{this.notificationService=g}),this.databaseService.getDb().pipe(D(g=>!!g),$(1)).subscribe(g=>{g&&this.getDocumentPaths()},g=>{this.loggingService.catch("Error in TagService getDb subscription: ",g)}),this.domService.onWindowPointerMove$().subscribe(g=>{if(this.addTagMode$.value){this.hightlightElement&&this.domService.removeHighlightFromElement(this.hightlightElement);let j=this.domService.getBackgroundElement(g.clientX,g.clientY);j&&(this.isElementInsideAllowedElements(j)?bt(g.target)?this.domService.removeClassFromElement(document.body,"show-pin-cursor"):(this.domService.addClassToElement(document.body,"show-pin-cursor"),this.hightlightElement=j,this.domService.highlightElement(this.hightlightElement,d.CURSOR.TAG_PIN)):this.domService.removeClassFromElement(document.body,"show-pin-cursor"))}},g=>{this.loggingService.catch("Error in TagService onWindowPointerMove$ subscription: ",g)}),this.domService.onWindowKeyupEsc$().subscribe(g=>{this.addTagMode$.value&&this.disableAddTagMode()},g=>{this.loggingService.catch("Error in TagService onWindowKeyupEsc$ subscription: ",g)}),this.domService.onDocumentClick$().subscribe(g=>{if(g&&this.addTagMode$.value){if(g.preventDefault(),g.stopPropagation(),!bt(g.target)){let j=this.domService.getBackgroundElement(g.clientX,g.clientY);j&&this.isElementInsideAllowedElements(j)&&this.addTag(g)}this.disableAddTagMode()}},g=>{this.loggingService.catch("Error in TagService onDocumentClick$ subscription: ",g)}),this.addTagMode$.subscribe(g=>{this.hightlightElement&&this.domService.removeHighlightFromElement(this.hightlightElement),g?this.domService.addClassToElement(document.body,"snippyly-add-tag-mode"):(this.domService.removeClassFromElement(document.body,"snippyly-add-tag-mode"),this.domService.removeClassFromElement(document.body,"show-pin-cursor"))},g=>{this.loggingService.catch("Error in TagService addTagMode$ subscription: ",g)}),this.domService.onWindowKeyupBackspace$().subscribe(g=>{this.deleteTagPinAnnotations("keyupBackspace")},g=>{this.loggingService.catch("Error in TagService onWindowKeyupBackspace$ subscription: ",g)}),this.domService.onWindowKeyupDelete$().subscribe(g=>{this.deleteTagPinAnnotations("keyupDelete")},g=>{this.loggingService.catch("Error in TagService onWindowKeyupDelete$ subscription: ",g)}),this.domService.getDeleteCommmentAnnotations$().subscribe(g=>{g?.length&&(g?.filter(vt=>vt.type==="tag")).forEach(vt=>ot(this,null,function*(){yield this.deleteTagPinAnnotation(vt)}))},g=>{this.loggingService.catch("Error in TagService onWindowKeyupDelete$ subscription: ",g)})}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;"),this.docService.getDocumentPaths$()}getAnonymousAvatarImage(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAnonymousAvatarImage","color: green;"),this.avatarService.generateUserImage()}setAllowedElementIds(t){this.allowedElementIds$.next(t||[])}getAllowedElementIds(){return this.allowedElementIds$.asObservable()}getAllTagAnnotations(t,e,n){this.loggingService.log("%c[WB] Calling FUNCTION: getAllTagAnnotations","color: green;");let i,l;try{if(t&&(l=Pt(t)),e&&typeof e=="object"){let s=le(e);i=Pt(JSON.stringify(s))}}catch(s){this.loggingService.catch("Error in TagService getAllTagAnnotations: ",s)}return this.authService.getAuthState$().pipe(D(s=>!!s),C(s=>this.isFeatureAllowed({firebaseUser:s,annotations:[],filteredAnnotations:[]})),C(s=>s.featureAllowed?this.iamService.isUserAllowed$().pipe(I(c=>(s.featureAllowed=c,s))):E(s)),C(s=>s.featureAllowed?this.authService.isPlanExpired$().pipe(I(c=>(s.featureAllowed=!c,s))):E(s)),C(s=>s.featureAllowed?E(s).pipe(C(c=>this.docService.getDocumentPaths$().pipe(I(y=>(this.documentPaths=y,c.documentPaths=y,c)))),C(c=>this.getDataFromDocumentId(l).pipe(I(y=>(c.annotations=y||[],G({},c))))),C(c=>this.docService.getLocation$().pipe(I(y=>(c.location=y,c)))),C(c=>this.docService.getLocations$().pipe(I(y=>(c.customLocations=y,c)))),I(c=>{if(c.filteredAnnotations=[],l&&!i)return c.filteredAnnotations=c.annotations?.slice(),c;{let y=[];return i?y.push(i):(y.push(c?.location?.locationId),y.push(...Object.values(c?.customLocations||[]).map(X=>X.locationId))),c.filteredAnnotations=this.filterAnnotationsByLocationIds(c?.annotations,y),c}}),C(c=>n?E(c):c?.annotations?.length?this.domService.onWindowResize$().pipe(I(()=>c)):E(c)),C(c=>n?E(c):c?.annotations?.length?this.domService.onDomChange$("TagService getAllTagAnnotations").pipe(I(()=>c)):E(c)),I(c=>(c?.filteredAnnotations?.forEach(y=>{this.calculateTagAnnotationPosition(y)}),c)),C(c=>c?.filteredAnnotations?E(c?.filteredAnnotations||[]):E([]))):E([])))}isFeatureAllowed(t){return this.configService.getConfig$().pipe(D(e=>!!e),I(e=>K(G({},t),{config:e})),C(e=>this.authService.getUser$().pipe(I(n=>K(G({},e),{user:n})))),C(e=>se(e.config,e.user,V.TAG)?E(K(G({},e),{featureAllowed:!0})):(this.loggingService.warn("Tag feature is not allowed."),E(K(G({},e),{featureAllowed:!1})))))}getDataFromDocumentId(t){return this.databaseService.getDb().pipe(D(e=>!!e),C(e=>this.configService?.getApiKey()&&this.documentPaths?.tag?this.commonDbService.dbListener({feature:"allTags",properties:{documentId:t??this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0}}).pipe(I(n=>n?.data),I(n=>{let i=[];return n&&(i=Object.values(n).filter(l=>typeof l=="object")),this.setTagAnnotationsByDocumentId(t||this.documentPaths?.documentId,i),i})):E([])))}setTagAnnotationsByDocumentId(t,e){try{t&&this.tagAnnotationsByDocumentId$.next(K(G({},this.tagAnnotationsByDocumentId$.value),{[t]:e}))}catch(n){this.loggingService.catch("Error in TagService setTagAnnotationsByDocumentId:",n)}}filterAnnotationsByLocationIds(t,e){try{return t.filter(n=>e.includes(n.locationId))}catch(n){return this.loggingService.catch("Error in TagService filterAnnotationsByLocations:",n),[]}}calculateTagAnnotationPosition(t){try{if(t.targetElement){let e=this.domService.getXPath(t.targetElement?.xpath);if(e){let n=e.iterateNext();if(n&&lt(n)){let i=n.getBoundingClientRect();if(i&&i.width&&i.height){let{height:l,width:s}=pe(n);t.position={top:l*t.targetElement.topPercentage/100,left:s*t.targetElement.leftPercentage/100}}else t.position=null}else t.position=null}else t.position=null}}catch(e){this.loggingService.catch("Error in TagService calculateTagAnnotationPosition:",e)}}filterPinAnnotations(t,e,n){this.loggingService.log("%c[WB] Calling FUNCTION: filterPinAnnotations","color: green;");try{let i=t?Object.values(t):[];i.forEach((s,c)=>{s?.annotationId&&(s.annotationIndex=c+1)});let l=[];if(e)n?l=i.filter(s=>s.locationId===n):l=i.slice();else{let s=this.docService.getLocation();s&&s.locationId?l=i.filter(c=>c.locationId===s.locationId):l=i.filter(c=>!c.locationId)}return l}catch(i){return this.loggingService.catch("Error in TagService filterPinAnnotations:",i),[]}}addTag(t,e){this.loggingService.log("%c[WB] Calling FUNCTION: addTag","color: green;");try{let n=this.authService.getUser();if(n)if(n.isReadOnly||n.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add tags.");else{let i=new _t;i.from=n,i.color=d.DEFAULT_ANNOTATION_COLOR,i.resolved=!1,i.lastUpdated=this.timestamp;let{topPositionX:l,topPositionY:s}=this.domService.getTopLeftPosition();i.positionX=l,i.positionY=s;let c=this.domService.getCurrentWindowSizeValue();if(i.screenWidth=c.screenWidth,i.screenHeight=c.screenHeight,i.screenScrollHeight=c.screenScrollHeight,i.taggedElementPath="",t&&(i.targetElement=this.domService.getTargetElementForCursorPosition(t)),e&&(i.targetTextRange=e),i?.targetElement?.xpath){let y=this.domService.getXPath(i.targetElement.xpath);if(y){let X=y.iterateNext();X&&(lt(X)||(i.targetElement=null))}}this.setLocationToTagAnnotation(i),i.pageInfo=Ct(),i.pageInfo&&(i.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth),this.saveTagToDb(i)}}catch(n){this.loggingService.catch("Error in TagService addTag: ",n)}}setLocationToTagAnnotation(t){try{let e=this.docService.getLocation();e?(t.locationId=e.locationId,t.location=e.location):(delete t.locationId,delete t.location);try{let n;t.targetElement?.xpath?n=this.domService.getElementFromXPath(t.targetElement.xpath):t.targetTextRange?.commonAncestorContainer&&(n=this.domService.getElementFromXPath(t.targetTextRange.commonAncestorContainer));let i=this.docService.getAdditionLocationFromElement(n);if(i){let l=this.docService.addLocation({location:i,source:"internal"});l?.[0]&&(t.locationId=l[0].locationId,t.location=l[0].location)}}catch{}}catch(e){this.loggingService.catch("Error in TagService setLocationToTagAnnotation:",e)}}saveTagToDb(t){this.loggingService.log("%c[WB] Calling FUNCTION: saveTagToDb","color: green;");try{this.authService.getUser()&&this.authService.isFeatureAllowed(V.TAG)&&this.docService.getDocumentPaths$().pipe(D(e=>!!e),$(1),C(e=>(this.documentPaths=e,this.loggingService.log(this.documentPaths),this.databaseService.getDb().pipe(D(n=>!!n),$(1),C(n=>{if(this.documentPaths?.tag){t.annotationId=this.commonDbService.generateDocumentId(),t.pageInfo&&(t.pageInfo.tagUrl=this.generateTagUrl(t));let i=JSON.parse(JSON.stringify(t));return i.position=null,this.domService.toggleAnnotationSelection(i),t.targetTextRange&&sessionStorage.setItem(d.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,t.annotationId),this.analyticsService.trackEvent(b.Events.Tag.TAG_DRAFT_ADDED,{annotationId:t.annotationId}),this.commonDbService.setData({feature:"tag",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",id:t.annotationId,skipFirestore:!0},data:i})}else return E(null)}))))).subscribe(()=>{},e=>{this.loggingService.catch("Error in TagService saveTagToDb subscription: ",e)})}catch(e){this.loggingService.catch("Error in TagService saveTagToDb: ",e)}}updateTag(t,e=!1,n){try{n&&this.setLocationToTagAnnotation(t),e&&this.updateNotificationsDatabase(t,ct.UPDATED),this.updateTagToDb(t)}catch(i){this.loggingService.catch("Error in TagService updateTag: ",i)}}resolveTag(t){try{t.resolved=!0,this.domService.resetSelectedAnnotationsMap(!1),this.updateNotificationsDatabase(t,ct.RESOLVED),this.updateTagToDb(t),this.domService.updateSelectedAnnotationInMap([t]),this.analyticsService.trackEvent(b.Events.Tag.TAG_RESOLVED,{annotationId:t.annotationId})}catch(e){this.loggingService.catch("Error in TagService resolveTag: ",e)}}updateTagToDb(t){this.loggingService.log("%c[WB] Calling FUNCTION: updateTagToDb","color: green;");try{if(t?.targetElement?.xpath){let e=this.domService.getXPath(t.targetElement.xpath);if(e){let n=e.iterateNext();n&&(lt(n)||(t.targetElement=null))}}this.domService.updateSelectedAnnotationInMap([t]),this.authService.getUser()&&this.authService.isFeatureAllowed(V.TAG)&&this.docService.getDocumentPaths$().pipe(D(e=>!!e),$(1),C(e=>(this.documentPaths=e,this.loggingService.log(this.documentPaths),this.databaseService.getDb().pipe(D(n=>!!n),$(1),C(n=>{if(this.documentPaths?.tag&&t?.annotationId){let i=JSON.parse(JSON.stringify(t));return i.position=null,this.commonDbService.setData({feature:"tag",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",id:t.annotationId,skipFirestore:!0},data:i})}else return E(null)}))))).subscribe(()=>{},e=>{this.loggingService.catch("Error in TagService updateTagToDb subscription: ",e)})}catch(e){this.loggingService.catch("Error in TagService updateTagToDb: ",e)}}deleteTagPinAnnotations(t){try{let e=this.domService.getSelectedAnnotationsMap(),n=this.authService.getUser(),i=[];Object.keys(e).forEach(l=>ot(this,null,function*(){let s=e[l];s.type==="tag"&&n&&s.from&&(n?.isAdmin||s.from.userId===n.userId)&&i.push(s)})),i?.length&&(this.analyticsService.trackEvent(b.Events.Tag.TAG_DELETE_TRIGGERED,{triggerType:t,annotationId:i.map(l=>l.annotationId).join()}),this.dialog.open(be,{panelClass:"velt-mat-dialog-container",data:{title:"Delete tag?",message:"This selected tag will be deleted.",yesButton:"Delete",noButton:"Cancel",variant:"tag"}}).afterClosed().pipe($(1)).subscribe(l=>{l&&(i.forEach(s=>ot(this,null,function*(){yield this.deleteTagPinAnnotation(s)})),setTimeout(()=>{document.querySelectorAll(`[${d.SNIPPYLY_HIGHLIGHT}]`).forEach(c=>{this.domService.removeHighlightFromElement(c)})},100))})),this.domService.resetSelectedAnnotationsMap(!0,"tag")}catch(e){this.loggingService.catch("Error in TagService deleteTagPinAnnotations: ",e)}}deleteTagPinAnnotation(t){return this.authService.isFeatureAllowed(V.TAG)&&this.documentPaths?.tag&&t?.annotationId?(this.updateNotificationsDatabase(t,ct.DELETED),this.analyticsService.trackEvent(b.Events.Tag.TAG_DELETED,{annotationId:t.annotationId}),this.commonDbService.deleteData({feature:"tag",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",id:t.annotationId,skipFirestore:!0}})):Promise.resolve()}enableAddTagMode(){this.authService.isFeatureAllowed(V.TAG)?(this.analyticsService.trackEvent(b.Events.Tag.TAG_ADD_MODE_ENABLED),this.addTagMode$.next(!0)):this.loggingService.catch("Error in TagService enableAddTagMode: ","Tag feature is not enabled.")}disableAddTagMode(){this.analyticsService.trackEvent(b.Events.Tag.TAG_ADD_MODE_DISABLED),this.addTagMode$.next(!1)}addTagModeChange(){return this.addTagMode$.asObservable()}enableTextTags(t){this.enableTextTags$.next(t)}getEnableTextTags$(){return this.enableTextTags$.asObservable()}get timestamp(){return this.commonDbService.getServerTimestamp()}isElementInsideAllowedElements(t){try{return this.domService.isElementInsideListedElementIds(t,this.allowedElementIds$.value)}catch(e){return this.loggingService.catch("Error in TagService isElementInsideAllowedElements: ",e),!1}}attachTag(t,e=[]){let n=de(t,e);if(n){let i=this.domService.getXPath(n),l=this.getTagPinAnnotationObject();l&&(l.targetElement={xpath:i,topPercentage:50,leftPercentage:90},this.saveTagToDb(l))}}getTagPinAnnotationObject(){let t=this.authService.getUser();if(t)if(t.isReadOnly||t.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add tags.");else{let e=new _t;e.from=t,e.color=d.DEFAULT_ANNOTATION_COLOR,e.resolved=!1,e.lastUpdated=this.timestamp;let{topPositionX:n,topPositionY:i}=this.domService.getTopLeftPosition();e.positionX=n,e.positionY=i;let l=this.domService.getCurrentWindowSizeValue();e.screenWidth=l.screenWidth,e.screenHeight=l.screenHeight,e.screenScrollHeight=l.screenScrollHeight,e.taggedElementPath="";let s=this.docService.getLocation();return s&&(e.locationId=s.locationId,e.location=s.location),e}return null}updateNotificationsDatabase(t,e){try{let n={annotationData:t,actionType:e,notificationSource:"tag"};this.notificationService?.updateNotificationDatabase(n)}catch(n){this.loggingService.catch("Error in TagService updateNotificationsDatabase: ",n)}}getUserContacts$(){return this.contactService.getUserContacts$()}addUserContact(t){this.contactService.addUserContact(t)}getTagUrl(t){try{return t?.pageInfo?.tagUrl?t.pageInfo.tagUrl:(t?.pageInfo||(t.pageInfo=Ct(),t.pageInfo&&(t.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth)),t.pageInfo.tagUrl=this.generateTagUrl(t),this.updateTag(t),t.pageInfo?.tagUrl)}catch(e){this.loggingService.catch("Error in TagService getTagUrl: ",e);return}}uploadFile(t,e){let n=`${d.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${d.FIREBASE_PARTIAL_PATH_TAG}/${e.annotationId}`;return this.documentPaths?.organizationId&&(n=`${d.FIREBASE_PARTIAL_PATH_ORGANIZATIONS}/${this.documentPaths.organizationId}/${d.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${d.FIREBASE_PARTIAL_PATH_TAG}/${e.annotationId}`),this.storageService.uploadFile({path:n,file:t})}downloadAttachment(t){this.storageService.downloadAttachment(t)}deleteAttachment(t){return this.storageService.deleteAttachment({attachment:t})}generateTagUrl(t){let e;try{e=new URL(t?.pageInfo?.url||window.location.href)}catch(n){this.loggingService.catch("Error in TagService generateTagUrl: ",n),e=new URL(window.location.href)}return e.searchParams.delete(d.URL_PARAMS.TAG_ID),e.searchParams.append(d.URL_PARAMS.TAG_ID,t.annotationId),e.href}};r.\u0275fac=function(e){return new(e||r)(f(B),f(ve),f(Se),f(Te),f(U),f(L),f(oe),f(Ae),f(fe),f(Pe),f(we),f(re),f(p),f(ue),f(_e))},r.\u0275prov=rt({token:r,factory:r.\u0275fac,providedIn:"root"});let a=r;return a})();var Fe=["customBtnRef"],He=["*"];function Ve(a,r){a&1&&ft(0)}function Ue(a,r){if(a&1&&O(0,Ve,1,0,"ng-container",5),a&2){h();let o=N(5);u("ngTemplateOutlet",o)}}function je(a,r){a&1&&(_(0,"div",8),W(),_(1,"svg",9),z(2,"circle",10)(3,"path",11),P()())}function Ge(a,r){a&1&&ft(0)}function $e(a,r){if(a&1&&(O(0,je,4,0,"div",6),_(1,"div",7,2),O(3,Ge,1,0,"ng-container",5),P()),a&2){let o=h(),t=N(5);u("ngIf",o.showDefaultBtn),v(3),u("ngTemplateOutlet",t)}}function We(a,r){a&1&&Ht(0)}var pt=(()=>{let r=class r{constructor(t,e,n,i,l){this.analyticsService=t,this.authService=e,this.tagService=n,this.loggingService=i,this.cdr=l,this.showDefaultBtn=!1,this.subscriptions=[],this.veltElement=!0,this.subscriptions.push(this.authService.getUser$().subscribe(s=>{this.user=s},s=>{this.loggingService.catch("Error in TagsToolComponent getUser$ subscription: ",s)}))}ngOnInit(){}ngAfterViewInit(){try{this.customBtnRef?.nativeElement?.children?.length||(this.showDefaultBtn=!0,this.cdr.detectChanges())}catch(t){this.loggingService.catch("Error in TagsToolComponent AfterViewInit: ",t)}}addTag(){this.loggingService.log("%c[WB] Calling FUNCTION: addTag","color: green;");try{this.analyticsService.trackEvent(b.Events.Tag.TAG_TOOL_CLICKED,{toolType:this.customBtnRef?.nativeElement?.children?.length?"custom":"default"}),this.user&&(this.user.isReadOnly||this.user.isAnonymous?this.loggingService.catch("Anonymous/Readonly users cannot add tags."):this.targetTagElementId?this.tagService.attachTag(this.targetTagElementId,["id","data-id"]):this.tagService.enableAddTagMode())}catch(t){this.loggingService.catch("Error in TagsToolComponent addTag: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(t){this.loggingService.catch("Error in TagsToolComponent ondestroy: ",t)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(t=>{t.unsubscribe()}),this.subscriptions=[]}catch(t){this.loggingService.catch("Error in TagsToolComponent unsubscribe: ",t)}}};r.\u0275fac=function(e){return new(e||r)(m(B),m(U),m(w),m(p),m($t))},r.\u0275cmp=k({type:r,selectors:[["snippyly-tags-tool"]],viewQuery:function(e,n){if(e&1&&Z(Fe,5),e&2){let i;tt(i=et())&&(n.customBtnRef=i.first)}},hostVars:1,hostBindings:function(e,n){e&2&&M("data-velt-element",n.veltElement)},inputs:{targetTagElementId:"targetTagElementId"},standalone:!1,ngContentSelectors:He,decls:6,vars:2,consts:[["tagToolBtn",""],["content",""],["customBtnRef",""],[1,"snippyly-tag-btn-container",3,"click"],[3,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","action-btn",4,"ngIf"],[1,"custom-btn-container"],[1,"action-btn"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","bx","https://boxy-svg.com","viewBox","0 0 32 32","width","32","height","32","fill","none",1,"action-btn-icon"],["cx","16","cy","10.751","r","3.751",0,"bx","origin","0.5 1.19976","has-stroke","",2,"stroke-width","2px"],["d","M 10 24.964 L 10 24.251 C 10 20.936 12.687 18.251 16 18.251 C 19.313 18.251 22 20.936 22 24.251 L 22 25","stroke-linecap","round",0,"bx","origin","0.5 -0.333481","has-stroke","",2,"stroke-width","2px"]],template:function(e,n){if(e&1){let i=x();Ft(),_(0,"div",3),A("click",function(s){return T(i),n.addTag(),S(s.stopPropagation())}),O(1,Ue,1,1,"ng-template",4)(2,$e,4,2,"ng-template",null,0,nt),P(),O(4,We,1,0,"ng-template",null,1,nt)}if(e&2){let i=N(3);v(),u("ngIf",n.targetTagElementId)("ngIfElse",i)}},dependencies:[H,zt],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}.snippyly-tag-btn-container[_ngcontent-%COMP%]{display:inline-block}.action-btn[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.action-btn-icon[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:50px;cursor:pointer;transition:.5s!important}.action-btn-icon[_ngcontent-%COMP%] *[has-stroke][_ngcontent-%COMP%]{stroke:#8f95b2!important}.action-btn-icon[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:not([has-stroke]){fill:#8f95b2!important}.action-btn-icon[_ngcontent-%COMP%]:hover{background:#eae8f9}.action-btn-icon[_ngcontent-%COMP%]:active, .action-btn-icon.active[_ngcontent-%COMP%]{background:#625df5}.action-btn-icon[_ngcontent-%COMP%]:active *[has-stroke][_ngcontent-%COMP%], .action-btn-icon.active[_ngcontent-%COMP%] *[has-stroke][_ngcontent-%COMP%]{stroke:#fff!important}.action-btn-icon[_ngcontent-%COMP%]:active *[_ngcontent-%COMP%]:not([has-stroke]), .action-btn-icon.active[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:not([has-stroke]){fill:#fff!important}"],changeDetection:0});let a=r;return a})();function ze(a,r){if(a&1){let o=x();_(0,"div",7),A("click",function(e){return T(o),h(2).copyLink(),S(e.stopPropagation())}),Q(1),R(2,"translate"),P()}if(a&2){let o=h(2);v(),St(" ",F(2,1,o.copyLinkText))}}function Ye(a,r){if(a&1){let o=x();_(0,"div",7),A("click",function(e){T(o);let n=h(2);return n.editMode=!0,S(e.stopPropagation())}),Q(1),R(2,"translate"),P()}a&2&&(v(),Tt(F(2,1,"Reassign")))}function Xe(a,r){if(a&1){let o=x();_(0,"div",7),A("click",function(e){T(o);let n=h(2);return n.editMode=!0,n.resolveTag(),S(e.stopPropagation())}),Q(1),R(2,"translate"),P()}a&2&&(v(),Tt(F(2,1,"Resolve")))}function Ke(a,r){if(a&1){let o=x();_(0,"div",7),A("click",function(e){return T(o),h(2).removeTag(),S(e.stopPropagation())}),Q(1),R(2,"translate"),P()}a&2&&(v(),St(" ",F(2,1,"Remove")))}function Je(a,r){if(a&1&&(_(0,"div",4)(1,"div",5),Q(2),R(3,"translate"),R(4,"translate"),P(),O(5,ze,3,3,"div",6)(6,Ye,3,3,"div",6)(7,Xe,3,3,"div",6)(8,Ke,3,3,"div",6),P()),a&2){let o=h();v(2),Ut("",F(3,6,"Assigned to:")," ",!(o.annotation==null||o.annotation.to[0]==null)&&o.annotation.to[0].name?o.annotation==null||o.annotation.to[0]==null?null:o.annotation.to[0].name:F(4,8,o.annotation==null||o.annotation.to[0]==null?null:o.annotation.to[0].email)),v(3),u("ngIf",o.tagPinSelected),v(),u("ngIf",o.tagPinSelected&&(o.allowedActions==null?null:o.allowedActions.update)),v(),u("ngIf",o.tagPinSelected&&(o.allowedActions==null?null:o.allowedActions.resolve)),v(),u("ngIf",o.tagPinSelected&&(o.allowedActions==null?null:o.allowedActions.remove))}}function Qe(a,r){if(a&1){let o=x();W(),_(0,"svg",11),A("click",function(){T(o);let e=h(2);return S(!(e.annotation==null||e.annotation.to==null)&&e.annotation.to.length?e.editMode=!1:e.removeTag())}),z(1,"path",12)(2,"path",13),P()}}function qe(a,r){if(a&1){let o=x();Lt(0),_(1,"div",8)(2,"velt-autocomplete-panel-internal",9,0),R(4,"translate"),A("optionSelected",function(e){T(o);let n=h();return S(n.saveTag(e))}),P(),O(5,Qe,3,0,"svg",10),P(),Nt()}if(a&2){let o=N(3),t=h();v(2),u("placeholder",F(4,3,"Please select a contact to assign"))("enableOnFocus",!0),v(3),u("ngIf",(t.annotation==null||t.annotation.to==null?null:t.annotation.to.length)||!(!(o==null||o.userContacts==null)&&o.userContacts.length))}}var It=(()=>{let r=class r{get user(){return this._user}set user(t){this._user=t,this.checkToShowActions()}get tagPinSelected(){return this._tagPinSelected}set tagPinSelected(t){this._tagPinSelected=t,this.tagPinSelected&&this.setTagReadInAnalytics()}constructor(t,e,n){this.analyticsService=t,this.tagService=e,this.loggingService=n,this.subscriptions=[],this.editMode=!1,this.copyLinkText="Copy Link",this._user=new ae,this.allowedActions=null,this._tagPinSelected=!1,this.veltElement=!0}ngOnInit(){try{this.checkToShowActions(),this.annotation?.to?.length||(this.editMode=!0)}catch(t){this.loggingService.catch("Error in TagDialogComponent OnInit: ",t)}}ngAfterViewInit(){try{this.setTagReadInAnalytics()}catch(t){this.loggingService.catch("Error in TagDialogComponent view init: ",t)}}trackByUserContact(t,e){return e?.email||t}setTagReadInAnalytics(){try{this.annotation&&this.analyticsService.trackEvent(b.Events.Tag.TAG_READ,{annotationId:this.annotation.annotationId,readType:this.tagPinSelected?"open":"hover"})}catch(t){this.loggingService.catch("Error in CommentDialogComponent setCommentReadInAnalytics: ",t)}}saveTag(t){try{this.analyticsService.trackEvent(b.Events.Tag.TAG_ADDED,{annotationId:this.annotation.annotationId}),this.annotation.to=[t],this.tagService.updateTag(this.annotation,!0),this.editMode=!1}catch(e){this.loggingService.catch("Error in TagDialogComponent saveTag: ",e)}}checkToShowActions(){try{this.user&&this.annotation?this.annotation.from?.userId===this.user.userId?(this.allowedActions||(this.allowedActions={}),this.allowedActions.update=!0,this.allowedActions.remove=!0):!this.annotation?.resolved&&this.annotation?.to?.find(t=>t?.email===this.user?.email)&&(this.allowedActions||(this.allowedActions={}),this.allowedActions.resolve=!0):this.allowedActions=null}catch(t){this.loggingService.catch("Error in TagDialogComponent checkToShowActions: ",t)}}resolveTag(){try{this.tagService.resolveTag(this.annotation),this.editMode=!1}catch(t){this.loggingService.catch("Error in TagDialogComponent resolveTag: ",t)}}removeTag(){try{this.tagService.deleteTagPinAnnotations("deleteOption")}catch(t){this.loggingService.catch("Error in TagDialogComponent removeTag: ",t)}}copyLink(){try{let t=this.copyLinkText;this.copyLinkText="Link Copied!",setTimeout(()=>{this.copyLinkText=t},2e3);let e=this.tagService.getTagUrl(this.annotation);e&&ge(e),this.analyticsService.trackEvent(b.Events.Tag.TAG_LINK_COPIED,{annotationId:this.annotation.annotationId})}catch(t){this.loggingService.catch("Error in TagDialogComponent copyLink: ",t)}}};r.\u0275fac=function(e){return new(e||r)(m(B),m(w),m(p))},r.\u0275cmp=k({type:r,selectors:[["snippyly-tag-dialog"]],hostVars:1,hostBindings:function(e,n){e&2&&M("data-velt-element",n.veltElement)},inputs:{annotation:"annotation",user:"user",tagPinSelected:"tagPinSelected"},standalone:!1,decls:3,vars:5,consts:[["userSelectorRef",""],[1,"tag-dialog-container",3,"pointerdown","pointerup"],["velt-ignore-change-detection","true",4,"ngIf"],[4,"ngIf"],["velt-ignore-change-detection","true"],[1,"tag-user-details"],["class","tag-action-button",3,"click",4,"ngIf"],[1,"tag-action-button",3,"click"],[1,"tag-input-container"],[3,"optionSelected","placeholder","enableOnFocus"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","class","bi bi-x-circle","viewBox","0 0 16 16",3,"click",4,"ngIf"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16",1,"bi","bi-x-circle",3,"click"],["d","M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"],["d","M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"]],template:function(e,n){e&1&&(_(0,"div",1),A("pointerdown",function(l){return l.stopPropagation()})("pointerup",function(l){return l.stopPropagation()}),O(1,Je,9,10,"div",2)(2,qe,6,5,"ng-container",3),P()),e&2&&(st("edit-mode",n.editMode),M("data-velt-annotation-draft",n.editMode?n.annotation==null?null:n.annotation.annotationId:null),v(),u("ngIf",(n.annotation==null||n.annotation.to==null?null:n.annotation.to.length)&&!n.editMode),v(),u("ngIf",n.editMode))},dependencies:[H,ye,Ce],styles:['html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}.tag-dialog-container[_ngcontent-%COMP%]{background-color:#fff;padding-top:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;padding-bottom:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;width:100%;padding-right:calc((.75rem + 0px) * var(--velt-base-rem-unit))!important;padding-left:calc((.75rem + 0px) * var(--velt-base-rem-unit))!important;margin-right:auto!important;margin-left:auto!important;font-size:calc((.875rem + 0px) * var(--velt-base-rem-unit));border-radius:10px!important;box-shadow:0 calc((1rem + 0px) * var(--velt-base-rem-unit)) calc((3rem + 0px) * var(--velt-base-rem-unit)) #0000002d!important;border:1px solid #dee2e6!important;max-height:fit-content!important;max-width:300px;min-width:300px}.tag-dialog-container[_ngcontent-%COMP%]:not(.edit-mode){background-color:#141416!important;padding-left:0!important;padding-right:0!important;max-width:250px;min-width:250px;border:none!important}.tag-dialog-container[_ngcontent-%COMP%]:not(.edit-mode) *[_ngcontent-%COMP%]{color:#fff!important}.tag-dialog-container[_ngcontent-%COMP%]:not(.edit-mode) .tag-user-details[_ngcontent-%COMP%]{margin-bottom:calc((.25rem + 0px) * var(--velt-base-rem-unit))!important;padding-right:calc((.75rem + 0px) * var(--velt-base-rem-unit))!important;padding-left:calc((.75rem + 0px) * var(--velt-base-rem-unit))!important;word-break:break-word}.tag-dialog-container[_ngcontent-%COMP%]:not(.edit-mode) .tag-action-button[_ngcontent-%COMP%]{padding:calc((.25rem + 0px) * var(--velt-base-rem-unit)) calc((.75rem + 0px) * var(--velt-base-rem-unit))!important;cursor:pointer}.tag-dialog-container[_ngcontent-%COMP%]:not(.edit-mode) .tag-action-button[_ngcontent-%COMP%]:hover{background-color:#353537}.tag-dialog-container[_ngcontent-%COMP%] .tag-input-container[_ngcontent-%COMP%]{display:flex}.tag-dialog-container[_ngcontent-%COMP%] .tag-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%!important;border:0!important} .snippyly-tag-autocomplete-panel{box-shadow:0 calc((.3rem + 0px) * var(--velt-base-rem-unit)) calc((1.5rem + 0px) * var(--velt-base-rem-unit)) #0000002e!important} .snippyly-tag-autocomplete-panel::-webkit-scrollbar{display:none!important;width:0!important;height:0!important} .snippyly-tag-autocomplete-panel::-webkit-scrollbar{width:0;height:0} .snippyly-tag-autocomplete-panel::-webkit-scrollbar-button{width:0;height:0} .snippyly-tag-autocomplete-panel .user-selection-container{background:#fff;border-radius:8px;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) 0!important} .snippyly-tag-autocomplete-panel .user-selection-container .mat-mdc-option{padding:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important} .snippyly-tag-autocomplete-panel .user-selection-container .mat-mdc-option.mat-mdc-option-active{background-color:#f2f2f2!important}.contact-container[_ngcontent-%COMP%]{display:flex;align-items:center}.photo-container[_ngcontent-%COMP%]{min-width:calc((2.5rem + 0px) * var(--velt-base-rem-unit));width:calc((2.5rem + 0px) * var(--velt-base-rem-unit));min-height:calc((2.5rem + 0px) * var(--velt-base-rem-unit));height:calc((2.5rem + 0px) * var(--velt-base-rem-unit));box-sizing:border-box;background-clip:padding-box;border:solid 2px transparent;display:flex;align-items:center;justify-content:center;position:relative;margin-right:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}.photo-container-small[_ngcontent-%COMP%]{width:calc((2rem + 0px) * var(--velt-base-rem-unit));height:calc((2rem + 0px) * var(--velt-base-rem-unit));min-width:calc((2rem + 0px) * var(--velt-base-rem-unit));min-height:calc((2rem + 0px) * var(--velt-base-rem-unit));margin-right:calc((.8rem + 0px) * var(--velt-base-rem-unit))!important}.photo-container[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;z-index:1;border-radius:inherit;background:inherit}.photo-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:50%;z-index:2;object-fit:cover}.contact-details[_ngcontent-%COMP%]{overflow:hidden}.contact-details[_ngcontent-%COMP%] .contact-name[_ngcontent-%COMP%], .contact-details[_ngcontent-%COMP%] .contact-email[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;line-height:calc((1rem + 0px) * var(--velt-base-rem-unit));font-size:calc((.875rem + 0px) * var(--velt-base-rem-unit))!important}.contact-details[_ngcontent-%COMP%] .contact-email[_ngcontent-%COMP%]{color:#6c757d!important}.photo-placeholder[_ngcontent-%COMP%]{z-index:2;opacity:.8}.tag-buttons-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;padding-top:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;background:#fff}.tag-button[_ngcontent-%COMP%]{background-color:#625df5;color:#fff!important;border:0;border-radius:4px;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;margin-right:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;cursor:pointer!important}.tag-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#fff!important}.tag-button.green[_ngcontent-%COMP%]{background-color:#0dcf82!important}.tag-button[_ngcontent-%COMP%]:hover{background-color:#44aeff!important;color:#fff!important}.tag-button[_ngcontent-%COMP%]:hover.green{background-color:#10b372!important}.tag-button[disabled][_ngcontent-%COMP%], .tag-button[disabled][_ngcontent-%COMP%]:hover{background-color:#0000001a!important;color:#0006!important}.cancel-button[_ngcontent-%COMP%]{border:0;border-radius:4px;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;margin-right:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;cursor:pointer!important}.cancel-button[_ngcontent-%COMP%]:hover{color:#e91e63}.no-contacts-message[_ngcontent-%COMP%]{text-align:center!important} .tag-input-container velt-autocomplete-panel-internal{width:100%!important} .tag-input-container velt-autocomplete-panel-internal input{width:100%!important;border:0!important}'],changeDetection:0});let a=r;return a})();var tn=["overlay"],en=["pin"],nn=(a,r)=>({"tag-pin-selected":a,"mutiple-pins-selected":r}),on=()=>["snippyly-overlay-panel","snippyly-tag-dialog-overlay-panel","velt-overlay-panel"];function rn(a,r){a&1&&(W(),z(0,"path",8))}function an(a,r){if(a&1){let o=x();_(0,"snippyly-user-avatar",9),A("pointerover",function(e){return T(o),h().onPointerOver(e),S(e.stopPropagation())})("pointerout",function(){T(o);let e=h();return S(e.onPointerOut())}),P()}if(a&2){let o=h();u("user",o.tagPinAnnotation==null?null:o.tagPinAnnotation.to[0])("background","rgb(162, 89, 254) !important")("size",26)}}function sn(a,r){if(a&1){let o=x();_(0,"snippyly-tag-dialog",10),A("saveTag",function(e){T(o);let n=h();return S(n.saveTag.emit(e))}),P()}if(a&2){let o=h();u("annotation",o.tagPinAnnotation)("user",o.user)("tagPinSelected",o.tagPinSelected)}}var At=(()=>{let r=class r{get tagPinAnnotation(){return this._tagPinAnnotation}set tagPinAnnotation(t){this._tagPinAnnotation=t}get tagPinSelected(){return this._tagPinSelected}set tagPinSelected(t){this._tagPinSelected=t,this.updateHighlightOnElement()}get tagPinHover(){return this._tagPinHover}set tagPinHover(t){this._tagPinHover=t,this.updateHighlightOnElement()}constructor(t,e,n){this.tagService=t,this.domService=e,this.loggingService=n,this._tagPinSelected=!1,this.multipleTagPinsSelected=!1,this.avatarErrorImage="",this.deleteTagThread=new at,this.saveTag=new at,this.signInToAccessFeature=new at,this.overlayOriginX="start",this.overlayOriginY="top",this._tagPinHover=!1,this.subscriptions=[],this.positions=d.OVERLAY_POSITIONS.map(i=>new Zt({originX:i.originX,originY:i.originY},{overlayX:i.overlayX,overlayY:i.overlayY})),this.veltElement=!0,this.loggingService.log("%c[WB] Creating COMPONENT TagPinComponent","color: blue;")}ngOnInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;")}ngAfterViewInit(){try{this.updateHighlightOnElement(),this.subscriptions.push(this.overlay.positionChange.subscribe(t=>{this.overlayOriginX=t.connectionPair.originX,this.overlayOriginY=t.connectionPair.originY},t=>{this.loggingService.catch("Error in TagPinComponent positionChange subscription: ",t)}))}catch(t){this.loggingService.catch("Error in TagPinComponent AfterViewInit: ",t)}}updateHighlightOnElement(){try{this.targetElement&&(this.tagPinSelected||this.tagPinHover?this.domService.highlightElement(this.targetElement):this.domService.removeHighlightFromElement(this.targetElement))}catch(t){this.loggingService.catch("Error in TagPinComponent updateHighlightOnElement: ",t)}}onPointerOver(t){try{t.buttons?this.tagPinHover&&(this.tagPinHover=!1):this.tagPinHover||(this.tagPinHover=!0)}catch(e){this.loggingService.catch("Error in TagPinComponent onPointerOver: ",e)}}onPointerOut(){this.tagPinHover=!1}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(t){this.loggingService.catch("Error in TagPinComponent ondestroy: ",t)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(t=>{t.unsubscribe()}),this.subscriptions=[]}catch(t){this.loggingService.catch("Error in TagPinComponent unsubscribe: ",t)}}};r.\u0275fac=function(e){return new(e||r)(m(w),m(L),m(p))},r.\u0275cmp=k({type:r,selectors:[["snippyly-tag-pin"]],viewQuery:function(e,n){if(e&1&&(Z(tn,5),Z(en,5)),e&2){let i;tt(i=et())&&(n.overlay=i.first),tt(i=et())&&(n.pin=i.first)}},hostVars:1,hostBindings:function(e,n){e&2&&M("data-velt-element",n.veltElement)},inputs:{tagPinAnnotation:"tagPinAnnotation",tagPinSelected:"tagPinSelected",multipleTagPinsSelected:"multipleTagPinsSelected",avatarErrorImage:"avatarErrorImage",user:"user",targetElement:"targetElement"},outputs:{deleteTagThread:"deleteTagThread",saveTag:"saveTag",signInToAccessFeature:"signInToAccessFeature"},standalone:!1,decls:8,vars:15,consts:[["trigger","cdkOverlayOrigin"],["overlay","cdkConnectedOverlay"],["cdkOverlayOrigin","",1,"tag-pin-container",3,"click","ngClass"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 100 100",1,"tag-pin"],["cx","50","cy","50","rx","50","ry","50",2,"stroke","rgb(0, 0, 0)","fill","rgb(162, 89, 254)","paint-order","fill","stroke-width","0px"],["d","M 24.999 77 C 24.999 77 20 77 20 72.001 C 20 66.999 24.999 51.999 50 51.999 C 75.001 51.999 80 66.999 80 72.001 C 80 77 75.001 77 75.001 77 L 24.999 77 Z M 50 47 C 61.548 47 68.764 34.5 62.991 24.499 C 60.312 19.857 55.359 17 50 17 C 38.452 17 31.236 29.5 37.009 39.499 C 39.688 44.14 44.641 47 50 47 Z","style","fill: rgb(255, 255, 255);",4,"ngIf"],["class","photo-container tag-user-avatar",3,"user","background","size","pointerover","pointerout",4,"ngIf"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPanelClass","cdkConnectedOverlayOffsetY","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayLockPosition","cdkConnectedOverlayPositions","cdkConnectedOverlayGrowAfterOpen"],["d","M 24.999 77 C 24.999 77 20 77 20 72.001 C 20 66.999 24.999 51.999 50 51.999 C 75.001 51.999 80 66.999 80 72.001 C 80 77 75.001 77 75.001 77 L 24.999 77 Z M 50 47 C 61.548 47 68.764 34.5 62.991 24.499 C 60.312 19.857 55.359 17 50 17 C 38.452 17 31.236 29.5 37.009 39.499 C 39.688 44.14 44.641 47 50 47 Z",2,"fill","rgb(255, 255, 255)"],[1,"photo-container","tag-user-avatar",3,"pointerover","pointerout","user","background","size"],[3,"saveTag","annotation","user","tagPinSelected"]],template:function(e,n){if(e&1){let i=x();_(0,"div",2,0),A("click",function(s){return T(i),S(s.preventDefault())}),W(),_(2,"svg",3),z(3,"ellipse",4),O(4,rn,1,0,"path",5),P(),O(5,an,1,3,"snippyly-user-avatar",6),P(),O(6,sn,1,3,"ng-template",7,1,nt)}if(e&2){let i=N(1);u("ngClass",Gt(11,nn,n.tagPinSelected,n.multipleTagPinsSelected)),v(4),u("ngIf",!(!(n.tagPinAnnotation==null||n.tagPinAnnotation.to==null)&&n.tagPinAnnotation.to.length&&(!(n.tagPinAnnotation==null||n.tagPinAnnotation.to[0]==null)&&n.tagPinAnnotation.to[0].photoUrl))),v(),u("ngIf",n.tagPinAnnotation==null||n.tagPinAnnotation.to==null?null:n.tagPinAnnotation.to.length),v(),u("cdkConnectedOverlayOrigin",i)("cdkConnectedOverlayOpen",n.tagPinSelected||n.tagPinHover)("cdkConnectedOverlayPanelClass",jt(14,on))("cdkConnectedOverlayOffsetY",n.overlayOriginY==="top"?-8:2)("cdkConnectedOverlayBackdropClass","snippyly-overlay-backdrop")("cdkConnectedOverlayLockPosition",!1)("cdkConnectedOverlayPositions",n.positions)("cdkConnectedOverlayGrowAfterOpen",!0)}},dependencies:[Wt,H,ee,te,Ee,It],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}.tag-pin-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;text-align:center;color:#fff;font-size:calc((.8rem + 0px) * var(--velt-base-rem-unit));font-weight:500;cursor:pointer}.tag-pin[_ngcontent-%COMP%]{position:absolute;left:0;top:0;width:32px;height:32px;transition:left .12s ease-in-out,top .12s ease-in-out,width .12s ease-in-out,height .12s ease-in-out,transform .12s ease-in-out}.tag-pin-container[_ngcontent-%COMP%]:hover{filter:brightness(110%) saturate(110%)}.tag-pin-container[_ngcontent-%COMP%]:hover .tag-pin[_ngcontent-%COMP%], .tag-pin-selected[_ngcontent-%COMP%] .tag-pin[_ngcontent-%COMP%], .tag-pin-container[_ngcontent-%COMP%]:hover .photo-container[_ngcontent-%COMP%], .tag-pin-selected[_ngcontent-%COMP%] .photo-container[_ngcontent-%COMP%]{transform:scale(1.2) translateY(-4px);transition:left .12s ease-in-out,top .12s ease-in-out,width .12s ease-in-out,height .12s ease-in-out,transform .12s ease-in-out}.tag-index[_ngcontent-%COMP%]{position:absolute;border-radius:50%;border:1px solid #fff;width:20px;height:20px;text-align:center;top:-8px;right:-8px;font-size:calc((.8rem + 0px) * var(--velt-base-rem-unit));color:#000;background:#fff}.tag-pin-selected[_ngcontent-%COMP%]{filter:brightness(110%) saturate(110%)}.tag-resolved[_ngcontent-%COMP%]{background-color:#0dcf82!important}.bi-check-lg[_ngcontent-%COMP%]{color:#fff}.mutiple-pins-selected[_ngcontent-%COMP%]{border-color:#9746ff!important}.photo-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;position:absolute;width:32px;height:32px;box-sizing:border-box;background-clip:padding-box;border-radius:50%;padding:calc((.2rem + 0px) * var(--velt-base-rem-unit))!important;transition:top .12s ease-in-out,width .12s ease-in-out,height .12s ease-in-out,transform .12s ease-in-out;text-transform:capitalize}.photo-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:50%;object-fit:cover}.photo-placeholder[_ngcontent-%COMP%]{z-index:2;opacity:.8} snippyly-user-avatar.tag-user-avatar{background-color:#a259fe!important} snippyly-user-avatar.tag-user-avatar .s-user-avatar-initial{font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))!important} .snippyly-tag-dialog-overlay-panel{z-index:2147483567!important}"],changeDetection:0});let a=r;return a})();function ln(a,r){if(a&1){let o=x();_(0,"div",1),A("pointerup",function(e){return T(o),h().togglePinSelection(),S(e.stopPropagation())})("pointerdown",function(e){return T(o),S(e.stopPropagation())})("click",function(e){return T(o),S(e.stopPropagation())})("cdkDragStarted",function(){T(o);let e=h();return S(e.onPinDragStart())})("cdkDragMoved",function(e){T(o);let n=h();return S(n.onPinMove(e))})("cdkDragReleased",function(){T(o);let e=h();return S(e.onPinRelease())}),_(1,"snippyly-tag-pin",2),A("saveTag",function(e){T(o);let n=h();return S(n.saveTag(e))}),P()()}if(a&2){let o=h();Vt("top",o.annotationDraging?(o.dragPosition==null?null:o.dragPosition.top)-16:(o.tagPinAnnotation==null||o.tagPinAnnotation.position==null?null:o.tagPinAnnotation.position.top)-16+o.offsetTop,"px")("left",o.annotationDraging?(o.dragPosition==null?null:o.dragPosition.left)-16:(o.tagPinAnnotation==null||o.tagPinAnnotation.position==null?null:o.tagPinAnnotation.position.left)-16+o.offsetLeft,"px"),st("pin-dragging",o.annotationDraging),u("id","tag-pin-contianer-"+(o.tagPinAnnotation==null?null:o.tagPinAnnotation.annotationId))("cdkDragDisabled",(o.tagPinAnnotation==null||o.tagPinAnnotation.from==null?null:o.tagPinAnnotation.from.userId)!==(o.user==null?null:o.user.userId)),v(),u("tagPinAnnotation",o.tagPinAnnotation)("tagPinSelected",o.selectedAnnotationsMap[o.tagPinAnnotation==null?null:o.tagPinAnnotation.annotationId]&&!o.annotationDraging&&o.objectKeys(o.selectedAnnotationsMap).length===1)("multipleTagPinSelected",o.selectedAnnotationsMap[o.tagPinAnnotation==null?null:o.tagPinAnnotation.annotationId]&&o.objectKeys(o.selectedAnnotationsMap).length>1)("targetElement",o.targetElement)("user",o.user)}}var Ot=(()=>{let r=class r{get tagPinAnnotation(){return this._tagPinAnnotation}set tagPinAnnotation(t){this._tagPinAnnotation=t,this.id=t.annotationId}constructor(t,e,n,i,l){this.analyticsService=t,this.authService=e,this.domService=n,this.tagService=i,this.loggingService=l,this.multipleTagPinsSelected=!1,this.avatarErrorImage="",this.offsetLeft=0,this.offsetTop=0,this.objectKeys=Object.keys,this.selectedAnnotationsMap={},this.subscriptions=[],this.annotationDraging=!1,this.dragPosition=null,this.veltElement=!0,this.subscriptions.push(this.authService.getUser$().subscribe(s=>{this.user=s},s=>{this.loggingService.catch("Error in TagPinPortalComponent getUser$ subscription: ",s)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(s=>{this.selectedAnnotationsMap=s},s=>{this.loggingService.catch("Error in TagPinPortalComponent getSelectedAnnotationsMap$ subscription: ",s)}))}ngOnInit(){}togglePinSelection(){try{this.domService.toggleAnnotationSelection(this.tagPinAnnotation)}catch(t){this.loggingService.catch("Error in TagPinPortalComponent togglePinSelection: ",t)}}onPinDragStart(){this.selectedAnnotationsMap[this.tagPinAnnotation.annotationId]&&this.domService.toggleAnnotationSelection(this.tagPinAnnotation);let t=document.getElementById(this.tagPinAnnotation.annotationId);t&&(this.parentElement=t.parentElement,document.body.appendChild(t)),this.annotationDraging=!0}onPinMove(t){try{this.updateCurrentPinPosition(t)}catch(e){this.loggingService.catch("Error in TagPinPortalComponent onPinMove: ",e)}}updateCurrentPinPosition(t){try{this.domService.removeHighlightFromElement(this.targetElement);let e=t.event,n=e?.touches?.length?e.touches[0]?.clientX:e.clientX,i=e?.touches?.length?e.touches[0]?.clientY:e.clientY,l=this.domService.getBackgroundElement(n,i);l&&(this.targetElement=l,this.domService.highlightElement(this.targetElement),this.pointerMoveEvent=t.event,this.dragPosition={top:i,left:n})}catch(e){this.loggingService.catch("Error in TagPinPortalComponent updateCurrentPinPosition: ",e)}}onPinRelease(){try{let t=document.getElementById(this.tagPinAnnotation.annotationId);t&&this.parentElement&&this.parentElement.appendChild(t);let e=this.domService.getElementFromXPath(this.tagPinAnnotation.targetElement?.xpath);this.pointerMoveEvent&&(this.tagPinAnnotation.targetElement=this.domService.getTargetElementForCursorPosition(this.pointerMoveEvent));let n=this.domService.getElementFromXPath(this.tagPinAnnotation.targetElement?.xpath),i=this.domService.isElementInsideAdditionalLocationContainer(e)||this.domService.isElementInsideAdditionalLocationContainer(n);this.tagService.updateTag(this.tagPinAnnotation,!1,i),setTimeout(()=>{this.annotationDraging=!1,this.dragPosition=null,this.domService.removeHighlightFromElement(this.targetElement)},100),this.analyticsService.trackEvent(b.Events.Tag.TAG_DRAGGED,{annotationId:this.tagPinAnnotation.annotationId})}catch(t){this.loggingService.catch("Error in TagPinPortalComponent onPinRelease: ",t)}}saveTag(t){}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(t){this.loggingService.catch("Error in TagPinPortalComponent ondestroy: ",t)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(t=>{t.unsubscribe()}),this.subscriptions=[]}catch(t){this.loggingService.catch("Error in TagPinPortalComponent unsubscribe: ",t)}}};r.\u0275fac=function(e){return new(e||r)(m(B),m(U),m(L),m(w),m(p))},r.\u0275cmp=k({type:r,selectors:[["snippyly-tag-pin-portal"]],hostVars:2,hostBindings:function(e,n){e&2&&(Rt("id",n.id),M("data-velt-element",n.veltElement))},inputs:{tagPinAnnotation:"tagPinAnnotation",multipleTagPinsSelected:"multipleTagPinsSelected",avatarErrorImage:"avatarErrorImage",user:"user",offsetLeft:"offsetLeft",offsetTop:"offsetTop",targetElement:"targetElement"},standalone:!1,decls:1,vars:1,consts:[["class","tag-pin-portal","cdkDrag","","cdkDragHandle","",3,"id","pin-dragging","top","left","cdkDragDisabled","pointerup","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased",4,"ngIf"],["cdkDrag","","cdkDragHandle","",1,"tag-pin-portal",3,"pointerup","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased","id","cdkDragDisabled"],[3,"saveTag","tagPinAnnotation","tagPinSelected","multipleTagPinSelected","targetElement","user"]],template:function(e,n){e&1&&O(0,ln,2,13,"div",0),e&2&&u("ngIf",n.tagPinAnnotation==null?null:n.tagPinAnnotation.position)},dependencies:[H,Kt,Xt,At],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{position:absolute!important;top:0!important;left:0!important;box-sizing:border-box!important;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset!important;width:unset!important;text-align:left!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}.tag-pin-portal[_ngcontent-%COMP%]{position:absolute;transform:none!important;transform-origin:0 0!important;transform-box:fill-box!important;top:0;left:0}.tag-pin-portal.pin-dragging[_ngcontent-%COMP%]{position:fixed;z-index:2147483557!important}"],changeDetection:0});let a=r;return a})();var xe=(()=>{let r=class r{constructor(t,e,n,i,l){this.domService=t,this.componentFactoryResolver=e,this.injector=n,this.appRef=i,this.loggingService=l,this.tagsPinById={}}setTagPin(t){try{if(!this.tagsPinById[t.annotationId])this.setPinPortal(t);else if(t.targetElement?.xpath===this.tagsPinById[t.annotationId]?.annotation?.targetElement?.xpath){let e=this.tagsPinById[t.annotationId].portalRef,n=this.tagsPinById[t.annotationId].userTargetElement,i=this.tagsPinById[t.annotationId].pinHostElement;if(document.body.contains(n)&&document.body.contains(i))e&&(e.instance.tagPinAnnotation=JSON.parse(JSON.stringify(t)),this.updateElementOffset(t));else{let l=this.tagsPinById[t.annotationId].pinHostDomPortalOutlet;l&&(this.tagsPinById[t.annotationId].pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST),this.tagsPinById[t.annotationId].pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC),l.detach(),delete this.tagsPinById[t.annotationId],this.setPinPortal(t))}}else{let e=this.tagsPinById[t.annotationId].pinHostDomPortalOutlet;e&&(this.tagsPinById[t.annotationId].pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST),this.tagsPinById[t.annotationId].pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC),e.detach(),delete this.tagsPinById[t.annotationId],this.setPinPortal(t))}}catch(e){this.loggingService.catch("Error in TagPinPortalService setTagPin: ",e)}}setPinPortal(t){try{let e=this.domService.getXPath(t.targetElement?.xpath);if(e){let n=e.iterateNext();if(n){let i=this.domService.getHostElement(n),l=new Qt(Ot),s=new qt(i,this.appRef,this.injector),c=s.attach(l);c.instance.tagPinAnnotation=JSON.parse(JSON.stringify(t)),c.instance.targetElement=n,this.tagsPinById[t.annotationId]={pinHostDomPortalOutlet:s,pinPortal:l,portalRef:c,annotation:JSON.parse(JSON.stringify(t)),userTargetElement:n,pinHostElement:i},i.setAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST,t.annotationId),window.getComputedStyle(i).position==="static"&&(me(i)||i.setAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC,"true")),this.updateElementOffset(t)}}}catch(e){this.loggingService.catch("Error in TagPinPortalService setPinPortal: ",e)}}updateElementOffset(t){try{let{portalRef:e,userTargetElement:n,pinHostElement:i}=this.tagsPinById[t.annotationId],l=this.domService.getElementOffset(n,i);e.instance.offsetLeft=l.offsetLeft,e.instance.offsetTop=l.offsetTop}catch(e){this.loggingService.catch("Error in TagPinPortalService updateElementOffset: ",e)}}checkPinsToRemove(t){try{let e=t.map(n=>n.annotationId);Object.keys(this.tagsPinById).forEach(n=>{if(!e.includes(n)){let i=this.tagsPinById[n];i.pinHostDomPortalOutlet.detach(),i.pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST),i.pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC),this.domService.removeHighlightFromElement(i.pinHostElement),delete this.tagsPinById[n]}})}catch(e){this.loggingService.catch("Error in TagPinPortalService checkPinsToRemove: ",e)}}};r.\u0275fac=function(e){return new(e||r)(f(L),f(Dt),f(xt),f(Bt),f(p))},r.\u0275prov=rt({token:r,factory:r.\u0275fac,providedIn:"root"});let a=r;return a})();var mt=(()=>{let r=class r{get pinHighlighterClass(){return this._pinHighlighterClass}set pinHighlighterClass(t){this._pinHighlighterClass=t,this.domService.setPinHighlighterClass(t)}constructor(t,e,n,i,l,s){this.analyticsService=t,this.authService=e,this.domService=n,this.tagService=i,this.tagPinPortalService=l,this.loggingService=s,this._pinHighlighterClass=null,this.tagPinAnnotations=[],this.subscriptions=[],this.isFirstComponent=!0,this.selectedAnnotationsMap={},this.tagAnnotationFocused=!1,this.veltId=ce(),this.veltElement=!0;try{this.loggingService.log("%c[WB] Creating CLASS: TagsContainerComponent","color: blue;");let c=new URL(window.location.href);this.focusTagAnnotationId=c.searchParams.get(d.URL_PARAMS.TAG_ID)}catch(c){this.loggingService.catch("Error in TagsContainerComponent constructor: ",c)}}ngOnInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;")}ngAfterViewInit(){try{let t=document.querySelector(d.TAGS.SNIPPYLY_TAGS),e=document.querySelector(d.TAGS.VELT_TAGS);e?this.veltId===e?.getAttribute(d.ATTRIBUTES.VELT_ID)&&(this.isFirstComponent=!0,this.initComponent()):this.veltId===t?.getAttribute(d.ATTRIBUTES.VELT_ID)&&(this.isFirstComponent=!0,this.initComponent())}catch(t){this.loggingService.catch("Error in TagsContainerComponent AfterViewInit: ",t)}}initComponent(){try{this.subscriptions.push(this.authService.getUser$().pipe(D(t=>!!t)).subscribe(t=>{t&&this.setTagInstalledInAnalytics()},t=>{this.loggingService.catch("Error in getUser: ",t)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(t=>{this.selectedAnnotationsMap=t},t=>{this.loggingService.catch("Error in TagsContainerComponent getSidebarVisibility$ subscription: ",t)})),this.getAllTagsOnCurrentDocument()}catch(t){this.loggingService.catch("Error in TagsContainerComponent initComponent: ",t)}}getAllTagsOnCurrentDocument(){this.loggingService.log("%c[WB] Calling FUNCTION: getAllTagsOnCurrentDocument","color: green;");try{this.subscriptions.push(this.tagService.getAllTagAnnotations().pipe(D(t=>!!t),C(t=>this.domService.getSelectedAnnotationsMap$().pipe(I(e=>({annotations:t,selectedAnnotationsMap:e||{}}))))).subscribe(t=>{try{this.loggingService.log(t),this.tagPinAnnotations=t?.annotations;let e=this.tagPinAnnotations.filter(n=>n.targetElement);e=e.filter(n=>!(n.resolved&&!t.selectedAnnotationsMap[n.annotationId])),this.tagPinPortalService.checkPinsToRemove(e),e.forEach(n=>{this.tagPinPortalService.setTagPin(n)}),this.focusTagAnnotation()}catch(e){this.loggingService.catch("Error in TagsContainerComponent getAllTagsOnCurrentDocument inside subscription: ",e)}},t=>{this.loggingService.catch("Error in TagsContainerComponent getAllTagsOnCurrentDocument subscription: ",t)}))}catch(t){this.loggingService.catch("Error in TagsContainerComponent getAllTagsOnCurrentDocument: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(t){this.loggingService.catch("Error in TagsContainerComponent ondestroy: ",t)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(t=>{t.unsubscribe()}),this.subscriptions=[]}catch(t){this.loggingService.catch("Error in TagsContainerComponent unsubscribe: ",t)}}focusTagAnnotation(){if(this.focusTagAnnotationId&&!this.tagAnnotationFocused){let t=this.tagPinAnnotations.find(e=>e.annotationId===this.focusTagAnnotationId);t&&(this.tagAnnotationFocused=!0,this.selectedAnnotationsMap[t.annotationId]||this.domService.toggleAnnotationSelection(t),setTimeout(()=>{let e=null;t.targetElement?e=document.getElementById(`tag-pin-contianer-${t.annotationId}`):e=document.querySelector(`[data-velt-id='${t.annotationId}']`),e&&e.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})},100))}}setTagInstalledInAnalytics(){try{this.analyticsService.setInstalledFeature(V.TAG)}catch(t){this.loggingService.catch("Error in TagsContainerComponent setTagInstalledInAnalytics: ",t)}}};r.\u0275fac=function(e){return new(e||r)(m(B),m(U),m(L),m(w),m(xe),m(p))},r.\u0275cmp=k({type:r,selectors:[["app-tags-container"]],hostVars:2,hostBindings:function(e,n){e&2&&M("data-velt-id",n.veltId)("data-velt-element",n.veltElement)},inputs:{pinHighlighterClass:"pinHighlighterClass"},standalone:!1,decls:0,vars:0,template:function(e,n){},encapsulation:2,changeDetection:0});let a=r;return a})();var ht=class extends Oe{constructor(r){super(r),this.getService(p).log("%c[WB] Creating CLASS: TagElement","color: blue;"),this.getAllTagAnnotations=this._getAllTagAnnotations,this.deleteTag=this._deleteTag,this.allowedElementIds=this._allowedElementIds,this.attachTag=this._attachTag,this.addTagModeChange=this._addTagModeChange}_getAllTagAnnotations(r,o){this.getService(p).log("%c[WB] Calling FUNCTION: getOnlineUsers","color: green;");try{return this.trackEvent(b.Events.Tag.GET_ALL_TAG_ANNOTATIONS_TRIGGERED,{payload:{documentId:r,location:o}}),this.getService(w).getAllTagAnnotations(r,o)}catch(t){return this.getService(p).catch("Error in _getLiveTagsOnCurrentDocument: ",t),E(null)}}_deleteTag(){this.getService(p).log("%c[WB] Calling FUNCTION: deleteTag","color: green;");try{this.trackEvent(b.Events.Tag.DELETE_TAG_TRIGGERED),this.getService(w).deleteTagPinAnnotations("tagElement")}catch(r){this.getService(p).catch("Error in _deleteTag: ",r)}}_allowedElementIds(r){this.getService(p).log("%c[WB] Calling FUNCTION: allowedElementIds","color: green;");try{this.trackEvent(b.Events.Tag.ALLOWED_ELEMENT_IDS_TRIGGERED,{payload:{elementIds:r}}),this.getService(w).setAllowedElementIds(r)}catch(o){this.getService(p).catch("Error in allowedElementIds: ",o)}}_attachTag(r){this.getService(p).log("%c[WB] Calling FUNCTION: attachTag","color: green;");try{this.trackEvent(b.Events.Tag.ATTACH_TAG_TRIGGERED,{payload:{elementId:r}}),this.getService(w).attachTag(r,["id","data-id"])}catch(o){this.getService(p).catch("Error in _attachTag: ",o)}}_addTagModeChange(){this.getService(p).log("%c[WB] Calling FUNCTION: addTagModeChange","color: green;");try{return this.trackEvent(b.Events.Tag.ADD_TAG_MODE_CHANGE_TRIGGERED),this.getService(w).addTagModeChange()}catch(r){return this.getService(p).catch("Error in _addTagModeChange: ",r),E(!1)}}};var De=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=kt({type:r}),r.\u0275inj=wt({imports:[Yt,ne,Jt,Ie]});let a=r;return a})();function dn(a){a.get(p).log("%c[WB] Loading tag feature chunk","color: blue;");let t=Mt(De,a).injector;return ut(t,d.TAGS.VELT_TAG_TOOL,pt),ut(t,d.TAGS.SNIPPYLY_TAG_TOOL,pt),ut(t,d.TAGS.VELT_TAGS,mt),ut(t,d.TAGS.SNIPPYLY_TAGS,mt),new ht(a)}function ut(a,r,o){if(customElements.get(r))return;let t=ie(o,{injector:a});customElements.define(r,t)}export{dn as default};
1
+ import{a as we}from"./chunk-HLPJRWIY.js";import"./chunk-TMYAQS7C.js";import{b as Xt,c as Kt,d as Jt}from"./chunk-6OW5GJ3E.js";import{b as ye,t as Ie}from"./chunk-5EO5WTC7.js";import"./chunk-ELEMLDFM.js";import"./chunk-6K2VWE4K.js";import"./chunk-APPJN3VX.js";import"./chunk-EYPJC34Q.js";import"./chunk-XYR7TNZL.js";import{b as be}from"./chunk-NLVNX52N.js";import{b as Ce,d as Ee}from"./chunk-S4APJ64C.js";import{a as Oe}from"./chunk-54BT4NQJ.js";import{a as Ae}from"./chunk-62RN7JJN.js";import{a as ie}from"./chunk-POME7PZR.js";import{A as Zt,G as te,H as ee,I as ne,Y as re,ca as Pe,r as Qt,t as qt}from"./chunk-K5BJ5DAO.js";import{$ as rt,Ab as Ft,Af as Pt,Bb as Ht,Bg as de,Db as Z,Dd as oe,De as d,E as D,Eb as tt,Ec as Wt,Fa as v,Fb as et,Ga as at,Gc as H,Hi as _e,Ib as N,J as $,Jb as Vt,Kb as st,Lc as zt,Ma as Dt,Mf as se,Nb as Q,Nf as ce,Ob as Tt,Pa as m,Pb as St,Pc as Yt,Qb as Ut,Qf as le,T as C,Ta as Mt,Ua as k,Va as kt,Ye as ae,Yg as pe,Zg as me,_a as O,_f as lt,a as G,aa as wt,ac as jt,ai as ue,b as K,bb as Bt,bi as B,ca as f,cc as Gt,ci as p,db as M,di as ve,fe as ct,g as ot,ha as T,hi as fe,ia as S,ig as Ct,ja as W,kc as R,kg as bt,ki as L,l as J,la as xt,lb as u,lc as F,li as U,mb as _,nb as P,ne as V,ob as z,pc as nt,pf as _t,pg as ge,r as E,sb as Lt,si as Te,tb as Nt,ub as ft,uh as b,v as I,vb as x,wb as Rt,xb as A,xc as $t,xh as he,xi as Se,zb as h}from"./chunk-O4F37U67.js";var w=(()=>{let r=class r{constructor(t,e,n,i,l,s,c,y,X,Me,ke,Be,Le,Ne,Re){this.analyticsService=t,this.configService=e,this.docService=n,this.databaseService=i,this.authService=l,this.domService=s,this.afAuth=c,this.iamService=y,this.avatarService=X,this.contactService=Me,this.storageService=ke,this.dialog=Be,this.loggingService=Le,this.serviceBook=Ne,this.commonDbService=Re,this.tagAnnotations$=new J({}),this.tagAnnotationsByDocumentId$=new J({}),this.documentPaths=null,this.allowedElementIds$=new J([]),this.addTagMode$=new J(!1),this.enableTextTags$=new J(!1),this.notificationService=null,this.loggingService.log("%c[WB] Creating CLASS: TagService","color: blue;"),this.serviceBook.observe(he).subscribe(g=>{this.notificationService=g}),this.databaseService.getDb().pipe(D(g=>!!g),$(1)).subscribe(g=>{g&&this.getDocumentPaths()},g=>{this.loggingService.catch("Error in TagService getDb subscription: ",g)}),this.domService.onWindowPointerMove$().subscribe(g=>{if(this.addTagMode$.value){this.hightlightElement&&this.domService.removeHighlightFromElement(this.hightlightElement);let j=this.domService.getBackgroundElement(g.clientX,g.clientY);j&&(this.isElementInsideAllowedElements(j)?bt(g.target)?this.domService.removeClassFromElement(document.body,"show-pin-cursor"):(this.domService.addClassToElement(document.body,"show-pin-cursor"),this.hightlightElement=j,this.domService.highlightElement(this.hightlightElement,d.CURSOR.TAG_PIN)):this.domService.removeClassFromElement(document.body,"show-pin-cursor"))}},g=>{this.loggingService.catch("Error in TagService onWindowPointerMove$ subscription: ",g)}),this.domService.onWindowKeyupEsc$().subscribe(g=>{this.addTagMode$.value&&this.disableAddTagMode()},g=>{this.loggingService.catch("Error in TagService onWindowKeyupEsc$ subscription: ",g)}),this.domService.onDocumentClick$().subscribe(g=>{if(g&&this.addTagMode$.value){if(g.preventDefault(),g.stopPropagation(),!bt(g.target)){let j=this.domService.getBackgroundElement(g.clientX,g.clientY);j&&this.isElementInsideAllowedElements(j)&&this.addTag(g)}this.disableAddTagMode()}},g=>{this.loggingService.catch("Error in TagService onDocumentClick$ subscription: ",g)}),this.addTagMode$.subscribe(g=>{this.hightlightElement&&this.domService.removeHighlightFromElement(this.hightlightElement),g?this.domService.addClassToElement(document.body,"snippyly-add-tag-mode"):(this.domService.removeClassFromElement(document.body,"snippyly-add-tag-mode"),this.domService.removeClassFromElement(document.body,"show-pin-cursor"))},g=>{this.loggingService.catch("Error in TagService addTagMode$ subscription: ",g)}),this.domService.onWindowKeyupBackspace$().subscribe(g=>{this.deleteTagPinAnnotations("keyupBackspace")},g=>{this.loggingService.catch("Error in TagService onWindowKeyupBackspace$ subscription: ",g)}),this.domService.onWindowKeyupDelete$().subscribe(g=>{this.deleteTagPinAnnotations("keyupDelete")},g=>{this.loggingService.catch("Error in TagService onWindowKeyupDelete$ subscription: ",g)}),this.domService.getDeleteCommmentAnnotations$().subscribe(g=>{g?.length&&(g?.filter(vt=>vt.type==="tag")).forEach(vt=>ot(this,null,function*(){yield this.deleteTagPinAnnotation(vt)}))},g=>{this.loggingService.catch("Error in TagService onWindowKeyupDelete$ subscription: ",g)})}getDocumentPaths(){this.loggingService.log("%c[WB] Calling FUNCTION: getDocumentPaths","color: green;"),this.docService.getDocumentPaths$()}getAnonymousAvatarImage(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAnonymousAvatarImage","color: green;"),this.avatarService.generateUserImage()}setAllowedElementIds(t){this.allowedElementIds$.next(t||[])}getAllowedElementIds(){return this.allowedElementIds$.asObservable()}getAllTagAnnotations(t,e,n){this.loggingService.log("%c[WB] Calling FUNCTION: getAllTagAnnotations","color: green;");let i,l;try{if(t&&(l=Pt(t)),e&&typeof e=="object"){let s=le(e);i=Pt(JSON.stringify(s))}}catch(s){this.loggingService.catch("Error in TagService getAllTagAnnotations: ",s)}return this.authService.getAuthState$().pipe(D(s=>!!s),C(s=>this.isFeatureAllowed({firebaseUser:s,annotations:[],filteredAnnotations:[]})),C(s=>s.featureAllowed?this.iamService.isUserAllowed$().pipe(I(c=>(s.featureAllowed=c,s))):E(s)),C(s=>s.featureAllowed?this.authService.isPlanExpired$().pipe(I(c=>(s.featureAllowed=!c,s))):E(s)),C(s=>s.featureAllowed?E(s).pipe(C(c=>this.docService.getDocumentPaths$().pipe(I(y=>(this.documentPaths=y,c.documentPaths=y,c)))),C(c=>this.getDataFromDocumentId(l).pipe(I(y=>(c.annotations=y||[],G({},c))))),C(c=>this.docService.getLocation$().pipe(I(y=>(c.location=y,c)))),C(c=>this.docService.getLocations$().pipe(I(y=>(c.customLocations=y,c)))),I(c=>{if(c.filteredAnnotations=[],l&&!i)return c.filteredAnnotations=c.annotations?.slice(),c;{let y=[];return i?y.push(i):(y.push(c?.location?.locationId),y.push(...Object.values(c?.customLocations||[]).map(X=>X.locationId))),c.filteredAnnotations=this.filterAnnotationsByLocationIds(c?.annotations,y),c}}),C(c=>n?E(c):c?.annotations?.length?this.domService.onWindowResize$().pipe(I(()=>c)):E(c)),C(c=>n?E(c):c?.annotations?.length?this.domService.onDomChange$("TagService getAllTagAnnotations").pipe(I(()=>c)):E(c)),I(c=>(c?.filteredAnnotations?.forEach(y=>{this.calculateTagAnnotationPosition(y)}),c)),C(c=>c?.filteredAnnotations?E(c?.filteredAnnotations||[]):E([]))):E([])))}isFeatureAllowed(t){return this.configService.getConfig$().pipe(D(e=>!!e),I(e=>K(G({},t),{config:e})),C(e=>this.authService.getUser$().pipe(I(n=>K(G({},e),{user:n})))),C(e=>se(e.config,e.user,V.TAG)?E(K(G({},e),{featureAllowed:!0})):(this.loggingService.warn("Tag feature is not allowed."),E(K(G({},e),{featureAllowed:!1})))))}getDataFromDocumentId(t){return this.databaseService.getDb().pipe(D(e=>!!e),C(e=>this.configService?.getApiKey()&&this.documentPaths?.tag?this.commonDbService.dbListener({feature:"allTags",properties:{documentId:t??this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0}}).pipe(I(n=>n?.data),I(n=>{let i=[];return n&&(i=Object.values(n).filter(l=>typeof l=="object")),this.setTagAnnotationsByDocumentId(t||this.documentPaths?.documentId,i),i})):E([])))}setTagAnnotationsByDocumentId(t,e){try{t&&this.tagAnnotationsByDocumentId$.next(K(G({},this.tagAnnotationsByDocumentId$.value),{[t]:e}))}catch(n){this.loggingService.catch("Error in TagService setTagAnnotationsByDocumentId:",n)}}filterAnnotationsByLocationIds(t,e){try{return t.filter(n=>e.includes(n.locationId))}catch(n){return this.loggingService.catch("Error in TagService filterAnnotationsByLocations:",n),[]}}calculateTagAnnotationPosition(t){try{if(t.targetElement){let e=this.domService.getXPath(t.targetElement?.xpath);if(e){let n=e.iterateNext();if(n&&lt(n)){let i=n.getBoundingClientRect();if(i&&i.width&&i.height){let{height:l,width:s}=pe(n);t.position={top:l*t.targetElement.topPercentage/100,left:s*t.targetElement.leftPercentage/100}}else t.position=null}else t.position=null}else t.position=null}}catch(e){this.loggingService.catch("Error in TagService calculateTagAnnotationPosition:",e)}}filterPinAnnotations(t,e,n){this.loggingService.log("%c[WB] Calling FUNCTION: filterPinAnnotations","color: green;");try{let i=t?Object.values(t):[];i.forEach((s,c)=>{s?.annotationId&&(s.annotationIndex=c+1)});let l=[];if(e)n?l=i.filter(s=>s.locationId===n):l=i.slice();else{let s=this.docService.getLocation();s&&s.locationId?l=i.filter(c=>c.locationId===s.locationId):l=i.filter(c=>!c.locationId)}return l}catch(i){return this.loggingService.catch("Error in TagService filterPinAnnotations:",i),[]}}addTag(t,e){this.loggingService.log("%c[WB] Calling FUNCTION: addTag","color: green;");try{let n=this.authService.getUser();if(n)if(n.isReadOnly||n.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add tags.");else{let i=new _t;i.from=n,i.color=d.DEFAULT_ANNOTATION_COLOR,i.resolved=!1,i.lastUpdated=this.timestamp;let{topPositionX:l,topPositionY:s}=this.domService.getTopLeftPosition();i.positionX=l,i.positionY=s;let c=this.domService.getCurrentWindowSizeValue();if(i.screenWidth=c.screenWidth,i.screenHeight=c.screenHeight,i.screenScrollHeight=c.screenScrollHeight,i.taggedElementPath="",t&&(i.targetElement=this.domService.getTargetElementForCursorPosition(t)),e&&(i.targetTextRange=e),i?.targetElement?.xpath){let y=this.domService.getXPath(i.targetElement.xpath);if(y){let X=y.iterateNext();X&&(lt(X)||(i.targetElement=null))}}this.setLocationToTagAnnotation(i),i.pageInfo=Ct(),i.pageInfo&&(i.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth),this.saveTagToDb(i)}}catch(n){this.loggingService.catch("Error in TagService addTag: ",n)}}setLocationToTagAnnotation(t){try{let e=this.docService.getLocation();e?(t.locationId=e.locationId,t.location=e.location):(delete t.locationId,delete t.location);try{let n;t.targetElement?.xpath?n=this.domService.getElementFromXPath(t.targetElement.xpath):t.targetTextRange?.commonAncestorContainer&&(n=this.domService.getElementFromXPath(t.targetTextRange.commonAncestorContainer));let i=this.docService.getAdditionLocationFromElement(n);if(i){let l=this.docService.addLocation({location:i,source:"internal"});l?.[0]&&(t.locationId=l[0].locationId,t.location=l[0].location)}}catch{}}catch(e){this.loggingService.catch("Error in TagService setLocationToTagAnnotation:",e)}}saveTagToDb(t){this.loggingService.log("%c[WB] Calling FUNCTION: saveTagToDb","color: green;");try{this.authService.getUser()&&this.authService.isFeatureAllowed(V.TAG)&&this.docService.getDocumentPaths$().pipe(D(e=>!!e),$(1),C(e=>(this.documentPaths=e,this.loggingService.log(this.documentPaths),this.databaseService.getDb().pipe(D(n=>!!n),$(1),C(n=>{if(this.documentPaths?.tag){t.annotationId=this.commonDbService.generateDocumentId(),t.pageInfo&&(t.pageInfo.tagUrl=this.generateTagUrl(t));let i=JSON.parse(JSON.stringify(t));return i.position=null,this.domService.toggleAnnotationSelection(i),t.targetTextRange&&sessionStorage.setItem(d.SESSION_STORAGE.SNIPPYLY_AUTO_SELECT_ANNOTATION_ID,t.annotationId),this.analyticsService.trackEvent(b.Events.Tag.TAG_DRAFT_ADDED,{annotationId:t.annotationId}),this.commonDbService.setData({feature:"tag",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",id:t.annotationId,skipFirestore:!0},data:i})}else return E(null)}))))).subscribe(()=>{},e=>{this.loggingService.catch("Error in TagService saveTagToDb subscription: ",e)})}catch(e){this.loggingService.catch("Error in TagService saveTagToDb: ",e)}}updateTag(t,e=!1,n){try{n&&this.setLocationToTagAnnotation(t),e&&this.updateNotificationsDatabase(t,ct.UPDATED),this.updateTagToDb(t)}catch(i){this.loggingService.catch("Error in TagService updateTag: ",i)}}resolveTag(t){try{t.resolved=!0,this.domService.resetSelectedAnnotationsMap(!1),this.updateNotificationsDatabase(t,ct.RESOLVED),this.updateTagToDb(t),this.domService.updateSelectedAnnotationInMap([t]),this.analyticsService.trackEvent(b.Events.Tag.TAG_RESOLVED,{annotationId:t.annotationId})}catch(e){this.loggingService.catch("Error in TagService resolveTag: ",e)}}updateTagToDb(t){this.loggingService.log("%c[WB] Calling FUNCTION: updateTagToDb","color: green;");try{if(t?.targetElement?.xpath){let e=this.domService.getXPath(t.targetElement.xpath);if(e){let n=e.iterateNext();n&&(lt(n)||(t.targetElement=null))}}this.domService.updateSelectedAnnotationInMap([t]),this.authService.getUser()&&this.authService.isFeatureAllowed(V.TAG)&&this.docService.getDocumentPaths$().pipe(D(e=>!!e),$(1),C(e=>(this.documentPaths=e,this.loggingService.log(this.documentPaths),this.databaseService.getDb().pipe(D(n=>!!n),$(1),C(n=>{if(this.documentPaths?.tag&&t?.annotationId){let i=JSON.parse(JSON.stringify(t));return i.position=null,this.commonDbService.setData({feature:"tag",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",id:t.annotationId,skipFirestore:!0},data:i})}else return E(null)}))))).subscribe(()=>{},e=>{this.loggingService.catch("Error in TagService updateTagToDb subscription: ",e)})}catch(e){this.loggingService.catch("Error in TagService updateTagToDb: ",e)}}deleteTagPinAnnotations(t){try{let e=this.domService.getSelectedAnnotationsMap(),n=this.authService.getUser(),i=[];Object.keys(e).forEach(l=>ot(this,null,function*(){let s=e[l];s.type==="tag"&&n&&s.from&&(n?.isAdmin||s.from.userId===n.userId)&&i.push(s)})),i?.length&&(this.analyticsService.trackEvent(b.Events.Tag.TAG_DELETE_TRIGGERED,{triggerType:t,annotationId:i.map(l=>l.annotationId).join()}),this.dialog.open(be,{panelClass:"velt-mat-dialog-container",data:{title:"Delete tag?",message:"This selected tag will be deleted.",yesButton:"Delete",noButton:"Cancel",variant:"tag"}}).afterClosed().pipe($(1)).subscribe(l=>{l&&(i.forEach(s=>ot(this,null,function*(){yield this.deleteTagPinAnnotation(s)})),setTimeout(()=>{document.querySelectorAll(`[${d.SNIPPYLY_HIGHLIGHT}]`).forEach(c=>{this.domService.removeHighlightFromElement(c)})},100))})),this.domService.resetSelectedAnnotationsMap(!0,"tag")}catch(e){this.loggingService.catch("Error in TagService deleteTagPinAnnotations: ",e)}}deleteTagPinAnnotation(t){return this.authService.isFeatureAllowed(V.TAG)&&this.documentPaths?.tag&&t?.annotationId?(this.updateNotificationsDatabase(t,ct.DELETED),this.analyticsService.trackEvent(b.Events.Tag.TAG_DELETED,{annotationId:t.annotationId}),this.commonDbService.deleteData({feature:"tag",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",id:t.annotationId,skipFirestore:!0}})):Promise.resolve()}enableAddTagMode(){this.authService.isFeatureAllowed(V.TAG)?(this.analyticsService.trackEvent(b.Events.Tag.TAG_ADD_MODE_ENABLED),this.addTagMode$.next(!0)):this.loggingService.catch("Error in TagService enableAddTagMode: ","Tag feature is not enabled.")}disableAddTagMode(){this.analyticsService.trackEvent(b.Events.Tag.TAG_ADD_MODE_DISABLED),this.addTagMode$.next(!1)}addTagModeChange(){return this.addTagMode$.asObservable()}enableTextTags(t){this.enableTextTags$.next(t)}getEnableTextTags$(){return this.enableTextTags$.asObservable()}get timestamp(){return this.commonDbService.getServerTimestamp()}isElementInsideAllowedElements(t){try{return this.domService.isElementInsideListedElementIds(t,this.allowedElementIds$.value)}catch(e){return this.loggingService.catch("Error in TagService isElementInsideAllowedElements: ",e),!1}}attachTag(t,e=[]){let n=de(t,e);if(n){let i=this.domService.getXPath(n),l=this.getTagPinAnnotationObject();l&&(l.targetElement={xpath:i,topPercentage:50,leftPercentage:90},this.saveTagToDb(l))}}getTagPinAnnotationObject(){let t=this.authService.getUser();if(t)if(t.isReadOnly||t.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add tags.");else{let e=new _t;e.from=t,e.color=d.DEFAULT_ANNOTATION_COLOR,e.resolved=!1,e.lastUpdated=this.timestamp;let{topPositionX:n,topPositionY:i}=this.domService.getTopLeftPosition();e.positionX=n,e.positionY=i;let l=this.domService.getCurrentWindowSizeValue();e.screenWidth=l.screenWidth,e.screenHeight=l.screenHeight,e.screenScrollHeight=l.screenScrollHeight,e.taggedElementPath="";let s=this.docService.getLocation();return s&&(e.locationId=s.locationId,e.location=s.location),e}return null}updateNotificationsDatabase(t,e){try{let n={annotationData:t,actionType:e,notificationSource:"tag"};this.notificationService?.updateNotificationDatabase(n)}catch(n){this.loggingService.catch("Error in TagService updateNotificationsDatabase: ",n)}}getUserContacts$(){return this.contactService.getUserContacts$()}addUserContact(t){this.contactService.addUserContact(t)}getTagUrl(t){try{return t?.pageInfo?.tagUrl?t.pageInfo.tagUrl:(t?.pageInfo||(t.pageInfo=Ct(),t.pageInfo&&(t.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth)),t.pageInfo.tagUrl=this.generateTagUrl(t),this.updateTag(t),t.pageInfo?.tagUrl)}catch(e){this.loggingService.catch("Error in TagService getTagUrl: ",e);return}}uploadFile(t,e){let n=`${d.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${d.FIREBASE_PARTIAL_PATH_TAG}/${e.annotationId}`;return this.documentPaths?.organizationId&&(n=`${d.FIREBASE_PARTIAL_PATH_ORGANIZATIONS}/${this.documentPaths.organizationId}/${d.FIREBASE_PARTIAL_PATH_DOCS}/${this.documentPaths?.documentId}/${d.FIREBASE_PARTIAL_PATH_TAG}/${e.annotationId}`),this.storageService.uploadFile({path:n,file:t})}downloadAttachment(t){this.storageService.downloadAttachment(t)}deleteAttachment(t){return this.storageService.deleteAttachment({attachment:t})}generateTagUrl(t){let e;try{e=new URL(t?.pageInfo?.url||window.location.href)}catch(n){this.loggingService.catch("Error in TagService generateTagUrl: ",n),e=new URL(window.location.href)}return e.searchParams.delete(d.URL_PARAMS.TAG_ID),e.searchParams.append(d.URL_PARAMS.TAG_ID,t.annotationId),e.href}};r.\u0275fac=function(e){return new(e||r)(f(B),f(ve),f(Se),f(Te),f(U),f(L),f(oe),f(Ae),f(fe),f(Pe),f(we),f(re),f(p),f(ue),f(_e))},r.\u0275prov=rt({token:r,factory:r.\u0275fac,providedIn:"root"});let a=r;return a})();var Fe=["customBtnRef"],He=["*"];function Ve(a,r){a&1&&ft(0)}function Ue(a,r){if(a&1&&O(0,Ve,1,0,"ng-container",5),a&2){h();let o=N(5);u("ngTemplateOutlet",o)}}function je(a,r){a&1&&(_(0,"div",8),W(),_(1,"svg",9),z(2,"circle",10)(3,"path",11),P()())}function Ge(a,r){a&1&&ft(0)}function $e(a,r){if(a&1&&(O(0,je,4,0,"div",6),_(1,"div",7,2),O(3,Ge,1,0,"ng-container",5),P()),a&2){let o=h(),t=N(5);u("ngIf",o.showDefaultBtn),v(3),u("ngTemplateOutlet",t)}}function We(a,r){a&1&&Ht(0)}var pt=(()=>{let r=class r{constructor(t,e,n,i,l){this.analyticsService=t,this.authService=e,this.tagService=n,this.loggingService=i,this.cdr=l,this.showDefaultBtn=!1,this.subscriptions=[],this.veltElement=!0,this.subscriptions.push(this.authService.getUser$().subscribe(s=>{this.user=s},s=>{this.loggingService.catch("Error in TagsToolComponent getUser$ subscription: ",s)}))}ngOnInit(){}ngAfterViewInit(){try{this.customBtnRef?.nativeElement?.children?.length||(this.showDefaultBtn=!0,this.cdr.detectChanges())}catch(t){this.loggingService.catch("Error in TagsToolComponent AfterViewInit: ",t)}}addTag(){this.loggingService.log("%c[WB] Calling FUNCTION: addTag","color: green;");try{this.analyticsService.trackEvent(b.Events.Tag.TAG_TOOL_CLICKED,{toolType:this.customBtnRef?.nativeElement?.children?.length?"custom":"default"}),this.user&&(this.user.isReadOnly||this.user.isAnonymous?this.loggingService.catch("Anonymous/Readonly users cannot add tags."):this.targetTagElementId?this.tagService.attachTag(this.targetTagElementId,["id","data-id"]):this.tagService.enableAddTagMode())}catch(t){this.loggingService.catch("Error in TagsToolComponent addTag: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(t){this.loggingService.catch("Error in TagsToolComponent ondestroy: ",t)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(t=>{t.unsubscribe()}),this.subscriptions=[]}catch(t){this.loggingService.catch("Error in TagsToolComponent unsubscribe: ",t)}}};r.\u0275fac=function(e){return new(e||r)(m(B),m(U),m(w),m(p),m($t))},r.\u0275cmp=k({type:r,selectors:[["snippyly-tags-tool"]],viewQuery:function(e,n){if(e&1&&Z(Fe,5),e&2){let i;tt(i=et())&&(n.customBtnRef=i.first)}},hostVars:1,hostBindings:function(e,n){e&2&&M("data-velt-element",n.veltElement)},inputs:{targetTagElementId:"targetTagElementId"},standalone:!1,ngContentSelectors:He,decls:6,vars:2,consts:[["tagToolBtn",""],["content",""],["customBtnRef",""],[1,"snippyly-tag-btn-container",3,"click"],[3,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["class","action-btn",4,"ngIf"],[1,"custom-btn-container"],[1,"action-btn"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","bx","https://boxy-svg.com","viewBox","0 0 32 32","width","32","height","32","fill","none",1,"action-btn-icon"],["cx","16","cy","10.751","r","3.751",0,"bx","origin","0.5 1.19976","has-stroke","",2,"stroke-width","2px"],["d","M 10 24.964 L 10 24.251 C 10 20.936 12.687 18.251 16 18.251 C 19.313 18.251 22 20.936 22 24.251 L 22 25","stroke-linecap","round",0,"bx","origin","0.5 -0.333481","has-stroke","",2,"stroke-width","2px"]],template:function(e,n){if(e&1){let i=x();Ft(),_(0,"div",3),A("click",function(s){return T(i),n.addTag(),S(s.stopPropagation())}),O(1,Ue,1,1,"ng-template",4)(2,$e,4,2,"ng-template",null,0,nt),P(),O(4,We,1,0,"ng-template",null,1,nt)}if(e&2){let i=N(3);v(),u("ngIf",n.targetTagElementId)("ngIfElse",i)}},dependencies:[H,zt],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}.snippyly-tag-btn-container[_ngcontent-%COMP%]{display:inline-block}.action-btn[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.action-btn-icon[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:50px;cursor:pointer;transition:.5s!important}.action-btn-icon[_ngcontent-%COMP%] *[has-stroke][_ngcontent-%COMP%]{stroke:#8f95b2!important}.action-btn-icon[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:not([has-stroke]){fill:#8f95b2!important}.action-btn-icon[_ngcontent-%COMP%]:hover{background:#eae8f9}.action-btn-icon[_ngcontent-%COMP%]:active, .action-btn-icon.active[_ngcontent-%COMP%]{background:#625df5}.action-btn-icon[_ngcontent-%COMP%]:active *[has-stroke][_ngcontent-%COMP%], .action-btn-icon.active[_ngcontent-%COMP%] *[has-stroke][_ngcontent-%COMP%]{stroke:#fff!important}.action-btn-icon[_ngcontent-%COMP%]:active *[_ngcontent-%COMP%]:not([has-stroke]), .action-btn-icon.active[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:not([has-stroke]){fill:#fff!important}"],changeDetection:0});let a=r;return a})();function ze(a,r){if(a&1){let o=x();_(0,"div",7),A("click",function(e){return T(o),h(2).copyLink(),S(e.stopPropagation())}),Q(1),R(2,"translate"),P()}if(a&2){let o=h(2);v(),St(" ",F(2,1,o.copyLinkText))}}function Ye(a,r){if(a&1){let o=x();_(0,"div",7),A("click",function(e){T(o);let n=h(2);return n.editMode=!0,S(e.stopPropagation())}),Q(1),R(2,"translate"),P()}a&2&&(v(),Tt(F(2,1,"Reassign")))}function Xe(a,r){if(a&1){let o=x();_(0,"div",7),A("click",function(e){T(o);let n=h(2);return n.editMode=!0,n.resolveTag(),S(e.stopPropagation())}),Q(1),R(2,"translate"),P()}a&2&&(v(),Tt(F(2,1,"Resolve")))}function Ke(a,r){if(a&1){let o=x();_(0,"div",7),A("click",function(e){return T(o),h(2).removeTag(),S(e.stopPropagation())}),Q(1),R(2,"translate"),P()}a&2&&(v(),St(" ",F(2,1,"Remove")))}function Je(a,r){if(a&1&&(_(0,"div",4)(1,"div",5),Q(2),R(3,"translate"),R(4,"translate"),P(),O(5,ze,3,3,"div",6)(6,Ye,3,3,"div",6)(7,Xe,3,3,"div",6)(8,Ke,3,3,"div",6),P()),a&2){let o=h();v(2),Ut("",F(3,6,"Assigned to:")," ",!(o.annotation==null||o.annotation.to[0]==null)&&o.annotation.to[0].name?o.annotation==null||o.annotation.to[0]==null?null:o.annotation.to[0].name:F(4,8,o.annotation==null||o.annotation.to[0]==null?null:o.annotation.to[0].email)),v(3),u("ngIf",o.tagPinSelected),v(),u("ngIf",o.tagPinSelected&&(o.allowedActions==null?null:o.allowedActions.update)),v(),u("ngIf",o.tagPinSelected&&(o.allowedActions==null?null:o.allowedActions.resolve)),v(),u("ngIf",o.tagPinSelected&&(o.allowedActions==null?null:o.allowedActions.remove))}}function Qe(a,r){if(a&1){let o=x();W(),_(0,"svg",11),A("click",function(){T(o);let e=h(2);return S(!(e.annotation==null||e.annotation.to==null)&&e.annotation.to.length?e.editMode=!1:e.removeTag())}),z(1,"path",12)(2,"path",13),P()}}function qe(a,r){if(a&1){let o=x();Lt(0),_(1,"div",8)(2,"velt-autocomplete-panel-internal",9,0),R(4,"translate"),A("optionSelected",function(e){T(o);let n=h();return S(n.saveTag(e))}),P(),O(5,Qe,3,0,"svg",10),P(),Nt()}if(a&2){let o=N(3),t=h();v(2),u("placeholder",F(4,3,"Please select a contact to assign"))("enableOnFocus",!0),v(3),u("ngIf",(t.annotation==null||t.annotation.to==null?null:t.annotation.to.length)||!(!(o==null||o.userContacts==null)&&o.userContacts.length))}}var It=(()=>{let r=class r{get user(){return this._user}set user(t){this._user=t,this.checkToShowActions()}get tagPinSelected(){return this._tagPinSelected}set tagPinSelected(t){this._tagPinSelected=t,this.tagPinSelected&&this.setTagReadInAnalytics()}constructor(t,e,n){this.analyticsService=t,this.tagService=e,this.loggingService=n,this.subscriptions=[],this.editMode=!1,this.copyLinkText="Copy Link",this._user=new ae,this.allowedActions=null,this._tagPinSelected=!1,this.veltElement=!0}ngOnInit(){try{this.checkToShowActions(),this.annotation?.to?.length||(this.editMode=!0)}catch(t){this.loggingService.catch("Error in TagDialogComponent OnInit: ",t)}}ngAfterViewInit(){try{this.setTagReadInAnalytics()}catch(t){this.loggingService.catch("Error in TagDialogComponent view init: ",t)}}trackByUserContact(t,e){return e?.email||t}setTagReadInAnalytics(){try{this.annotation&&this.analyticsService.trackEvent(b.Events.Tag.TAG_READ,{annotationId:this.annotation.annotationId,readType:this.tagPinSelected?"open":"hover"})}catch(t){this.loggingService.catch("Error in CommentDialogComponent setCommentReadInAnalytics: ",t)}}saveTag(t){try{this.analyticsService.trackEvent(b.Events.Tag.TAG_ADDED,{annotationId:this.annotation.annotationId}),this.annotation.to=[t],this.tagService.updateTag(this.annotation,!0),this.editMode=!1}catch(e){this.loggingService.catch("Error in TagDialogComponent saveTag: ",e)}}checkToShowActions(){try{this.user&&this.annotation?this.annotation.from?.userId===this.user.userId?(this.allowedActions||(this.allowedActions={}),this.allowedActions.update=!0,this.allowedActions.remove=!0):!this.annotation?.resolved&&this.annotation?.to?.find(t=>t?.email===this.user?.email)&&(this.allowedActions||(this.allowedActions={}),this.allowedActions.resolve=!0):this.allowedActions=null}catch(t){this.loggingService.catch("Error in TagDialogComponent checkToShowActions: ",t)}}resolveTag(){try{this.tagService.resolveTag(this.annotation),this.editMode=!1}catch(t){this.loggingService.catch("Error in TagDialogComponent resolveTag: ",t)}}removeTag(){try{this.tagService.deleteTagPinAnnotations("deleteOption")}catch(t){this.loggingService.catch("Error in TagDialogComponent removeTag: ",t)}}copyLink(){try{let t=this.copyLinkText;this.copyLinkText="Link Copied!",setTimeout(()=>{this.copyLinkText=t},2e3);let e=this.tagService.getTagUrl(this.annotation);e&&ge(e),this.analyticsService.trackEvent(b.Events.Tag.TAG_LINK_COPIED,{annotationId:this.annotation.annotationId})}catch(t){this.loggingService.catch("Error in TagDialogComponent copyLink: ",t)}}};r.\u0275fac=function(e){return new(e||r)(m(B),m(w),m(p))},r.\u0275cmp=k({type:r,selectors:[["snippyly-tag-dialog"]],hostVars:1,hostBindings:function(e,n){e&2&&M("data-velt-element",n.veltElement)},inputs:{annotation:"annotation",user:"user",tagPinSelected:"tagPinSelected"},standalone:!1,decls:3,vars:5,consts:[["userSelectorRef",""],[1,"tag-dialog-container",3,"pointerdown","pointerup"],["velt-ignore-change-detection","true",4,"ngIf"],[4,"ngIf"],["velt-ignore-change-detection","true"],[1,"tag-user-details"],["class","tag-action-button",3,"click",4,"ngIf"],[1,"tag-action-button",3,"click"],[1,"tag-input-container"],[3,"optionSelected","placeholder","enableOnFocus"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","class","bi bi-x-circle","viewBox","0 0 16 16",3,"click",4,"ngIf"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","currentColor","viewBox","0 0 16 16",1,"bi","bi-x-circle",3,"click"],["d","M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"],["d","M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"]],template:function(e,n){e&1&&(_(0,"div",1),A("pointerdown",function(l){return l.stopPropagation()})("pointerup",function(l){return l.stopPropagation()}),O(1,Je,9,10,"div",2)(2,qe,6,5,"ng-container",3),P()),e&2&&(st("edit-mode",n.editMode),M("data-velt-annotation-draft",n.editMode?n.annotation==null?null:n.annotation.annotationId:null),v(),u("ngIf",(n.annotation==null||n.annotation.to==null?null:n.annotation.to.length)&&!n.editMode),v(),u("ngIf",n.editMode))},dependencies:[H,ye,Ce],styles:['html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}.tag-dialog-container[_ngcontent-%COMP%]{background-color:#fff;padding-top:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;padding-bottom:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;width:100%;padding-right:calc((.75rem + 0px) * var(--velt-base-rem-unit))!important;padding-left:calc((.75rem + 0px) * var(--velt-base-rem-unit))!important;margin-right:auto!important;margin-left:auto!important;font-size:calc((.875rem + 0px) * var(--velt-base-rem-unit));border-radius:10px!important;box-shadow:0 calc((1rem + 0px) * var(--velt-base-rem-unit)) calc((3rem + 0px) * var(--velt-base-rem-unit)) #0000002d!important;border:1px solid #dee2e6!important;max-height:fit-content!important;max-width:300px;min-width:300px}.tag-dialog-container[_ngcontent-%COMP%]:not(.edit-mode){background-color:#141416!important;padding-left:0!important;padding-right:0!important;max-width:250px;min-width:250px;border:none!important}.tag-dialog-container[_ngcontent-%COMP%]:not(.edit-mode) *[_ngcontent-%COMP%]{color:#fff!important}.tag-dialog-container[_ngcontent-%COMP%]:not(.edit-mode) .tag-user-details[_ngcontent-%COMP%]{margin-bottom:calc((.25rem + 0px) * var(--velt-base-rem-unit))!important;padding-right:calc((.75rem + 0px) * var(--velt-base-rem-unit))!important;padding-left:calc((.75rem + 0px) * var(--velt-base-rem-unit))!important;word-break:break-word}.tag-dialog-container[_ngcontent-%COMP%]:not(.edit-mode) .tag-action-button[_ngcontent-%COMP%]{padding:calc((.25rem + 0px) * var(--velt-base-rem-unit)) calc((.75rem + 0px) * var(--velt-base-rem-unit))!important;cursor:pointer}.tag-dialog-container[_ngcontent-%COMP%]:not(.edit-mode) .tag-action-button[_ngcontent-%COMP%]:hover{background-color:#353537}.tag-dialog-container[_ngcontent-%COMP%] .tag-input-container[_ngcontent-%COMP%]{display:flex}.tag-dialog-container[_ngcontent-%COMP%] .tag-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%!important;border:0!important} .snippyly-tag-autocomplete-panel{box-shadow:0 calc((.3rem + 0px) * var(--velt-base-rem-unit)) calc((1.5rem + 0px) * var(--velt-base-rem-unit)) #0000002e!important} .snippyly-tag-autocomplete-panel::-webkit-scrollbar{display:none!important;width:0!important;height:0!important} .snippyly-tag-autocomplete-panel::-webkit-scrollbar{width:0;height:0} .snippyly-tag-autocomplete-panel::-webkit-scrollbar-button{width:0;height:0} .snippyly-tag-autocomplete-panel .user-selection-container{background:#fff;border-radius:8px;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) 0!important} .snippyly-tag-autocomplete-panel .user-selection-container .mat-mdc-option{padding:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important} .snippyly-tag-autocomplete-panel .user-selection-container .mat-mdc-option.mat-mdc-option-active{background-color:#f2f2f2!important}.contact-container[_ngcontent-%COMP%]{display:flex;align-items:center}.photo-container[_ngcontent-%COMP%]{min-width:calc((2.5rem + 0px) * var(--velt-base-rem-unit));width:calc((2.5rem + 0px) * var(--velt-base-rem-unit));min-height:calc((2.5rem + 0px) * var(--velt-base-rem-unit));height:calc((2.5rem + 0px) * var(--velt-base-rem-unit));box-sizing:border-box;background-clip:padding-box;border:solid 2px transparent;display:flex;align-items:center;justify-content:center;position:relative;margin-right:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}.photo-container-small[_ngcontent-%COMP%]{width:calc((2rem + 0px) * var(--velt-base-rem-unit));height:calc((2rem + 0px) * var(--velt-base-rem-unit));min-width:calc((2rem + 0px) * var(--velt-base-rem-unit));min-height:calc((2rem + 0px) * var(--velt-base-rem-unit));margin-right:calc((.8rem + 0px) * var(--velt-base-rem-unit))!important}.photo-container[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:0;z-index:1;border-radius:inherit;background:inherit}.photo-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:50%;z-index:2;object-fit:cover}.contact-details[_ngcontent-%COMP%]{overflow:hidden}.contact-details[_ngcontent-%COMP%] .contact-name[_ngcontent-%COMP%], .contact-details[_ngcontent-%COMP%] .contact-email[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;line-height:calc((1rem + 0px) * var(--velt-base-rem-unit));font-size:calc((.875rem + 0px) * var(--velt-base-rem-unit))!important}.contact-details[_ngcontent-%COMP%] .contact-email[_ngcontent-%COMP%]{color:#6c757d!important}.photo-placeholder[_ngcontent-%COMP%]{z-index:2;opacity:.8}.tag-buttons-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;padding-top:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;background:#fff}.tag-button[_ngcontent-%COMP%]{background-color:#625df5;color:#fff!important;border:0;border-radius:4px;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;margin-right:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;cursor:pointer!important}.tag-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#fff!important}.tag-button.green[_ngcontent-%COMP%]{background-color:#0dcf82!important}.tag-button[_ngcontent-%COMP%]:hover{background-color:#44aeff!important;color:#fff!important}.tag-button[_ngcontent-%COMP%]:hover.green{background-color:#10b372!important}.tag-button[disabled][_ngcontent-%COMP%], .tag-button[disabled][_ngcontent-%COMP%]:hover{background-color:#0000001a!important;color:#0006!important}.cancel-button[_ngcontent-%COMP%]{border:0;border-radius:4px;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;margin-right:calc((.5rem + 0px) * var(--velt-base-rem-unit))!important;cursor:pointer!important}.cancel-button[_ngcontent-%COMP%]:hover{color:#e91e63}.no-contacts-message[_ngcontent-%COMP%]{text-align:center!important} .tag-input-container velt-autocomplete-panel-internal{width:100%!important} .tag-input-container velt-autocomplete-panel-internal input{width:100%!important;border:0!important}'],changeDetection:0});let a=r;return a})();var tn=["overlay"],en=["pin"],nn=(a,r)=>({"tag-pin-selected":a,"mutiple-pins-selected":r}),on=()=>["snippyly-overlay-panel","snippyly-tag-dialog-overlay-panel","velt-overlay-panel"];function rn(a,r){a&1&&(W(),z(0,"path",8))}function an(a,r){if(a&1){let o=x();_(0,"snippyly-user-avatar",9),A("pointerover",function(e){return T(o),h().onPointerOver(e),S(e.stopPropagation())})("pointerout",function(){T(o);let e=h();return S(e.onPointerOut())}),P()}if(a&2){let o=h();u("user",o.tagPinAnnotation==null?null:o.tagPinAnnotation.to[0])("background","rgb(162, 89, 254) !important")("size",26)}}function sn(a,r){if(a&1){let o=x();_(0,"snippyly-tag-dialog",10),A("saveTag",function(e){T(o);let n=h();return S(n.saveTag.emit(e))}),P()}if(a&2){let o=h();u("annotation",o.tagPinAnnotation)("user",o.user)("tagPinSelected",o.tagPinSelected)}}var At=(()=>{let r=class r{get tagPinAnnotation(){return this._tagPinAnnotation}set tagPinAnnotation(t){this._tagPinAnnotation=t}get tagPinSelected(){return this._tagPinSelected}set tagPinSelected(t){this._tagPinSelected=t,this.updateHighlightOnElement()}get tagPinHover(){return this._tagPinHover}set tagPinHover(t){this._tagPinHover=t,this.updateHighlightOnElement()}constructor(t,e,n){this.tagService=t,this.domService=e,this.loggingService=n,this._tagPinSelected=!1,this.multipleTagPinsSelected=!1,this.avatarErrorImage="",this.deleteTagThread=new at,this.saveTag=new at,this.signInToAccessFeature=new at,this.overlayOriginX="start",this.overlayOriginY="top",this._tagPinHover=!1,this.subscriptions=[],this.positions=d.OVERLAY_POSITIONS.map(i=>new Zt({originX:i.originX,originY:i.originY},{overlayX:i.overlayX,overlayY:i.overlayY})),this.veltElement=!0,this.loggingService.log("%c[WB] Creating COMPONENT TagPinComponent","color: blue;")}ngOnInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;")}ngAfterViewInit(){try{this.updateHighlightOnElement(),this.subscriptions.push(this.overlay.positionChange.subscribe(t=>{this.overlayOriginX=t.connectionPair.originX,this.overlayOriginY=t.connectionPair.originY},t=>{this.loggingService.catch("Error in TagPinComponent positionChange subscription: ",t)}))}catch(t){this.loggingService.catch("Error in TagPinComponent AfterViewInit: ",t)}}updateHighlightOnElement(){try{this.targetElement&&(this.tagPinSelected||this.tagPinHover?this.domService.highlightElement(this.targetElement):this.domService.removeHighlightFromElement(this.targetElement))}catch(t){this.loggingService.catch("Error in TagPinComponent updateHighlightOnElement: ",t)}}onPointerOver(t){try{t.buttons?this.tagPinHover&&(this.tagPinHover=!1):this.tagPinHover||(this.tagPinHover=!0)}catch(e){this.loggingService.catch("Error in TagPinComponent onPointerOver: ",e)}}onPointerOut(){this.tagPinHover=!1}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(t){this.loggingService.catch("Error in TagPinComponent ondestroy: ",t)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(t=>{t.unsubscribe()}),this.subscriptions=[]}catch(t){this.loggingService.catch("Error in TagPinComponent unsubscribe: ",t)}}};r.\u0275fac=function(e){return new(e||r)(m(w),m(L),m(p))},r.\u0275cmp=k({type:r,selectors:[["snippyly-tag-pin"]],viewQuery:function(e,n){if(e&1&&(Z(tn,5),Z(en,5)),e&2){let i;tt(i=et())&&(n.overlay=i.first),tt(i=et())&&(n.pin=i.first)}},hostVars:1,hostBindings:function(e,n){e&2&&M("data-velt-element",n.veltElement)},inputs:{tagPinAnnotation:"tagPinAnnotation",tagPinSelected:"tagPinSelected",multipleTagPinsSelected:"multipleTagPinsSelected",avatarErrorImage:"avatarErrorImage",user:"user",targetElement:"targetElement"},outputs:{deleteTagThread:"deleteTagThread",saveTag:"saveTag",signInToAccessFeature:"signInToAccessFeature"},standalone:!1,decls:8,vars:15,consts:[["trigger","cdkOverlayOrigin"],["overlay","cdkConnectedOverlay"],["cdkOverlayOrigin","",1,"tag-pin-container",3,"click","ngClass"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 100 100",1,"tag-pin"],["cx","50","cy","50","rx","50","ry","50",2,"stroke","rgb(0, 0, 0)","fill","rgb(162, 89, 254)","paint-order","fill","stroke-width","0px"],["d","M 24.999 77 C 24.999 77 20 77 20 72.001 C 20 66.999 24.999 51.999 50 51.999 C 75.001 51.999 80 66.999 80 72.001 C 80 77 75.001 77 75.001 77 L 24.999 77 Z M 50 47 C 61.548 47 68.764 34.5 62.991 24.499 C 60.312 19.857 55.359 17 50 17 C 38.452 17 31.236 29.5 37.009 39.499 C 39.688 44.14 44.641 47 50 47 Z","style","fill: rgb(255, 255, 255);",4,"ngIf"],["class","photo-container tag-user-avatar",3,"user","background","size","pointerover","pointerout",4,"ngIf"],["cdkConnectedOverlay","",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPanelClass","cdkConnectedOverlayOffsetY","cdkConnectedOverlayBackdropClass","cdkConnectedOverlayLockPosition","cdkConnectedOverlayPositions","cdkConnectedOverlayGrowAfterOpen"],["d","M 24.999 77 C 24.999 77 20 77 20 72.001 C 20 66.999 24.999 51.999 50 51.999 C 75.001 51.999 80 66.999 80 72.001 C 80 77 75.001 77 75.001 77 L 24.999 77 Z M 50 47 C 61.548 47 68.764 34.5 62.991 24.499 C 60.312 19.857 55.359 17 50 17 C 38.452 17 31.236 29.5 37.009 39.499 C 39.688 44.14 44.641 47 50 47 Z",2,"fill","rgb(255, 255, 255)"],[1,"photo-container","tag-user-avatar",3,"pointerover","pointerout","user","background","size"],[3,"saveTag","annotation","user","tagPinSelected"]],template:function(e,n){if(e&1){let i=x();_(0,"div",2,0),A("click",function(s){return T(i),S(s.preventDefault())}),W(),_(2,"svg",3),z(3,"ellipse",4),O(4,rn,1,0,"path",5),P(),O(5,an,1,3,"snippyly-user-avatar",6),P(),O(6,sn,1,3,"ng-template",7,1,nt)}if(e&2){let i=N(1);u("ngClass",Gt(11,nn,n.tagPinSelected,n.multipleTagPinsSelected)),v(4),u("ngIf",!(!(n.tagPinAnnotation==null||n.tagPinAnnotation.to==null)&&n.tagPinAnnotation.to.length&&(!(n.tagPinAnnotation==null||n.tagPinAnnotation.to[0]==null)&&n.tagPinAnnotation.to[0].photoUrl))),v(),u("ngIf",n.tagPinAnnotation==null||n.tagPinAnnotation.to==null?null:n.tagPinAnnotation.to.length),v(),u("cdkConnectedOverlayOrigin",i)("cdkConnectedOverlayOpen",n.tagPinSelected||n.tagPinHover)("cdkConnectedOverlayPanelClass",jt(14,on))("cdkConnectedOverlayOffsetY",n.overlayOriginY==="top"?-8:2)("cdkConnectedOverlayBackdropClass","snippyly-overlay-backdrop")("cdkConnectedOverlayLockPosition",!1)("cdkConnectedOverlayPositions",n.positions)("cdkConnectedOverlayGrowAfterOpen",!0)}},dependencies:[Wt,H,ee,te,Ee,It],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}.tag-pin-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;text-align:center;color:#fff;font-size:calc((.8rem + 0px) * var(--velt-base-rem-unit));font-weight:500;cursor:pointer}.tag-pin[_ngcontent-%COMP%]{position:absolute;left:0;top:0;width:32px;height:32px;transition:left .12s ease-in-out,top .12s ease-in-out,width .12s ease-in-out,height .12s ease-in-out,transform .12s ease-in-out}.tag-pin-container[_ngcontent-%COMP%]:hover{filter:brightness(110%) saturate(110%)}.tag-pin-container[_ngcontent-%COMP%]:hover .tag-pin[_ngcontent-%COMP%], .tag-pin-selected[_ngcontent-%COMP%] .tag-pin[_ngcontent-%COMP%], .tag-pin-container[_ngcontent-%COMP%]:hover .photo-container[_ngcontent-%COMP%], .tag-pin-selected[_ngcontent-%COMP%] .photo-container[_ngcontent-%COMP%]{transform:scale(1.2) translateY(-4px);transition:left .12s ease-in-out,top .12s ease-in-out,width .12s ease-in-out,height .12s ease-in-out,transform .12s ease-in-out}.tag-index[_ngcontent-%COMP%]{position:absolute;border-radius:50%;border:1px solid #fff;width:20px;height:20px;text-align:center;top:-8px;right:-8px;font-size:calc((.8rem + 0px) * var(--velt-base-rem-unit));color:#000;background:#fff}.tag-pin-selected[_ngcontent-%COMP%]{filter:brightness(110%) saturate(110%)}.tag-resolved[_ngcontent-%COMP%]{background-color:#0dcf82!important}.bi-check-lg[_ngcontent-%COMP%]{color:#fff}.mutiple-pins-selected[_ngcontent-%COMP%]{border-color:#9746ff!important}.photo-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;position:absolute;width:32px;height:32px;box-sizing:border-box;background-clip:padding-box;border-radius:50%;padding:calc((.2rem + 0px) * var(--velt-base-rem-unit))!important;transition:top .12s ease-in-out,width .12s ease-in-out,height .12s ease-in-out,transform .12s ease-in-out;text-transform:capitalize}.photo-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:50%;object-fit:cover}.photo-placeholder[_ngcontent-%COMP%]{z-index:2;opacity:.8} snippyly-user-avatar.tag-user-avatar{background-color:#a259fe!important} snippyly-user-avatar.tag-user-avatar .s-user-avatar-initial{font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))!important} .snippyly-tag-dialog-overlay-panel{z-index:2147483567!important}"],changeDetection:0});let a=r;return a})();function ln(a,r){if(a&1){let o=x();_(0,"div",1),A("pointerup",function(e){return T(o),h().togglePinSelection(),S(e.stopPropagation())})("pointerdown",function(e){return T(o),S(e.stopPropagation())})("click",function(e){return T(o),S(e.stopPropagation())})("cdkDragStarted",function(){T(o);let e=h();return S(e.onPinDragStart())})("cdkDragMoved",function(e){T(o);let n=h();return S(n.onPinMove(e))})("cdkDragReleased",function(){T(o);let e=h();return S(e.onPinRelease())}),_(1,"snippyly-tag-pin",2),A("saveTag",function(e){T(o);let n=h();return S(n.saveTag(e))}),P()()}if(a&2){let o=h();Vt("top",o.annotationDraging?(o.dragPosition==null?null:o.dragPosition.top)-16:(o.tagPinAnnotation==null||o.tagPinAnnotation.position==null?null:o.tagPinAnnotation.position.top)-16+o.offsetTop,"px")("left",o.annotationDraging?(o.dragPosition==null?null:o.dragPosition.left)-16:(o.tagPinAnnotation==null||o.tagPinAnnotation.position==null?null:o.tagPinAnnotation.position.left)-16+o.offsetLeft,"px"),st("pin-dragging",o.annotationDraging),u("id","tag-pin-contianer-"+(o.tagPinAnnotation==null?null:o.tagPinAnnotation.annotationId))("cdkDragDisabled",(o.tagPinAnnotation==null||o.tagPinAnnotation.from==null?null:o.tagPinAnnotation.from.userId)!==(o.user==null?null:o.user.userId)),v(),u("tagPinAnnotation",o.tagPinAnnotation)("tagPinSelected",o.selectedAnnotationsMap[o.tagPinAnnotation==null?null:o.tagPinAnnotation.annotationId]&&!o.annotationDraging&&o.objectKeys(o.selectedAnnotationsMap).length===1)("multipleTagPinSelected",o.selectedAnnotationsMap[o.tagPinAnnotation==null?null:o.tagPinAnnotation.annotationId]&&o.objectKeys(o.selectedAnnotationsMap).length>1)("targetElement",o.targetElement)("user",o.user)}}var Ot=(()=>{let r=class r{get tagPinAnnotation(){return this._tagPinAnnotation}set tagPinAnnotation(t){this._tagPinAnnotation=t,this.id=t.annotationId}constructor(t,e,n,i,l){this.analyticsService=t,this.authService=e,this.domService=n,this.tagService=i,this.loggingService=l,this.multipleTagPinsSelected=!1,this.avatarErrorImage="",this.offsetLeft=0,this.offsetTop=0,this.objectKeys=Object.keys,this.selectedAnnotationsMap={},this.subscriptions=[],this.annotationDraging=!1,this.dragPosition=null,this.veltElement=!0,this.subscriptions.push(this.authService.getUser$().subscribe(s=>{this.user=s},s=>{this.loggingService.catch("Error in TagPinPortalComponent getUser$ subscription: ",s)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(s=>{this.selectedAnnotationsMap=s},s=>{this.loggingService.catch("Error in TagPinPortalComponent getSelectedAnnotationsMap$ subscription: ",s)}))}ngOnInit(){}togglePinSelection(){try{this.domService.toggleAnnotationSelection(this.tagPinAnnotation)}catch(t){this.loggingService.catch("Error in TagPinPortalComponent togglePinSelection: ",t)}}onPinDragStart(){this.selectedAnnotationsMap[this.tagPinAnnotation.annotationId]&&this.domService.toggleAnnotationSelection(this.tagPinAnnotation);let t=document.getElementById(this.tagPinAnnotation.annotationId);t&&(this.parentElement=t.parentElement,document.body.appendChild(t)),this.annotationDraging=!0}onPinMove(t){try{this.updateCurrentPinPosition(t)}catch(e){this.loggingService.catch("Error in TagPinPortalComponent onPinMove: ",e)}}updateCurrentPinPosition(t){try{this.domService.removeHighlightFromElement(this.targetElement);let e=t.event,n=e?.touches?.length?e.touches[0]?.clientX:e.clientX,i=e?.touches?.length?e.touches[0]?.clientY:e.clientY,l=this.domService.getBackgroundElement(n,i);l&&(this.targetElement=l,this.domService.highlightElement(this.targetElement),this.pointerMoveEvent=t.event,this.dragPosition={top:i,left:n})}catch(e){this.loggingService.catch("Error in TagPinPortalComponent updateCurrentPinPosition: ",e)}}onPinRelease(){try{let t=document.getElementById(this.tagPinAnnotation.annotationId);t&&this.parentElement&&this.parentElement.appendChild(t);let e=this.domService.getElementFromXPath(this.tagPinAnnotation.targetElement?.xpath);this.pointerMoveEvent&&(this.tagPinAnnotation.targetElement=this.domService.getTargetElementForCursorPosition(this.pointerMoveEvent));let n=this.domService.getElementFromXPath(this.tagPinAnnotation.targetElement?.xpath),i=this.domService.isElementInsideAdditionalLocationContainer(e)||this.domService.isElementInsideAdditionalLocationContainer(n);this.tagService.updateTag(this.tagPinAnnotation,!1,i),setTimeout(()=>{this.annotationDraging=!1,this.dragPosition=null,this.domService.removeHighlightFromElement(this.targetElement)},100),this.analyticsService.trackEvent(b.Events.Tag.TAG_DRAGGED,{annotationId:this.tagPinAnnotation.annotationId})}catch(t){this.loggingService.catch("Error in TagPinPortalComponent onPinRelease: ",t)}}saveTag(t){}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(t){this.loggingService.catch("Error in TagPinPortalComponent ondestroy: ",t)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(t=>{t.unsubscribe()}),this.subscriptions=[]}catch(t){this.loggingService.catch("Error in TagPinPortalComponent unsubscribe: ",t)}}};r.\u0275fac=function(e){return new(e||r)(m(B),m(U),m(L),m(w),m(p))},r.\u0275cmp=k({type:r,selectors:[["snippyly-tag-pin-portal"]],hostVars:2,hostBindings:function(e,n){e&2&&(Rt("id",n.id),M("data-velt-element",n.veltElement))},inputs:{tagPinAnnotation:"tagPinAnnotation",multipleTagPinsSelected:"multipleTagPinsSelected",avatarErrorImage:"avatarErrorImage",user:"user",offsetLeft:"offsetLeft",offsetTop:"offsetTop",targetElement:"targetElement"},standalone:!1,decls:1,vars:1,consts:[["class","tag-pin-portal","cdkDrag","","cdkDragHandle","",3,"id","pin-dragging","top","left","cdkDragDisabled","pointerup","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased",4,"ngIf"],["cdkDrag","","cdkDragHandle","",1,"tag-pin-portal",3,"pointerup","pointerdown","click","cdkDragStarted","cdkDragMoved","cdkDragReleased","id","cdkDragDisabled"],[3,"saveTag","tagPinAnnotation","tagPinSelected","multipleTagPinSelected","targetElement","user"]],template:function(e,n){e&1&&O(0,ln,2,13,"div",0),e&2&&u("ngIf",n.tagPinAnnotation==null?null:n.tagPinAnnotation.position)},dependencies:[H,Kt,Xt,At],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{position:absolute!important;top:0!important;left:0!important;box-sizing:border-box!important;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset!important;width:unset!important;text-align:left!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;height:unset;width:unset;text-align:left!important;line-height:1.5!important;color:#000!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:empty{display:revert!important}.tag-pin-portal[_ngcontent-%COMP%]{position:absolute;transform:none!important;transform-origin:0 0!important;transform-box:fill-box!important;top:0;left:0}.tag-pin-portal.pin-dragging[_ngcontent-%COMP%]{position:fixed;z-index:2147483557!important}"],changeDetection:0});let a=r;return a})();var xe=(()=>{let r=class r{constructor(t,e,n,i,l){this.domService=t,this.componentFactoryResolver=e,this.injector=n,this.appRef=i,this.loggingService=l,this.tagsPinById={}}setTagPin(t){try{if(!this.tagsPinById[t.annotationId])this.setPinPortal(t);else if(t.targetElement?.xpath===this.tagsPinById[t.annotationId]?.annotation?.targetElement?.xpath){let e=this.tagsPinById[t.annotationId].portalRef,n=this.tagsPinById[t.annotationId].userTargetElement,i=this.tagsPinById[t.annotationId].pinHostElement;if(document.body.contains(n)&&document.body.contains(i))e&&(e.instance.tagPinAnnotation=JSON.parse(JSON.stringify(t)),this.updateElementOffset(t));else{let l=this.tagsPinById[t.annotationId].pinHostDomPortalOutlet;l&&(this.tagsPinById[t.annotationId].pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST),this.tagsPinById[t.annotationId].pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC),l.detach(),delete this.tagsPinById[t.annotationId],this.setPinPortal(t))}}else{let e=this.tagsPinById[t.annotationId].pinHostDomPortalOutlet;e&&(this.tagsPinById[t.annotationId].pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST),this.tagsPinById[t.annotationId].pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC),e.detach(),delete this.tagsPinById[t.annotationId],this.setPinPortal(t))}}catch(e){this.loggingService.catch("Error in TagPinPortalService setTagPin: ",e)}}setPinPortal(t){try{let e=this.domService.getXPath(t.targetElement?.xpath);if(e){let n=e.iterateNext();if(n){let i=this.domService.getHostElement(n),l=new Qt(Ot),s=new qt(i,this.appRef,this.injector),c=s.attach(l);c.instance.tagPinAnnotation=JSON.parse(JSON.stringify(t)),c.instance.targetElement=n,this.tagsPinById[t.annotationId]={pinHostDomPortalOutlet:s,pinPortal:l,portalRef:c,annotation:JSON.parse(JSON.stringify(t)),userTargetElement:n,pinHostElement:i},i.setAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST,t.annotationId),window.getComputedStyle(i).position==="static"&&(me(i)||i.setAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC,"true")),this.updateElementOffset(t)}}}catch(e){this.loggingService.catch("Error in TagPinPortalService setPinPortal: ",e)}}updateElementOffset(t){try{let{portalRef:e,userTargetElement:n,pinHostElement:i}=this.tagsPinById[t.annotationId],l=this.domService.getElementOffset(n,i);e.instance.offsetLeft=l.offsetLeft,e.instance.offsetTop=l.offsetTop}catch(e){this.loggingService.catch("Error in TagPinPortalService updateElementOffset: ",e)}}checkPinsToRemove(t){try{let e=t.map(n=>n.annotationId);Object.keys(this.tagsPinById).forEach(n=>{if(!e.includes(n)){let i=this.tagsPinById[n];i.pinHostDomPortalOutlet.detach(),i.pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST),i.pinHostElement?.removeAttribute(d.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC),this.domService.removeHighlightFromElement(i.pinHostElement),delete this.tagsPinById[n]}})}catch(e){this.loggingService.catch("Error in TagPinPortalService checkPinsToRemove: ",e)}}};r.\u0275fac=function(e){return new(e||r)(f(L),f(Dt),f(xt),f(Bt),f(p))},r.\u0275prov=rt({token:r,factory:r.\u0275fac,providedIn:"root"});let a=r;return a})();var mt=(()=>{let r=class r{get pinHighlighterClass(){return this._pinHighlighterClass}set pinHighlighterClass(t){this._pinHighlighterClass=t,this.domService.setPinHighlighterClass(t)}constructor(t,e,n,i,l,s){this.analyticsService=t,this.authService=e,this.domService=n,this.tagService=i,this.tagPinPortalService=l,this.loggingService=s,this._pinHighlighterClass=null,this.tagPinAnnotations=[],this.subscriptions=[],this.isFirstComponent=!0,this.selectedAnnotationsMap={},this.tagAnnotationFocused=!1,this.veltId=ce(),this.veltElement=!0;try{this.loggingService.log("%c[WB] Creating CLASS: TagsContainerComponent","color: blue;");let c=new URL(window.location.href);this.focusTagAnnotationId=c.searchParams.get(d.URL_PARAMS.TAG_ID)}catch(c){this.loggingService.catch("Error in TagsContainerComponent constructor: ",c)}}ngOnInit(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnInit","color: green;")}ngAfterViewInit(){try{let t=document.querySelector(d.TAGS.SNIPPYLY_TAGS),e=document.querySelector(d.TAGS.VELT_TAGS);e?this.veltId===e?.getAttribute(d.ATTRIBUTES.VELT_ID)&&(this.isFirstComponent=!0,this.initComponent()):this.veltId===t?.getAttribute(d.ATTRIBUTES.VELT_ID)&&(this.isFirstComponent=!0,this.initComponent())}catch(t){this.loggingService.catch("Error in TagsContainerComponent AfterViewInit: ",t)}}initComponent(){try{this.subscriptions.push(this.authService.getUser$().pipe(D(t=>!!t)).subscribe(t=>{t&&this.setTagInstalledInAnalytics()},t=>{this.loggingService.catch("Error in getUser: ",t)})),this.subscriptions.push(this.domService.getSelectedAnnotationsMap$().subscribe(t=>{this.selectedAnnotationsMap=t},t=>{this.loggingService.catch("Error in TagsContainerComponent getSidebarVisibility$ subscription: ",t)})),this.getAllTagsOnCurrentDocument()}catch(t){this.loggingService.catch("Error in TagsContainerComponent initComponent: ",t)}}getAllTagsOnCurrentDocument(){this.loggingService.log("%c[WB] Calling FUNCTION: getAllTagsOnCurrentDocument","color: green;");try{this.subscriptions.push(this.tagService.getAllTagAnnotations().pipe(D(t=>!!t),C(t=>this.domService.getSelectedAnnotationsMap$().pipe(I(e=>({annotations:t,selectedAnnotationsMap:e||{}}))))).subscribe(t=>{try{this.loggingService.log(t),this.tagPinAnnotations=t?.annotations;let e=this.tagPinAnnotations.filter(n=>n.targetElement);e=e.filter(n=>!(n.resolved&&!t.selectedAnnotationsMap[n.annotationId])),this.tagPinPortalService.checkPinsToRemove(e),e.forEach(n=>{this.tagPinPortalService.setTagPin(n)}),this.focusTagAnnotation()}catch(e){this.loggingService.catch("Error in TagsContainerComponent getAllTagsOnCurrentDocument inside subscription: ",e)}},t=>{this.loggingService.catch("Error in TagsContainerComponent getAllTagsOnCurrentDocument subscription: ",t)}))}catch(t){this.loggingService.catch("Error in TagsContainerComponent getAllTagsOnCurrentDocument: ",t)}}ngOnDestroy(){this.loggingService.log("%c[WB] Calling FUNCTION: ngOnDestroy","color: green;");try{this.unsubscribe()}catch(t){this.loggingService.catch("Error in TagsContainerComponent ondestroy: ",t)}}unsubscribe(){this.loggingService.log("%c[WB] Calling FUNCTION: unsubscribe","color: green;");try{this.subscriptions.map(t=>{t.unsubscribe()}),this.subscriptions=[]}catch(t){this.loggingService.catch("Error in TagsContainerComponent unsubscribe: ",t)}}focusTagAnnotation(){if(this.focusTagAnnotationId&&!this.tagAnnotationFocused){let t=this.tagPinAnnotations.find(e=>e.annotationId===this.focusTagAnnotationId);t&&(this.tagAnnotationFocused=!0,this.selectedAnnotationsMap[t.annotationId]||this.domService.toggleAnnotationSelection(t),setTimeout(()=>{let e=null;t.targetElement?e=document.getElementById(`tag-pin-contianer-${t.annotationId}`):e=document.querySelector(`[data-velt-id='${t.annotationId}']`),e&&e.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})},100))}}setTagInstalledInAnalytics(){try{this.analyticsService.setInstalledFeature(V.TAG)}catch(t){this.loggingService.catch("Error in TagsContainerComponent setTagInstalledInAnalytics: ",t)}}};r.\u0275fac=function(e){return new(e||r)(m(B),m(U),m(L),m(w),m(xe),m(p))},r.\u0275cmp=k({type:r,selectors:[["app-tags-container"]],hostVars:2,hostBindings:function(e,n){e&2&&M("data-velt-id",n.veltId)("data-velt-element",n.veltElement)},inputs:{pinHighlighterClass:"pinHighlighterClass"},standalone:!1,decls:0,vars:0,template:function(e,n){},encapsulation:2,changeDetection:0});let a=r;return a})();var ht=class extends Oe{constructor(r){super(r),this.getService(p).log("%c[WB] Creating CLASS: TagElement","color: blue;"),this.getAllTagAnnotations=this._getAllTagAnnotations,this.deleteTag=this._deleteTag,this.allowedElementIds=this._allowedElementIds,this.attachTag=this._attachTag,this.addTagModeChange=this._addTagModeChange}_getAllTagAnnotations(r,o){this.getService(p).log("%c[WB] Calling FUNCTION: getOnlineUsers","color: green;");try{return this.trackEvent(b.Events.Tag.GET_ALL_TAG_ANNOTATIONS_TRIGGERED,{payload:{documentId:r,location:o}}),this.getService(w).getAllTagAnnotations(r,o)}catch(t){return this.getService(p).catch("Error in _getLiveTagsOnCurrentDocument: ",t),E(null)}}_deleteTag(){this.getService(p).log("%c[WB] Calling FUNCTION: deleteTag","color: green;");try{this.trackEvent(b.Events.Tag.DELETE_TAG_TRIGGERED),this.getService(w).deleteTagPinAnnotations("tagElement")}catch(r){this.getService(p).catch("Error in _deleteTag: ",r)}}_allowedElementIds(r){this.getService(p).log("%c[WB] Calling FUNCTION: allowedElementIds","color: green;");try{this.trackEvent(b.Events.Tag.ALLOWED_ELEMENT_IDS_TRIGGERED,{payload:{elementIds:r}}),this.getService(w).setAllowedElementIds(r)}catch(o){this.getService(p).catch("Error in allowedElementIds: ",o)}}_attachTag(r){this.getService(p).log("%c[WB] Calling FUNCTION: attachTag","color: green;");try{this.trackEvent(b.Events.Tag.ATTACH_TAG_TRIGGERED,{payload:{elementId:r}}),this.getService(w).attachTag(r,["id","data-id"])}catch(o){this.getService(p).catch("Error in _attachTag: ",o)}}_addTagModeChange(){this.getService(p).log("%c[WB] Calling FUNCTION: addTagModeChange","color: green;");try{return this.trackEvent(b.Events.Tag.ADD_TAG_MODE_CHANGE_TRIGGERED),this.getService(w).addTagModeChange()}catch(r){return this.getService(p).catch("Error in _addTagModeChange: ",r),E(!1)}}};var De=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=kt({type:r}),r.\u0275inj=wt({imports:[Yt,ne,Jt,Ie]});let a=r;return a})();function dn(a){a.get(p).log("%c[WB] Loading tag feature chunk","color: blue;");let t=Mt(De,a).injector;return ut(t,d.TAGS.VELT_TAG_TOOL,pt),ut(t,d.TAGS.SNIPPYLY_TAG_TOOL,pt),ut(t,d.TAGS.VELT_TAGS,mt),ut(t,d.TAGS.SNIPPYLY_TAGS,mt),new ht(a)}function ut(a,r,o){if(customElements.get(r))return;let t=ie(o,{injector:a});customElements.define(r,t)}export{dn as default};
@@ -1,2 +1,2 @@
1
- import{a as We}from"./chunk-OWD3J56P.js";import{b as Ye}from"./chunk-UF2D32ZI.js";import{b as $e,j as Ge,t as Je}from"./chunk-N3AV6IGG.js";import"./chunk-P54MO3GU.js";import{l as Ue}from"./chunk-JDZOVFS3.js";import"./chunk-XM2SXO32.js";import"./chunk-YFZUZKVN.js";import"./chunk-SG6UCHMH.js";import"./chunk-CZTTDJFW.js";import"./chunk-7MOQQG4Z.js";import{b as He,d as Ze}from"./chunk-GNMKNWD5.js";import{a as Ke}from"./chunk-SXYSM6QP.js";import{a as De}from"./chunk-AIQ4EOVH.js";import{I as xe,W as Me,X as Ee,Y as Te,ba as Oe,ca as Ne,da as Q,ea as Fe,ga as ze}from"./chunk-N2SSZ74J.js";import{$ as me,Bf as V,De as L,E as ie,Fa as s,Fc as _e,Fh as J,Gc as ye,Hc as be,Hi as je,Ic as Se,J as ne,Jb as G,Kb as Z,Mc as Ie,Nb as m,Ob as D,Pa as g,Pb as M,Pc as we,T as R,Ta as ge,Ua as H,Va as he,Xe as ke,Ya as Ce,_a as U,_b as fe,a as ae,aa as ue,ai as Le,bi as K,ca as E,ci as A,db as $,di as Y,g as ce,ge as Pe,ha as b,ia as S,ja as w,ka as j,kc as p,ki as Ve,l as le,lb as u,lc as d,li as W,mb as a,nb as c,ob as C,p as te,pc as oe,pg as Be,r as pe,sb as k,se as O,si as Re,tb as B,te as Ae,uh as P,v as de,vb as T,wa as ve,xb as x,xi as q,zb as h}from"./chunk-NFOSJ24G.js";var Qe=(()=>{let r=class r{constructor(e,t,o,l,_,I,N,ee){this.authService=e,this.configService=t,this.contactService=o,this.docService=l,this.commonDbService=_,this.databaseService=I,this.loggingService=N,this.notificationService=ee,this.documentUsers$=new le([]);try{this.databaseService.getDb().pipe(ie(y=>!!y),ne(1)).subscribe(y=>{y&&this.subscribeUsersFromDocument()}),this.authService.getUser$().subscribe(y=>{if(y?.email){this.subscribeUsersFromDocument();let z=V(y.email);y?.organizationId&&(z=V(y.userId)),this.getDocumentUserByIdFromDb(z).then(f=>{f&&(f.user.name=y.name,f.user.photoUrl=y.photoUrl,this.updateDocumentUser(f))}).catch(f=>{this.loggingService.catch("Error in DocumentUserAccessService getDocumentUserByIdFromDb:",f)})}},y=>{this.loggingService.catch("Error in DocumentUserAccessService getUser$:",y)})}catch(y){this.loggingService.catch("Error in DocService constructor:",y)}}getDocumentUserByIdFromDb(e){return ce(this,null,function*(){try{let t=this.docService.getDocumentPaths();return t?(yield this.commonDbService.dbListener({feature:"documentUser",properties:{documentId:t?.documentId,organizationId:t?.organizationId,isCollection:!1,id:e}}).pipe(ne(1)).toPromise())?.data:void 0}catch(t){this.loggingService.catch("Error in DocService getDocumentUserById:",t);return}})}subscribeUsersFromDocument(){try{this.documentUsersSubscription&&this.documentUsersSubscription.unsubscribe(),this.documentUsersSubscription=this.authService.getUser$().pipe(R(e=>e?this.docService.getDocumentPaths$().pipe(ie(t=>!!t),R(t=>this.commonDbService.dbListener({feature:"allDocumentUsers",properties:{documentId:t?.documentId,organizationId:t?.organizationId,isCollection:!0}}).pipe(de(o=>o?.data?Object.values(o?.data):[])))):pe([]))).subscribe(e=>{this.documentUsers$.next(e)},e=>{this.loggingService.catch("Error in DocService subscribeUsersFromDocument subscription:",e)})}catch(e){this.loggingService.catch("Error in DocService subscribeUsersFromDocument:",e)}}getDocumentUsers$(){return this.documentUsers$.asObservable()}addDocumentUser(e){try{let t=this.authService.getUser();if(t){if(this.configService.getSF()){if(e?.role?.name===O.ADMIN)this.contactService.addGlobalContact(e.user);else if(e?.role?.name===O.COMMENTER){let l=t.groupId;if(l){let _=JSON.parse(JSON.stringify(e.user));_.visibility="group",this.contactService.setLoggedInUserGroupContacts(l,[_])}}}e.id=V(e?.user?.email),e.invitedBy=t,e.invitedDate=this.timestamp;let o=this.docService.getDocumentPaths();o&&this.commonDbService.updateData({feature:"documentUserAccess",properties:{id:e.id,documentId:o?.documentId??"",organizationId:o?.organizationId??""},data:JSON.parse(JSON.stringify(e))}),this.updateNotificationsDatabase(e)}else this.loggingService.error("Error in DocService addDocumentUser: User not found")}catch(t){this.loggingService.catch("Error in DocService addDocumentUser:",t)}}updateDocumentUser(e,t={}){try{let o=this.authService.getUser();if(o){e.updatedBy=o,e.updatedDate=this.timestamp;let l=this.docService.getDocumentPaths();this.commonDbService.updateData({feature:"documentUserAccess",properties:{id:e.id,documentId:l?.documentId??"",organizationId:l?.organizationId??""},data:JSON.parse(JSON.stringify(e))}),this.updateNotificationsDatabase(e)}}catch(o){this.loggingService.catch("Error in DocumentUserAccessService updateDocumentUser:",o)}}removeDocumentUser(e){try{let t=this.docService.getDocumentPaths();this.commonDbService.deleteData({feature:"documentUserAccess",properties:{id:e.id,documentId:t?.documentId??"",organizationId:t?.organizationId??""}})}catch(t){this.loggingService.catch("Error in DocumentUserAccessService removeDocumentUser:",t)}}updateNotificationsDatabase(e={}){try{let t=ae({notificationSource:"user"},e);this.notificationService.updateNotificationDatabase(t)}catch(t){this.loggingService.catch("Error in DocumentUserAccessService updateNotificationsDatabase: ",t)}}get timestamp(){return this.commonDbService.getServerTimestamp()}};r.\u0275fac=function(t){return new(t||r)(E(W),E(Y),E(Ne),E(q),E(je),E(Re),E(A),E(Ye))},r.\u0275prov=me({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();function ct(n,r){if(n&1){let i=T();k(0),a(1,"div",23)(2,"div",24),m(3),c(),a(4,"div",25),x("click",function(){let t=b(i).$implicit,o=h();return S(o.removeSelectedUserToInvite(t))}),w(),a(5,"svg",26),C(6,"path",7),c()()(),B()}if(n&2){let i=r.$implicit;s(3),D((i==null||i.user==null?null:i.user.name)||(i==null||i.user==null?null:i.user.email))}}function lt(n,r){if(n&1){let i=T();k(0),a(1,"div",31),x("click",function(){let t=b(i).$implicit,o=h(2);return S(o.selectRole(t))}),w(),a(2,"svg",32),C(3,"path",33),c(),j(),a(4,"div")(5,"h4"),m(6),p(7,"translate"),c(),a(8,"p"),m(9),p(10,"translate"),c()()(),B()}if(n&2){let i=r.$implicit,e=r.first,t=h(2);s(),Z("border-top",!e),s(),G("visibility",(t.selectedUserRole==null?null:t.selectedUserRole.id)===(i==null?null:i.id)?"visible":"hidden"),s(4),D(d(7,6,i==null?null:i.name)),s(3),D(d(10,8,i==null?null:i.description))}}function pt(n,r){if(n&1&&(a(0,"div",27)(1,"div",28),U(2,lt,11,10,"ng-container",12),c(),m(3),p(4,"translate"),w(),a(5,"svg",29),C(6,"path",30),c()()),n&2){let i=h();Z("disabled",!i.isUserAdmin),s(2),u("ngForOf",i.userRoles),s(),M(" ",d(4,4,i.selectedUserRole==null?null:i.selectedUserRole.name)," ")}}function dt(n,r){n&1&&(w(),a(0,"svg",32),C(1,"path",44),c())}function mt(n,r){if(n&1&&(a(0,"div",41),m(1),p(2,"translate"),U(3,dt,2,0,"svg",43),c()),n&2){let i=h().$implicit,e=h(2);s(),M(" ",d(2,2,i==null||i.role==null?null:i.role.name)," "),s(2),u("ngIf",e.isUserAdmin&&(i==null||i.user==null?null:i.user.email)!==(e.user==null?null:e.user.email))}}function ut(n,r){if(n&1){let i=T();a(0,"div",28)(1,"div",45),x("click",function(){b(i);let t=h().$implicit,o=h(2);return S(o.removeUser(t))}),m(2),p(3,"translate"),c()()}n&2&&(s(2),M(" ",d(3,1,"Remove")," "))}function vt(n,r){if(n&1&&(k(0),a(1,"div",38)(2,"div",39),C(3,"snippyly-user-avatar",40),m(4),c(),a(5,"div",41)(6,"app-overlay-tooltip",42),U(7,mt,4,4,"ng-template",null,1,oe)(9,ut,4,3,"ng-template",null,2,oe),c()()(),B()),n&2){let i=r.$implicit,e=h(2);s(3),u("user",i==null?null:i.user)("background","#625DF5"),s(),M(" ",(i==null||i.user==null?null:i.user.name)||(i==null||i.user==null?null:i.user.email)," "),s(2),u("disabled",!(e.isUserAdmin&&(i==null||i.user==null?null:i.user.email)!==(e.user==null?null:e.user.email)))}}function gt(n,r){n&1&&(k(0),a(1,"div"),m(2),p(3,"translate"),c(),B()),n&2&&(s(2),D(d(3,1,"No users are added.")))}function ht(n,r){if(n&1&&(a(0,"div",34)(1,"div",35),m(2),p(3,"translate"),c(),U(4,vt,11,4,"ng-container",36)(5,gt,4,3,"ng-container",37),c()),n&2){let i=h();s(2),D(d(3,4,"People on this project")),s(2),u("ngForOf",i.documentUsers)("ngForTrackBy",i.trackByDocumentUserId),s(),u("ngIf",!(i.documentUsers!=null&&i.documentUsers.length))}}function Ct(n,r){if(n&1&&(k(0),a(1,"div",38)(2,"div",39),C(3,"snippyly-user-avatar",40),m(4),p(5,"translate"),c()(),B()),n&2){let i=r.$implicit;s(3),u("user",i)("background","#625DF5"),s(),M(" ",d(5,3,(i==null?null:i.name)||(i==null?null:i.email))," ")}}function ft(n,r){if(n&1&&(a(0,"div",38)(1,"div",39),C(2,"snippyly-user-avatar",40),m(3),p(4,"translate"),c(),a(5,"div",27),m(6),p(7,"translate"),c()()),n&2){let i=h().$implicit;s(2),u("user",i)("background","#625DF5"),s(),M(" ",d(4,4,(i==null?null:i.name)||(i==null?null:i.email))," "),s(3),M(" ",d(7,6,"Invited")," ")}}function _t(n,r){if(n&1&&(k(0),U(1,ft,8,8,"div",46),B()),n&2){let i=r.$implicit,e=h(2);s(),u("ngIf",!e.huddleUsersByEmailMap[i==null?null:i.email])}}function yt(n,r){if(n&1&&(a(0,"div",34)(1,"div",35),m(2),p(3,"translate"),c(),U(4,Ct,6,5,"ng-container",36)(5,_t,2,1,"ng-container",36),c()),n&2){let i=h();s(2),D(d(3,5,"People on this huddle")),s(2),u("ngForOf",i.huddleUsers)("ngForTrackBy",i.trackByHuddleUserId),s(),u("ngForOf",i.huddleInvitees)("ngForTrackBy",i.trackByHuddleInviteeId)}}function bt(n,r){if(n&1){let i=T();a(0,"div",47)(1,"div",48),m(2),p(3,"translate"),c(),a(4,"div",49)(5,"div",28)(6,"div",31),x("click",function(){b(i);let t=h();return S(t.changeDocumentAccessType(t.DocumentAccessTypes.PUBLIC))}),w(),a(7,"svg",32),C(8,"path",33),c(),j(),a(9,"div")(10,"h3"),m(11),p(12,"translate"),p(13,"titlecase"),c(),a(14,"p"),m(15),p(16,"translate"),c()()(),a(17,"div",45),x("click",function(){b(i);let t=h();return S(t.changeDocumentAccessType(t.DocumentAccessTypes.RESTRICTED))}),w(),a(18,"svg",32),C(19,"path",33),c(),j(),a(20,"div")(21,"h3"),m(22),p(23,"translate"),p(24,"titlecase"),c(),a(25,"p"),m(26),p(27,"translate"),c()()()(),w(),a(28,"svg",32),C(29,"path",50)(30,"path",51)(31,"path",52),c(),j(),a(32,"div",53)(33,"h3"),m(34),p(35,"translate"),p(36,"titlecase"),c(),a(37,"p"),m(38),p(39,"translate"),c()()()()}if(n&2){let i=h();s(2),D(d(3,11,"General access")),s(5),G("visibility",!i.documentAccessType||i.documentAccessType===i.DocumentAccessTypes.PUBLIC?"visible":"hidden"),s(4),D(d(13,15,d(12,13,i.DocumentAccessTypes.PUBLIC))),s(4),D(d(16,17,i.documentAccessTypeMap[i.DocumentAccessTypes.PUBLIC]==null?null:i.documentAccessTypeMap[i.DocumentAccessTypes.PUBLIC].description)),s(3),G("visibility",i.documentAccessType===i.DocumentAccessTypes.RESTRICTED?"visible":"hidden"),s(4),D(d(24,21,d(23,19,i.DocumentAccessTypes.RESTRICTED))),s(4),D(d(27,23,i.documentAccessTypeMap[i.DocumentAccessTypes.RESTRICTED]==null?null:i.documentAccessTypeMap[i.DocumentAccessTypes.RESTRICTED].description)),s(8),D(d(36,27,d(35,25,i.documentAccessType||i.DocumentAccessTypes.PUBLIC))),s(4),M("",d(39,29,i.documentAccessTypeMap[i.documentAccessType?i.documentAccessType:i.DocumentAccessTypes.PUBLIC]==null?null:i.documentAccessTypeMap[i.documentAccessType?i.documentAccessType:i.DocumentAccessTypes.PUBLIC].description)," ")}}function St(n,r){n&1&&(w(),a(0,"svg",54),C(1,"path",55),c())}function It(n,r){n&1&&(w(),a(0,"svg",56),C(1,"path",57),c())}var se=(()=>{let r=class r{constructor(e,t,o,l,_,I,N,ee,y,z,f){this.analyticsService=e,this.authService=t,this.configService=o,this.docService=l,this.documentUserAccessService=_,this.serviceBook=I,this.loggingService=N,this.iamService=ee,this.toastService=y,this.dialogRef=z,this.usersToInvite=[],this.documentUsers=[],this.huddleInvitees=[],this.huddleUsers=[],this.huddleUsersByEmailMap={},this.userRoles=[],this.excludeContacts=[],this.linkCopied=!1,this.hideAccessControlDropdown=!1,this.subscriptions=[],this.title="Share project",this.placeholder="Add email address",this.documentAccessType="",this.DocumentAccessTypes=Ae,this.isUserAdmin=!1,this.documentAccessTypeMap=L.DocumentAccessTypeMap,this.documentUserAccessList=!0,this.veltElement=!0;try{f&&(this.hideAccessControlDropdown=!!f.hideAccessControlDropdown,this.type=f.type,this.source=f.source,f.title&&(this.title=f.title),f.placeholder&&(this.placeholder=f.placeholder),this.documentUserAccessList=!!f.documentUserAccessList,this.inviteUrl=f.inviteUrl),this.subscriptions.push(this.authService.getUser$().subscribe(v=>{this.user=v})),this.subscriptions.push(this.iamService.isUserAdmin$().subscribe(v=>{this.isUserAdmin=v})),this.subscriptions.push(this.configService.getSF$().subscribe(v=>{v?this.documentAccessTypeMap=L.DocumentAccessTypeMapSF:this.documentAccessTypeMap=L.DocumentAccessTypeMap})),this.type!=="invite"&&this.subscriptions.push(this.documentUserAccessService.getDocumentUsers$().subscribe(v=>{this.documentUsers=v,this.updateExcludeContacts()})),this.type!=="invite"&&this.subscriptions.push(this.iamService.getRoles$().subscribe(v=>{this.userRoles=v,this.userRoles?.length&&(this.selectedUserRole=this.userRoles?.find(F=>F.name===O.COMMENTER))})),this.type!=="invite"&&this.subscriptions.push(this.iamService.getDocumentIAM$().subscribe(v=>{this.documentAccessType=this.docService.getDocumentAccessType(v)})),this.type==="invite"&&(this.subscriptions.push(this.serviceBook.observe(J).pipe(R(v=>v?.getHuddleAttendees$()??te)).subscribe(v=>{this.huddleUsers=v,this.huddleUsersByEmailMap={},v.forEach(F=>{F.email&&(this.huddleUsersByEmailMap[F.email]=F)})})),this.subscriptions.push(this.serviceBook.observe(J).pipe(R(v=>v?.getHuddleInvitees$()??te)).subscribe(v=>{this.huddleInvitees=v})))}catch(v){this.loggingService.catch("Error in UserInviteDialogComponent constructor: ",v)}}ngOnInit(){try{this.dialogRef.addPanelClass("snippyly-user-invite-dialog"),this.userRoles?.length&&(this.selectedUserRole=this.userRoles?.find(e=>e.name===O.COMMENTER))}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent ngOnInit: ",e)}}updateExcludeContacts(){try{this.excludeContacts=[],this.excludeContacts.push(...this.documentUsers.map(e=>e.user)),this.excludeContacts.push(...this.usersToInvite.map(e=>e.user))}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent updateExcludeContacts: ",e)}}trackByDocumentUserId(e,t){return t.id}trackByHuddleUserId(e,t){return t.userSnippylyId||t.userId}trackByHuddleInviteeId(e,t){return t.userId||t.email}selectRole(e){try{this.selectedUserRole=e}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent selectRole: ",t)}}onUserSelected(e){try{let t=new ke;t.id=e.email?V(e.email):V(e.userId),t.user=e,this.usersToInvite.find(o=>o.id===t.id)||this.usersToInvite.push(t),this.updateExcludeContacts()}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent onUserSelected: ",t)}}inviteSelectedUsers(){try{if(this.usersToInvite?.length)if(this.type==="invite"){let e=this.usersToInvite.map(t=>t.user);this.analyticsService.trackEvent(P.Events.InviteDialog.USER_INVITED,{source:this.source}),this.serviceBook.get(J)?.inviteUsers(e),this.toastService.setToast({message:"Invitation sent!",type:"success",duration:2e3})}else{this.usersToInvite.forEach(l=>{this.selectedUserRole&&(l.role=this.selectedUserRole)});let e=this.usersToInvite.filter(l=>l.role?.name===O.ADMIN).map(l=>l.user.email),t=this.usersToInvite.filter(l=>l.role?.name===O.COMMENTER).map(l=>l.user.email),o={actionType:Pe.INVITE,userInvite:{admin:e?.length?{emails:e,emailProperties:{url:this.getInviteUrl()}}:void 0,commenter:t?.length?{emails:t,clientDocumentId:this.docService.getDocumentPaths()?.clientDocumentId,documentId:this.docService.getDocumentPaths()?.documentId,clientOrganizationId:this.user?.clientOrganizationId,organizationId:this.user?.organizationId,emailProperties:{url:this.getInviteUrl()}}:void 0}};this.documentUserAccessService.updateNotificationsDatabase(o),this.toastService.setToast({message:"Invitation sent!",type:"success",duration:2e3})}this.usersToInvite=[]}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent inviteSelectedUsers: ",e)}}removeSelectedUserToInvite(e){try{this.usersToInvite=this.usersToInvite.filter(t=>t.id!==e.id),this.updateExcludeContacts()}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent removeSelectedUserToInvite: ",t)}}updateUserRole(e,t){try{let o=e?.role?.name,l=t?.name;e.role=t,this.documentUserAccessService.updateDocumentUser(e,{oldAccess:o,newAccess:l})}catch(o){this.loggingService.catch("Error in UserInviteDialogComponent updateUserRole: ",o)}}removeUser(e){try{this.analyticsService.trackEvent(P.Events.ShareDialog.DOCUMENT_USER_ACCESS_REMOVED,{targetUserId:e?.user?.userId,targetUserEmail:e?.user?.email,roleType:e?.role?.name}),this.documentUserAccessService.removeDocumentUser(e),this.toastService.setToast({message:"User removed!",type:"success",duration:2e3})}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent removeUser: ",t)}}getInviteUrl(){try{return this.inviteUrl||window.location.href}catch(e){return this.loggingService.catch("Error in UserInviteDialogComponent getInviteUrl: ",e),""}}copyLink(){try{let e=this.getInviteUrl();this.linkCopied=!0,Be(e),setTimeout(()=>{this.linkCopied=!1},2e3),this.type==="invite"?this.analyticsService.trackEvent(P.Events.InviteDialog.INVITE_LINK_COPIED,{source:this.source}):this.type==="share"&&this.analyticsService.trackEvent(P.Events.ShareDialog.SHARE_LINK_COPIED)}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent copyLink: ",e)}}changeDocumentAccessType(e){try{this.documentAccessType!==e&&(this.analyticsService.trackEvent(P.Events.ShareDialog.DOCUMENT_ACCESS_CHANGED,{oldAccessType:this.documentAccessType,newAccessType:e}),this.docService.changeDocumentAccessType(e),this.toastService.setToast({message:"Access changed to '"+e+"'.",type:"success",duration:2e3}))}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent changeDocumentAccessType: ",t)}}closeDialog(){try{this.dialogRef.close()}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent closeDialog: ",e)}}ngOnDestroy(){try{this.subscriptions.forEach(e=>e.unsubscribe())}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent ngOnDestroy: ",e)}}};r.\u0275fac=function(t){return new(t||r)(g(K),g(W),g(Y),g(q),g(Qe),g(Le),g(A),g(Ke),g(We),g(Me),g(Ee,8))},r.\u0275cmp=H({type:r,selectors:[["snippyly-user-invite-dialog"]],hostVars:1,hostBindings:function(t,o){t&2&&$("data-velt-element",o.veltElement)},standalone:!1,decls:32,vars:27,consts:[["userSelectorRef",""],["triggerTemplate",""],["tooltipTemplate",""],[1,"s-video-settings-modal",3,"click","pointerdown","pointerup"],[1,"s-video-header"],[1,"s-video-header-name"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",1,"s-cursor-pointer",3,"click"],["fill-rule","evenodd","clip-rule","evenodd","d","M4.41076 4.41058C4.7362 4.08514 5.26384 4.08514 5.58928 4.41058L10 8.82133L14.4108 4.41058C14.7362 4.08514 15.2638 4.08514 15.5893 4.41058C15.9147 4.73602 15.9147 5.26366 15.5893 5.58909L11.1785 9.99984L15.5893 14.4106C15.9147 14.736 15.9147 15.2637 15.5893 15.5891C15.2638 15.9145 14.7362 15.9145 14.4108 15.5891L10 11.1783L5.58928 15.5891C5.26384 15.9145 4.7362 15.9145 4.41076 15.5891C4.08533 15.2637 4.08533 14.736 4.41076 14.4106L8.82151 9.99984L4.41076 5.58909C4.08533 5.26366 4.08533 4.73602 4.41076 4.41058Z","fill","#80808A"],[1,"s-video-settings-modal-item"],[1,"s-input"],[1,"s-input-chip-list-container"],[1,"s-chip-list"],[4,"ngFor","ngForOf"],[1,"s-input-user-selector",3,"optionSelected","placeholder","enableOnFocus"],["class","s-role dropdown",3,"disabled",4,"ngIf"],["class","s-video-settings-modal-item s-people-list-container",4,"ngIf"],["class","s-general-access-container",4,"ngIf"],[1,"s-buttons-wrap"],[1,"s-button","s-secondary",3,"click"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["width","20","height","20","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],[1,"s-flex-fill"],[1,"s-button","s-primary",3,"click"],[1,"s-chip"],[1,"s-chip-user"],[1,"s-chip-remove",3,"click"],["width","14","height","14","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],[1,"s-role","dropdown"],[1,"dropdown-content"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"dropdown-icon"],["fill-rule","evenodd","clip-rule","evenodd","d","M7.79289 9.79289C8.18342 9.40237 8.81658 9.40237 9.20711 9.79289L12 12.5858L14.7929 9.79289C15.1834 9.40237 15.8166 9.40237 16.2071 9.79289C16.5976 10.1834 16.5976 10.8166 16.2071 11.2071L12.7071 14.7071C12.3166 15.0976 11.6834 15.0976 11.2929 14.7071L7.79289 11.2071C7.40237 10.8166 7.40237 10.1834 7.79289 9.79289Z","fill","#D4D6DF"],[1,"dropdown-item",3,"click"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M18.7071 7.29289C19.0976 7.68342 19.0976 8.31658 18.7071 8.70711L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071L5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929C5.68342 10.9024 6.31658 10.9024 6.70711 11.2929L10 14.5858L17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289Z","fill","#80808A"],[1,"s-video-settings-modal-item","s-people-list-container"],[1,"s-people-list-title"],[4,"ngFor","ngForOf","ngForTrackBy"],[4,"ngIf"],[1,"s-user"],[1,"s-user-info"],[1,"s-flex",3,"user","background"],[1,"s-role"],[3,"disabled"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["fill-rule","evenodd","clip-rule","evenodd","d","M16.2071 9.79289C15.8166 9.40237 15.1834 9.40237 14.7929 9.79289L12 12.5858L9.20711 9.79289C8.81658 9.40237 8.18342 9.40237 7.79289 9.79289C7.40237 10.1834 7.40237 10.8166 7.79289 11.2071L11.2929 14.7071C11.6834 15.0976 12.3166 15.0976 12.7071 14.7071L16.2071 11.2071C16.5976 10.8166 16.5976 10.1834 16.2071 9.79289Z","fill","#404044"],[1,"dropdown-item","border-top",3,"click"],["class","s-user",4,"ngIf"],[1,"s-general-access-container"],[1,"s-general-access-title"],[1,"s-button","s-secondary","s-document-access-btn","dropdown"],["fill-rule","evenodd","clip-rule","evenodd","d","M12 11C10.2274 11 8.64844 11.0646 7.35838 11.1466C6.13471 11.2243 5.19379 12.158 5.10597 13.373C5.0435 14.2373 5 15.1481 5 16C5 16.8519 5.0435 17.7627 5.10597 18.627C5.19379 19.842 6.13471 20.7757 7.35838 20.8534C8.64844 20.9354 10.2274 21 12 21C13.7726 21 15.3516 20.9354 16.6416 20.8534C17.8653 20.7757 18.8062 19.842 18.894 18.627C18.9565 17.7627 19 16.8519 19 16C19 15.1481 18.9565 14.2373 18.894 13.373C18.8062 12.158 17.8653 11.2243 16.6416 11.1466C15.3516 11.0646 13.7726 11 12 11ZM7.2315 9.15059C5.01376 9.29156 3.27137 11.0124 3.11117 13.2288C3.04652 14.1234 3 15.085 3 16C3 16.915 3.04652 17.8766 3.11118 18.7712C3.27137 20.9876 5.01376 22.7084 7.23151 22.8494C8.55778 22.9337 10.1795 23 12 23C13.8205 23 15.4422 22.9337 16.7685 22.8494C18.9862 22.7084 20.7286 20.9876 20.8888 18.7712C20.9535 17.8766 21 16.915 21 16C21 15.085 20.9535 14.1234 20.8888 13.2288C20.7286 11.0124 18.9862 9.29156 16.7685 9.15059C15.4422 9.06629 13.8205 9 12 9C10.1795 9 8.55778 9.06629 7.2315 9.15059Z","fill","#777E91"],["fill-rule","evenodd","clip-rule","evenodd","d","M13 16.7324C13.5978 16.3866 14 15.7403 14 15C14 13.8954 13.1046 13 12 13C10.8954 13 10 13.8954 10 15C10 15.7403 10.4022 16.3866 11 16.7324V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V16.7324Z","fill","#777E91"],["fill-rule","evenodd","clip-rule","evenodd","d","M7 6C7 3.23858 9.23858 1 12 1C14.7614 1 17 3.23858 17 6V10C17 10.5523 16.5523 11 16 11C15.4477 11 15 10.5523 15 10V6C15 4.34315 13.6569 3 12 3C10.3431 3 9 4.34315 9 6V10C9 10.5523 8.55228 11 8 11C7.44772 11 7 10.5523 7 10V6Z","fill","#777E91"],[1,"s-document-access-btn-content"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M6.49027 2.50491C6.46607 2.50996 6.34731 2.53007 6.22635 2.54966C5.17052 2.72053 4.19457 3.45245 3.69214 4.45019C3.56689 4.69886 3.43711 5.08311 3.37864 5.3784C3.31829 5.68302 3.31829 14.3108 3.37864 14.6154C3.52088 15.3336 3.85013 15.9526 4.36233 16.4647C4.76978 16.8722 5.22723 17.1555 5.75266 17.3256C6.23219 17.4809 6.32453 17.4891 7.59205 17.4891H8.76711L8.88599 17.4104C9.06906 17.2893 9.14407 17.146 9.14407 16.9173C9.14407 16.6887 9.06909 16.5453 8.88611 16.4242L8.76728 16.3455L7.6068 16.3286C6.3852 16.3109 6.35854 16.3081 5.96566 16.1588C5.43291 15.9564 4.86723 15.3934 4.67143 14.8707C4.49992 14.4129 4.51091 14.747 4.51091 9.9969C4.51091 5.24677 4.49992 5.58091 4.67143 5.12308C4.88025 4.56564 5.45367 4.01728 6.0476 3.80712C6.46364 3.65989 6.4966 3.65865 9.67189 3.66895C12.8862 3.67939 12.6707 3.6688 13.1239 3.83838C13.3521 3.92374 13.6919 4.15074 13.8939 4.35272C14.0958 4.5547 14.3228 4.89447 14.4082 5.12264C14.5641 5.53916 14.5639 5.53763 14.5816 6.87392L14.5983 8.13484L14.6679 8.24677C14.7061 8.30835 14.791 8.39412 14.8563 8.43737C14.9554 8.50291 15.0078 8.51605 15.1701 8.51605C15.3324 8.51605 15.3848 8.50291 15.4839 8.43737C15.5492 8.39412 15.6341 8.30835 15.6723 8.24677L15.7419 8.13484V6.85925C15.7419 5.89002 15.7321 5.53438 15.7012 5.3784C15.4231 3.97403 14.4078 2.9182 13.0001 2.56948C12.7554 2.50887 12.6941 2.50764 9.64257 2.50177C7.93299 2.49849 6.51446 2.4999 6.49027 2.50491ZM10.1326 4.86732C10.0008 4.90764 9.81429 5.10144 9.77661 5.23721C9.75922 5.29976 9.74547 5.6244 9.74538 5.97344C9.74517 6.73161 9.7789 6.93488 9.97026 7.32843C10.0835 7.56132 10.1471 7.64839 10.358 7.85928C10.5687 8.06997 10.6561 8.13387 10.8888 8.24715C11.3004 8.44752 11.4993 8.4781 12.3174 8.46675L12.9899 8.4574L13.1087 8.37872C13.2923 8.25712 13.3667 8.11437 13.3667 7.88344C13.3667 7.72342 13.3533 7.6705 13.288 7.57182C13.2448 7.50646 13.159 7.42162 13.0974 7.38336C12.9898 7.31647 12.9581 7.31319 12.2817 7.29876C11.6484 7.28524 11.5646 7.27759 11.4445 7.22234C11.2497 7.13276 11.1074 6.99491 11.0146 6.80594C10.9336 6.64091 10.9327 6.63267 10.9182 5.93556C10.904 5.25876 10.9008 5.2275 10.8339 5.11986C10.6956 4.89741 10.3918 4.788 10.1326 4.86732ZM15.7049 9.14973C15.3168 9.21439 14.8688 9.42637 14.5091 9.71547C14.1903 9.97168 12.9551 11.227 12.785 11.4677C12.6151 11.708 12.4379 12.0846 12.3662 12.3575C12.2934 12.6347 12.2934 13.2178 12.3662 13.4864C12.4763 13.8923 12.7739 14.3816 12.9941 14.5185C13.1571 14.6198 13.4451 14.6146 13.6071 14.5074C13.7916 14.3853 13.8652 14.2433 13.8652 14.0094C13.8652 13.8346 13.8552 13.8007 13.7698 13.6869C13.7174 13.6169 13.6316 13.474 13.5792 13.3691C13.4922 13.1949 13.4842 13.1559 13.4861 12.9146C13.4901 12.4126 13.6018 12.2459 14.588 11.2695C15.3768 10.4885 15.479 10.4117 15.8541 10.3176C16.4471 10.1688 17.0959 10.642 17.1542 11.2659C17.1867 11.6138 17.0539 11.95 16.7418 12.3102C16.554 12.527 16.5067 12.6446 16.5261 12.8468C16.5522 13.1185 16.7716 13.3292 17.0627 13.362C17.163 13.3733 17.2272 13.3595 17.3476 13.3006C17.6751 13.1404 18.1188 12.4832 18.2617 11.9469C18.4137 11.3768 18.3213 10.7383 18.0102 10.209C17.8837 9.99361 17.4606 9.57059 17.2452 9.444C16.7724 9.16618 16.2292 9.06241 15.7049 9.14973ZM14.7568 12.1471C14.6858 12.1846 14.588 12.2715 14.5396 12.3402C14.4628 12.4494 14.4517 12.4903 14.4517 12.6643C14.4517 12.846 14.4612 12.8773 14.5601 13.021C14.869 13.4698 14.893 13.8775 14.6373 14.3344C14.5091 14.5636 13.051 16.0217 12.8218 16.15C12.3282 16.4261 11.818 16.3718 11.4502 16.0041C11.1691 15.723 11.0679 15.3616 11.1645 14.9843C11.2245 14.75 11.3364 14.5523 11.5457 14.3107C11.7336 14.0939 11.7808 13.9764 11.7614 13.7742C11.7353 13.5024 11.5159 13.2917 11.2249 13.259C11.1245 13.2476 11.0603 13.2615 10.9399 13.3204C10.6125 13.4806 10.1687 14.1377 10.0258 14.674C9.87388 15.2442 9.96627 15.8826 10.2773 16.4119C10.4039 16.6273 10.8269 17.0504 11.0423 17.177C11.5716 17.488 12.2101 17.5804 12.7802 17.4284C13.0265 17.3628 13.41 17.1783 13.6407 17.0145C13.8608 16.858 14.9432 15.8056 15.2867 15.4139C15.9653 14.64 16.1624 13.7239 15.8293 12.8919C15.562 12.2242 15.1512 11.9389 14.7568 12.1471Z","fill","#80808A"],["width","20","height","20","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M18.7071 7.29289C19.0976 7.68342 19.0976 8.31658 18.7071 8.70711L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071L5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929C5.68342 10.9024 6.31658 10.9024 6.70711 11.2929L10 14.5858L17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289Z","fill","#ABABB5"]],template:function(t,o){if(t&1){let l=T();a(0,"div",3),x("click",function(I){return b(l),S(I.stopPropagation())})("pointerdown",function(I){return b(l),S(I.stopPropagation())})("pointerup",function(I){return b(l),S(I.stopPropagation())}),a(1,"div",4)(2,"div",5),m(3),p(4,"translate"),c(),w(),a(5,"svg",6),x("click",function(){return b(l),S(o.closeDialog())}),C(6,"path",7),c()(),j(),a(7,"div",8),m(8),p(9,"translate"),a(10,"div",9)(11,"div",10)(12,"div",11),U(13,ct,7,1,"ng-container",12),c(),a(14,"velt-autocomplete-panel-internal",13,0),p(16,"translate"),x("optionSelected",function(I){return b(l),S(o.onUserSelected(I))}),c()(),U(17,pt,7,6,"div",14),c()(),U(18,ht,6,6,"div",15)(19,yt,6,7,"div",15)(20,bt,40,31,"div",16),a(21,"div",17)(22,"div",18),x("click",function(){return b(l),S(o.copyLink())}),U(23,St,2,0,"svg",19)(24,It,2,0,"svg",20),m(25),p(26,"translate"),p(27,"translate"),c(),C(28,"div",21),a(29,"div",22),x("click",function(){return b(l),S(o.inviteSelectedUsers())}),m(30),p(31,"translate"),c()()()}t&2&&(s(3),M(" ",d(4,15,o.title)," "),s(5),M(" ",d(9,17,"Invite users")," "),s(5),u("ngForOf",o.usersToInvite),s(),u("placeholder",d(16,19,o.placeholder))("enableOnFocus",!1),s(3),u("ngIf",!o.hideAccessControlDropdown),s(),u("ngIf",o.documentUserAccessList&&(o.documentUsers==null?null:o.documentUsers.length)),s(),u("ngIf",(o.huddleInvitees==null?null:o.huddleInvitees.length)||(o.huddleUsers==null?null:o.huddleUsers.length)),s(),u("ngIf",o.isUserAdmin&&!o.hideAccessControlDropdown),s(3),u("ngIf",!o.linkCopied),s(),u("ngIf",o.linkCopied),s(),M(" ",o.linkCopied?d(26,21,"Link Copied!"):d(27,23,"Copy Link")," "),s(4),Z("s-disabled",!(o.usersToInvite!=null&&o.usersToInvite.length)),s(),D(d(31,25,"Send invite")))},dependencies:[_e,ye,Ge,Ze,$e,Ie,He],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;line-height:1.5!important;color:#dcdde0!important;font-size:calc((.8rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){height:unset;width:unset}*[_ngcontent-%COMP%]:empty:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){display:revert!important}*[_ngcontent-%COMP%]{box-sizing:border-box}.s-video-settings-modal[_ngcontent-%COMP%], .s-video-header[_ngcontent-%COMP%], .s-video-header-name[_ngcontent-%COMP%], .s-video-settings-modal-item[_ngcontent-%COMP%], .s-input[_ngcontent-%COMP%], .s-buttons-wrap[_ngcontent-%COMP%], .s-role[_ngcontent-%COMP%], .s-user[_ngcontent-%COMP%], .s-user-info[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;color:#fff!important}.s-video-settings-modal-item[_ngcontent-%COMP%]{flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;width:100%!important;color:#ababb5!important;font-size:.8rem!important;gap:1rem!important}.s-people-list-container[_ngcontent-%COMP%]{overflow:auto!important}.s-people-list-container[_ngcontent-%COMP%] .s-people-list-title[_ngcontent-%COMP%]{position:sticky!important;top:0!important;background:#141416!important;width:100%!important;z-index:1!important}.s-video-settings-modal[_ngcontent-%COMP%]{flex-direction:column!important;align-items:flex-end!important;padding:2rem!important;gap:2rem!important;background:#141416!important;border-radius:1rem!important;max-width:42rem!important;width:80vw!important;border:2px solid #303034!important;overflow:auto!important;max-height:80vh!important}.s-video-header[_ngcontent-%COMP%]{justify-content:space-between!important;width:100%!important}.s-video-header-name[_ngcontent-%COMP%]{gap:.5rem!important;font-weight:600!important;font-size:1.2rem!important}.s-button[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;justify-content:center!important;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((2rem + 0px) * var(--velt-base-rem-unit))!important;border-radius:calc((4rem + 0px) * var(--velt-base-rem-unit))!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;transition:.1s ease!important;cursor:pointer!important}.s-primary[_ngcontent-%COMP%]{background:#625df5!important;color:#fff!important}.s-primary[_ngcontent-%COMP%]:not(.s-disabled):hover{background:#4f4bbf!important}.s-disabled[_ngcontent-%COMP%]{background:#939393!important;cursor:not-allowed!important}.s-secondary[_ngcontent-%COMP%]{border:2px solid #303034!important;border-radius:.5rem!important;color:#ababb5!important;gap:.5rem!important}.s-secondary[_ngcontent-%COMP%]:hover{background:#303034!important;color:#fff!important}.s-video-settings-modal-item[_ngcontent-%COMP%] .s-heading[_ngcontent-%COMP%]{font-size:1rem!important;color:#fff!important;padding:.5rem 0!important}.s-input[_ngcontent-%COMP%]{padding:1rem!important;color:#ababb5!important;width:100%!important;justify-content:space-between!important;border-radius:1rem!important;border:2px solid #303034!important;align-items:center!important;cursor:pointer!important;transition:.2s ease!important}.s-input[_ngcontent-%COMP%]:hover{background:#303034!important}.s-buttons-wrap[_ngcontent-%COMP%]{width:100%!important;justify-content:space-between!important;align-items:stretch!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}.s-user[_ngcontent-%COMP%]{width:100%!important;justify-content:space-between!important}.s-user-info[_ngcontent-%COMP%]{color:#ababb5!important;gap:.75rem!important}.s-user[_ngcontent-%COMP%] .s-role[_ngcontent-%COMP%]{color:#404044!important}.s-role[_ngcontent-%COMP%]{position:relative!important;cursor:pointer!important}.dropdown[_ngcontent-%COMP%] .dropdown-content[_ngcontent-%COMP%]{position:absolute!important;top:100%!important;right:0!important;z-index:10!important}.dropdown[_ngcontent-%COMP%] .dropdown-content.top[_ngcontent-%COMP%]{top:auto!important;bottom:2rem!important}.dropdown-content[_ngcontent-%COMP%]{min-width:max-content!important;overflow:hidden!important;flex-direction:column!important;justify-content:flex-start!important;align-items:flex-start!important;border-radius:.5rem!important;border:1px solid #303034!important;font-style:normal!important;font-weight:400!important;font-size:1em!important;line-height:1em!important;color:#ababb5!important;background:#141416!important;cursor:pointer!important;transition:.2s ease!important}.dropdown-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#ababb5!important}.dropdown[_ngcontent-%COMP%] .dropdown-content[_ngcontent-%COMP%]{display:none!important;visibility:hidden!important;opacity:0!important}.dropdown[_ngcontent-%COMP%] .dropdown-icon[_ngcontent-%COMP%]{width:24px!important;min-width:24px!important}.dropdown.disabled[_ngcontent-%COMP%] .dropdown-icon[_ngcontent-%COMP%]{display:none!important}.dropdown[_ngcontent-%COMP%]:not(.disabled):hover .dropdown-content[_ngcontent-%COMP%]{display:flex!important;visibility:visible!important;opacity:1!important}.dropdown-item[_ngcontent-%COMP%]{padding:1em 2rem 1rem 1rem!important;width:100%!important;display:flex!important;justify-content:flex-start!important;align-items:center!important;gap:1em!important;line-height:1rem!important;border-radius:0!important}.dropdown-item[_ngcontent-%COMP%]:hover{background:#303034!important}.dropdown-item[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:#fff!important;margin:0!important}.dropdown-item[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0!important}.border-top[_ngcontent-%COMP%]{outline:solid 1px #303034!important}.s-flex-fill[_ngcontent-%COMP%]{flex-grow:1!important}.s-input-chip-list-container[_ngcontent-%COMP%]{display:flex;width:100%!important;gap:8px!important;flex-wrap:wrap!important;align-items:center!important}.s-input-chip-list-container[_ngcontent-%COMP%] .s-chip-list[_ngcontent-%COMP%]{display:flex!important;gap:8px!important;flex-wrap:wrap!important}.s-input-chip-list-container[_ngcontent-%COMP%] .s-chip-list[_ngcontent-%COMP%] .s-chip[_ngcontent-%COMP%]{padding:8px 16px!important;background:#222226!important;color:#dcdde0!important;border-radius:100px!important;display:flex!important;align-items:center!important;gap:8px!important}.s-input-chip-list-container[_ngcontent-%COMP%] .s-chip-list[_ngcontent-%COMP%] .s-chip[_ngcontent-%COMP%] .s-chip-remove[_ngcontent-%COMP%]{display:flex!important;cursor:pointer!important}.s-input-chip-list-container[_ngcontent-%COMP%] velt-autocomplete-panel-internal.s-input-user-selector[_ngcontent-%COMP%]{flex-basis:250px!important}.s-general-access-container[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;width:100%!important;gap:8px!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn-content[_ngcontent-%COMP%]{position:relative!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn-content[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:calc((.9rem + 0px) * var(--velt-base-rem-unit))!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn[_ngcontent-%COMP%]{position:relative!important;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;width:100%!important;justify-content:flex-start!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn[_ngcontent-%COMP%] .dropdown-content[_ngcontent-%COMP%]{left:0!important;top:auto!important;bottom:100%!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{color:#ababb5!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{background-color:transparent!important;padding:0!important;margin:0!important;border-radius:20px!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container velt-autocomplete-panel-internal.s-input-user-selector{flex-grow:1!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container velt-autocomplete-panel-internal.s-input-user-selector input{background:transparent!important;border:0!important;outline:0!important;color:#fff!important}@media screen and (max-width:425px){ .velt-mat-dialog-container.snippyly-user-invite-dialog{width:100vw!important;max-width:100vw!important;height:100vh!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{border-radius:0!important} .velt-mat-dialog-container.snippyly-user-invite-dialog .s-video-settings-modal{width:100vw!important;height:100vh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important} .velt-mat-dialog-container.snippyly-user-invite-dialog .s-chip-user{word-break:break-all!important}}"],changeDetection:0});let n=r;return n})();function wt(n,r){n&1&&(a(0,"div",4),w(),a(1,"svg",5)(2,"g"),C(3,"path",6)(4,"path",7)(5,"path",8),c()()())}function xt(n,r){if(n&1){let i=T();a(0,"div")(1,"slot",9),x("slotchange",function(){b(i);let t=h();return S(t.onButtonSlotChange())}),a(2,"div",10),w(),a(3,"svg",11),C(4,"path",12),c()()()()}}var X=(()=>{let r=class r extends ze{set _disabled(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.disabled=t}set _documentUserAccessList(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.documentUserAccessList=t}constructor(e,t,o,l,_,I,N){super(_,o,void 0,void 0,void 0,I,t),this.analyticsService=e,this.loggingService=t,this.themeService=o,this.dialog=l,this.elementRef=_,this.dynamicDataService=I,this.domService=N,this.type="share",this.disabled=!1,this.documentUserAccessList=!0,this.hideAccessControlDropdown=!1,this.accessControlDropdown=!0,this.veltElement=!0,this.customButtonAdded=!1}ngAfterViewInit(){try{this.customCssSubscription=this.domService.subscribeInjectCustomCss(this.elementRef)}catch(e){this.loggingService.catch("Error in UserInviteToolComponent ngAfterViewInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.customCssSubscription?.unsubscribe()}catch(e){this.loggingService.catch("Error in UserInviteToolComponent ngOnDestroy: ",e)}}onButtonSlotChange(){this.customButtonAdded=!0}openInviteDialog(){try{this.disabled||(this.type==="share"&&this.analyticsService.trackEvent(P.Events.ShareDialog.SHARE_BUTTON_CLICKED),this.dialog.open(se,{panelClass:"velt-mat-dialog-container",backdropClass:"s-background-blur-1",data:{title:this.title,placeholder:this.placeholder,hideAccessControlDropdown:this.hideAccessControlDropdown||!this.accessControlDropdown,type:this.type,source:this.source,documentUserAccessList:this.documentUserAccessList,inviteUrl:this.inviteUrl}}))}catch(e){this.loggingService.catch("Error in UserInviteToolComponent openInviteDialog: ",e)}}};r.\u0275fac=function(t){return new(t||r)(g(K),g(A),g(Fe),g(Te),g(ve),g(Q),g(Ve))},r.\u0275cmp=H({type:r,selectors:[["snippyly-user-invite-tool-internal"]],hostVars:1,hostBindings:function(t,o){t&2&&$("data-velt-element",o.veltElement)},inputs:{type:"type",source:"source",title:"title",placeholder:"placeholder",inviteUrl:"inviteUrl",_disabled:[0,"disabled","_disabled"],_documentUserAccessList:[0,"documentUserAccessList","_documentUserAccessList"],hideAccessControlDropdown:"hideAccessControlDropdown",accessControlDropdown:"accessControlDropdown"},standalone:!1,features:[fe([Q]),Ce],decls:4,vars:3,consts:[["part","container",1,"s-user-invite-tool-container","s-cursor-pointer",3,"click"],[1,"s-user-invite-tool-default",3,"ngSwitch"],["class","s-user-invite-tool-button",4,"ngSwitchCase"],[4,"ngSwitchCase"],[1,"s-user-invite-tool-button"],["width","32","height","32","viewBox","0 0 32 32","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M19.3589 13.3008C17.3965 13.3008 15.6521 14.2519 14.5622 15.7174C14.1206 15.6247 13.6692 15.5768 13.2136 15.5768C9.6054 15.5768 6.66992 18.5123 6.66992 22.1205C6.66992 22.5918 7.05207 22.974 7.52344 22.974H14.67C15.7651 24.3594 17.4599 25.25 19.3589 25.25C22.6533 25.25 25.3335 22.5698 25.3335 19.2754C25.3335 15.981 22.6533 13.3008 19.3589 13.3008ZM8.45235 21.2669C8.85669 19.0058 10.8378 17.2839 13.2136 17.2839C13.3823 17.2839 13.5501 17.2933 13.7166 17.3104C13.5016 17.9261 13.3843 18.5873 13.3843 19.2754C13.3843 19.9735 13.505 20.6437 13.726 21.2669H8.45235ZM19.3589 23.543C17.0057 23.543 15.0913 21.6286 15.0913 19.2754C15.0913 16.9223 17.0057 15.0078 19.3589 15.0078C21.712 15.0078 23.6265 16.9223 23.6265 19.2754C23.6265 21.6286 21.712 23.543 19.3589 23.543Z","fill","white"],["d","M13.2132 13.8716C15.182 13.8716 16.7837 12.2699 16.7837 10.3011C16.7837 8.33224 15.182 6.73047 13.2132 6.73047C11.2443 6.73047 9.64258 8.33224 9.64258 10.3011C9.64258 12.2699 11.2443 13.8716 13.2132 13.8716ZM13.2132 8.4375C14.2408 8.4375 15.0767 9.2735 15.0767 10.3011C15.0767 11.3286 14.2408 12.1645 13.2132 12.1645C12.1856 12.1645 11.3496 11.3286 11.3496 10.3011C11.3496 9.2735 12.1856 8.4375 13.2132 8.4375Z","fill","white"],["d","M21.0664 18.4219H20.2129V17.5684C20.2129 17.097 19.8308 16.7148 19.3594 16.7148C18.888 16.7148 18.5059 17.097 18.5059 17.5684V18.4219H17.6523C17.181 18.4219 16.7988 18.804 16.7988 19.2754C16.7988 19.7468 17.181 20.1289 17.6523 20.1289H18.5059V20.9824C18.5059 21.4538 18.888 21.836 19.3594 21.836C19.8308 21.836 20.2129 21.4538 20.2129 20.9824V20.1289H21.0664C21.5378 20.1289 21.9199 19.7468 21.9199 19.2754C21.9199 18.804 21.5378 18.4219 21.0664 18.4219Z","fill","white"],["name","button",3,"slotchange"],["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",1,"action-btn-icon"],["d","M8.57143 9.42858H7.71429C7.25963 9.42858 6.82359 9.60919 6.5021 9.93068C6.18061 10.2522 6 10.6882 6 11.1429V18C6 18.4547 6.18061 18.8907 6.5021 19.2122C6.82359 19.5337 7.25963 19.7143 7.71429 19.7143H16.2857C16.7404 19.7143 17.1764 19.5337 17.4979 19.2122C17.8194 18.8907 18 18.4547 18 18V11.1429C18 10.6882 17.8194 10.2522 17.4979 9.93068C17.1764 9.60919 16.7404 9.42858 16.2857 9.42858H15.4286M12 13.7143V4.28572M12 4.28572L9.42857 6.85715M12 4.28572L14.5714 6.85715","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,o){t&1&&(a(0,"div",0),x("click",function(){return o.openInviteDialog()}),a(1,"div",1),U(2,wt,6,0,"div",2)(3,xt,5,0,"div",3),c()()),t&2&&(s(),u("ngSwitch",o.type),s(),u("ngSwitchCase","invite"),s(),u("ngSwitchCase","share"))},dependencies:[be,Se],styles:[`html{--velt-base-rem-unit: 1}*[data-snippyly-element=true],*[data-velt-element=true]{font-family:var(--velt-default-font-family)}velt-wireframe{display:none!important}body.velt-pin-dragging iframe{pointer-events:none!important}:host{display:inline-flex!important}.s-user-invite-tool-container{display:inline-block!important}.s-user-invite-tool-button{display:flex!important}.action-btn{display:inline-flex;justify-content:center;align-items:center;padding:6px!important;border-radius:var(--legacy-velt-tool-border-radius);border:var(--legacy-velt-tool-border);background-color:var(--legacy-velt-tool-bg-color);color:var(--legacy-velt-tool-icon-color);cursor:pointer}.action-btn .action-btn-label{font-size:calc((.9rem + 0px) * var(--velt-base-rem-unit))!important;padding-right:4px!important;font-weight:700!important;color:currentColor!important}.action-btn .action-btn-icon{width:calc((var(--legacy-velt-tool-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-icon-size) + 0px) * var(--velt-base-rem-unit));color:currentColor}.action-btn .toolbar-icon-dropdown-arrow{width:16px;height:16px;color:currentColor}.action-btn:focus{border-radius:var(--legacy-velt-tool-focus-border-radius);border:var(--legacy-velt-tool-focus-border);background-color:var(--legacy-velt-tool-focus-bg-color);color:var(--legacy-velt-tool-focus-icon-color)}.action-btn:focus .action-btn-icon{width:calc((var(--legacy-velt-tool-focus-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-focus-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:focus .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-focus-icon-color)}.action-btn:hover{border-radius:var(--legacy-velt-tool-hover-border-radius);border:var(--legacy-velt-tool-hover-border);background-color:var(--legacy-velt-tool-hover-bg-color);color:var(--legacy-velt-tool-hover-icon-color)}.action-btn:hover .action-btn-icon{width:calc((var(--legacy-velt-tool-hover-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-hover-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:hover .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-hover-icon-color)}.action-btn:active,.action-btn.active{border-radius:var(--legacy-velt-tool-active-border-radius);border:var(--legacy-velt-tool-active-border);background-color:var(--legacy-velt-tool-active-bg-color);color:var(--legacy-velt-tool-active-icon-color)}.action-btn:active .action-btn-icon,.action-btn.active .action-btn-icon{width:calc((var(--legacy-velt-tool-active-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-active-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:active .toolbar-icon-dropdown-arrow,.action-btn.active .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-active-icon-color)}
1
+ import{a as We}from"./chunk-RD2BRSWO.js";import{b as Ye}from"./chunk-5NMVUDFG.js";import{b as $e,j as Ge,t as Je}from"./chunk-5EO5WTC7.js";import"./chunk-ELEMLDFM.js";import{l as Ue}from"./chunk-6K2VWE4K.js";import"./chunk-IY3WJ7XZ.js";import"./chunk-APPJN3VX.js";import"./chunk-EYPJC34Q.js";import"./chunk-XYR7TNZL.js";import"./chunk-NLVNX52N.js";import{b as He,d as Ze}from"./chunk-S4APJ64C.js";import{a as Ke}from"./chunk-62RN7JJN.js";import{a as De}from"./chunk-POME7PZR.js";import{I as xe,W as Me,X as Ee,Y as Te,ba as Oe,ca as Ne,da as Q,ea as Fe,ga as ze}from"./chunk-K5BJ5DAO.js";import{$ as me,Bf as V,De as L,E as ie,Fa as s,Fc as _e,Fh as J,Gc as ye,Hc as be,Hi as je,Ic as Se,J as ne,Jb as G,Kb as Z,Mc as Ie,Nb as m,Ob as D,Pa as g,Pb as M,Pc as we,T as R,Ta as ge,Ua as H,Va as he,Xe as ke,Ya as Ce,_a as U,_b as fe,a as ae,aa as ue,ai as Le,bi as K,ca as E,ci as A,db as $,di as Y,g as ce,ge as Pe,ha as b,ia as S,ja as w,ka as j,kc as p,ki as Ve,l as le,lb as u,lc as d,li as W,mb as a,nb as c,ob as C,p as te,pc as oe,pg as Be,r as pe,sb as k,se as O,si as Re,tb as B,te as Ae,uh as P,v as de,vb as T,wa as ve,xb as x,xi as q,zb as h}from"./chunk-O4F37U67.js";var Qe=(()=>{let r=class r{constructor(e,t,o,l,_,I,N,ee){this.authService=e,this.configService=t,this.contactService=o,this.docService=l,this.commonDbService=_,this.databaseService=I,this.loggingService=N,this.notificationService=ee,this.documentUsers$=new le([]);try{this.databaseService.getDb().pipe(ie(y=>!!y),ne(1)).subscribe(y=>{y&&this.subscribeUsersFromDocument()}),this.authService.getUser$().subscribe(y=>{if(y?.email){this.subscribeUsersFromDocument();let z=V(y.email);y?.organizationId&&(z=V(y.userId)),this.getDocumentUserByIdFromDb(z).then(f=>{f&&(f.user.name=y.name,f.user.photoUrl=y.photoUrl,this.updateDocumentUser(f))}).catch(f=>{this.loggingService.catch("Error in DocumentUserAccessService getDocumentUserByIdFromDb:",f)})}},y=>{this.loggingService.catch("Error in DocumentUserAccessService getUser$:",y)})}catch(y){this.loggingService.catch("Error in DocService constructor:",y)}}getDocumentUserByIdFromDb(e){return ce(this,null,function*(){try{let t=this.docService.getDocumentPaths();return t?(yield this.commonDbService.dbListener({feature:"documentUser",properties:{documentId:t?.documentId,organizationId:t?.organizationId,isCollection:!1,id:e}}).pipe(ne(1)).toPromise())?.data:void 0}catch(t){this.loggingService.catch("Error in DocService getDocumentUserById:",t);return}})}subscribeUsersFromDocument(){try{this.documentUsersSubscription&&this.documentUsersSubscription.unsubscribe(),this.documentUsersSubscription=this.authService.getUser$().pipe(R(e=>e?this.docService.getDocumentPaths$().pipe(ie(t=>!!t),R(t=>this.commonDbService.dbListener({feature:"allDocumentUsers",properties:{documentId:t?.documentId,organizationId:t?.organizationId,isCollection:!0}}).pipe(de(o=>o?.data?Object.values(o?.data):[])))):pe([]))).subscribe(e=>{this.documentUsers$.next(e)},e=>{this.loggingService.catch("Error in DocService subscribeUsersFromDocument subscription:",e)})}catch(e){this.loggingService.catch("Error in DocService subscribeUsersFromDocument:",e)}}getDocumentUsers$(){return this.documentUsers$.asObservable()}addDocumentUser(e){try{let t=this.authService.getUser();if(t){if(this.configService.getSF()){if(e?.role?.name===O.ADMIN)this.contactService.addGlobalContact(e.user);else if(e?.role?.name===O.COMMENTER){let l=t.groupId;if(l){let _=JSON.parse(JSON.stringify(e.user));_.visibility="group",this.contactService.setLoggedInUserGroupContacts(l,[_])}}}e.id=V(e?.user?.email),e.invitedBy=t,e.invitedDate=this.timestamp;let o=this.docService.getDocumentPaths();o&&this.commonDbService.updateData({feature:"documentUserAccess",properties:{id:e.id,documentId:o?.documentId??"",organizationId:o?.organizationId??""},data:JSON.parse(JSON.stringify(e))}),this.updateNotificationsDatabase(e)}else this.loggingService.error("Error in DocService addDocumentUser: User not found")}catch(t){this.loggingService.catch("Error in DocService addDocumentUser:",t)}}updateDocumentUser(e,t={}){try{let o=this.authService.getUser();if(o){e.updatedBy=o,e.updatedDate=this.timestamp;let l=this.docService.getDocumentPaths();this.commonDbService.updateData({feature:"documentUserAccess",properties:{id:e.id,documentId:l?.documentId??"",organizationId:l?.organizationId??""},data:JSON.parse(JSON.stringify(e))}),this.updateNotificationsDatabase(e)}}catch(o){this.loggingService.catch("Error in DocumentUserAccessService updateDocumentUser:",o)}}removeDocumentUser(e){try{let t=this.docService.getDocumentPaths();this.commonDbService.deleteData({feature:"documentUserAccess",properties:{id:e.id,documentId:t?.documentId??"",organizationId:t?.organizationId??""}})}catch(t){this.loggingService.catch("Error in DocumentUserAccessService removeDocumentUser:",t)}}updateNotificationsDatabase(e={}){try{let t=ae({notificationSource:"user"},e);this.notificationService.updateNotificationDatabase(t)}catch(t){this.loggingService.catch("Error in DocumentUserAccessService updateNotificationsDatabase: ",t)}}get timestamp(){return this.commonDbService.getServerTimestamp()}};r.\u0275fac=function(t){return new(t||r)(E(W),E(Y),E(Ne),E(q),E(je),E(Re),E(A),E(Ye))},r.\u0275prov=me({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();function ct(n,r){if(n&1){let i=T();k(0),a(1,"div",23)(2,"div",24),m(3),c(),a(4,"div",25),x("click",function(){let t=b(i).$implicit,o=h();return S(o.removeSelectedUserToInvite(t))}),w(),a(5,"svg",26),C(6,"path",7),c()()(),B()}if(n&2){let i=r.$implicit;s(3),D((i==null||i.user==null?null:i.user.name)||(i==null||i.user==null?null:i.user.email))}}function lt(n,r){if(n&1){let i=T();k(0),a(1,"div",31),x("click",function(){let t=b(i).$implicit,o=h(2);return S(o.selectRole(t))}),w(),a(2,"svg",32),C(3,"path",33),c(),j(),a(4,"div")(5,"h4"),m(6),p(7,"translate"),c(),a(8,"p"),m(9),p(10,"translate"),c()()(),B()}if(n&2){let i=r.$implicit,e=r.first,t=h(2);s(),Z("border-top",!e),s(),G("visibility",(t.selectedUserRole==null?null:t.selectedUserRole.id)===(i==null?null:i.id)?"visible":"hidden"),s(4),D(d(7,6,i==null?null:i.name)),s(3),D(d(10,8,i==null?null:i.description))}}function pt(n,r){if(n&1&&(a(0,"div",27)(1,"div",28),U(2,lt,11,10,"ng-container",12),c(),m(3),p(4,"translate"),w(),a(5,"svg",29),C(6,"path",30),c()()),n&2){let i=h();Z("disabled",!i.isUserAdmin),s(2),u("ngForOf",i.userRoles),s(),M(" ",d(4,4,i.selectedUserRole==null?null:i.selectedUserRole.name)," ")}}function dt(n,r){n&1&&(w(),a(0,"svg",32),C(1,"path",44),c())}function mt(n,r){if(n&1&&(a(0,"div",41),m(1),p(2,"translate"),U(3,dt,2,0,"svg",43),c()),n&2){let i=h().$implicit,e=h(2);s(),M(" ",d(2,2,i==null||i.role==null?null:i.role.name)," "),s(2),u("ngIf",e.isUserAdmin&&(i==null||i.user==null?null:i.user.email)!==(e.user==null?null:e.user.email))}}function ut(n,r){if(n&1){let i=T();a(0,"div",28)(1,"div",45),x("click",function(){b(i);let t=h().$implicit,o=h(2);return S(o.removeUser(t))}),m(2),p(3,"translate"),c()()}n&2&&(s(2),M(" ",d(3,1,"Remove")," "))}function vt(n,r){if(n&1&&(k(0),a(1,"div",38)(2,"div",39),C(3,"snippyly-user-avatar",40),m(4),c(),a(5,"div",41)(6,"app-overlay-tooltip",42),U(7,mt,4,4,"ng-template",null,1,oe)(9,ut,4,3,"ng-template",null,2,oe),c()()(),B()),n&2){let i=r.$implicit,e=h(2);s(3),u("user",i==null?null:i.user)("background","#625DF5"),s(),M(" ",(i==null||i.user==null?null:i.user.name)||(i==null||i.user==null?null:i.user.email)," "),s(2),u("disabled",!(e.isUserAdmin&&(i==null||i.user==null?null:i.user.email)!==(e.user==null?null:e.user.email)))}}function gt(n,r){n&1&&(k(0),a(1,"div"),m(2),p(3,"translate"),c(),B()),n&2&&(s(2),D(d(3,1,"No users are added.")))}function ht(n,r){if(n&1&&(a(0,"div",34)(1,"div",35),m(2),p(3,"translate"),c(),U(4,vt,11,4,"ng-container",36)(5,gt,4,3,"ng-container",37),c()),n&2){let i=h();s(2),D(d(3,4,"People on this project")),s(2),u("ngForOf",i.documentUsers)("ngForTrackBy",i.trackByDocumentUserId),s(),u("ngIf",!(i.documentUsers!=null&&i.documentUsers.length))}}function Ct(n,r){if(n&1&&(k(0),a(1,"div",38)(2,"div",39),C(3,"snippyly-user-avatar",40),m(4),p(5,"translate"),c()(),B()),n&2){let i=r.$implicit;s(3),u("user",i)("background","#625DF5"),s(),M(" ",d(5,3,(i==null?null:i.name)||(i==null?null:i.email))," ")}}function ft(n,r){if(n&1&&(a(0,"div",38)(1,"div",39),C(2,"snippyly-user-avatar",40),m(3),p(4,"translate"),c(),a(5,"div",27),m(6),p(7,"translate"),c()()),n&2){let i=h().$implicit;s(2),u("user",i)("background","#625DF5"),s(),M(" ",d(4,4,(i==null?null:i.name)||(i==null?null:i.email))," "),s(3),M(" ",d(7,6,"Invited")," ")}}function _t(n,r){if(n&1&&(k(0),U(1,ft,8,8,"div",46),B()),n&2){let i=r.$implicit,e=h(2);s(),u("ngIf",!e.huddleUsersByEmailMap[i==null?null:i.email])}}function yt(n,r){if(n&1&&(a(0,"div",34)(1,"div",35),m(2),p(3,"translate"),c(),U(4,Ct,6,5,"ng-container",36)(5,_t,2,1,"ng-container",36),c()),n&2){let i=h();s(2),D(d(3,5,"People on this huddle")),s(2),u("ngForOf",i.huddleUsers)("ngForTrackBy",i.trackByHuddleUserId),s(),u("ngForOf",i.huddleInvitees)("ngForTrackBy",i.trackByHuddleInviteeId)}}function bt(n,r){if(n&1){let i=T();a(0,"div",47)(1,"div",48),m(2),p(3,"translate"),c(),a(4,"div",49)(5,"div",28)(6,"div",31),x("click",function(){b(i);let t=h();return S(t.changeDocumentAccessType(t.DocumentAccessTypes.PUBLIC))}),w(),a(7,"svg",32),C(8,"path",33),c(),j(),a(9,"div")(10,"h3"),m(11),p(12,"translate"),p(13,"titlecase"),c(),a(14,"p"),m(15),p(16,"translate"),c()()(),a(17,"div",45),x("click",function(){b(i);let t=h();return S(t.changeDocumentAccessType(t.DocumentAccessTypes.RESTRICTED))}),w(),a(18,"svg",32),C(19,"path",33),c(),j(),a(20,"div")(21,"h3"),m(22),p(23,"translate"),p(24,"titlecase"),c(),a(25,"p"),m(26),p(27,"translate"),c()()()(),w(),a(28,"svg",32),C(29,"path",50)(30,"path",51)(31,"path",52),c(),j(),a(32,"div",53)(33,"h3"),m(34),p(35,"translate"),p(36,"titlecase"),c(),a(37,"p"),m(38),p(39,"translate"),c()()()()}if(n&2){let i=h();s(2),D(d(3,11,"General access")),s(5),G("visibility",!i.documentAccessType||i.documentAccessType===i.DocumentAccessTypes.PUBLIC?"visible":"hidden"),s(4),D(d(13,15,d(12,13,i.DocumentAccessTypes.PUBLIC))),s(4),D(d(16,17,i.documentAccessTypeMap[i.DocumentAccessTypes.PUBLIC]==null?null:i.documentAccessTypeMap[i.DocumentAccessTypes.PUBLIC].description)),s(3),G("visibility",i.documentAccessType===i.DocumentAccessTypes.RESTRICTED?"visible":"hidden"),s(4),D(d(24,21,d(23,19,i.DocumentAccessTypes.RESTRICTED))),s(4),D(d(27,23,i.documentAccessTypeMap[i.DocumentAccessTypes.RESTRICTED]==null?null:i.documentAccessTypeMap[i.DocumentAccessTypes.RESTRICTED].description)),s(8),D(d(36,27,d(35,25,i.documentAccessType||i.DocumentAccessTypes.PUBLIC))),s(4),M("",d(39,29,i.documentAccessTypeMap[i.documentAccessType?i.documentAccessType:i.DocumentAccessTypes.PUBLIC]==null?null:i.documentAccessTypeMap[i.documentAccessType?i.documentAccessType:i.DocumentAccessTypes.PUBLIC].description)," ")}}function St(n,r){n&1&&(w(),a(0,"svg",54),C(1,"path",55),c())}function It(n,r){n&1&&(w(),a(0,"svg",56),C(1,"path",57),c())}var se=(()=>{let r=class r{constructor(e,t,o,l,_,I,N,ee,y,z,f){this.analyticsService=e,this.authService=t,this.configService=o,this.docService=l,this.documentUserAccessService=_,this.serviceBook=I,this.loggingService=N,this.iamService=ee,this.toastService=y,this.dialogRef=z,this.usersToInvite=[],this.documentUsers=[],this.huddleInvitees=[],this.huddleUsers=[],this.huddleUsersByEmailMap={},this.userRoles=[],this.excludeContacts=[],this.linkCopied=!1,this.hideAccessControlDropdown=!1,this.subscriptions=[],this.title="Share project",this.placeholder="Add email address",this.documentAccessType="",this.DocumentAccessTypes=Ae,this.isUserAdmin=!1,this.documentAccessTypeMap=L.DocumentAccessTypeMap,this.documentUserAccessList=!0,this.veltElement=!0;try{f&&(this.hideAccessControlDropdown=!!f.hideAccessControlDropdown,this.type=f.type,this.source=f.source,f.title&&(this.title=f.title),f.placeholder&&(this.placeholder=f.placeholder),this.documentUserAccessList=!!f.documentUserAccessList,this.inviteUrl=f.inviteUrl),this.subscriptions.push(this.authService.getUser$().subscribe(v=>{this.user=v})),this.subscriptions.push(this.iamService.isUserAdmin$().subscribe(v=>{this.isUserAdmin=v})),this.subscriptions.push(this.configService.getSF$().subscribe(v=>{v?this.documentAccessTypeMap=L.DocumentAccessTypeMapSF:this.documentAccessTypeMap=L.DocumentAccessTypeMap})),this.type!=="invite"&&this.subscriptions.push(this.documentUserAccessService.getDocumentUsers$().subscribe(v=>{this.documentUsers=v,this.updateExcludeContacts()})),this.type!=="invite"&&this.subscriptions.push(this.iamService.getRoles$().subscribe(v=>{this.userRoles=v,this.userRoles?.length&&(this.selectedUserRole=this.userRoles?.find(F=>F.name===O.COMMENTER))})),this.type!=="invite"&&this.subscriptions.push(this.iamService.getDocumentIAM$().subscribe(v=>{this.documentAccessType=this.docService.getDocumentAccessType(v)})),this.type==="invite"&&(this.subscriptions.push(this.serviceBook.observe(J).pipe(R(v=>v?.getHuddleAttendees$()??te)).subscribe(v=>{this.huddleUsers=v,this.huddleUsersByEmailMap={},v.forEach(F=>{F.email&&(this.huddleUsersByEmailMap[F.email]=F)})})),this.subscriptions.push(this.serviceBook.observe(J).pipe(R(v=>v?.getHuddleInvitees$()??te)).subscribe(v=>{this.huddleInvitees=v})))}catch(v){this.loggingService.catch("Error in UserInviteDialogComponent constructor: ",v)}}ngOnInit(){try{this.dialogRef.addPanelClass("snippyly-user-invite-dialog"),this.userRoles?.length&&(this.selectedUserRole=this.userRoles?.find(e=>e.name===O.COMMENTER))}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent ngOnInit: ",e)}}updateExcludeContacts(){try{this.excludeContacts=[],this.excludeContacts.push(...this.documentUsers.map(e=>e.user)),this.excludeContacts.push(...this.usersToInvite.map(e=>e.user))}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent updateExcludeContacts: ",e)}}trackByDocumentUserId(e,t){return t.id}trackByHuddleUserId(e,t){return t.userSnippylyId||t.userId}trackByHuddleInviteeId(e,t){return t.userId||t.email}selectRole(e){try{this.selectedUserRole=e}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent selectRole: ",t)}}onUserSelected(e){try{let t=new ke;t.id=e.email?V(e.email):V(e.userId),t.user=e,this.usersToInvite.find(o=>o.id===t.id)||this.usersToInvite.push(t),this.updateExcludeContacts()}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent onUserSelected: ",t)}}inviteSelectedUsers(){try{if(this.usersToInvite?.length)if(this.type==="invite"){let e=this.usersToInvite.map(t=>t.user);this.analyticsService.trackEvent(P.Events.InviteDialog.USER_INVITED,{source:this.source}),this.serviceBook.get(J)?.inviteUsers(e),this.toastService.setToast({message:"Invitation sent!",type:"success",duration:2e3})}else{this.usersToInvite.forEach(l=>{this.selectedUserRole&&(l.role=this.selectedUserRole)});let e=this.usersToInvite.filter(l=>l.role?.name===O.ADMIN).map(l=>l.user.email),t=this.usersToInvite.filter(l=>l.role?.name===O.COMMENTER).map(l=>l.user.email),o={actionType:Pe.INVITE,userInvite:{admin:e?.length?{emails:e,emailProperties:{url:this.getInviteUrl()}}:void 0,commenter:t?.length?{emails:t,clientDocumentId:this.docService.getDocumentPaths()?.clientDocumentId,documentId:this.docService.getDocumentPaths()?.documentId,clientOrganizationId:this.user?.clientOrganizationId,organizationId:this.user?.organizationId,emailProperties:{url:this.getInviteUrl()}}:void 0}};this.documentUserAccessService.updateNotificationsDatabase(o),this.toastService.setToast({message:"Invitation sent!",type:"success",duration:2e3})}this.usersToInvite=[]}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent inviteSelectedUsers: ",e)}}removeSelectedUserToInvite(e){try{this.usersToInvite=this.usersToInvite.filter(t=>t.id!==e.id),this.updateExcludeContacts()}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent removeSelectedUserToInvite: ",t)}}updateUserRole(e,t){try{let o=e?.role?.name,l=t?.name;e.role=t,this.documentUserAccessService.updateDocumentUser(e,{oldAccess:o,newAccess:l})}catch(o){this.loggingService.catch("Error in UserInviteDialogComponent updateUserRole: ",o)}}removeUser(e){try{this.analyticsService.trackEvent(P.Events.ShareDialog.DOCUMENT_USER_ACCESS_REMOVED,{targetUserId:e?.user?.userId,targetUserEmail:e?.user?.email,roleType:e?.role?.name}),this.documentUserAccessService.removeDocumentUser(e),this.toastService.setToast({message:"User removed!",type:"success",duration:2e3})}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent removeUser: ",t)}}getInviteUrl(){try{return this.inviteUrl||window.location.href}catch(e){return this.loggingService.catch("Error in UserInviteDialogComponent getInviteUrl: ",e),""}}copyLink(){try{let e=this.getInviteUrl();this.linkCopied=!0,Be(e),setTimeout(()=>{this.linkCopied=!1},2e3),this.type==="invite"?this.analyticsService.trackEvent(P.Events.InviteDialog.INVITE_LINK_COPIED,{source:this.source}):this.type==="share"&&this.analyticsService.trackEvent(P.Events.ShareDialog.SHARE_LINK_COPIED)}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent copyLink: ",e)}}changeDocumentAccessType(e){try{this.documentAccessType!==e&&(this.analyticsService.trackEvent(P.Events.ShareDialog.DOCUMENT_ACCESS_CHANGED,{oldAccessType:this.documentAccessType,newAccessType:e}),this.docService.changeDocumentAccessType(e),this.toastService.setToast({message:"Access changed to '"+e+"'.",type:"success",duration:2e3}))}catch(t){this.loggingService.catch("Error in UserInviteDialogComponent changeDocumentAccessType: ",t)}}closeDialog(){try{this.dialogRef.close()}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent closeDialog: ",e)}}ngOnDestroy(){try{this.subscriptions.forEach(e=>e.unsubscribe())}catch(e){this.loggingService.catch("Error in UserInviteDialogComponent ngOnDestroy: ",e)}}};r.\u0275fac=function(t){return new(t||r)(g(K),g(W),g(Y),g(q),g(Qe),g(Le),g(A),g(Ke),g(We),g(Me),g(Ee,8))},r.\u0275cmp=H({type:r,selectors:[["snippyly-user-invite-dialog"]],hostVars:1,hostBindings:function(t,o){t&2&&$("data-velt-element",o.veltElement)},standalone:!1,decls:32,vars:27,consts:[["userSelectorRef",""],["triggerTemplate",""],["tooltipTemplate",""],[1,"s-video-settings-modal",3,"click","pointerdown","pointerup"],[1,"s-video-header"],[1,"s-video-header-name"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",1,"s-cursor-pointer",3,"click"],["fill-rule","evenodd","clip-rule","evenodd","d","M4.41076 4.41058C4.7362 4.08514 5.26384 4.08514 5.58928 4.41058L10 8.82133L14.4108 4.41058C14.7362 4.08514 15.2638 4.08514 15.5893 4.41058C15.9147 4.73602 15.9147 5.26366 15.5893 5.58909L11.1785 9.99984L15.5893 14.4106C15.9147 14.736 15.9147 15.2637 15.5893 15.5891C15.2638 15.9145 14.7362 15.9145 14.4108 15.5891L10 11.1783L5.58928 15.5891C5.26384 15.9145 4.7362 15.9145 4.41076 15.5891C4.08533 15.2637 4.08533 14.736 4.41076 14.4106L8.82151 9.99984L4.41076 5.58909C4.08533 5.26366 4.08533 4.73602 4.41076 4.41058Z","fill","#80808A"],[1,"s-video-settings-modal-item"],[1,"s-input"],[1,"s-input-chip-list-container"],[1,"s-chip-list"],[4,"ngFor","ngForOf"],[1,"s-input-user-selector",3,"optionSelected","placeholder","enableOnFocus"],["class","s-role dropdown",3,"disabled",4,"ngIf"],["class","s-video-settings-modal-item s-people-list-container",4,"ngIf"],["class","s-general-access-container",4,"ngIf"],[1,"s-buttons-wrap"],[1,"s-button","s-secondary",3,"click"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["width","20","height","20","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],[1,"s-flex-fill"],[1,"s-button","s-primary",3,"click"],[1,"s-chip"],[1,"s-chip-user"],[1,"s-chip-remove",3,"click"],["width","14","height","14","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],[1,"s-role","dropdown"],[1,"dropdown-content"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"dropdown-icon"],["fill-rule","evenodd","clip-rule","evenodd","d","M7.79289 9.79289C8.18342 9.40237 8.81658 9.40237 9.20711 9.79289L12 12.5858L14.7929 9.79289C15.1834 9.40237 15.8166 9.40237 16.2071 9.79289C16.5976 10.1834 16.5976 10.8166 16.2071 11.2071L12.7071 14.7071C12.3166 15.0976 11.6834 15.0976 11.2929 14.7071L7.79289 11.2071C7.40237 10.8166 7.40237 10.1834 7.79289 9.79289Z","fill","#D4D6DF"],[1,"dropdown-item",3,"click"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M18.7071 7.29289C19.0976 7.68342 19.0976 8.31658 18.7071 8.70711L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071L5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929C5.68342 10.9024 6.31658 10.9024 6.70711 11.2929L10 14.5858L17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289Z","fill","#80808A"],[1,"s-video-settings-modal-item","s-people-list-container"],[1,"s-people-list-title"],[4,"ngFor","ngForOf","ngForTrackBy"],[4,"ngIf"],[1,"s-user"],[1,"s-user-info"],[1,"s-flex",3,"user","background"],[1,"s-role"],[3,"disabled"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf"],["fill-rule","evenodd","clip-rule","evenodd","d","M16.2071 9.79289C15.8166 9.40237 15.1834 9.40237 14.7929 9.79289L12 12.5858L9.20711 9.79289C8.81658 9.40237 8.18342 9.40237 7.79289 9.79289C7.40237 10.1834 7.40237 10.8166 7.79289 11.2071L11.2929 14.7071C11.6834 15.0976 12.3166 15.0976 12.7071 14.7071L16.2071 11.2071C16.5976 10.8166 16.5976 10.1834 16.2071 9.79289Z","fill","#404044"],[1,"dropdown-item","border-top",3,"click"],["class","s-user",4,"ngIf"],[1,"s-general-access-container"],[1,"s-general-access-title"],[1,"s-button","s-secondary","s-document-access-btn","dropdown"],["fill-rule","evenodd","clip-rule","evenodd","d","M12 11C10.2274 11 8.64844 11.0646 7.35838 11.1466C6.13471 11.2243 5.19379 12.158 5.10597 13.373C5.0435 14.2373 5 15.1481 5 16C5 16.8519 5.0435 17.7627 5.10597 18.627C5.19379 19.842 6.13471 20.7757 7.35838 20.8534C8.64844 20.9354 10.2274 21 12 21C13.7726 21 15.3516 20.9354 16.6416 20.8534C17.8653 20.7757 18.8062 19.842 18.894 18.627C18.9565 17.7627 19 16.8519 19 16C19 15.1481 18.9565 14.2373 18.894 13.373C18.8062 12.158 17.8653 11.2243 16.6416 11.1466C15.3516 11.0646 13.7726 11 12 11ZM7.2315 9.15059C5.01376 9.29156 3.27137 11.0124 3.11117 13.2288C3.04652 14.1234 3 15.085 3 16C3 16.915 3.04652 17.8766 3.11118 18.7712C3.27137 20.9876 5.01376 22.7084 7.23151 22.8494C8.55778 22.9337 10.1795 23 12 23C13.8205 23 15.4422 22.9337 16.7685 22.8494C18.9862 22.7084 20.7286 20.9876 20.8888 18.7712C20.9535 17.8766 21 16.915 21 16C21 15.085 20.9535 14.1234 20.8888 13.2288C20.7286 11.0124 18.9862 9.29156 16.7685 9.15059C15.4422 9.06629 13.8205 9 12 9C10.1795 9 8.55778 9.06629 7.2315 9.15059Z","fill","#777E91"],["fill-rule","evenodd","clip-rule","evenodd","d","M13 16.7324C13.5978 16.3866 14 15.7403 14 15C14 13.8954 13.1046 13 12 13C10.8954 13 10 13.8954 10 15C10 15.7403 10.4022 16.3866 11 16.7324V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V16.7324Z","fill","#777E91"],["fill-rule","evenodd","clip-rule","evenodd","d","M7 6C7 3.23858 9.23858 1 12 1C14.7614 1 17 3.23858 17 6V10C17 10.5523 16.5523 11 16 11C15.4477 11 15 10.5523 15 10V6C15 4.34315 13.6569 3 12 3C10.3431 3 9 4.34315 9 6V10C9 10.5523 8.55228 11 8 11C7.44772 11 7 10.5523 7 10V6Z","fill","#777E91"],[1,"s-document-access-btn-content"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M6.49027 2.50491C6.46607 2.50996 6.34731 2.53007 6.22635 2.54966C5.17052 2.72053 4.19457 3.45245 3.69214 4.45019C3.56689 4.69886 3.43711 5.08311 3.37864 5.3784C3.31829 5.68302 3.31829 14.3108 3.37864 14.6154C3.52088 15.3336 3.85013 15.9526 4.36233 16.4647C4.76978 16.8722 5.22723 17.1555 5.75266 17.3256C6.23219 17.4809 6.32453 17.4891 7.59205 17.4891H8.76711L8.88599 17.4104C9.06906 17.2893 9.14407 17.146 9.14407 16.9173C9.14407 16.6887 9.06909 16.5453 8.88611 16.4242L8.76728 16.3455L7.6068 16.3286C6.3852 16.3109 6.35854 16.3081 5.96566 16.1588C5.43291 15.9564 4.86723 15.3934 4.67143 14.8707C4.49992 14.4129 4.51091 14.747 4.51091 9.9969C4.51091 5.24677 4.49992 5.58091 4.67143 5.12308C4.88025 4.56564 5.45367 4.01728 6.0476 3.80712C6.46364 3.65989 6.4966 3.65865 9.67189 3.66895C12.8862 3.67939 12.6707 3.6688 13.1239 3.83838C13.3521 3.92374 13.6919 4.15074 13.8939 4.35272C14.0958 4.5547 14.3228 4.89447 14.4082 5.12264C14.5641 5.53916 14.5639 5.53763 14.5816 6.87392L14.5983 8.13484L14.6679 8.24677C14.7061 8.30835 14.791 8.39412 14.8563 8.43737C14.9554 8.50291 15.0078 8.51605 15.1701 8.51605C15.3324 8.51605 15.3848 8.50291 15.4839 8.43737C15.5492 8.39412 15.6341 8.30835 15.6723 8.24677L15.7419 8.13484V6.85925C15.7419 5.89002 15.7321 5.53438 15.7012 5.3784C15.4231 3.97403 14.4078 2.9182 13.0001 2.56948C12.7554 2.50887 12.6941 2.50764 9.64257 2.50177C7.93299 2.49849 6.51446 2.4999 6.49027 2.50491ZM10.1326 4.86732C10.0008 4.90764 9.81429 5.10144 9.77661 5.23721C9.75922 5.29976 9.74547 5.6244 9.74538 5.97344C9.74517 6.73161 9.7789 6.93488 9.97026 7.32843C10.0835 7.56132 10.1471 7.64839 10.358 7.85928C10.5687 8.06997 10.6561 8.13387 10.8888 8.24715C11.3004 8.44752 11.4993 8.4781 12.3174 8.46675L12.9899 8.4574L13.1087 8.37872C13.2923 8.25712 13.3667 8.11437 13.3667 7.88344C13.3667 7.72342 13.3533 7.6705 13.288 7.57182C13.2448 7.50646 13.159 7.42162 13.0974 7.38336C12.9898 7.31647 12.9581 7.31319 12.2817 7.29876C11.6484 7.28524 11.5646 7.27759 11.4445 7.22234C11.2497 7.13276 11.1074 6.99491 11.0146 6.80594C10.9336 6.64091 10.9327 6.63267 10.9182 5.93556C10.904 5.25876 10.9008 5.2275 10.8339 5.11986C10.6956 4.89741 10.3918 4.788 10.1326 4.86732ZM15.7049 9.14973C15.3168 9.21439 14.8688 9.42637 14.5091 9.71547C14.1903 9.97168 12.9551 11.227 12.785 11.4677C12.6151 11.708 12.4379 12.0846 12.3662 12.3575C12.2934 12.6347 12.2934 13.2178 12.3662 13.4864C12.4763 13.8923 12.7739 14.3816 12.9941 14.5185C13.1571 14.6198 13.4451 14.6146 13.6071 14.5074C13.7916 14.3853 13.8652 14.2433 13.8652 14.0094C13.8652 13.8346 13.8552 13.8007 13.7698 13.6869C13.7174 13.6169 13.6316 13.474 13.5792 13.3691C13.4922 13.1949 13.4842 13.1559 13.4861 12.9146C13.4901 12.4126 13.6018 12.2459 14.588 11.2695C15.3768 10.4885 15.479 10.4117 15.8541 10.3176C16.4471 10.1688 17.0959 10.642 17.1542 11.2659C17.1867 11.6138 17.0539 11.95 16.7418 12.3102C16.554 12.527 16.5067 12.6446 16.5261 12.8468C16.5522 13.1185 16.7716 13.3292 17.0627 13.362C17.163 13.3733 17.2272 13.3595 17.3476 13.3006C17.6751 13.1404 18.1188 12.4832 18.2617 11.9469C18.4137 11.3768 18.3213 10.7383 18.0102 10.209C17.8837 9.99361 17.4606 9.57059 17.2452 9.444C16.7724 9.16618 16.2292 9.06241 15.7049 9.14973ZM14.7568 12.1471C14.6858 12.1846 14.588 12.2715 14.5396 12.3402C14.4628 12.4494 14.4517 12.4903 14.4517 12.6643C14.4517 12.846 14.4612 12.8773 14.5601 13.021C14.869 13.4698 14.893 13.8775 14.6373 14.3344C14.5091 14.5636 13.051 16.0217 12.8218 16.15C12.3282 16.4261 11.818 16.3718 11.4502 16.0041C11.1691 15.723 11.0679 15.3616 11.1645 14.9843C11.2245 14.75 11.3364 14.5523 11.5457 14.3107C11.7336 14.0939 11.7808 13.9764 11.7614 13.7742C11.7353 13.5024 11.5159 13.2917 11.2249 13.259C11.1245 13.2476 11.0603 13.2615 10.9399 13.3204C10.6125 13.4806 10.1687 14.1377 10.0258 14.674C9.87388 15.2442 9.96627 15.8826 10.2773 16.4119C10.4039 16.6273 10.8269 17.0504 11.0423 17.177C11.5716 17.488 12.2101 17.5804 12.7802 17.4284C13.0265 17.3628 13.41 17.1783 13.6407 17.0145C13.8608 16.858 14.9432 15.8056 15.2867 15.4139C15.9653 14.64 16.1624 13.7239 15.8293 12.8919C15.562 12.2242 15.1512 11.9389 14.7568 12.1471Z","fill","#80808A"],["width","20","height","20","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M18.7071 7.29289C19.0976 7.68342 19.0976 8.31658 18.7071 8.70711L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071L5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929C5.68342 10.9024 6.31658 10.9024 6.70711 11.2929L10 14.5858L17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289Z","fill","#ABABB5"]],template:function(t,o){if(t&1){let l=T();a(0,"div",3),x("click",function(I){return b(l),S(I.stopPropagation())})("pointerdown",function(I){return b(l),S(I.stopPropagation())})("pointerup",function(I){return b(l),S(I.stopPropagation())}),a(1,"div",4)(2,"div",5),m(3),p(4,"translate"),c(),w(),a(5,"svg",6),x("click",function(){return b(l),S(o.closeDialog())}),C(6,"path",7),c()(),j(),a(7,"div",8),m(8),p(9,"translate"),a(10,"div",9)(11,"div",10)(12,"div",11),U(13,ct,7,1,"ng-container",12),c(),a(14,"velt-autocomplete-panel-internal",13,0),p(16,"translate"),x("optionSelected",function(I){return b(l),S(o.onUserSelected(I))}),c()(),U(17,pt,7,6,"div",14),c()(),U(18,ht,6,6,"div",15)(19,yt,6,7,"div",15)(20,bt,40,31,"div",16),a(21,"div",17)(22,"div",18),x("click",function(){return b(l),S(o.copyLink())}),U(23,St,2,0,"svg",19)(24,It,2,0,"svg",20),m(25),p(26,"translate"),p(27,"translate"),c(),C(28,"div",21),a(29,"div",22),x("click",function(){return b(l),S(o.inviteSelectedUsers())}),m(30),p(31,"translate"),c()()()}t&2&&(s(3),M(" ",d(4,15,o.title)," "),s(5),M(" ",d(9,17,"Invite users")," "),s(5),u("ngForOf",o.usersToInvite),s(),u("placeholder",d(16,19,o.placeholder))("enableOnFocus",!1),s(3),u("ngIf",!o.hideAccessControlDropdown),s(),u("ngIf",o.documentUserAccessList&&(o.documentUsers==null?null:o.documentUsers.length)),s(),u("ngIf",(o.huddleInvitees==null?null:o.huddleInvitees.length)||(o.huddleUsers==null?null:o.huddleUsers.length)),s(),u("ngIf",o.isUserAdmin&&!o.hideAccessControlDropdown),s(3),u("ngIf",!o.linkCopied),s(),u("ngIf",o.linkCopied),s(),M(" ",o.linkCopied?d(26,21,"Link Copied!"):d(27,23,"Copy Link")," "),s(4),Z("s-disabled",!(o.usersToInvite!=null&&o.usersToInvite.length)),s(),D(d(31,25,"Send invite")))},dependencies:[_e,ye,Ge,Ze,$e,Ie,He],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;line-height:1.5!important;color:#dcdde0!important;font-size:calc((.8rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){height:unset;width:unset}*[_ngcontent-%COMP%]:empty:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){display:revert!important}*[_ngcontent-%COMP%]{box-sizing:border-box}.s-video-settings-modal[_ngcontent-%COMP%], .s-video-header[_ngcontent-%COMP%], .s-video-header-name[_ngcontent-%COMP%], .s-video-settings-modal-item[_ngcontent-%COMP%], .s-input[_ngcontent-%COMP%], .s-buttons-wrap[_ngcontent-%COMP%], .s-role[_ngcontent-%COMP%], .s-user[_ngcontent-%COMP%], .s-user-info[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;color:#fff!important}.s-video-settings-modal-item[_ngcontent-%COMP%]{flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;width:100%!important;color:#ababb5!important;font-size:.8rem!important;gap:1rem!important}.s-people-list-container[_ngcontent-%COMP%]{overflow:auto!important}.s-people-list-container[_ngcontent-%COMP%] .s-people-list-title[_ngcontent-%COMP%]{position:sticky!important;top:0!important;background:#141416!important;width:100%!important;z-index:1!important}.s-video-settings-modal[_ngcontent-%COMP%]{flex-direction:column!important;align-items:flex-end!important;padding:2rem!important;gap:2rem!important;background:#141416!important;border-radius:1rem!important;max-width:42rem!important;width:80vw!important;border:2px solid #303034!important;overflow:auto!important;max-height:80vh!important}.s-video-header[_ngcontent-%COMP%]{justify-content:space-between!important;width:100%!important}.s-video-header-name[_ngcontent-%COMP%]{gap:.5rem!important;font-weight:600!important;font-size:1.2rem!important}.s-button[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;justify-content:center!important;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((2rem + 0px) * var(--velt-base-rem-unit))!important;border-radius:calc((4rem + 0px) * var(--velt-base-rem-unit))!important;font-size:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;transition:.1s ease!important;cursor:pointer!important}.s-primary[_ngcontent-%COMP%]{background:#625df5!important;color:#fff!important}.s-primary[_ngcontent-%COMP%]:not(.s-disabled):hover{background:#4f4bbf!important}.s-disabled[_ngcontent-%COMP%]{background:#939393!important;cursor:not-allowed!important}.s-secondary[_ngcontent-%COMP%]{border:2px solid #303034!important;border-radius:.5rem!important;color:#ababb5!important;gap:.5rem!important}.s-secondary[_ngcontent-%COMP%]:hover{background:#303034!important;color:#fff!important}.s-video-settings-modal-item[_ngcontent-%COMP%] .s-heading[_ngcontent-%COMP%]{font-size:1rem!important;color:#fff!important;padding:.5rem 0!important}.s-input[_ngcontent-%COMP%]{padding:1rem!important;color:#ababb5!important;width:100%!important;justify-content:space-between!important;border-radius:1rem!important;border:2px solid #303034!important;align-items:center!important;cursor:pointer!important;transition:.2s ease!important}.s-input[_ngcontent-%COMP%]:hover{background:#303034!important}.s-buttons-wrap[_ngcontent-%COMP%]{width:100%!important;justify-content:space-between!important;align-items:stretch!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}.s-user[_ngcontent-%COMP%]{width:100%!important;justify-content:space-between!important}.s-user-info[_ngcontent-%COMP%]{color:#ababb5!important;gap:.75rem!important}.s-user[_ngcontent-%COMP%] .s-role[_ngcontent-%COMP%]{color:#404044!important}.s-role[_ngcontent-%COMP%]{position:relative!important;cursor:pointer!important}.dropdown[_ngcontent-%COMP%] .dropdown-content[_ngcontent-%COMP%]{position:absolute!important;top:100%!important;right:0!important;z-index:10!important}.dropdown[_ngcontent-%COMP%] .dropdown-content.top[_ngcontent-%COMP%]{top:auto!important;bottom:2rem!important}.dropdown-content[_ngcontent-%COMP%]{min-width:max-content!important;overflow:hidden!important;flex-direction:column!important;justify-content:flex-start!important;align-items:flex-start!important;border-radius:.5rem!important;border:1px solid #303034!important;font-style:normal!important;font-weight:400!important;font-size:1em!important;line-height:1em!important;color:#ababb5!important;background:#141416!important;cursor:pointer!important;transition:.2s ease!important}.dropdown-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#ababb5!important}.dropdown[_ngcontent-%COMP%] .dropdown-content[_ngcontent-%COMP%]{display:none!important;visibility:hidden!important;opacity:0!important}.dropdown[_ngcontent-%COMP%] .dropdown-icon[_ngcontent-%COMP%]{width:24px!important;min-width:24px!important}.dropdown.disabled[_ngcontent-%COMP%] .dropdown-icon[_ngcontent-%COMP%]{display:none!important}.dropdown[_ngcontent-%COMP%]:not(.disabled):hover .dropdown-content[_ngcontent-%COMP%]{display:flex!important;visibility:visible!important;opacity:1!important}.dropdown-item[_ngcontent-%COMP%]{padding:1em 2rem 1rem 1rem!important;width:100%!important;display:flex!important;justify-content:flex-start!important;align-items:center!important;gap:1em!important;line-height:1rem!important;border-radius:0!important}.dropdown-item[_ngcontent-%COMP%]:hover{background:#303034!important}.dropdown-item[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{color:#fff!important;margin:0!important}.dropdown-item[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0!important}.border-top[_ngcontent-%COMP%]{outline:solid 1px #303034!important}.s-flex-fill[_ngcontent-%COMP%]{flex-grow:1!important}.s-input-chip-list-container[_ngcontent-%COMP%]{display:flex;width:100%!important;gap:8px!important;flex-wrap:wrap!important;align-items:center!important}.s-input-chip-list-container[_ngcontent-%COMP%] .s-chip-list[_ngcontent-%COMP%]{display:flex!important;gap:8px!important;flex-wrap:wrap!important}.s-input-chip-list-container[_ngcontent-%COMP%] .s-chip-list[_ngcontent-%COMP%] .s-chip[_ngcontent-%COMP%]{padding:8px 16px!important;background:#222226!important;color:#dcdde0!important;border-radius:100px!important;display:flex!important;align-items:center!important;gap:8px!important}.s-input-chip-list-container[_ngcontent-%COMP%] .s-chip-list[_ngcontent-%COMP%] .s-chip[_ngcontent-%COMP%] .s-chip-remove[_ngcontent-%COMP%]{display:flex!important;cursor:pointer!important}.s-input-chip-list-container[_ngcontent-%COMP%] velt-autocomplete-panel-internal.s-input-user-selector[_ngcontent-%COMP%]{flex-basis:250px!important}.s-general-access-container[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;width:100%!important;gap:8px!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn-content[_ngcontent-%COMP%]{position:relative!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn-content[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:calc((.9rem + 0px) * var(--velt-base-rem-unit))!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn[_ngcontent-%COMP%]{position:relative!important;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;width:100%!important;justify-content:flex-start!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn[_ngcontent-%COMP%] .dropdown-content[_ngcontent-%COMP%]{left:0!important;top:auto!important;bottom:100%!important}.s-general-access-container[_ngcontent-%COMP%] .s-document-access-btn[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{color:#ababb5!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{background-color:transparent!important;padding:0!important;margin:0!important;border-radius:20px!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container velt-autocomplete-panel-internal.s-input-user-selector{flex-grow:1!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container velt-autocomplete-panel-internal.s-input-user-selector input{background:transparent!important;border:0!important;outline:0!important;color:#fff!important}@media screen and (max-width:425px){ .velt-mat-dialog-container.snippyly-user-invite-dialog{width:100vw!important;max-width:100vw!important;height:100vh!important} .velt-mat-dialog-container.snippyly-user-invite-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{border-radius:0!important} .velt-mat-dialog-container.snippyly-user-invite-dialog .s-video-settings-modal{width:100vw!important;height:100vh!important;max-width:100vw!important;max-height:100vh!important;border-radius:0!important} .velt-mat-dialog-container.snippyly-user-invite-dialog .s-chip-user{word-break:break-all!important}}"],changeDetection:0});let n=r;return n})();function wt(n,r){n&1&&(a(0,"div",4),w(),a(1,"svg",5)(2,"g"),C(3,"path",6)(4,"path",7)(5,"path",8),c()()())}function xt(n,r){if(n&1){let i=T();a(0,"div")(1,"slot",9),x("slotchange",function(){b(i);let t=h();return S(t.onButtonSlotChange())}),a(2,"div",10),w(),a(3,"svg",11),C(4,"path",12),c()()()()}}var X=(()=>{let r=class r extends ze{set _disabled(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.disabled=t}set _documentUserAccessList(e){let t=e;typeof e=="string"&&(t=JSON.parse(e)),this.documentUserAccessList=t}constructor(e,t,o,l,_,I,N){super(_,o,void 0,void 0,void 0,I,t),this.analyticsService=e,this.loggingService=t,this.themeService=o,this.dialog=l,this.elementRef=_,this.dynamicDataService=I,this.domService=N,this.type="share",this.disabled=!1,this.documentUserAccessList=!0,this.hideAccessControlDropdown=!1,this.accessControlDropdown=!0,this.veltElement=!0,this.customButtonAdded=!1}ngAfterViewInit(){try{this.customCssSubscription=this.domService.subscribeInjectCustomCss(this.elementRef)}catch(e){this.loggingService.catch("Error in UserInviteToolComponent ngAfterViewInit: ",e)}}ngOnDestroy(){try{super.ngOnDestroy(),this.customCssSubscription?.unsubscribe()}catch(e){this.loggingService.catch("Error in UserInviteToolComponent ngOnDestroy: ",e)}}onButtonSlotChange(){this.customButtonAdded=!0}openInviteDialog(){try{this.disabled||(this.type==="share"&&this.analyticsService.trackEvent(P.Events.ShareDialog.SHARE_BUTTON_CLICKED),this.dialog.open(se,{panelClass:"velt-mat-dialog-container",backdropClass:"s-background-blur-1",data:{title:this.title,placeholder:this.placeholder,hideAccessControlDropdown:this.hideAccessControlDropdown||!this.accessControlDropdown,type:this.type,source:this.source,documentUserAccessList:this.documentUserAccessList,inviteUrl:this.inviteUrl}}))}catch(e){this.loggingService.catch("Error in UserInviteToolComponent openInviteDialog: ",e)}}};r.\u0275fac=function(t){return new(t||r)(g(K),g(A),g(Fe),g(Te),g(ve),g(Q),g(Ve))},r.\u0275cmp=H({type:r,selectors:[["snippyly-user-invite-tool-internal"]],hostVars:1,hostBindings:function(t,o){t&2&&$("data-velt-element",o.veltElement)},inputs:{type:"type",source:"source",title:"title",placeholder:"placeholder",inviteUrl:"inviteUrl",_disabled:[0,"disabled","_disabled"],_documentUserAccessList:[0,"documentUserAccessList","_documentUserAccessList"],hideAccessControlDropdown:"hideAccessControlDropdown",accessControlDropdown:"accessControlDropdown"},standalone:!1,features:[fe([Q]),Ce],decls:4,vars:3,consts:[["part","container",1,"s-user-invite-tool-container","s-cursor-pointer",3,"click"],[1,"s-user-invite-tool-default",3,"ngSwitch"],["class","s-user-invite-tool-button",4,"ngSwitchCase"],[4,"ngSwitchCase"],[1,"s-user-invite-tool-button"],["width","32","height","32","viewBox","0 0 32 32","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M19.3589 13.3008C17.3965 13.3008 15.6521 14.2519 14.5622 15.7174C14.1206 15.6247 13.6692 15.5768 13.2136 15.5768C9.6054 15.5768 6.66992 18.5123 6.66992 22.1205C6.66992 22.5918 7.05207 22.974 7.52344 22.974H14.67C15.7651 24.3594 17.4599 25.25 19.3589 25.25C22.6533 25.25 25.3335 22.5698 25.3335 19.2754C25.3335 15.981 22.6533 13.3008 19.3589 13.3008ZM8.45235 21.2669C8.85669 19.0058 10.8378 17.2839 13.2136 17.2839C13.3823 17.2839 13.5501 17.2933 13.7166 17.3104C13.5016 17.9261 13.3843 18.5873 13.3843 19.2754C13.3843 19.9735 13.505 20.6437 13.726 21.2669H8.45235ZM19.3589 23.543C17.0057 23.543 15.0913 21.6286 15.0913 19.2754C15.0913 16.9223 17.0057 15.0078 19.3589 15.0078C21.712 15.0078 23.6265 16.9223 23.6265 19.2754C23.6265 21.6286 21.712 23.543 19.3589 23.543Z","fill","white"],["d","M13.2132 13.8716C15.182 13.8716 16.7837 12.2699 16.7837 10.3011C16.7837 8.33224 15.182 6.73047 13.2132 6.73047C11.2443 6.73047 9.64258 8.33224 9.64258 10.3011C9.64258 12.2699 11.2443 13.8716 13.2132 13.8716ZM13.2132 8.4375C14.2408 8.4375 15.0767 9.2735 15.0767 10.3011C15.0767 11.3286 14.2408 12.1645 13.2132 12.1645C12.1856 12.1645 11.3496 11.3286 11.3496 10.3011C11.3496 9.2735 12.1856 8.4375 13.2132 8.4375Z","fill","white"],["d","M21.0664 18.4219H20.2129V17.5684C20.2129 17.097 19.8308 16.7148 19.3594 16.7148C18.888 16.7148 18.5059 17.097 18.5059 17.5684V18.4219H17.6523C17.181 18.4219 16.7988 18.804 16.7988 19.2754C16.7988 19.7468 17.181 20.1289 17.6523 20.1289H18.5059V20.9824C18.5059 21.4538 18.888 21.836 19.3594 21.836C19.8308 21.836 20.2129 21.4538 20.2129 20.9824V20.1289H21.0664C21.5378 20.1289 21.9199 19.7468 21.9199 19.2754C21.9199 18.804 21.5378 18.4219 21.0664 18.4219Z","fill","white"],["name","button",3,"slotchange"],["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",1,"action-btn-icon"],["d","M8.57143 9.42858H7.71429C7.25963 9.42858 6.82359 9.60919 6.5021 9.93068C6.18061 10.2522 6 10.6882 6 11.1429V18C6 18.4547 6.18061 18.8907 6.5021 19.2122C6.82359 19.5337 7.25963 19.7143 7.71429 19.7143H16.2857C16.7404 19.7143 17.1764 19.5337 17.4979 19.2122C17.8194 18.8907 18 18.4547 18 18V11.1429C18 10.6882 17.8194 10.2522 17.4979 9.93068C17.1764 9.60919 16.7404 9.42858 16.2857 9.42858H15.4286M12 13.7143V4.28572M12 4.28572L9.42857 6.85715M12 4.28572L14.5714 6.85715","stroke","currentColor","stroke-width","1.25","stroke-linecap","round","stroke-linejoin","round"]],template:function(t,o){t&1&&(a(0,"div",0),x("click",function(){return o.openInviteDialog()}),a(1,"div",1),U(2,wt,6,0,"div",2)(3,xt,5,0,"div",3),c()()),t&2&&(s(),u("ngSwitch",o.type),s(),u("ngSwitchCase","invite"),s(),u("ngSwitchCase","share"))},dependencies:[be,Se],styles:[`html{--velt-base-rem-unit: 1}*[data-snippyly-element=true],*[data-velt-element=true]{font-family:var(--velt-default-font-family)}velt-wireframe{display:none!important}body.velt-pin-dragging iframe{pointer-events:none!important}:host{display:inline-flex!important}.s-user-invite-tool-container{display:inline-block!important}.s-user-invite-tool-button{display:flex!important}.action-btn{display:inline-flex;justify-content:center;align-items:center;padding:6px!important;border-radius:var(--legacy-velt-tool-border-radius);border:var(--legacy-velt-tool-border);background-color:var(--legacy-velt-tool-bg-color);color:var(--legacy-velt-tool-icon-color);cursor:pointer}.action-btn .action-btn-label{font-size:calc((.9rem + 0px) * var(--velt-base-rem-unit))!important;padding-right:4px!important;font-weight:700!important;color:currentColor!important}.action-btn .action-btn-icon{width:calc((var(--legacy-velt-tool-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-icon-size) + 0px) * var(--velt-base-rem-unit));color:currentColor}.action-btn .toolbar-icon-dropdown-arrow{width:16px;height:16px;color:currentColor}.action-btn:focus{border-radius:var(--legacy-velt-tool-focus-border-radius);border:var(--legacy-velt-tool-focus-border);background-color:var(--legacy-velt-tool-focus-bg-color);color:var(--legacy-velt-tool-focus-icon-color)}.action-btn:focus .action-btn-icon{width:calc((var(--legacy-velt-tool-focus-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-focus-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:focus .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-focus-icon-color)}.action-btn:hover{border-radius:var(--legacy-velt-tool-hover-border-radius);border:var(--legacy-velt-tool-hover-border);background-color:var(--legacy-velt-tool-hover-bg-color);color:var(--legacy-velt-tool-hover-icon-color)}.action-btn:hover .action-btn-icon{width:calc((var(--legacy-velt-tool-hover-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-hover-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:hover .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-hover-icon-color)}.action-btn:active,.action-btn.active{border-radius:var(--legacy-velt-tool-active-border-radius);border:var(--legacy-velt-tool-active-border);background-color:var(--legacy-velt-tool-active-bg-color);color:var(--legacy-velt-tool-active-icon-color)}.action-btn:active .action-btn-icon,.action-btn.active .action-btn-icon{width:calc((var(--legacy-velt-tool-active-icon-size) + 0px) * var(--velt-base-rem-unit));height:calc((var(--legacy-velt-tool-active-icon-size) + 0px) * var(--velt-base-rem-unit))}.action-btn:active .toolbar-icon-dropdown-arrow,.action-btn.active .toolbar-icon-dropdown-arrow{color:var(--legacy-velt-tool-active-icon-color)}
2
2
  `],encapsulation:3,changeDetection:0});let n=r;return n})();var Xe=(()=>{let r=class r{};r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=he({type:r}),r.\u0275inj=ue({imports:[we,Ue,xe,Oe,Je]});let n=r;return n})();function Dt(n){n.get(A).log("%c[WB] Loading user-invite feature chunk","color: blue;");let e=ge(Xe,n).injector;et(e,L.TAGS.VELT_USER_INVITE_TOOL,X),et(e,L.TAGS.SNIPPYLY_USER_INVITE_TOOL,X)}function et(n,r,i){if(customElements.get(r))return;let e=De(i,{injector:n});customElements.define(r,e)}export{Dt as default};