@veltdev/sdk-dev 6.0.7 → 6.0.8-beta.1

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 (68) hide show
  1. package/app/models/element/activity-element.model.d.ts +9 -0
  2. package/app/models/element/autocomplete-element.model.d.ts +10 -0
  3. package/app/models/element/comment-element.model.d.ts +94 -0
  4. package/app/models/element/notification-element.model.d.ts +17 -0
  5. package/{chunk-HGFGZISK.js → chunk-23NZV3J5.js} +1 -1
  6. package/{chunk-LTCLU4T3.js → chunk-24U4LEAT.js} +1 -1
  7. package/{chunk-YJ5BCVP3.js → chunk-33F6VZ2D.js} +1 -1
  8. package/{chunk-PLGVZJ6T.js → chunk-3XNLR5I6.js} +1 -1
  9. package/{chunk-GPTCITIB.js → chunk-52DNHP4V.js} +1 -1
  10. package/{chunk-N72BHERH.js → chunk-5YU74OX2.js} +1 -1
  11. package/{chunk-HS6LFYOH.js → chunk-7DVALKQ7.js} +1 -1
  12. package/chunk-7LUSUNI3.js +1 -0
  13. package/{chunk-ZFEUGJVC.js → chunk-ANVOXADQ.js} +1 -1
  14. package/chunk-BARZUD2Z.js +1 -0
  15. package/{chunk-KWXZADQY.js → chunk-CRZGZZVQ.js} +1 -1
  16. package/chunk-D2BOLY5Q.js +1 -0
  17. package/chunk-G4MWCI3H.js +193 -0
  18. package/{chunk-4FUBGV7B.js → chunk-H2PBKB34.js} +1 -1
  19. package/{chunk-PHNGEVKT.js → chunk-HNZ452CD.js} +1 -1
  20. package/{chunk-TBVR7DMN.js → chunk-I3U6YUMT.js} +1 -1
  21. package/{chunk-GDRY5OGH.js → chunk-IOANBPOF.js} +1 -1
  22. package/{chunk-Z6E2ZIIQ.js → chunk-KES24H7E.js} +1 -1
  23. package/chunk-KMCCIFJ3.js +93 -0
  24. package/{chunk-FRPQQ7DI.js → chunk-LFEKCFWQ.js} +1 -1
  25. package/chunk-LS3GLCPX.js +2 -0
  26. package/{chunk-2ZGVZZFS.js → chunk-MIANWP6R.js} +1 -1
  27. package/{chunk-2Q3745J2.js → chunk-MRNSRINQ.js} +1 -1
  28. package/chunk-N4APL3ZG.js +1 -0
  29. package/chunk-NCVN3JXT.js +6 -0
  30. package/{chunk-75Z7SIQI.js → chunk-OTEHXO3L.js} +1 -1
  31. package/{chunk-OXX7MHHB.js → chunk-QC3HLRNI.js} +1 -1
  32. package/chunk-QVPRXGEH.js +1 -0
  33. package/{chunk-BCDJ35DN.js → chunk-RTIZJ4JW.js} +1 -1
  34. package/{chunk-XVEAFTH3.js → chunk-T4CM6UKZ.js} +1 -1
  35. package/chunk-WNOKX7ML.js +1 -0
  36. package/{chunk-2WE6CG7F.js → chunk-WNW7AS77.js} +1 -1
  37. package/{chunk-7UFH2MQ5.js → chunk-Y6KJEASI.js} +1 -1
  38. package/package.json +1 -1
  39. package/velt-activity-log.js +1 -1
  40. package/velt-area.js +1 -1
  41. package/velt-arrow.js +2 -2
  42. package/velt-comment.js +7 -7
  43. package/velt-crdt.js +1 -1
  44. package/velt-cursor.js +2 -2
  45. package/velt-huddle.js +2 -2
  46. package/velt-live-state-sync.js +2 -2
  47. package/velt-notification.js +1 -1
  48. package/velt-presence.js +1 -1
  49. package/velt-reaction.js +1 -1
  50. package/velt-recorder.js +1 -1
  51. package/velt-rewriter.js +2 -2
  52. package/velt-selection.js +1 -1
  53. package/velt-tag.js +1 -1
  54. package/velt-user-invite.js +2 -2
  55. package/velt-user-request.js +1 -1
  56. package/velt-video-player.js +1 -1
  57. package/velt-views.js +2 -2
  58. package/velt.js +5 -5
  59. package/chunk-5CFN76GI.js +0 -193
  60. package/chunk-6VMBIKMK.js +0 -6
  61. package/chunk-DF5SLQUS.js +0 -1
  62. package/chunk-DZB424JF.js +0 -2
  63. package/chunk-FJ6CN2HK.js +0 -1
  64. package/chunk-FR7BEDQT.js +0 -1
  65. package/chunk-HVJ4WKTL.js +0 -93
  66. package/chunk-O6NHFZMD.js +0 -1
  67. package/chunk-PB5PWSQS.js +0 -1
  68. package/chunk-XJT64ZXP.js +0 -1
