@veltdev/sdk-dev 4.5.6-beta.30 → 4.5.6-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/velt.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltdev/sdk-dev",
|
|
3
|
-
"version": "4.5.6-beta.
|
|
3
|
+
"version": "4.5.6-beta.31",
|
|
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": [
|
package/velt.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var SNIPPYLY_VERSION = '4.5.6-beta.
|
|
1
|
+
var SNIPPYLY_VERSION = '4.5.6-beta.31';
|
|
2
2
|
(function(m,w){"use strict";function rt(){var e=K.splice(0,K.length);for(ie=0;e.length;)e.shift().call(null,e.shift())}function me(e,t){for(var n=0,r=e.length;n<r;n++)Te(e[n],t)}function ot(e){for(var t,n=0,r=e.length;n<r;n++)t=e[n],U(t,q[pe(t)])}function fe(e){return function(t){Lt(t)&&(Te(t,e),L.length&&me(t.querySelectorAll(L),e))}}function pe(e){var t=le.call(e,"is"),n=e.nodeName.toUpperCase(),r=v.call(D,t?Y+t.toUpperCase():x+n);return t&&-1<r&&!De(n,t)?-1:r}function De(e,t){return-1<L.indexOf(e+'[is="'+t+'"]')}function Ie(e){var t=e.currentTarget,n=e.attrChange,r=e.attrName,o=e.target,l=e[W]||2,a=e[He]||3;!ce||o&&o!==t||!t[y]||r==="style"||e.prevValue===e.newValue&&(e.newValue!==""||n!==l&&n!==a)||t[y](r,n===l?null:e.prevValue,n===a?null:e.newValue)}function Fe(e){var t=fe(e);return function(n){K.push(t,n.target),ie&&clearTimeout(ie),ie=setTimeout(rt,1)}}function de(e){nt&&(nt=!1,e.currentTarget.removeEventListener(Ze,de)),L.length&&me((e.target||u).querySelectorAll(L),e.detail===E?E:b),R&&at()}function lt(e,t){var n=this;Ye.call(n,e,t),Me.call(n,{target:n})}function Se(e,t,n){var r=t.apply(e,n),o=pe(r);return-1<o&&U(r,q[o]),n.pop()&&L.length&&ot(r.querySelectorAll(L)),r}function he(e,t){Tt(e,t),$?$.observe(e,gt):(ue&&(e.setAttribute=lt,e[H]=Ee(e),e[g](st,Me)),e[g](N,Ie)),e[k]&&ce&&(e.created=!0,e[k](),e.created=!1)}function at(){for(var e,t=0,n=G.length;t<n;t++)e=G[t],V.contains(e)||(n--,G.splice(t--,1),Te(e,E))}function Ve(e){throw new Error("A "+e+" type is already registered")}function Te(e,t){var n,r,o=pe(e);-1<o&&!Mt.call(e,"TEMPLATE")&&(Q(e,q[o]),o=0,t!==b||e[b]?t!==E||e[E]||(e[b]=!1,e[E]=!0,r="disconnected",o=1):(e[E]=!1,e[b]=!0,r="connected",o=1,R&&v.call(G,e)<0&&G.push(e)),o&&(n=e[t+O]||e[r+O])&&n.call(e))}function z(){}function Pe(e,t,n){var r=n&&n[_]||"",o=t.prototype,l=Ce(o),a=t.observedAttributes||ye,s={prototype:l};oe(l,k,{value:function(){if(te)te=!1;else if(!this[B]){this[B]=!0,new t(this),o[k]&&o[k].call(this);var i=j[ne.get(t)];(!Z||i.create.length>1)&&_e(this)}}}),oe(l,y,{value:function(i){-1<v.call(a,i)&&o[y]&&o[y].apply(this,arguments)}}),o[qe]&&oe(l,ut,{value:o[qe]}),o[Be]&&oe(l,ct,{value:o[Be]}),r&&(s[_]=r),e=e.toUpperCase(),j[e]={constructor:t,create:r?[r,re(e)]:[e]},ne.set(t,e),u[S](e.toLowerCase(),s),Le(e),P[e].r()}function Re(e){var t=j[e.toUpperCase()];return t&&t.constructor}function Ue(e){return typeof e=="string"?e:e&&e.is||""}function _e(e){for(var t,n=e[y],r=n?e.attributes:ye,o=r.length;o--;)t=r[o],n.call(e,t.name||t.nodeName,null,t.value||t.nodeValue)}function Le(e){return e=e.toUpperCase(),e in P||(P[e]={},P[e].p=new Xe(function(t){P[e].r=t})),P[e].p}function ke(){C&&delete m.customElements,I(m,"customElements",{configurable:!0,value:new z}),I(m,"CustomElementRegistry",{configurable:!0,value:z});for(var e=it.get(/^HTML[A-Z]*[a-z]/),t=e.length;t--;function(n){var r=m[n];if(r){m[n]=function(o){var l,a;return o||(o=this),o[B]||(te=!0,l=j[ne.get(o.constructor)],a=Z&&l.create.length===1,o=a?Reflect.construct(r,ye,l.constructor):u.createElement.apply(u,l.create),o[B]=!0,te=!1,a||_e(o)),o},m[n].prototype=r.prototype;try{r.prototype.constructor=m[n]}catch{dt=!0,I(r,B,{value:m[n]})}}}(e[t]));u.createElement=function(n,r){var o=Ue(r);return o?Ae.call(this,n,re(o)):Ae.call(this,n)},et||(Oe=!0,u[S](""))}var u=m.document,T=m.Object,it=function(e){var t,n,r,o,l=/^[A-Z]+[a-z]/,a=function(p){var f,h=[];for(f in i)p.test(f)&&h.push(f);return h},s=function(p,f){(f=f.toLowerCase())in i||(i[p]=(i[p]||[]).concat(f),i[f]=i[f.toUpperCase()]=p)},i=(T.create||T)(null),c={};for(n in e)for(o in e[n])for(r=e[n][o],i[o]=r,t=0;t<r.length;t++)i[r[t].toLowerCase()]=i[r[t].toUpperCase()]=o;return c.get=function(p){return typeof p=="string"?i[p]||(l.test(p)?[]:""):a(p)},c.set=function(p,f){return l.test(p)?s(p,f):s(f,p),c},c}({collections:{HTMLAllCollection:["all"],HTMLCollection:["forms"],HTMLFormControlsCollection:["elements"],HTMLOptionsCollection:["options"]},elements:{Element:["element"],HTMLAnchorElement:["a"],HTMLAppletElement:["applet"],HTMLAreaElement:["area"],HTMLAttachmentElement:["attachment"],HTMLAudioElement:["audio"],HTMLBRElement:["br"],HTMLBaseElement:["base"],HTMLBodyElement:["body"],HTMLButtonElement:["button"],HTMLCanvasElement:["canvas"],HTMLContentElement:["content"],HTMLDListElement:["dl"],HTMLDataElement:["data"],HTMLDataListElement:["datalist"],HTMLDetailsElement:["details"],HTMLDialogElement:["dialog"],HTMLDirectoryElement:["dir"],HTMLDivElement:["div"],HTMLDocument:["document"],HTMLElement:["element","abbr","address","article","aside","b","bdi","bdo","cite","code","command","dd","dfn","dt","em","figcaption","figure","footer","header","i","kbd","mark","nav","noscript","rp","rt","ruby","s","samp","section","small","strong","sub","summary","sup","u","var","wbr"],HTMLEmbedElement:["embed"],HTMLFieldSetElement:["fieldset"],HTMLFontElement:["font"],HTMLFormElement:["form"],HTMLFrameElement:["frame"],HTMLFrameSetElement:["frameset"],HTMLHRElement:["hr"],HTMLHeadElement:["head"],HTMLHeadingElement:["h1","h2","h3","h4","h5","h6"],HTMLHtmlElement:["html"],HTMLIFrameElement:["iframe"],HTMLImageElement:["img"],HTMLInputElement:["input"],HTMLKeygenElement:["keygen"],HTMLLIElement:["li"],HTMLLabelElement:["label"],HTMLLegendElement:["legend"],HTMLLinkElement:["link"],HTMLMapElement:["map"],HTMLMarqueeElement:["marquee"],HTMLMediaElement:["media"],HTMLMenuElement:["menu"],HTMLMenuItemElement:["menuitem"],HTMLMetaElement:["meta"],HTMLMeterElement:["meter"],HTMLModElement:["del","ins"],HTMLOListElement:["ol"],HTMLObjectElement:["object"],HTMLOptGroupElement:["optgroup"],HTMLOptionElement:["option"],HTMLOutputElement:["output"],HTMLParagraphElement:["p"],HTMLParamElement:["param"],HTMLPictureElement:["picture"],HTMLPreElement:["pre"],HTMLProgressElement:["progress"],HTMLQuoteElement:["blockquote","q","quote"],HTMLScriptElement:["script"],HTMLSelectElement:["select"],HTMLShadowElement:["shadow"],HTMLSlotElement:["slot"],HTMLSourceElement:["source"],HTMLSpanElement:["span"],HTMLStyleElement:["style"],HTMLTableCaptionElement:["caption"],HTMLTableCellElement:["td","th"],HTMLTableColElement:["col","colgroup"],HTMLTableElement:["table"],HTMLTableRowElement:["tr"],HTMLTableSectionElement:["thead","tbody","tfoot"],HTMLTemplateElement:["template"],HTMLTextAreaElement:["textarea"],HTMLTimeElement:["time"],HTMLTitleElement:["title"],HTMLTrackElement:["track"],HTMLUListElement:["ul"],HTMLUnknownElement:["unknown","vhgroupv","vkeygen"],HTMLVideoElement:["video"]},nodes:{Attr:["node"],Audio:["audio"],CDATASection:["node"],CharacterData:["node"],Comment:["#comment"],Document:["#document"],DocumentFragment:["#document-fragment"],DocumentType:["node"],HTMLDocument:["#document"],Image:["img"],Option:["option"],ProcessingInstruction:["node"],ShadowRoot:["#shadow-root"],Text:["#text"],XMLDocument:["xml"]}});typeof w!="object"&&(w={type:w||"auto"});var K,Me,X,Ee,$,ve,Q,U,A,S="registerElement",xe=1e5*m.Math.random()>>0,H="__"+S+xe,g="addEventListener",b="attached",O="Callback",E="detached",_="extends",y="attributeChanged"+O,ut=b+O,qe="connected"+O,Be="disconnected"+O,k="created"+O,ct=E+O,W="ADDITION",He="REMOVAL",N="DOMAttrModified",Ze="DOMContentLoaded",st="DOMSubtreeModified",x="<",Y="=",mt=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,ft=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],D=[],q=[],L="",V=u.documentElement,v=D.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},ge=T.prototype,be=ge.hasOwnProperty,J=ge.isPrototypeOf,I=T.defineProperty,ye=[],ee=T.getOwnPropertyDescriptor,je=T.getOwnPropertyNames,pt=T.getPrototypeOf,Ge=T.setPrototypeOf,ze=!!T.__proto__,dt=!1,B="__dreCEv1",C=m.customElements,Z=!/^force/.test(w.type)&&!!(C&&C.define&&C.get&&C.whenDefined),Ke=T.create||T,ht=m.Map||function(){var e,t=[],n=[];return{get:function(r){return n[v.call(t,r)]},set:function(r,o){e=v.call(t,r),e<0?n[t.push(r)-1]=o:n[e]=o}}},Xe=m.Promise||function(e){function t(l){for(r=!0;n.length;)n.shift()(l)}var n=[],r=!1,o={catch:function(){return o},then:function(l){return n.push(l),r&&setTimeout(t,1),o}};return e(t),o},te=!1,j=Ke(null),P=Ke(null),ne=new ht,re=function(e){return e.toLowerCase()},Ce=T.create||function e(t){return t?(e.prototype=t,new e):this},Tt=Ge||(ze?function(e,t){return e.__proto__=t,e}:je&&ee?function(){function e(t,n){for(var r,o=je(n),l=0,a=o.length;l<a;l++)r=o[l],be.call(t,r)||I(t,r,ee(n,r))}return function(t,n){do e(t,n);while((n=pt(n))&&!J.call(n,t));return t}}():function(e,t){for(var n in t)e[n]=t[n];return e}),F=m.MutationObserver||m.WebKitMutationObserver,$e=m.HTMLAnchorElement,d=(m.HTMLElement||m.Element||m.Node).prototype,R=!J.call(d,V),oe=R?function(e,t,n){return e[t]=n.value,e}:I,Lt=R?function(e){return e.nodeType===1}:function(e){return J.call(d,e)},G=R&&[],Qe=d.attachShadow,We=d.cloneNode,Mt=d.closest||function(e){for(var t=this;t&&t.nodeName!==e;)t=t.parentNode;return t},we=d.dispatchEvent,le=d.getAttribute,Et=d.hasAttribute,vt=d.removeAttribute,Ye=d.setAttribute,ae=u.createElement,Ht=u.importNode,Ae=ae,gt=F&&{attributes:!0,characterData:!0,attributeOldValue:!0},Je=F||function(e){ue=!1,V.removeEventListener(N,Je)},ie=0,et=S in u&&!/^force-all/.test(w.type),tt=!0,Oe=!1,ue=!0,nt=!0,ce=!0;if(F&&(A=u.createElement("div"),A.innerHTML="<div><div></div></div>",new F(function(e,t){if(e[0]&&e[0].type=="childList"&&!e[0].removedNodes[0].childNodes.length){A=ee(d,"innerHTML");var n=A&&A.set;n&&I(d,"innerHTML",{set:function(r){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,r)}})}t.disconnect(),A=null}).observe(A,{childList:!0,subtree:!0}),A.innerHTML=""),et||(Ge||ze?(Q=function(e,t){J.call(t,e)||he(e,t)},U=he):(Q=function(e,t){e[H]||(e[H]=T(!0),he(e,t))},U=Q),R?(ue=!1,function(){var e=ee(d,g),t=e.value,n=function(l){var a=new CustomEvent(N,{bubbles:!0});a.attrName=l,a.prevValue=le.call(this,l),a.newValue=null,a[He]=a.attrChange=2,vt.call(this,l),we.call(this,a)},r=function(l,a){var s=Et.call(this,l),i=s&&le.call(this,l),c=new CustomEvent(N,{bubbles:!0});Ye.call(this,l,a),c.attrName=l,c.prevValue=s?i:null,c.newValue=a,s?c.MODIFICATION=c.attrChange=1:c[W]=c.attrChange=0,we.call(this,c)},o=function(l){var a,s=l.currentTarget,i=s[H],c=l.propertyName;i.hasOwnProperty(c)&&(i=i[c],a=new CustomEvent(N,{bubbles:!0}),a.attrName=i.name,a.prevValue=i.value||null,a.newValue=i.value=s[c]||null,a.prevValue==null?a[W]=a.attrChange=0:a.MODIFICATION=a.attrChange=1,we.call(s,a))};e.value=function(l,a,s){l===N&&this[y]&&this.setAttribute!==r&&(this[H]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",o)),t.call(this,l,a,s)},I(d,g,e)}()):F||(V[g](N,Je),V.setAttribute(H,1),V.removeAttribute(H),ue&&(Me=function(e){var t,n,r,o=this;if(o===e.target){t=o[H],o[H]=n=Ee(o);for(r in n){if(!(r in t))return X(0,o,r,t[r],n[r],W);if(n[r]!==t[r])return X(1,o,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return X(2,o,r,t[r],n[r],He)}},X=function(e,t,n,r,o,l){var a={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:o};a[l]=e,Ie(a)},Ee=function(e){for(var t,n,r={},o=e.attributes,l=0,a=o.length;l<a;l++)t=o[l],(n=t.name)!=="setAttribute"&&(r[n]=t.value);return r})),u[S]=function(e,t){if(n=e.toUpperCase(),tt&&(tt=!1,F?($=function(i,c){function p(f,h){for(var M=0,se=f.length;M<se;h(f[M++]));}return new F(function(f){for(var h,M,se,Ne=0,bt=f.length;Ne<bt;Ne++)h=f[Ne],h.type==="childList"?(p(h.addedNodes,i),p(h.removedNodes,c)):(M=h.target,ce&&M[y]&&h.attributeName!=="style"&&(se=le.call(M,h.attributeName))!==h.oldValue&&M[y](h.attributeName,h.oldValue,se))})}(fe(b),fe(E)),ve=function(i){return $.observe(i,{childList:!0,subtree:!0}),i},ve(u),Qe&&(d.attachShadow=function(){return ve(Qe.apply(this,arguments))})):(K=[],u[g]("DOMNodeInserted",Fe(b)),u[g]("DOMNodeRemoved",Fe(E))),u[g](Ze,de),u[g]("readystatechange",de),u.importNode=function(i,c){switch(i.nodeType){case 1:return Se(u,Ht,[i,!!c]);case 11:for(var p=u.createDocumentFragment(),f=i.childNodes,h=f.length,M=0;M<h;M++)p.appendChild(u.importNode(f[M],!!c));return p;default:return We.call(i,!!c)}},d.cloneNode=function(i){return Se(this,We,[!!i])}),Oe)return Oe=!1;if(-2<v.call(D,Y+n)+v.call(D,x+n)&&Ve(e),!mt.test(n)||-1<v.call(ft,n))throw new Error("The type "+e+" is invalid");var n,r,o=function(){return a?u.createElement(s,n):u.createElement(s)},l=t||ge,a=be.call(l,_),s=a?t[_].toUpperCase():n;return a&&-1<v.call(D,x+s)&&Ve(s),r=D.push((a?Y:x)+n)-1,L=L.concat(L.length?",":"",a?s+'[is="'+e.toLowerCase()+'"]':s),o.prototype=q[r]=be.call(l,"prototype")?l.prototype:Ce(d),L.length&&me(u.querySelectorAll(L),b),o},u.createElement=Ae=function(e,t){var n=Ue(t),r=n?ae.call(u,e,re(n)):ae.call(u,e),o=""+e,l=v.call(D,(n?Y:x)+(n||o).toUpperCase()),a=-1<l;return n&&(r.setAttribute("is",n=n.toLowerCase()),a&&(a=De(o.toUpperCase(),n))),ce=!u.createElement.innerHTMLHelper,a&&U(r,q[l]),r}),addEventListener("beforeunload",function(){delete u.createElement,delete u.importNode,delete u[S]},!1),z.prototype={constructor:z,define:Z?function(e,t,n){if(n)Pe(e,t,n);else{var r=e.toUpperCase();j[r]={constructor:t,create:[r]},ne.set(t,r),C.define(e,t)}}:Pe,get:Z?function(e){return C.get(e)||Re(e)}:Re,whenDefined:Z?function(e){return Xe.race([C.whenDefined(e),Le(e)])}:Le},!C||/^force/.test(w.type))ke();else if(!w.noBuiltIn)try{(function(e,t,n){var r=new RegExp(`^<a\\s+is=('|")`+n+"\\1></a>$");if(t[_]="a",e.prototype=Ce($e.prototype),e.prototype.constructor=e,m.customElements.define(n,e,t),!r.test(u.createElement("a",{is:n}).outerHTML)||!r.test(new e().outerHTML))throw t})(function e(){return Reflect.construct($e,[],e)},{},"document-register-element-a"+xe)}catch{ke()}if(!w.noBuiltIn)try{if(ae.call(u,"a","a").outerHTML.indexOf("is")<0)throw{}}catch{re=function(t){return{is:t.toLowerCase()}}}})(window);
|
|
3
3
|
|
|
4
4
|
var u1e=Object.create;var BO=Object.defineProperty,h1e=Object.defineProperties,f1e=Object.getOwnPropertyDescriptor,v1e=Object.getOwnPropertyDescriptors,C1e=Object.getOwnPropertyNames,LO=Object.getOwnPropertySymbols,XW=Object.getPrototypeOf,iR=Object.prototype.hasOwnProperty,QW=Object.prototype.propertyIsEnumerable,_1e=Reflect.get;var ZW=(i,o,n)=>o in i?BO(i,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[o]=n,I=(i,o)=>{for(var n in o||={})iR.call(o,n)&&ZW(i,n,o[n]);if(LO)for(var n of LO(o))QW.call(o,n)&&ZW(i,n,o[n]);return i},D=(i,o)=>h1e(i,v1e(o));var K_=(i,o)=>{var n={};for(var e in i)iR.call(i,e)&&o.indexOf(e)<0&&(n[e]=i[e]);if(i!=null&&LO)for(var e of LO(i))o.indexOf(e)<0&&QW.call(i,e)&&(n[e]=i[e]);return n};var y1e=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),VO=(i,o)=>{for(var n in o)BO(i,n,{get:o[n],enumerable:!0})},S1e=(i,o,n,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of C1e(o))!iR.call(i,t)&&t!==n&&BO(i,t,{get:()=>o[t],enumerable:!(e=f1e(o,t))||e.enumerable});return i};var JW=(i,o,n)=>(n=i!=null?u1e(XW(i)):{},S1e(o||!i||!i.__esModule?BO(n,"default",{value:i,enumerable:!0}):n,i));var rp=(i,o,n)=>_1e(XW(i),n,o);var Q=(i,o,n)=>new Promise((e,t)=>{var r=c=>{try{s(n.next(c))}catch(p){t(p)}},a=c=>{try{s(n.throw(c))}catch(p){t(p)}},s=c=>c.done?e(c.value):Promise.resolve(c.value).then(r,a);s((n=n.apply(i,o)).next())});var hW=y1e((nSo,uW)=>{"use strict";var It={};It.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)};It.localCName=It.generateIdentifier();It.splitLines=function(i){return i.trim().split(`
|
|
@@ -379,7 +379,7 @@ This typically indicates that your device does not have a healthy Internet conne
|
|
|
379
379
|
</radialGradient>
|
|
380
380
|
</defs>
|
|
381
381
|
</svg>
|
|
382
|
-
`},o.GIF_PATHS={CAT_JAM:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/emojis%2Fcatjam.gif?alt=media&token=9868b4ec-0031-4751-bb2e-47bf0f9d9583"},o.\u0275fac=function(t){return new(t||o)(ee(Be),ee(y),ee(Ks))},o.\u0275prov=Ae({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var cr=(()=>{let o=class o{constructor(e,t,r,a,s,c,p,g,C,E,T){this.afAuth=e,this.analyticsService=t,this.authService=r,this.configService=a,this.databaseService=s,this.commonDbService=c,this.docService=p,this.domService=g,this.emojiService=C,this.iamService=E,this.loggingService=T,this.documentPaths=null,this.reactionAnnotationById$=new ve({}),this.customReactions$=new ve({}),this.darkMode$=new ve(null),this.loggingService.log("%c[WB] Creating CLASS: ReactionService","color: blue;"),this.analyticsService.setReactionService(this),this.authService.setReactionService(this),this.databaseService.getDb().pipe(Fe(N=>!!N),ot(1)).subscribe(N=>{N&&this.getAllReactionAnnotations(void 0,void 0,!0).subscribe()},N=>{this.loggingService.catch("Error in ReactionService getDb subscription: ",N)})}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in ReactionService","color: green;");try{this.reactionAnnotationById$.next({}),this.customReactions$.next({}),this.documentPaths=null}catch(e){this.loggingService.catch("Error in ReactionService clearCache: ",e)}}getAllReactionAnnotations(e,t,r,a,s){this.loggingService.log("%c[WB] Calling FUNCTION: getAllReactionAnnotations","color: green;");let c,p;try{if(e&&(p=`${An(e)}`),t&&typeof t=="object"){let g=Qo(t);c=An(JSON.stringify(g))}}catch(g){this.loggingService.catch("Error in ReactionService getAllReactionAnnotations: ",g)}return ei(this.afAuth).pipe(Fe(g=>!!g),he(g=>this.isFeatureAllowed({firebaseUser:g,annotations:[],filteredAnnotations:[]})),he(g=>g.featureAllowed?this.iamService.isUserAllowed$().pipe(de(C=>(g.featureAllowed=C,g))):se(g)),he(g=>g.featureAllowed?se(g).pipe(he(C=>this.docService.getDocumentPaths$().pipe(de(E=>(this.documentPaths=E,C.documentPaths=E,C)))),he(C=>p?this.getDataFromDocumentIds([p]).pipe(de(E=>(C.annotations=E||[],I({},C)))):this.docService.getDocumentIds$().pipe(he(E=>{let T=E?.length>0?E.map(N=>N.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds(T).pipe(de(N=>(C.annotations=N||[],I({},C))))}))),he(C=>this.docService.getLocation$().pipe(de(E=>(C.location=E,C)))),he(C=>this.docService.getLocations$().pipe(de(E=>(C.customLocations=E,C)))),de(C=>{if(C.filteredAnnotations=[],p&&!c)return C.filteredAnnotations=C.annotations?.slice(),C;{let E=[];return c?E.push(c):(E.push(C?.location?.locationId),E.push(...Object.values(C?.customLocations||[]).map(T=>T.locationId))),C.filteredAnnotations=this.filterAnnotationsByLocationIds(C?.annotations,E),C}}),he(C=>r?se(C):C?.annotations?.length?this.domService.onWindowResize$().pipe(de(()=>C)):se(C)),he(C=>r?se(C):se(C)),de(C=>C),he(C=>C?.filteredAnnotations?se(C?.filteredAnnotations||[]):se([]))):se([])),yt(pn))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(Fe(t=>!!t),de(t=>D(I({},e),{config:t})),he(t=>this.authService.getUser$().pipe(de(r=>D(I({},t),{user:r})))),he(t=>Zi(t.config,t.user,Ne.REACTION)?se(D(I({},t),{featureAllowed:!0})):(this.loggingService.warn("Reaction feature is not allowed."),se(D(I({},t),{featureAllowed:!1})))),yt((t,r)=>t?.featureAllowed===r?.featureAllowed))}getDataFromDocumentIds(e,t){return this.getDataFromDocuments({documentIds:e,filters:t})}getDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:t,filters:r}=e;if(t?.some(g=>!g)||!this.documentPaths)return se([]);let a=this.docService.getDocumentPaths()?.veltFolderId,s=se([]),c={useCollectionGroup:!0,isCollection:!0,useQuery:!0};this.commonDbService.shouldUseFirestore()||(c.documentId=t?.length?t[0]:void 0,c.organizationId=this.documentPaths?.organizationId);let p=[];for(let g=0;g<(t?.length??0);g+=j.LISTENER_BATCH_SIZE)p.push(t?.slice(g,g+j.LISTENER_BATCH_SIZE)??[]);return s=Tn(p.map(g=>this.commonDbService.dbListener({feature:"allReactions",properties:D(I({},c),{firestoreQuery:[Gi(Ot("metadata.apiKey","==",this.configService?.getApiKey()),Ot("metadata.documentId","in",g),Ot("metadata.organizationId","==",this.documentPaths?.organizationId),...a?[Ot("metadata.veltFolderId","==",a)]:[])]})}).pipe(Ka()))).pipe(de(g=>Ps(g))),s.pipe(de(g=>({data:g?.data,operation:g?.operation})),de(({data:g,operation:C})=>{let E=[];return g&&(E=Object.values(g??{}).filter(T=>typeof T=="object")),E?.forEach(T=>{this.sanitizeReactionAnnotation(T)}),{data:E,operation:C}}),de(({data:g,operation:C})=>{if(!t)return{data:g,documentMap:{},operation:C};let E=g.reduce((T,N)=>{let z=N.metadata?.documentId;return z&&(T[z]||(T[z]=[]),T[z].push(N)),T},{});return{data:g,documentMap:E,operation:C}}),de(({data:g,documentMap:C,operation:E})=>{if(!r)if(E?.type==="removed"){if(E?.ids?.length){let T=this.reactionAnnotationById$.value;E?.ids?.forEach(N=>{delete T?.[N]}),this.reactionAnnotationById$.next(T)}}else Object.entries(C??{}).forEach(([T,N])=>{this.setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:T,annotations:N})});return g}),Un(g=>(this.loggingService.catch("Error in ReactionService getDataFromDocumentId: ",g),se([]))))}else return se([])}setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:r,queryHash:a}){try{if(t){e||(e=j.NO_ORGANIZATION_ID),a||(a=j.DEFAULT_QUERY_HASH);let s={};r?.forEach(p=>{p?.annotationId&&(s[p?.annotationId]=p)});let c=I(I({},this.reactionAnnotationById$.value),s);this.reactionAnnotationById$.next(c)}}catch(s){this.loggingService.catch("Error in ReactionService setReactionAnnotationsByOrganizationIdAndDocumentId:",s)}}getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let r={};return Object.values(this.reactionAnnotationById$.value??{}).forEach(a=>{a?.metadata?.documentId==t&&a?.metadata?.organizationId==e&&(r[a?.annotationId]=a)}),Object.values(r)}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsByOrganizationIdAndDocumentId:",r),[]}}getLocations$(){return this.docService.getLocation$().pipe(he(e=>this.docService.getLocations$().pipe(de(t=>({location:e,locations:t})))),de(e=>{let t=[];return t.push(e?.location?.locationId),t.push(...Object.values(e.locations||[]).map(r=>r.locationId)),t||[]}))}filterAnnotationsByLocationIds(e,t){try{return e.filter(r=>t.includes(r.locationId))}catch(r){return this.loggingService.catch("Error in ReactionService filterAnnotationsByLocations:",r),[]}}getAnnotationById(e,t){try{let r=this.reactionAnnotationById$.value?.[e];if(r){let{documentId:a,organizationId:s}=t||{};if(a&&r.metadata?.documentId!==a||s&&r.metadata?.organizationId!==s)return}return r}catch(r){this.loggingService.catch("Error in ReactionService getAnnotationById: ",r);return}}getBaseMetadataFromReactionAnnotationId(e){try{let t=this.reactionAnnotationById$.value?.[e];return t?t.metadata:void 0}catch(t){this.loggingService.catch("Error in ReactionService getBaseMetadataFromReactionAnnotationId: ",t);return}}getReactionAnnotationByAnnotationId(e,t){try{return this.reactionAnnotationById$.pipe(de(()=>this.getAnnotationById(e,t)),he(r=>r?se(r):se(r)))}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationByAnnotationId: ",r),se(void 0)}}getReactionAnnotationsBySectionId(e){try{return this.reactionAnnotationById$.pipe(he(t=>this.docService.getDocumentPaths$().pipe(de(r=>({documentPaths:r,sectionId:e,reactionAnnotationsMap:t})))),he(t=>{let r=ra(e,["id","data-id"]);if(r){let a=this.docService.getAdditionLocationFromElement(r);if(a){let s=this.docService.genarateLocationId(a);return this.docService.getLocations$().pipe(de(c=>{let g=Object.values(c||{}).find(C=>C.locationId===s||a?.id&&C.location.id===a.id);return D(I({},t),{additionalLocation:g,locationOnElement:!!a})}))}}return se(D(I({},t),{additionalLocation:null,element:r}))}),he(t=>t?.locationOnElement?se(t):this.docService.getLocation$().pipe(de(r=>D(I({},t),{location:r})))),de(({documentPaths:t,location:r,additionalLocation:a,locationOnElement:s,element:c})=>{let p=null,g=this.docService.getAdditionalDocumentIdFromElement(c),C=g?this.docService.generateDocumentId(g):t?.documentId,E=t?.organizationId;if(C){let T=this.getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:E,documentId:C});if(T){p=[];for(let N of T)N?.targetElementId===e&&(s?a&&nh({location:a?.location,locationId:a?.locationId},{location:N.location,locationId:N.locationId})&&p.push(N):r?nh({location:r?.location,locationId:r?.locationId},{location:N.location,locationId:N.locationId})&&p.push(N):N?.locationId||p.push(N))}}return p}))}catch(t){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsBySectionId: ",t),se(null)}}addOrUpdateReaction(e,t,r,a,s,c,p,g){return Q(this,null,function*(){try{let C=t?.map(E=>this.getAnnotationById(E)).find(E=>E?.icon===e);if(C){if(!p||p==="delete")return yield this.updateUserInReaction(C)}else if(!p||p==="add")return yield this.addReaction(void 0,e,r,a,s,c,g)}catch(C){this.loggingService.catch("Error in ReactionService addOrUpdateReaction: ",C)}})}addReaction(e,t,r,a,s,c,p){return Q(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: addReaction","color: green;");try{let g=this.authService.getUser();if(g)if(g.isReadOnly||g.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add reactions.");else{let C=new Vk;if(C.from=g,C.lastUpdated=this.timestamp,C.reactions=[],C.reactions.push({from:g,lastUpdated:this.timestamp}),a&&(C.targetElementId=a),s&&(C.commentAnnotationId=s),this.setLocationToReactionAnnotation(C),C.pageInfo=Mi(),C.pageInfo&&(C.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth),t)if(C.icon=t,c)C.iconUrl=c?.url,C.iconEmoji=c?.emoji;else{let E=this.customReactions$.value;if(E){let T=E[t];T?.url&&(C.iconUrl=T?.url),T?.emoji&&(C.iconEmoji=T?.emoji)}}return r&&(C.location={},C.location=I({},r),C.locationId=this.docService.genarateLocationId(C.location)),yield this.saveReactionToDb(C)}}catch(g){this.loggingService.catch("Error in ReactionService addReaction: ",g)}})}setLocationToReactionAnnotation(e){try{let t=this.docService.getLocation();t?(e.locationId=t.locationId,e.location=t.location):(delete e.locationId,delete e.location);try{let r;e.targetElement?.xpath?r=this.domService.getElementFromXPath(e.targetElement.xpath):e.targetElementId&&(r=ra(e.targetElementId,["id","data-id"]));let a=this.docService.getAdditionLocationFromElement(r);if(a){let s=this.docService.addLocation({location:a,source:"internal"});s?.[0]&&(e.locationId=s[0].locationId,e.location=s[0].location)}}catch{}}catch(t){this.loggingService.catch("Error in ReactionService setLocationToReactionAnnotation:",t)}}getElementForReactionAnnotation(e){try{let t;return e.targetElementId&&(t=ra(e.targetElementId,["id","data-id"])),t}catch(t){return this.loggingService.catch("Error in ReactionService getElementForReactionAnnotation: ",t),null}}saveReactionToDb(e){return Q(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: saveReactionToDb","color: green;");try{if(this.authService.getUser()){let t=yield this.docService.getDocumentPaths$().pipe(Fe(a=>!!a),ot(1)).toPromise();if(!t)throw new Error("Document paths not found.");if(this.documentPaths=t,this.loggingService.log(this.documentPaths),!(yield this.databaseService.getDb().pipe(Fe(a=>!!a),ot(1)).toPromise()))throw new Error("Database not found.");if(this.documentPaths?.reaction){if(e.annotationId=this.commonDbService.generateDocumentId(),e.pageInfo,!e?.metadata?.documentId){e?.metadata||(e.metadata={});let p=this.getElementForReactionAnnotation(e),g=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId,element:p});e.metadata=I(I({},e?.metadata),g)}let a=JSON.parse(JSON.stringify(e));a.position=null;let{documentId:s,organizationId:c}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(e);return yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:s,organizationId:c},data:a}),a}else return}}catch(t){this.loggingService.catch("Error in ReactionService saveReactionToDb: ",t)}})}getDocumentIdAndOrganizationIdFromReactionAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in ReactionService getDocumentIdAndOrganizationIdFromReactionAnnotation: ",t),{}}}updateUserInReaction(e){return Q(this,null,function*(){try{let t=this.authService.getUser();if(t)return e?.reactions||(e.reactions=[]),e?.reactions?.find(a=>a?.from?.userId===t?.userId)?e.reactions=e?.reactions?.filter(a=>a?.from?.userId!==t?.userId):e.reactions.push({from:t,lastUpdated:this.timestamp}),e.reactions.length?yield this.updateReaction(e):yield this.deleteReactionPinAnnotation(e?.annotationId),e}catch(t){this.loggingService.catch("Error in ReactionService updateUserInReaction: ",t)}})}removeUserFromReaction(e){this.loggingService.log("%c[WB] Calling FUNCTION: removeUserFromReaction","color: green;");try{let t=this.authService.getUser();t&&(e?.reactions||(e.reactions=[]),e.reactions=e?.reactions?.filter(r=>r?.from?.userId!==t?.userId),this.updateReaction(e))}catch(t){this.loggingService.catch("Error in ReactionService removeUserFromReaction: ",t)}}updateReaction(e,t,r){return Q(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateReaction","color: green;");try{if(this.authService.getUser()){if(e?.targetElement?.xpath){let p=this.domService.getXPath(e.targetElement.xpath);if(p){let g=p.iterateNext();g&&(Ti(g)||(e.targetElement=null))}}let a=JSON.parse(JSON.stringify(e));if(a.position=null,a.lastUpdated=this.timestamp,!a?.metadata?.documentId){a?.metadata||(a.metadata={});let p=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId});a.metadata=I(I({},a?.metadata),p)}let{documentId:s,organizationId:c}=a?.metadata||{};return r?yield this.commonDbService.updateData({feature:"reaction",properties:{id:e.annotationId,documentId:s,organizationId:c},data:JSON.parse(JSON.stringify(a))}):yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:s,organizationId:c},data:JSON.parse(JSON.stringify(a))}),a}}catch(a){this.loggingService.catch("Error in ReactionService updateReaction: ",a)}})}deleteReactionPinAnnotation(e,t){return Q(this,null,function*(){try{let r=this.getAnnotationById(e),{documentId:a,organizationId:s}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(r);yield this.commonDbService.deleteData({feature:"reaction",properties:{id:e,documentId:a,organizationId:s}})}catch(r){this.loggingService.catch("Error in ReactionService deleteReactionPinAnnotation: ",r)}})}setCustomReactions(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;"),this.customReactions$.next(e),this.emojiService.setEmojiList(e)}catch(t){this.loggingService.catch("Error in ReactionService setCustomReactions: ",t)}}enableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;"),this.darkMode$.value===!0)return;this.darkMode$.next(!0)}catch(e){this.loggingService.catch("Error in ReactionService enableDarkMode: ",e)}}disableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;"),this.darkMode$.value===!1)return;this.darkMode$.next(!1)}catch(e){this.loggingService.catch("Error in ReactionService disableDarkMode: ",e)}}getDarkMode(){return this.darkMode$.value}getDarkMode$(){return this.darkMode$.asObservable()}sanitizeReactionAnnotation(e){try{e&&(e.iconUrl&&(e.iconUrl=this.domService.sanitizeHtml(e.iconUrl)),e.iconEmoji&&(e.iconEmoji=this.domService.sanitizeHtml(e.iconEmoji)),e.icon&&(e.icon=this.domService.sanitizeHtml(e.icon)))}catch(t){this.loggingService.catch("Error in ReactionService sanitizeReactionAnnotation: ",t)}}get timestamp(){return this.commonDbService.getServerTimestamp()}getReactionAnnotationForClient(e){try{let t=["isReactionResolverUsed","pageInfo"],r=JSON.parse(JSON.stringify(e)),a={};return Object.keys(r).forEach(s=>{t.includes(s)||(a[s]=r[s])}),a}catch(t){return this.loggingService.catch("Error in ReactionService getReactionAnnotationForClient: ",t),e}}};o.\u0275fac=function(t){return new(t||o)(ee(Ai),ee(et),ee(Ve),ee(Nt),ee(yn),ee(ln),ee(it),ee(Be),ee(Hc),ee(Sn),ee(y))},o.\u0275prov=Ae({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Cde=(()=>{let o=class o{constructor(e,t){this.domService=e,this.loggingService=t,this.keyEventSubject$=new tt;try{this.loggingService.log("%c[WB] Creating CLASS: HotkeyService","color: blue;"),this.keyEvent$=this.keyEventSubject$.asObservable().pipe(Xg()),this.domService.onWindowKeydown$().subscribe(r=>{this.keyEventSubject$.next(r)})}catch(r){this.loggingService.catch("Error in HotkeyService constructor: ",r)}}getKeyPressEvent(e,t={}){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getKeyPressEvent","color: green;"),this.keyEvent$.pipe(Fe(r=>r?.key===e),Fe(r=>!(!!t?.includeCtrl!==r.ctrlKey||!!t?.includeAlt!==r.altKey||!!t?.includeShift!==r.shiftKey||!!t?.includeMeta!==r.metaKey)),Fe(()=>this.isNoInputFocused()))}catch(r){return this.loggingService.catch("Error in HotkeyService getKeyPressEvent: ",r),new Ut}}isNoInputFocused(){try{let e=document.activeElement;for(;e&&e?.tagName!=="BODY";){if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e?.isContentEditable)return!1;e=e?.parentElement}return!0}catch(e){return this.loggingService.catch("Error in HotkeyService isNoInputFocused: ",e),!1}}};o.\u0275fac=function(t){return new(t||o)(ee(Be),ee(y))},o.\u0275prov=Ae({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Ye=(()=>{let o=class o{constructor(e,t){this.loggingService=e,this.configService=t,this.darkMode$=new ve(!1)}setDarkMode(e){try{let t=document.documentElement;if(!t)return;e?t.setAttribute(j.ATTRIBUTES.VELT_THEME,"dark"):t.removeAttribute(j.ATTRIBUTES.VELT_THEME),this.darkMode$.next(e)}catch(t){this.loggingService.catch("Error in theme service setDarkMode: ",t)}}getDarkMode$(){return this.darkMode$.asObservable()}updateListenerOnConfigChange(){try{this.configService.getConfig$().subscribe(e=>{if(e&&e.usePrefersColorScheme){this.enablePrefersColorScheme();return}this.disablePrefersColorScheme()})}catch(e){this.loggingService.catch("Error in theme service updateListenerOnConfigChange: ",e)}}enablePrefersColorScheme(){try{if(this.disablePrefersColorScheme(),!window.matchMedia)return;this.darkModeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.setDarkMode(this.darkModeQuery.matches),this.darkModeQueryListener=e=>{this.setDarkMode(e.matches)},this.darkModeQuery.addEventListener("change",this.darkModeQueryListener)}catch(e){this.loggingService.catch("Error in theme service enablePrefersColorScheme: ",e)}}disablePrefersColorScheme(){try{this.darkModeQuery&&this.darkModeQueryListener&&this.darkModeQuery.removeEventListener("change",this.darkModeQueryListener)}catch(e){this.loggingService.catch("Error in theme service disablePrefersColorScheme: ",e)}}};o.\u0275fac=function(t){return new(t||o)(ee(y),ee(Nt))},o.\u0275prov=Ae({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();function w8e(i,o){i&1&&(le(),_(0,"svg",16),w(1,"rect",17)(2,"path",18)(3,"path",19)(4,"rect",20)(5,"path",21),b())}function O8e(i,o){i&1&&(le(),_(0,"svg",16),w(1,"rect",22)(2,"path",23)(3,"path",19)(4,"rect",20)(5,"path",21),b())}function A8e(i,o){if(i&1&&(f(0),_(1,"div",6)(2,"div",7),u(3,w8e,6,0,"svg",8)(4,O8e,6,0,"ng-template",null,1,Ie),b(),_(6,"div",9),te(7),P(8,"translate"),w(9,"br"),te(10),P(11,"translate"),b(),_(12,"div",10)(13,"p"),te(14),P(15,"translate"),le(),_(16,"svg",11),w(17,"path",12)(18,"path",13)(19,"path",14)(20,"path",15),b(),te(21),P(22,"translate"),b(),ut(),_(23,"p"),te(24),P(25,"translate"),b()()(),v()),i&2){let n=me(5),e=l();m(3),d("ngIf",e.darkMode)("ngIfElse",n),m(4),_e(" ",M(8,7,"Allow mic permission to"),""),m(3),_e("",M(11,9,"enable your audio")," "),m(4),_e(" ",M(15,11,"1. Click the")," "),m(7),_e(" ",M(22,13,"page info icon in your browser\u2019s address bar")," "),m(3),_e(" ",M(25,15,"2. Turn on Microphone")," ")}}function P8e(i,o){i&1&&(le(),_(0,"svg",16),w(1,"rect",17)(2,"path",24)(3,"path",19)(4,"rect",20)(5,"path",21),b())}function M8e(i,o){i&1&&(le(),_(0,"svg",16),w(1,"rect",22)(2,"path",25)(3,"path",19)(4,"rect",20)(5,"path",21),b())}function k8e(i,o){if(i&1&&(f(0),_(1,"div",6)(2,"div",7),u(3,P8e,6,0,"svg",8)(4,M8e,6,0,"ng-template",null,2,Ie),b(),_(6,"div",9),te(7),P(8,"translate"),w(9,"br"),te(10),P(11,"translate"),b(),_(12,"div",10)(13,"p"),te(14),P(15,"translate"),le(),_(16,"svg",11),w(17,"path",12)(18,"path",13)(19,"path",14)(20,"path",15),b(),te(21),P(22,"translate"),b(),ut(),_(23,"p"),te(24),P(25,"translate"),b()()(),v()),i&2){let n=me(5),e=l();m(3),d("ngIf",e.darkMode)("ngIfElse",n),m(4),_e(" ",M(8,7,"Allow camera permission"),""),m(3),_e("",M(11,9,"to enable your video")," "),m(4),_e(" ",M(15,11,"1. Click the")," "),m(7),_e(" ",M(22,13,"page info icon in your browser\u2019s address bar")," "),m(3),_e(" ",M(25,15,"2. Turn on Camera")," ")}}var e9=(()=>{let o=class o{constructor(e,t,r,a,s){this.loggingService=e,this.themeService=t,this.elementRef=r,this.matDialogRef=a,this.data=s,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(c){this.loggingService.catch("Error in DevicePermissionDeniedDialogComponent constructor: ",c)}}ngOnDestroy(){}};o.\u0275fac=function(t){return new(t||o)(h(y),h(Ye),h(R),h(rr,8),h(Nl,8))},o.\u0275cmp=O({type:o,selectors:[["velt-device-permission-denied-dialog-internal"]],hostVars:1,hostBindings:function(t,r){t&2&&x("data-velt-element",r.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(t,r){if(t&1&&(_(0,"div",3,0),f(2,4),u(3,A8e,26,17,"ng-container",5)(4,k8e,26,17,"ng-container",5),v(),b()),t&2){let a=me(1);d("snippylyOverlay",a)("snippylyOverlayZIndex",3e3),m(2),d("ngSwitch",r.type),m(),d("ngSwitchCase","audio"),m(),d("ngSwitchCase","video")}},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}[_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-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-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 i=o;return i})();var qd=(()=>{let o=class o{constructor(e,t){this.loggingService=e,this.matDialog=t,this.audioPermissionState$=new ve(null),this.videoPermissionState$=new ve(null);try{this.loggingService.log("%c[WB] Creating CLASS: DevicePermissionService","color: blue;"),this.checkPermissions()}catch(r){this.loggingService.catch("Error in DevicePermissionService constructor: ",r)}}checkPermissions(){try{this.loggingService.log("%c[WB] Calling DevicePermissionService FUNCTION: checkPermissions","color: green;"),new Wn().browserName!=="Firefox"&&(navigator.permissions.query({name:"microphone"}).then(t=>{this.audioPermissionState$.next(t.state),t.onchange=()=>{this.audioPermissionState$.next(t.state)}}).catch(t=>{}),navigator.permissions.query({name:"camera"}).then(t=>{this.videoPermissionState$.next(t.state),t.onchange=()=>{this.videoPermissionState$.next(t.state)}}).catch(t=>{}))}catch(e){this.loggingService.catch("Error in DevicePermissionService checkPermissions: ",e)}}getPermissionState$(e){try{switch(this.loggingService.log("%c[WB] Calling DevicePermissionService FUNCTION: getPermissionState$","color: green;"),e){case"audio":return this.getAudioPermissionState$();case"video":return this.getVideoPermissionState$();default:return se(null)}}catch(t){return this.loggingService.catch("Error in DevicePermissionService getPermissionState$: ",t),se(null)}}getAudioPermissionState$(){return this.audioPermissionState$.asObservable()}getVideoPermissionState$(){return this.videoPermissionState$.asObservable()}openDevicePermissionDeniedDialog(e,t){try{this.loggingService.log("%c[WB] Calling DevicePermissionService FUNCTION: openDevicePermissionDeniedDialog","color: green;"),this.matDialog.open(e9,{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:e},t||{})})}catch(r){this.loggingService.catch("Error in DevicePermissionService openDevicePermissionDeniedDialog: ",r)}}};o.\u0275fac=function(t){return new(t||o)(ee(y),ee(io))},o.\u0275prov=Ae({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var R8e=()=>["video","screen"];function N8e(i,o){if(i&1&&w(0,"app-recording-preview-steps-dialog-video",4),i&2){let n=l(2);d("componentConfigSignal",n.componentConfigSignal)}}function F8e(i,o){if(i&1&&w(0,"app-recording-preview-steps-dialog-audio",4),i&2){let n=l(2);d("componentConfigSignal",n.componentConfigSignal)}}function L8e(i,o){if(i&1&&(f(0),_(1,"div",2,0),u(3,N8e,1,1,"app-recording-preview-steps-dialog-video",3)(4,F8e,1,1,"app-recording-preview-steps-dialog-audio",3),b(),v()),i&2){let n=o.ngIf,e=me(2),t=l();m(),d("snippylyOverlay",e)("snippylyOverlayZIndex",2e3),x("aria-label","Recording preview - "+n.type+" mode")("data-testid",t.componentId),m(2),d("ngIf",mt(6,R8e).includes(n.type)),m(),d("ngIf",n.type==="audio")}}var t9=(()=>{let o=class o{constructor(e,t,r,a,s,c,p){this.loggingService=e,this.recorderService=t,this.dialog=r,this.devicePermissionService=a,this.dialogRef=s,this.elementRef=c,this.data=p,this.darkMode=!1,this.shadowDom=!0,this.startCountdownFrom=3,this.defaultMediaSourceOptions=Nc(),this.recordingCountdownEnabled=!1,this.subscriptions=[],this.veltElement=!0,this.componentId="velt-recording-preview-steps-dialog",this.componentConfigSignal=Te({closeDialog:this.closeDialog.bind(this),startCountdown:this.startCountdown.bind(this),toggleAudio:this.toggleAudio.bind(this),toggleVideo:this.toggleVideo.bind(this),toggleSettings:this.toggleSettings.bind(this),cancelCountdown:this.cancelCountdown.bind(this),updateMediaConfig:this.updateMediaConfig.bind(this),handleOverlayClick:this.handleOverlayClick.bind(this),countdownStarted:!1,mediaConfig:{audio:{enabled:!1},video:{enabled:!1}},mediaState:{audio:{enabled:!1},video:{enabled:!1}},type:"video",countdown:this.startCountdownFrom,mediaStream:void 0,isSettingsOpen:!1,darkMode:this.darkMode,shadowDom:this.shadowDom});try{this.devicePermissionService.getPermissionState$("video").subscribe(g=>{this.componentConfigSignal.update(C=>(C=D(I({},C),{mediaState:D(I({},C.mediaState),{video:{enabled:g!=="denied"}})}),C))}),this.devicePermissionService.getPermissionState$("audio").subscribe(g=>{this.componentConfigSignal.update(C=>(C=D(I({},C),{mediaState:D(I({},C.mediaState),{audio:{enabled:g!=="denied"}})}),C))}),this.subscriptions.push(this.recorderService.getRecordingCountdownEnabled$().subscribe(g=>{this.recordingCountdownEnabled=g})),this.subscriptions.push(this.recorderService.getRecordingMicEnabled$().subscribe(g=>{g!==null&&(g?this.toggleAudioOn():this.toggleAudioOff())})),p&&(p.type&&this.componentConfigSignal.update(g=>(g=D(I({},g),{type:p.type}),g)),p.recordingCountdown!==void 0&&(this.recordingCountdownEnabled=!!p.recordingCountdown),p.mediaConfig&&(p.mediaConfig?.audio?.enabled&&!p.mediaConfig?.audio?.deviceId&&(p.mediaConfig.audio.deviceId=this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId),p.mediaConfig?.video?.enabled&&!p.mediaConfig?.video?.deviceId&&(p.mediaConfig.video.deviceId=this.defaultMediaSourceOptions?.selectedVideoDevice?.deviceId),p?.darkMode?this.elementRef.nativeElement.setAttribute("dark",""):this.elementRef.nativeElement.removeAttribute("dark"),this.componentConfigSignal.update(g=>(g=D(I({},g),{shadowDom:p?.shadowDom!==!1,darkMode:p.darkMode||!1}),g)),this.updateMediaConfig(p.mediaConfig)))}catch(g){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent constructor: ",g)}}ngOnInit(){try{this.setupA11yAttributes(),this.componentConfigSignal().type==="screen"&&this.subscriptions.push(this.recorderService.getScreenStream$().subscribe(e=>{e&&e.active&&e.getVideoTracks().some(t=>t.readyState==="live")&&this.componentConfigSignal.update(t=>(t=I({},t),t.mediaConfig.screen={enabled:!0,stream:e},t))}))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngOnInit:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","dialog"),e.setAttribute("aria-label","Recording preview steps dialog")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(I({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngOnChanges: ",t)}}ngAfterViewInit(){try{this.dialogRef.addPanelClass("snippyly-recording-preview-steps-dialog"),this.dialogRef.disableClose=!0}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngAfterViewInit: ",e)}}toggleSettings(e){try{e.stopPropagation(),this.componentConfigSignal.update(t=>(t=D(I({},t),{isSettingsOpen:!t.isSettingsOpen}),t))}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleSettings: ",t)}}toggleAudio(){try{this.componentConfigSignal().mediaConfig.audio||this.componentConfigSignal.update(r=>(r=D(I({},r),{mediaConfig:D(I({},r.mediaConfig),{audio:{enabled:!0}})}),r));let e=!this.componentConfigSignal().mediaConfig.audio?.enabled;this.componentConfigSignal.update(r=>(r=D(I({},r),{mediaConfig:D(I({},r.mediaConfig),{audio:{enabled:e}})}),r));let t=this.componentConfigSignal().mediaStream?.getAudioTracks()[0];t?t.enabled=e:e&&(this.componentConfigSignal.update(r=>(r=D(I({},r),{mediaConfig:D(I({},r.mediaConfig),{audio:D(I({},r.mediaConfig.audio),{deviceId:this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId})})}),r)),this.updateMediaConfig(this.componentConfigSignal().mediaConfig))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleAudio: ",e)}}toggleAudioOn(){try{this.componentConfigSignal.update(t=>(t=D(I({},t),{mediaConfig:D(I({},t.mediaConfig),{audio:{enabled:!0}})}),t));let e=this.componentConfigSignal().mediaStream?.getAudioTracks()[0];e?e.enabled=!0:(this.componentConfigSignal.update(t=>(t=D(I({},t),{mediaConfig:D(I({},t.mediaConfig),{audio:D(I({},t.mediaConfig.audio),{deviceId:this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId})})}),t)),this.updateMediaConfig(this.componentConfigSignal().mediaConfig))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleAudioOn: ",e)}}toggleAudioOff(){try{this.componentConfigSignal.update(t=>(t=D(I({},t),{mediaConfig:D(I({},t.mediaConfig),{audio:{enabled:!1}})}),t));let e=this.componentConfigSignal().mediaStream?.getAudioTracks()[0];e&&(e.enabled=!1)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleAudioOn: ",e)}}toggleVideo(){try{this.componentConfigSignal.update(e=>(e=I({},e),e.mediaConfig.video||(e.mediaConfig.video={enabled:!0}),e.mediaConfig.video.enabled=!e.mediaConfig.video.enabled,e.mediaConfig.video.deviceId=this.defaultMediaSourceOptions?.selectedVideoDevice?.deviceId,e)),this.updateMediaConfig(this.componentConfigSignal().mediaConfig)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleVideo: ",e)}}updateMediaConfig(e){try{this.stopMediaStream(),this.getMediaStream(e)}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent updateMediaConfig: ",t)}}getMediaStream(e){try{if(!navigator.mediaDevices){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream: ","No media devices");return}if(!navigator.mediaDevices.getUserMedia){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream: ","No getUserMedia");return}if(e.audio?.enabled||e.video?.enabled){let t={};e.audio?.enabled&&(t.audio={deviceId:e.audio.deviceId}),e.video?.enabled&&(t.video={deviceId:e.video.deviceId}),navigator.mediaDevices.getUserMedia(t).then(r=>{this.componentConfigSignal.update(a=>(a=D(I({},a),{mediaConfig:e,mediaStream:r}),a))}).catch(r=>{this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream catch: ",r)})}else this.componentConfigSignal.update(t=>(t=D(I({},t),{mediaStream:void 0,mediaConfig:e}),t))}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream: ",t)}}stopMediaStream(){try{this.componentConfigSignal.update(e=>(e=I({},e),e.mediaStream?.getTracks().forEach(t=>{t.stop()}),e.mediaStream=void 0,e))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent stopMediaStream: ",e)}}startCountdown(){return Q(this,null,function*(){try{let t=new Wn().getBrowserName()==="Firefox",r=null;if(t&&this.componentConfigSignal().type==="screen")try{let a=this.componentConfigSignal().mediaConfig,s={};a.audio?.enabled&&(s.audio={deviceId:a.audio?.deviceId}),a.video?.enabled&&(s.video={deviceId:a.video?.deviceId}),Object.keys(s).length>0&&(r=yield navigator.mediaDevices.getUserMedia(s))}catch(a){this.loggingService.catch("Error getting Firefox user media stream:",a),r=null}if(this.componentConfigSignal().type==="screen"){if(!this.componentConfigSignal().mediaConfig.screen?.stream)try{let s=yield navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0});this.componentConfigSignal.update(c=>(c=I({},c),c.mediaConfig.screen={enabled:!0,stream:s},c))}catch(s){this.loggingService.catch("Error getting screen media stream:",s),this.cancelCountdown();return}this.componentConfigSignal.update(s=>(s=I({},s),r&&(s.mediaConfig.audio?.enabled&&(s.mediaConfig.audio.stream=r),s.mediaConfig.video?.enabled&&(s.mediaConfig.video.stream=r)),s)),this.componentConfigSignal().mediaConfig.screen?.stream?.getTracks().forEach(s=>{s&&(s.onended=()=>{this.cancelCountdown()})})}this.recordingCountdownEnabled?(this.componentConfigSignal.update(a=>(a=D(I({},a),{countdownStarted:!0}),a)),this.countdownInterval=setInterval(()=>{this.componentConfigSignal().countdown>1?this.componentConfigSignal.update(a=>(a=D(I({},a),{countdown:a.countdown-1}),a)):this.closeDialog(this.componentConfigSignal().mediaConfig)},1e3)):this.closeDialog(this.componentConfigSignal().mediaConfig)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent startCountdown: ",e)}})}cancelCountdown(){try{if(this.componentConfigSignal.update(e=>(e=D(I({},e),{countdownStarted:!1,countdown:this.startCountdownFrom}),e)),this.clearInterval(),this.componentConfigSignal().type==="screen"){let e=this.componentConfigSignal().mediaConfig.screen?.stream;e&&e.getTracks().forEach(t=>{t.stop()}),this.componentConfigSignal.update(t=>(t=I({},t),t.mediaConfig.screen=void 0,t))}}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent cancelCountdown: ",e)}}closeDialog(e){return Q(this,null,function*(){try{this.clearInterval(),e||(this.stopMediaStream(),this.componentConfigSignal.update(t=>(t=I({},t),t.mediaConfig&&(t.mediaConfig.screen?.stream&&(t.mediaConfig.screen.stream.getTracks().forEach(r=>r.stop()),t.mediaConfig.screen.stream=void 0),t.mediaConfig.audio?.stream&&(t.mediaConfig.audio.stream.getTracks().forEach(r=>r.stop()),t.mediaConfig.audio.stream=void 0),t.mediaConfig.video?.stream&&(t.mediaConfig.video.stream.getTracks().forEach(r=>r.stop()),t.mediaConfig.video.stream=void 0)),t))),this.dialogRef.close(e)}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent closeDialog: ",t)}})}handleOverlayClick(e){try{this.componentConfigSignal.update(t=>(t=D(I({},t),{isSettingsOpen:!1}),t)),e.stopPropagation()}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent handleOverlayClick: ",t)}}clearInterval(){try{this.countdownInterval&&(clearInterval(this.countdownInterval),this.countdownInterval=void 0)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent clearInterval: ",e)}}ngOnDestroy(){try{this.clearInterval(),this.stopMediaStream(),this.subscriptions.forEach(e=>{e?.unsubscribe()})}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngOnDestroy: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(y),h(_n),h(io),h(qd),h(rr),h(R),h(Nl,8))},o.\u0275cmp=O({type:o,selectors:[["snippyly-recording-preview-steps-dialog"]],hostVars:1,hostBindings:function(t,r){t&2&&x("data-velt-element",r.veltElement)},inputs:{darkMode:"darkMode",shadowDom:"shadowDom"},standalone:!1,features:[Ze],decls:1,vars:1,consts:[["recordingPreviewDialogRef",""],[4,"ngIf"],["role","dialog","aria-modal","true",3,"snippylyOverlay","snippylyOverlayZIndex"],[3,"componentConfigSignal",4,"ngIf"],[3,"componentConfigSignal"]],template:function(t,r){t&1&&u(0,L8e,5,7,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}[_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-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-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.snippyly-recording-preview-steps-dialog{max-width:none} .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{background:transparent;padding:0;margin:0;border-radius:var(--velt-border-radius-lg)}"],changeDetection:0});let i=o;return i})();var za=(()=>{let o=class o{constructor(e){this.loggingService=e,this.isPipActive$=new ve(!1),this.pipStopRecordingTriggered$=new ve(!1),this.pipPauseRecordingTriggered$=new ve(!1),this.pictureInPicture$=new ve(!1),this.pipClearRecordingTriggered$=new ve(!1)}getPipClearRecordingTriggered$(){return this.pipClearRecordingTriggered$.asObservable()}resetPipClearRecordingTriggered(){this.pipClearRecordingTriggered$.next(!1)}openPictureInPicture(e,t){return Q(this,null,function*(){try{if(!this.isPictureInPictureEnabled()||!e||document.pictureInPictureElement||window.documentPictureInPicture?.window)return;if("documentPictureInPicture"in window){yield this.createDocumentPip(e,t);return}if(document.pictureInPictureEnabled){let r=yield this.findVideoElement();if(!r){this.loggingService.warn("No video element found for Picture-in-Picture");return}yield r.requestPictureInPicture(),this.isPipActive$.next(!0);return}}catch(r){this.loggingService.catch("Error in PipService openPictureInPicture:",r)}})}createDocumentPip(e,t){return Q(this,null,function*(){try{let r=window.documentPictureInPicture;this.pipWindow=yield r.requestWindow({width:320,height:288}),yield this.addStylesToPip(),yield this.createControlPanelInPip(e,t),this.pipWindow?.addEventListener("unload",()=>{try{this.isPipActive$.next(!1),this.pipWindow=void 0}catch(a){this.loggingService.catch("Error in PipService createDocumentPip unload:",a)}}),this.isPipActive$.next(!0)}catch{this.isPipActive$.next(!1),this.pipWindow=void 0}})}addStylesToPip(){return Q(this,null,function*(){try{if(!this.pipWindow)return;this.pipWindow.document.body.style.margin="0",this.pipWindow.document.body.style.padding="0",this.pipWindow.document.body.style.backgroundColor="#000",this.pipWindow.document.body.style.display="flex",this.pipWindow.document.body.style.alignItems="center",this.pipWindow.document.body.style.justifyContent="center"}catch(e){this.loggingService.catch("Error in PipService copyStylesToPip:",e)}})}createControlPanelInPip(e,t){return Q(this,null,function*(){if(this.pipWindow)try{let r=this.pipWindow.document.createElement("div");r.style.cssText=`
|
|
382
|
+
`},o.GIF_PATHS={CAT_JAM:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/emojis%2Fcatjam.gif?alt=media&token=9868b4ec-0031-4751-bb2e-47bf0f9d9583"},o.\u0275fac=function(t){return new(t||o)(ee(Be),ee(y),ee(Ks))},o.\u0275prov=Ae({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var cr=(()=>{let o=class o{constructor(e,t,r,a,s,c,p,g,C,E,T){this.afAuth=e,this.analyticsService=t,this.authService=r,this.configService=a,this.databaseService=s,this.commonDbService=c,this.docService=p,this.domService=g,this.emojiService=C,this.iamService=E,this.loggingService=T,this.documentPaths=null,this.reactionAnnotationById$=new ve({}),this.customReactions$=new ve({}),this.darkMode$=new ve(null),this.loggingService.log("%c[WB] Creating CLASS: ReactionService","color: blue;"),this.analyticsService.setReactionService(this),this.authService.setReactionService(this),this.databaseService.getDb().pipe(Fe(N=>!!N),ot(1)).subscribe(N=>{N&&this.getAllReactionAnnotations(void 0,void 0,!0).subscribe()},N=>{this.loggingService.catch("Error in ReactionService getDb subscription: ",N)})}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in ReactionService","color: green;");try{this.reactionAnnotationById$.next({}),this.customReactions$.next({}),this.documentPaths=null}catch(e){this.loggingService.catch("Error in ReactionService clearCache: ",e)}}getAllReactionAnnotations(e,t,r,a,s){this.loggingService.log("%c[WB] Calling FUNCTION: getAllReactionAnnotations","color: green;");let c,p;try{if(e&&(p=`${An(e)}`),t&&typeof t=="object"){let g=Qo(t);c=An(JSON.stringify(g))}}catch(g){this.loggingService.catch("Error in ReactionService getAllReactionAnnotations: ",g)}return ei(this.afAuth).pipe(Fe(g=>!!g),he(g=>this.isFeatureAllowed({firebaseUser:g,annotations:[],filteredAnnotations:[]})),he(g=>g.featureAllowed?this.iamService.isUserAllowed$().pipe(de(C=>(g.featureAllowed=C,g))):se(g)),he(g=>g.featureAllowed?se(g).pipe(he(C=>this.docService.getDocumentPaths$().pipe(de(E=>(this.documentPaths=E,C.documentPaths=E,C)))),he(C=>p?this.getDataFromDocumentIds([p]).pipe(de(E=>(C.annotations=E||[],I({},C)))):this.docService.getDocumentIds$().pipe(he(E=>{let T=E?.length>0?E.map(N=>N.documentId):[this.documentPaths?.documentId??""];return this.getDataFromDocumentIds(T).pipe(de(N=>(C.annotations=N||[],I({},C))))}))),he(C=>this.docService.getLocation$().pipe(de(E=>(C.location=E,C)))),he(C=>this.docService.getLocations$().pipe(de(E=>(C.customLocations=E,C)))),de(C=>{if(C.filteredAnnotations=[],p&&!c)return C.filteredAnnotations=C.annotations?.slice(),C;{let E=[];return c?E.push(c):(E.push(C?.location?.locationId),E.push(...Object.values(C?.customLocations||[]).map(T=>T.locationId))),C.filteredAnnotations=this.filterAnnotationsByLocationIds(C?.annotations,E),C}}),he(C=>r?se(C):C?.annotations?.length?this.domService.onWindowResize$().pipe(de(()=>C)):se(C)),he(C=>r?se(C):se(C)),de(C=>C),he(C=>C?.filteredAnnotations?se(C?.filteredAnnotations||[]):se([]))):se([])),yt(pn))}isFeatureAllowed(e){return this.configService.getConfig$().pipe(Fe(t=>!!t),de(t=>D(I({},e),{config:t})),he(t=>this.authService.getUser$().pipe(de(r=>D(I({},t),{user:r})))),he(t=>Zi(t.config,t.user,Ne.REACTION)?se(D(I({},t),{featureAllowed:!0})):(this.loggingService.warn("Reaction feature is not allowed."),se(D(I({},t),{featureAllowed:!1})))),yt((t,r)=>t?.featureAllowed===r?.featureAllowed))}getDataFromDocumentIds(e,t){return this.getDataFromDocuments({documentIds:e,filters:t})}getDataFromDocuments(e){if(this.configService?.getApiKey()){let{documentIds:t,filters:r}=e;if(t?.some(g=>!g)||!this.documentPaths)return se([]);let a=this.docService.getDocumentPaths()?.veltFolderId,s=se([]),c={useCollectionGroup:!0,isCollection:!0,useQuery:!0};this.commonDbService.shouldUseFirestore()||(c.documentId=t?.length?t[0]:void 0,c.organizationId=this.documentPaths?.organizationId);let p=[];for(let g=0;g<(t?.length??0);g+=j.LISTENER_BATCH_SIZE)p.push(t?.slice(g,g+j.LISTENER_BATCH_SIZE)??[]);return s=Tn(p.map(g=>this.commonDbService.dbListener({feature:"allReactions",properties:D(I({},c),{firestoreQuery:[Gi(Ot("metadata.apiKey","==",this.configService?.getApiKey()),Ot("metadata.documentId","in",g),Ot("metadata.organizationId","==",this.documentPaths?.organizationId),...a?[Ot("metadata.veltFolderId","==",a)]:[])]})}).pipe(Ka()))).pipe(de(g=>Ps(g))),s.pipe(de(g=>({data:g?.data,operation:g?.operation})),de(({data:g,operation:C})=>{let E=[];return g&&(E=Object.values(g??{}).filter(T=>typeof T=="object")),E?.forEach(T=>{this.sanitizeReactionAnnotation(T)}),{data:E,operation:C}}),de(({data:g,operation:C})=>{if(!t)return{data:g,documentMap:{},operation:C};let E=g.reduce((T,N)=>{let z=N.metadata?.documentId;return z&&(T[z]||(T[z]=[]),T[z].push(N)),T},{});return{data:g,documentMap:E,operation:C}}),de(({data:g,documentMap:C,operation:E})=>{if(!r)if(E?.type==="removed"){if(E?.ids?.length){let T=this.reactionAnnotationById$.value;E?.ids?.forEach(N=>{delete T?.[N]}),this.reactionAnnotationById$.next(T)}}else Object.entries(C??{}).forEach(([T,N])=>{this.setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:this.documentPaths?.organizationId,documentId:T,annotations:N})});return g}),Un(g=>(this.loggingService.catch("Error in ReactionService getDataFromDocumentId: ",g),se([]))))}else return se([])}setReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t,annotations:r,queryHash:a}){try{if(t){e||(e=j.NO_ORGANIZATION_ID),a||(a=j.DEFAULT_QUERY_HASH);let s={};r?.forEach(p=>{p?.annotationId&&(s[p?.annotationId]=p)});let c=I(I({},this.reactionAnnotationById$.value),s);this.reactionAnnotationById$.next(c)}}catch(s){this.loggingService.catch("Error in ReactionService setReactionAnnotationsByOrganizationIdAndDocumentId:",s)}}getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:e,documentId:t}){try{let r={};return Object.values(this.reactionAnnotationById$.value??{}).forEach(a=>{a?.metadata?.documentId==t&&a?.metadata?.organizationId==e&&(r[a?.annotationId]=a)}),Object.values(r)}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsByOrganizationIdAndDocumentId:",r),[]}}getLocations$(){return this.docService.getLocation$().pipe(he(e=>this.docService.getLocations$().pipe(de(t=>({location:e,locations:t})))),de(e=>{let t=[];return t.push(e?.location?.locationId),t.push(...Object.values(e.locations||[]).map(r=>r.locationId)),t||[]}))}filterAnnotationsByLocationIds(e,t){try{return e.filter(r=>t.includes(r.locationId))}catch(r){return this.loggingService.catch("Error in ReactionService filterAnnotationsByLocations:",r),[]}}getAnnotationById(e,t){try{let r=this.reactionAnnotationById$.value?.[e];if(r){let{documentId:a,organizationId:s}=t||{};if(a&&r.metadata?.documentId!==a||s&&r.metadata?.organizationId!==s)return}return r}catch(r){this.loggingService.catch("Error in ReactionService getAnnotationById: ",r);return}}getBaseMetadataFromReactionAnnotationId(e){try{let t=this.reactionAnnotationById$.value?.[e];return t?t.metadata:void 0}catch(t){this.loggingService.catch("Error in ReactionService getBaseMetadataFromReactionAnnotationId: ",t);return}}getReactionAnnotationByAnnotationId(e,t){try{return this.reactionAnnotationById$.pipe(de(()=>this.getAnnotationById(e,t)),he(r=>r?se(r):se(r)))}catch(r){return this.loggingService.catch("Error in ReactionService getReactionAnnotationByAnnotationId: ",r),se(void 0)}}getReactionAnnotationsBySectionId(e){try{return this.reactionAnnotationById$.pipe(he(t=>this.docService.getDocumentPaths$().pipe(de(r=>({documentPaths:r,sectionId:e,reactionAnnotationsMap:t})))),he(t=>{let r=ra(e,["id","data-id"]);if(r){let a=this.docService.getAdditionLocationFromElement(r);if(a){let s=this.docService.genarateLocationId(a);return this.docService.getLocations$().pipe(de(c=>{let g=Object.values(c||{}).find(C=>C.locationId===s||a?.id&&C.location.id===a.id);return D(I({},t),{additionalLocation:g,locationOnElement:!!a})}))}}return se(D(I({},t),{additionalLocation:null,element:r}))}),he(t=>t?.locationOnElement?se(t):this.docService.getLocation$().pipe(de(r=>D(I({},t),{location:r})))),de(({documentPaths:t,location:r,additionalLocation:a,locationOnElement:s,element:c})=>{let p=null,g=this.docService.getAdditionalDocumentIdFromElement(c),C=g?this.docService.generateDocumentId(g):t?.documentId,E=t?.organizationId;if(C){let T=this.getReactionAnnotationsByOrganizationIdAndDocumentId({organizationId:E,documentId:C});if(T){p=[];for(let N of T)N?.targetElementId===e&&(s?a&&nh({location:a?.location,locationId:a?.locationId},{location:N.location,locationId:N.locationId})&&p.push(N):r?nh({location:r?.location,locationId:r?.locationId},{location:N.location,locationId:N.locationId})&&p.push(N):N?.locationId||p.push(N))}}return p}))}catch(t){return this.loggingService.catch("Error in ReactionService getReactionAnnotationsBySectionId: ",t),se(null)}}addOrUpdateReaction(e,t,r,a,s,c,p,g){return Q(this,null,function*(){try{let C=t?.map(E=>this.getAnnotationById(E)).find(E=>E?.icon===e);if(C){if(!p||p==="delete")return yield this.updateUserInReaction(C)}else if(!p||p==="add")return yield this.addReaction(void 0,e,r,a,s,c,g)}catch(C){this.loggingService.catch("Error in ReactionService addOrUpdateReaction: ",C)}})}addReaction(e,t,r,a,s,c,p){return Q(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: addReaction","color: green;");try{let g=this.authService.getUser();if(g)if(g.isReadOnly||g.isAnonymous)this.loggingService.catch("Anonymous/Readonly users cannot add reactions.");else{let C=new Vk;if(C.from=g,C.lastUpdated=this.timestamp,C.reactions=[],C.reactions.push({from:g,lastUpdated:this.timestamp}),a&&(C.targetElementId=a),s&&(C.commentAnnotationId=s),this.setLocationToReactionAnnotation(C),C.pageInfo=Mi(),C.pageInfo&&(C.pageInfo.screenWidth=this.domService.getCurrentWindowSizeValue()?.screenWidth),t)if(C.icon=t,c)C.iconUrl=c?.url,C.iconEmoji=c?.emoji;else{let E=this.customReactions$.value;if(E){let T=E[t];T?.url&&(C.iconUrl=T?.url),T?.emoji&&(C.iconEmoji=T?.emoji)}}return r&&(C.location={},C.location=I({},r),C.locationId=this.docService.genarateLocationId(C.location)),yield this.saveReactionToDb(C)}}catch(g){this.loggingService.catch("Error in ReactionService addReaction: ",g)}})}setLocationToReactionAnnotation(e){try{let t=this.docService.getLocation();t?(e.locationId=t.locationId,e.location=t.location):(delete e.locationId,delete e.location);try{let r;e.targetElement?.xpath?r=this.domService.getElementFromXPath(e.targetElement.xpath):e.targetElementId&&(r=ra(e.targetElementId,["id","data-id"]));let a=this.docService.getAdditionLocationFromElement(r);if(a){let s=this.docService.addLocation({location:a,source:"internal"});s?.[0]&&(e.locationId=s[0].locationId,e.location=s[0].location)}}catch{}}catch(t){this.loggingService.catch("Error in ReactionService setLocationToReactionAnnotation:",t)}}getElementForReactionAnnotation(e){try{let t;return e.targetElementId&&(t=ra(e.targetElementId,["id","data-id"])),t}catch(t){return this.loggingService.catch("Error in ReactionService getElementForReactionAnnotation: ",t),null}}saveReactionToDb(e){return Q(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: saveReactionToDb","color: green;");try{if(this.authService.getUser()){let t=yield this.docService.getDocumentPaths$().pipe(Fe(a=>!!a),ot(1)).toPromise();if(!t)throw new Error("Document paths not found.");if(this.documentPaths=t,this.loggingService.log(this.documentPaths),!(yield this.databaseService.getDb().pipe(Fe(a=>!!a),ot(1)).toPromise()))throw new Error("Database not found.");if(this.documentPaths?.reaction){if(e.annotationId=this.commonDbService.generateDocumentId(),e.pageInfo,!e?.metadata?.documentId){e?.metadata||(e.metadata={});let p=this.getElementForReactionAnnotation(e),g=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId,element:p});e.metadata=I(I({},e?.metadata),g)}let a=JSON.parse(JSON.stringify(e));a.position=null;let{documentId:s,organizationId:c}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(e);return yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:s,organizationId:c},data:a}),a}else return}}catch(t){this.loggingService.catch("Error in ReactionService saveReactionToDb: ",t)}})}getDocumentIdAndOrganizationIdFromReactionAnnotation(e){try{return{documentId:e?.metadata?.documentId,organizationId:e?.metadata?.organizationId}}catch(t){return this.loggingService.catch("Error in ReactionService getDocumentIdAndOrganizationIdFromReactionAnnotation: ",t),{}}}updateUserInReaction(e){return Q(this,null,function*(){try{let t=this.authService.getUser();if(t)return e?.reactions||(e.reactions=[]),e?.reactions?.find(a=>a?.from?.userId===t?.userId)?e.reactions=e?.reactions?.filter(a=>a?.from?.userId!==t?.userId):e.reactions.push({from:t,lastUpdated:this.timestamp}),e.reactions.length?yield this.updateReaction(e):yield this.deleteReactionPinAnnotation(e?.annotationId),e}catch(t){this.loggingService.catch("Error in ReactionService updateUserInReaction: ",t)}})}removeUserFromReaction(e){this.loggingService.log("%c[WB] Calling FUNCTION: removeUserFromReaction","color: green;");try{let t=this.authService.getUser();t&&(e?.reactions||(e.reactions=[]),e.reactions=e?.reactions?.filter(r=>r?.from?.userId!==t?.userId),this.updateReaction(e))}catch(t){this.loggingService.catch("Error in ReactionService removeUserFromReaction: ",t)}}updateReaction(e,t,r){return Q(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateReaction","color: green;");try{if(this.authService.getUser()){if(e?.targetElement?.xpath){let p=this.domService.getXPath(e.targetElement.xpath);if(p){let g=p.iterateNext();g&&(Ti(g)||(e.targetElement=null))}}let a=JSON.parse(JSON.stringify(e));if(a.position=null,a.lastUpdated=this.timestamp,!a?.metadata?.documentId){a?.metadata||(a.metadata={});let p=this.docService.getBaseMetadata("reaction",{commentAnnotationId:e.commentAnnotationId});a.metadata=I(I({},a?.metadata),p)}let{documentId:s,organizationId:c}=a?.metadata||{};return r?yield this.commonDbService.updateData({feature:"reaction",properties:{id:e.annotationId,documentId:s,organizationId:c},data:JSON.parse(JSON.stringify(a))}):yield this.commonDbService.setData({feature:"reaction",properties:{id:e.annotationId,documentId:s,organizationId:c},data:JSON.parse(JSON.stringify(a))}),a}}catch(a){this.loggingService.catch("Error in ReactionService updateReaction: ",a)}})}deleteReactionPinAnnotation(e,t){return Q(this,null,function*(){try{let r=this.getAnnotationById(e),{documentId:a,organizationId:s}=this.getDocumentIdAndOrganizationIdFromReactionAnnotation(r);yield this.commonDbService.deleteData({feature:"reaction",properties:{id:e,documentId:a,organizationId:s}})}catch(r){this.loggingService.catch("Error in ReactionService deleteReactionPinAnnotation: ",r)}})}setCustomReactions(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCustomReactions","color: green;"),this.customReactions$.next(e),this.emojiService.setEmojiList(e)}catch(t){this.loggingService.catch("Error in ReactionService setCustomReactions: ",t)}}enableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: enableDarkMode","color: green;"),this.darkMode$.value===!0)return;this.darkMode$.next(!0)}catch(e){this.loggingService.catch("Error in ReactionService enableDarkMode: ",e)}}disableDarkMode(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: disableDarkMode","color: green;"),this.darkMode$.value===!1)return;this.darkMode$.next(!1)}catch(e){this.loggingService.catch("Error in ReactionService disableDarkMode: ",e)}}getDarkMode(){return this.darkMode$.value}getDarkMode$(){return this.darkMode$.asObservable()}sanitizeReactionAnnotation(e){try{e&&(e.iconUrl&&(e.iconUrl=this.domService.sanitizeHtml(e.iconUrl)),e.iconEmoji&&(e.iconEmoji=this.domService.sanitizeHtml(e.iconEmoji)),e.icon&&(e.icon=this.domService.sanitizeHtml(e.icon)))}catch(t){this.loggingService.catch("Error in ReactionService sanitizeReactionAnnotation: ",t)}}get timestamp(){return this.commonDbService.getServerTimestamp()}getReactionAnnotationForClient(e){try{let t=["isReactionResolverUsed","pageInfo","from","involvedUserIds","position"],r=JSON.parse(JSON.stringify(e)),a={};return Object.keys(r).forEach(s=>{t.includes(s)||(s==="reactions"?a.fromUsers=r[s]:a[s]=r[s])}),a}catch(t){return this.loggingService.catch("Error in ReactionService getReactionAnnotationForClient: ",t),e}}};o.\u0275fac=function(t){return new(t||o)(ee(Ai),ee(et),ee(Ve),ee(Nt),ee(yn),ee(ln),ee(it),ee(Be),ee(Hc),ee(Sn),ee(y))},o.\u0275prov=Ae({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Cde=(()=>{let o=class o{constructor(e,t){this.domService=e,this.loggingService=t,this.keyEventSubject$=new tt;try{this.loggingService.log("%c[WB] Creating CLASS: HotkeyService","color: blue;"),this.keyEvent$=this.keyEventSubject$.asObservable().pipe(Xg()),this.domService.onWindowKeydown$().subscribe(r=>{this.keyEventSubject$.next(r)})}catch(r){this.loggingService.catch("Error in HotkeyService constructor: ",r)}}getKeyPressEvent(e,t={}){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getKeyPressEvent","color: green;"),this.keyEvent$.pipe(Fe(r=>r?.key===e),Fe(r=>!(!!t?.includeCtrl!==r.ctrlKey||!!t?.includeAlt!==r.altKey||!!t?.includeShift!==r.shiftKey||!!t?.includeMeta!==r.metaKey)),Fe(()=>this.isNoInputFocused()))}catch(r){return this.loggingService.catch("Error in HotkeyService getKeyPressEvent: ",r),new Ut}}isNoInputFocused(){try{let e=document.activeElement;for(;e&&e?.tagName!=="BODY";){if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e?.isContentEditable)return!1;e=e?.parentElement}return!0}catch(e){return this.loggingService.catch("Error in HotkeyService isNoInputFocused: ",e),!1}}};o.\u0275fac=function(t){return new(t||o)(ee(Be),ee(y))},o.\u0275prov=Ae({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Ye=(()=>{let o=class o{constructor(e,t){this.loggingService=e,this.configService=t,this.darkMode$=new ve(!1)}setDarkMode(e){try{let t=document.documentElement;if(!t)return;e?t.setAttribute(j.ATTRIBUTES.VELT_THEME,"dark"):t.removeAttribute(j.ATTRIBUTES.VELT_THEME),this.darkMode$.next(e)}catch(t){this.loggingService.catch("Error in theme service setDarkMode: ",t)}}getDarkMode$(){return this.darkMode$.asObservable()}updateListenerOnConfigChange(){try{this.configService.getConfig$().subscribe(e=>{if(e&&e.usePrefersColorScheme){this.enablePrefersColorScheme();return}this.disablePrefersColorScheme()})}catch(e){this.loggingService.catch("Error in theme service updateListenerOnConfigChange: ",e)}}enablePrefersColorScheme(){try{if(this.disablePrefersColorScheme(),!window.matchMedia)return;this.darkModeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.setDarkMode(this.darkModeQuery.matches),this.darkModeQueryListener=e=>{this.setDarkMode(e.matches)},this.darkModeQuery.addEventListener("change",this.darkModeQueryListener)}catch(e){this.loggingService.catch("Error in theme service enablePrefersColorScheme: ",e)}}disablePrefersColorScheme(){try{this.darkModeQuery&&this.darkModeQueryListener&&this.darkModeQuery.removeEventListener("change",this.darkModeQueryListener)}catch(e){this.loggingService.catch("Error in theme service disablePrefersColorScheme: ",e)}}};o.\u0275fac=function(t){return new(t||o)(ee(y),ee(Nt))},o.\u0275prov=Ae({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();function w8e(i,o){i&1&&(le(),_(0,"svg",16),w(1,"rect",17)(2,"path",18)(3,"path",19)(4,"rect",20)(5,"path",21),b())}function O8e(i,o){i&1&&(le(),_(0,"svg",16),w(1,"rect",22)(2,"path",23)(3,"path",19)(4,"rect",20)(5,"path",21),b())}function A8e(i,o){if(i&1&&(f(0),_(1,"div",6)(2,"div",7),u(3,w8e,6,0,"svg",8)(4,O8e,6,0,"ng-template",null,1,Ie),b(),_(6,"div",9),te(7),P(8,"translate"),w(9,"br"),te(10),P(11,"translate"),b(),_(12,"div",10)(13,"p"),te(14),P(15,"translate"),le(),_(16,"svg",11),w(17,"path",12)(18,"path",13)(19,"path",14)(20,"path",15),b(),te(21),P(22,"translate"),b(),ut(),_(23,"p"),te(24),P(25,"translate"),b()()(),v()),i&2){let n=me(5),e=l();m(3),d("ngIf",e.darkMode)("ngIfElse",n),m(4),_e(" ",M(8,7,"Allow mic permission to"),""),m(3),_e("",M(11,9,"enable your audio")," "),m(4),_e(" ",M(15,11,"1. Click the")," "),m(7),_e(" ",M(22,13,"page info icon in your browser\u2019s address bar")," "),m(3),_e(" ",M(25,15,"2. Turn on Microphone")," ")}}function P8e(i,o){i&1&&(le(),_(0,"svg",16),w(1,"rect",17)(2,"path",24)(3,"path",19)(4,"rect",20)(5,"path",21),b())}function M8e(i,o){i&1&&(le(),_(0,"svg",16),w(1,"rect",22)(2,"path",25)(3,"path",19)(4,"rect",20)(5,"path",21),b())}function k8e(i,o){if(i&1&&(f(0),_(1,"div",6)(2,"div",7),u(3,P8e,6,0,"svg",8)(4,M8e,6,0,"ng-template",null,2,Ie),b(),_(6,"div",9),te(7),P(8,"translate"),w(9,"br"),te(10),P(11,"translate"),b(),_(12,"div",10)(13,"p"),te(14),P(15,"translate"),le(),_(16,"svg",11),w(17,"path",12)(18,"path",13)(19,"path",14)(20,"path",15),b(),te(21),P(22,"translate"),b(),ut(),_(23,"p"),te(24),P(25,"translate"),b()()(),v()),i&2){let n=me(5),e=l();m(3),d("ngIf",e.darkMode)("ngIfElse",n),m(4),_e(" ",M(8,7,"Allow camera permission"),""),m(3),_e("",M(11,9,"to enable your video")," "),m(4),_e(" ",M(15,11,"1. Click the")," "),m(7),_e(" ",M(22,13,"page info icon in your browser\u2019s address bar")," "),m(3),_e(" ",M(25,15,"2. Turn on Camera")," ")}}var e9=(()=>{let o=class o{constructor(e,t,r,a,s){this.loggingService=e,this.themeService=t,this.elementRef=r,this.matDialogRef=a,this.data=s,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(c){this.loggingService.catch("Error in DevicePermissionDeniedDialogComponent constructor: ",c)}}ngOnDestroy(){}};o.\u0275fac=function(t){return new(t||o)(h(y),h(Ye),h(R),h(rr,8),h(Nl,8))},o.\u0275cmp=O({type:o,selectors:[["velt-device-permission-denied-dialog-internal"]],hostVars:1,hostBindings:function(t,r){t&2&&x("data-velt-element",r.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(t,r){if(t&1&&(_(0,"div",3,0),f(2,4),u(3,A8e,26,17,"ng-container",5)(4,k8e,26,17,"ng-container",5),v(),b()),t&2){let a=me(1);d("snippylyOverlay",a)("snippylyOverlayZIndex",3e3),m(2),d("ngSwitch",r.type),m(),d("ngSwitchCase","audio"),m(),d("ngSwitchCase","video")}},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}[_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-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-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 i=o;return i})();var qd=(()=>{let o=class o{constructor(e,t){this.loggingService=e,this.matDialog=t,this.audioPermissionState$=new ve(null),this.videoPermissionState$=new ve(null);try{this.loggingService.log("%c[WB] Creating CLASS: DevicePermissionService","color: blue;"),this.checkPermissions()}catch(r){this.loggingService.catch("Error in DevicePermissionService constructor: ",r)}}checkPermissions(){try{this.loggingService.log("%c[WB] Calling DevicePermissionService FUNCTION: checkPermissions","color: green;"),new Wn().browserName!=="Firefox"&&(navigator.permissions.query({name:"microphone"}).then(t=>{this.audioPermissionState$.next(t.state),t.onchange=()=>{this.audioPermissionState$.next(t.state)}}).catch(t=>{}),navigator.permissions.query({name:"camera"}).then(t=>{this.videoPermissionState$.next(t.state),t.onchange=()=>{this.videoPermissionState$.next(t.state)}}).catch(t=>{}))}catch(e){this.loggingService.catch("Error in DevicePermissionService checkPermissions: ",e)}}getPermissionState$(e){try{switch(this.loggingService.log("%c[WB] Calling DevicePermissionService FUNCTION: getPermissionState$","color: green;"),e){case"audio":return this.getAudioPermissionState$();case"video":return this.getVideoPermissionState$();default:return se(null)}}catch(t){return this.loggingService.catch("Error in DevicePermissionService getPermissionState$: ",t),se(null)}}getAudioPermissionState$(){return this.audioPermissionState$.asObservable()}getVideoPermissionState$(){return this.videoPermissionState$.asObservable()}openDevicePermissionDeniedDialog(e,t){try{this.loggingService.log("%c[WB] Calling DevicePermissionService FUNCTION: openDevicePermissionDeniedDialog","color: green;"),this.matDialog.open(e9,{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:e},t||{})})}catch(r){this.loggingService.catch("Error in DevicePermissionService openDevicePermissionDeniedDialog: ",r)}}};o.\u0275fac=function(t){return new(t||o)(ee(y),ee(io))},o.\u0275prov=Ae({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var R8e=()=>["video","screen"];function N8e(i,o){if(i&1&&w(0,"app-recording-preview-steps-dialog-video",4),i&2){let n=l(2);d("componentConfigSignal",n.componentConfigSignal)}}function F8e(i,o){if(i&1&&w(0,"app-recording-preview-steps-dialog-audio",4),i&2){let n=l(2);d("componentConfigSignal",n.componentConfigSignal)}}function L8e(i,o){if(i&1&&(f(0),_(1,"div",2,0),u(3,N8e,1,1,"app-recording-preview-steps-dialog-video",3)(4,F8e,1,1,"app-recording-preview-steps-dialog-audio",3),b(),v()),i&2){let n=o.ngIf,e=me(2),t=l();m(),d("snippylyOverlay",e)("snippylyOverlayZIndex",2e3),x("aria-label","Recording preview - "+n.type+" mode")("data-testid",t.componentId),m(2),d("ngIf",mt(6,R8e).includes(n.type)),m(),d("ngIf",n.type==="audio")}}var t9=(()=>{let o=class o{constructor(e,t,r,a,s,c,p){this.loggingService=e,this.recorderService=t,this.dialog=r,this.devicePermissionService=a,this.dialogRef=s,this.elementRef=c,this.data=p,this.darkMode=!1,this.shadowDom=!0,this.startCountdownFrom=3,this.defaultMediaSourceOptions=Nc(),this.recordingCountdownEnabled=!1,this.subscriptions=[],this.veltElement=!0,this.componentId="velt-recording-preview-steps-dialog",this.componentConfigSignal=Te({closeDialog:this.closeDialog.bind(this),startCountdown:this.startCountdown.bind(this),toggleAudio:this.toggleAudio.bind(this),toggleVideo:this.toggleVideo.bind(this),toggleSettings:this.toggleSettings.bind(this),cancelCountdown:this.cancelCountdown.bind(this),updateMediaConfig:this.updateMediaConfig.bind(this),handleOverlayClick:this.handleOverlayClick.bind(this),countdownStarted:!1,mediaConfig:{audio:{enabled:!1},video:{enabled:!1}},mediaState:{audio:{enabled:!1},video:{enabled:!1}},type:"video",countdown:this.startCountdownFrom,mediaStream:void 0,isSettingsOpen:!1,darkMode:this.darkMode,shadowDom:this.shadowDom});try{this.devicePermissionService.getPermissionState$("video").subscribe(g=>{this.componentConfigSignal.update(C=>(C=D(I({},C),{mediaState:D(I({},C.mediaState),{video:{enabled:g!=="denied"}})}),C))}),this.devicePermissionService.getPermissionState$("audio").subscribe(g=>{this.componentConfigSignal.update(C=>(C=D(I({},C),{mediaState:D(I({},C.mediaState),{audio:{enabled:g!=="denied"}})}),C))}),this.subscriptions.push(this.recorderService.getRecordingCountdownEnabled$().subscribe(g=>{this.recordingCountdownEnabled=g})),this.subscriptions.push(this.recorderService.getRecordingMicEnabled$().subscribe(g=>{g!==null&&(g?this.toggleAudioOn():this.toggleAudioOff())})),p&&(p.type&&this.componentConfigSignal.update(g=>(g=D(I({},g),{type:p.type}),g)),p.recordingCountdown!==void 0&&(this.recordingCountdownEnabled=!!p.recordingCountdown),p.mediaConfig&&(p.mediaConfig?.audio?.enabled&&!p.mediaConfig?.audio?.deviceId&&(p.mediaConfig.audio.deviceId=this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId),p.mediaConfig?.video?.enabled&&!p.mediaConfig?.video?.deviceId&&(p.mediaConfig.video.deviceId=this.defaultMediaSourceOptions?.selectedVideoDevice?.deviceId),p?.darkMode?this.elementRef.nativeElement.setAttribute("dark",""):this.elementRef.nativeElement.removeAttribute("dark"),this.componentConfigSignal.update(g=>(g=D(I({},g),{shadowDom:p?.shadowDom!==!1,darkMode:p.darkMode||!1}),g)),this.updateMediaConfig(p.mediaConfig)))}catch(g){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent constructor: ",g)}}ngOnInit(){try{this.setupA11yAttributes(),this.componentConfigSignal().type==="screen"&&this.subscriptions.push(this.recorderService.getScreenStream$().subscribe(e=>{e&&e.active&&e.getVideoTracks().some(t=>t.readyState==="live")&&this.componentConfigSignal.update(t=>(t=I({},t),t.mediaConfig.screen={enabled:!0,stream:e},t))}))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngOnInit:",e)}}setupA11yAttributes(){try{let e=this.elementRef.nativeElement;e.setAttribute("data-testid",this.componentId+"-container"),e.setAttribute("role","dialog"),e.setAttribute("aria-label","Recording preview steps dialog")}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent setupA11yAttributes:",e)}}ngOnChanges(e){try{e&&Object.keys(e).forEach(t=>{this.componentConfigSignal.update(r=>(r=D(I({},r),{[t]:e[t].currentValue}),r))})}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngOnChanges: ",t)}}ngAfterViewInit(){try{this.dialogRef.addPanelClass("snippyly-recording-preview-steps-dialog"),this.dialogRef.disableClose=!0}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngAfterViewInit: ",e)}}toggleSettings(e){try{e.stopPropagation(),this.componentConfigSignal.update(t=>(t=D(I({},t),{isSettingsOpen:!t.isSettingsOpen}),t))}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleSettings: ",t)}}toggleAudio(){try{this.componentConfigSignal().mediaConfig.audio||this.componentConfigSignal.update(r=>(r=D(I({},r),{mediaConfig:D(I({},r.mediaConfig),{audio:{enabled:!0}})}),r));let e=!this.componentConfigSignal().mediaConfig.audio?.enabled;this.componentConfigSignal.update(r=>(r=D(I({},r),{mediaConfig:D(I({},r.mediaConfig),{audio:{enabled:e}})}),r));let t=this.componentConfigSignal().mediaStream?.getAudioTracks()[0];t?t.enabled=e:e&&(this.componentConfigSignal.update(r=>(r=D(I({},r),{mediaConfig:D(I({},r.mediaConfig),{audio:D(I({},r.mediaConfig.audio),{deviceId:this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId})})}),r)),this.updateMediaConfig(this.componentConfigSignal().mediaConfig))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleAudio: ",e)}}toggleAudioOn(){try{this.componentConfigSignal.update(t=>(t=D(I({},t),{mediaConfig:D(I({},t.mediaConfig),{audio:{enabled:!0}})}),t));let e=this.componentConfigSignal().mediaStream?.getAudioTracks()[0];e?e.enabled=!0:(this.componentConfigSignal.update(t=>(t=D(I({},t),{mediaConfig:D(I({},t.mediaConfig),{audio:D(I({},t.mediaConfig.audio),{deviceId:this.defaultMediaSourceOptions?.selectedAudioDevice?.deviceId})})}),t)),this.updateMediaConfig(this.componentConfigSignal().mediaConfig))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleAudioOn: ",e)}}toggleAudioOff(){try{this.componentConfigSignal.update(t=>(t=D(I({},t),{mediaConfig:D(I({},t.mediaConfig),{audio:{enabled:!1}})}),t));let e=this.componentConfigSignal().mediaStream?.getAudioTracks()[0];e&&(e.enabled=!1)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleAudioOn: ",e)}}toggleVideo(){try{this.componentConfigSignal.update(e=>(e=I({},e),e.mediaConfig.video||(e.mediaConfig.video={enabled:!0}),e.mediaConfig.video.enabled=!e.mediaConfig.video.enabled,e.mediaConfig.video.deviceId=this.defaultMediaSourceOptions?.selectedVideoDevice?.deviceId,e)),this.updateMediaConfig(this.componentConfigSignal().mediaConfig)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent toggleVideo: ",e)}}updateMediaConfig(e){try{this.stopMediaStream(),this.getMediaStream(e)}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent updateMediaConfig: ",t)}}getMediaStream(e){try{if(!navigator.mediaDevices){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream: ","No media devices");return}if(!navigator.mediaDevices.getUserMedia){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream: ","No getUserMedia");return}if(e.audio?.enabled||e.video?.enabled){let t={};e.audio?.enabled&&(t.audio={deviceId:e.audio.deviceId}),e.video?.enabled&&(t.video={deviceId:e.video.deviceId}),navigator.mediaDevices.getUserMedia(t).then(r=>{this.componentConfigSignal.update(a=>(a=D(I({},a),{mediaConfig:e,mediaStream:r}),a))}).catch(r=>{this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream catch: ",r)})}else this.componentConfigSignal.update(t=>(t=D(I({},t),{mediaStream:void 0,mediaConfig:e}),t))}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent getMediaStream: ",t)}}stopMediaStream(){try{this.componentConfigSignal.update(e=>(e=I({},e),e.mediaStream?.getTracks().forEach(t=>{t.stop()}),e.mediaStream=void 0,e))}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent stopMediaStream: ",e)}}startCountdown(){return Q(this,null,function*(){try{let t=new Wn().getBrowserName()==="Firefox",r=null;if(t&&this.componentConfigSignal().type==="screen")try{let a=this.componentConfigSignal().mediaConfig,s={};a.audio?.enabled&&(s.audio={deviceId:a.audio?.deviceId}),a.video?.enabled&&(s.video={deviceId:a.video?.deviceId}),Object.keys(s).length>0&&(r=yield navigator.mediaDevices.getUserMedia(s))}catch(a){this.loggingService.catch("Error getting Firefox user media stream:",a),r=null}if(this.componentConfigSignal().type==="screen"){if(!this.componentConfigSignal().mediaConfig.screen?.stream)try{let s=yield navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0});this.componentConfigSignal.update(c=>(c=I({},c),c.mediaConfig.screen={enabled:!0,stream:s},c))}catch(s){this.loggingService.catch("Error getting screen media stream:",s),this.cancelCountdown();return}this.componentConfigSignal.update(s=>(s=I({},s),r&&(s.mediaConfig.audio?.enabled&&(s.mediaConfig.audio.stream=r),s.mediaConfig.video?.enabled&&(s.mediaConfig.video.stream=r)),s)),this.componentConfigSignal().mediaConfig.screen?.stream?.getTracks().forEach(s=>{s&&(s.onended=()=>{this.cancelCountdown()})})}this.recordingCountdownEnabled?(this.componentConfigSignal.update(a=>(a=D(I({},a),{countdownStarted:!0}),a)),this.countdownInterval=setInterval(()=>{this.componentConfigSignal().countdown>1?this.componentConfigSignal.update(a=>(a=D(I({},a),{countdown:a.countdown-1}),a)):this.closeDialog(this.componentConfigSignal().mediaConfig)},1e3)):this.closeDialog(this.componentConfigSignal().mediaConfig)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent startCountdown: ",e)}})}cancelCountdown(){try{if(this.componentConfigSignal.update(e=>(e=D(I({},e),{countdownStarted:!1,countdown:this.startCountdownFrom}),e)),this.clearInterval(),this.componentConfigSignal().type==="screen"){let e=this.componentConfigSignal().mediaConfig.screen?.stream;e&&e.getTracks().forEach(t=>{t.stop()}),this.componentConfigSignal.update(t=>(t=I({},t),t.mediaConfig.screen=void 0,t))}}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent cancelCountdown: ",e)}}closeDialog(e){return Q(this,null,function*(){try{this.clearInterval(),e||(this.stopMediaStream(),this.componentConfigSignal.update(t=>(t=I({},t),t.mediaConfig&&(t.mediaConfig.screen?.stream&&(t.mediaConfig.screen.stream.getTracks().forEach(r=>r.stop()),t.mediaConfig.screen.stream=void 0),t.mediaConfig.audio?.stream&&(t.mediaConfig.audio.stream.getTracks().forEach(r=>r.stop()),t.mediaConfig.audio.stream=void 0),t.mediaConfig.video?.stream&&(t.mediaConfig.video.stream.getTracks().forEach(r=>r.stop()),t.mediaConfig.video.stream=void 0)),t))),this.dialogRef.close(e)}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent closeDialog: ",t)}})}handleOverlayClick(e){try{this.componentConfigSignal.update(t=>(t=D(I({},t),{isSettingsOpen:!1}),t)),e.stopPropagation()}catch(t){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent handleOverlayClick: ",t)}}clearInterval(){try{this.countdownInterval&&(clearInterval(this.countdownInterval),this.countdownInterval=void 0)}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent clearInterval: ",e)}}ngOnDestroy(){try{this.clearInterval(),this.stopMediaStream(),this.subscriptions.forEach(e=>{e?.unsubscribe()})}catch(e){this.loggingService.catch("Error in RecordingPreviewStepsDialogComponent ngOnDestroy: ",e)}}};o.\u0275fac=function(t){return new(t||o)(h(y),h(_n),h(io),h(qd),h(rr),h(R),h(Nl,8))},o.\u0275cmp=O({type:o,selectors:[["snippyly-recording-preview-steps-dialog"]],hostVars:1,hostBindings:function(t,r){t&2&&x("data-velt-element",r.veltElement)},inputs:{darkMode:"darkMode",shadowDom:"shadowDom"},standalone:!1,features:[Ze],decls:1,vars:1,consts:[["recordingPreviewDialogRef",""],[4,"ngIf"],["role","dialog","aria-modal","true",3,"snippylyOverlay","snippylyOverlayZIndex"],[3,"componentConfigSignal",4,"ngIf"],[3,"componentConfigSignal"]],template:function(t,r){t&1&&u(0,L8e,5,7,"ng-container",1),t&2&&d("ngIf",r.componentConfigSignal())},styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}[_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-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-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.snippyly-recording-preview-steps-dialog{max-width:none} .velt-mat-dialog-container.snippyly-recording-preview-steps-dialog mat-dialog-container .mat-mdc-dialog-surface.mdc-dialog__surface{background:transparent;padding:0;margin:0;border-radius:var(--velt-border-radius-lg)}"],changeDetection:0});let i=o;return i})();var za=(()=>{let o=class o{constructor(e){this.loggingService=e,this.isPipActive$=new ve(!1),this.pipStopRecordingTriggered$=new ve(!1),this.pipPauseRecordingTriggered$=new ve(!1),this.pictureInPicture$=new ve(!1),this.pipClearRecordingTriggered$=new ve(!1)}getPipClearRecordingTriggered$(){return this.pipClearRecordingTriggered$.asObservable()}resetPipClearRecordingTriggered(){this.pipClearRecordingTriggered$.next(!1)}openPictureInPicture(e,t){return Q(this,null,function*(){try{if(!this.isPictureInPictureEnabled()||!e||document.pictureInPictureElement||window.documentPictureInPicture?.window)return;if("documentPictureInPicture"in window){yield this.createDocumentPip(e,t);return}if(document.pictureInPictureEnabled){let r=yield this.findVideoElement();if(!r){this.loggingService.warn("No video element found for Picture-in-Picture");return}yield r.requestPictureInPicture(),this.isPipActive$.next(!0);return}}catch(r){this.loggingService.catch("Error in PipService openPictureInPicture:",r)}})}createDocumentPip(e,t){return Q(this,null,function*(){try{let r=window.documentPictureInPicture;this.pipWindow=yield r.requestWindow({width:320,height:288}),yield this.addStylesToPip(),yield this.createControlPanelInPip(e,t),this.pipWindow?.addEventListener("unload",()=>{try{this.isPipActive$.next(!1),this.pipWindow=void 0}catch(a){this.loggingService.catch("Error in PipService createDocumentPip unload:",a)}}),this.isPipActive$.next(!0)}catch{this.isPipActive$.next(!1),this.pipWindow=void 0}})}addStylesToPip(){return Q(this,null,function*(){try{if(!this.pipWindow)return;this.pipWindow.document.body.style.margin="0",this.pipWindow.document.body.style.padding="0",this.pipWindow.document.body.style.backgroundColor="#000",this.pipWindow.document.body.style.display="flex",this.pipWindow.document.body.style.alignItems="center",this.pipWindow.document.body.style.justifyContent="center"}catch(e){this.loggingService.catch("Error in PipService copyStylesToPip:",e)}})}createControlPanelInPip(e,t){return Q(this,null,function*(){if(this.pipWindow)try{let r=this.pipWindow.document.createElement("div");r.style.cssText=`
|
|
383
383
|
display: flex;
|
|
384
384
|
flex-direction: column;
|
|
385
385
|
`;let a=this.pipWindow.document.createElement("div");a.style.cssText=`
|