@veltdev/sdk-dev 6.0.7 → 6.0.8-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/models/element/activity-element.model.d.ts +9 -0
- package/app/models/element/autocomplete-element.model.d.ts +10 -0
- package/app/models/element/comment-element.model.d.ts +94 -0
- package/app/models/element/notification-element.model.d.ts +17 -0
- package/{chunk-HGFGZISK.js → chunk-23NZV3J5.js} +1 -1
- package/{chunk-LTCLU4T3.js → chunk-24U4LEAT.js} +1 -1
- package/{chunk-YJ5BCVP3.js → chunk-33F6VZ2D.js} +1 -1
- package/{chunk-PLGVZJ6T.js → chunk-3XNLR5I6.js} +1 -1
- package/{chunk-GPTCITIB.js → chunk-52DNHP4V.js} +1 -1
- package/{chunk-N72BHERH.js → chunk-5YU74OX2.js} +1 -1
- package/{chunk-HS6LFYOH.js → chunk-7DVALKQ7.js} +1 -1
- package/chunk-7LUSUNI3.js +1 -0
- package/{chunk-ZFEUGJVC.js → chunk-ANVOXADQ.js} +1 -1
- package/chunk-BARZUD2Z.js +1 -0
- package/{chunk-KWXZADQY.js → chunk-CRZGZZVQ.js} +1 -1
- package/chunk-D2BOLY5Q.js +1 -0
- package/chunk-G4MWCI3H.js +193 -0
- package/{chunk-4FUBGV7B.js → chunk-H2PBKB34.js} +1 -1
- package/{chunk-PHNGEVKT.js → chunk-HNZ452CD.js} +1 -1
- package/{chunk-TBVR7DMN.js → chunk-I3U6YUMT.js} +1 -1
- package/{chunk-GDRY5OGH.js → chunk-IOANBPOF.js} +1 -1
- package/{chunk-Z6E2ZIIQ.js → chunk-KES24H7E.js} +1 -1
- package/chunk-KMCCIFJ3.js +93 -0
- package/{chunk-FRPQQ7DI.js → chunk-LFEKCFWQ.js} +1 -1
- package/chunk-LS3GLCPX.js +2 -0
- package/{chunk-2ZGVZZFS.js → chunk-MIANWP6R.js} +1 -1
- package/{chunk-2Q3745J2.js → chunk-MRNSRINQ.js} +1 -1
- package/chunk-N4APL3ZG.js +1 -0
- package/chunk-NCVN3JXT.js +6 -0
- package/{chunk-75Z7SIQI.js → chunk-OTEHXO3L.js} +1 -1
- package/{chunk-OXX7MHHB.js → chunk-QC3HLRNI.js} +1 -1
- package/chunk-QVPRXGEH.js +1 -0
- package/{chunk-BCDJ35DN.js → chunk-RTIZJ4JW.js} +1 -1
- package/{chunk-XVEAFTH3.js → chunk-T4CM6UKZ.js} +1 -1
- package/chunk-WNOKX7ML.js +1 -0
- package/{chunk-2WE6CG7F.js → chunk-WNW7AS77.js} +1 -1
- package/{chunk-7UFH2MQ5.js → chunk-Y6KJEASI.js} +1 -1
- package/package.json +1 -1
- package/velt-activity-log.js +1 -1
- package/velt-area.js +1 -1
- package/velt-arrow.js +2 -2
- package/velt-comment.js +7 -7
- package/velt-crdt.js +1 -1
- package/velt-cursor.js +2 -2
- package/velt-huddle.js +2 -2
- package/velt-live-state-sync.js +2 -2
- package/velt-notification.js +1 -1
- package/velt-presence.js +1 -1
- package/velt-reaction.js +1 -1
- package/velt-recorder.js +1 -1
- package/velt-rewriter.js +2 -2
- package/velt-selection.js +1 -1
- package/velt-tag.js +1 -1
- package/velt-user-invite.js +2 -2
- package/velt-user-request.js +1 -1
- package/velt-video-player.js +1 -1
- package/velt-views.js +2 -2
- package/velt.js +5 -5
- package/chunk-5CFN76GI.js +0 -193
- package/chunk-6VMBIKMK.js +0 -6
- package/chunk-DF5SLQUS.js +0 -1
- package/chunk-DZB424JF.js +0 -2
- package/chunk-FJ6CN2HK.js +0 -1
- package/chunk-FR7BEDQT.js +0 -1
- package/chunk-HVJ4WKTL.js +0 -93
- package/chunk-O6NHFZMD.js +0 -1
- package/chunk-PB5PWSQS.js +0 -1
- package/chunk-XJT64ZXP.js +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{$ as y,Ab as In,Ai as jn,Bb as Dn,Bc as kt,Be as S,Cf as O,Ch as Mt,D as bt,Db as Ot,Dc as An,E as D,Eb as wt,Ee as je,F as St,Fa as gn,Fb as At,Ff as Ln,Fi as Nt,G as di,Ga as z,Gi as $n,Ha as N,I as It,Ia as se,J as ne,Jb as En,Kb as tt,L as oe,La as Se,M as rn,Na as ae,Oa as Le,P as sn,Pa as Z,Pi as Hn,Q as an,Ra as Ne,S as be,Sa as ui,Sd as kn,T as v,Td as Rn,Te as xn,U as he,Ua as W,Ue as Mn,Uh as nt,V as cn,Va as U,Vf as Nn,W as J,Wa as F,Y as ln,Ya as Y,Yc as H,Za as mn,Zc as Rt,Ze as Pn,_ as dn,_a as Et,_b as Be,a as p,aa as L,b as B,ba as A,bb as Ue,be as Tn,ca as R,da as h,db as fe,fa as Pe,g as j,h as Q,i as Ce,ii as Pt,j as tn,ji as zn,k as _,ki as te,l as b,la as E,li as $e,ma as P,mb as _n,n as nn,na as hn,nb as vn,nh as mi,o as on,oe as it,pa as Fe,pb as yn,pg as Un,q as vt,qa as $,qb as Cn,qh as xt,qi as Vn,r as g,rb as bn,rc as On,rf as Fn,s as yt,sa as un,sc as pi,sh as Bn,ta as fn,tc as ze,ti as Ft,ua as re,ue as Tt,uf as gi,ui as Ie,v as C,va as ue,vi as He,w as et,wa as k,wb as fi,wi as De,x as Ct,xa as hi,xb as Sn,xc as Ve,xi as Lt,ya as pn,yc as wn,za as Dt,zc as ee,zi as T}from"./chunk-CRZGZZVQ.js";function ce(n,i=0){return Gn(n)?Number(n):arguments.length===2?i:0}function Gn(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}function Ee(n){return n instanceof k?n.nativeElement:n}var er=new A("cdk-dir-doc",{providedIn:"root",factory:tr});function tr(){return h(P)}var ir=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function Wn(n){let i=n?.toLowerCase()||"";return i==="auto"&&typeof navigator<"u"&&navigator?.language?ir.test(navigator.language)?"rtl":"ltr":i==="rtl"?"rtl":"ltr"}var le=(()=>{class n{get value(){return this.valueSignal()}valueSignal=$("ltr");change=new z;constructor(){let e=h(er,{optional:!0});if(e){let t=e.body?e.body.dir:null,o=e.documentElement?e.documentElement.dir:null;this.valueSignal.set(Wn(t||o||"ltr"))}}ngOnDestroy(){this.change.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var q=(function(n){return n[n.NORMAL=0]="NORMAL",n[n.NEGATED=1]="NEGATED",n[n.INVERTED=2]="INVERTED",n})(q||{}),Ut,Oe;function Bt(){if(Oe==null){if(typeof document!="object"||!document||typeof Element!="function"||!Element)return Oe=!1,Oe;if(document.documentElement?.style&&"scrollBehavior"in document.documentElement.style)Oe=!0;else{let n=Element.prototype.scrollTo;n?Oe=!/\{\s*\[native code\]\s*\}/.test(n.toString()):Oe=!1}}return Oe}function Ge(){if(typeof document!="object"||!document)return q.NORMAL;if(Ut==null){let n=document.createElement("div"),i=n.style;n.dir="rtl",i.width="1px",i.overflow="auto",i.visibility="hidden",i.pointerEvents="none",i.position="absolute";let e=document.createElement("div"),t=e.style;t.width="2px",t.height="1px",n.appendChild(e),document.body.appendChild(n),Ut=q.NORMAL,n.scrollLeft===0&&(n.scrollLeft=1,Ut=n.scrollLeft===0?q.NEGATED:q.INVERTED),n.remove()}return Ut}var pe=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=U({type:n});static \u0275inj=L({})}return n})();var zt=class{};function Yn(n){return n&&typeof n.connect=="function"&&!(n instanceof tn)}var Vt=class extends zt{_data;constructor(i){super(),this._data=i}connect(){return yt(this._data)?this._data:g(this._data)}disconnect(){}},ot=(function(n){return n[n.REPLACED=0]="REPLACED",n[n.INSERTED=1]="INSERTED",n[n.MOVED=2]="MOVED",n[n.REMOVED=3]="REMOVED",n})(ot||{}),_i=new A("_ViewRepeater"),jt=class{viewCacheSize=20;_viewCache=[];applyChanges(i,e,t,o,r){i.forEachOperation((s,a,c)=>{let d,l;if(s.previousIndex==null){let u=()=>t(s,a,c);d=this._insertView(u,c,e,o(s)),l=d?ot.INSERTED:ot.REPLACED}else c==null?(this._detachAndCacheView(a,e),l=ot.REMOVED):(d=this._moveView(a,c,e,o(s)),l=ot.MOVED);r&&r({context:d?.context,operation:l,record:s})})}detach(){for(let i of this._viewCache)i.destroy();this._viewCache=[]}_insertView(i,e,t,o){let r=this._insertViewFromCache(e,t);if(r){r.context.$implicit=o;return}let s=i();return t.createEmbeddedView(s.templateRef,s.context,s.index)}_detachAndCacheView(i,e){let t=e.detach(i);this._maybeCacheView(t,e)}_moveView(i,e,t,o){let r=t.get(i);return t.move(r,e),r.context.$implicit=o,r}_maybeCacheView(i,e){if(this._viewCache.length<this.viewCacheSize)this._viewCache.push(i);else{let t=e.indexOf(i);t===-1?i.destroy():e.remove(t)}}_insertViewFromCache(i,e){let t=this._viewCache.pop();return t&&e.insert(t,i),t||null}};var nr=["contentWrapper"],or=["*"],Zn=new A("VIRTUAL_SCROLL_STRATEGY"),vi=class{_scrolledIndexChange=new _;scrolledIndexChange=this._scrolledIndexChange.pipe(oe());_viewport=null;_itemSize;_minBufferPx;_maxBufferPx;constructor(i,e,t){this._itemSize=i,this._minBufferPx=e,this._maxBufferPx=t}attach(i){this._viewport=i,this._updateTotalContentSize(),this._updateRenderedRange()}detach(){this._scrolledIndexChange.complete(),this._viewport=null}updateItemAndBufferSize(i,e,t){t<e,this._itemSize=i,this._minBufferPx=e,this._maxBufferPx=t,this._updateTotalContentSize(),this._updateRenderedRange()}onContentScrolled(){this._updateRenderedRange()}onDataLengthChanged(){this._updateTotalContentSize(),this._updateRenderedRange()}onContentRendered(){}onRenderedOffsetChanged(){}scrollToIndex(i,e){this._viewport&&this._viewport.scrollToOffset(i*this._itemSize,e)}_updateTotalContentSize(){this._viewport&&this._viewport.setTotalContentSize(this._viewport.getDataLength()*this._itemSize)}_updateRenderedRange(){if(!this._viewport)return;let i=this._viewport.getRenderedRange(),e={start:i.start,end:i.end},t=this._viewport.getViewportSize(),o=this._viewport.getDataLength(),r=this._viewport.measureScrollOffset(),s=this._itemSize>0?r/this._itemSize:0;if(e.end>o){let c=Math.ceil(t/this._itemSize),d=Math.max(0,Math.min(s,o-c));s!=d&&(s=d,r=d*this._itemSize,e.start=Math.floor(s)),e.end=Math.max(0,Math.min(o,e.start+c))}let a=r-e.start*this._itemSize;if(a<this._minBufferPx&&e.start!=0){let c=Math.ceil((this._maxBufferPx-a)/this._itemSize);e.start=Math.max(0,e.start-c),e.end=Math.min(o,Math.ceil(s+(t+this._minBufferPx)/this._itemSize))}else{let c=e.end*this._itemSize-(r+t);if(c<this._minBufferPx&&e.end!=o){let d=Math.ceil((this._maxBufferPx-c)/this._itemSize);d>0&&(e.end=Math.min(o,e.end+d),e.start=Math.max(0,Math.floor(s-this._minBufferPx/this._itemSize)))}}this._viewport.setRenderedRange(e),this._viewport.setRenderedContentOffset(Math.round(this._itemSize*e.start)),this._scrolledIndexChange.next(Math.floor(s))}};function rr(n){return n._scrollStrategy}var sr=(()=>{class n{get itemSize(){return this._itemSize}set itemSize(e){this._itemSize=ce(e)}_itemSize=20;get minBufferPx(){return this._minBufferPx}set minBufferPx(e){this._minBufferPx=ce(e)}_minBufferPx=100;get maxBufferPx(){return this._maxBufferPx}set maxBufferPx(e){this._maxBufferPx=ce(e)}_maxBufferPx=200;_scrollStrategy=new vi(this.itemSize,this.minBufferPx,this.maxBufferPx);ngOnChanges(){this._scrollStrategy.updateItemAndBufferSize(this.itemSize,this.minBufferPx,this.maxBufferPx)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=F({type:n,selectors:[["cdk-virtual-scroll-viewport","itemSize",""]],inputs:{itemSize:"itemSize",minBufferPx:"minBufferPx",maxBufferPx:"maxBufferPx"},features:[Be([{provide:Zn,useFactory:rr,deps:[dn(()=>n)]}]),re]})}return n})(),ar=20,rt=(()=>{class n{_ngZone=h(N);_platform=h(H);_renderer=h(ae).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new _;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let t=this.scrollContainers.get(e);t&&(t.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=ar){return this._platform.isBrowser?new Ce(t=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let o=e>0?this._scrolled.pipe(St(e)).subscribe(t):this._scrolled.subscribe(t);return this._scrolledCount++,()=>{o.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):g()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,t)=>this.deregister(t)),this._scrolled.complete()}ancestorScrolled(e,t){let o=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(D(r=>!r||o.indexOf(r)>-1))}getAncestorScrollContainers(e){let t=[];return this.scrollContainers.forEach((o,r)=>{this._scrollableContainsElement(r,e)&&t.push(r)}),t}_scrollableContainsElement(e,t){let o=Ee(t),r=e.getElementRef().nativeElement;do if(o==r)return!0;while(o=o.parentElement);return!1}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),st=(()=>{class n{elementRef=h(k);scrollDispatcher=h(rt);ngZone=h(N);dir=h(le,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new _;_renderer=h(Le);_cleanupScroll;_elementScrolled=new _;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){let t=this.elementRef.nativeElement,o=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=o?e.end:e.start),e.right==null&&(e.right=o?e.start:e.end),e.bottom!=null&&(e.top=t.scrollHeight-t.clientHeight-e.bottom),o&&Ge()!=q.NORMAL?(e.left!=null&&(e.right=t.scrollWidth-t.clientWidth-e.left),Ge()==q.INVERTED?e.left=e.right:Ge()==q.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=t.scrollWidth-t.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let t=this.elementRef.nativeElement;Bt()?t.scrollTo(e):(e.top!=null&&(t.scrollTop=e.top),e.left!=null&&(t.scrollLeft=e.left))}measureScrollOffset(e){let t="left",o="right",r=this.elementRef.nativeElement;if(e=="top")return r.scrollTop;if(e=="bottom")return r.scrollHeight-r.clientHeight-r.scrollTop;let s=this.dir&&this.dir.value=="rtl";return e=="start"?e=s?o:t:e=="end"&&(e=s?t:o),s&&Ge()==q.INVERTED?e==t?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:s&&Ge()==q.NEGATED?e==t?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==t?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(t){return new(t||n)};static \u0275dir=F({type:n,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return n})(),cr=20,we=(()=>{class n{_platform=h(H);_listeners;_viewportSize;_change=new _;_document=h(P);constructor(){let e=h(N),t=h(ae).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let o=r=>this._change.next(r);this._listeners=[t.listen("window","resize",o),t.listen("window","orientationchange",o)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:t,height:o}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+o,right:e.left+t,height:o,width:t}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,t=this._getWindow(),o=e.documentElement,r=o.getBoundingClientRect(),s=-r.top||e.body.scrollTop||t.scrollY||o.scrollTop||0,a=-r.left||e.body.scrollLeft||t.scrollX||o.scrollLeft||0;return{top:s,left:a}}change(e=cr){return e>0?this._change.pipe(St(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Xn=new A("VIRTUAL_SCROLLABLE"),lr=(()=>{class n extends st{constructor(){super()}measureViewportSize(e){let t=this.elementRef.nativeElement;return e==="horizontal"?t.clientWidth:t.clientHeight}static \u0275fac=function(t){return new(t||n)};static \u0275dir=F({type:n,features:[Y]})}return n})();function dr(n,i){return n.start==i.start&&n.end==i.end}var hr=typeof requestAnimationFrame<"u"?on:nn,Qn=(()=>{class n extends lr{elementRef=h(k);_changeDetectorRef=h(Ve);_scrollStrategy=h(Zn,{optional:!0});scrollable=h(Xn,{optional:!0});_platform=h(H);_detachedSubject=new _;_renderedRangeSubject=new _;get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this._calculateSpacerSize())}_orientation="vertical";appendOnly=!1;scrolledIndexChange=new Ce(e=>this._scrollStrategy.scrolledIndexChange.subscribe(t=>Promise.resolve().then(()=>this.ngZone.run(()=>e.next(t)))));_contentWrapper;renderedRangeStream=this._renderedRangeSubject;_totalContentSize=0;_totalContentWidth=$("");_totalContentHeight=$("");_renderedContentTransform;_renderedRange={start:0,end:0};_dataLength=0;_viewportSize=0;_forOf;_renderedContentOffset=0;_renderedContentOffsetNeedsRewrite=!1;_changeDetectionNeeded=$(!1);_runAfterChangeDetection=[];_viewportChanges=Q.EMPTY;_injector=h(E);_isDestroyed=!1;constructor(){super();let e=h(we);this._scrollStrategy,this._viewportChanges=e.change().subscribe(()=>{this.checkViewportSize()}),this.scrollable||(this.elementRef.nativeElement.classList.add("cdk-virtual-scrollable"),this.scrollable=this);let t=ze(()=>{this._changeDetectionNeeded()&&this._doChangeDetection()},{injector:h(Ue).injector});h(hn).onDestroy(()=>{t.destroy()})}ngOnInit(){this._platform.isBrowser&&(this.scrollable===this&&super.ngOnInit(),this.ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>{this._measureViewportSize(),this._scrollStrategy.attach(this),this.scrollable.elementScrolled().pipe(be(null),St(0,hr),he(this._destroyed)).subscribe(()=>this._scrollStrategy.onContentScrolled()),this._markChangeDetectionNeeded()})))}ngOnDestroy(){this.detach(),this._scrollStrategy.detach(),this._renderedRangeSubject.complete(),this._detachedSubject.complete(),this._viewportChanges.unsubscribe(),this._isDestroyed=!0,super.ngOnDestroy()}attach(e){this._forOf,this.ngZone.runOutsideAngular(()=>{this._forOf=e,this._forOf.dataStream.pipe(he(this._detachedSubject)).subscribe(t=>{let o=t.length;o!==this._dataLength&&(this._dataLength=o,this._scrollStrategy.onDataLengthChanged()),this._doChangeDetection()})})}detach(){this._forOf=null,this._detachedSubject.next()}getDataLength(){return this._dataLength}getViewportSize(){return this._viewportSize}getRenderedRange(){return this._renderedRange}measureBoundingClientRectWithScrollOffset(e){return this.getElementRef().nativeElement.getBoundingClientRect()[e]}setTotalContentSize(e){this._totalContentSize!==e&&(this._totalContentSize=e,this._calculateSpacerSize(),this._markChangeDetectionNeeded())}setRenderedRange(e){dr(this._renderedRange,e)||(this.appendOnly&&(e={start:0,end:Math.max(this._renderedRange.end,e.end)}),this._renderedRangeSubject.next(this._renderedRange=e),this._markChangeDetectionNeeded(()=>this._scrollStrategy.onContentRendered()))}getOffsetToRenderedContentStart(){return this._renderedContentOffsetNeedsRewrite?null:this._renderedContentOffset}setRenderedContentOffset(e,t="to-start"){e=this.appendOnly&&t==="to-start"?0:e;let o=this.dir&&this.dir.value=="rtl",r=this.orientation=="horizontal",s=r?"X":"Y",c=`translate${s}(${Number((r&&o?-1:1)*e)}px)`;this._renderedContentOffset=e,t==="to-end"&&(c+=` translate${s}(-100%)`,this._renderedContentOffsetNeedsRewrite=!0),this._renderedContentTransform!=c&&(this._renderedContentTransform=c,this._markChangeDetectionNeeded(()=>{this._renderedContentOffsetNeedsRewrite?(this._renderedContentOffset-=this.measureRenderedContentSize(),this._renderedContentOffsetNeedsRewrite=!1,this.setRenderedContentOffset(this._renderedContentOffset)):this._scrollStrategy.onRenderedOffsetChanged()}))}scrollToOffset(e,t="auto"){let o={behavior:t};this.orientation==="horizontal"?o.start=e:o.top=e,this.scrollable.scrollTo(o)}scrollToIndex(e,t="auto"){this._scrollStrategy.scrollToIndex(e,t)}measureScrollOffset(e){let t;return this.scrollable==this?t=o=>super.measureScrollOffset(o):t=o=>this.scrollable.measureScrollOffset(o),Math.max(0,t(e??(this.orientation==="horizontal"?"start":"top"))-this.measureViewportOffset())}measureViewportOffset(e){let t,o="left",r="right",s=this.dir?.value=="rtl";e=="start"?t=s?r:o:e=="end"?t=s?o:r:e?t=e:t=this.orientation==="horizontal"?"left":"top";let a=this.scrollable.measureBoundingClientRectWithScrollOffset(t);return this.elementRef.nativeElement.getBoundingClientRect()[t]-a}measureRenderedContentSize(){let e=this._contentWrapper.nativeElement;return this.orientation==="horizontal"?e.offsetWidth:e.offsetHeight}measureRangeSize(e){return this._forOf?this._forOf.measureRangeSize(e,this.orientation):0}checkViewportSize(){this._measureViewportSize(),this._scrollStrategy.onDataLengthChanged()}_measureViewportSize(){this._viewportSize=this.scrollable.measureViewportSize(this.orientation)}_markChangeDetectionNeeded(e){e&&this._runAfterChangeDetection.push(e),!On(this._changeDetectionNeeded)&&this.ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this.ngZone.run(()=>{this._changeDetectionNeeded.set(!0)})})})}_doChangeDetection(){this._isDestroyed||this.ngZone.run(()=>{this._changeDetectorRef.markForCheck(),this._contentWrapper.nativeElement.style.transform=this._renderedContentTransform,se(()=>{this._changeDetectionNeeded.set(!1);let e=this._runAfterChangeDetection;this._runAfterChangeDetection=[];for(let t of e)t()},{injector:this._injector})})}_calculateSpacerSize(){this._totalContentHeight.set(this.orientation==="horizontal"?"":`${this._totalContentSize}px`),this._totalContentWidth.set(this.orientation==="horizontal"?`${this._totalContentSize}px`:"")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["cdk-virtual-scroll-viewport"]],viewQuery:function(t,o){if(t&1&&Ot(nr,7),t&2){let r;wt(r=At())&&(o._contentWrapper=r.first)}},hostAttrs:[1,"cdk-virtual-scroll-viewport"],hostVars:4,hostBindings:function(t,o){t&2&&tt("cdk-virtual-scroll-orientation-horizontal",o.orientation==="horizontal")("cdk-virtual-scroll-orientation-vertical",o.orientation!=="horizontal")},inputs:{orientation:"orientation",appendOnly:[2,"appendOnly","appendOnly",ee]},outputs:{scrolledIndexChange:"scrolledIndexChange"},features:[Be([{provide:st,useFactory:(e,t)=>e||t,deps:[[new fn,new un(Xn)],n]}]),Y],ngContentSelectors:or,decls:4,vars:4,consts:[["contentWrapper",""],[1,"cdk-virtual-scroll-content-wrapper"],[1,"cdk-virtual-scroll-spacer"]],template:function(t,o){t&1&&(In(),yn(0,"div",1,0),Dn(2),Cn(),bn(3,"div",2)),t&2&&(gn(3),En("width",o._totalContentWidth())("height",o._totalContentHeight()))},styles:[`cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}
|
|
2
|
+
`],encapsulation:2,changeDetection:0})}return n})();function Kn(n,i,e){let t=e;if(!t.getBoundingClientRect)return 0;let o=t.getBoundingClientRect();return n==="horizontal"?i==="start"?o.left:o.right:i==="start"?o.top:o.bottom}var ur=(()=>{class n{_viewContainerRef=h(Ne);_template=h(Se);_differs=h(wn);_viewRepeater=h(_i);_viewport=h(Qn,{skipSelf:!0});viewChange=new _;_dataSourceChanges=new _;get cdkVirtualForOf(){return this._cdkVirtualForOf}set cdkVirtualForOf(e){this._cdkVirtualForOf=e,Yn(e)?this._dataSourceChanges.next(e):this._dataSourceChanges.next(new Vt(yt(e)?e:Array.from(e||[])))}_cdkVirtualForOf;get cdkVirtualForTrackBy(){return this._cdkVirtualForTrackBy}set cdkVirtualForTrackBy(e){this._needsUpdate=!0,this._cdkVirtualForTrackBy=e?(t,o)=>e(t+(this._renderedRange?this._renderedRange.start:0),o):void 0}_cdkVirtualForTrackBy;set cdkVirtualForTemplate(e){e&&(this._needsUpdate=!0,this._template=e)}get cdkVirtualForTemplateCacheSize(){return this._viewRepeater.viewCacheSize}set cdkVirtualForTemplateCacheSize(e){this._viewRepeater.viewCacheSize=ce(e)}dataStream=this._dataSourceChanges.pipe(be(null),rn(),v(([e,t])=>this._changeDataSource(e,t)),sn(1));_differ=null;_data;_renderedItems;_renderedRange;_needsUpdate=!1;_destroyed=new _;constructor(){let e=h(N);this.dataStream.subscribe(t=>{this._data=t,this._onRenderedDataChange()}),this._viewport.renderedRangeStream.pipe(he(this._destroyed)).subscribe(t=>{this._renderedRange=t,this.viewChange.observers.length&&e.run(()=>this.viewChange.next(this._renderedRange)),this._onRenderedDataChange()}),this._viewport.attach(this)}measureRangeSize(e,t){if(e.start>=e.end)return 0;e.start<this._renderedRange.start||e.end>this._renderedRange.end;let o=e.start-this._renderedRange.start,r=e.end-e.start,s,a;for(let c=0;c<r;c++){let d=this._viewContainerRef.get(c+o);if(d&&d.rootNodes.length){s=a=d.rootNodes[0];break}}for(let c=r-1;c>-1;c--){let d=this._viewContainerRef.get(c+o);if(d&&d.rootNodes.length){a=d.rootNodes[d.rootNodes.length-1];break}}return s&&a?Kn(t,"end",a)-Kn(t,"start",s):0}ngDoCheck(){if(this._differ&&this._needsUpdate){let e=this._differ.diff(this._renderedItems);e?this._applyChanges(e):this._updateContext(),this._needsUpdate=!1}}ngOnDestroy(){this._viewport.detach(),this._dataSourceChanges.next(void 0),this._dataSourceChanges.complete(),this.viewChange.complete(),this._destroyed.next(),this._destroyed.complete(),this._viewRepeater.detach()}_onRenderedDataChange(){this._renderedRange&&(this._renderedItems=this._data.slice(this._renderedRange.start,this._renderedRange.end),this._differ||(this._differ=this._differs.find(this._renderedItems).create((e,t)=>this.cdkVirtualForTrackBy?this.cdkVirtualForTrackBy(e,t):t)),this._needsUpdate=!0)}_changeDataSource(e,t){return e&&e.disconnect(this),this._needsUpdate=!0,t?t.connect(this):g()}_updateContext(){let e=this._data.length,t=this._viewContainerRef.length;for(;t--;){let o=this._viewContainerRef.get(t);o.context.index=this._renderedRange.start+t,o.context.count=e,this._updateComputedContextProperties(o.context),o.detectChanges()}}_applyChanges(e){this._viewRepeater.applyChanges(e,this._viewContainerRef,(r,s,a)=>this._getEmbeddedViewArgs(r,a),r=>r.item),e.forEachIdentityChange(r=>{let s=this._viewContainerRef.get(r.currentIndex);s.context.$implicit=r.item});let t=this._data.length,o=this._viewContainerRef.length;for(;o--;){let r=this._viewContainerRef.get(o);r.context.index=this._renderedRange.start+o,r.context.count=t,this._updateComputedContextProperties(r.context)}}_updateComputedContextProperties(e){e.first=e.index===0,e.last=e.index===e.count-1,e.even=e.index%2===0,e.odd=!e.even}_getEmbeddedViewArgs(e,t){return{templateRef:this._template,context:{$implicit:e.item,cdkVirtualForOf:this._cdkVirtualForOf,index:-1,count:-1,first:!1,last:!1,odd:!1,even:!1},index:t}}static ngTemplateContextGuard(e,t){return!0}static \u0275fac=function(t){return new(t||n)};static \u0275dir=F({type:n,selectors:[["","cdkVirtualFor","","cdkVirtualForOf",""]],inputs:{cdkVirtualForOf:"cdkVirtualForOf",cdkVirtualForTrackBy:"cdkVirtualForTrackBy",cdkVirtualForTemplate:"cdkVirtualForTemplate",cdkVirtualForTemplateCacheSize:"cdkVirtualForTemplateCacheSize"},features:[Be([{provide:_i,useClass:jt}])]})}return n})();var yi=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=U({type:n});static \u0275inj=L({})}return n})(),Ci=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=U({type:n});static \u0275inj=L({imports:[pe,yi,pe,yi]})}return n})();var at=class{_attachedHost;attach(i){return this._attachedHost=i,i.attach(this)}detach(){let i=this._attachedHost;i!=null&&(this._attachedHost=null,i.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(i){this._attachedHost=i}},We=class extends at{component;viewContainerRef;injector;projectableNodes;constructor(i,e,t,o){super(),this.component=i,this.viewContainerRef=e,this.injector=t,this.projectableNodes=o}},Ae=class extends at{templateRef;viewContainerRef;context;injector;constructor(i,e,t,o){super(),this.templateRef=i,this.viewContainerRef=e,this.context=t,this.injector=o}get origin(){return this.templateRef.elementRef}attach(i,e=this.context){return this.context=e,super.attach(i)}detach(){return this.context=void 0,super.detach()}},bi=class extends at{element;constructor(i){super(),this.element=i instanceof k?i.nativeElement:i}},Ye=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(i){if(i instanceof We)return this._attachedPortal=i,this.attachComponentPortal(i);if(i instanceof Ae)return this._attachedPortal=i,this.attachTemplatePortal(i);if(this.attachDomPortal&&i instanceof bi)return this._attachedPortal=i,this.attachDomPortal(i)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(i){this._disposeFn=i}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},$t=class extends Ye{outletElement;_appRef;_defaultInjector;constructor(i,e,t){super(),this.outletElement=i,this._appRef=e,this._defaultInjector=t}attachComponentPortal(i){let e;if(i.viewContainerRef){let t=i.injector||i.viewContainerRef.injector,o=t.get(ui,null,{optional:!0})||void 0;e=i.viewContainerRef.createComponent(i.component,{index:i.viewContainerRef.length,injector:t,ngModuleRef:o,projectableNodes:i.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let t=this._appRef,o=i.injector||this._defaultInjector||E.NULL,r=o.get(Pe,t.injector);e=kt(i.component,{elementInjector:o,environmentInjector:r,projectableNodes:i.projectableNodes||void 0}),t.attachView(e.hostView),this.setDisposeFn(()=>{t.viewCount>0&&t.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=i,e}attachTemplatePortal(i){let e=i.viewContainerRef,t=e.createEmbeddedView(i.templateRef,i.context,{injector:i.injector});return t.rootNodes.forEach(o=>this.outletElement.appendChild(o)),t.detectChanges(),this.setDisposeFn(()=>{let o=e.indexOf(t);o!==-1&&e.remove(o)}),this._attachedPortal=i,t}attachDomPortal=i=>{let e=i.element;e.parentNode;let t=this.outletElement.ownerDocument.createComment("dom-portal");e.parentNode.insertBefore(t,e),this.outletElement.appendChild(e),this._attachedPortal=i,super.setDisposeFn(()=>{t.parentNode&&t.parentNode.replaceChild(e,t)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(i){return i.hostView.rootNodes[0]}};var ct=(()=>{class n extends Ye{_moduleRef=h(ui,{optional:!0});_document=h(P);_viewContainerRef=h(Ne);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}attached=new z;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let t=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,o=t.createComponent(e.component,{index:t.length,injector:e.injector||t.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return t!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=e,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(e){e.setAttachedHost(this);let t=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=t,this.attached.emit(t),t}attachDomPortal=e=>{let t=e.element;t.parentNode;let o=this._document.createComment("dom-portal");e.setAttachedHost(this),t.parentNode.insertBefore(o,t),this._getRootNode().appendChild(t),this._attachedPortal=e,super.setDisposeFn(()=>{o.parentNode&&o.parentNode.replaceChild(t,o)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(t){return new(t||n)};static \u0275dir=F({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[Y]})}return n})();var ke=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=U({type:n});static \u0275inj=L({})}return n})();var Si;function pr(){if(Si==null){let n=typeof document<"u"?document.head:null;Si=!!(n&&(n.createShadowRoot||n.attachShadow))}return Si}function qn(n){if(pr()){let i=n.getRootNode?n.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&i instanceof ShadowRoot)return i}return null}function Ht(){let n=typeof document<"u"&&document?document.activeElement:null;for(;n&&n.shadowRoot;){let i=n.shadowRoot.activeElement;if(i===n)break;n=i}return n}function ie(n){return n.composedPath?n.composedPath()[0]:n.target}function Ii(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}var Gt=new WeakMap,Xe=(()=>{class n{_appRef;_injector=h(E);_environmentInjector=h(Pe);load(e){let t=this._appRef=this._appRef||this._injector.get(Ue),o=Gt.get(t);o||(o={loaders:new Set,refs:[]},Gt.set(t,o),t.onDestroy(()=>{Gt.get(t)?.refs.forEach(r=>r.destroy()),Gt.delete(t)})),o.loaders.has(e)||(o.loaders.add(e),o.refs.push(kt(e,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function x(n){return n==null?"":typeof n=="string"?n:`${n}px`}var Di={},ge=(()=>{class n{_appId=h(pn);getId(e){return this._appId!=="ng"&&(e+=this._appId),Di.hasOwnProperty(e)||(Di[e]=0),`${e}${Di[e]++}`}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function me(n,...i){return i.length?i.some(e=>n[e]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}var Jn=Bt();function Ze(n){return new Wt(n.get(we),n.get(P))}var Wt=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(i,e){this._viewportRuler=i,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let i=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=i.style.left||"",this._previousHTMLStyles.top=i.style.top||"",i.style.left=x(-this._previousScrollPosition.left),i.style.top=x(-this._previousScrollPosition.top),i.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let i=this._document.documentElement,e=this._document.body,t=i.style,o=e.style,r=t.scrollBehavior||"",s=o.scrollBehavior||"";this._isEnabled=!1,t.left=this._previousHTMLStyles.left,t.top=this._previousHTMLStyles.top,i.classList.remove("cdk-global-scrollblock"),Jn&&(t.scrollBehavior=o.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Jn&&(t.scrollBehavior=r,o.scrollBehavior=s)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,t=this._viewportRuler.getViewportSize();return e.scrollHeight>t.height||e.scrollWidth>t.width}};function so(n,i){return new Yt(n.get(rt),n.get(N),n.get(we),i)}var Yt=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(i,e,t,o){this._scrollDispatcher=i,this._ngZone=e,this._viewportRuler=t,this._config=o}attach(i){this._overlayRef,this._overlayRef=i}enable(){if(this._scrollSubscription)return;let i=this._scrollDispatcher.scrolled(0).pipe(D(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=i.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=i.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}};var lt=class{enable(){}disable(){}attach(){}};function Ei(n,i){return i.some(e=>{let t=n.bottom<e.top,o=n.top>e.bottom,r=n.right<e.left,s=n.left>e.right;return t||o||r||s})}function eo(n,i){return i.some(e=>{let t=n.top<e.top,o=n.bottom>e.bottom,r=n.left<e.left,s=n.right>e.right;return t||o||r||s})}function qt(n,i){return new Xt(n.get(rt),n.get(we),n.get(N),i)}var Xt=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(i,e,t,o){this._scrollDispatcher=i,this._viewportRuler=e,this._ngZone=t,this._config=o}attach(i){this._overlayRef,this._overlayRef=i}enable(){if(!this._scrollSubscription){let i=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(i).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:t,height:o}=this._viewportRuler.getViewportSize();Ei(e,[{width:t,height:o,bottom:o,right:t,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},ao=(()=>{class n{_injector=h(E);constructor(){}noop=()=>new lt;close=e=>so(this._injector,e);block=()=>Ze(this._injector);reposition=e=>qt(this._injector,e);static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Te=class{positionStrategy;scrollStrategy=new lt;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(i){if(i){let e=Object.keys(i);for(let t of e)i[t]!==void 0&&(this[t]=i[t])}}},Oi=class{offsetX;offsetY;panelClass;originX;originY;overlayX;overlayY;constructor(i,e,t,o,r){this.offsetX=t,this.offsetY=o,this.panelClass=r,this.originX=i.originX,this.originY=i.originY,this.overlayX=e.overlayX,this.overlayY=e.overlayY}};var Kt=class{connectionPair;scrollableViewProperties;constructor(i,e){this.connectionPair=i,this.scrollableViewProperties=e}};var co=(()=>{class n{_attachedOverlays=[];_document=h(P);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let t=this._attachedOverlays.indexOf(e);t>-1&&this._attachedOverlays.splice(t,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),lo=(()=>{class n extends co{_ngZone=h(N);_renderer=h(ae).createRenderer(null,null);_cleanupKeydown;add(e){super.add(e),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=e=>{let t=this._attachedOverlays;for(let o=t.length-1;o>-1;o--)if(t[o]._keydownEvents.observers.length>0){this._ngZone.run(()=>t[o]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=ue(n)))(o||n)}})();static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),ho=(()=>{class n extends co{_platform=h(H);_ngZone=h(N);_renderer=h(ae).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let t=this._document.body,o={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(t,"pointerdown",this._pointerDownListener,o),r.listen(t,"click",this._clickListener,o),r.listen(t,"auxclick",this._clickListener,o),r.listen(t,"contextmenu",this._clickListener,o)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=t.style.cursor,t.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(e=>e()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=e=>{this._pointerDownEventTarget=ie(e)};_clickListener=e=>{let t=ie(e),o=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:t;this._pointerDownEventTarget=null;let r=this._attachedOverlays.slice();for(let s=r.length-1;s>-1;s--){let a=r[s];if(a._outsidePointerEvents.observers.length<1||!a.hasAttached())continue;if(to(a.overlayElement,t)||to(a.overlayElement,o))break;let c=a._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>c.next(e)):c.next(e)}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=ue(n)))(o||n)}})();static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function to(n,i){let e=typeof ShadowRoot<"u"&&ShadowRoot,t=i;for(;t;){if(t===n)return!0;t=e&&t instanceof ShadowRoot?t.host:t.parentNode}return!1}var uo=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(t,o){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
|
|
3
|
+
`],encapsulation:2,changeDetection:0})}return n})(),Jt=(()=>{class n{_platform=h(H);_containerElement;_document=h(P);_styleLoader=h(Xe);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||Ii()){let o=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r<o.length;r++)o[r].remove()}let t=this._document.createElement("div");t.classList.add(e),Ii()?t.setAttribute("platform","test"):this._platform.isBrowser||t.setAttribute("platform","server"),this._document.body.appendChild(t),this._containerElement=t}_loadStyles(){this._styleLoader.load(uo)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),wi=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(i,e,t,o){this._renderer=e,this._ngZone=t,this.element=i.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",o)}detach(){this._ngZone.runOutsideAngular(()=>{let i=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(i,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),i.style.pointerEvents="none",i.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Ke=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new _;_attachments=new _;_detachments=new _;_positionStrategy;_scrollStrategy;_locationChanges=Q.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new _;_outsidePointerEvents=new _;_afterNextRenderRef;constructor(i,e,t,o,r,s,a,c,d,l=!1,u,w){this._portalOutlet=i,this._host=e,this._pane=t,this._config=o,this._ngZone=r,this._keyboardDispatcher=s,this._document=a,this._location=c,this._outsideClickDispatcher=d,this._animationsDisabled=l,this._injector=u,this._renderer=w,o.scrollStrategy&&(this._scrollStrategy=o.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=o.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(i){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let e=this._portalOutlet.attach(i);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=se(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let i=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),i}dispose(){let i=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,i&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(i){i!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=i,this.hasAttached()&&(i.attach(this),this.updatePosition()))}updateSize(i){this._config=p(p({},this._config),i),this._updateElementSize()}setDirection(i){this._config=B(p({},this._config),{direction:i}),this._updateElementDirection()}addPanelClass(i){this._pane&&this._toggleClasses(this._pane,i,!0)}removePanelClass(i){this._pane&&this._toggleClasses(this._pane,i,!1)}getDirection(){let i=this._config.direction;return i?typeof i=="string"?i:i.value:"ltr"}updateScrollStrategy(i){i!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=i,this.hasAttached()&&(i.attach(this),i.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let i=this._pane.style;i.width=x(this._config.width),i.height=x(this._config.height),i.minWidth=x(this._config.minWidth),i.minHeight=x(this._config.minHeight),i.maxWidth=x(this._config.maxWidth),i.maxHeight=x(this._config.maxHeight)}_togglePointerEvents(i){this._pane.style.pointerEvents=i?"":"none"}_attachBackdrop(){let i="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new wi(this._document,this._renderer,this._ngZone,e=>{this._backdropClick.next(e)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(i))}):this._backdropRef.element.classList.add(i)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(i,e,t){let o=Rt(e||[]).filter(r=>!!r);o.length&&(t?i.classList.add(...o):i.classList.remove(...o))}_detachContentWhenEmpty(){let i=!1;try{this._detachContentAfterRenderRef=se(()=>{i=!0,this._detachContent()},{injector:this._injector})}catch(e){if(i)throw e;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let i=this._scrollStrategy;i?.disable(),i?.detach?.()}},io="cdk-overlay-connected-position-bounding-box",gr=/([A-Za-z%]+)$/;function Ri(n,i){return new Zt(i,n.get(we),n.get(P),n.get(H),n.get(Jt))}var Zt=class{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new _;_resizeSubscription=Q.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(i,e,t,o,r){this._viewportRuler=e,this._document=t,this._platform=o,this._overlayContainer=r,this.setOrigin(i)}attach(i){this._overlayRef&&this._overlayRef,this._validatePositions(),i.hostElement.classList.add(io),this._overlayRef=i,this._boundingBox=i.hostElement,this._pane=i.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let i=this._originRect,e=this._overlayRect,t=this._viewportRect,o=this._containerRect,r=[],s;for(let a of this._preferredPositions){let c=this._getOriginPoint(i,o,a),d=this._getOverlayPoint(c,e,a),l=this._getOverlayFit(d,e,t,a);if(l.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(a,c);return}if(this._canFitWithFlexibleDimensions(l,d,t)){r.push({position:a,origin:c,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(c,a)});continue}(!s||s.overlayFit.visibleArea<l.visibleArea)&&(s={overlayFit:l,overlayPoint:d,originPoint:c,position:a,overlayRect:e})}if(r.length){let a=null,c=-1;for(let d of r){let l=d.boundingBoxRect.width*d.boundingBoxRect.height*(d.position.weight||1);l>c&&(c=l,a=d)}this._isPushed=!1,this._applyPosition(a.position,a.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(s.position,s.originPoint);return}this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Re(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(io),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let i=this._lastPosition;if(i){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._getOriginPoint(this._originRect,this._containerRect,i);this._applyPosition(i,e)}else this.apply()}withScrollableContainers(i){return this._scrollables=i,this}withPositions(i){return this._preferredPositions=i,i.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(i){return this._viewportMargin=i,this}withFlexibleDimensions(i=!0){return this._hasFlexibleDimensions=i,this}withGrowAfterOpen(i=!0){return this._growAfterOpen=i,this}withPush(i=!0){return this._canPush=i,this}withLockedPosition(i=!0){return this._positionLocked=i,this}setOrigin(i){return this._origin=i,this}withDefaultOffsetX(i){return this._offsetX=i,this}withDefaultOffsetY(i){return this._offsetY=i,this}withTransformOriginOn(i){return this._transformOriginSelector=i,this}_getOriginPoint(i,e,t){let o;if(t.originX=="center")o=i.left+i.width/2;else{let s=this._isRtl()?i.right:i.left,a=this._isRtl()?i.left:i.right;o=t.originX=="start"?s:a}e.left<0&&(o-=e.left);let r;return t.originY=="center"?r=i.top+i.height/2:r=t.originY=="top"?i.top:i.bottom,e.top<0&&(r-=e.top),{x:o,y:r}}_getOverlayPoint(i,e,t){let o;t.overlayX=="center"?o=-e.width/2:t.overlayX==="start"?o=this._isRtl()?-e.width:0:o=this._isRtl()?0:-e.width;let r;return t.overlayY=="center"?r=-e.height/2:r=t.overlayY=="top"?0:-e.height,{x:i.x+o,y:i.y+r}}_getOverlayFit(i,e,t,o){let r=oo(e),{x:s,y:a}=i,c=this._getOffset(o,"x"),d=this._getOffset(o,"y");c&&(s+=c),d&&(a+=d);let l=0-s,u=s+r.width-t.width,w=0-a,f=a+r.height-t.height,m=this._subtractOverflows(r.width,l,u),I=this._subtractOverflows(r.height,w,f),X=m*I;return{visibleArea:X,isCompletelyWithinViewport:r.width*r.height===X,fitsInViewportVertically:I===r.height,fitsInViewportHorizontally:m==r.width}}_canFitWithFlexibleDimensions(i,e,t){if(this._hasFlexibleDimensions){let o=t.bottom-e.y,r=t.right-e.x,s=no(this._overlayRef.getConfig().minHeight),a=no(this._overlayRef.getConfig().minWidth),c=i.fitsInViewportVertically||s!=null&&s<=o,d=i.fitsInViewportHorizontally||a!=null&&a<=r;return c&&d}return!1}_pushOverlayOnScreen(i,e,t){if(this._previousPushAmount&&this._positionLocked)return{x:i.x+this._previousPushAmount.x,y:i.y+this._previousPushAmount.y};let o=oo(e),r=this._viewportRect,s=Math.max(i.x+o.width-r.width,0),a=Math.max(i.y+o.height-r.height,0),c=Math.max(r.top-t.top-i.y,0),d=Math.max(r.left-t.left-i.x,0),l=0,u=0;return o.width<=r.width?l=d||-s:l=i.x<this._viewportMargin?r.left-t.left-i.x:0,o.height<=r.height?u=c||-a:u=i.y<this._viewportMargin?r.top-t.top-i.y:0,this._previousPushAmount={x:l,y:u},{x:i.x+l,y:i.y+u}}_applyPosition(i,e){if(this._setTransformOrigin(i),this._setOverlayElementStyles(e,i),this._setBoundingBoxStyles(e,i),i.panelClass&&this._addPanelClasses(i.panelClass),this._positionChanges.observers.length){let t=this._getScrollVisibility();if(i!==this._lastPosition||!this._lastScrollVisibility||!mr(this._lastScrollVisibility,t)){let o=new Kt(i,t);this._positionChanges.next(o)}this._lastScrollVisibility=t}this._lastPosition=i,this._isInitialRender=!1}_setTransformOrigin(i){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),t,o=i.overlayY;i.overlayX==="center"?t="center":this._isRtl()?t=i.overlayX==="start"?"right":"left":t=i.overlayX==="start"?"left":"right";for(let r=0;r<e.length;r++)e[r].style.transformOrigin=`${t} ${o}`}_calculateBoundingBoxRect(i,e){let t=this._viewportRect,o=this._isRtl(),r,s,a;if(e.overlayY==="top")s=i.y,r=t.height-s+this._viewportMargin;else if(e.overlayY==="bottom")a=t.height-i.y+this._viewportMargin*2,r=t.height-a+this._viewportMargin;else{let f=Math.min(t.bottom-i.y+t.top,i.y),m=this._lastBoundingBoxSize.height;r=f*2,s=i.y-f,r>m&&!this._isInitialRender&&!this._growAfterOpen&&(s=i.y-m/2)}let c=e.overlayX==="start"&&!o||e.overlayX==="end"&&o,d=e.overlayX==="end"&&!o||e.overlayX==="start"&&o,l,u,w;if(d)w=t.width-i.x+this._viewportMargin*2,l=i.x-this._viewportMargin;else if(c)u=i.x,l=t.right-i.x;else{let f=Math.min(t.right-i.x+t.left,i.x),m=this._lastBoundingBoxSize.width;l=f*2,u=i.x-f,l>m&&!this._isInitialRender&&!this._growAfterOpen&&(u=i.x-m/2)}return{top:s,left:u,bottom:a,right:w,width:l,height:r}}_setBoundingBoxStyles(i,e){let t=this._calculateBoundingBoxRect(i,e);!this._isInitialRender&&!this._growAfterOpen&&(t.height=Math.min(t.height,this._lastBoundingBoxSize.height),t.width=Math.min(t.width,this._lastBoundingBoxSize.width));let o={};if(this._hasExactPosition())o.top=o.left="0",o.bottom=o.right=o.maxHeight=o.maxWidth="",o.width=o.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,s=this._overlayRef.getConfig().maxWidth;o.height=x(t.height),o.top=x(t.top),o.bottom=x(t.bottom),o.width=x(t.width),o.left=x(t.left),o.right=x(t.right),e.overlayX==="center"?o.alignItems="center":o.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?o.justifyContent="center":o.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",r&&(o.maxHeight=x(r)),s&&(o.maxWidth=x(s))}this._lastBoundingBoxSize=t,Re(this._boundingBox.style,o)}_resetBoundingBoxStyles(){Re(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Re(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(i,e){let t={},o=this._hasExactPosition(),r=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(o){let l=this._viewportRuler.getViewportScrollPosition();Re(t,this._getExactOverlayY(e,i,l)),Re(t,this._getExactOverlayX(e,i,l))}else t.position="static";let a="",c=this._getOffset(e,"x"),d=this._getOffset(e,"y");c&&(a+=`translateX(${c}px) `),d&&(a+=`translateY(${d}px)`),t.transform=a.trim(),s.maxHeight&&(o?t.maxHeight=x(s.maxHeight):r&&(t.maxHeight="")),s.maxWidth&&(o?t.maxWidth=x(s.maxWidth):r&&(t.maxWidth="")),Re(this._pane.style,t)}_getExactOverlayY(i,e,t){let o={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,i);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,t)),i.overlayY==="bottom"){let s=this._document.documentElement.clientHeight;o.bottom=`${s-(r.y+this._overlayRect.height)}px`}else o.top=x(r.y);return o}_getExactOverlayX(i,e,t){let o={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,i);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,t));let s;if(this._isRtl()?s=i.overlayX==="end"?"left":"right":s=i.overlayX==="end"?"right":"left",s==="right"){let a=this._document.documentElement.clientWidth;o.right=`${a-(r.x+this._overlayRect.width)}px`}else o.left=x(r.x);return o}_getScrollVisibility(){let i=this._getOriginRect(),e=this._pane.getBoundingClientRect(),t=this._scrollables.map(o=>o.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:eo(i,t),isOriginOutsideView:Ei(i,t),isOverlayClipped:eo(e,t),isOverlayOutsideView:Ei(e,t)}}_subtractOverflows(i,...e){return e.reduce((t,o)=>t-Math.max(o,0),i)}_getNarrowedViewportRect(){let i=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,t=this._viewportRuler.getViewportScrollPosition();return{top:t.top+this._viewportMargin,left:t.left+this._viewportMargin,right:t.left+i-this._viewportMargin,bottom:t.top+e-this._viewportMargin,width:i-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(i,e){return e==="x"?i.offsetX==null?this._offsetX:i.offsetX:i.offsetY==null?this._offsetY:i.offsetY}_validatePositions(){}_addPanelClasses(i){this._pane&&Rt(i).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(i=>{this._pane.classList.remove(i)}),this._appliedPanelClasses=[])}_getOriginRect(){let i=this._origin;if(i instanceof k)return i.nativeElement.getBoundingClientRect();if(i instanceof Element)return i.getBoundingClientRect();let e=i.width||0,t=i.height||0;return{top:i.y,bottom:i.y+t,left:i.x,right:i.x+e,height:t,width:e}}};function Re(n,i){for(let e in i)i.hasOwnProperty(e)&&(n[e]=i[e]);return n}function no(n){if(typeof n!="number"&&n!=null){let[i,e]=n.split(gr);return!e||e==="px"?parseFloat(i):null}return n||null}function oo(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}function mr(n,i){return n===i?!0:n.isOriginClipped===i.isOriginClipped&&n.isOriginOutsideView===i.isOriginOutsideView&&n.isOverlayClipped===i.isOverlayClipped&&n.isOverlayOutsideView===i.isOverlayOutsideView}var ro="cdk-global-overlay-wrapper";function Qe(n){return new Qt}var Qt=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(i){let e=i.getConfig();this._overlayRef=i,this._width&&!e.width&&i.updateSize({width:this._width}),this._height&&!e.height&&i.updateSize({height:this._height}),i.hostElement.classList.add(ro),this._isDisposed=!1}top(i=""){return this._bottomOffset="",this._topOffset=i,this._alignItems="flex-start",this}left(i=""){return this._xOffset=i,this._xPosition="left",this}bottom(i=""){return this._topOffset="",this._bottomOffset=i,this._alignItems="flex-end",this}right(i=""){return this._xOffset=i,this._xPosition="right",this}start(i=""){return this._xOffset=i,this._xPosition="start",this}end(i=""){return this._xOffset=i,this._xPosition="end",this}width(i=""){return this._overlayRef?this._overlayRef.updateSize({width:i}):this._width=i,this}height(i=""){return this._overlayRef?this._overlayRef.updateSize({height:i}):this._height=i,this}centerHorizontally(i=""){return this.left(i),this._xPosition="center",this}centerVertically(i=""){return this.top(i),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let i=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,t=this._overlayRef.getConfig(),{width:o,height:r,maxWidth:s,maxHeight:a}=t,c=(o==="100%"||o==="100vw")&&(!s||s==="100%"||s==="100vw"),d=(r==="100%"||r==="100vh")&&(!a||a==="100%"||a==="100vh"),l=this._xPosition,u=this._xOffset,w=this._overlayRef.getConfig().direction==="rtl",f="",m="",I="";c?I="flex-start":l==="center"?(I="center",w?m=u:f=u):w?l==="left"||l==="end"?(I="flex-end",f=u):(l==="right"||l==="start")&&(I="flex-start",m=u):l==="left"||l==="start"?(I="flex-start",f=u):(l==="right"||l==="end")&&(I="flex-end",m=u),i.position=this._cssPosition,i.marginLeft=c?"0":f,i.marginTop=d?"0":this._topOffset,i.marginBottom=this._bottomOffset,i.marginRight=c?"0":m,e.justifyContent=I,e.alignItems=d?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let i=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,t=e.style;e.classList.remove(ro),t.justifyContent=t.alignItems=i.marginTop=i.marginBottom=i.marginLeft=i.marginRight=i.position="",this._overlayRef=null,this._isDisposed=!0}},fo=(()=>{class n{_injector=h(E);constructor(){}global(){return Qe()}flexibleConnectedTo(e){return Ri(this._injector,e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function dt(n,i){n.get(Xe).load(uo);let e=n.get(Jt),t=n.get(P),o=n.get(ge),r=n.get(Ue),s=n.get(le),a=t.createElement("div"),c=t.createElement("div");c.id=o.getId("cdk-overlay-"),c.classList.add("cdk-overlay-pane"),a.appendChild(c),e.getContainerElement().appendChild(a);let d=new $t(c,r,n),l=new Te(i),u=n.get(Le,null,{optional:!0})||n.get(ae).createRenderer(null,null);return l.direction=l.direction||s.value,new Ke(d,a,c,l,n.get(N),n.get(lo),t,n.get(An),n.get(ho),i?.disableAnimations??n.get(Dt,null,{optional:!0})==="NoopAnimations",n.get(Pe),u)}var po=(()=>{class n{scrollStrategies=h(ao);_positionBuilder=h(fo);_injector=h(E);constructor(){}create(e){return dt(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),_r=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],go=new A("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let n=h(E);return()=>qt(n)}}),Ai=(()=>{class n{elementRef=h(k);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=F({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return n})(),vr=(()=>{class n{_dir=h(le,{optional:!0});_injector=h(E);_overlayRef;_templatePortal;_backdropSubscription=Q.EMPTY;_attachSubscription=Q.EMPTY;_detachSubscription=Q.EMPTY;_positionSubscription=Q.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=h(go);_disposeOnNavigation=!1;_ngZone=h(N);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(e){this._disposeOnNavigation=e}backdropClick=new z;positionChange=new z;attach=new z;detach=new z;overlayKeydown=new z;overlayOutsideClick=new z;constructor(){let e=h(Se),t=h(Ne);this._templatePortal=new Ae(e,t),this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=_r);let e=this._overlayRef=dt(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(t=>{this.overlayKeydown.next(t),t.keyCode===27&&!this.disableClose&&!me(t)&&(t.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(t=>{let o=this._getOriginElement(),r=ie(t);(!o||o!==r&&!o.contains(r))&&this.overlayOutsideClick.next(t)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),t=new Te({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(t.width=this.width),(this.height||this.height===0)&&(t.height=this.height),(this.minWidth||this.minWidth===0)&&(t.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(t.minHeight=this.minHeight),this.backdropClass&&(t.backdropClass=this.backdropClass),this.panelClass&&(t.panelClass=this.panelClass),t}_updatePositionStrategy(e){let t=this.positions.map(o=>({originX:o.originX,originY:o.originY,overlayX:o.overlayX,overlayY:o.overlayY,offsetX:o.offsetX||this.offsetX,offsetY:o.offsetY||this.offsetY,panelClass:o.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(t).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let e=Ri(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof Ai?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Ai?this.origin.elementRef.nativeElement:this.origin instanceof k?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(e=>{this.backdropClick.emit(e)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(cn(()=>this.positionChange.observers.length>0)).subscribe(e=>{this._ngZone.run(()=>this.positionChange.emit(e)),this.positionChange.observers.length===0&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}static \u0275fac=function(t){return new(t||n)};static \u0275dir=F({type:n,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",ee],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",ee],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",ee],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",ee],push:[2,"cdkConnectedOverlayPush","push",ee],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",ee]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[re]})}return n})();function yr(n){let i=h(E);return()=>qt(i)}var Cr={provide:go,useFactory:yr},ht=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=U({type:n});static \u0275inj=L({providers:[po,Cr],imports:[pe,ke,Ci,Ci]})}return n})();var br=new Set(["annotation-id","class","style","id","slot","title","hidden","dark","role","tabindex","ng-reflect-annotation-id","ng-version","_nghost","_ngcontent"]),Ti="__veltContext";function Sr(n){let i={};try{if(!n?.attributes)return i;let e=n.attributes;for(let t=0;t<e.length;t++){let o=e[t].name.toLowerCase();br.has(o)||o.startsWith("_ng")||o.startsWith("ng-")||o.startsWith("data-")||o.startsWith("aria-")||o!=="velt-element"&&(i[o]=e[t].value)}}catch{}return i}function Ir(n,i){return p(p({},n||{}),i||{})}function _o(n){try{let i=n?.[Ti];return i&&typeof i=="object"?i:void 0}catch{return}}function vo(n){try{let i=n||null;for(;i;){let e=i.parentElement;if(!e){let o=i.getRootNode?.();if(o instanceof ShadowRoot&&o.host){i=o.host;continue}break}let t=_o(e);if(t)return{host:e,payload:t};i=e}}catch{}}function Dr(n){try{return n?!!n.annotationId||Object.keys(n.contextData||{}).length>0||n.data!==void 0||n.localUIState!==void 0||n.registry!==void 0:!1}catch{return!1}}function $a(n,i){try{if(!n)return;if(!Dr(i)){Er(n,i.ownerRef);return}return n[Ti]=i,i}catch{return}}function Er(n,i){try{if(!n)return;let e=_o(n);if(e&&e.ownerRef!==i)return;n[Ti]=void 0}catch{}}function Ha(n){let{host:i,inherited:e,ownAnnotationId:t,ownData:o,registry:r,ownLocalUIState:s,ownerRef:a}=n,c=Sr(i),d=Ir(e?.contextData,c),l;try{l=i?.getAttribute?.("annotation-id")||void 0}catch{}return{annotationId:t||l||e?.annotationId,contextData:d,data:o??e?.data,registry:r??e?.registry,localUIState:s??e?.localUIState,ownerRef:a}}function Or(n){try{return vo(n)?.payload?.localUIState}catch{return}}function Ga(n){try{if(n.isRoot||!n.isOwner)return!1;let i=Or(n.host);if(!i||i===n.current)return!1;try{n.current?.update?.(e=>p({},e))}catch{}return n.adopt(i),!0}catch{return!1}}function Wa(n){try{return vo(n)?.payload?.data}catch{return}}var ei="__veltRefreshContext";function Ya(n,i,e){try{if(!n||typeof e!="function")return;n[ei]={ownerRef:i,fn:e}}catch{}}function mo(n){try{let i=n?.[ei];return i&&typeof i.fn=="function"?i.fn:void 0}catch{return}}function Xa(n,i){try{if(!n)return;let e=n[ei];if(e&&e.ownerRef!==i)return;n[ei]=void 0}catch{}}function yo(n){try{if(!n||n.nodeType!==Node.ELEMENT_NODE)return;let i=n,e=mo(i);if(e)try{e()}catch{}let t=i.querySelectorAll("*");for(let o=0;o<t.length;o++){let r=mo(t[o]);if(r)try{r()}catch{}}}catch{}}var _e=new WeakMap,Co=new WeakSet,wr=new Set(["snippyly-user-request-tool","snippyly-sidebar-button","velt-sidebar-button","velt-comments-sidebar-button","snippyly-comment-tool","velt-comment-tool","snippyly-area-tool","velt-area-tool","snippyly-tags-tool","velt-tags-tool","velt-autocomplete-tool"]),Ar=new WeakSet;function qa(n){try{return!!n}catch{return!1}}function So(n){try{return!!n&&wr.has(n.tagName.toLowerCase())}catch{return!1}}function kr(n){try{return!!n&&n.nodeType===Node.ELEMENT_NODE}catch{return!1}}function Ja(n){try{if(!n)return;if(Co.has(n))return _e.get(n);if(Co.add(n),So(n)){Ar.add(n);return}let i=Array.from(n.childNodes).filter(kr);if(!i.length)return;let e={host:n,nodes:i,claimed:!1};return _e.set(n,e),e}catch{return}}function ec(n){try{if(!n)return;!n.claimed&&n.nodes.some(e=>!!e.parentNode)&&_e.delete(n.host)}catch{}}function tc(n){try{if(!n)return;let i=_e.get(n);if(!i||i.claimed)return;console.warn(`[Velt] <${n.tagName.toLowerCase()}> does not support children, so the markup you put inside it was not rendered. This primitive renders its own child primitives instead \u2014 place your markup inside one of those, or use a wireframe for this element.`)}catch{}}function ic(n){try{if(!n||_e.has(n)||So(n)||!Array.from(n.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&!!(e.textContent||"").trim()))return;console.warn(`[Velt] <${n.tagName.toLowerCase()}> was given plain text as its content, which is not supported. Wrap it in an element \u2014 for example <span>your text</span>.`)}catch{}}function nc(n){try{if(!n)return!1;let i=_e.get(n);return!!i&&i.nodes.length>0}catch{return!1}}function oc(n){try{let i=!!n.wireframeTemplate||!!n.hasCustomerChildren;return!i&&!!n.shadowDom||i&&!!n.isExplicitShadowDom}catch{return!1}}function rc(n,i){try{if(!n)return;let e=_e.get(n);return!e||!e.nodes.length||e.claimed&&e.owner!==i?void 0:e}catch{return}}function Rr(n,i,e){try{if(!n)return;let t=_e.get(n);if(!t)return;let o=i.toLowerCase(),r=t.nodes.findIndex(a=>a.tagName.toLowerCase()===o);if(r===-1)return;let[s]=t.nodes.splice(r,1);return t.nodes.length||(t.claimed=!0,t.owner=e),s}catch{return}}var bo=class{constructor(i){this.triggerTagName=i}get isActive(){return!!this.element}take(i,e){try{return this.element=Rr(i,this.triggerTagName,e),!!this.element}catch{return!1}}place(i){try{return!this.element||!i?.parentNode?!1:(i.parentNode.insertBefore(this.element,i.nextSibling),yo(this.element),!0)}catch{return!1}}release(i){try{this.element&&i&&this.element.parentNode!==i&&i.appendChild(this.element)}catch{}}},xi="data-velt-hidden",ti=new WeakMap;function Io(n,i){try{if(n.getAttribute(xi)==="true"===i)return;if(i)ti.has(n)||ti.set(n,n.style.display||""),n.setAttribute(xi,"true"),n.style.display="none";else{n.removeAttribute(xi);let t=ti.get(n);t?n.style.display=t:n.style.removeProperty("display"),ti.delete(n)}}catch{}}function sc(n,i){try{return n?(n.claimed=!0,n.owner=i,Io(n.host,!1),n.nodes):[]}catch{return[]}}function ac(n,i){try{if(!n||n.owner!==i)return;n.claimed=!1,n.owner=void 0,Io(n.host,!0),n.nodes.forEach(e=>{try{e.parentNode!==n.host&&n.host.appendChild(e)}catch{}})}catch{}}function cc(n,i){try{if(i(n.tagName.toLowerCase()))return!0;let e=n.querySelectorAll("*");for(let t=0;t<e.length;t++)if(i(e[t].tagName.toLowerCase()))return!0;return!1}catch{return!1}}function Mi(n){return n.buttons===0||n.detail===0}function Pi(n){let i=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!!i&&i.identifier===-1&&(i.radiusX==null||i.radiusX===1)&&(i.radiusY==null||i.radiusY===1)}var ut;function Tr(){if(ut==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>ut=!0}))}finally{ut=ut||!1}return ut}function Do(n){return Tr()?n:!!n.capture}var Eo=new A("cdk-input-modality-detector-options"),Oo={ignoreKeys:[18,17,224,91,16]},wo=650,Fi={passive:!0,capture:!0},Ao=(()=>{class n{_platform=h(H);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new b(null);_options;_lastTouchMs=0;_onKeydown=e=>{this._options?.ignoreKeys?.some(t=>t===e.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=ie(e))};_onMousedown=e=>{Date.now()-this._lastTouchMs<wo||(this._modality.next(Mi(e)?"keyboard":"mouse"),this._mostRecentTarget=ie(e))};_onTouchstart=e=>{if(Pi(e)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=ie(e)};constructor(){let e=h(N),t=h(P),o=h(Eo,{optional:!0});if(this._options=p(p({},Oo),o),this.modalityDetected=this._modality.pipe(an(1)),this.modalityChanged=this.modalityDetected.pipe(oe()),this._platform.isBrowser){let r=h(ae).createRenderer(null,null);this._listenerCleanups=e.runOutsideAngular(()=>[r.listen(t,"keydown",this._onKeydown,Fi),r.listen(t,"mousedown",this._onMousedown,Fi),r.listen(t,"touchstart",this._onTouchstart,Fi)])}}ngOnDestroy(){this._modality.complete(),this._listenerCleanups?.forEach(e=>e())}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),ft=(function(n){return n[n.IMMEDIATE=0]="IMMEDIATE",n[n.EVENTUAL=1]="EVENTUAL",n})(ft||{}),ko=new A("cdk-focus-monitor-default-options"),ii=Do({passive:!0,capture:!0}),Li=(()=>{class n{_ngZone=h(N);_platform=h(H);_inputModalityDetector=h(Ao);_origin=null;_lastFocusOrigin;_windowFocused=!1;_windowFocusTimeoutId;_originTimeoutId;_originFromTouchInteraction=!1;_elementInfo=new Map;_monitoredElementCount=0;_rootNodeFocusListenerCount=new Map;_detectionMode;_windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)};_document=h(P);_stopInputModalityDetector=new _;constructor(){let e=h(ko,{optional:!0});this._detectionMode=e?.detectionMode||ft.IMMEDIATE}_rootNodeFocusAndBlurListener=e=>{let t=ie(e);for(let o=t;o;o=o.parentElement)e.type==="focus"?this._onFocus(e,o):this._onBlur(e,o)};monitor(e,t=!1){let o=Ee(e);if(!this._platform.isBrowser||o.nodeType!==1)return g();let r=qn(o)||this._document,s=this._elementInfo.get(o);if(s)return t&&(s.checkChildren=!0),s.subject;let a={checkChildren:t,subject:new _,rootNode:r};return this._elementInfo.set(o,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(e){let t=Ee(e),o=this._elementInfo.get(t);o&&(o.subject.complete(),this._setClasses(t),this._elementInfo.delete(t),this._removeGlobalListeners(o))}focusVia(e,t,o){let r=Ee(e),s=this._document.activeElement;r===s?this._getClosestElementsInfo(r).forEach(([a,c])=>this._originChanged(a,t,c)):(this._setOrigin(t),typeof r.focus=="function"&&r.focus(o))}ngOnDestroy(){this._elementInfo.forEach((e,t)=>this.stopMonitoring(t))}_getWindow(){return this._document.defaultView||window}_getFocusOrigin(e){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(e)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:e&&this._isLastInteractionFromInputLabel(e)?"mouse":"program"}_shouldBeAttributedToTouch(e){return this._detectionMode===ft.EVENTUAL||!!e?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(e,t){e.classList.toggle("cdk-focused",!!t),e.classList.toggle("cdk-touch-focused",t==="touch"),e.classList.toggle("cdk-keyboard-focused",t==="keyboard"),e.classList.toggle("cdk-mouse-focused",t==="mouse"),e.classList.toggle("cdk-program-focused",t==="program")}_setOrigin(e,t=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=e,this._originFromTouchInteraction=e==="touch"&&t,this._detectionMode===ft.IMMEDIATE){clearTimeout(this._originTimeoutId);let o=this._originFromTouchInteraction?wo:1;this._originTimeoutId=setTimeout(()=>this._origin=null,o)}})}_onFocus(e,t){let o=this._elementInfo.get(t),r=ie(e);!o||!o.checkChildren&&t!==r||this._originChanged(t,this._getFocusOrigin(r),o)}_onBlur(e,t){let o=this._elementInfo.get(t);!o||o.checkChildren&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(this._setClasses(t),this._emitOrigin(o,null))}_emitOrigin(e,t){e.subject.observers.length&&this._ngZone.run(()=>e.subject.next(t))}_registerGlobalListeners(e){if(!this._platform.isBrowser)return;let t=e.rootNode,o=this._rootNodeFocusListenerCount.get(t)||0;o||this._ngZone.runOutsideAngular(()=>{t.addEventListener("focus",this._rootNodeFocusAndBlurListener,ii),t.addEventListener("blur",this._rootNodeFocusAndBlurListener,ii)}),this._rootNodeFocusListenerCount.set(t,o+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(he(this._stopInputModalityDetector)).subscribe(r=>{this._setOrigin(r,!0)}))}_removeGlobalListeners(e){let t=e.rootNode;if(this._rootNodeFocusListenerCount.has(t)){let o=this._rootNodeFocusListenerCount.get(t);o>1?this._rootNodeFocusListenerCount.set(t,o-1):(t.removeEventListener("focus",this._rootNodeFocusAndBlurListener,ii),t.removeEventListener("blur",this._rootNodeFocusAndBlurListener,ii),this._rootNodeFocusListenerCount.delete(t))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(e,t,o){this._setClasses(e,t),this._emitOrigin(o,t),this._lastFocusOrigin=t}_getClosestElementsInfo(e){let t=[];return this._elementInfo.forEach((o,r)=>{(r===e||o.checkChildren&&r.contains(e))&&t.push([r,o])}),t}_isLastInteractionFromInputLabel(e){let{_mostRecentTarget:t,mostRecentModality:o}=this._inputModalityDetector;if(o!=="mouse"||!t||t===e||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA"||e.disabled)return!1;let r=e.labels;if(r){for(let s=0;s<r.length;s++)if(r[s].contains(t))return!0}return!1}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Ro=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(t,o){},styles:[`.cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}
|
|
4
|
+
`],encapsulation:2,changeDetection:0})}return n})();var xr=(()=>{class n{create(e){return typeof MutationObserver>"u"?null:new MutationObserver(e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var To=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=U({type:n});static \u0275inj=L({providers:[xr]})}return n})();var Bi=(()=>{class n{_platform=h(H);constructor(){}isDisabled(e){return e.hasAttribute("disabled")}isVisible(e){return Pr(e)&&getComputedStyle(e).visibility==="visible"}isTabbable(e){if(!this._platform.isBrowser)return!1;let t=Mr(jr(e));if(t&&(xo(t)===-1||!this.isVisible(t)))return!1;let o=e.nodeName.toLowerCase(),r=xo(e);return e.hasAttribute("contenteditable")?r!==-1:o==="iframe"||o==="object"||this._platform.WEBKIT&&this._platform.IOS&&!zr(e)?!1:o==="audio"?e.hasAttribute("controls")?r!==-1:!1:o==="video"?r===-1?!1:r!==null?!0:this._platform.FIREFOX||e.hasAttribute("controls"):e.tabIndex>=0}isFocusable(e,t){return Vr(e)&&!this.isDisabled(e)&&(t?.ignoreVisibility||this.isVisible(e))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Mr(n){try{return n.frameElement}catch{return null}}function Pr(n){return!!(n.offsetWidth||n.offsetHeight||typeof n.getClientRects=="function"&&n.getClientRects().length)}function Fr(n){let i=n.nodeName.toLowerCase();return i==="input"||i==="select"||i==="button"||i==="textarea"}function Lr(n){return Ur(n)&&n.type=="hidden"}function Nr(n){return Br(n)&&n.hasAttribute("href")}function Ur(n){return n.nodeName.toLowerCase()=="input"}function Br(n){return n.nodeName.toLowerCase()=="a"}function Fo(n){if(!n.hasAttribute("tabindex")||n.tabIndex===void 0)return!1;let i=n.getAttribute("tabindex");return!!(i&&!isNaN(parseInt(i,10)))}function xo(n){if(!Fo(n))return null;let i=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(i)?-1:i}function zr(n){let i=n.nodeName.toLowerCase(),e=i==="input"&&n.type;return e==="text"||e==="password"||i==="select"||i==="textarea"}function Vr(n){return Lr(n)?!1:Fr(n)||Nr(n)||n.hasAttribute("contenteditable")||Fo(n)}function jr(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}var Ui=class{_element;_checker;_ngZone;_document;_injector;_startAnchor;_endAnchor;_hasAttached=!1;startAnchorListener=()=>this.focusLastTabbableElement();endAnchorListener=()=>this.focusFirstTabbableElement();get enabled(){return this._enabled}set enabled(i){this._enabled=i,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(i,this._startAnchor),this._toggleAnchorTabIndex(i,this._endAnchor))}_enabled=!0;constructor(i,e,t,o,r=!1,s){this._element=i,this._checker=e,this._ngZone=t,this._document=o,this._injector=s,r||this.attachAnchors()}destroy(){let i=this._startAnchor,e=this._endAnchor;i&&(i.removeEventListener("focus",this.startAnchorListener),i.remove()),e&&(e.removeEventListener("focus",this.endAnchorListener),e.remove()),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return this._hasAttached?!0:(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(i){return new Promise(e=>{this._executeOnStable(()=>e(this.focusInitialElement(i)))})}focusFirstTabbableElementWhenReady(i){return new Promise(e=>{this._executeOnStable(()=>e(this.focusFirstTabbableElement(i)))})}focusLastTabbableElementWhenReady(i){return new Promise(e=>{this._executeOnStable(()=>e(this.focusLastTabbableElement(i)))})}_getRegionBoundary(i){let e=this._element.querySelectorAll(`[cdk-focus-region-${i}], [cdkFocusRegion${i}], [cdk-focus-${i}]`);return i=="start"?e.length?e[0]:this._getFirstTabbableElement(this._element):e.length?e[e.length-1]:this._getLastTabbableElement(this._element)}focusInitialElement(i){let e=this._element.querySelector("[cdk-focus-initial], [cdkFocusInitial]");if(e){if(!this._checker.isFocusable(e)){let t=this._getFirstTabbableElement(e);return t?.focus(i),!!t}return e.focus(i),!0}return this.focusFirstTabbableElement(i)}focusFirstTabbableElement(i){let e=this._getRegionBoundary("start");return e&&e.focus(i),!!e}focusLastTabbableElement(i){let e=this._getRegionBoundary("end");return e&&e.focus(i),!!e}hasAttached(){return this._hasAttached}_getFirstTabbableElement(i){if(this._checker.isFocusable(i)&&this._checker.isTabbable(i))return i;let e=i.children;for(let t=0;t<e.length;t++){let o=e[t].nodeType===this._document.ELEMENT_NODE?this._getFirstTabbableElement(e[t]):null;if(o)return o}return null}_getLastTabbableElement(i){if(this._checker.isFocusable(i)&&this._checker.isTabbable(i))return i;let e=i.children;for(let t=e.length-1;t>=0;t--){let o=e[t].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(e[t]):null;if(o)return o}return null}_createAnchor(){let i=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,i),i.classList.add("cdk-visually-hidden"),i.classList.add("cdk-focus-trap-anchor"),i.setAttribute("aria-hidden","true"),i}_toggleAnchorTabIndex(i,e){i?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")}toggleAnchors(i){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(i,this._startAnchor),this._toggleAnchorTabIndex(i,this._endAnchor))}_executeOnStable(i){this._injector?se(i,{injector:this._injector}):setTimeout(i)}},zi=(()=>{class n{_checker=h(Bi);_ngZone=h(N);_document=h(P);_injector=h(E);constructor(){h(Xe).load(Ro)}create(e,t=!1){return new Ui(e,this._checker,this._ngZone,this._document,t,this._injector)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var ve=(function(n){return n[n.NONE=0]="NONE",n[n.BLACK_ON_WHITE=1]="BLACK_ON_WHITE",n[n.WHITE_ON_BLACK=2]="WHITE_ON_BLACK",n})(ve||{}),Mo="cdk-high-contrast-black-on-white",Po="cdk-high-contrast-white-on-black",Ni="cdk-high-contrast-active",ni=(()=>{class n{_platform=h(H);_hasCheckedHighContrastMode;_document=h(P);_breakpointSubscription;constructor(){this._breakpointSubscription=h(Rn).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return ve.NONE;let e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);let t=this._document.defaultView||window,o=t&&t.getComputedStyle?t.getComputedStyle(e):null,r=(o&&o.backgroundColor||"").replace(/ /g,"");switch(e.remove(),r){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return ve.WHITE_ON_BLACK;case"rgb(255,255,255)":case"rgb(255,250,239)":return ve.BLACK_ON_WHITE}return ve.NONE}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){let e=this._document.body.classList;e.remove(Ni,Mo,Po),this._hasCheckedHighContrastMode=!0;let t=this.getHighContrastMode();t===ve.BLACK_ON_WHITE?e.add(Ni,Mo):t===ve.WHITE_ON_BLACK&&e.add(Ni,Po)}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Vi=(()=>{class n{constructor(){h(ni)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(t){return new(t||n)};static \u0275mod=U({type:n});static \u0275inj=L({imports:[To]})}return n})();function $r(n,i){}var ye=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var $i=(()=>{class n extends Ye{_elementRef=h(k);_focusTrapFactory=h(zi);_config;_interactivityChecker=h(Bi);_ngZone=h(N);_focusMonitor=h(Li);_renderer=h(Le);_changeDetectorRef=h(Ve);_injector=h(E);_platform=h(H);_document=h(P);_portalOutlet;_focusTrapped=new _;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=h(ye,{optional:!0})||new ye,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let t=this._ariaLabelledByQueue.indexOf(e);t>-1&&(this._ariaLabelledByQueue.splice(t,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),t}attachTemplatePortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),t}attachDomPortal=e=>{this._portalOutlet.hasAttached();let t=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),t};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,t){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let o=()=>{r(),s(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",o),s=this._renderer.listen(e,"mousedown",o)})),e.focus(t)}_focusByCssSelector(e,t){let o=this._elementRef.nativeElement.querySelector(e);o&&this._forceFocus(o,t)}_trapFocus(e){this._isDestroyed||se(()=>{let t=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||t.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let e=this._config.restoreFocus,t=null;if(typeof e=="string"?t=this._document.querySelector(e):typeof e=="boolean"?t=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(t=e),this._config.restoreFocus&&t&&typeof t.focus=="function"){let o=Ht(),r=this._elementRef.nativeElement;(!o||o===this._document.body||o===r||r.contains(o))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,t=Ht();return e===t||e.contains(t)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=Ht()))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=W({type:n,selectors:[["cdk-dialog-container"]],viewQuery:function(t,o){if(t&1&&Ot(ct,7),t&2){let r;wt(r=At())&&(o._portalOutlet=r.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(t,o){t&2&&fe("id",o._config.id||null)("role",o._config.role)("aria-modal",o._config.ariaModal)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null)},features:[Y],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,o){t&1&&Et(0,$r,0,0,"ng-template",0)},dependencies:[ct],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
|
|
5
|
+
`],encapsulation:2})}return n})(),pt=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new _;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(i,e){this.overlayRef=i,this.config=e,this.disableClose=e.disableClose,this.backdropClick=i.backdropClick(),this.keydownEvents=i.keydownEvents(),this.outsidePointerEvents=i.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(t=>{t.keyCode===27&&!this.disableClose&&!me(t)&&(t.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=i.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(i,e){if(this._canClose(i)){let t=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),t.next(i),t.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(i="",e=""){return this.overlayRef.updateSize({width:i,height:e}),this}addPanelClass(i){return this.overlayRef.addPanelClass(i),this}removePanelClass(i){return this.overlayRef.removePanelClass(i),this}_canClose(i){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(i,e,this.componentInstance))}},Hr=new A("DialogScrollStrategy",{providedIn:"root",factory:()=>{let n=h(E);return()=>Ze(n)}}),Gr=new A("DialogData"),Wr=new A("DefaultDialogConfig");function Yr(n){let i=$(n),e=new z;return{valueSignal:i,get value(){return i()},change:e,ngOnDestroy(){e.complete()}}}var Hi=(()=>{class n{_injector=h(E);_defaultOptions=h(Wr,{optional:!0});_parentDialog=h(n,{optional:!0,skipSelf:!0});_overlayContainer=h(Jt);_idGenerator=h(ge);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new _;_afterOpenedAtThisLevel=new _;_ariaHiddenElements=new Map;_scrollStrategy=h(Hr);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=Ct(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(be(void 0)));constructor(){}open(e,t){let o=this._defaultOptions||new ye;t=p(p({},o),t),t.id=t.id||this._idGenerator.getId("cdk-dialog-"),t.id&&this.getDialogById(t.id);let r=this._getOverlayConfig(t),s=dt(this._injector,r),a=new pt(s,t),c=this._attachContainer(s,a,t);if(a.containerInstance=c,!this.openDialogs.length){let d=this._overlayContainer.getContainerElement();c._focusTrapped?c._focusTrapped.pipe(ne(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(d)}):this._hideNonDialogContentFromAssistiveTechnology(d)}return this._attachDialogContent(e,a,c,t),this.openDialogs.push(a),a.closed.subscribe(()=>this._removeOpenDialog(a,!0)),this.afterOpened.next(a),a}closeAll(){ji(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(t=>t.id===e)}ngOnDestroy(){ji(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),ji(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let t=new Te({positionStrategy:e.positionStrategy||Qe().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(t.backdropClass=e.backdropClass),t}_attachContainer(e,t,o){let r=o.injector||o.viewContainerRef?.injector,s=[{provide:ye,useValue:o},{provide:pt,useValue:t},{provide:Ke,useValue:e}],a;o.container?typeof o.container=="function"?a=o.container:(a=o.container.type,s.push(...o.container.providers(o))):a=$i;let c=new We(a,o.viewContainerRef,E.create({parent:r||this._injector,providers:s}));return e.attach(c).instance}_attachDialogContent(e,t,o,r){if(e instanceof Se){let s=this._createInjector(r,t,o,void 0),a={$implicit:r.data,dialogRef:t};r.templateContext&&(a=p(p({},a),typeof r.templateContext=="function"?r.templateContext():r.templateContext)),o.attachTemplatePortal(new Ae(e,null,a,s))}else{let s=this._createInjector(r,t,o,this._injector),a=o.attachComponentPortal(new We(e,r.viewContainerRef,s));t.componentRef=a,t.componentInstance=a.instance}}_createInjector(e,t,o,r){let s=e.injector||e.viewContainerRef?.injector,a=[{provide:Gr,useValue:e.data},{provide:pt,useValue:t}];return e.providers&&(typeof e.providers=="function"?a.push(...e.providers(t,e,o)):a.push(...e.providers)),e.direction&&(!s||!s.get(le,null,{optional:!0}))&&a.push({provide:le,useValue:Yr(e.direction)}),E.create({parent:s||r,providers:a})}_removeOpenDialog(e,t){let o=this.openDialogs.indexOf(e);o>-1&&(this.openDialogs.splice(o,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),t&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let t=e.parentElement.children;for(let o=t.length-1;o>-1;o--){let r=t[o];r!==e&&r.nodeName!=="SCRIPT"&&r.nodeName!=="STYLE"&&!r.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(r,r.getAttribute("aria-hidden")),r.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function ji(n,i){let e=n.length;for(;e--;)i(n[e])}var Lo=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=U({type:n});static \u0275inj=L({providers:[Hi],imports:[ht,ke,Vi,ke]})}return n})();var Xr=new A("MATERIAL_ANIMATIONS");var No=null;function Kr(){return h(Xr,{optional:!0})?.animationsDisabled||h(Dt,{optional:!0})==="NoopAnimations"?"di-disabled":(No??=h(kn).matchMedia("(prefers-reduced-motion)").matches,No?"reduced-motion":"enabled")}function Gi(){return Kr()!=="enabled"}var Zr=200,oi=class{_letterKeyStream=new _;_items=[];_selectedItemIndex=-1;_pressedLetters=[];_skipPredicateFn;_selectedItem=new _;selectedItem=this._selectedItem;constructor(i,e){let t=typeof e?.debounceInterval=="number"?e.debounceInterval:Zr;e?.skipPredicate&&(this._skipPredicateFn=e.skipPredicate),this.setItems(i),this._setupKeyHandler(t)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(i){this._selectedItemIndex=i}setItems(i){this._items=i}handleKey(i){let e=i.keyCode;i.key&&i.key.length===1?this._letterKeyStream.next(i.key.toLocaleUpperCase()):(e>=65&&e<=90||e>=48&&e<=57)&&this._letterKeyStream.next(String.fromCharCode(e))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(i){this._letterKeyStream.pipe(J(e=>this._pressedLetters.push(e)),It(i),D(()=>this._pressedLetters.length>0),C(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(e=>{for(let t=1;t<this._items.length+1;t++){let o=(this._selectedItemIndex+t)%this._items.length,r=this._items[o];if(!this._skipPredicateFn?.(r)&&r.getLabel?.().toLocaleUpperCase().trim().indexOf(e)===0){this._selectedItem.next(r);break}}this._pressedLetters=[]})}};var qe=class{_items;_activeItemIndex=$(-1);_activeItem=$(null);_wrap=!1;_typeaheadSubscription=Q.EMPTY;_itemChangesSubscription;_vertical=!0;_horizontal;_allowedModifierKeys=[];_homeAndEnd=!1;_pageUpAndDown={enabled:!1,delta:10};_effectRef;_typeahead;_skipPredicateFn=i=>i.disabled;constructor(i,e){this._items=i,i instanceof hi?this._itemChangesSubscription=i.changes.subscribe(t=>this._itemsChanged(t.toArray())):Fe(i)&&(this._effectRef=ze(()=>this._itemsChanged(i()),{injector:e}))}tabOut=new _;change=new _;skipPredicate(i){return this._skipPredicateFn=i,this}withWrap(i=!0){return this._wrap=i,this}withVerticalOrientation(i=!0){return this._vertical=i,this}withHorizontalOrientation(i){return this._horizontal=i,this}withAllowedModifierKeys(i){return this._allowedModifierKeys=i,this}withTypeAhead(i=200){this._typeaheadSubscription.unsubscribe();let e=this._getItemsArray();return this._typeahead=new oi(e,{debounceInterval:typeof i=="number"?i:void 0,skipPredicate:t=>this._skipPredicateFn(t)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(t=>{this.setActiveItem(t)}),this}cancelTypeahead(){return this._typeahead?.reset(),this}withHomeAndEnd(i=!0){return this._homeAndEnd=i,this}withPageUpDown(i=!0,e=10){return this._pageUpAndDown={enabled:i,delta:e},this}setActiveItem(i){let e=this._activeItem();this.updateActiveItem(i),this._activeItem()!==e&&this.change.next(this._activeItemIndex())}onKeydown(i){let e=i.keyCode,o=["altKey","ctrlKey","metaKey","shiftKey"].every(r=>!i[r]||this._allowedModifierKeys.indexOf(r)>-1);switch(e){case 9:this.tabOut.next();return;case 40:if(this._vertical&&o){this.setNextItemActive();break}else return;case 38:if(this._vertical&&o){this.setPreviousItemActive();break}else return;case 39:if(this._horizontal&&o){this._horizontal==="rtl"?this.setPreviousItemActive():this.setNextItemActive();break}else return;case 37:if(this._horizontal&&o){this._horizontal==="rtl"?this.setNextItemActive():this.setPreviousItemActive();break}else return;case 36:if(this._homeAndEnd&&o){this.setFirstItemActive();break}else return;case 35:if(this._homeAndEnd&&o){this.setLastItemActive();break}else return;case 33:if(this._pageUpAndDown.enabled&&o){let r=this._activeItemIndex()-this._pageUpAndDown.delta;this._setActiveItemByIndex(r>0?r:0,1);break}else return;case 34:if(this._pageUpAndDown.enabled&&o){let r=this._activeItemIndex()+this._pageUpAndDown.delta,s=this._getItemsArray().length;this._setActiveItemByIndex(r<s?r:s-1,-1);break}else return;default:(o||me(i,"shiftKey"))&&this._typeahead?.handleKey(i);return}this._typeahead?.reset(),i.preventDefault()}get activeItemIndex(){return this._activeItemIndex()}get activeItem(){return this._activeItem()}isTyping(){return!!this._typeahead&&this._typeahead.isTyping()}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._getItemsArray().length-1,-1)}setNextItemActive(){this._activeItemIndex()<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex()<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(i){let e=this._getItemsArray(),t=typeof i=="number"?i:e.indexOf(i),o=e[t];this._activeItem.set(o??null),this._activeItemIndex.set(t),this._typeahead?.setCurrentSelectedItemIndex(t)}destroy(){this._typeaheadSubscription.unsubscribe(),this._itemChangesSubscription?.unsubscribe(),this._effectRef?.destroy(),this._typeahead?.destroy(),this.tabOut.complete(),this.change.complete()}_setActiveItemByDelta(i){this._wrap?this._setActiveInWrapMode(i):this._setActiveInDefaultMode(i)}_setActiveInWrapMode(i){let e=this._getItemsArray();for(let t=1;t<=e.length;t++){let o=(this._activeItemIndex()+i*t+e.length)%e.length,r=e[o];if(!this._skipPredicateFn(r)){this.setActiveItem(o);return}}}_setActiveInDefaultMode(i){this._setActiveItemByIndex(this._activeItemIndex()+i,i)}_setActiveItemByIndex(i,e){let t=this._getItemsArray();if(t[i]){for(;this._skipPredicateFn(t[i]);)if(i+=e,!t[i])return;this.setActiveItem(i)}}_getItemsArray(){return Fe(this._items)?this._items():this._items instanceof hi?this._items.toArray():this._items}_itemsChanged(i){this._typeahead?.setItems(i);let e=this._activeItem();if(e){let t=i.indexOf(e);t>-1&&t!==this._activeItemIndex()&&(this._activeItemIndex.set(t),this._typeahead?.setCurrentSelectedItemIndex(t))}}};var Wi=class extends qe{setActiveItem(i){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(i),this.activeItem&&this.activeItem.setActiveStyles()}};var Yi=class extends qe{_origin="program";setFocusOrigin(i){return this._origin=i,this}setActiveItem(i){super.setActiveItem(i),this.activeItem&&this.activeItem.focus(this._origin)}};var Uo=" ";function Zl(n,i,e){let t=Bo(n,i);e=e.trim(),!t.some(o=>o.trim()===e)&&(t.push(e),n.setAttribute(i,t.join(Uo)))}function Ql(n,i,e){let t=Bo(n,i);e=e.trim();let o=t.filter(r=>r!==e);o.length?n.setAttribute(i,o.join(Uo)):n.removeAttribute(i)}function Bo(n,i){return n.getAttribute(i)?.match(/\S+/g)??[]}var Xi=(()=>{class n{constructor(){h(ni)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(t){return new(t||n)};static \u0275mod=U({type:n});static \u0275inj=L({imports:[pe,pe]})}return n})();function Qr(n,i){}var mt=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},Ki="mdc-dialog--open",zo="mdc-dialog--opening",Vo="mdc-dialog--closing",qr=150,Jr=75,Ho=(()=>{class n extends $i{_animationStateChanged=new z;_animationsEnabled=!Gi();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?$o(this._config.enterAnimationDuration)??qr:0;_exitAnimationDuration=this._animationsEnabled?$o(this._config.exitAnimationDuration)??Jr:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(jo,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(zo,Ki)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(Ki),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(Ki),this._animationsEnabled?(this._hostElement.style.setProperty(jo,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(Vo)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(zo,Vo)}_waitForAnimationToComplete(e,t){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(t,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let t=super.attachComponentPortal(e);return t.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),t}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ue(n)))(o||n)}})();static \u0275cmp=W({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(t,o){t&2&&(fi("id",o._config.id),fe("aria-modal",o._config.ariaModal)("role",o._config.role)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null),tt("_mat-animation-noopable",!o._animationsEnabled)("mat-mdc-dialog-container-with-actions",o._actionSectionCount>0))},features:[Y],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(t,o){t&1&&(_n(0,"div",0)(1,"div",1),Et(2,Qr,0,0,"ng-template",2),vn()())},dependencies:[ct],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
|
|
6
|
+
`],encapsulation:2})}return n})(),jo="--mat-dialog-transition-duration";function $o(n){return n==null?null:typeof n=="number"?n:n.endsWith("ms")?ce(n.substring(0,n.length-2)):n.endsWith("s")?ce(n.substring(0,n.length-1))*1e3:n==="0"?0:null}var gt=(function(n){return n[n.OPEN=0]="OPEN",n[n.CLOSING=1]="CLOSING",n[n.CLOSED=2]="CLOSED",n})(gt||{}),Je=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new _;_beforeClosed=new _;_result;_closeFallbackTimeout;_state=gt.OPEN;_closeInteractionType;constructor(i,e,t){this._ref=i,this._config=e,this._containerInstance=t,this.disableClose=e.disableClose,this.id=i.id,i.addPanelClass("mat-mdc-dialog-panel"),t._animationStateChanged.pipe(D(o=>o.state==="opened"),ne(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(D(o=>o.state==="closed"),ne(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),i.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),bt(this.backdropClick(),this.keydownEvents().pipe(D(o=>o.keyCode===27&&!this.disableClose&&!me(o)))).subscribe(o=>{this.disableClose||(o.preventDefault(),Zi(this,o.type==="keydown"?"keyboard":"mouse"))})}close(i){let e=this._config.closePredicate;e&&!e(i,this._config,this.componentInstance)||(this._result=i,this._containerInstance._animationStateChanged.pipe(D(t=>t.state==="closing"),ne(1)).subscribe(t=>{this._beforeClosed.next(i),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.totalTime+100)}),this._state=gt.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(i){let e=this._ref.config.positionStrategy;return i&&(i.left||i.right)?i.left?e.left(i.left):e.right(i.right):e.centerHorizontally(),i&&(i.top||i.bottom)?i.top?e.top(i.top):e.bottom(i.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(i="",e=""){return this._ref.updateSize(i,e),this}addPanelClass(i){return this._ref.addPanelClass(i),this}removePanelClass(i){return this._ref.removePanelClass(i),this}getState(){return this._state}_finishDialogClose(){this._state=gt.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function Zi(n,i,e){return n._closeInteractionType=i,n.close(e)}var Go=new A("MatMdcDialogData"),Wo=new A("mat-mdc-dialog-default-options"),Yo=new A("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let n=h(E);return()=>Ze(n)}}),ri=(()=>{class n{_defaultOptions=h(Wo,{optional:!0});_scrollStrategy=h(Yo);_parentDialog=h(n,{optional:!0,skipSelf:!0});_idGenerator=h(ge);_injector=h(E);_dialog=h(Hi);_animationsDisabled=Gi();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new _;_afterOpenedAtThisLevel=new _;dialogConfigClass=mt;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=Ct(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(be(void 0)));constructor(){this._dialogRefConstructor=Je,this._dialogContainerType=Ho,this._dialogDataToken=Go}open(e,t){let o;t=p(p({},this._defaultOptions||new mt),t),t.id=t.id||this._idGenerator.getId("mat-mdc-dialog-"),t.scrollStrategy=t.scrollStrategy||this._scrollStrategy();let r=this._dialog.open(e,B(p({},t),{positionStrategy:Qe(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||t.enterAnimationDuration?.toLocaleString()==="0"||t.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:t},{provide:ye,useValue:t}]},templateContext:()=>({dialogRef:o}),providers:(s,a,c)=>(o=new this._dialogRefConstructor(s,t,c),o.updatePosition(t?.position),[{provide:this._dialogContainerType,useValue:c},{provide:this._dialogDataToken,useValue:a.data},{provide:this._dialogRefConstructor,useValue:o}])}));return o.componentRef=r.componentRef,o.componentInstance=r.componentInstance,this.openDialogs.push(o),this.afterOpened.next(o),o.afterClosed().subscribe(()=>{let s=this.openDialogs.indexOf(o);s>-1&&(this.openDialogs.splice(s,1),this.openDialogs.length||this._getAfterAllClosed().next())}),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(t=>t.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let t=e.length;for(;t--;)e[t].close()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=y({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),es=(()=>{class n{dialogRef=h(Je,{optional:!0});_elementRef=h(k);_dialog=h(ri);ariaLabel;type="button";dialogResult;_matDialogClose;constructor(){}ngOnInit(){this.dialogRef||(this.dialogRef=Ko(this._elementRef,this._dialog.openDialogs))}ngOnChanges(e){let t=e._matDialogClose||e._matDialogCloseResult;t&&(this.dialogResult=t.currentValue)}_onButtonClick(e){Zi(this.dialogRef,e.screenX===0&&e.screenY===0?"keyboard":"mouse",this.dialogResult)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=F({type:n,selectors:[["","mat-dialog-close",""],["","matDialogClose",""]],hostVars:2,hostBindings:function(t,o){t&1&&Sn("click",function(s){return o._onButtonClick(s)}),t&2&&fe("aria-label",o.ariaLabel||null)("type",o.type)},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],type:"type",dialogResult:[0,"mat-dialog-close","dialogResult"],_matDialogClose:[0,"matDialogClose","_matDialogClose"]},exportAs:["matDialogClose"],features:[re]})}return n})(),Xo=(()=>{class n{_dialogRef=h(Je,{optional:!0});_elementRef=h(k);_dialog=h(ri);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=Ko(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=F({type:n})}return n})(),ts=(()=>{class n extends Xo{id=h(ge).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ue(n)))(o||n)}})();static \u0275dir=F({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(t,o){t&2&&fi("id",o.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[Y]})}return n})(),is=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=F({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[mn([st])]})}return n})(),ns=(()=>{class n extends Xo{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ue(n)))(o||n)}})();static \u0275dir=F({type:n,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(t,o){t&2&&tt("mat-mdc-dialog-actions-align-start",o.align==="start")("mat-mdc-dialog-actions-align-center",o.align==="center")("mat-mdc-dialog-actions-align-end",o.align==="end")},inputs:{align:"align"},features:[Y]})}return n})();function Ko(n,i){let e=n.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?i.find(t=>t.id===e.id):null}var os=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=U({type:n});static \u0275inj=L({providers:[ri],imports:[Lo,ht,ke,Xi,Xi]})}return n})();var Gd=(()=>{let i=class i{constructor(t,o,r,s,a,c,d,l,u,w){this.analyticsService=t,this.authService=o,this.configService=r,this.coreActionsService=s,this.databaseService=a,this.docService=c,this.loggingService=d,this.commonDbService=l,this.usersService=u,this.serviceBook=w,this.db=null,this.internalUserContacts$=new b([]),this.userGlobalContact$=new b(!1),this.userGroupContact$=new b(null),this.users$=new b([]),this.userPersonalContacts=[],this.userGroupContacts=[],this.userGlobalContacts=[],this.users=[],this.documentPaths=null,this.userAccessFields$=new b({}),this.userOrganizationContacts$=new b([]),this.userFolderContacts$=new b([]),this.userDocumentContacts$=new b([]),this.userOrganizationGroups$=new b([]),this.onContactSelectedSubject$=new _,this.documentAccessType=null,this.atHereEnabled$=new b(!1),this.atHereLabel$=new b("here"),this.atHereDescription$=new b(null),this.contactListScopeForOrganizationUsers$=new b([S.ALL]),this.customUserContacts$=new b(null),this.customUserContactsConfig$=new b({merge:!1}),this.orgList$=new b([]),this.currentOrganizationUserIAM$=new b(null),this.userContacts$=new b([]),this.userSnippylyIdContacts$=new b(null),this.usersByOrganizationId$=new b({}),this.temporaryUserIds$=new b([]),this.usersByOrganizationIdAndDocumentId$=new b({}),this.usersByOrganizationIdAndFolderId$=new b({}),this.userById$=new b({}),this.searchUsersSubject$=new _,this.searchUsersDebounceTime=300,this.pendingSearchPromises=new Map,this.authService.setContactService(this),this.usersService.setContactService(this),this.serviceBook.observe(nt).subscribe(f=>{this.commentService=f??void 0}),this.authService.getUser$().pipe(v(f=>this.docService.getDocumentPaths$().pipe(J(m=>{this.documentPaths=m}),C(()=>f)))).subscribe(f=>j(this,null,function*(){if(this.user=f,f&&this.documentPaths)if(!f?.organizationId)this.getLoggedInUsers$().subscribe(),this.getUserContactsFromDb$(),yield this.migrateLoggedInUserFromEmailToUserIdPath(f),this.setLoggedInUser(f),yield this.moveGlobalContactUserFromEmailToUserIdPath(f),this.updateUserInGlobalContactsIfAvailable(f),f?.groupId&&(yield this.migrateGroupContactsFromEmailToUserIdPath(f?.groupId)),this.checkToSetLoggedInUserInGroupContacts();else{let m=this.userPermissionService?.getCurrentUserPermissions(),I=this.documentPaths.folderId,X=!0;I&&m?.[f?.userId]?.folders?.[I]?.errorCode===gi.PERMISSION_DENIED&&(X=!1),this.getOrganizationContactsFromDb$(),X&&this.getFolderContactsFromDb$(),this.getDocumentContactsFromDb$(),this.getOrganizationGroupsFromDb$(),this.getTemporaryUsers()}else this.getUserContactSubscription?.unsubscribe(),this.getUserContactSubscription=void 0,this.getLoggedInUsersSubscription?.unsubscribe(),this.getLoggedInUsersSubscription=void 0,this.getOrganizationContactsSubscription?.unsubscribe(),this.getOrganizationContactsSubscription=void 0,this.getFolderContactsSubscription?.unsubscribe(),this.getFolderContactsSubscription=void 0,this.getDocumentContactsSubscription?.unsubscribe(),this.getDocumentContactsSubscription=void 0,this.getOrganizationGroupsSubscription?.unsubscribe(),this.getOrganizationGroupsSubscription=void 0}),f=>{this.loggingService.catch("Error in ContactService constructor getUser$: ",f)}),this.databaseService.getDb().pipe(D(f=>!!f),ne(1)).subscribe(f=>{f&&(this.db=f)},f=>{this.loggingService.catch("Error in ContactService constructor getDb: ",f)}),this.getOrganizationGroups$().subscribe(f=>{this.authService.setOrganizationUserGroups(f)}),et([this.getInternalUserContacts$(),this.getCustomUserContacts$(),this.getCustomUserContactsConfig$()]).subscribe(([f,m,I])=>{m?I?.merge?this.userContacts$.next([...f||[],...m||[]]):this.userContacts$.next(m||[]):this.userContacts$.next(f||[])}),this.getUserContacts$().subscribe(f=>{try{f?.forEach(m=>{let I=m?.userSnippylyId||Un(this.configService.getApiKey(),m.userId);I&&this.userSnippylyIdContacts$.next(B(p({},this.userSnippylyIdContacts$.value),{[I]:m}))})}catch{}})}setCommentService(t){try{this.commentService=t}catch(o){this.loggingService.catch("Error in ContactService setCommentService: ",o)}}setUserPermissionService(t){try{this.userPermissionService=t}catch(o){this.loggingService.catch("Error in ContactService setUserPermissionService: ",o)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in ContactService","color: green;");try{this.documentPaths=null,this.usersByOrganizationId$.next({}),this.temporaryUserIds$.next([]),this.usersByOrganizationIdAndFolderId$.next({}),this.usersByOrganizationIdAndDocumentId$.next({}),this.userById$.next({}),this.userOrganizationContacts$.next([]),this.userFolderContacts$.next([]),this.userDocumentContacts$.next([]),this.userOrganizationGroups$.next([]),this.userContacts$.next([]),this.userSnippylyIdContacts$.next(null),this.userGlobalContact$.next(!1),this.userGroupContact$.next(null),this.users$.next([]),this.userPersonalContacts=[],this.userGroupContacts=[],this.userGlobalContacts=[],this.users=[],this.currentOrganizationUserIAM$.next(null)}catch(t){this.loggingService.catch("Error in ContactService clearCache: ",t)}}setDocumentAccessType(t){try{this.documentAccessType=t}catch(o){this.loggingService.catch("Error in ContactService setDocumentAccessType: ",o)}}checkIfUserGlobalContact(t){return j(this,null,function*(){try{if(t?.userId&&this.documentPaths?.globalContacts){let o=yield this.commonDbService?.getData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.userId),skipFirestore:!0}});if(Object.keys(o??{}).length>0)return!0}if(t?.email&&this.documentPaths?.globalContacts){let o=yield this.commonDbService?.getData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.email),skipFirestore:!0}});if(Object.keys(o??{}).length>0)return!0}return!1}catch(o){return this.loggingService.catch("Error in ContactService isUserGlobalContact: ",o),!1}})}setLoggedInUser(t){try{t?.userId&&this.documentPaths?.logins&&(this.commonDbService.updateData({feature:"logins",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(B(p({},t),{contacts:void 0})))}),this.setLoggedInUserPrivateContacts(t,t?.contacts))}catch(o){this.loggingService.catch("Error in ContactService setLoggedInUser: ",o)}}migrateLoggedInUserFromEmailToUserIdPath(t){return j(this,null,function*(){try{if(t?.email&&this.documentPaths?.logins){let o=yield this.commonDbService?.getData({feature:"logins",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.email),skipFirestore:!0}});if(Object.keys(o??{}).length>0){let r=o;if(r){if(r?.contacts){let s={};Object.keys(r?.contacts??{})?.forEach(a=>{let c=r.contacts[a];if(c?.userId){let d=O(c?.userId);s[d]=c}}),r.contacts=s}yield this.commonDbService.updateData({feature:"logins",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))}),yield this.commonDbService.deleteData({feature:"logins",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.email),skipFirestore:!0}})}}}}catch(o){this.loggingService.catch("Error in ContactService migrateLoggedInUserFromEmailToUserIdPath: ",o)}})}addGlobalContact(t){try{t?.userId&&this.documentPaths?.globalContacts&&this.commonDbService.updateData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(t))})}catch(o){this.loggingService.catch("Error in ContactService addGlobalContact: ",o)}}getUserAccessFields(){return JSON.parse(JSON.stringify(this.userAccessFields$.value))}getUserAccessFieldsByUserId(t){return this.getUserAccessFields()?.[t]}setUserAccessFields(t){try{let o=this.getUserAccessFields();t.forEach(s=>{o[s.user.userId]=s.accessFields||[]});let r=this.authService.getUser()?.userId;if(r&&o?.[r]?.length){let s=this.userPermissionService?.getCurrentUserPermissions();s&&(s[r]||(s[r]={}),s[r].context={accessFields:o[r]},this.userPermissionService?.setCurrentUserPermissions(s))}this.userAccessFields$.next(JSON.parse(JSON.stringify(o)))}catch(o){this.loggingService.catch("Error in ContactService setUserAccessFields: ",o)}}updateUserInGlobalContactsIfAvailable(t){return j(this,null,function*(){try{if(t?.userId&&this.documentPaths?.globalContacts&&(yield this.checkIfUserGlobalContact(t))){let r=new Pn;r.userId=t?.userId,r.userSnippylyId=t?.userSnippylyId,r.email=t?.email,r.name=t?.name,r.photoUrl=t?.photoUrl,this.commonDbService.updateData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))})}}catch(o){this.loggingService.catch("Error in ContactService updateUserInGlobalContactsIfAvailable: ",o)}})}moveGlobalContactUserFromEmailToUserIdPath(t){return j(this,null,function*(){try{if(t?.email&&t?.userId&&this.documentPaths?.globalContacts){let o=yield this.commonDbService?.getData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.email),skipFirestore:!0}});if(Object.keys(o??{}).length>0){let r=o;r&&(yield this.commonDbService.updateData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))}),yield this.commonDbService.deleteData({feature:"globalContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.email),skipFirestore:!0}}))}}}catch(o){this.loggingService.catch("Error in ContactService removeUserFromGlobalContactsByEmail: ",o)}})}setLoggedInUserPrivateContacts(t,o){try{if(t?.userId&&this.documentPaths?.logins){let r,s=o?.filter(c=>c?.visibility!=="group"),a=!1;this.authService.getUserOptions()&&(a=!!this.authService.getUserOptions()?.replaceContacts||!!this.authService.getUserOptions()?.replacePrivateContacts),s?.length?(r={},s?.forEach(c=>{if(c?.userId){let d=O(c?.userId);r[d]=c}}),a?this.commonDbService.setData({feature:"allLoginContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))}):this.commonDbService.updateData({feature:"allLoginContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(r))})):a&&this.commonDbService.deleteData({feature:"allLoginContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",userId:O(t?.userId),skipFirestore:!0}})}}catch(r){this.loggingService.catch("Error in ContactService setLoggedInUserPrivateContacts: ",r)}}migrateGroupContactsFromEmailToUserIdPath(t){return j(this,null,function*(){try{if(this.documentPaths?.groupContacts&&t){let o=yield this.commonDbService?.getData({feature:"groupContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:t,skipFirestore:!0}});o&&Object.keys(o??{}).forEach(r=>j(this,null,function*(){let s=o[r];s?.email&&s?.userId&&O(s?.email)===r&&(yield this.commonDbService.deleteData({feature:"groupContactsUser",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:t,userId:r,skipFirestore:!0}}),yield this.commonDbService.updateData({feature:"groupContactsUser",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:t,userId:O(s?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(s))}))}))}}catch(o){this.loggingService.catch("Error in ContactService migrateGroupContacts: ",o)}})}checkToSetLoggedInUserInGroupContacts(){return j(this,null,function*(){try{this.user?.groupId&&this.user?.userId&&((yield this.checkIfUserGlobalContact(this.user))||this.docService.getDocumentIam$().pipe(ne(1)).subscribe(o=>j(this,null,function*(){if(this.user?.groupId&&this.user?.userId){let r=!1,s=this.docService.getDocumentAccessType(o);if(!s||s===Tt.PUBLIC)r=!0;else if(s===Tt.RESTRICTED){let a=O(this.user?.userId);if(o?.users?.[a]&&(r=!0),this.user?.email){let c=O(this.user?.email);o?.users?.[c]&&(r=!0)}}if(r){let a=new Fn;a.email=this.user.email,a.visibility="group",a.name=this.user.name,a.photoUrl=this.user.photoUrl,a.userId=this.user.userId,(this.authService.getUserOptions()?.replaceContacts||this.authService.getUserOptions()?.replaceGroupContacts)&&(yield this.removeGroupContacts(this.user?.groupId)),this.setLoggedInUserGroupContacts(this.user?.groupId,[a]),this.user?.contacts&&this.user?.groupId&&this.setLoggedInUserGroupContacts(this.user?.groupId,this.user?.contacts)}}})))}catch(t){this.loggingService.catch("Error in ContactService checkToSetLoggedInUserInGroupContacts: ",t)}})}setLoggedInUserGroupContacts(t,o){try{let r=o?.filter(s=>s?.visibility==="group");r?.length&&r.forEach(s=>j(this,null,function*(){if(s?.userId&&t&&this.documentPaths?.groupContacts){if(this.configService?.getSF()&&(yield this.checkIfUserGlobalContact(s)))return;yield this.commonDbService.updateData({feature:"groupContactsUser",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:t,userId:O(s?.userId),skipFirestore:!0},data:JSON.parse(JSON.stringify(s))}),s?.email&&(yield this.commonDbService.deleteData({feature:"groupContactsUser",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:t,userId:O(s?.email),skipFirestore:!0}}))}}))}catch(r){this.loggingService.catch("Error in ContactService setLoggedInUserGroupContacts: ",r)}}removeGroupContacts(t){return j(this,null,function*(){try{if(this.documentPaths?.groupContacts&&t)return this.commonDbService.deleteData({feature:"groupContacts",properties:{documentId:this.documentPaths?.documentId??"",organizationId:this.documentPaths?.organizationId??"",groupId:t,skipFirestore:!0}})}catch(o){this.loggingService.catch("Error in ContactService removeGroupContacts: ",o)}})}mergeUserContacts(){try{let t=[];this.userPersonalContacts&&t.push(...this.userPersonalContacts),this.userGroupContacts&&t.push(...this.userGroupContacts),this.userGlobalContacts&&t.push(...this.userGlobalContacts);let o={};t.forEach(r=>{r?.userId?(!r?.email||!o[r.email])&&(o[r.userId]=r):r?.email&&(!r?.userId||!o[r.userId])&&(o[r.email]=r)}),t=Object.values(o??{}),this.internalUserContacts$.next(t)}catch(t){this.loggingService.catch("Error in ContactService mergeUserContacts: ",t)}}getInternalUserContacts(){return this.internalUserContacts$.value}getInternalUserContacts$(){return this.internalUserContacts$.asObservable()}getUserContacts$(t){try{let{organizationId:o,documentId:r,veltFolderId:s}=t||{};return o&&r?et([this.usersByOrganizationId$,this.usersByOrganizationIdAndFolderId$,this.usersByOrganizationIdAndDocumentId$,this.userById$,this.customUserContacts$,this.customUserContactsConfig$,this.getContactListScopeForOrganizationUsers$(),this.temporaryUserIds$]).pipe(C(([a,c,d,l,u,w,f,m])=>{let I={},X=!1;w&&!w?.merge&&(X=!0);let M=xe=>f.some(Me=>xe.includes(Me)),K=M([S.ALL,S.ORGANIZATION])?Object.keys(a?.[o]||{}):[],G=s?M([S.ALL,S.FOLDER])?Object.keys(c?.[o]?.[s]||{}):[]:[],ci=M([S.ALL,S.DOCUMENT])?Object.keys(d?.[o]?.[r]||{}):[];if([...K,...G||[],...ci,...m].forEach(xe=>{let Me=l?.[xe];Me&&(I[xe]=Me)}),u){let{merge:xe,options:Me}=w||{},{organizationId:Qi,documentId:qi,folderId:Ji}=Me||{},en=Ji?Ln(Ji):void 0;(!Qi||Qi===o)&&(!qi||qi===r)&&(!en||en===s)&&(xe||(I={}),u.forEach(li=>{li?.userId&&(I[li.userId]=li)}))}return Object.values(I??{})})):this.userContacts$.asObservable().pipe(C(a=>a))}catch(o){return this.loggingService.catch("Error in ContactService getUserContacts$ metadata: ",o),g([])}}getUserContactsBySnippylyId$(){return this.userSnippylyIdContacts$.asObservable()}getUserBySnippylyId(t){return this.userSnippylyIdContacts$.value?.[t]}getAtHereLabel(){return this.atHereLabel$.asObservable()}getAtHereDescription(){return this.atHereDescription$.asObservable()}getUserContactsFromDb$(){this.getUserContactSubscription||(this.getUserContactSubscription=this.authService.getUser$().pipe(D(t=>!!t),v(t=>this.docService.getDocumentPaths$().pipe(D(o=>!!o),J(o=>{this.documentPaths=o}),C(()=>t))),v(t=>{if(this.userGroupContacts=[],this.userPersonalContacts=[],!t)return g();if(!this.documentPaths)return g();let o=[];return o.push(this.commonDbService.dbListener({feature:"allGlobalContacts",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0}}).pipe(C(r=>r?.data),J(r=>{r?(this.userGlobalContacts=Object.values(r??{}),this.userGlobalContacts?.find(s=>s.userId===this.user?.userId)?this.userGlobalContact$.next(!0):this.userGlobalContact$.next(!1)):(this.userGlobalContacts=[],this.userGlobalContact$.next(!1))}))),o.push(this.commonDbService.dbListener({feature:"groupContacts",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0,groupId:t?.groupId}}).pipe(C(r=>r?.data),J(r=>{r?(this.userGroupContacts=Object.values(r??{}),this.userGroupContacts?.find(s=>s?.userId===this.user?.userId)?this.userGroupContact$.next(!0):this.userGroupContact$.next(!1)):(this.userGroupContacts=[],this.userGroupContact$.next(!1))}))),o.push(this.commonDbService.dbListener({feature:"allLoginContacts",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0,userId:O(t?.userId)}}).pipe(C(r=>r?.data),J(r=>{r?this.userPersonalContacts=Object.values(r??{}):this.userPersonalContacts=[]}))),bt(...o).pipe(he(this.authService.getUser$().pipe(D(r=>!r))))})).subscribe(()=>{this.mergeUserContacts()},t=>{this.loggingService.catch("Error in ContactService getUserContacts$ subscription: ",t)}))}addUserContact(t){try{this.user?.organizationId||this.user?.groupId&&(t.visibility="group",this.setLoggedInUserGroupContacts(this.user?.groupId,[t]))}catch(o){this.loggingService.catch("Error in ContactService addUserContact: ",o)}}isUserGlobalContact$(){return this.userGlobalContact$.asObservable().pipe(oe(xt))}isUserGlobalContact(){return this.userGlobalContact$.value}isUserGroupContact$(){return this.userGroupContact$.asObservable()}isUserGroupContact(){return this.userGroupContact$.value}getLoggedInUsers$(){return this.getLoggedInUsersSubscription||(this.getLoggedInUsersSubscription=this.authService.getUser$().pipe(v(t=>t?this.documentPaths?t?.userId&&this.documentPaths?.logins?this.commonDbService.dbListener({feature:"allLogins",properties:{documentId:this.documentPaths?.documentId,organizationId:this.documentPaths?.organizationId,skipFirestore:!0}}).pipe(C(o=>o?.data),J(o=>{o?this.users=Object.values(o??{}):this.users=[]})):(this.users=[],g()):g():g())).subscribe(()=>{this.users$.next(this.users)},t=>{this.loggingService.catch("Error in ContactService getLoggedInUsers$ subscription: ",t)})),this.users$.asObservable()}getUsersMap$(){return this.authService.getUser$().pipe(v(t=>t?.organizationId?this.userById$.pipe(C(o=>{let r={};return Object.values(o||{}).forEach(s=>{s?.userSnippylyId&&(r[s?.userSnippylyId]=s)}),r})):this.users$.pipe(C(o=>{let r={};return o.forEach(s=>{r[s.userSnippylyId]=s}),r}))))}getUserByEmail$(t){return this.users$.pipe(C(o=>o.find(r=>r.email===t)))}getUserByEmail(t){return this.users?.find(o=>o.email===t)}getContactByEmail(t){return this.getInternalUserContacts().find(o=>o.email===t)}getUserByUserId$(t){return this.users$.pipe(C(o=>o.find(r=>r.userId===t)))}getUserGroupContacts(){return this.userGroupContacts}getTemporaryUsers(){try{let t=this.authService.getUser();this.docService.getOrganizationConfig$().pipe(D(o=>!!o),C(o=>o?.organizationId)).subscribe(o=>j(this,null,function*(){if(o&&t){let r=((yield this.commonDbService?.queryData({feature:"allPermissionsUsers",properties:{organizationId:o,useCollectionGroup:!1,isCollection:!0,firestoreQuery:[T("expiresAt",">",new Date().getTime())]}}))??[]).filter(s=>s?.userId!==t?.userId);if(r?.length){let s=r.map(l=>l?.userId),a=Nn(),c=Mn.GET_TEMPORARY_USERS;this.coreActionsService.triggerAction(Tn.USER_RESOLVER,{event:Mt.Events.Resolver.USER_RESOLUTION_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:a,moduleName:c,methodName:xn.GET_TEMPORARY_USERS,source:"internal",payload:{userIds:s}});let d=yield this.usersService.resolveUsers({userIds:s,uniqueId:a,moduleName:c});if(d){let l={};Object.entries(d).forEach(([w,f])=>{l[w]=f}),this.userById$.next(p(p({},this.userById$.value),l));let u=new Set([...this.temporaryUserIds$.value,...Object.keys(l)]);this.temporaryUserIds$.next(Array.from(u))}}}}))}catch(t){this.loggingService.catch("Error in ContactService getTemporaryUsers: ",t)}}searchUsers(t){return j(this,null,function*(){try{if(!t||typeof t!="string"||!t.trim())return[];let o=t.trim();return this.searchUsersDebounced$||(this.searchUsersDebounced$=this.searchUsersSubject$.pipe(It(this.searchUsersDebounceTime),oe(),v(r=>vt(this.performSearch(r)).pipe(C(s=>({searchText:r,results:s})),di(s=>(this.loggingService.catch("Error in ContactService performSearch: ",s),g({searchText:r,results:[]})))))),this.searchUsersDebounced$.subscribe({next:({searchText:r,results:s})=>{Array.from(this.pendingSearchPromises.keys()).forEach(d=>{if(d!==r){let l=this.pendingSearchPromises.get(d);l&&(l.forEach(({resolve:u})=>u([])),this.pendingSearchPromises.delete(d))}});let c=this.pendingSearchPromises.get(r);c&&(c.forEach(({resolve:d})=>d(s)),this.pendingSearchPromises.delete(r))},error:r=>{this.pendingSearchPromises.forEach(s=>{s.forEach(({reject:a})=>a(r))}),this.pendingSearchPromises.clear()}})),new Promise((r,s)=>{this.pendingSearchPromises.has(o)||this.pendingSearchPromises.set(o,[]),this.pendingSearchPromises.get(o).push({resolve:r,reject:s}),this.searchUsersSubject$.next(o)})}catch(o){return this.loggingService.catch("Error in ContactService searchUsers: ",o),[]}})}performSearch(t){return j(this,null,function*(){try{let o=this.docService.getOrganizationConfig()?.organizationId;if(!o)return[];let r=this.documentPaths?.veltFolderId,s=this.docService.getDocumentIds().map(M=>M?.documentId),a=t.toLowerCase().trim(),c=a+"\uF8FF",d=[],l=s?.filter(M=>!!M)||[],u=l.length>0,w=!!r;if(u){let M=[];for(let G=0;G<l.length;G+=20)M.push(l.slice(G,G+20));M.forEach(G=>{let ci=[T("documentIds","array-contains-any",G),T("viewerDocumentIds","array-contains-any",G)],_t=[T("organizationIds","array-contains-any",[o]),T("viewerOrganizationIds","array-contains-any",[o]),...ci];w&&_t.push(T("folderIds","array-contains-any",[r]),T("viewerFolderIds","array-contains-any",[r])),d.push(this.commonDbService.queryData({feature:"allDocumentUsers",properties:{organizationId:o,isCollection:!0,useCollectionGroup:!1,useQuery:!0,firestoreQuery:[Ie(De(..._t),T("user.name_lowercase",">=",a),T("user.name_lowercase","<",c)),He(10)]}}).catch(()=>[])),d.push(this.commonDbService.queryData({feature:"allDocumentUsers",properties:{organizationId:o,isCollection:!0,useCollectionGroup:!1,useQuery:!0,firestoreQuery:[Ie(De(..._t),T("user.email_lowercase",">=",a),T("user.email_lowercase","<",c)),He(10)]}}).catch(()=>[]))})}let f=yield Promise.all(d),m=[];f.forEach(M=>{M&&Array.isArray(M)?M.forEach(K=>{K&&K.user&&K.user.userId&&m.push(K)}):M&&typeof M=="object"&&Object.values(M).forEach(G=>{G&&G.user&&G.user.userId&&m.push(G)})});let I=new Map;m.forEach(M=>{let K=M.user?.userId;K&&!I.has(K)&&I.set(K,M)});let X=Array.from(I.values());return this.setResolvedUsers(X,!0),X}catch(o){return this.loggingService.catch("Error in ContactService performSearch: ",o),[]}})}setResolvedUsers(t,o=!1){try{if(t?.length){let r=[],s=[],a=[],c=this.docService.getOrganizationConfig()?.organizationId,d=this.documentPaths?.veltFolderId,l=this.docService.getDocumentIds().map(f=>f?.documentId);t.forEach(f=>{this.userById$.value[f?.user?.userId]||(c&&f?.organizationIds?.includes(c)&&!r.find(m=>m?.user?.userId===f?.user?.userId)&&r.push(f),d&&f?.folderIds?.includes(d)&&!s.find(m=>m?.user?.userId===f?.user?.userId)&&s.push(f),l?.some(m=>f?.documentIds?.includes(m))&&!a.find(m=>m?.user?.userId===f?.user?.userId)&&a.push(f))}),r?.length&&this.setUserOrganizationContacts(r,c,o),s?.length&&this.setUserFolderContacts(s,o),a?.length&&this.setUserDocumentContacts(a,o);let w=[...r,...s,...a].filter((f,m,I)=>m===I.findIndex(X=>X.user.userId===f.user.userId));w?.length&&(this.setUserAccessFields(w),this.mergeOrganizationAndDocumentContacts())}}catch(r){this.loggingService.catch("Error in ContactService setResolvedUsers: ",r)}}getOrganizationContactsFromDb$(){try{this.getOrganizationContactsSubscription||(this.getOrganizationContactsSubscription=this.authService.getUser$().pipe(v(t=>t?.organizationId?g(t).pipe(v(o=>this.docService.getOrganizationConfig$().pipe(D(r=>!!r),C(()=>o))),v(o=>this.usersService.getResolveOrganizationUsers$().pipe(D(r=>r),C(()=>o))),v(o=>{let r=this.docService.getOrganizationConfig()?.organizationId;return this.setUserOrganizationContacts([],r),o?r?this.commonDbService.dbListener({feature:"allOrganizationUsers",properties:{organizationId:r,isCollection:!0,useQuery:!0,firestoreQuery:[Ie(De(T("organizationIds","array-contains-any",[r]),T("viewerOrganizationIds","array-contains-any",[r]))),Lt("id"),...this.commentService?.getPaginatedContactList()?[He(10)]:[]]}}).pipe(C(s=>s?.data),v(s=>this.commentService?.getPaginatedContactList()&&!Object.values(s??{}).find(a=>a?.user?.userId===this.authService.getUser()?.userId)?vt(this.commonDbService.queryData({feature:"allOrganizationUsers",properties:{organizationId:r,isCollection:!0,useQuery:!0,firestoreQuery:[Ie(De(T("organizationIds","array-contains-any",[r]),T("viewerOrganizationIds","array-contains-any",[r])),T("user.userId","==",this.authService.getUser()?.userId))]}})).pipe(C(a=>{if(a&&a.length>0){let c=a[0],d=c?.user?.userId||c?.id;if(d&&s){let l=O(d);return B(p({},s),{[l]:c})}}return s})):g(s)),C(s=>{if(s){typeof s=="object"&&(s?.undefined&&delete s.undefined,s?.null&&delete s.null);let a=Object.values(s??{});this.setUserAccessFields(a),this.setUserOrganizationContacts(a,r)}else this.setUserOrganizationContacts([],r)})):g():g()}),v(()=>this.getContactListScopeForOrganizationUsers$())):(this.setUserOrganizationContacts([]),g()))).subscribe(()=>{this.mergeOrganizationAndDocumentContacts()},t=>{this.loggingService.catch("Error in ContactService getOrganizationContactsFromDb$ subscription: ",t)}))}catch{}}getFolderContactsFromDb$(){try{this.getFolderContactsSubscription||(this.getFolderContactsSubscription=this.authService.getUser$().pipe(v(t=>t?g(t).pipe(v(o=>this.docService.getOrganizationConfig$().pipe(D(r=>!!r),C(()=>o))),v(o=>this.usersService.getResolveFolderUsers$().pipe(D(r=>r),C(()=>o))),v(o=>{let r=this.docService.getOrganizationConfig()?.organizationId;if(this.setUserFolderContacts([]),!o)return g();if(!this.commonDbService.shouldUseFirestore())return g();if(!this.documentPaths?.veltFolderId)return g();let s=g([]);return s=this.commonDbService.dbListener({feature:"allFolderUsers",properties:{organizationId:r,folderId:this.documentPaths?.veltFolderId,isCollection:!0,useQuery:!0,firestoreQuery:[Ie(De(T("folderIds","array-contains-any",[this.documentPaths?.veltFolderId]),T("viewerFolderIds","array-contains-any",[this.documentPaths?.veltFolderId]))),Lt("id"),...this.commentService?.getPaginatedContactList()?[He(10)]:[]]}}).pipe(C(a=>a?.data)),s.pipe(C(a=>{if(a){typeof a=="object"&&(a?.undefined&&delete a.undefined,a?.null&&delete a.null);let c=Object.values(a??{});this.setUserAccessFields(c),this.setUserFolderContacts(c)}else this.setUserFolderContacts([])}))}),v(()=>this.getContactListScopeForOrganizationUsers$())):(this.setUserFolderContacts([]),g()))).subscribe(()=>{this.mergeOrganizationAndDocumentContacts()},t=>{this.loggingService.catch("Error in ContactService getFolderContactsFromDb$ subscription: ",t)}))}catch{}}getDocumentContactsFromDb$(){try{this.getDocumentContactsSubscription||(this.getDocumentContactsSubscription=this.authService.getUser$().pipe(v(t=>t?g(t).pipe(v(o=>this.docService.getDocumentPaths$().pipe(D(r=>!!r),J(r=>{this.documentPaths=r}),C(()=>o))),v(o=>this.usersService.getResolveDocumentUsers$().pipe(D(r=>r),C(()=>o))),v(o=>(this.setUserDocumentContacts([]),o?this.documentPaths?this.docService.getDocumentIds$().pipe(v(r=>{let s=r?.length>0?r.map(l=>l.documentId):[this.documentPaths?.documentId??""];if(s.some(l=>!l)||!this.documentPaths)return g();let a=g([]),c={isCollection:!0,useQuery:!0};this.commonDbService.shouldUseFirestore()||(c.documentId=s?.length?s[0]:void 0,c.organizationId=this.documentPaths?.organizationId);let d=[];for(let l=0;l<s.length;l+=je.LISTENER_BATCH_SIZE)d.push(s.slice(l,l+je.LISTENER_BATCH_SIZE));return a=et(d.map(l=>this.commonDbService.dbListener({feature:"allDocumentUsers",properties:B(p({},c),{firestoreQuery:[Ie(De(T("documentIds","array-contains-any",l),T("viewerDocumentIds","array-contains-any",l))),Lt("id"),...this.commentService?.getPaginatedContactList()?[He(10)]:[]]})}).pipe(ln()))).pipe(C(l=>Bn(l)?.data)),a.pipe(C(l=>{if(l){typeof l=="object"&&(l?.undefined&&delete l.undefined,l?.null&&delete l.null);let u=Object.values(l??{});this.setUserAccessFields(u),this.setUserDocumentContacts(u)}else this.setUserDocumentContacts([])}))})):g():g())),v(()=>this.getContactListScopeForOrganizationUsers$())):(this.setUserDocumentContacts([]),g()))).subscribe(()=>{this.mergeOrganizationAndDocumentContacts()},t=>{this.loggingService.catch("Error in ContactService getDocumentContactsFromDb$ subscription: ",t)}))}catch{}}setUserOrganizationContacts(t,o,r=!0){try{let s=t.find(c=>c.user.userId===this.user?.userId);s&&this.setCurrentOrganizationUserIAM(s);let a=t.map(c=>c.user)?.filter(c=>!this.userOrganizationContacts$.value.find(d=>d.userId===c.userId));if(this.userOrganizationContacts$.next([...this.userOrganizationContacts$.value,...a]),r&&this.usersService.setUserByIds(a),o){let c={};c[o]={};let d={};t.forEach(u=>{c[o][u.user.userId]=u,d[u.user.userId]=u.user}),this.userById$.next(p(p({},this.userById$.value),d));let l=this.usersByOrganizationId$.value?.[o];l&&(c[o]=p(p({},l),c[o])),this.usersByOrganizationId$.next(B(p({},this.usersByOrganizationId$.value),{[o]:c[o]}))}else this.usersByOrganizationId$.next({})}catch(s){this.loggingService.catch("Error in ContactService setUserOrganizationContacts: ",s)}}getUserOrganizationContacts$(){return this.getContactListScopeForOrganizationUsers$().pipe(v(()=>this.checkContactListScopeForOrganizationUsers([S.ALL,S.ORGANIZATION])?this.userOrganizationContacts$.asObservable():g([])))}getUserOrganizationContacts(){return this.checkContactListScopeForOrganizationUsers([S.ALL,S.ORGANIZATION])?this.userOrganizationContacts$.value:[]}setUserFolderContacts(t,o=!0){try{let r=t?.map(d=>d?.user)?.filter(d=>!this.userFolderContacts$.value.find(l=>l.userId===d.userId));this.userFolderContacts$.next([...this.userFolderContacts$.value,...r]),o&&this.usersService.setUserByIds(r);let s=this.usersByOrganizationIdAndFolderId$.value||{},a=p({},s),c={};t?.forEach(d=>{let{organizationId:l}=d?.metadata||{};l&&(a[l]||(a[l]={}),d.folderIds?.forEach(u=>{a[l][u]||(a[l][u]={}),a[l][u]=B(p({},a[l][u]),{[d.user.userId]:d}),c[d.user.userId]=d.user}))}),this.userById$.next(p(p({},this.userById$.value),c)),this.usersByOrganizationIdAndFolderId$.next(a)}catch(r){this.loggingService.catch("Error in ContactService updateUserFolderContacts: ",r)}}getUserFolderContacts$(){return this.getContactListScopeForOrganizationUsers$().pipe(v(()=>this.checkContactListScopeForOrganizationUsers([S.ALL,S.FOLDER])?this.userFolderContacts$.asObservable():g([])))}getUserFolderContacts(){return this.checkContactListScopeForOrganizationUsers([S.ALL,S.FOLDER])?this.userFolderContacts$.value:[]}setUserDocumentContacts(t,o=!0){try{let r=t?.map(d=>d?.user)?.filter(d=>!this.userDocumentContacts$.value.find(l=>l.userId===d.userId));this.userDocumentContacts$.next([...this.userDocumentContacts$.value,...r]),o&&this.usersService.setUserByIds(r);let s=this.usersByOrganizationIdAndDocumentId$.value||{},a=p({},s),c={};t?.forEach(d=>{let{organizationId:l}=d?.metadata||{};l&&(a[l]||(a[l]={}),d.documentIds?.forEach(u=>{a[l][u]||(a[l][u]={}),a[l][u]=B(p({},a[l][u]),{[d.user.userId]:d}),c[d.user.userId]=d.user}))}),this.userById$.next(p(p({},this.userById$.value),c)),this.usersByOrganizationIdAndDocumentId$.next(a)}catch(r){this.loggingService.catch("Error in ContactService updateUserDocumentContacts: ",r)}}getUserDocumentContacts$(){return this.getContactListScopeForOrganizationUsers$().pipe(v(()=>this.checkContactListScopeForOrganizationUsers([S.ALL,S.DOCUMENT])?this.userDocumentContacts$.asObservable():g([])))}getUserDocumentContacts(){return this.checkContactListScopeForOrganizationUsers([S.ALL,S.DOCUMENT])?this.userDocumentContacts$.value:[]}setCurrentOrganizationUserIAM(t){try{this.currentOrganizationUserIAM$.next(JSON.parse(JSON.stringify(t)))}catch(o){this.loggingService.catch("Error in ContactService setCurrentOrganizationUserIAM: ",o)}}getCurrentOrganizationUserIAM$(){return this.currentOrganizationUserIAM$.asObservable().pipe(oe(xt))}getCurrentOrganizationUserIAM(){return this.currentOrganizationUserIAM$.value}mergeOrganizationAndDocumentContacts(){try{this.mergeContactsDebounceTimer&&clearTimeout(this.mergeContactsDebounceTimer),this.mergeContactsDebounceTimer=setTimeout(()=>{this.executeMergeContacts()},200)}catch(t){this.loggingService.catch("Error in ContactService mergeOrganizationAndDocumentContacts: ",t)}}executeMergeContacts(){try{let t=this.getContactListScopeForOrganizationUsers(),o=[];t.includes(S.ALL)?o=[...this.getUserOrganizationContacts(),...this.getUserFolderContacts(),...this.getUserDocumentContacts()]:t.includes(S.ORGANIZATION)?o=[...this.getUserOrganizationContacts()]:t.includes(S.FOLDER)?o=[...this.getUserFolderContacts()]:t.includes(S.DOCUMENT)&&(o=[...this.getUserDocumentContacts()]);let r=[...new Map(o.filter(s=>s?.userId).map(s=>[s.userId,s])).values()];this.internalUserContacts$.next(r)}catch(t){this.loggingService.catch("Error in ContactService mergeOrganizationAndDocumentContacts: ",t)}}getOrganizationGroupsFromDb$(){try{this.getOrganizationGroupsSubscription||(this.getOrganizationGroupsSubscription=this.authService.getUser$().pipe(v(t=>t?.organizationId?g(t).pipe(v(o=>this.docService.getOrganizationConfig$().pipe(D(r=>!!r),C(()=>o))),v(o=>{if(this.setUserOrganizationGroups([]),!o)return g();let r=this.docService.getOrganizationConfig(),s=r?.organizationId,a=r?.clientOrganizationId??"";if(!s)return g();let c=o.userId??"";return vt(this.userPermissionService?.getUserPermissionsFromCacheOrFetch({organizationId:a})??Promise.resolve({})).pipe(v(d=>c&&a&&d?.[c]?.organization?.[a]?.errorCode===gi.PERMISSION_DENIED?g():this.commonDbService.dbListener({feature:"allOrganizationGroups",properties:{organizationId:s,isCollection:!0}}).pipe(C(l=>l?.data),C(l=>{l?(typeof l=="object"&&(l?.undefined&&delete l.undefined,l?.null&&delete l.null),this.setUserOrganizationGroups(Object.values(l??{}))):this.setUserOrganizationGroups([])}))))})):(this.setUserOrganizationGroups([]),g()))).subscribe(()=>{},t=>{this.loggingService.catch("Error in ContactService getOrganizationGroupsFromDb$ subscription: ",t)}))}catch{}}setUserOrganizationGroups(t){try{this.userOrganizationGroups$.next(t)}catch(o){this.loggingService.catch("Error in ContactService setUserOrganizationGroups: ",o)}}onContactSelected(t){try{if(t?.userId){let o=!!this.getUserDocumentContacts().find(s=>s.userId===t.userId),r=!!this.getUserOrganizationContacts().find(s=>s.userId===t.userId);switch(this.documentAccessType){case Tt.RESTRICTED:if(!o){let s={contact:t,isOrganizationContact:r,isDocumentContact:o,documentAccessType:this.documentAccessType};this.onContactSelectedSubject$.next(s)}break}}else{let o={contact:t,isOrganizationContact:!1,isDocumentContact:!1,documentAccessType:this.documentAccessType};this.onContactSelectedSubject$.next(o)}}catch(o){this.loggingService.catch("Error in ContactService onContactSelected: ",o)}}onContactSelected$(){return this.onContactSelectedSubject$.asObservable()}getOrganizationGroups$(){return this.getContactListScopeForOrganizationUsers$().pipe(v(()=>this.checkContactListScopeForOrganizationUsers([S.ALL,S.ORGANIZATION_USER_GROUP])?this.userOrganizationGroups$.asObservable():g([])))}enableAtHere(){try{if(this.analyticsService.setFeatureConfig({feature:it.COMMENT,config:{atHereEnabled:!0}}),this.atHereEnabled$.value===!0)return;this.atHereEnabled$.next(!0)}catch(t){this.loggingService.catch("Error in ContactService enableAtHere: ",t)}}setAtHereLabel(t){try{this.analyticsService.setFeatureConfig({feature:it.COMMENT,config:{atHereLabel:t}}),t&&this.atHereLabel$.next(t)}catch(o){this.loggingService.catch("Error in ContactService setAtHereLabel: ",o)}}setAtHereDescription(t){try{this.analyticsService.setFeatureConfig({feature:it.COMMENT,config:{atHereDescription:t}}),t&&this.atHereDescription$.next(t)}catch(o){this.loggingService.catch("Error in ContactService setAtHereDescription: ",o)}}disableAtHere(){try{if(this.analyticsService.setFeatureConfig({feature:it.COMMENT,config:{atHereEnabled:!1}}),this.atHereEnabled$.value===!1)return;this.atHereEnabled$.next(!1)}catch(t){this.loggingService.catch("Error in ContactService disableAtHere: ",t)}}getAtHereEnabled$(){return this.getContactListScopeForOrganizationUsers$().pipe(v(()=>this.checkContactListScopeForOrganizationUsers([S.ALL,S.DOCUMENT])?this.atHereEnabled$.asObservable():g(!1)))}getAtHereEnabled(){return this.checkContactListScopeForOrganizationUsers([S.ALL,S.DOCUMENT])?this.atHereEnabled$.value:!1}updateContactListScopeForOrganizationUsers(t){try{this.contactListScopeForOrganizationUsers$.next(t)}catch(o){this.loggingService.catch("Error in ContactService updateContactListScopeForOrganizationUsers: ",o)}}getContactListScopeForOrganizationUsers$(){return this.contactListScopeForOrganizationUsers$.asObservable()}getContactListScopeForOrganizationUsers(){return this.contactListScopeForOrganizationUsers$.value}checkContactListScopeForOrganizationUsers(t){return this.getContactListScopeForOrganizationUsers().some(o=>t.includes(o))}updateContactList(t,o){return j(this,null,function*(){try{this.analyticsService.trackEvent(Mt.Events.Contact.UPDATE_CONTACT_LIST_TRIGGERED,{contactsCount:t?.length,config:o}),this.usersService.setContactListUsers(t),this.customUserContacts$.next(t),this.customUserContactsConfig$.next(o)}catch(r){this.loggingService.catch("Error in CommentService updateContactList: ",r)}})}updateOrgList(t){try{let o=t?.orgList??[];this.analyticsService.trackEvent(Mt.Events.Contact.UPDATE_ORG_LIST_TRIGGERED,{orgCount:o?.length}),this.orgList$.next(o)}catch(o){this.loggingService.catch("Error in ContactService updateOrgList: ",o)}}getOrgList$(){return this.orgList$.asObservable()}getOrgList(){return this.orgList$.value}convert(t){try{if(t?.options){let{documentId:o,organizationId:r}=this.docService.getServerId(t?.options);t.options=B(p({},t?.options),{documentId:o,organizationId:r})}return this}catch(o){return this.loggingService.catch("Error in ContactService convert: ",o),this}}getContactList$(){try{return this.authService.getUser$().pipe(v(t=>t?et([this.userOrganizationContacts$.asObservable(),this.userFolderContacts$.asObservable(),this.userDocumentContacts$.asObservable(),this.userOrganizationGroups$.asObservable(),this.customUserContacts$.asObservable()]).pipe(C(([o,r,s,a,c])=>{let d={};d.organizationUsers=o?.map(u=>this.convertToClientUser(u)),d.folderUsers=r?.map(u=>this.convertToClientUser(u)),d.documentUsers=s?.map(u=>this.convertToClientUser(u)),d.updatedContactList=c?.map(u=>this.convertToClientUser(u));let l=[];return a?.forEach(u=>{let w=this.convertToClientUserGroup(u,d.organizationUsers||[]);w&&l.push(w)}),d.userGroups=l,d}),oe(xt)):g(null)),di(t=>(this.loggingService.catch("Error in ContactService getContactList$: ",t),g(null))))}catch(t){return this.loggingService.catch("Error in ContactService getContactList$: ",t),g(null)}}convertToClientUserGroup(t,o){try{let r={groupId:t?.metadata?.clientGroupId,groupName:t?.metadata?.groupName,users:[]},s={};return o?.forEach(a=>{if(a?.userId){let c=O(a.userId);s[c]=a}}),Object.keys(t?.users??{}).forEach(a=>{s[a]&&r.users?.push(s[a])}),r}catch(r){return this.loggingService.catch("Error in ContactService convertToClientUserGroup: ",r),null}}convertToClientUser(t){try{return t&&(t=JSON.parse(JSON.stringify(t)),t?.clientGroupId&&(t.groupId=t.clientGroupId,delete t.clientGroupId),t?.clientOrganizationId&&(t.organizationId=t.clientOrganizationId,delete t.clientOrganizationId),t?.userSnippylyId&&delete t.userSnippylyId),t}catch(o){return this.loggingService.catch("Error in ContactService convertToClientUser: ",o),t}}getCustomUserContacts(){return this.customUserContacts$.value}getCustomUserContacts$(){return this.customUserContacts$.asObservable()}getCustomUserContactsConfig(){return this.customUserContactsConfig$.value}getCustomUserContactsConfig$(){return this.customUserContactsConfig$.asObservable()}};i.\u0275fac=function(o){return new(o||i)(R(zn),R(Ft),R($e),R(Vn),R(jn),R(Nt),R(te),R(Hn),R($n),R(Pt))},i.\u0275prov=y({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var de={user:"componentConfigSignal.appState.user",isUserAdmin:"componentConfigSignal.appState.isUserAdmin",isKnownUser:"componentConfigSignal.appState.isKnownUser",repliesUniqueUsers:"componentConfigSignal.appState.repliesUniqueUsers",annotation:"componentConfigSignal.data.annotation",annotations:"componentConfigSignal.data.annotations",allAnnotations:"componentConfigSignal.data.allAnnotations",ghostComment:"componentConfigSignal.data.ghostComment",selectedFiles:"parentLocalUIState.selectedFiles",invalidSelectedFiles:"parentLocalUIState.invalidSelectedFiles",selectedAttachments:"parentLocalUIState.selectedAttachments",editComment:"parentLocalUIState.editComment",editCommentIndex:"parentLocalUIState.editCommentIndex",assignTo:"componentConfigSignal.data.assignTo",selectedUserContacts:"componentConfigSignal.data.selectedUserContacts",agentName:"componentConfigSignal.data.annotation.agent.agentName",agentAvatar:"componentConfigSignal.data.annotation.agent.avatar",agentResultTitle:"componentConfigSignal.data.annotation.agent.result.title",localRecordedData:"parentLocalUIState.localRecordedData",customList:"componentConfigSignal.data.customList",toOrganizationUserGroup:"componentConfigSignal.data.toOrganizationUserGroup",taggedUserContacts:"componentConfigSignal.data.taggedUserContacts",taggedGroups:"componentConfigSignal.data.taggedGroups",attachmentsToDelete:"parentLocalUIState.attachmentsToDelete",customChipData:"componentConfigSignal.data.customChipData",selectedCustomChipSet:"componentConfigSignal.data.selectedCustomChipSet",currentDialogView:"componentConfigSignal.data.currentDialogView",sidebarMode:"parentLocalUIState.sidebarMode",inboxMode:"parentLocalUIState.inboxMode",dialogMode:"parentLocalUIState.dialogMode",inlineCommentMode:"parentLocalUIState.inlineCommentMode",inlineCommentSectionMode:"parentLocalUIState.inlineCommentSectionMode",focusedThreadMode:"parentLocalUIState.focusedThreadMode",isFocusedThreadEnabled:"parentLocalUIState.isFocusedThreadEnabled",pageModeComposer:"parentLocalUIState.pageModeComposer",darkMode:"parentLocalUIState.darkMode",variant:"parentLocalUIState.variant",disabled:"parentLocalUIState.disabled",commentPinSelected:"parentLocalUIState.commentPinSelected",fullExpanded:"parentLocalUIState.fullExpanded",commentDialogSelected:"parentLocalUIState.commentDialogSelected",readOnly:"parentLocalUIState.readOnly",dialogShadowDOM:"parentLocalUIState.dialogShadowDOM",locationVersion:"parentLocalUIState.locationVersion",composerPosition:"parentLocalUIState.composerPosition",dialogOpenedInSidebar:"parentLocalUIState.dialogOpenedInSidebar",expandOnSelection:"parentLocalUIState.expandOnSelection",selectedVisibility:"parentLocalUIState.selectedVisibility",selectedVisibilityUsers:"parentLocalUIState.selectedVisibilityUsers",containerComponentId:"componentConfigSignal.uiState.containerComponentId",isPrivateComment:"componentConfigSignal.uiState.isPrivateComment",assignToMenuOpened:"parentLocalUIState.assignToMenuOpened",showGhostCommentMessage:"componentConfigSignal.uiState.showGhostCommentMessage",showReplies:"componentConfigSignal.uiState.showReplies",collapsedComments:"componentConfigSignal.uiState.collapsedComments",collapsedRepliesPreview:"componentConfigSignal.uiState.collapsedRepliesPreview",showAllComments:"componentConfigSignal.uiState.showAllComments",composerContent:"parentLocalUIState.composerContent",composerContentHTML:"parentLocalUIState.composerContentHTML",composerInOpenState:"parentLocalUIState.composerInOpenState",composerMode:"componentConfigSignal.uiState.composerMode",multiThreadAnnotationId:"componentConfigSignal.uiState.multiThreadAnnotationId",maxReplyAvatars:"componentConfigSignal.uiState.maxReplyAvatars",showSuggestionModeActions:"componentConfigSignal.uiState.showSuggestionModeActions",uploadingAttachments:"componentConfigSignal.uiState.uploadingAttachments",playVideoInFullScreen:"componentConfigSignal.uiState.playVideoInFullScreen",commentDialogUniqueId:"componentConfigSignal.uiState.commentDialogUniqueId",recorderInitConfig:"componentConfigSignal.uiState.recorderInitConfig",isInputFocused:"componentConfigSignal.uiState.isInputFocused",showCommentButtons:"componentConfigSignal.uiState.showCommentButtons",isAutocompleteDropdownOpen:"componentConfigSignal.uiState.isAutocompleteDropdownOpen",bottomSheetMode:"componentConfigSignal.uiState.bottomSheetMode",commentComposerMode:"componentConfigSignal.uiState.commentComposerMode",shouldScrollToBottom:"componentConfigSignal.uiState.shouldScrollToBottom",deviceType:"componentConfigSignal.uiState.deviceType",showReplyComposer:"componentConfigSignal.uiState.showReplyComposer",reactionToolOpenIndex:"parentLocalUIState.reactionToolOpenIndex",openDropdownIndexValue:"parentLocalUIState.openDropdownIndexValue",hasReactionsByCommentId:"componentConfigSignal.uiState.hasReactionsByCommentId",newComment:"parentLocalUIState.composerContent",newCommentHTML:"parentLocalUIState.composerContentHTML",canResolveAnnotation:"componentConfigSignal.featureState.canResolveAnnotation",canUnresolveAnnotation:"componentConfigSignal.featureState.canUnresolveAnnotation",dialogSelectedByKnownUser:"componentConfigSignal.featureState.dialogSelectedByKnownUser",resolveStatusAccessAdminOnly:"componentConfigSignal.featureState.resolveStatusAccessAdminOnly",enableResolve:"componentConfigSignal.featureState.enableResolve",isPlanExpired:"componentConfigSignal.featureState.isPlanExpired",moderatorMode:"componentConfigSignal.featureState.moderatorMode",enableAutoCategorize:"componentConfigSignal.featureState.enableAutoCategorize",suggestionMode:"componentConfigSignal.featureState.suggestionMode",commentAcceptedStatus:"componentConfigSignal.featureState.commentAcceptedStatus",commentRejectedStatus:"componentConfigSignal.featureState.commentRejectedStatus",enableSignInButton:"componentConfigSignal.featureState.enableSignInButton",enableUpgradeButton:"componentConfigSignal.featureState.enableUpgradeButton",enableGhostCommentsMessage:"componentConfigSignal.featureState.enableGhostCommentsMessage",replyAvatars:"componentConfigSignal.featureState.replyAvatars",userMentions:"componentConfigSignal.featureState.userMentions",recordingSummaryEnabled:"componentConfigSignal.featureState.recordingSummaryEnabled",enableAttachment:"componentConfigSignal.featureState.enableAttachment",allowedFileTypes:"componentConfigSignal.featureState.allowedFileTypes",allowedRecordings:"componentConfigSignal.featureState.allowedRecordings",screenSharingSupported:"componentConfigSignal.featureState.screenSharingSupported",enterKeyToSubmit:"componentConfigSignal.featureState.enterKeyToSubmit",deleteOnBackspace:"componentConfigSignal.featureState.deleteOnBackspace",showScreenSizeInfo:"componentConfigSignal.uiState.showScreenSizeInfo",enableReactions:"componentConfigSignal.featureState.enableReactions",isInsidePdfViewer:"componentConfigSignal.featureState.isInsidePdfViewer",sidebarButtonOnCommentDialogVisible:"componentConfigSignal.uiState.sidebarButtonOnCommentDialogVisible",enableStatus:"componentConfigSignal.featureState.enableStatus",customStatusesShown:"componentConfigSignal.featureState.customStatusesShown",statusOptions:"componentConfigSignal.featureState.statusOptions",enablePriority:"componentConfigSignal.featureState.enablePriority",visibilityOptions:"componentConfigSignal.featureState.visibilityOptions",priorityOptions:"componentConfigSignal.featureState.priorityOptions",enableAssignment:"componentConfigSignal.featureState.enableAssignment",enableNotifications:"componentConfigSignal.featureState.enableNotifications",enableEdit:"componentConfigSignal.featureState.enableEdit",enableDelete:"componentConfigSignal.featureState.enableDelete",enablePrivateMode:"componentConfigSignal.featureState.enablePrivateMode",deleteThreadWithFirstComment:"componentConfigSignal.featureState.deleteThreadWithFirstComment",seenByUsers:"componentConfigSignal.featureState.seenByUsers",allowAssignment:"componentConfigSignal.featureState.enableAssignment",allowToggleNotification:"componentConfigSignal.featureState.enableNotifications",allowEdit:"componentConfigSignal.featureState.enableEdit",allowChangeCommentAccessMode:"componentConfigSignal.featureState.enablePrivateMode",notificationEnabled:"notificationEnabled",mainCommentId:"componentConfigSignal.data.annotation.comments.0.commentId",commentObj:"commentObj",commentIndex:"commentIndex",userContact:"selectorItem.contact",comment:"commentObj",commentAnnotation:"componentConfigSignal.data.annotation",commentAnnotations:"componentConfigSignal.data.annotations",context:"parentLocalUIState.context",focusedAnnotation:"focusedAnnotation",notification:"notification",unreadNotificationsForYou:"componentConfigSignal.data.unreadNotificationsForYou",notificationsPanelVisible:"componentConfigSignal.uiState.notificationsPanelVisible",notificationsForYouInSession:"componentConfigSignal.data.notificationsForYouInSession",notificationsInSession:"componentConfigSignal.data.notificationsInSession",notificationsByUserMap:"componentConfigSignal.data.notificationsByUserMap",notificationsByDocumentId:"componentConfigSignal.data.notificationsByDocumentId",notificationsByDate:"componentConfigSignal.data.notificationsByDate",currentDocumentName:"componentConfigSignal.data.currentDocumentName",settingsConfig:"componentConfigSignal.data.settingsConfig",settingsSelectedOption:"componentConfigSignal.data.settingsSelectedOption",selectedTab:"componentConfigSignal.uiState.selectedTab",tabConfig:"componentConfigSignal.uiState.tabConfig",TABS:"componentConfigSignal.uiState.TABS",tabPage:"componentConfigSignal.uiState.tabPage",pageSize:"componentConfigSignal.uiState.pageSize",panelOpenMode:"componentConfigSignal.uiState.panelOpenMode",settingsOpen:"componentConfigSignal.uiState.settingsOpen",settingsAccordionExpanded:"componentConfigSignal.uiState.settingsAccordionExpanded",settingsMutedAll:"componentConfigSignal.uiState.settingsMutedAll",settingsItemRecentlyClosed:"componentConfigSignal.uiState.settingsItemRecentlyClosed",settingsLayout:"componentConfigSignal.uiState.settingsLayout",tabCount:"componentConfigSignal.uiState.tabCount",usersExpanded:"componentConfigSignal.uiState.usersExpanded",documentExpanded:"componentConfigSignal.uiState.documentExpanded",shadowDom:"componentConfigSignal.uiState.shadowDom",settingsEnabled:"componentConfigSignal.featureState.settingsEnabled",selectedMinimalFilterDropdownOption:"selectedMinimalFilterDropdownOption",appliedFiltersCount:"appliedFiltersCount",filteredCommentAnnotationsCount:"filteredCommentAnnotationsCount",unreadCommentAnnotationCount:"unreadCommentAnnotationCount",isEnabled:"componentConfigSignal.featureState.isEnabled",allActivities:"componentConfigSignal.data.allActivities",filteredActivities:"componentConfigSignal.data.filteredActivities",groupedActivities:"componentConfigSignal.data.groupedActivities",virtualScrollItems:"componentConfigSignal.data.virtualScrollItems",activeFilter:"componentConfigSignal.data.activeFilter",availableFilters:"componentConfigSignal.data.availableFilters",isOpen:"componentConfigSignal.uiState.isOpen",expandedGroups:"componentConfigSignal.uiState.expandedGroups",defaultVisibleCount:"componentConfigSignal.uiState.defaultVisibleCount",filterDropdownOpen:"componentConfigSignal.uiState.filterDropdownOpen",activity:"activityRecord",activityRecord:"activityRecord",dateGroup:"dateGroup",filter:"filterOption",filterOption:"filterOption",isActive:"isActive",isExpanded:"isExpanded",remainingCount:"remainingCount",showAdder:"componentConfigSignal.uiState.showAdder",commentToolEnabled:"componentConfigSignal.uiState.commentToolEnabled",isUserAllowed:"componentConfigSignal.uiState.isUserAllowed",enableTextComments:"componentConfigSignal.uiState.enableTextComments",rewriterEnabled:"componentConfigSignal.uiState.rewriterEnabled",rewriterDefaultUIEnabled:"componentConfigSignal.uiState.rewriterDefaultUIEnabled",selectedWordsCount:"componentConfigSignal.data.selectedWordsCount",selectedCharactersCount:"componentConfigSignal.data.selectedCharactersCount",allowedElementIds:"componentConfigSignal.data.allowedElementIds",contextId:"componentConfigSignal.data.contextId",position:"componentConfigSignal.data.position",MIN_ALLOWED_WORDS_COUNT:"componentConfigSignal.uiState.MIN_ALLOWED_WORDS_COUNT",MIN_ALLOWED_CHARACTERS_COUNT:"componentConfigSignal.uiState.MIN_ALLOWED_CHARACTERS_COUNT",MAX_ALLOWED_CHARACTERS_COUNT:"componentConfigSignal.uiState.MAX_ALLOWED_CHARACTERS_COUNT",filteredAnnotations:"componentConfigSignal.data.filteredAnnotations",multiThreadCommentAnnotation:"componentConfigSignal.data.multiThreadCommentAnnotation",nonDraftCommentsCount:"componentConfigSignal.data.nonDraftCommentsCount",commentPinType:"componentConfigSignal.uiState.commentPinType",hideMultiThreadAnnotationComposer:"componentConfigSignal.uiState.hideMultiThreadAnnotationComposer",dialogVariant:"componentConfigSignal.uiState.dialogVariant",minimalFilter:"componentConfigSignal.uiState.minimalFilter",minimalFilterDropdownOpen:"componentConfigSignal.uiState.minimalFilterDropdownOpen",minimalActionsDropdownOpen:"componentConfigSignal.uiState.minimalActionsDropdownOpen",noCommentsFoundForAppliedFilters:"componentConfigSignal.uiState.noCommentsFoundForAppliedFilters",noCommentsFound:"componentConfigSignal.uiState.noCommentsFound",isSelected:"isSelected",composerCommentAnnotation:"componentConfigSignal.data.composerCommentAnnotation",statuses:"componentConfigSignal.data.statuses",skeletonLoading:"componentConfigSignal.uiState.skeletonLoading",filterState:"componentConfigSignal.uiState.filterState",sortState:"componentConfigSignal.uiState.sortState",isResolvedCommentsOnDomFilterSelected:"componentConfigSignal.uiState.isResolvedCommentsOnDomFilterSelected",resolvedCommentsOnDom:"componentConfigSignal.uiState.resolvedCommentsOnDom",selectedAnnotationsMap:"componentConfigSignal.uiState.selectedAnnotationsMap",selectedAnnotationsLocationMap:"componentConfigSignal.uiState.selectedAnnotationsLocationMap",composerVariant:"parentLocalUIState.composerVariant",multiThread:"parentLocalUIState.multiThread",commentPlaceholder:"parentLocalUIState.commentPlaceholder",replyPlaceholder:"parentLocalUIState.replyPlaceholder",composerPlaceholder:"parentLocalUIState.composerPlaceholder",editPlaceholder:"parentLocalUIState.editPlaceholder",editCommentPlaceholder:"parentLocalUIState.editCommentPlaceholder",editReplyPlaceholder:"parentLocalUIState.editReplyPlaceholder",targetElementId:"parentLocalUIState.targetElementId",folderId:"parentLocalUIState.folderId",veltFolderId:"parentLocalUIState.veltFolderId",clientDocumentId:"parentLocalUIState.clientDocumentId",documentId:"parentLocalUIState.documentId",locationId:"parentLocalUIState.locationId",contextOptions:"parentLocalUIState.contextOptions",messageTruncation:"parentLocalUIState.messageTruncation",messageTruncationLines:"parentLocalUIState.messageTruncationLines",unresolvedAnnotationsCount:"componentConfigSignal.data.unresolvedAnnotationsCount",unreadCount:"componentConfigSignal.data.unreadCount",commentBubbleTargetPinHover:"parentLocalUIState.commentBubbleTargetPinHover",openDialog:"parentLocalUIState.openDialog",showAvatar:"parentLocalUIState.showAvatar",commentCountType:"parentLocalUIState.commentCountType"},cs=["user","annotation","annotations","allAnnotations","userContact","comment","commentAnnotation","commentAnnotations","recorderInitConfig","ghostComment","editComment","assignTo","customChipData","currentDialogView","context","focusedAnnotation","notification","selectedMinimalFilterDropdownOption","unreadNotificationsForYou","notificationsForYouInSession","notificationsInSession","notificationsByUserMap","notificationsByDocumentId","notificationsByDate","settingsConfig","settingsSelectedOption","settingsAccordionExpanded","tabConfig","tabPage","TABS","allActivities","filteredActivities","groupedActivities","virtualScrollItems","availableFilters","expandedGroups","activity","activityRecord","dateGroup","filter","filterOption","position","allowedElementIds","filteredAnnotations","multiThreadCommentAnnotation","composerCommentAnnotation","statuses","filterState","sortState","selectedAnnotationsMap","selectedAnnotationsLocationMap","contextOptions"],ai=(()=>{let _DynamicDataService=class _DynamicDataService{constructor(n,i,e,t,o,r){this.authService=n,this.serviceBook=i,this.loggingService=e,this.injector=t,this.docService=o,this.configService=r,this.subscriptions=[],this.commonData$=new b({}),this.evaluateConditionTriggered=new z,this.conditionRegex=/\{(.*?)\}/g,this.extractedProps={},this.condition="",this.dataComponentConfigSignal=$({});try{this.subscriptions.push(this.authService.getUser$().subscribe(s=>{this.commonData$.next(B(p({},this.commonData$.value),{user:s}))})),this.subscriptions.push(this.serviceBook.observe(nt).pipe(D(Boolean),v(s=>s.getUnreadCommentAnnotationCountOnCurrentDocument$())).subscribe(s=>{this.commonData$.next(B(p({},this.commonData$.value),{unreadCommentAnnotationCount:s?.count||0}))})),this.subscriptions.push(this.serviceBook.observe(nt).pipe(D(Boolean),v(s=>s.getUnreadCommentCountOnCurrentDocument$())).subscribe(s=>{this.commonData$.next(B(p({},this.commonData$.value),{unreadCommentCount:s?.count||0}))})),this.subscriptions.push(this.docService.getUIState$().subscribe(s=>{this.commonData$.next(p(p({},this.commonData$.value),s))})),this.subscriptions.push(this.getCommonData().subscribe(s=>{this.dataComponentConfigSignal.update(a=>(a=p(p({},a),s),a)),this.executeConditionalClasses()})),this.subscriptions.push(this.evaluateConditionTriggered.subscribe(s=>{this.extractedProps=s.extractedProps,this.evaluateCondition(s.className,s.elementRef,s.condition)}))}catch(s){this.loggingService.catch("Error in DynamicDataService constructor: ",s)}}ngOnDestroy(){try{this.subscriptions.forEach(n=>n.unsubscribe())}catch(n){this.loggingService.catch("Error in DynamicDataService ngOnDestroy: ",n)}}getCommonData(){return this.commonData$.asObservable()}getModifiedPathBasedOnCondition(n,i){try{return Object.keys(i).forEach(e=>{i[e].path=this.modifyPathBasedOnCondition(e,n)}),i}catch(e){this.loggingService.catch("Error in DynamicDataService getModifiedPathBasedOnCondition: ",e)}}getComputedValues(n,i,e,t,o,r){try{Object.keys(e).forEach(s=>{let a;if(Fe(n)?a=pi(()=>mi(n(),e[s].path)):a=pi(()=>mi(n,e[s].path)),Fe(a()))ze(()=>{try{let c=a()();e[s].value=c,this.evaluateConditionTriggered.emit({extractedProps:e,className:t,elementRef:o,condition:r})}catch{}},{injector:this.injector});else{let c=a();e[s].value=c,this.evaluateConditionTriggered.emit({extractedProps:e,className:t,elementRef:o,condition:r})}})}catch(s){this.loggingService.catch("Error in DynamicDataService getComputedValues: ",s)}}modifyPathBasedOnCondition(n,i){try{let e=n.match(/^([^\.\[]+)/),t=e?e[1]:n,o=n.slice(t.length);if(de[n])return de[n];if(["commentDialogOptionsDropdownConfigSignal","commentDialogStatusDropdownConfigSignal"].includes(t)&&o.startsWith(".")){let s=o.slice(1),a=s.match(/^([^\.\[]+)/),c=a?a[1]:s,d=s.slice(c.length);return de[c]?de[c]+d:"componentConfigSignal."+s}if(t&&i&&typeof i=="function"){let s=i();if(s&&t in s){let c=n.match(/\[(.*?)\]/);if(c&&c[1]){let d=c[1];if(d.includes(".")){let l=d.split(".")[0];if(de[l]){let u=d.replace(l,de[l]);return n.replace(`[${d}]`,`[${u}]`)}return l&&s&&l in s?n:n.replace(`[${d}]`,`[componentConfigSignal.${d}]`)}}return n}let a=s?.componentConfigSignal;if(a&&typeof a=="function"){let c=a();if(c&&t in c)return"componentConfigSignal."+n}}return de[t]?cs.includes(t)?de[t]+o:de[t]:"componentConfigSignal."+n}catch(e){return this.loggingService.catch("Error in DynamicDataService modifyPathBasedOnCondition: ",e),n}}applyConditionalClasses(n,i){try{this.elementRef=n,this.data=i}catch(e){this.loggingService.catch("Error in DynamicDataService applyConditionalClasses: ",e)}}executeConditionalClasses(){try{let n=this.getHostElementAttributes(this.elementRef),e=[...Object.keys(n).filter(t=>t.startsWith("velt-class-")).map(t=>({name:t,value:n[t]}))];if(n["velt-class"]){let t=n["velt-class"],o=/'([^']+)':\s*([^,]+)(?:,|$)/g,r=[],s=0,a=100,c;for(;(c=o.exec(t))!==null;){if(s++>a){this.loggingService.catch("Too many class definitions detected.");break}if(c.length<3)continue;let[,d,l]=c;!d||!l||d.split(" ").forEach(u=>{u.trim()&&r.push({name:`velt-class-${u.trim()}`,value:l.trim()})})}e=[...e,...r]}this.data&&typeof this.data=="object"&&Object.keys(this.data).forEach(t=>{this.updateDataComponentConfigSignal(t,this.data[t])}),e.forEach(t=>{let o=t.name.replace("velt-class-","");this.condition=t.value,this.condition&&(this.extractProps(),this.extractedProps=this.getModifiedPathBasedOnCondition(this.dataComponentConfigSignal,this.extractedProps),this.getComputedValues(this.dataComponentConfigSignal,this.evaluateCondition,this.extractedProps,o,this.elementRef,t.value))})}catch(n){this.loggingService.catch("Error in DynamicDataService applyConditionalClasses: ",n)}}updateDataComponentConfigSignal(n,i){try{n==="dataComponentConfigSignal"?this.dataComponentConfigSignal.set(i):this.dataComponentConfigSignal.update(e=>B(p({},e),{[n]:i}))}catch(e){this.loggingService.catch("Error in DataComponent updateDataComponentConfigSignal: ",e)}}extractProps(){try{this.extractedProps={},this.conditionRegex.lastIndex=0;let n;for(;(n=this.conditionRegex.exec(this.condition))!==null;){let i=n[1];this.extractedProps[i]={value:null,path:null,isDynamicPath:this.hasDynamicParts(i)}}}catch(n){this.loggingService.catch("Error in DynamicDataService extractProps: ",n)}}hasDynamicParts(n){try{let i=/\[[^\]'"]*[^\]'"]\]/.test(n),e=/\[[^[\]]*[\.\[][^[\]]*\]/.test(n);return i||e}catch(i){return this.loggingService.catch("Error checking for dynamic path: ",i),!1}}evaluateCondition(n,i,e){try{if(e){let t=this.extractedProps,o=e.replace(this.conditionRegex,(a,c)=>{let d=t[c];if(d&&d.value!==void 0){let l=d.value;return typeof l=="string"?`'${l}'`:typeof l=="boolean"||typeof l=="number"?String(l):l===null?"null":typeof l=="object"?l?"true":"false":String(l)}return"false"}),r=this.sanitizeCondition(o),s=this.safeEval(r);return n&&i&&(s?this.setHostElementClasses(i,n):this.removeHostElementClasses(i,n)),s}return!1}catch(t){return this.loggingService.catch("Error in IfComponent evaluateCondition: ",t),!1}}sanitizeCondition(n){try{return n.replace(/[^a-zA-Z0-9\s\+\-\*\/\%\(\)\!\=\<\>\|\&\.\[\]\{\},'"]/g,"")}catch(i){return this.loggingService.catch("Error in IfComponent sanitizeCondition: ",i),""}}safeEval(expression){try{if(this.configService.getSafeEval()){let n=this.tokenize(expression.trim());return this.evaluateTokens(n)}else return eval(expression)}catch(n){return this.loggingService.catch("safeEval error",n),!1}}tokenize(n){try{if(!n||n.trim()==="")return[];let i=[],e=0;for(;e<n.length;){let t=n[e];if(/\s/.test(t)){e++;continue}if(t==='"'||t==="'"){let o=t,r="";for(e++;e<n.length;)if(n[e]==="\\"&&e+1<n.length)r+=n[e+1],e+=2;else if(n[e]===o){e++;break}else r+=n[e],e++;i.push({type:"string",value:r});continue}if(t==="("){i.push({type:"lparen",value:"("}),e++;continue}if(t===")"){i.push({type:"rparen",value:")"}),e++;continue}if(e<n.length-2&&n.substring(e,e+3)==="==="){i.push({type:"operator",value:"===",precedence:4}),e+=3;continue}if(e<n.length-2&&n.substring(e,e+3)==="!=="){i.push({type:"operator",value:"!==",precedence:4}),e+=3;continue}if(e<n.length-1&&n.substring(e,e+2)==="&&"){i.push({type:"operator",value:"&&",precedence:2}),e+=2;continue}if(e<n.length-1&&n.substring(e,e+2)==="||"){i.push({type:"operator",value:"||",precedence:1}),e+=2;continue}if(e<n.length-1&&n.substring(e,e+2)==="<="){i.push({type:"operator",value:"<=",precedence:4}),e+=2;continue}if(e<n.length-1&&n.substring(e,e+2)===">="){i.push({type:"operator",value:">=",precedence:4}),e+=2;continue}if(e<n.length-1&&n.substring(e,e+2)==="=="){i.push({type:"operator",value:"==",precedence:4}),e+=2;continue}if(e<n.length-1&&n.substring(e,e+2)==="!="){i.push({type:"operator",value:"!=",precedence:4}),e+=2;continue}if(t==="!"){i.push({type:"unary",value:"!",precedence:5}),e++;continue}if(t==="<"){i.push({type:"operator",value:"<",precedence:4}),e++;continue}if(t===">"){i.push({type:"operator",value:">",precedence:4}),e++;continue}if(/[a-zA-Z0-9._]/.test(t)){let o="";for(;e<n.length&&/[a-zA-Z0-9._]/.test(n[e]);)o+=n[e],e++;/^-?\d+(\.\d+)?$/.test(o)?i.push({type:"number",value:parseFloat(o)}):o==="true"||o==="false"?i.push({type:"boolean",value:o==="true"}):o==="null"?i.push({type:"null",value:null}):o==="undefined"?i.push({type:"undefined",value:void 0}):i.push({type:"identifier",value:o});continue}e++}return i}catch(i){return this.loggingService.catch("tokenize error",i),[]}}evaluateTokens(n){try{if(!n||n.length===0)return!1;let i=this.infixToPostfix(n);return this.evaluatePostfix(i)}catch(i){return this.loggingService.catch("evaluateTokens error",i),!1}}infixToPostfix(n){try{let i=[],e=[];for(let t of n)if(t.type==="string"||t.type==="number"||t.type==="boolean"||t.type==="null"||t.type==="undefined"||t.type==="identifier")i.push(t);else if(t.type==="unary")e.push(t);else if(t.type==="operator"){for(;e.length>0;){let o=e[e.length-1];if(o.type==="lparen"||o.precedence!==void 0&&o.precedence<t.precedence)break;i.push(e.pop())}e.push(t)}else if(t.type==="lparen")e.push(t);else if(t.type==="rparen"){for(;e.length>0&&e[e.length-1].type!=="lparen";)i.push(e.pop());e.length>0&&e.pop()}for(;e.length>0;){let t=e.pop();t.type!=="lparen"&&t.type!=="rparen"&&i.push(t)}return i}catch(i){return this.loggingService.catch("infixToPostfix error",i),[]}}evaluatePostfix(n){try{let i=[];for(let e of n)if(e.type==="string"||e.type==="number"||e.type==="boolean"||e.type==="null"||e.type==="undefined"||e.type==="identifier")i.push(e.value);else if(e.type==="unary"){if(i.length>=1){let t=i.pop();e.value==="!"&&i.push(!this.isTruthy(t))}}else if(e.type==="operator"&&i.length>=2){let t=i.pop(),o=i.pop();e.value==="&&"?i.push(this.isTruthy(o)&&this.isTruthy(t)):e.value==="||"?i.push(this.isTruthy(o)||this.isTruthy(t)):i.push(this.compare(o,t,e.value))}return i.length===1?this.isTruthy(i[0]):!1}catch(i){return this.loggingService.catch("evaluatePostfix error",i),!1}}parseValue(n){try{let i=n.trim();return i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'")?i.substring(1,i.length-1):/^-?\d+(\.\d+)?$/.test(i)?parseFloat(i):i==="true"?!0:i==="false"?!1:i==="null"?null:i==="undefined"?void 0:i}catch(i){return this.loggingService.catch("parseValue error",i),n}}compare(n,i,e){try{switch(e){case"===":return n===i;case"!==":return n!==i;case"==":return n==i;case"!=":return n!=i;case"<":return n<i;case">":return n>i;case"<=":return n<=i;case">=":return n>=i;default:return!1}}catch(t){return this.loggingService.catch("compare error",t),!1}}isTruthy(n){try{return n==null||n===""||n==="false"?!1:n==="true"?!0:typeof n=="number"?n!==0:!!n}catch(i){return this.loggingService.catch("isTruthy error",i),!1}}getHostElementAttributes(n){try{let i=n,e={};for(let t of i.attributes)e[t.name]=t.value;return e}catch{return{}}}setHostElementClasses(n,i){try{n.classList.add(i)}catch{}}removeHostElementClasses(n,i){try{n.classList.remove(i)}catch{}}};_DynamicDataService.\u0275fac=function(i){return new(i||_DynamicDataService)(R(Ft),R(Pt),R(te),R(E),R(Nt),R($e))},_DynamicDataService.\u0275prov=y({token:_DynamicDataService,factory:_DynamicDataService.\u0275fac,providedIn:"root"});let DynamicDataService=_DynamicDataService;return DynamicDataService})();var qo=(()=>{let i=class i{constructor(t,o){this.loggingService=t,this.configService=o,this.darkMode$=new b(!1)}setDarkMode(t){try{let o=document.documentElement;if(!o)return;t?o.setAttribute(je.ATTRIBUTES.VELT_THEME,"dark"):o.removeAttribute(je.ATTRIBUTES.VELT_THEME),this.darkMode$.next(t)}catch(o){this.loggingService.catch("Error in theme service setDarkMode: ",o)}}getDarkMode$(){return this.darkMode$.asObservable()}updateListenerOnConfigChange(){try{this.configService.getConfig$().subscribe(t=>{if(t&&t.usePrefersColorScheme){this.enablePrefersColorScheme();return}this.disablePrefersColorScheme()})}catch(t){this.loggingService.catch("Error in theme service updateListenerOnConfigChange: ",t)}}enablePrefersColorScheme(){try{if(this.disablePrefersColorScheme(),!window.matchMedia)return;this.darkModeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.setDarkMode(this.darkModeQuery.matches),this.darkModeQueryListener=t=>{this.setDarkMode(t.matches)},this.darkModeQuery.addEventListener("change",this.darkModeQueryListener)}catch(t){this.loggingService.catch("Error in theme service enablePrefersColorScheme: ",t)}}disablePrefersColorScheme(){try{this.darkModeQuery&&this.darkModeQueryListener&&this.darkModeQuery.removeEventListener("change",this.darkModeQueryListener)}catch(t){this.loggingService.catch("Error in theme service disablePrefersColorScheme: ",t)}}};i.\u0275fac=function(o){return new(o||i)(R(te),R($e))},i.\u0275prov=y({token:i,factory:i.\u0275fac,providedIn:"root"});let n=i;return n})();var Jo=(()=>{let i=class i{set veltIf(t){try{t&&this.setIfCondition(t)}catch(o){this._loggingService.catch("Error in BaseComponent set veltIf:",o)}}constructor(t,o,r){this._elementRef=t,this._dynamicDataService=o,this._loggingService=r,this.componentConfigSignal=$({}),this.veltElement=!0,this.conditionSignal=$(null)}initializeComponentConfigSignal(t){try{this.componentConfigSignal.set(t)}catch(o){this._loggingService.catch("Error in BaseComponent initializeComponentConfigSignal:",o)}}ngOnInit(){try{this._dynamicDataService.applyConditionalClasses(this._elementRef?.nativeElement,{componentConfigSignal:this.componentConfigSignal})}catch(t){this._loggingService.catch("Error in BaseComponent ngOnInit:",t)}}ngOnDestroy(){}setIfCondition(t){try{this.conditionSignal.set(t)}catch(o){this._loggingService.catch("Error in BaseComponent setIfCondition:",o)}}};i.\u0275fac=function(o){return new(o||i)(Z(k),Z(ai),Z(te))},i.\u0275cmp=W({type:i,selectors:[["app-base"]],hostVars:1,hostBindings:function(o,r){o&2&&fe("data-velt-element",r.veltElement)},inputs:{componentConfigSignal:"componentConfigSignal",template:"template",wireframe:"wireframe",veltIf:"veltIf"},standalone:!1,decls:0,vars:0,template:function(o,r){},encapsulation:2});let n=i;return n})();var fh=(()=>{let i=class i extends Jo{onDarkModeChange(){return this.darkModeSubject$.asObservable()}constructor(t,o,r,s,a,c,d){super(t,c,d),this._elementRef=t,this._themeService=o,this._changeDetector=r,this._featureService=s,this._componentDarkModeObservable=a,this._componentDarkMode=null,this._globalDarkMode=!1,this._featureDarkMode=!1,this._themeSubscriptions=[],this._darkMode=!1,this.darkMode=!1,this.darkModeSubject$=new b(!1);try{if(this._themeSubscriptions.push(this._themeService.getDarkMode$().subscribe(l=>{this._globalDarkMode=l,this.setDarkMode()})),this._featureService){let l=this._featureService;typeof l.getCommentContainerDarkMode=="function"?this._themeSubscriptions.push(l.getCommentContainerDarkMode().subscribe(u=>{this._featureDarkMode=u,this.setDarkMode()})):typeof l.getDarkMode$=="function"&&this._themeSubscriptions.push(l.getDarkMode$().subscribe(u=>{u!==null&&(this._featureDarkMode=u),this.setDarkMode()}))}this._componentDarkModeObservable&&this._componentDarkModeObservable instanceof Ce&&this._themeSubscriptions.push(this._componentDarkModeObservable.subscribe(l=>{this._componentDarkMode=l,this.setDarkMode()}))}catch{}}ngOnInit(){super.ngOnInit()}ngOnChanges(t){try{if(t._darkMode){let o=t._darkMode.currentValue;typeof o=="string"&&(o=o==="true"),this._componentDarkMode=o,this.setDarkMode()}}catch{}}setComponentDarkMode(t){try{this._componentDarkMode=t,this.setDarkMode()}catch{}}setDarkMode(){try{this._componentDarkMode===null?this._featureDarkMode?this.darkMode=!0:this.darkMode=!!this._globalDarkMode:this.darkMode=!!this._componentDarkMode,this.darkMode?this._elementRef.nativeElement.hasAttribute("dark")||this._elementRef.nativeElement.setAttribute("dark",""):this._elementRef.nativeElement.hasAttribute("dark")&&this._elementRef.nativeElement.removeAttribute("dark"),this.darkModeSubject$.next(this.darkMode),this._changeDetector&&this._changeDetector.markForCheck()}catch{}}ngOnDestroy(){try{super.ngOnDestroy(),this._themeSubscriptions.forEach(t=>{t.unsubscribe()})}catch{}}};i.\u0275fac=function(o){return new(o||i)(Z(k),Z(qo),Z(Ve),Z("FeatureService",8),Z(Ce),Z(ai),Z(te))},i.\u0275cmp=W({type:i,selectors:[["app-themed"]],inputs:{_darkMode:[0,"darkMode","_darkMode"]},standalone:!1,features:[Y,re],decls:0,vars:0,template:function(o,r){},encapsulation:2,changeDetection:0});let n=i;return n})();export{qn as a,Ht as b,ie as c,Mi as d,Pi as e,ce as f,Ee as g,Xe as h,le as i,Zn as j,sr as k,we as l,Qn as m,ur as n,yi as o,Ci as p,ge as q,We as r,Ae as s,$t as t,ct as u,ke as v,me as w,Ze as x,qt as y,Te as z,Oi as A,Ri as B,Qe as C,fo as D,dt as E,po as F,Ai as G,vr as H,ht as I,Sr as J,Ir as K,vo as L,$a as M,Er as N,Ha as O,Or as P,Ga as Q,Wa as R,Ya as S,Xa as T,yo as U,qa as V,Ja as W,ec as X,tc as Y,ic as Z,nc as _,oc as $,rc as aa,bo as ba,sc as ca,ac as da,cc as ea,Do as fa,Li as ga,Ro as ha,Vi as ia,Wi as ja,Yi as ka,Zl as la,Ql as ma,Gi as na,Xi as oa,$i as pa,Hi as qa,Lo as ra,Je as sa,Go as ta,ri as ua,es as va,ts as wa,is as xa,ns as ya,os as za,Gd as Aa,ai as Ba,qo as Ca,Jo as Da,fh as Ea};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Aa as F}from"./chunk-NCVN3JXT.js";import{$ as A,Ai as U,Cf as g,Ch as D,E as h,Ee as $,Fi as C,G as d,J as v,L as l,Pi as w,T as n,Xe as M,ca as s,ji as E,ki as R,l as p,li as y,qh as I,r as u,te as a,ti as k,ue as m,v as c}from"./chunk-CRZGZZVQ.js";var Z=(()=>{let o=class o{constructor(e,t,r,b,f,W,T,j){this.analyticsService=e,this.authService=t,this.contactService=r,this.databaseService=b,this.docService=f,this.configService=W,this.loggingService=T,this.commonDbService=j,this.documentIAM$=new p(null),this.workspaceIAM$=new p(null),this.roles$=new p([]),this.getDocumentIamSubscription=null,this.getOrganizationIamSubscription=null,this.getWorkspaceIamSubscription=null;try{this.authService.setIamService(this),this.databaseService.getDb().pipe(h(i=>!!i),v(1)).subscribe(i=>{i&&(this.getUser(),this.getDocumentPaths())},i=>{this.loggingService.catch("Error in CommentService getDb subscription: ",i)}),this.getRole$().pipe(v(1)).subscribe(i=>{this.authService?.getUser()&&!i&&this.analyticsService.trackEvent(D.Events.Iam.USER_ACCESS_DENIED)}),this.documentIAM$.subscribe(i=>{i?.accessType&&this.contactService.setDocumentAccessType(i.accessType)})}catch(i){this.loggingService.catch("Error in IamService constructor: ",i)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache in IamService","color: green;");try{this.documentIAM$.next(null),this.workspaceIAM$.next(null),this.roles$.next([]),this.documentPaths=null}catch(e){this.loggingService.catch("Error in IamService clearCache: ",e)}}getUser(){try{this.authService.getUser$().pipe(h(e=>!!e)).subscribe(e=>{this.user=e,this.user?this.getDocumentIam():(this.getDocumentIamSubscription?.unsubscribe(),this.getOrganizationIamSubscription?.unsubscribe(),this.getWorkspaceIamSubscription?.unsubscribe())},e=>{this.loggingService.catch("Error in IamService getUser$ subscription: ",e)})}catch(e){this.loggingService.catch("Error in IamService getUser: ",e)}}getDocumentPaths(){try{this.docService.getDocumentPaths$().pipe(h(e=>!!e)).subscribe(e=>{this.documentPaths=e,this.getDocumentIam(),this.getWorkspaceIam()},e=>{this.loggingService.catch("Error in IamService getDocumentPaths$ subscription: ",e)})}catch(e){this.loggingService.catch("Error in IamService getDocumentPaths: ",e)}}getDocumentIam(){try{this.getDocumentIamSubscription&&(this.getDocumentIamSubscription.unsubscribe(),this.getDocumentIamSubscription=null),this.user?this.getDocumentIamSubscription=this.docService.getDocumentIam$().subscribe(e=>{let t=e||new M;this.documentIAM$.next(t)},e=>{this.loggingService.catch("Error in IamService getDocumentIam$ subscription: ",e)}):this.documentIAM$.next(null)}catch(e){this.loggingService.catch("Error in IamService getDocumentIam: ",e)}}getWorkspaceIam(){try{this.getWorkspaceIamSubscription||(this.getWorkspaceIamSubscription=this.commonDbService.dbListener({feature:"workspaceIam",properties:{skipFirestore:!0}}).pipe(d(e=>u(null))).subscribe(e=>{this.workspaceIAM$.next(e?.data),this.roles$.next(e?.data?.roles||[])}))}catch(e){this.loggingService.catch("Error in IamService getWorkspaceIam: ",e)}}isUserAllowed$(){return this.getRole$().pipe(c(e=>!!e),l())}getDocumentIAM$(){return this.documentIAM$.asObservable()}getRoles$(){return this.roles$.asObservable().pipe(c(e=>e?.length?e:$.WorkspaceRoles))}getFeaturesAccessLevel$(){return this.documentIAM$.asObservable().pipe(c(e=>e?.features),n(e=>this.getRole$().pipe(c(t=>(t===a.ADMIN&&(e=e&&JSON.parse(JSON.stringify(e||{})),e?.all?.disabled&&(e.all.disabled=!1)),e)))))}hasRole(e){try{return e===this.getRole()}catch(t){return this.loggingService.catch("Error in IamService hasRole: ",t),!1}}hasRoleAny(e=[]){try{return e?.includes(this.getRole()||"")}catch(t){return this.loggingService.catch("Error in IamService hasRoleAny: ",t),!1}}hasRole$(e){try{return this.authService.getUser$().pipe(n(()=>this.documentIAM$.pipe(h(t=>!!t),n(()=>this.workspaceIAM$.pipe(c(()=>e===this.getRole()))))))}catch(t){return this.loggingService.catch("Error in IamService hasRole$: ",t),u(!1)}}getRole$(){try{return this.authService.getUser$().pipe(n(()=>this.configService.getSF$()),n(()=>this.configService.getSF()?this.contactService.isUserGlobalContact$():u(null)),n(()=>this.configService.getSF()?this.documentIAM$.pipe(h(e=>!!e),l(I)):u(null)),n(()=>this.workspaceIAM$.pipe(l(I))),c(()=>this.getRole()))}catch(e){return this.loggingService.catch("Error in IamService getRole$: ",e),u(null)}}getRole(){try{let e=this.configService.getSF();if(this.user?.isAdmin)return a.ADMIN;return a.COMMENTER;if(this.user)switch((this.documentIAM$.value?this.documentIAM$.value?.features?.all?.restricted:!1)?m.RESTRICTED:this.documentIAM$.value?this.documentIAM$.value?.documentAccessType||m.PUBLIC:null){case m.PUBLIC:r=this.getUserFromDocumentIAM(this.user?.email,this.user?.userId),r||(r=this.getUserFromWorkspaceIAM(this.user?.email,this.user?.userId)),t=r?.role?.name||a.COMMENTER;break;case m.RESTRICTED:r=this.getUserFromDocumentIAM(this.user?.email,this.user?.userId),r||(r=this.getUserFromWorkspaceIAM(this.user?.email,this.user?.userId)),t=r?.role?.name||null;break;default:break}}catch(e){this.loggingService.catch("Error in IamService getRole: ",e)}return null}isUserAdmin$(){return this.getRole$().pipe(c(e=>e===a.ADMIN),l())}isUserAdmin(){try{return this.getRole()===a.ADMIN}catch(e){return this.loggingService.catch("Error in IamService isUserAdmin: ",e),!1}}getUserFromDocumentIAM(e,t){try{if(e||t){let r;return e&&(r=this.documentIAM$.value?.users?.[g(e)]),!r&&t&&(r=this.documentIAM$.value?.users?.[g(t)]),r}else return}catch(r){this.loggingService.catch("Error in IamService getUserFromDocumentIAM: ",r)}}getUserFromWorkspaceIAM(e,t){try{if(e||t){let r;return e&&(r=this.workspaceIAM$.value?.users?.[g(e)]),!r&&t&&(r=this.workspaceIAM$.value?.users?.[g(t)]),r}else return}catch(r){this.loggingService.catch("Error in IamService getUserFromWorkspaceIAM: ",r)}}};o.\u0275fac=function(t){return new(t||o)(s(E),s(k),s(F),s(U),s(C),s(y),s(R),s(w))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let S=o;return S})();export{Z as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-MRNSRINQ.js";import{Pa as g,U as c,Wa as l,k as s,ki as v}from"./chunk-CRZGZZVQ.js";var p=(()=>{let i=class i{constructor(e,r){this.loggingService=e,this.dragDrop=r,this.currentX=0,this.currentY=0,this.destroy$=new s,this.subscriptions=[],this.loggingService.log("%c[WB] Creating CLASS: DraggableOverlayDirective","color: blue;")}ngOnInit(){try{this.loggingService.log("%c[WB] Calling DraggableOverlayDirective FUNCTION: ngOnInit","color: green;"),this.setupDraggableOverlay()}catch(e){this.loggingService.catch("Error in DraggableOverlayDirective ngOnInit: ",e)}}setupDraggableOverlay(){try{if(this.loggingService.log("%c[WB] Calling DraggableOverlayDirective FUNCTION: setupDraggableOverlay","color: green;"),this.connectedOverlay&&this.connectedOverlay.overlayRef){let e=this.connectedOverlay.overlayRef.overlayElement;this.dragRef=this.dragDrop.createDrag(e),this.subscriptions.push(this.dragRef.moved.pipe(c(this.destroy$)).subscribe(r=>{let a=this.connectedOverlay?.overlayRef.getConfig().positionStrategy;this.updatePosition(a,r.distance.x,r.distance.y)},r=>{this.loggingService.catch("Error in DraggableOverlayDirective dragRef.moved subscription: ",r)})),this.dragRef.ended.pipe(c(this.destroy$)).subscribe(r=>{this.currentX+=r.distance.x,this.currentY+=r.distance.y},r=>{this.loggingService.catch("Error in DraggableOverlayDirective dragRef.ended subscription: ",r)})}}catch(e){this.loggingService.catch("Error in DraggableOverlayDirective setupDraggableOverlay: ",e)}}updatePosition(e,r,a){try{if(e){let n=this.currentX+r,h=this.currentY+a;e.withDefaultOffsetX(n).withDefaultOffsetY(h),this.connectedOverlay?.overlayRef?.updatePosition()}}catch{}}cleanupDraggableOverlay(){try{this.loggingService.log("%c[WB] Calling DraggableOverlayDirective FUNCTION: cleanupDraggableOverlay","color: green;"),this.dragRef&&this.dragRef.dispose()}catch(e){this.loggingService.catch("Error in DraggableOverlayDirective cleanupDraggableOverlay: ",e)}}ngOnDestroy(){try{this.loggingService.log("%c[WB] Calling DraggableOverlayDirective FUNCTION: ngOnDestroy","color: green;"),this.cleanupDraggableOverlay(),this.destroy$.next(),this.destroy$.complete(),this.subscriptions.forEach(e=>{e.unsubscribe()})}catch(e){this.loggingService.catch("Error in DraggableOverlayDirective ngOnDestroy: ",e)}}};i.\u0275fac=function(r){return new(r||i)(g(v),g(o))},i.\u0275dir=l({type:i,selectors:[["","veltDraggableOverlay",""]],inputs:{connectedOverlay:[0,"veltDraggableOverlay","connectedOverlay"]}});let t=i;return t})();export{p as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as x}from"./chunk-7LUSUNI3.js";import{Ba as L,Ca as D,Ea as V,L as C,Q as v,R as y}from"./chunk-NCVN3JXT.js";import{Ua as d,Uh as I,Ya as m,a,b as l,da as o,ii as E,ki as U,qa as f,vc as u,wa as S,xc as p}from"./chunk-CRZGZZVQ.js";var A=(()=>{let r=class r extends V{set parentLocalUIState(t){try{t&&(this.localUIStateSignal=t,this.isLocalUIStateOwner=!1)}catch{}}get elementRef(){try{return this.hostElementRef}catch{return null}}getServiceComponentConfigSignal(){}constructor(){let t=o(S),e=o(D),i=o(p),h=o(E).get(I),g=o(L),c=o(U);super(t,e,i,h??void 0,void 0,g,c),this.defaultCondition=u(!0,{transform:n=>{try{return typeof n=="string"?n==="true"||n==="":n}catch{return!0}}}),this.isLocalUIStateOwner=!1,this.veltContextHost=new x({getHost:()=>this.hostElementRef?.nativeElement,ownerRef:this,getEntity:()=>this.getPublishedVeltEntity(),getLocalUIState:()=>this.isLocalUIStateOwner?this.localUIStateSignal:void 0,onContextChanged:()=>{this.adoptInheritedLocalUIState(),this.rebindServiceConfigFromPlacement(),this.onVeltContextChanged()},markForCheck:()=>this.cd?.markForCheck()}),this.isLocalUIStateRoot=!1,this.selfConnectedConfig=!1;try{this.hostElementRef=t,this.themeService=e,this.dynamicDataService=g,this.loggingService=c,this.cd=i,this.commentService=h??void 0,this.initializeLocalUIState()}catch(n){this.loggingService=this.loggingService||c,this.loggingService?.catch?.("Error in V2PrimitiveThemedBase constructor:",n)}}initializeLocalUIState(){this.localUIStateSignal=f(this.getDefaultLocalUIState()),this.isLocalUIStateOwner=!0}getConditionalClassesContext(){return{componentConfigSignal:this.componentConfigSignal}}ngOnInit(){try{this.adoptInheritedLocalUIState(),this.connectToServiceSignalIfStandalone(),this.dynamicDataService.applyConditionalClasses(this.hostElementRef?.nativeElement,this.getConditionalClassesContext()),this.setupA11yAttributes(),this.isLocalUIStateOwner&&this.setupDarkModeSync(),this.finalizeVeltContext()}catch(t){this.loggingService.catch("Error in V2PrimitiveThemedBase ngOnInit:",t)}}adoptInheritedLocalUIState(){try{v({host:this.hostElementRef?.nativeElement,current:this.localUIStateSignal,isOwner:this.isLocalUIStateOwner,isRoot:this.isLocalUIStateRoot,adopt:t=>{this.localUIStateSignal=t,this.isLocalUIStateOwner=!1}})}catch(t){this.loggingService.catch("Error in V2PrimitiveThemedBase adoptInheritedLocalUIState:",t)}}rebindServiceConfigFromPlacement(){try{if(!this.selfConnectedConfig)return;let t=this.getServiceComponentConfigSignal();if(!t||t===this.componentConfigSignal)return;let e=this.componentConfigSignal;this.componentConfigSignal=t;try{e?.update(i=>a({},i))}catch{}this.cd?.markForCheck()}catch(t){this.loggingService.catch("Error in V2PrimitiveThemedBase rebindServiceConfigFromPlacement:",t)}}finalizeVeltContext(){this.veltContextHost.finalize()}getPublishedVeltEntity(){}getInheritedVeltEntity(){try{return y(this.hostElementRef?.nativeElement)}catch{return}}refreshVeltContextFromPlacement(){this.veltContextHost.refreshFromPlacement()}onVeltContextChanged(){}getInheritedVeltContextData(){try{return C(this.hostElementRef?.nativeElement)?.payload?.contextData||{}}catch{return{}}}connectToServiceSignalIfStandalone(){try{let t=this.componentConfigSignal();if(!t||!t?.uiState){this.selfConnectedConfig=!0;let e=this.getServiceComponentConfigSignal();e&&(this.componentConfigSignal=e)}}catch(t){this.loggingService.catch("Error connecting to service signal:",t)}}ngOnDestroy(){try{this.darkModeConfigSyncSubscription&&this.darkModeConfigSyncSubscription.unsubscribe(),this.veltContextHost.destroy(),super.ngOnDestroy()}catch(t){this.loggingService.catch("Error in V2PrimitiveThemedBase ngOnDestroy:",t)}}setupA11yAttributes(){}setupDarkModeSync(){try{this.darkModeConfigSyncSubscription=this.onDarkModeChange().subscribe(t=>{try{if(this.componentConfigSignal&&typeof this.componentConfigSignal=="function"){let e=this.componentConfigSignal();e&&e.uiState&&e.uiState.darkMode!==t&&this.componentConfigSignal.update(i=>l(a({},i),{uiState:l(a({},i.uiState),{darkMode:t})}))}}catch(e){this.loggingService.catch("Error in darkMode sync subscription:",e)}})}catch(t){this.loggingService.catch("Error in V2PrimitiveThemedBase setupDarkModeSync:",t)}}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=d({type:r,selectors:[["app-v2-primitive-themed-base"]],inputs:{defaultCondition:[1,"defaultCondition"],parentLocalUIState:"parentLocalUIState"},standalone:!1,features:[m],decls:0,vars:0,template:function(e,i){},encapsulation:2});let s=r;return s})();export{A as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-5YU74OX2.js";import{Pa as c,Xa as f}from"./chunk-CRZGZZVQ.js";var l=(()=>{let t=class t{constructor(r){this.translateService=r}transform(r,...i){try{let n=(new Date().getTime()-new Date(r).getTime())/1e3;if(n<1)return this.translateService.translate("now");let s={y:31536e3,mo:2592e3,w:604800,d:86400,h:3600,m:60,s:1};for(let a in s){let o=Math.floor(n/s[a]);if(o>0)return`${o}${this.translateService.translate(a)}`}return r}catch{return r}}};t.\u0275fac=function(i){return new(i||t)(c(m,16))},t.\u0275pipe=f({name:"timeAgo",type:t,pure:!0});let e=t;return e})();export{l as a};
|