@@ -1 +1 @@
1
- import{a as N}from"./chunk-TBVR7DMN.js";import{$ as v,Ai as B,E as P,Ee as m,Fi as J,G as x,I as C,J as f,Ma as j,Oi as K,Pi as W,Sg as V,Tg as L,Ug as H,Vf as $,Vg as z,Wg as R,Xg as F,bb as X,ca as a,ki as g,l as p,la as M,lg as T,qg as k,r as A,si as G,ti as b,w as D,z as y}from"./chunk-KWXZADQY.js";var h=(function(l){return l.CLICK="click",l.HOVER="hover",l.SCROLL="scroll",l.NAVIGATE="navigate",l})(h||{}),u=class{constructor(){this.type=h.HOVER,this.data=null,this.pageInfo=k(),this.timestamp=Date.now()}},U=class{constructor(n,w){this.targetXpath=n,this.xpath=w}};var E=class{constructor(){this.sessionId=null,this.isLeader=!1,this.lastProcessedActionTimestamp=null}};var S=class{constructor(n){this.snippylyId=n,this.joinTimestamp=Date.now()}};var I=class{constructor(n,w,e){this.followers=[],this.actionStack=[],this.id=$(),this.leaderId=n,this.leaderName=w,this.followers.push(new S(e))}};var Q=(()=>{let n=class n{constructor(e,t,r,i,o,s){this.databaseService=e,this.docService=t,this.loggingService=r,this.authService=i,this.commonDbService=o,this.realtimeAdapter=s,this.currentUser$=new p(null),this.currentSession$=new p(null);try{this.databaseService.getDb().pipe(P(c=>!!c),f(1)).subscribe(c=>{c&&(this.db=c)},c=>{this.loggingService.catch("Error in FlockSessionService getDb subscription: ",c)}),this.authService.getUser$().subscribe(c=>{c&&c.userSnippylyId&&(this.user=c)})}catch(c){this.loggingService.catch("Error in FlockSessionService constructor: ",c)}}startCurrentFlockUserSubscription(e){try{this.currentUserSub?.unsubscribe(),e&&e.userSnippylyId&&(this.user=e,this.subscribeToCurrentFlockUser(e?.userSnippylyId))}catch(t){this.loggingService.catch("Error in FlockSessionService startCurrentFlockUserSubscription: ",t)}}stopCurrentFlockUserSubscription(){try{this.currentUserSub?.unsubscribe()}catch(e){this.loggingService.catch("Error in FlockSessionService stopCurrentFlockUserSubscription: ",e)}}provisionFlockSession(e,t,r){try{let i=this.docService.getDocumentPaths();i&&this.db&&this.commonDbService.dbListener({feature:"flockUser",properties:{documentId:i?.documentId,organizationId:i?.organizationId,id:e,skipFirestore:!0}}).pipe(f(1)).subscribe(o=>{o?.data&&o?.data?.sessionId?this.subscribeToCurrentSession(o?.data?.sessionId,r):this.createFlockSession(e,t,r)})}catch(i){this.loggingService.catch("Error in FlockSessionService provisionFlockSession: ",i)}return null}swapLeader(e,t,r){try{if(this.updateRemoteFlockUser(e,{isLeader:!1}),this.updateRemoteFlockUser(t,{isLeader:!0}),this.currentSession){this.currentSession.leaderId=t,this.currentSession.leaderName=r,this.currentSession.followers.push(new S(e));let i=this.currentSession.followers.findIndex(o=>o.snippylyId===t);i>-1&&this.currentSession.followers.splice(i,1),this.updateSession(this.currentSession.id,this.currentSession)}}catch(i){this.loggingService.catch("Error in FlockSessionService swapLeader: ",i)}}createFlockSession(e,t,r){try{let i=new I(e,t,r);return this.updateRemoteFlockUser(e,{snippylyId:e,sessionId:i.id,isLeader:!0}),this.updateSession(i.id,i),this.subscribeToCurrentSession(i.id),i.id}catch(i){this.loggingService.catch("Error in FlockSessionService createFlockSession: ",i)}return null}removeFollowerFromCurrentSession(e){try{if(this.currentSession){this.updateRemoteFlockUser(e,{sessionId:null,lastProcessedActionTimestamp:null});let t=this.currentSession.followers.findIndex(r=>r.snippylyId===e);if(t>-1){if(this.currentSession.followers.splice(t,1),this.currentSession.followers.length===0){this.deleteSession(this.currentSession.id);return}this.updateSession(this.currentSession.id,this.currentSession),this.user&&this.user.userSnippylyId&&this.user.userSnippylyId===e&&(this.sessionSub?.unsubscribe(),this.currentSession=void 0,this.currentSession$?.next(null))}}}catch(t){this.loggingService.catch("Error in FlockSessionService removeFollowerFromSession: ",t)}}updateRemoteFlockUser(e,t={}){try{if(!e)return;let r=this.docService.getDocumentPaths();for(let i in t)t.hasOwnProperty(i)&&t[i]===void 0&&delete t[i];r&&this.db&&this.commonDbService.updateData({feature:"flockUser",properties:{documentId:r?.documentId??"",organizationId:r?.organizationId??"",id:e,skipFirestore:!0},data:JSON.parse(JSON.stringify(t))})}catch(r){this.loggingService.catch("Error in FlockSessionService updateRemoteFlockUser: ",r)}}subscribeToCurrentSession(e,t=void 0){try{let r=this.docService.getDocumentPaths();r&&this.db&&(this.sessionSub&&this.sessionSub.unsubscribe(),this.sessionSub=this.commonDbService.dbListener({feature:"flockSession",properties:{documentId:r?.documentId,organizationId:r?.organizationId,id:e,skipFirestore:!0}}).subscribe(i=>{i?.data&&typeof i?.data=="object"&&Object.keys(i?.data)?.length>0?(this.currentSession=i?.data,t!==void 0&&this.currentSession?.followers.findIndex(o=>o.snippylyId===t)===-1&&(this.currentSession.followers.push(new S(t)),this.updateSession(this.currentSession.id,this.currentSession)),this.currentSession$.next(this.currentSession??null)):(this.currentSession=void 0,this.currentSession$.next(null))}))}catch(r){this.loggingService.catch("Error in FlockSessionService subscribeToCurrentSession: ",r)}}subscribeToCurrentFlockUser(e){try{let t=this.docService.getDocumentPaths();t&&this.db&&(this.currentUserSub&&this.currentUserSub.unsubscribe(),this.currentUserSub=this.commonDbService.dbListener({feature:"flockUser",properties:{documentId:t?.documentId,organizationId:t?.organizationId,id:e,skipFirestore:!0}}).pipe(x(r=>(this.loggingService.catch("Error in FlockSessionService subscribeToCurrentFlockUser: ",r),A(null)))).subscribe(r=>{r?.data&&typeof r?.data=="object"&&Object.keys(r?.data)?.length>0&&(this.currentUser$.next(r?.data),r?.data?.sessionId&&this.subscribeToCurrentSession(r?.data?.sessionId))},r=>{this.loggingService.catch("Error in FlockSessionService subscribeToCurrentFlockUser subscription: ",r)}))}catch(t){this.loggingService.catch("Error in FlockSessionService subscribeToCurrentFlockUser: ",t)}}updateSession(e,t={}){try{if(!e)return;let r=this.docService.getDocumentPaths();for(let i in t)t.hasOwnProperty(i)&&t[i]===void 0&&delete t[i];r&&this.db&&this.commonDbService.updateData({feature:"flockSession",properties:{documentId:r?.documentId??"",organizationId:r?.organizationId??"",id:e,skipFirestore:!0},data:JSON.parse(JSON.stringify(t))})}catch(r){this.loggingService.catch("Error in FlockSessionService updateSession: ",r)}}deleteSession(e){try{let t=this.docService.getDocumentPaths();t&&this.db&&(this.commonDbService.deleteData({feature:"flockSession",properties:{documentId:t?.documentId??"",organizationId:t?.organizationId??"",id:e,skipFirestore:!0}}),this.currentSession&&e===this.currentSession.id&&(this.updateRemoteFlockUser(this.currentSession.leaderId,{sessionId:null,isLeader:!1,lastProcessedActionTimestamp:null}),this.currentSession.followers.forEach(r=>{this.updateRemoteFlockUser(r.snippylyId,{sessionId:null,lastProcessedActionTimestamp:null})}),this.currentSession=void 0,this.currentSession$.next(null),this.sessionSub?.unsubscribe()))}catch(t){this.loggingService.catch("Error in FlockSessionService deleteSession: ",t)}}addActionToStack(e,t){try{t=t&&JSON.parse(JSON.stringify(t));let r=this.docService.getDocumentPaths();if(r&&this.db&&e){let i=this.realtimeAdapter.rtdbRef(this.db,`${r.flock}/sessions/${e}/actionStack`);this.realtimeAdapter.rtdbRunTransaction("flockSession",i,o=>o?(o.unshift(t),o.slice(0,5)):[t]),t.type===h.NAVIGATE&&this.updateSession(e,{pageInfo:t.pageInfo})}}catch(r){this.loggingService.catch("Error in FlockSessionService addActionToStack: ",r)}}};n.\u0275fac=function(t){return new(t||n)(a(B),a(J),a(g),a(b),a(W),a(K))},n.\u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"});let l=n;return l})();var Z=(()=>{let n=class n{constructor(e,t,r,i){this.componentFactoryResolver=e,this.applicationRef=t,this.injector=r,this.loggingService=i,this.darkMode=!1}createFollowOverlay(e,t){try{let i=this.componentFactoryResolver.resolveComponentFactory(N).create(this.injector);i.instance.setLeaderName(e),i.instance.closeOverlayEvent.pipe(f(1)).subscribe(()=>{this.removeOverlay(),t()}),this.applicationRef.attachView(i.hostView),this.overlayRef=i,this.overlayRef.instance.darkMode=this.darkMode;let o=this.overlayRef.location.nativeElement;o.id="snippyly-follow-overlay",o.setAttribute(m.ATTRIBUTES.VELT_IGNORE,""),document.body.appendChild(o)}catch(r){this.loggingService.catch("Error in FlockOverlayService createFollowOverlay: ",r)}}createLeaderOverlay(e){let r=this.componentFactoryResolver.resolveComponentFactory(N).create(this.injector);r.instance.setType("leading"),r.instance.closeOverlayEvent.pipe(f(1)).subscribe(()=>{this.removeOverlay(),e()}),this.applicationRef.attachView(r.hostView),this.overlayRef=r,this.overlayRef.instance.darkMode=this.darkMode;let i=this.overlayRef.location.nativeElement;i.id="snippyly-follow-overlay",i.setAttribute(m.ATTRIBUTES.VELT_IGNORE,""),document.body.appendChild(i)}changeLeaderName(e){this.overlayRef&&this.overlayRef.instance.setLeaderName(e)}getLeaderName(){return this.overlayRef?this.overlayRef.instance.getLeaderName():null}removeOverlay(){if(this.overlayRef){let e=this.overlayRef.location.nativeElement;this.applicationRef.detachView(this.overlayRef.hostView),this.overlayRef.destroy(),e.shadowRoot&&e.shadowRoot.removeChild(e.shadowRoot.childNodes[0]),e.remove(),this.overlayRef=void 0}}setDarkMode(e){try{this.darkMode=e,this.overlayRef&&(this.overlayRef.instance.darkMode=e)}catch(t){this.loggingService.catch("Error in FlockOverlayService setDarkMode: ",t)}}};n.\u0275fac=function(t){return new(t||n)(a(j),a(X),a(M),a(g))},n.\u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"});let l=n;return l})();var Ce=(()=>{let n=class n{constructor(e,t,r,i,o){this.authService=e,this.domService=t,this.loggingService=r,this.flockSessionService=i,this.flockOverlayService=o,this.flockLeader$=new p({userId:"",name:""}),this.flockMode$=new p(!1),this.currentFlockUser=null,this.localScrollData=[],this.domSubscriptions=[],this.followOverlayCreated=!1,this.leaderOverlayCreated=!1,this.windowFocused=!0,this.tabFocused=!0,this.useHistoryAPI=!0,this.disableDefaultNavigation=!1;try{this.flockLeader$.subscribe(s=>{let{userId:c,name:d}=s,O=c;if(this.provisionFollowUser(),O&&this.currentFlockUser&&this.currentFlockUser.snippylyId)if(this.currentFlockUser.sessionId){if(this.currentFlockUser.snippylyId&&this.currentFlockUser.isLeader){this.flockSessionService.swapLeader(this.currentFlockUser.snippylyId,O,d);return}this.removeCurrentUserFromSession()}else this.flockSessionService.provisionFlockSession(O,d,this.currentFlockUser.snippylyId)},s=>{this.loggingService.catch("Error in FlockService flockLeader$ subscription: ",s)}),this.flockSessionService.currentSession$.subscribe(s=>{if(s!==null){if(this.currentFlockUser&&(this.currentFlockUser.sessionId===null||this.currentFlockUser.sessionId===void 0)&&this.currentFlockUser.snippylyId&&(this.currentFlockUser.sessionId=s.id,this.flockSessionService.updateRemoteFlockUser(this.currentFlockUser.snippylyId,this.currentFlockUser)),this.currentFlockUser&&!this.currentFlockUser.isLeader&&!this.followOverlayCreated&&(this.leaderOverlayCreated&&(this.flockOverlayService.removeOverlay(),this.leaderOverlayCreated=!1),this.followOverlayCreated=!0,this.flockOverlayService.createFollowOverlay(s.leaderName,()=>{this.removeCurrentUserFromSession(),this.followOverlayCreated=!1})),this.currentFlockUser&&this.currentFlockUser.isLeader&&!this.leaderOverlayCreated&&(this.followOverlayCreated&&(this.flockOverlayService.removeOverlay(),this.followOverlayCreated=!1),this.leaderOverlayCreated=!0,this.flockOverlayService.createLeaderOverlay(()=>{this.removeCurrentUserFromSession(),this.leaderOverlayCreated=!1})),this.currentFlockUser&&!this.currentFlockUser.isLeader&&s.actionStack){let c=s.actionStack[0];c&&this.currentFlockUser.lastProcessedActionTimestamp!==c.timestamp&&this.processAction(c)}if(this.currentFlockUser&&!this.currentFlockUser.isLeader&&this.followOverlayCreated&&this.flockOverlayService.getLeaderName()!==null&&s.leaderName!==this.flockOverlayService.getLeaderName()&&this.flockOverlayService.changeLeaderName(s.leaderName),this.currentFlockUser&&this.currentFlockUser.isLeader){let c=k();if(s.pageInfo){if(c&&c.url!==s.pageInfo.url){let d=new u;d.type=h.NAVIGATE,this.flockSessionService.addActionToStack(s.id,d)}}else{this.flockSessionService.updateSession(s.id,{pageInfo:c});let d=new u;d.type=h.NAVIGATE,this.flockSessionService.addActionToStack(s.id,d)}}}else this.currentFlockUser&&this.leaderOverlayCreated&&(this.flockOverlayService.removeOverlay(),this.leaderOverlayCreated=!1),this.currentFlockUser&&this.followOverlayCreated&&(this.flockOverlayService.removeOverlay(),this.followOverlayCreated=!1)}),this.flockSessionService.currentUser$.subscribe(s=>{if(s!==null&&(this.currentFlockUser&&this.currentFlockUser.isLeader!==s.isLeader&&(this.domSubscriptions.forEach(c=>c.unsubscribe()),this.domSubscriptions=[]),this.currentFlockUser=s,s.sessionId&&this.domSubscriptions.length===0))if(s.isLeader){if(!this.tabFocused||!this.windowFocused)return;this.subscribeToLeaderDOMEvents()}else this.subscribeToFollowerDOMEvents()}),D([this.authService.getUser$(),this.getFlockMode$()]).subscribe(([s,c])=>{s&&s.userSnippylyId&&c?this.flockSessionService.startCurrentFlockUserSubscription(s):this.flockSessionService.stopCurrentFlockUserSubscription()})}catch(s){this.loggingService.catch("Error in FlockService constructor: ",s)}}provisionFollowUser(){try{if(this.currentFlockUser===null){let e=this.authService.getUser();e&&e.userSnippylyId&&(this.currentFlockUser=new E,this.currentFlockUser.snippylyId=e.userSnippylyId)}}catch(e){this.loggingService.catch("Error in FlockService provisionFollowUser: ",e)}}startFollowingUser(e,t){try{if(this.provisionFollowUser(),e&&this.currentFlockUser&&this.currentFlockUser.snippylyId){if(this.currentFlockUser.sessionId){if(this.currentFlockUser.snippylyId&&this.currentFlockUser.isLeader){this.flockSessionService.swapLeader(this.currentFlockUser.snippylyId,e,t);return}this.removeCurrentUserFromSession()}this.flockSessionService.provisionFlockSession(e,t,this.currentFlockUser.snippylyId)}}catch(r){this.loggingService.catch("Error in FlockService startFollowingUser: ",r)}}stopFollowingUser(){try{this.removeCurrentUserFromSession()}catch(e){this.loggingService.catch("Error in FlockService stopFollowingUser: ",e)}}subscribeToUrlChanges(){try{if(this.useHistoryAPI){let e=window.history.pushState,t=window.history.replaceState;window.history.pushState=(...r)=>{e.apply(window.history,r),this.onUrlChange()},window.history.replaceState=(...r)=>{t.apply(window.history,r),this.onUrlChange()},this.domSubscriptions.push({unsubscribe:()=>{window.history.pushState=e,window.history.replaceState=t}}),this.domSubscriptions.push(y(window,"popstate").subscribe(()=>{this.onUrlChange()}))}}catch(e){this.loggingService.catch("Error in FlockService subscribeToUrlChanges: ",e)}}onUrlChange(){try{if(this.currentFlockUser&&this.currentFlockUser.sessionId&&this.currentFlockUser.isLeader){let e=new u;e.type=h.NAVIGATE,this.flockSessionService.addActionToStack(this.currentFlockUser.sessionId,e)}}catch(e){this.loggingService.catch("Error in FlockService onUrlChange: ",e)}}processAction(e){try{switch(e.type){case h.CLICK:this.clickUserElement(e.data);break;case h.HOVER:this.scrollToHoveredElement(e.data);break;case h.SCROLL:this.scrollToFollowedUser(e.data);break;case h.NAVIGATE:this.checkMatchingUrl(e.pageInfo);break}this.currentFlockUser&&this.currentFlockUser.snippylyId&&this.flockSessionService.updateRemoteFlockUser(this.currentFlockUser.snippylyId,{lastProcessedActionTimestamp:e.timestamp})}catch(t){this.loggingService.catch("Error in FlockService processAction: ",t)}}subscribeToLeaderDOMEvents(){try{this.domSubscriptions.length>0&&(this.domSubscriptions.forEach(e=>e.unsubscribe()),this.domSubscriptions=[]),this.domSubscriptions.push(y(window,"mouseover").pipe(C(500)).subscribe(e=>{let t=e?.target;if(t){let r=window.getComputedStyle(t);if(r.position==="fixed"||r.position==="sticky"||t.hasAttribute(m.ATTRIBUTES.VELT_IGNORE))return;t=L(t,{x:e.clientX,y:e.clientY}),this.updateHoveredElement(t)}})),this.domSubscriptions.push(this.domService.onWindowClick$().subscribe(e=>{let t=e?.target;if(t){if(t.hasAttribute(m.ATTRIBUTES.VELT_IGNORE))return;this.updateClickedElement(t)}})),this.subscribeToUrlChanges(),this.subscribeToScrollables()}catch(e){this.loggingService.catch("Error in FlockService subscribeToLeaderDOMEvents: ",e)}}subscribeToFollowerDOMEvents(){}updateClickedElement(e){try{if(this.currentFlockUser&&this.currentFlockUser.sessionId){let t=this.domService.getXPath(e),r=T(e),i=this.domService.getXPath(r),o={id:Math.random().toString(36).substring(2),xpath:t,parentXpath:i},s=new u;s.type=h.CLICK,s.data=o,this.flockSessionService.addActionToStack(this.currentFlockUser.sessionId,s)}}catch(t){this.loggingService.catch("Error in FlockService updateClickedElement: ",t)}}updateHoveredElement(e){try{if(this.currentFlockUser&&this.currentFlockUser.sessionId){let t=this.domService.getXPath(e),r=T(e),i=this.domService.getXPath(r),o={id:Math.random().toString(36).substring(2),xpath:t,parentXpath:i},s=new u;s.type=h.HOVER,s.data=o,this.flockSessionService.addActionToStack(this.currentFlockUser.sessionId,s)}}catch(t){this.loggingService.catch("Error in FlockService updateHoveredElement: ",t)}}subscribeToScrollables(){try{let e=V();e.push(document),e?.forEach(t=>{this.domSubscriptions.push(y(t,"scroll").pipe(C(100)).subscribe(r=>{this.currentFlockUser&&this.currentFlockUser.sessionId&&this.currentFlockUser.isLeader&&this.updateScrollPositionOfElement(t)}))})}catch(e){this.loggingService.catch("Error in FlockService getScrollableElements: ",e)}}updateScrollPositionOfElement(e){try{if(this.currentFlockUser&&this.currentFlockUser.sessionId){let t=new U("","");if(e===document){let o=z();if(o){let s=L(o);s&&(t.targetXpath=this.domService.getXPath(s))}t.xpath=""}else{let o=H(e);t.targetXpath=this.domService.getXPath(o),t.xpath=this.domService.getXPath(e)}let r=!1,i=!1;if(this.localScrollData.forEach((o,s)=>{o.xpath===o.xpath&&(t.targetXpath!==o.targetXpath&&(r=!0),this.localScrollData[s]=Object.assign(o,t),i=!0)}),i||this.localScrollData.push(t),r||!i){let o=new u;o.type=h.SCROLL,o.data=t,this.flockSessionService.addActionToStack(this.currentFlockUser.sessionId,o)}}}catch(t){this.loggingService.catch("Error in FlockService calculateScrollPositionOfAnElement: ",t)}}enableFlockMode(e){try{if(this.flockMode$.next(!0),e){let{useHistoryAPI:t,onNavigate:r,disableDefaultNavigation:i,darkMode:o}=e;t!==void 0&&(this.useHistoryAPI=t),r!==void 0&&typeof r=="function"&&(this.onNavigate=r),i!==void 0&&(this.disableDefaultNavigation=i),this.flockOverlayService.setDarkMode(o)}}catch(t){this.loggingService.catch("Error in FlockService enableFlockMode: ",t)}}disableFlockMode(){try{this.flockMode$.next(!1),this.onNavigateEmitter=void 0,this.useHistoryAPI=!0,this.onNavigate=void 0}catch(e){this.loggingService.catch("Error in FlockService disableFlockMode: ",e)}}setDisableFlockNavigation(e){try{this.disableDefaultNavigation=e}catch(t){this.loggingService.catch("Error in FlockService setDisableFlockNavigation: ",t)}}getFlockMode$(){return this.flockMode$.asObservable()}getFlockMode(){return this.flockMode$.value}setNavigateEmitter(e){try{this.onNavigateEmitter=e}catch(t){this.loggingService.catch("Error in FlockService setNavigateEmitter: ",t)}}setTabFocused(e){try{if(this.tabFocused=e,!this.currentFlockUser)return;this.currentFlockUser.isLeader&&this.currentFlockUser.sessionId&&(this.tabFocused&&this.domSubscriptions.length===0?this.subscribeToLeaderDOMEvents():!this.tabFocused&&this.domSubscriptions.length>0&&(this.domSubscriptions.forEach(r=>{r.unsubscribe()}),this.domSubscriptions=[]))}catch(t){this.loggingService.catch("Error in FlockService setTabFocused: ",t)}}setWindowFocused(e){try{if(this.windowFocused=e,!this.currentFlockUser)return;this.currentFlockUser.isLeader&&this.currentFlockUser.sessionId&&(this.windowFocused&&this.domSubscriptions.length===0?this.subscribeToLeaderDOMEvents():!this.windowFocused&&this.domSubscriptions.length>0&&(this.domSubscriptions.forEach(r=>{r.unsubscribe()}),this.domSubscriptions=[]))}catch(t){this.loggingService.catch("Error in FlockService setWindowFocused: ",t)}}setFlockLeader(e,t){try{this.flockLeader$.next({userId:e,name:t})}catch(r){this.loggingService.catch("Error in FlockService setFlockLeader: ",r)}}isInSession(){try{return!!(this.currentFlockUser&&this.currentFlockUser.sessionId)}catch(e){this.loggingService.catch("Error in FlockService isFollowing: ",e)}return!1}removeCurrentUserFromSession(){try{this.domSubscriptions.forEach(e=>e.unsubscribe()),this.domSubscriptions=[],this.currentFlockUser&&(this.currentFlockUser.isLeader?this.currentFlockUser.sessionId&&this.flockSessionService.deleteSession(this.currentFlockUser.sessionId):this.currentFlockUser.snippylyId&&this.flockSessionService.removeFollowerFromCurrentSession(this.currentFlockUser.snippylyId))}catch(e){this.loggingService.catch("Error in FlockService removeCurrentUserFromSession: ",e)}}checkMatchingUrl(e){try{let r=k()?.url,i=e.url;if(r!==i&&i!==void 0){let{url:o,path:s,baseUrl:c}=e;if(this.onNavigate!==void 0&&typeof this.onNavigate=="function"){this.onNavigate({url:o,path:s,baseUrl:c});return}if(this.onNavigateEmitter&&this.onNavigateEmitter.emit({url:o,path:s,baseUrl:c}),this.disableDefaultNavigation)return;window.location.href=i}}catch(t){this.loggingService.catch("Error in FlockService checkMatchingUrl: ",t)}}scrollToFollowedUser(e){try{if(e.xpath===""){let t=this.domService.getElementFromXPath(e.targetXpath);t&&F(t)}else{let t=this.domService.getElementFromXPath(e.xpath),r=this.domService.getElementFromXPath(e.targetXpath);t&&r&&(F(t),R(t,r))}}catch(t){this.loggingService.catch("Error in FlockService scrollToFollowedUser: ",t)}}clickUserElement(e){try{let t=this.domService.getElementFromXPath(e.xpath);t&&this.lastClickedElement?.id!==e.id&&(t?.click(),this.lastClickedElement=e)}catch(t){this.loggingService.catch("Error in FlockService clickUserElement: ",t)}}scrollToHoveredElement(e){try{let t=this.domService.getElementFromXPath(e.xpath);if(t&&e.parentXpath)if(e.parentXpath==="/html")F(t);else{let r=this.domService.getElementFromXPath(e.parentXpath);r&&R(r,t,!0)}}catch(t){this.loggingService.catch("Error in FlockService clickUserElement: ",t)}}};n.\u0275fac=function(t){return new(t||n)(a(b),a(G),a(g),a(Q),a(Z))},n.\u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"});let l=n;return l})();export{Ce as a};
1
+ import{a as N}from"./chunk-I3U6YUMT.js";import{$ as v,Ai as B,E as P,Ee as m,Fi as J,G as x,I as C,J as f,Ma as j,Oi as K,Pi as W,Sg as V,Tg as L,Ug as H,Vf as $,Vg as z,Wg as R,Xg as F,bb as X,ca as a,ki as g,l as p,la as M,lg as T,qg as k,r as A,si as G,ti as b,w as D,z as y}from"./chunk-CRZGZZVQ.js";var h=(function(l){return l.CLICK="click",l.HOVER="hover",l.SCROLL="scroll",l.NAVIGATE="navigate",l})(h||{}),u=class{constructor(){this.type=h.HOVER,this.data=null,this.pageInfo=k(),this.timestamp=Date.now()}},U=class{constructor(n,w){this.targetXpath=n,this.xpath=w}};var E=class{constructor(){this.sessionId=null,this.isLeader=!1,this.lastProcessedActionTimestamp=null}};var S=class{constructor(n){this.snippylyId=n,this.joinTimestamp=Date.now()}};var I=class{constructor(n,w,e){this.followers=[],this.actionStack=[],this.id=$(),this.leaderId=n,this.leaderName=w,this.followers.push(new S(e))}};var Q=(()=>{let n=class n{constructor(e,t,r,i,o,s){this.databaseService=e,this.docService=t,this.loggingService=r,this.authService=i,this.commonDbService=o,this.realtimeAdapter=s,this.currentUser$=new p(null),this.currentSession$=new p(null);try{this.databaseService.getDb().pipe(P(c=>!!c),f(1)).subscribe(c=>{c&&(this.db=c)},c=>{this.loggingService.catch("Error in FlockSessionService getDb subscription: ",c)}),this.authService.getUser$().subscribe(c=>{c&&c.userSnippylyId&&(this.user=c)})}catch(c){this.loggingService.catch("Error in FlockSessionService constructor: ",c)}}startCurrentFlockUserSubscription(e){try{this.currentUserSub?.unsubscribe(),e&&e.userSnippylyId&&(this.user=e,this.subscribeToCurrentFlockUser(e?.userSnippylyId))}catch(t){this.loggingService.catch("Error in FlockSessionService startCurrentFlockUserSubscription: ",t)}}stopCurrentFlockUserSubscription(){try{this.currentUserSub?.unsubscribe()}catch(e){this.loggingService.catch("Error in FlockSessionService stopCurrentFlockUserSubscription: ",e)}}provisionFlockSession(e,t,r){try{let i=this.docService.getDocumentPaths();i&&this.db&&this.commonDbService.dbListener({feature:"flockUser",properties:{documentId:i?.documentId,organizationId:i?.organizationId,id:e,skipFirestore:!0}}).pipe(f(1)).subscribe(o=>{o?.data&&o?.data?.sessionId?this.subscribeToCurrentSession(o?.data?.sessionId,r):this.createFlockSession(e,t,r)})}catch(i){this.loggingService.catch("Error in FlockSessionService provisionFlockSession: ",i)}return null}swapLeader(e,t,r){try{if(this.updateRemoteFlockUser(e,{isLeader:!1}),this.updateRemoteFlockUser(t,{isLeader:!0}),this.currentSession){this.currentSession.leaderId=t,this.currentSession.leaderName=r,this.currentSession.followers.push(new S(e));let i=this.currentSession.followers.findIndex(o=>o.snippylyId===t);i>-1&&this.currentSession.followers.splice(i,1),this.updateSession(this.currentSession.id,this.currentSession)}}catch(i){this.loggingService.catch("Error in FlockSessionService swapLeader: ",i)}}createFlockSession(e,t,r){try{let i=new I(e,t,r);return this.updateRemoteFlockUser(e,{snippylyId:e,sessionId:i.id,isLeader:!0}),this.updateSession(i.id,i),this.subscribeToCurrentSession(i.id),i.id}catch(i){this.loggingService.catch("Error in FlockSessionService createFlockSession: ",i)}return null}removeFollowerFromCurrentSession(e){try{if(this.currentSession){this.updateRemoteFlockUser(e,{sessionId:null,lastProcessedActionTimestamp:null});let t=this.currentSession.followers.findIndex(r=>r.snippylyId===e);if(t>-1){if(this.currentSession.followers.splice(t,1),this.currentSession.followers.length===0){this.deleteSession(this.currentSession.id);return}this.updateSession(this.currentSession.id,this.currentSession),this.user&&this.user.userSnippylyId&&this.user.userSnippylyId===e&&(this.sessionSub?.unsubscribe(),this.currentSession=void 0,this.currentSession$?.next(null))}}}catch(t){this.loggingService.catch("Error in FlockSessionService removeFollowerFromSession: ",t)}}updateRemoteFlockUser(e,t={}){try{if(!e)return;let r=this.docService.getDocumentPaths();for(let i in t)t.hasOwnProperty(i)&&t[i]===void 0&&delete t[i];r&&this.db&&this.commonDbService.updateData({feature:"flockUser",properties:{documentId:r?.documentId??"",organizationId:r?.organizationId??"",id:e,skipFirestore:!0},data:JSON.parse(JSON.stringify(t))})}catch(r){this.loggingService.catch("Error in FlockSessionService updateRemoteFlockUser: ",r)}}subscribeToCurrentSession(e,t=void 0){try{let r=this.docService.getDocumentPaths();r&&this.db&&(this.sessionSub&&this.sessionSub.unsubscribe(),this.sessionSub=this.commonDbService.dbListener({feature:"flockSession",properties:{documentId:r?.documentId,organizationId:r?.organizationId,id:e,skipFirestore:!0}}).subscribe(i=>{i?.data&&typeof i?.data=="object"&&Object.keys(i?.data)?.length>0?(this.currentSession=i?.data,t!==void 0&&this.currentSession?.followers.findIndex(o=>o.snippylyId===t)===-1&&(this.currentSession.followers.push(new S(t)),this.updateSession(this.currentSession.id,this.currentSession)),this.currentSession$.next(this.currentSession??null)):(this.currentSession=void 0,this.currentSession$.next(null))}))}catch(r){this.loggingService.catch("Error in FlockSessionService subscribeToCurrentSession: ",r)}}subscribeToCurrentFlockUser(e){try{let t=this.docService.getDocumentPaths();t&&this.db&&(this.currentUserSub&&this.currentUserSub.unsubscribe(),this.currentUserSub=this.commonDbService.dbListener({feature:"flockUser",properties:{documentId:t?.documentId,organizationId:t?.organizationId,id:e,skipFirestore:!0}}).pipe(x(r=>(this.loggingService.catch("Error in FlockSessionService subscribeToCurrentFlockUser: ",r),A(null)))).subscribe(r=>{r?.data&&typeof r?.data=="object"&&Object.keys(r?.data)?.length>0&&(this.currentUser$.next(r?.data),r?.data?.sessionId&&this.subscribeToCurrentSession(r?.data?.sessionId))},r=>{this.loggingService.catch("Error in FlockSessionService subscribeToCurrentFlockUser subscription: ",r)}))}catch(t){this.loggingService.catch("Error in FlockSessionService subscribeToCurrentFlockUser: ",t)}}updateSession(e,t={}){try{if(!e)return;let r=this.docService.getDocumentPaths();for(let i in t)t.hasOwnProperty(i)&&t[i]===void 0&&delete t[i];r&&this.db&&this.commonDbService.updateData({feature:"flockSession",properties:{documentId:r?.documentId??"",organizationId:r?.organizationId??"",id:e,skipFirestore:!0},data:JSON.parse(JSON.stringify(t))})}catch(r){this.loggingService.catch("Error in FlockSessionService updateSession: ",r)}}deleteSession(e){try{let t=this.docService.getDocumentPaths();t&&this.db&&(this.commonDbService.deleteData({feature:"flockSession",properties:{documentId:t?.documentId??"",organizationId:t?.organizationId??"",id:e,skipFirestore:!0}}),this.currentSession&&e===this.currentSession.id&&(this.updateRemoteFlockUser(this.currentSession.leaderId,{sessionId:null,isLeader:!1,lastProcessedActionTimestamp:null}),this.currentSession.followers.forEach(r=>{this.updateRemoteFlockUser(r.snippylyId,{sessionId:null,lastProcessedActionTimestamp:null})}),this.currentSession=void 0,this.currentSession$.next(null),this.sessionSub?.unsubscribe()))}catch(t){this.loggingService.catch("Error in FlockSessionService deleteSession: ",t)}}addActionToStack(e,t){try{t=t&&JSON.parse(JSON.stringify(t));let r=this.docService.getDocumentPaths();if(r&&this.db&&e){let i=this.realtimeAdapter.rtdbRef(this.db,`${r.flock}/sessions/${e}/actionStack`);this.realtimeAdapter.rtdbRunTransaction("flockSession",i,o=>o?(o.unshift(t),o.slice(0,5)):[t]),t.type===h.NAVIGATE&&this.updateSession(e,{pageInfo:t.pageInfo})}}catch(r){this.loggingService.catch("Error in FlockSessionService addActionToStack: ",r)}}};n.\u0275fac=function(t){return new(t||n)(a(B),a(J),a(g),a(b),a(W),a(K))},n.\u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"});let l=n;return l})();var Z=(()=>{let n=class n{constructor(e,t,r,i){this.componentFactoryResolver=e,this.applicationRef=t,this.injector=r,this.loggingService=i,this.darkMode=!1}createFollowOverlay(e,t){try{let i=this.componentFactoryResolver.resolveComponentFactory(N).create(this.injector);i.instance.setLeaderName(e),i.instance.closeOverlayEvent.pipe(f(1)).subscribe(()=>{this.removeOverlay(),t()}),this.applicationRef.attachView(i.hostView),this.overlayRef=i,this.overlayRef.instance.darkMode=this.darkMode;let o=this.overlayRef.location.nativeElement;o.id="snippyly-follow-overlay",o.setAttribute(m.ATTRIBUTES.VELT_IGNORE,""),document.body.appendChild(o)}catch(r){this.loggingService.catch("Error in FlockOverlayService createFollowOverlay: ",r)}}createLeaderOverlay(e){let r=this.componentFactoryResolver.resolveComponentFactory(N).create(this.injector);r.instance.setType("leading"),r.instance.closeOverlayEvent.pipe(f(1)).subscribe(()=>{this.removeOverlay(),e()}),this.applicationRef.attachView(r.hostView),this.overlayRef=r,this.overlayRef.instance.darkMode=this.darkMode;let i=this.overlayRef.location.nativeElement;i.id="snippyly-follow-overlay",i.setAttribute(m.ATTRIBUTES.VELT_IGNORE,""),document.body.appendChild(i)}changeLeaderName(e){this.overlayRef&&this.overlayRef.instance.setLeaderName(e)}getLeaderName(){return this.overlayRef?this.overlayRef.instance.getLeaderName():null}removeOverlay(){if(this.overlayRef){let e=this.overlayRef.location.nativeElement;this.applicationRef.detachView(this.overlayRef.hostView),this.overlayRef.destroy(),e.shadowRoot&&e.shadowRoot.removeChild(e.shadowRoot.childNodes[0]),e.remove(),this.overlayRef=void 0}}setDarkMode(e){try{this.darkMode=e,this.overlayRef&&(this.overlayRef.instance.darkMode=e)}catch(t){this.loggingService.catch("Error in FlockOverlayService setDarkMode: ",t)}}};n.\u0275fac=function(t){return new(t||n)(a(j),a(X),a(M),a(g))},n.\u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"});let l=n;return l})();var Ce=(()=>{let n=class n{constructor(e,t,r,i,o){this.authService=e,this.domService=t,this.loggingService=r,this.flockSessionService=i,this.flockOverlayService=o,this.flockLeader$=new p({userId:"",name:""}),this.flockMode$=new p(!1),this.currentFlockUser=null,this.localScrollData=[],this.domSubscriptions=[],this.followOverlayCreated=!1,this.leaderOverlayCreated=!1,this.windowFocused=!0,this.tabFocused=!0,this.useHistoryAPI=!0,this.disableDefaultNavigation=!1;try{this.flockLeader$.subscribe(s=>{let{userId:c,name:d}=s,O=c;if(this.provisionFollowUser(),O&&this.currentFlockUser&&this.currentFlockUser.snippylyId)if(this.currentFlockUser.sessionId){if(this.currentFlockUser.snippylyId&&this.currentFlockUser.isLeader){this.flockSessionService.swapLeader(this.currentFlockUser.snippylyId,O,d);return}this.removeCurrentUserFromSession()}else this.flockSessionService.provisionFlockSession(O,d,this.currentFlockUser.snippylyId)},s=>{this.loggingService.catch("Error in FlockService flockLeader$ subscription: ",s)}),this.flockSessionService.currentSession$.subscribe(s=>{if(s!==null){if(this.currentFlockUser&&(this.currentFlockUser.sessionId===null||this.currentFlockUser.sessionId===void 0)&&this.currentFlockUser.snippylyId&&(this.currentFlockUser.sessionId=s.id,this.flockSessionService.updateRemoteFlockUser(this.currentFlockUser.snippylyId,this.currentFlockUser)),this.currentFlockUser&&!this.currentFlockUser.isLeader&&!this.followOverlayCreated&&(this.leaderOverlayCreated&&(this.flockOverlayService.removeOverlay(),this.leaderOverlayCreated=!1),this.followOverlayCreated=!0,this.flockOverlayService.createFollowOverlay(s.leaderName,()=>{this.removeCurrentUserFromSession(),this.followOverlayCreated=!1})),this.currentFlockUser&&this.currentFlockUser.isLeader&&!this.leaderOverlayCreated&&(this.followOverlayCreated&&(this.flockOverlayService.removeOverlay(),this.followOverlayCreated=!1),this.leaderOverlayCreated=!0,this.flockOverlayService.createLeaderOverlay(()=>{this.removeCurrentUserFromSession(),this.leaderOverlayCreated=!1})),this.currentFlockUser&&!this.currentFlockUser.isLeader&&s.actionStack){let c=s.actionStack[0];c&&this.currentFlockUser.lastProcessedActionTimestamp!==c.timestamp&&this.processAction(c)}if(this.currentFlockUser&&!this.currentFlockUser.isLeader&&this.followOverlayCreated&&this.flockOverlayService.getLeaderName()!==null&&s.leaderName!==this.flockOverlayService.getLeaderName()&&this.flockOverlayService.changeLeaderName(s.leaderName),this.currentFlockUser&&this.currentFlockUser.isLeader){let c=k();if(s.pageInfo){if(c&&c.url!==s.pageInfo.url){let d=new u;d.type=h.NAVIGATE,this.flockSessionService.addActionToStack(s.id,d)}}else{this.flockSessionService.updateSession(s.id,{pageInfo:c});let d=new u;d.type=h.NAVIGATE,this.flockSessionService.addActionToStack(s.id,d)}}}else this.currentFlockUser&&this.leaderOverlayCreated&&(this.flockOverlayService.removeOverlay(),this.leaderOverlayCreated=!1),this.currentFlockUser&&this.followOverlayCreated&&(this.flockOverlayService.removeOverlay(),this.followOverlayCreated=!1)}),this.flockSessionService.currentUser$.subscribe(s=>{if(s!==null&&(this.currentFlockUser&&this.currentFlockUser.isLeader!==s.isLeader&&(this.domSubscriptions.forEach(c=>c.unsubscribe()),this.domSubscriptions=[]),this.currentFlockUser=s,s.sessionId&&this.domSubscriptions.length===0))if(s.isLeader){if(!this.tabFocused||!this.windowFocused)return;this.subscribeToLeaderDOMEvents()}else this.subscribeToFollowerDOMEvents()}),D([this.authService.getUser$(),this.getFlockMode$()]).subscribe(([s,c])=>{s&&s.userSnippylyId&&c?this.flockSessionService.startCurrentFlockUserSubscription(s):this.flockSessionService.stopCurrentFlockUserSubscription()})}catch(s){this.loggingService.catch("Error in FlockService constructor: ",s)}}provisionFollowUser(){try{if(this.currentFlockUser===null){let e=this.authService.getUser();e&&e.userSnippylyId&&(this.currentFlockUser=new E,this.currentFlockUser.snippylyId=e.userSnippylyId)}}catch(e){this.loggingService.catch("Error in FlockService provisionFollowUser: ",e)}}startFollowingUser(e,t){try{if(this.provisionFollowUser(),e&&this.currentFlockUser&&this.currentFlockUser.snippylyId){if(this.currentFlockUser.sessionId){if(this.currentFlockUser.snippylyId&&this.currentFlockUser.isLeader){this.flockSessionService.swapLeader(this.currentFlockUser.snippylyId,e,t);return}this.removeCurrentUserFromSession()}this.flockSessionService.provisionFlockSession(e,t,this.currentFlockUser.snippylyId)}}catch(r){this.loggingService.catch("Error in FlockService startFollowingUser: ",r)}}stopFollowingUser(){try{this.removeCurrentUserFromSession()}catch(e){this.loggingService.catch("Error in FlockService stopFollowingUser: ",e)}}subscribeToUrlChanges(){try{if(this.useHistoryAPI){let e=window.history.pushState,t=window.history.replaceState;window.history.pushState=(...r)=>{e.apply(window.history,r),this.onUrlChange()},window.history.replaceState=(...r)=>{t.apply(window.history,r),this.onUrlChange()},this.domSubscriptions.push({unsubscribe:()=>{window.history.pushState=e,window.history.replaceState=t}}),this.domSubscriptions.push(y(window,"popstate").subscribe(()=>{this.onUrlChange()}))}}catch(e){this.loggingService.catch("Error in FlockService subscribeToUrlChanges: ",e)}}onUrlChange(){try{if(this.currentFlockUser&&this.currentFlockUser.sessionId&&this.currentFlockUser.isLeader){let e=new u;e.type=h.NAVIGATE,this.flockSessionService.addActionToStack(this.currentFlockUser.sessionId,e)}}catch(e){this.loggingService.catch("Error in FlockService onUrlChange: ",e)}}processAction(e){try{switch(e.type){case h.CLICK:this.clickUserElement(e.data);break;case h.HOVER:this.scrollToHoveredElement(e.data);break;case h.SCROLL:this.scrollToFollowedUser(e.data);break;case h.NAVIGATE:this.checkMatchingUrl(e.pageInfo);break}this.currentFlockUser&&this.currentFlockUser.snippylyId&&this.flockSessionService.updateRemoteFlockUser(this.currentFlockUser.snippylyId,{lastProcessedActionTimestamp:e.timestamp})}catch(t){this.loggingService.catch("Error in FlockService processAction: ",t)}}subscribeToLeaderDOMEvents(){try{this.domSubscriptions.length>0&&(this.domSubscriptions.forEach(e=>e.unsubscribe()),this.domSubscriptions=[]),this.domSubscriptions.push(y(window,"mouseover").pipe(C(500)).subscribe(e=>{let t=e?.target;if(t){let r=window.getComputedStyle(t);if(r.position==="fixed"||r.position==="sticky"||t.hasAttribute(m.ATTRIBUTES.VELT_IGNORE))return;t=L(t,{x:e.clientX,y:e.clientY}),this.updateHoveredElement(t)}})),this.domSubscriptions.push(this.domService.onWindowClick$().subscribe(e=>{let t=e?.target;if(t){if(t.hasAttribute(m.ATTRIBUTES.VELT_IGNORE))return;this.updateClickedElement(t)}})),this.subscribeToUrlChanges(),this.subscribeToScrollables()}catch(e){this.loggingService.catch("Error in FlockService subscribeToLeaderDOMEvents: ",e)}}subscribeToFollowerDOMEvents(){}updateClickedElement(e){try{if(this.currentFlockUser&&this.currentFlockUser.sessionId){let t=this.domService.getXPath(e),r=T(e),i=this.domService.getXPath(r),o={id:Math.random().toString(36).substring(2),xpath:t,parentXpath:i},s=new u;s.type=h.CLICK,s.data=o,this.flockSessionService.addActionToStack(this.currentFlockUser.sessionId,s)}}catch(t){this.loggingService.catch("Error in FlockService updateClickedElement: ",t)}}updateHoveredElement(e){try{if(this.currentFlockUser&&this.currentFlockUser.sessionId){let t=this.domService.getXPath(e),r=T(e),i=this.domService.getXPath(r),o={id:Math.random().toString(36).substring(2),xpath:t,parentXpath:i},s=new u;s.type=h.HOVER,s.data=o,this.flockSessionService.addActionToStack(this.currentFlockUser.sessionId,s)}}catch(t){this.loggingService.catch("Error in FlockService updateHoveredElement: ",t)}}subscribeToScrollables(){try{let e=V();e.push(document),e?.forEach(t=>{this.domSubscriptions.push(y(t,"scroll").pipe(C(100)).subscribe(r=>{this.currentFlockUser&&this.currentFlockUser.sessionId&&this.currentFlockUser.isLeader&&this.updateScrollPositionOfElement(t)}))})}catch(e){this.loggingService.catch("Error in FlockService getScrollableElements: ",e)}}updateScrollPositionOfElement(e){try{if(this.currentFlockUser&&this.currentFlockUser.sessionId){let t=new U("","");if(e===document){let o=z();if(o){let s=L(o);s&&(t.targetXpath=this.domService.getXPath(s))}t.xpath=""}else{let o=H(e);t.targetXpath=this.domService.getXPath(o),t.xpath=this.domService.getXPath(e)}let r=!1,i=!1;if(this.localScrollData.forEach((o,s)=>{o.xpath===o.xpath&&(t.targetXpath!==o.targetXpath&&(r=!0),this.localScrollData[s]=Object.assign(o,t),i=!0)}),i||this.localScrollData.push(t),r||!i){let o=new u;o.type=h.SCROLL,o.data=t,this.flockSessionService.addActionToStack(this.currentFlockUser.sessionId,o)}}}catch(t){this.loggingService.catch("Error in FlockService calculateScrollPositionOfAnElement: ",t)}}enableFlockMode(e){try{if(this.flockMode$.next(!0),e){let{useHistoryAPI:t,onNavigate:r,disableDefaultNavigation:i,darkMode:o}=e;t!==void 0&&(this.useHistoryAPI=t),r!==void 0&&typeof r=="function"&&(this.onNavigate=r),i!==void 0&&(this.disableDefaultNavigation=i),this.flockOverlayService.setDarkMode(o)}}catch(t){this.loggingService.catch("Error in FlockService enableFlockMode: ",t)}}disableFlockMode(){try{this.flockMode$.next(!1),this.onNavigateEmitter=void 0,this.useHistoryAPI=!0,this.onNavigate=void 0}catch(e){this.loggingService.catch("Error in FlockService disableFlockMode: ",e)}}setDisableFlockNavigation(e){try{this.disableDefaultNavigation=e}catch(t){this.loggingService.catch("Error in FlockService setDisableFlockNavigation: ",t)}}getFlockMode$(){return this.flockMode$.asObservable()}getFlockMode(){return this.flockMode$.value}setNavigateEmitter(e){try{this.onNavigateEmitter=e}catch(t){this.loggingService.catch("Error in FlockService setNavigateEmitter: ",t)}}setTabFocused(e){try{if(this.tabFocused=e,!this.currentFlockUser)return;this.currentFlockUser.isLeader&&this.currentFlockUser.sessionId&&(this.tabFocused&&this.domSubscriptions.length===0?this.subscribeToLeaderDOMEvents():!this.tabFocused&&this.domSubscriptions.length>0&&(this.domSubscriptions.forEach(r=>{r.unsubscribe()}),this.domSubscriptions=[]))}catch(t){this.loggingService.catch("Error in FlockService setTabFocused: ",t)}}setWindowFocused(e){try{if(this.windowFocused=e,!this.currentFlockUser)return;this.currentFlockUser.isLeader&&this.currentFlockUser.sessionId&&(this.windowFocused&&this.domSubscriptions.length===0?this.subscribeToLeaderDOMEvents():!this.windowFocused&&this.domSubscriptions.length>0&&(this.domSubscriptions.forEach(r=>{r.unsubscribe()}),this.domSubscriptions=[]))}catch(t){this.loggingService.catch("Error in FlockService setWindowFocused: ",t)}}setFlockLeader(e,t){try{this.flockLeader$.next({userId:e,name:t})}catch(r){this.loggingService.catch("Error in FlockService setFlockLeader: ",r)}}isInSession(){try{return!!(this.currentFlockUser&&this.currentFlockUser.sessionId)}catch(e){this.loggingService.catch("Error in FlockService isFollowing: ",e)}return!1}removeCurrentUserFromSession(){try{this.domSubscriptions.forEach(e=>e.unsubscribe()),this.domSubscriptions=[],this.currentFlockUser&&(this.currentFlockUser.isLeader?this.currentFlockUser.sessionId&&this.flockSessionService.deleteSession(this.currentFlockUser.sessionId):this.currentFlockUser.snippylyId&&this.flockSessionService.removeFollowerFromCurrentSession(this.currentFlockUser.snippylyId))}catch(e){this.loggingService.catch("Error in FlockService removeCurrentUserFromSession: ",e)}}checkMatchingUrl(e){try{let r=k()?.url,i=e.url;if(r!==i&&i!==void 0){let{url:o,path:s,baseUrl:c}=e;if(this.onNavigate!==void 0&&typeof this.onNavigate=="function"){this.onNavigate({url:o,path:s,baseUrl:c});return}if(this.onNavigateEmitter&&this.onNavigateEmitter.emit({url:o,path:s,baseUrl:c}),this.disableDefaultNavigation)return;window.location.href=i}}catch(t){this.loggingService.catch("Error in FlockService checkMatchingUrl: ",t)}}scrollToFollowedUser(e){try{if(e.xpath===""){let t=this.domService.getElementFromXPath(e.targetXpath);t&&F(t)}else{let t=this.domService.getElementFromXPath(e.xpath),r=this.domService.getElementFromXPath(e.targetXpath);t&&r&&(F(t),R(t,r))}}catch(t){this.loggingService.catch("Error in FlockService scrollToFollowedUser: ",t)}}clickUserElement(e){try{let t=this.domService.getElementFromXPath(e.xpath);t&&this.lastClickedElement?.id!==e.id&&(t?.click(),this.lastClickedElement=e)}catch(t){this.loggingService.catch("Error in FlockService clickUserElement: ",t)}}scrollToHoveredElement(e){try{let t=this.domService.getElementFromXPath(e.xpath);if(t&&e.parentXpath)if(e.parentXpath==="/html")F(t);else{let r=this.domService.getElementFromXPath(e.parentXpath);r&&R(r,t,!0)}}catch(t){this.loggingService.catch("Error in FlockService clickUserElement: ",t)}}};n.\u0275fac=function(t){return new(t||n)(a(b),a(G),a(g),a(Q),a(Z))},n.\u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"});let l=n;return l})();export{Ce as a};
@@ -0,0 +1 @@
1
+ import{x as F}from"./chunk-MIANWP6R.js";import{b as G}from"./chunk-5YU74OX2.js";import{Ca as R,sa as H,ta as A,ua as L}from"./chunk-NCVN3JXT.js";import{$ as E,Fa as n,Gc as j,Hc as T,Ib as x,Ic as $,Ke as N,Nb as l,Pa as h,Pb as v,Ua as V,_a as u,a as I,ca as D,db as B,ja as m,ka as P,kc as d,ki as f,l as y,lb as p,lc as c,mb as a,nb as o,ob as g,pc as M,r as S,sb as k,tb as b,wa as O,zb as _}from"./chunk-CRZGZZVQ.js";function K(t,r){t&1&&(m(),a(0,"svg",16),g(1,"rect",17)(2,"path",18)(3,"path",19)(4,"rect",20)(5,"path",21),o())}function Q(t,r){t&1&&(m(),a(0,"svg",16),g(1,"rect",22)(2,"path",23)(3,"path",19)(4,"rect",20)(5,"path",21),o())}function X(t,r){if(t&1&&(k(0),a(1,"div",6)(2,"div",7),u(3,K,6,0,"svg",8)(4,Q,6,0,"ng-template",null,1,M),o(),a(6,"div",9),l(7),d(8,"translate"),g(9,"br"),l(10),d(11,"translate"),o(),a(12,"div",10)(13,"p"),l(14),d(15,"translate"),m(),a(16,"svg",11),g(17,"path",12)(18,"path",13)(19,"path",14)(20,"path",15),o(),l(21),d(22,"translate"),o(),P(),a(23,"p"),l(24),d(25,"translate"),o()()(),b()),t&2){let C=x(5),i=_();n(3),p("ngIf",i.darkMode)("ngIfElse",C),n(4),v(" ",c(8,7,"Allow mic permission to")),n(3),v("",c(11,9,"enable your audio")," "),n(4),v(" ",c(15,11,"1. Click the")," "),n(7),v(" ",c(22,13,"page info icon in your browser\u2019s address bar")," "),n(3),v(" ",c(25,15,"2. Turn on Microphone")," ")}}function Y(t,r){t&1&&(m(),a(0,"svg",16),g(1,"rect",17)(2,"path",24)(3,"path",19)(4,"rect",20)(5,"path",21),o())}function ee(t,r){t&1&&(m(),a(0,"svg",16),g(1,"rect",22)(2,"path",25)(3,"path",19)(4,"rect",20)(5,"path",21),o())}function te(t,r){if(t&1&&(k(0),a(1,"div",6)(2,"div",7),u(3,Y,6,0,"svg",8)(4,ee,6,0,"ng-template",null,2,M),o(),a(6,"div",9),l(7),d(8,"translate"),g(9,"br"),l(10),d(11,"translate"),o(),a(12,"div",10)(13,"p"),l(14),d(15,"translate"),m(),a(16,"svg",11),g(17,"path",12)(18,"path",13)(19,"path",14)(20,"path",15),o(),l(21),d(22,"translate"),o(),P(),a(23,"p"),l(24),d(25,"translate"),o()()(),b()),t&2){let C=x(5),i=_();n(3),p("ngIf",i.darkMode)("ngIfElse",C),n(4),v(" ",c(8,7,"Allow camera permission")),n(3),v("",c(11,9,"to enable your video")," "),n(4),v(" ",c(15,11,"1. Click the")," "),n(7),v(" ",c(22,13,"page info icon in your browser\u2019s address bar")," "),n(3),v(" ",c(25,15,"2. Turn on Camera")," ")}}var z=(()=>{let r=class r{constructor(i,e,s,w,W){this.loggingService=i,this.themeService=e,this.elementRef=s,this.matDialogRef=w,this.data=W,this.veltElement=!0,this.darkMode=!0;try{this.loggingService.log("%c[WB] Creating CLASS: DevicePermissionDeniedDialogComponent","color: blue;"),this.type=this.data?.type,[!0,!1].includes(this.data?.darkMode)&&(this.darkMode=this.data?.darkMode)}catch(Z){this.loggingService.catch("Error in DevicePermissionDeniedDialogComponent constructor: ",Z)}}ngOnDestroy(){}};r.\u0275fac=function(e){return new(e||r)(h(f),h(R),h(O),h(H,8),h(A,8))},r.\u0275cmp=V({type:r,selectors:[["velt-device-permission-denied-dialog-internal"]],hostVars:1,hostBindings:function(e,s){e&2&&B("data-velt-element",s.veltElement)},inputs:{type:"type"},standalone:!1,decls:5,vars:5,consts:[["devicePermissionDialogRef",""],["defaultAudioIcon",""],["defaultVideoIcon",""],[1,"velt-device-permission-denied-dialog--container",3,"snippylyOverlay","snippylyOverlayZIndex"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"velt-device-permission-denied-dialog"],[1,"velt-device-permission-denied-dialog--icon"],["width","61","height","60","viewBox","0 0 61 60","fill","none","xmlns","http://www.w3.org/2000/svg",4,"ngIf","ngIfElse"],[1,"velt-device-permission-denied-dialog--header"],[1,"velt-device-permission-denied-dialog--content"],["width","13","height","12","viewBox","0 0 13 12","fill","none","xmlns","http://www.w3.org/2000/svg",1,"velt-device-permission-denied-dialog--page-info-icon"],["d","M4.375 2.5C4.375 3.53553 3.53553 4.375 2.5 4.375C1.46447 4.375 0.625 3.53553 0.625 2.5C0.625 1.46447 1.46447 0.625 2.5 0.625C3.53553 0.625 4.375 1.46447 4.375 2.5Z","stroke","currentColor","stroke-opacity","0.6","stroke-width","1.25"],["d","M5 2.5H12.5","stroke","currentColor","stroke-opacity","0.6","stroke-width","1.25"],["d","M0 8.75H7.5","stroke","currentColor","stroke-opacity","0.6","stroke-width","1.25"],["d","M11.875 8.75C11.875 9.78553 11.0355 10.625 10 10.625C8.96447 10.625 8.125 9.78553 8.125 8.75C8.125 7.71447 8.96447 6.875 10 6.875C11.0355 6.875 11.875 7.71447 11.875 8.75Z","stroke","currentColor","stroke-opacity","0.6","stroke-width","1.25"],["width","61","height","60","viewBox","0 0 61 60","fill","none","xmlns","http://www.w3.org/2000/svg"],["x","0.5","y","4","width","56","height","56","rx","28","fill","white","fill-opacity","0.04"],["d","M23.5026 20.333C23.5026 19.0069 24.0294 17.7352 24.9671 16.7975C25.9048 15.8598 27.1765 15.333 28.5026 15.333C29.8287 15.333 31.1005 15.8598 32.0381 16.7975C32.9758 17.7352 33.5026 19.0069 33.5026 20.333V28.6663C33.5027 29.1599 33.4297 29.6508 33.2859 30.123M29.9526 33.4563C29.2054 33.6828 28.4155 33.7311 27.6463 33.5973C26.8771 33.4636 26.1499 33.1516 25.5229 32.6863C24.8959 32.2211 24.3866 31.6154 24.0358 30.9179C23.685 30.2204 23.5024 29.4504 23.5026 28.6697V27.003M16.8359 28.6663C16.8356 30.7719 17.405 32.8383 18.484 34.6465C19.5629 36.4546 21.111 37.9371 22.9642 38.9366C24.8174 39.9362 26.9066 40.4156 29.0102 40.324C31.1137 40.2324 33.1533 39.5732 34.9126 38.4163M38.2459 35.083C39.5023 33.1791 40.1701 30.9474 40.1659 28.6663M21.8359 46.9997H35.1693M28.5026 40.333V46.9997","stroke","white","stroke-opacity","0.52","stroke-width","2.5","stroke-linecap","round","stroke-linejoin","round"],["d","M13.5 17L43.5 47","stroke","currentColor","stroke-width","2.5","stroke-linecap","round","stroke-linejoin","round"],["x","36.5","width","24","height","24","rx","12","fill","currentColor"],["d","M48.5 18.99V19M48.5 14V5","stroke","white","stroke-width","2.5","stroke-linecap","round","stroke-linejoin","round"],["x","0.5","y","4","width","56","height","56","rx","28","fill","black","fill-opacity","0.04"],["d","M23.5026 20.333C23.5026 19.0069 24.0294 17.7352 24.9671 16.7975C25.9048 15.8598 27.1765 15.333 28.5026 15.333C29.8287 15.333 31.1005 15.8598 32.0381 16.7975C32.9758 17.7352 33.5026 19.0069 33.5026 20.333V28.6663C33.5027 29.1599 33.4297 29.6508 33.2859 30.123M29.9526 33.4563C29.2054 33.6828 28.4155 33.7311 27.6463 33.5973C26.8771 33.4636 26.1499 33.1516 25.5229 32.6863C24.8959 32.2211 24.3866 31.6154 24.0358 30.9179C23.685 30.2204 23.5024 29.4504 23.5026 28.6697V27.003M16.8359 28.6663C16.8356 30.7719 17.405 32.8383 18.484 34.6465C19.5629 36.4546 21.111 37.9371 22.9642 38.9366C24.8174 39.9362 26.9066 40.4156 29.0102 40.324C31.1137 40.2324 33.1533 39.5732 34.9126 38.4163M38.2459 35.083C39.5023 33.1791 40.1701 30.9474 40.1659 28.6663M21.8359 46.9997H35.1693M28.5026 40.333V46.9997","stroke","black","stroke-opacity","0.52","stroke-width","2.5","stroke-linecap","round","stroke-linejoin","round"],["d","M42.375 39.2135C42.7034 39.1007 42.9883 38.8881 43.19 38.6054C43.3917 38.3227 43.5001 37.9841 43.5 37.6369V26.3635C43.4998 26.0795 43.4271 25.8003 43.2888 25.5523C43.1504 25.3043 42.9509 25.0958 42.7093 24.9465C42.4677 24.7973 42.192 24.7122 41.9083 24.6994C41.6246 24.6867 41.3424 24.7466 41.0883 24.8735L33.5 28.6669V30.3335V25.3333C33.5 24.4493 33.1488 23.6014 32.5237 22.9763C31.8986 22.3512 31.0507 22 30.1667 22H25.1667M33.5 37V38.6667C33.5 39.5507 33.1488 40.3986 32.5237 41.0237C31.8986 41.6488 31.0507 42 30.1667 42H16.8333C15.9493 42 15.1014 41.6488 14.4763 41.0237C13.8512 40.3986 13.5 39.5507 13.5 38.6667V25.3333C13.5 24.4493 13.8512 23.6014 14.4763 22.9763C15.1014 22.3512 15.9493 22 16.8333 22H18.5","stroke","white","stroke-opacity","0.52","stroke-width","2.5","stroke-linecap","round","stroke-linejoin","round"],["d","M42.375 39.2135C42.7034 39.1007 42.9883 38.8881 43.19 38.6054C43.3917 38.3227 43.5001 37.9841 43.5 37.6369V26.3635C43.4998 26.0795 43.4271 25.8003 43.2888 25.5523C43.1504 25.3043 42.9509 25.0958 42.7093 24.9465C42.4677 24.7973 42.192 24.7122 41.9083 24.6994C41.6246 24.6867 41.3424 24.7466 41.0883 24.8735L33.5 28.6669V30.3335V25.3333C33.5 24.4493 33.1488 23.6014 32.5237 22.9763C31.8986 22.3512 31.0507 22 30.1667 22H25.1667M33.5 37V38.6667C33.5 39.5507 33.1488 40.3986 32.5237 41.0237C31.8986 41.6488 31.0507 42 30.1667 42H16.8333C15.9493 42 15.1014 41.6488 14.4763 41.0237C13.8512 40.3986 13.5 39.5507 13.5 38.6667V25.3333C13.5 24.4493 13.8512 23.6014 14.4763 22.9763C15.1014 22.3512 15.9493 22 16.8333 22H18.5","stroke","currentColor","stroke-opacity","0.52","stroke-width","2.5","stroke-linecap","round","stroke-linejoin","round"]],template:function(e,s){if(e&1&&(a(0,"div",3,0),k(2,4),u(3,X,26,17,"ng-container",5)(4,te,26,17,"ng-container",5),b(),o()),e&2){let w=x(1);p("snippylyOverlay",w)("snippylyOverlayZIndex",3e3),n(2),p("ngSwitch",s.type),n(),p("ngSwitchCase","audio"),n(),p("ngSwitchCase","video")}},dependencies:[j,T,$,F,G],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}[_nghost-%COMP%]{--velt-green: var(--velt-light-mode-green);--velt-magenta: var(--velt-light-mode-magenta);--velt-amber: var(--velt-light-mode-amber);--velt-purple: var(--velt-light-mode-purple);--velt-cyan: var(--velt-light-mode-cyan);--velt-orange: var(--velt-light-mode-orange);--velt-black: var(--velt-light-mode-black);--velt-white: var(--velt-light-mode-white);--velt-gray: var(--velt-light-mode-gray);--velt-error: var(--velt-light-mode-error);--velt-error-hover: var(--velt-light-mode-error-hover);--velt-error-foreground: var(--velt-light-mode-error-foreground);--velt-error-light: var(--velt-light-mode-error-light);--velt-error-transparent: var(--velt-light-mode-error-transparent);--velt-warning: var(--velt-light-mode-warning);--velt-warning-hover: var(--velt-light-mode-warning-hover);--velt-warning-foreground: var(--velt-light-mode-warning-foreground);--velt-warning-light: var(--velt-light-mode-warning-light);--velt-warning-transparent: var(--velt-light-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-light-mode-success);--velt-success-hover: var(--velt-light-mode-success-hover);--velt-success-foreground: var(--velt-light-mode-success-foreground);--velt-success-light: var(--velt-light-mode-success-light);--velt-success-transparent: var(--velt-light-mode-success-transparent);--velt-accent: var(--velt-light-mode-accent);--velt-accent-text: var(--velt-light-mode-accent-text);--velt-accent-hover: var(--velt-light-mode-accent-hover);--velt-accent-foreground: var(--velt-light-mode-accent-foreground);--velt-accent-light: var(--velt-light-mode-accent-light);--velt-accent-transparent: var(--velt-light-mode-accent-transparent);--velt-text-0: var(--velt-light-mode-text-0);--velt-text-1: var(--velt-light-mode-text-1);--velt-text-2: var(--velt-light-mode-text-2);--velt-text-3: var(--velt-light-mode-text-3);--velt-text-4: var(--velt-light-mode-text-4);--velt-text-5: var(--velt-light-mode-text-5);--velt-text-6: var(--velt-light-mode-text-6);--velt-text-7: var(--velt-light-mode-text-7);--velt-text-8: var(--velt-light-mode-text-8);--velt-text-9: var(--velt-light-mode-text-9);--velt-text-10: var(--velt-light-mode-text-10);--velt-text-11: var(--velt-light-mode-text-11);--velt-text-12: var(--velt-light-mode-text-12);--velt-background-0: var(--velt-light-mode-background-0);--velt-background-1: var(--velt-light-mode-background-1);--velt-background-2: var(--velt-light-mode-background-2);--velt-background-3: var(--velt-light-mode-background-3);--velt-background-4: var(--velt-light-mode-background-4);--velt-background-5: var(--velt-light-mode-background-5);--velt-background-6: var(--velt-light-mode-background-6);--velt-background-7: var(--velt-light-mode-background-7);--velt-background-8: var(--velt-light-mode-background-8);--velt-background-9: var(--velt-light-mode-background-9);--velt-background-10: var(--velt-light-mode-background-10);--velt-border-0: var(--velt-light-mode-border-0);--velt-border-1: var(--velt-light-mode-border-1);--velt-border-2: var(--velt-light-mode-border-2);--velt-border-3: var(--velt-light-mode-border-3);--velt-border-4: var(--velt-light-mode-border-4);--velt-border-5: var(--velt-light-mode-border-5);--velt-border-6: var(--velt-light-mode-border-6);--velt-border-7: var(--velt-light-mode-border-7);--velt-border-8: var(--velt-light-mode-border-8);--velt-border-9: var(--velt-light-mode-border-9);--velt-border-10: var(--velt-light-mode-border-10);--velt-background-transparent: var(--velt-light-mode-background-transparent);--velt-border-transparent: var(--velt-light-mode-border-transparent);--velt-animation-transparent: var(--velt-light-mode-animation-transparent)}[dark][_nghost-%COMP%]{--velt-green: var(--velt-dark-mode-green);--velt-magenta: var(--velt-dark-mode-magenta);--velt-amber: var(--velt-dark-mode-amber);--velt-purple: var(--velt-dark-mode-purple);--velt-cyan: var(--velt-dark-mode-cyan);--velt-orange: var(--velt-dark-mode-orange);--velt-black: var(--velt-dark-mode-black);--velt-white: var(--velt-dark-mode-white);--velt-gray: var(--velt-dark-mode-gray);--velt-error: var(--velt-dark-mode-error);--velt-error-hover: var(--velt-dark-mode-error-hover);--velt-error-foreground: var(--velt-dark-mode-error-foreground);--velt-error-light: var(--velt-dark-mode-error-light);--velt-error-transparent: var(--velt-dark-mode-error-transparent);--velt-warning: var(--velt-dark-mode-warning);--velt-warning-hover: var(--velt-dark-mode-warning-hover);--velt-warning-foreground: var(--velt-dark-mode-warning-foreground);--velt-warning-light: var(--velt-dark-mode-warning-light);--velt-warning-transparent: var(--velt-dark-mode-warning-transparent);--velt-agent-accent: #4495ff;--velt-agent-accent-transparent: rgba(68, 149, 255, .2);--velt-success: var(--velt-dark-mode-success);--velt-success-hover: var(--velt-dark-mode-success-hover);--velt-success-foreground: var(--velt-dark-mode-success-foreground);--velt-success-light: var(--velt-dark-mode-success-light);--velt-success-transparent: var(--velt-dark-mode-success-transparent);--velt-accent: var(--velt-dark-mode-accent);--velt-accent-text: var(--velt-dark-mode-accent-text);--velt-accent-hover: var(--velt-dark-mode-accent-hover);--velt-accent-foreground: var(--velt-dark-mode-accent-foreground);--velt-accent-light: var(--velt-dark-mode-accent-light);--velt-accent-transparent: var(--velt-dark-mode-accent-transparent);--velt-text-0: var(--velt-dark-mode-text-0);--velt-text-1: var(--velt-dark-mode-text-1);--velt-text-2: var(--velt-dark-mode-text-2);--velt-text-3: var(--velt-dark-mode-text-3);--velt-text-4: var(--velt-dark-mode-text-4);--velt-text-5: var(--velt-dark-mode-text-5);--velt-text-6: var(--velt-dark-mode-text-6);--velt-text-7: var(--velt-dark-mode-text-7);--velt-text-8: var(--velt-dark-mode-text-8);--velt-text-9: var(--velt-dark-mode-text-9);--velt-text-10: var(--velt-dark-mode-text-10);--velt-text-11: var(--velt-dark-mode-text-11);--velt-text-12: var(--velt-dark-mode-text-12);--velt-background-0: var(--velt-dark-mode-background-0);--velt-background-1: var(--velt-dark-mode-background-1);--velt-background-2: var(--velt-dark-mode-background-2);--velt-background-3: var(--velt-dark-mode-background-3);--velt-background-4: var(--velt-dark-mode-background-4);--velt-background-5: var(--velt-dark-mode-background-5);--velt-background-6: var(--velt-dark-mode-background-6);--velt-background-7: var(--velt-dark-mode-background-7);--velt-background-8: var(--velt-dark-mode-background-8);--velt-background-9: var(--velt-dark-mode-background-9);--velt-background-10: var(--velt-dark-mode-background-10);--velt-border-0: var(--velt-dark-mode-border-0);--velt-border-1: var(--velt-dark-mode-border-1);--velt-border-2: var(--velt-dark-mode-border-2);--velt-border-3: var(--velt-dark-mode-border-3);--velt-border-4: var(--velt-dark-mode-border-4);--velt-border-5: var(--velt-dark-mode-border-5);--velt-border-6: var(--velt-dark-mode-border-6);--velt-border-7: var(--velt-dark-mode-border-7);--velt-border-8: var(--velt-dark-mode-border-8);--velt-border-9: var(--velt-dark-mode-border-9);--velt-border-10: var(--velt-dark-mode-border-10);--velt-background-transparent: var(--velt-dark-mode-background-transparent);--velt-border-transparent: var(--velt-dark-mode-border-transparent);--velt-animation-transparent: var(--velt-dark-mode-animation-transparent)} .velt-mat-dialog-container.velt-device-permission-denied-dialog--panel mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{padding:0;background-color:transparent;box-shadow:none;overflow:unset}.velt-device-permission-denied-dialog[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--velt-spacing-lg);align-items:center;justify-content:center;padding:4rem;box-sizing:border-box;word-break:break-word;max-width:600px;max-height:400px;text-align:center;background-color:var(--velt-background-0);border-radius:var(--velt-border-radius-2xl);box-shadow:0 calc((4rem + 0px) * var(--velt-base-rem-unit)) calc((4rem + 0px) * var(--velt-base-rem-unit)) calc((-3rem + 0px) * var(--velt-base-rem-unit)) #1f2f461f}.velt-device-permission-denied-dialog[_ngcontent-%COMP%] .velt-device-permission-denied-dialog--icon[_ngcontent-%COMP%]{color:var(--velt-error)}.velt-device-permission-denied-dialog[_ngcontent-%COMP%] .velt-device-permission-denied-dialog--header[_ngcontent-%COMP%]{font-size:var(--velt-font-size-lg);font-weight:600;line-height:36px;letter-spacing:-.02em;text-align:center;color:var(--velt-text-0)}.velt-device-permission-denied-dialog[_ngcontent-%COMP%] .velt-device-permission-denied-dialog--content[_ngcontent-%COMP%]{font-size:var(--velt-font-size-sm);font-weight:400;line-height:21px;text-align:center;color:var(--velt-text-0)}.velt-device-permission-denied-dialog[_ngcontent-%COMP%] .velt-device-permission-denied-dialog--content[_ngcontent-%COMP%] .velt-device-permission-denied-dialog--page-info-icon[_ngcontent-%COMP%]{margin-left:var(--velt-spacing-sm);margin-right:var(--velt-spacing-sm);color:var(--velt-error)}"],changeDetection:0});let t=r;return t})();var me=(()=>{let r=class r{constructor(i,e){this.loggingService=i,this.matDialog=e,this.audioPermissionState$=new y(null),this.videoPermissionState$=new y(null);try{this.loggingService.log("%c[WB] Creating CLASS: DevicePermissionService","color: blue;"),this.checkPermissions()}catch(s){this.loggingService.catch("Error in DevicePermissionService constructor: ",s)}}checkPermissions(){try{this.loggingService.log("%c[WB] Calling DevicePermissionService FUNCTION: checkPermissions","color: green;"),new N().browserName!=="Firefox"&&(navigator.permissions.query({name:"microphone"}).then(e=>{this.audioPermissionState$.next(e.state),e.onchange=()=>{this.audioPermissionState$.next(e.state)}}).catch(e=>{}),navigator.permissions.query({name:"camera"}).then(e=>{this.videoPermissionState$.next(e.state),e.onchange=()=>{this.videoPermissionState$.next(e.state)}}).catch(e=>{}))}catch(i){this.loggingService.catch("Error in DevicePermissionService checkPermissions: ",i)}}getPermissionState$(i){try{switch(this.loggingService.log("%c[WB] Calling DevicePermissionService FUNCTION: getPermissionState$","color: green;"),i){case"audio":return this.getAudioPermissionState$();case"video":return this.getVideoPermissionState$();default:return S(null)}}catch(e){return this.loggingService.catch("Error in DevicePermissionService getPermissionState$: ",e),S(null)}}getAudioPermissionState$(){return this.audioPermissionState$.asObservable()}getVideoPermissionState$(){return this.videoPermissionState$.asObservable()}openDevicePermissionDeniedDialog(i,e){try{this.loggingService.log("%c[WB] Calling DevicePermissionService FUNCTION: openDevicePermissionDeniedDialog","color: green;"),this.matDialog.open(z,{panelClass:["velt-device-permission-denied-dialog--panel","velt-mat-dialog-container"],backdropClass:["velt-device-permission-denied-dialog--backdrop","s-background-blur-1"],data:I({type:i},e||{})})}catch(s){this.loggingService.catch("Error in DevicePermissionService openDevicePermissionDeniedDialog: ",s)}}};r.\u0275fac=function(e){return new(e||r)(D(f),D(L))},r.\u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"});let t=r;return t})();export{me as a};
@@ -1,4 +1,4 @@
1
- import{$c as ne,Ad as qe,Fd as $e,Ha as ke,_c as ye,ad as Ee,ba as Re,bd as Ue,cd as Ae,dd as Oe,ea as Te,ed as C,fd as Se,g as K,gd as Ie,hd as Pe,id as Ne,jd as Ce,kd as xe,la as we,ld as H,qd as ve,rd as De,sd as Le,ta as $,td as Be,ud as x,vd as Me,wd as Fe}from"./chunk-KWXZADQY.js";var Ke="firebasestorage.googleapis.com",Ze="storageBucket",Tt=120*1e3,wt=600*1e3,kt=1e3;var d=class t extends Oe{constructor(e,n,s=0){super(se(e),`Firebase Storage: ${n} (${se(e)})`),this.status_=s,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,t.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return se(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
1
+ import{$c as ne,Ad as qe,Fd as $e,Ha as ke,_c as ye,ad as Ee,ba as Re,bd as Ue,cd as Ae,dd as Oe,ea as Te,ed as C,fd as Se,g as K,gd as Ie,hd as Pe,id as Ne,jd as Ce,kd as xe,la as we,ld as H,qd as ve,rd as De,sd as Le,ta as $,td as Be,ud as x,vd as Me,wd as Fe}from"./chunk-CRZGZZVQ.js";var Ke="firebasestorage.googleapis.com",Ze="storageBucket",Tt=120*1e3,wt=600*1e3,kt=1e3;var d=class t extends Oe{constructor(e,n,s=0){super(se(e),`Firebase Storage: ${n} (${se(e)})`),this.status_=s,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,t.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return se(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
2
2
  ${this.customData.serverResponse}`:this.message=this._baseMessage}},h=(function(t){return t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment",t})(h||{});function se(t){return"storage/"+t}function de(){let t="An unknown error occurred, please check the error payload for server response.";return new d(h.UNKNOWN,t)}function yt(t){return new d(h.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function Et(t){return new d(h.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function Ut(){let t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new d(h.UNAUTHENTICATED,t)}function At(){return new d(h.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function Ot(t){return new d(h.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function Ye(){return new d(h.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function Je(){return new d(h.CANCELED,"User canceled the upload/download.")}function St(t){return new d(h.INVALID_URL,"Invalid URL '"+t+"'.")}function It(t){return new d(h.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function Pt(){return new d(h.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+Ze+"' property when initializing the app?")}function Qe(){return new d(h.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function Nt(){return new d(h.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function Ct(){return new d(h.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function xt(t){return new d(h.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function oe(t){return new d(h.INVALID_ARGUMENT,t)}function et(){return new d(h.APP_DELETED,"The Firebase app was deleted.")}function vt(t){return new d(h.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function z(t,e){return new d(h.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function j(t){throw new d(h.INTERNAL_ERROR,"Internal error: "+t)}var y=class t{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){let e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let s;try{s=t.makeFromUrl(e,n)}catch{return new t(e,"")}if(s.path==="")return s;throw It(e)}static makeFromUrl(e,n){let s=null,r="([A-Za-z0-9.\\-_]+)";function o(b){b.path.charAt(b.path.length-1)==="/"&&(b.path_=b.path_.slice(0,-1))}let i="(/(.*))?$",u=new RegExp("^gs://"+r+i,"i"),a={bucket:1,path:3};function c(b){b.path_=decodeURIComponent(b.path)}let l="v[A-Za-z0-9_]+",f=n.replace(/[.]/g,"\\."),p="(/([^?#]*).*)?$",m=new RegExp(`^https?://${f}/${l}/b/${r}/o${p}`,"i"),g={bucket:1,path:3},w=n===Ke?"(?:storage.googleapis.com|storage.cloud.google.com)":n,_="([^?#]*)",U=new RegExp(`^https?://${w}/${r}/${_}`,"i"),T=[{regex:u,indices:a,postModify:o},{regex:m,indices:g,postModify:c},{regex:U,indices:{bucket:1,path:2},postModify:c}];for(let b=0;b<T.length;b++){let P=T[b],N=P.regex.exec(e);if(N){let ee=N[P.indices.bucket],q=N[P.indices.path];q||(q=""),s=new t(ee,q),P.postModify(s);break}}if(s==null)throw St(e);return s}},ie=class{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}};function Dt(t,e,n){let s=1,r=null,o=null,i=!1,u=0;function a(){return u===2}let c=!1;function l(..._){c||(c=!0,e.apply(null,_))}function f(_){r=setTimeout(()=>{r=null,t(m,a())},_)}function p(){o&&clearTimeout(o)}function m(_,...U){if(c){p();return}if(_){p(),l.call(null,_,...U);return}if(a()||i){p(),l.call(null,_,...U);return}s<64&&(s*=2);let T;u===1?(u=2,T=0):T=(s+Math.random())*1e3,f(T)}let g=!1;function w(_){g||(g=!0,p(),!c&&(r!==null?(_||(u=2),clearTimeout(r),f(0)):_||(u=1)))}return f(0),o=setTimeout(()=>{i=!0,w(!0)},n),w}function Lt(t){t(!1)}function Bt(t){return t!==void 0}function Mt(t){return typeof t=="function"}function Ft(t){return typeof t=="object"&&!Array.isArray(t)}function Q(t){return typeof t=="string"||t instanceof String}function He(t){return fe()&&t instanceof Blob}function fe(){return typeof Blob<"u"}function je(t,e,n,s){if(s<e)throw oe(`Invalid value for '${t}'. Expected ${e} or greater.`);if(s>n)throw oe(`Invalid value for '${t}'. Expected ${n} or less.`)}function F(t,e,n){let s=e;return n==null&&(s=`https://${e}`),`${n}://${s}/v0${t}`}function tt(t){let e=encodeURIComponent,n="?";for(let s in t)if(t.hasOwnProperty(s)){let r=e(s)+"="+e(t[s]);n=n+r+"&"}return n=n.slice(0,-1),n}var L=(function(t){return t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT",t})(L||{});function nt(t,e){let n=t>=500&&t<600,r=[408,429].indexOf(t)!==-1,o=e.indexOf(t)!==-1;return n||r||o}var ae=class{constructor(e,n,s,r,o,i,u,a,c,l,f,p=!0,m=!1){this.url_=e,this.method_=n,this.headers_=s,this.body_=r,this.successCodes_=o,this.additionalRetryCodes_=i,this.callback_=u,this.errorCallback_=a,this.timeout_=c,this.progressCallback_=l,this.connectionFactory_=f,this.retry=p,this.isUsingEmulator=m,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((g,w)=>{this.resolve_=g,this.reject_=w,this.start_()})}start_(){let e=(s,r)=>{if(r){s(!1,new D(!1,null,!0));return}let o=this.connectionFactory_();this.pendingConnection_=o;let i=u=>{let a=u.loaded,c=u.lengthComputable?u.total:-1;this.progressCallback_!==null&&this.progressCallback_(a,c)};this.progressCallback_!==null&&o.addUploadProgressListener(i),o.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&o.removeUploadProgressListener(i),this.pendingConnection_=null;let u=o.getErrorCode()===L.NO_ERROR,a=o.getStatus();if(!u||nt(a,this.additionalRetryCodes_)&&this.retry){let l=o.getErrorCode()===L.ABORT;s(!1,new D(!1,null,l));return}let c=this.successCodes_.indexOf(a)!==-1;s(!0,new D(c,o))})},n=(s,r)=>{let o=this.resolve_,i=this.reject_,u=r.connection;if(r.wasSuccessCode)try{let a=this.callback_(u,u.getResponse());Bt(a)?o(a):o()}catch(a){i(a)}else if(u!==null){let a=de();a.serverResponse=u.getErrorText(),this.errorCallback_?i(this.errorCallback_(u,a)):i(a)}else if(r.canceled){let a=this.appDelete_?et():Je();i(a)}else{let a=Ye();i(a)}};this.canceled_?n(!1,new D(!1,null,!0)):this.backoffId_=Dt(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&Lt(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}},D=class{constructor(e,n,s){this.wasSuccessCode=e,this.connection=n,this.canceled=!!s}};function qt(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function $t(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function Ht(t,e){e&&(t["X-Firebase-GMPID"]=e)}function jt(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function zt(t,e,n,s,r,o,i=!0,u=!1){let a=tt(t.urlParams),c=t.url+a,l=Object.assign({},t.headers);return Ht(l,e),qt(l,n),$t(l,o),jt(l,s),new ae(c,t.method,l,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r,i,u)}function Gt(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function Wt(...t){let e=Gt();if(e!==void 0){let n=new e;for(let s=0;s<t.length;s++)n.append(t[s]);return n.getBlob()}else{if(fe())return new Blob(t);throw new d(h.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function Vt(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}function Xt(t){if(typeof atob>"u")throw xt("base-64");return atob(t)}var E={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},G=class{constructor(e,n){this.data=e,this.contentType=n||null}};function Kt(t,e){switch(t){case E.RAW:return new G(st(e));case E.BASE64:case E.BASE64URL:return new G(rt(t,e));case E.DATA_URL:return new G(Yt(e),Jt(e))}throw de()}function st(t){let e=[];for(let n=0;n<t.length;n++){let s=t.charCodeAt(n);if(s<=127)e.push(s);else if(s<=2047)e.push(192|s>>6,128|s&63);else if((s&64512)===55296)if(!(n<t.length-1&&(t.charCodeAt(n+1)&64512)===56320))e.push(239,191,189);else{let o=s,i=t.charCodeAt(++n);s=65536|(o&1023)<<10|i&1023,e.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63)}else(s&64512)===56320?e.push(239,191,189):e.push(224|s>>12,128|s>>6&63,128|s&63)}return new Uint8Array(e)}function Zt(t){let e;try{e=decodeURIComponent(t)}catch{throw z(E.DATA_URL,"Malformed data URL.")}return st(e)}function rt(t,e){switch(t){case E.BASE64:{let r=e.indexOf("-")!==-1,o=e.indexOf("_")!==-1;if(r||o)throw z(t,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break}case E.BASE64URL:{let r=e.indexOf("+")!==-1,o=e.indexOf("/")!==-1;if(r||o)throw z(t,"Invalid character '"+(r?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=Xt(e)}catch(r){throw r.message.includes("polyfill")?r:z(t,"Invalid character found")}let s=new Uint8Array(n.length);for(let r=0;r<n.length;r++)s[r]=n.charCodeAt(r);return s}var Y=class{constructor(e){this.base64=!1,this.contentType=null;let n=e.match(/^data:([^,]+)?,/);if(n===null)throw z(E.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");let s=n[1]||null;s!=null&&(this.base64=Qt(s,";base64"),this.contentType=this.base64?s.substring(0,s.length-7):s),this.rest=e.substring(e.indexOf(",")+1)}};function Yt(t){let e=new Y(t);return e.base64?rt(E.BASE64,e.rest):Zt(e.rest)}function Jt(t){return new Y(t).contentType}function Qt(t,e){return t.length>=e.length?t.substring(t.length-e.length)===e:!1}var J=class t{constructor(e,n){let s=0,r="";He(e)?(this.data_=e,s=e.size,r=e.type):e instanceof ArrayBuffer?(n?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),s=this.data_.length):e instanceof Uint8Array&&(n?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),s=e.length),this.size_=s,this.type_=r}size(){return this.size_}type(){return this.type_}slice(e,n){if(He(this.data_)){let s=this.data_,r=Vt(s,e,n);return r===null?null:new t(r)}else{let s=new Uint8Array(this.data_.buffer,e,n-e);return new t(s,!0)}}static getBlob(...e){if(fe()){let n=e.map(s=>s instanceof t?s.data_:s);return new t(Wt.apply(null,n))}else{let n=e.map(i=>Q(i)?Kt(E.RAW,i).data:i.data_),s=0;n.forEach(i=>{s+=i.byteLength});let r=new Uint8Array(s),o=0;return n.forEach(i=>{for(let u=0;u<i.length;u++)r[o++]=i[u]}),new t(r,!0)}}uploadData(){return this.data_}};function ot(t){let e;try{e=JSON.parse(t)}catch{return null}return Ft(e)?e:null}function en(t){if(t.length===0)return null;let e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function tn(t,e){let n=e.split("/").filter(s=>s.length>0).join("/");return t.length===0?n:t+"/"+n}function it(t){let e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}function nn(t,e){return e}var R=class{constructor(e,n,s,r){this.server=e,this.local=n||e,this.writable=!!s,this.xform=r||nn}},Z=null;function sn(t){return!Q(t)||t.length<2?t:it(t)}function at(){if(Z)return Z;let t=[];t.push(new R("bucket")),t.push(new R("generation")),t.push(new R("metageneration")),t.push(new R("name","fullPath",!0));function e(o,i){return sn(i)}let n=new R("name");n.xform=e,t.push(n);function s(o,i){return i!==void 0?Number(i):i}let r=new R("size");return r.xform=s,t.push(r),t.push(new R("timeCreated")),t.push(new R("updated")),t.push(new R("md5Hash",null,!0)),t.push(new R("cacheControl",null,!0)),t.push(new R("contentDisposition",null,!0)),t.push(new R("contentEncoding",null,!0)),t.push(new R("contentLanguage",null,!0)),t.push(new R("contentType",null,!0)),t.push(new R("metadata","customMetadata",!0)),Z=t,Z}function rn(t,e){function n(){let s=t.bucket,r=t.fullPath,o=new y(s,r);return e._makeStorageReference(o)}Object.defineProperty(t,"ref",{get:n})}function on(t,e,n){let s={};s.type="file";let r=n.length;for(let o=0;o<r;o++){let i=n[o];s[i.local]=i.xform(s,e[i.server])}return rn(s,t),s}function ut(t,e,n){let s=ot(e);return s===null?null:on(t,s,n)}function an(t,e,n,s){let r=ot(e);if(r===null||!Q(r.downloadTokens))return null;let o=r.downloadTokens;if(o.length===0)return null;let i=encodeURIComponent;return o.split(",").map(c=>{let l=t.bucket,f=t.fullPath,p="/b/"+i(l)+"/o/"+i(f),m=F(p,n,s),g=tt({alt:"media",token:c});return m+g})[0]}function ct(t,e){let n={},s=e.length;for(let r=0;r<s;r++){let o=e[r];o.writable&&(n[o.server]=t[o.local])}return JSON.stringify(n)}var S=class{constructor(e,n,s,r){this.url=e,this.method=n,this.handler=s,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}};function O(t){if(!t)throw de()}function _e(t,e){function n(s,r){let o=ut(t,r,e);return O(o!==null),o}return n}function un(t,e){function n(s,r){let o=ut(t,r,e);return O(o!==null),an(o,r,t.host,t._protocol)}return n}function V(t){function e(n,s){let r;return n.getStatus()===401?n.getErrorText().includes("Firebase App Check token is invalid")?r=At():r=Ut():n.getStatus()===402?r=Et(t.bucket):n.getStatus()===403?r=Ot(t.path):r=s,r.status=n.getStatus(),r.serverResponse=s.serverResponse,r}return e}function pe(t){let e=V(t);function n(s,r){let o=e(s,r);return s.getStatus()===404&&(o=yt(t.path)),o.serverResponse=r.serverResponse,o}return n}function cn(t,e,n){let s=e.fullServerUrl(),r=F(s,t.host,t._protocol),o="GET",i=t.maxOperationRetryTime,u=new S(r,o,_e(t,n),i);return u.errorHandler=pe(e),u}function ln(t,e,n){let s=e.fullServerUrl(),r=F(s,t.host,t._protocol),o="GET",i=t.maxOperationRetryTime,u=new S(r,o,un(t,n),i);return u.errorHandler=pe(e),u}function hn(t,e){let n=e.fullServerUrl(),s=F(n,t.host,t._protocol),r="DELETE",o=t.maxOperationRetryTime;function i(a,c){}let u=new S(s,r,i,o);return u.successCodes=[200,204],u.errorHandler=pe(e),u}function dn(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function lt(t,e,n){let s=Object.assign({},n);return s.fullPath=t.path,s.size=e.size(),s.contentType||(s.contentType=dn(null,e)),s}function fn(t,e,n,s,r){let o=e.bucketOnlyServerUrl(),i={"X-Goog-Upload-Protocol":"multipart"};function u(){let T="";for(let b=0;b<2;b++)T=T+Math.random().toString().slice(2);return T}let a=u();i["Content-Type"]="multipart/related; boundary="+a;let c=lt(e,s,r),l=ct(c,n),f="--"+a+`\r
3
3
  Content-Type: application/json; charset=utf-8\r
4
4
  \r
@@ -1,2 +1,2 @@
1
- import{Ab as a,Bb as h,Pa as o,Ua as c,db as m,ki as g,si as l,wa as s}from"./chunk-KWXZADQY.js";var d=["*"],C=(()=>{let i=class i{constructor(t,e,n){this.elementRef=t,this.domService=e,this.loggingService=n,this.veltElement=!0}ngAfterViewInit(){try{this.customCssSubscription=this.domService.subscribeInjectCustomCss(this.elementRef)}catch(t){this.loggingService.catch("Error in ShadowDomComponent ngAfterViewInit: ",t)}}ngOnDestroy(){try{this.customCssSubscription?.unsubscribe()}catch(t){this.loggingService.catch("Error in ShadowDomComponent ngOnDestroy: ",t)}}};i.\u0275fac=function(e){return new(e||i)(o(s),o(l),o(g))},i.\u0275cmp=c({type:i,selectors:[["velt-shadow-dom-internal"]],hostVars:1,hostBindings:function(e,n){e&2&&m("data-velt-element",n.veltElement)},ngContentSelectors:d,decls:1,vars:0,template:function(e,n){e&1&&(a(),h(0))},styles:[`:host{width:100%}
1
+ import{Ab as a,Bb as h,Pa as o,Ua as c,db as m,ki as g,si as l,wa as s}from"./chunk-CRZGZZVQ.js";var d=["*"],C=(()=>{let i=class i{constructor(t,e,n){this.elementRef=t,this.domService=e,this.loggingService=n,this.veltElement=!0}ngAfterViewInit(){try{this.customCssSubscription=this.domService.subscribeInjectCustomCss(this.elementRef)}catch(t){this.loggingService.catch("Error in ShadowDomComponent ngAfterViewInit: ",t)}}ngOnDestroy(){try{this.customCssSubscription?.unsubscribe()}catch(t){this.loggingService.catch("Error in ShadowDomComponent ngOnDestroy: ",t)}}};i.\u0275fac=function(e){return new(e||i)(o(s),o(l),o(g))},i.\u0275cmp=c({type:i,selectors:[["velt-shadow-dom-internal"]],hostVars:1,hostBindings:function(e,n){e&2&&m("data-velt-element",n.veltElement)},ngContentSelectors:d,decls:1,vars:0,template:function(e,n){e&1&&(a(),h(0))},styles:[`:host{width:100%}
2
2
  `],encapsulation:3,changeDetection:0});let r=i;return r})();export{C as a};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/sdk-dev",
3
- "version": "6.0.7",
3
+ "version": "6.0.8-beta.1",
4
4
  "description": "Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.",
5
5
  "homepage": "https://velt.dev",
6
6
  "keywords": [