Viewing File: /home/markqprx/iniasli.pro/public/client/275-es2015.469744cfb9d499ff23f5.js

(self.webpackChunkclient=self.webpackChunkclient||[]).push([[275,445],{69244:function(t,e,n){"use strict";n.d(e,{Zt:function(){return mt},Bh:function(){return pt},Wj:function(){return dt},_t:function(){return bt},bA:function(){return H}});var i=n(35366),a=n(61116),o=n(43725),s=n(93169),r=n(19861),l=n(48318),c=n(48569),d=n(62293);function u(t){const{subscriber:e,counter:n,period:i}=t;e.next(n),this.schedule({subscriber:e,counter:n+1,period:i},i)}var p=n(55959),g=n(87570),h=n(91741),m=n(31906),f=n(25416),b=n(56238),v=n(79996),_=n(90611),Z=n(66599),x=n(44689),y=n(94720);function A(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function w(t,e){const n=e?"":"none";A(t.style,{touchAction:e?"":"none",webkitUserDrag:e?"":"none",webkitTapHighlightColor:e?"":"transparent",userSelect:n,msUserSelect:n,webkitUserSelect:n,MozUserSelect:n})}function k(t,e){const n=t.style;n.position=e?"":"fixed",n.top=n.opacity=e?"":"0",n.left=e?"":"-999em"}function T(t){const e=t.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(t)*e}function C(t,e){return t.getPropertyValue(e).split(",").map(t=>t.trim())}function q(t){const e=t.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}}function U(t,e,n){const{top:i,bottom:a,left:o,right:s}=t;return n>=i&&n<=a&&e>=o&&e<=s}function I(t,e,n){t.top+=e,t.bottom=t.top+t.height,t.left+=n,t.right=t.left+t.width}function M(t,e,n,i){const{top:a,right:o,bottom:s,left:r,width:l,height:c}=t,d=l*e,u=c*e;return i>a-u&&i<s+u&&n>r-d&&n<o+d}class O{constructor(t,e){this._document=t,this._viewportRuler=e,this.positions=new Map}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this._viewportRuler.getViewportScrollPosition()}),t.forEach(t=>{this.positions.set(t,{scrollPosition:{top:t.scrollTop,left:t.scrollLeft},clientRect:q(t)})})}handleScroll(t){const e=t.target,n=this.positions.get(e);if(!n)return null;const i=e===this._document?e.documentElement:e,a=n.scrollPosition;let o,s;if(e===this._document){const t=this._viewportRuler.getViewportScrollPosition();o=t.top,s=t.left}else o=e.scrollTop,s=e.scrollLeft;const r=a.top-o,l=a.left-s;return this.positions.forEach((t,n)=>{t.clientRect&&e!==n&&i.contains(n)&&I(t.clientRect,r,l)}),a.top=o,a.left=s,{top:r,left:l}}}function J(t){const e=t.cloneNode(!0),n=e.querySelectorAll("[id]"),i=t.nodeName.toLowerCase();e.removeAttribute("id");for(let a=0;a<n.length;a++)n[a].removeAttribute("id");return"canvas"===i?D(t,e):"input"!==i&&"select"!==i&&"textarea"!==i||S(t,e),P("canvas",t,e,D),P("input, textarea, select",t,e,S),e}function P(t,e,n,i){const a=e.querySelectorAll(t);if(a.length){const e=n.querySelectorAll(t);for(let t=0;t<a.length;t++)i(a[t],e[t])}}let N=0;function S(t,e){"file"!==e.type&&(e.value=t.value),"radio"===e.type&&e.name&&(e.name=`mat-clone-${e.name}-${N++}`)}function D(t,e){const n=e.getContext("2d");if(n)try{n.drawImage(t,0,0)}catch(i){}}const Q=(0,s.i$)({passive:!0}),Y=(0,s.i$)({passive:!1});class L{constructor(t,e,n,i,a,o){this._config=e,this._document=n,this._ngZone=i,this._viewportRuler=a,this._dragDropRegistry=o,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._moveEvents=new p.xQ,this._pointerMoveSubscription=g.w.EMPTY,this._pointerUpSubscription=g.w.EMPTY,this._scrollSubscription=g.w.EMPTY,this._resizeSubscription=g.w.EMPTY,this._boundaryElement=null,this._nativeInteractionsEnabled=!0,this._handles=[],this._disabledHandles=new Set,this._direction="ltr",this.dragStartDelay=0,this._disabled=!1,this.beforeStarted=new p.xQ,this.started=new p.xQ,this.released=new p.xQ,this.ended=new p.xQ,this.entered=new p.xQ,this.exited=new p.xQ,this.dropped=new p.xQ,this.moved=this._moveEvents,this._pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){const e=this._handles.find(e=>{const n=t.target;return!!n&&(n===e||e.contains(n))});!e||this._disabledHandles.has(e)||this.disabled||this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)},this._pointerMove=t=>{const e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging){if(Math.abs(e.x-this._pickupPositionOnPage.x)+Math.abs(e.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){const e=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),n=this._dropContainer;if(!e)return void this._endDragSequence(t);n&&(n.isDragging()||n.isReceiving())||(t.preventDefault(),this._hasStartedDragging=!0,this._ngZone.run(()=>this._startDragSequence(t)))}return}this._boundaryElement&&(this._previewRect&&(this._previewRect.width||this._previewRect.height)||(this._previewRect=(this._preview||this._rootElement).getBoundingClientRect())),t.preventDefault();const n=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(n),this._dropContainer)this._updateActiveDropContainer(n,e);else{const t=this._activeTransform;t.x=n.x-this._pickupPositionOnPage.x+this._passiveTransform.x,t.y=n.y-this._pickupPositionOnPage.y+this._passiveTransform.y,this._applyRootElementTransform(t.x,t.y),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&this._rootElement.setAttribute("transform",`translate(${t.x} ${t.y})`)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:n,event:t,distance:this._getDragDistance(n),delta:this._pointerDirectionDelta})})},this._pointerUp=t=>{this._endDragSequence(t)},this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new O(n,a),o.registerDragItem(this)}get disabled(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)}set disabled(t){const e=(0,r.Ig)(t);e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(t=>w(t,e)))}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(t=>(0,r.fI)(t)),this._handles.forEach(t=>w(t,this.disabled)),this._toggleNativeDragInteractions();const e=new Set;return this._disabledHandles.forEach(t=>{this._handles.indexOf(t)>-1&&e.add(t)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){const e=(0,r.fI)(t);return e!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(()=>{e.addEventListener("mousedown",this._pointerDown,Y),e.addEventListener("touchstart",this._pointerDown,Q)}),this._initialTransform=void 0,this._rootElement=e),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?(0,r.fI)(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&R(this._rootElement),R(this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeSubscriptions(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._anchor=this._parentDragRef=null}isDragging(){return this._hasStartedDragging&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),w(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),w(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){const t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}_sortFromLastPointerPosition(){const t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){this._preview&&R(this._preview),this._previewRef&&this._previewRef.destroy(),this._preview=this._previewRef=null}_destroyPlaceholder(){this._placeholder&&R(this._placeholder),this._placeholderRef&&this._placeholderRef.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(t){this._dragDropRegistry.isDragging(this)&&(this._removeSubscriptions(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),this._hasStartedDragging&&(this.released.next({source:this}),this._dropContainer?(this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)})):(this._passiveTransform.x=this._activeTransform.x,this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(this._getPointerPositionOnPage(t))})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this))))}_startDragSequence(t){$(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();const e=this._dropContainer;if(e){const t=this._rootElement,n=t.parentNode,i=this._preview=this._createPreviewElement(),a=this._placeholder=this._createPlaceholderElement(),o=this._anchor=this._anchor||this._document.createComment(""),s=this._getShadowRoot();n.insertBefore(o,t),k(t,!1),this._document.body.appendChild(n.replaceChild(a,t)),function(t,e){return e||t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement||t.body}(this._document,s).appendChild(i),this.started.next({source:this}),e.start(),this._initialContainer=e,this._initialIndex=e.getItemIndex(this)}else this.started.next({source:this}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(e?e.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();const n=this.isDragging(),i=$(e),a=!i&&0!==e.button,o=this._rootElement,s=!i&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now();if(e.target&&e.target.draggable&&"mousedown"===e.type&&e.preventDefault(),n||a||s)return;this._handles.length&&(this._rootElementTapHighlight=o.style.webkitTapHighlightColor||"",o.style.webkitTapHighlightColor="transparent"),this._hasStartedDragging=this._hasMoved=!1,this._removeSubscriptions(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scroll.subscribe(t=>{this._updateOnScroll(t)}),this._boundaryElement&&(this._boundaryRect=q(this._boundaryElement));const r=this._previewTemplate;this._pickupPositionInElement=r&&r.template&&!r.matchSize?{x:0,y:0}:this._getPointerPositionInElement(t,e);const l=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:l.x,y:l.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){k(this._rootElement,!0),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._boundaryRect=this._previewRect=void 0,this._ngZone.run(()=>{const e=this._dropContainer,n=e.getItemIndex(this),i=this._getPointerPositionOnPage(t),a=this._getDragDistance(this._getPointerPositionOnPage(t)),o=e._isOverContainer(i.x,i.y);this.ended.next({source:this,distance:a}),this.dropped.next({item:this,currentIndex:n,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:a}),e.drop(this,n,this._initialIndex,this._initialContainer,o,a),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:n,y:i}){let a=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!a&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(a=this._initialContainer),a&&a!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=a,this._dropContainer.enter(this,t,e,a===this._initialContainer&&a.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:a,currentIndex:a.getItemIndex(this)})}),this._dropContainer._startScrollingIfNecessary(n,i),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this._preview.style.transform=F(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y)}_createPreviewElement(){const t=this._previewTemplate,e=this.previewClass,n=t?t.template:null;let i;if(n&&t){const e=t.matchSize?this._rootElement.getBoundingClientRect():null,a=t.viewContainer.createEmbeddedView(n,t.context);a.detectChanges(),i=V(a,this._document),this._previewRef=a,t.matchSize?B(i,e):i.style.transform=F(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else{const t=this._rootElement;i=J(t),B(i,t.getBoundingClientRect())}return A(i.style,{pointerEvents:"none",margin:"0",position:"fixed",top:"0",left:"0",zIndex:`${this._config.zIndex||1e3}`}),w(i,!1),i.classList.add("cdk-drag-preview"),i.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(t=>i.classList.add(t)):i.classList.add(e)),i}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const t=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._preview.style.transform=F(t.left,t.top);const e=function(t){const e=getComputedStyle(t),n=C(e,"transition-property"),i=n.find(t=>"transform"===t||"all"===t);if(!i)return 0;const a=n.indexOf(i),o=C(e,"transition-duration"),s=C(e,"transition-delay");return T(o[a])+T(s[a])}(this._preview);return 0===e?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(t=>{const n=e=>{(!e||e.target===this._preview&&"transform"===e.propertyName)&&(this._preview.removeEventListener("transitionend",n),t(),clearTimeout(i))},i=setTimeout(n,1.5*e);this._preview.addEventListener("transitionend",n)}))}_createPlaceholderElement(){const t=this._placeholderTemplate,e=t?t.template:null;let n;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),n=V(this._placeholderRef,this._document)):n=J(this._rootElement),n.classList.add("cdk-drag-placeholder"),n}_getPointerPositionInElement(t,e){const n=this._rootElement.getBoundingClientRect(),i=t===this._rootElement?null:t,a=i?i.getBoundingClientRect():n,o=$(e)?e.targetTouches[0]:e,s=this._getViewportScrollPosition();return{x:a.left-n.left+(o.pageX-a.left-s.left),y:a.top-n.top+(o.pageY-a.top-s.top)}}_getPointerPositionOnPage(t){const e=this._getViewportScrollPosition(),n=$(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,i=n.pageX-e.left,a=n.pageY-e.top;if(this._ownerSVGElement){const t=this._ownerSVGElement.getScreenCTM();if(t){const e=this._ownerSVGElement.createSVGPoint();return e.x=i,e.y=a,e.matrixTransform(t.inverse())}}return{x:i,y:a}}_getConstrainedPointerPosition(t){const e=this._dropContainer?this._dropContainer.lockAxis:null;let{x:n,y:i}=this.constrainPosition?this.constrainPosition(t,this):t;if("x"===this.lockAxis||"x"===e?i=this._pickupPositionOnPage.y:"y"!==this.lockAxis&&"y"!==e||(n=this._pickupPositionOnPage.x),this._boundaryRect){const{x:t,y:e}=this._pickupPositionInElement,a=this._boundaryRect,o=this._previewRect,s=a.top+e,r=a.bottom-(o.height-e);n=E(n,a.left+t,a.right-(o.width-t)),i=E(i,s,r)}return{x:n,y:i}}_updatePointerDirectionDelta(t){const{x:e,y:n}=t,i=this._pointerDirectionDelta,a=this._pointerPositionAtLastDirectionChange,o=Math.abs(e-a.x),s=Math.abs(n-a.y);return o>this._config.pointerDirectionChangeThreshold&&(i.x=e>a.x?1:-1,a.x=e),s>this._config.pointerDirectionChangeThreshold&&(i.y=n>a.y?1:-1,a.y=n),i}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,w(this._rootElement,t))}_removeRootElementListeners(t){t.removeEventListener("mousedown",this._pointerDown,Y),t.removeEventListener("touchstart",this._pointerDown,Q)}_applyRootElementTransform(t,e){const n=F(t,e);null==this._initialTransform&&(this._initialTransform=this._rootElement.style.transform||""),this._rootElement.style.transform=this._initialTransform?n+" "+this._initialTransform:n}_getDragDistance(t){const e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(0===t&&0===e||this.isDragging()||!this._boundaryElement)return;const n=this._boundaryElement.getBoundingClientRect(),i=this._rootElement.getBoundingClientRect();if(0===n.width&&0===n.height||0===i.width&&0===i.height)return;const a=n.left-i.left,o=i.right-n.right,s=n.top-i.top,r=i.bottom-n.bottom;n.width>i.width?(a>0&&(t+=a),o>0&&(t-=o)):t=0,n.height>i.height?(s>0&&(e+=s),r>0&&(e-=r)):e=0,t===this._passiveTransform.x&&e===this._passiveTransform.y||this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){const e=this.dragStartDelay;return"number"==typeof e?e:$(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){const e=this._parentPositions.handleScroll(t);if(e){const n=t.target;this._boundaryRect&&(n===this._document||n!==this._boundaryElement&&n.contains(this._boundaryElement))&&I(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){const t=this._parentPositions.positions.get(this._document);return t?t.scrollPosition:this._viewportRuler.getViewportScrollPosition()}_getShadowRoot(){return void 0===this._cachedShadowRoot&&(this._cachedShadowRoot=(0,s.kV)(this._rootElement)),this._cachedShadowRoot}}function F(t,e){return`translate3d(${Math.round(t)}px, ${Math.round(e)}px, 0)`}function E(t,e,n){return Math.max(e,Math.min(n,t))}function R(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function $(t){return"t"===t.type[0]}function V(t,e){const n=t.rootNodes;if(1===n.length&&n[0].nodeType===e.ELEMENT_NODE)return n[0];const i=e.createElement("div");return n.forEach(t=>i.appendChild(t)),i}function B(t,e){t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.transform=F(e.left,e.top)}function H(t,e,n){const i=z(e,t.length-1),a=z(n,t.length-1);if(i===a)return;const o=t[i],s=a<i?-1:1;for(let r=i;r!==a;r+=s)t[r]=t[r+s];t[a]=o}function z(t,e){return Math.max(0,Math.min(e,t))}class G{constructor(t,e,n,i,a){this._dragDropRegistry=e,this._ngZone=i,this._viewportRuler=a,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.autoScrollStep=2,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.beforeStarted=new p.xQ,this.entered=new p.xQ,this.exited=new p.xQ,this.dropped=new p.xQ,this.sorted=new p.xQ,this._isDragging=!1,this._itemPositions=[],this._previousSwap={drag:null,delta:0,overlaps:!1},this._draggables=[],this._siblings=[],this._orientation="vertical",this._activeSiblings=new Set,this._direction="ltr",this._viewportScrollSubscription=g.w.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new p.xQ,this._cachedShadowRoot=null,this._startScrollInterval=()=>{this._stopScrolling(),function(t=0,e=c.P){return(!(0,d.k)(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=c.P),new l.y(n=>(n.add(e.schedule(u,t,{subscriber:n,counter:0,period:t})),n))}(0,h.Z).pipe((0,f.R)(this._stopScrollTimers)).subscribe(()=>{const t=this._scrollNode,e=this.autoScrollStep;1===this._verticalScrollDirection?X(t,-e):2===this._verticalScrollDirection&&X(t,e),1===this._horizontalScrollDirection?W(t,-e):2===this._horizontalScrollDirection&&W(t,e)})},this.element=(0,r.fI)(t),this._document=n,this.withScrollableParents([this.element]),e.registerDropContainer(this),this._parentPositions=new O(n,a)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,n,i){let a;this._draggingStarted(),null==i?(a=this.sortingDisabled?this._draggables.indexOf(t):-1,-1===a&&(a=this._getItemIndexFromPointerPosition(t,e,n))):a=i;const o=this._activeDraggables,s=o.indexOf(t),l=t.getPlaceholderElement();let c=o[a];if(c===t&&(c=o[a+1]),s>-1&&o.splice(s,1),c&&!this._dragDropRegistry.isDragging(c)){const e=c.getRootElement();e.parentElement.insertBefore(l,e),o.splice(a,0,t)}else if(this._shouldEnterAsFirstChild(e,n)){const e=o[0].getRootElement();e.parentNode.insertBefore(l,e),o.unshift(t)}else(0,r.fI)(this.element).appendChild(l),o.push(t);l.style.transform="",this._cacheItemPositions(),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,n,i,a,o){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:n,container:this,previousContainer:i,isPointerOverContainer:a,distance:o})}withItems(t){const e=this._draggables;return this._draggables=t,t.forEach(t=>t._withDropContainer(this)),this.isDragging()&&(e.filter(t=>t.isDragging()).every(e=>-1===t.indexOf(e))?this._reset():this._cacheItems()),this}withDirection(t){return this._direction=t,this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){return this._orientation=t,this}withScrollableParents(t){const e=(0,r.fI)(this.element);return this._scrollableElements=-1===t.indexOf(e)?[e,...t]:t.slice(),this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?j("horizontal"===this._orientation&&"rtl"===this._direction?this._itemPositions.slice().reverse():this._itemPositions,e=>e.drag===t):this._draggables.indexOf(t)}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,n,i){if(this.sortingDisabled||!this._clientRect||!M(this._clientRect,.05,e,n))return;const a=this._itemPositions,o=this._getItemIndexFromPointerPosition(t,e,n,i);if(-1===o&&a.length>0)return;const s="horizontal"===this._orientation,r=j(a,e=>e.drag===t),l=a[o],c=l.clientRect,d=r>o?1:-1,u=this._getItemOffsetPx(a[r].clientRect,c,d),p=this._getSiblingOffsetPx(r,a,d),g=a.slice();H(a,r,o),this.sorted.next({previousIndex:r,currentIndex:o,container:this,item:t}),a.forEach((e,n)=>{if(g[n]===e)return;const i=e.drag===t,a=i?u:p,o=i?t.getPlaceholderElement():e.drag.getRootElement();e.offset+=a,s?(o.style.transform=`translate3d(${Math.round(e.offset)}px, 0, 0)`,I(e.clientRect,0,a)):(o.style.transform=`translate3d(0, ${Math.round(e.offset)}px, 0)`,I(e.clientRect,a,0))}),this._previousSwap.overlaps=U(c,e,n),this._previousSwap.drag=l.drag,this._previousSwap.delta=s?i.x:i.y}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let n,i=0,a=0;if(this._parentPositions.positions.forEach((o,s)=>{s!==this._document&&o.clientRect&&!n&&M(o.clientRect,.05,t,e)&&([i,a]=function(t,e,n,i){const a=K(e,i),o=tt(e,n);let s=0,r=0;if(a){const e=t.scrollTop;1===a?e>0&&(s=1):t.scrollHeight-e>t.clientHeight&&(s=2)}if(o){const e=t.scrollLeft;1===o?e>0&&(r=1):t.scrollWidth-e>t.clientWidth&&(r=2)}return[s,r]}(s,o.clientRect,t,e),(i||a)&&(n=s))}),!i&&!a){const{width:o,height:s}=this._viewportRuler.getViewportSize(),r={width:o,height:s,top:0,right:o,bottom:s,left:0};i=K(r,e),a=tt(r,t),n=window}!n||i===this._verticalScrollDirection&&a===this._horizontalScrollDirection&&n===this._scrollNode||(this._verticalScrollDirection=i,this._horizontalScrollDirection=a,this._scrollNode=n,(i||a)&&n?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){const t=(0,r.fI)(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._cacheItems(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){const t=(0,r.fI)(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(t).clientRect}_cacheItemPositions(){const t="horizontal"===this._orientation;this._itemPositions=this._activeDraggables.map(t=>{const e=t.getVisibleElement();return{drag:t,offset:0,clientRect:q(e)}}).sort((e,n)=>t?e.clientRect.left-n.clientRect.left:e.clientRect.top-n.clientRect.top)}_reset(){this._isDragging=!1;const t=(0,r.fI)(this.element).style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._activeDraggables.forEach(t=>{const e=t.getRootElement();e&&(e.style.transform="")}),this._siblings.forEach(t=>t._stopReceiving(this)),this._activeDraggables=[],this._itemPositions=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1,this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_getSiblingOffsetPx(t,e,n){const i="horizontal"===this._orientation,a=e[t].clientRect,o=e[t+-1*n];let s=a[i?"width":"height"]*n;if(o){const t=i?"left":"top",e=i?"right":"bottom";-1===n?s-=o.clientRect[t]-a[e]:s+=a[t]-o.clientRect[e]}return s}_getItemOffsetPx(t,e,n){const i="horizontal"===this._orientation;let a=i?e.left-t.left:e.top-t.top;return-1===n&&(a+=i?e.width-t.width:e.height-t.height),a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;const n=this._itemPositions,i="horizontal"===this._orientation;if(n[0].drag!==this._activeDraggables[0]){const a=n[n.length-1].clientRect;return i?t>=a.right:e>=a.bottom}{const a=n[0].clientRect;return i?t<=a.left:e<=a.top}}_getItemIndexFromPointerPosition(t,e,n,i){const a="horizontal"===this._orientation,o=j(this._itemPositions,({drag:o,clientRect:s},r,l)=>{if(o===t)return l.length<2;if(i){const t=a?i.x:i.y;if(o===this._previousSwap.drag&&this._previousSwap.overlaps&&t===this._previousSwap.delta)return!1}return a?e>=Math.floor(s.left)&&e<Math.floor(s.right):n>=Math.floor(s.top)&&n<Math.floor(s.bottom)});return-1!==o&&this.sortPredicate(o,t,this)?o:-1}_cacheItems(){this._activeDraggables=this._draggables.slice(),this._cacheItemPositions(),this._cacheParentPositions()}_isOverContainer(t,e){return null!=this._clientRect&&U(this._clientRect,t,e)}_getSiblingContainerFromPosition(t,e,n){return this._siblings.find(i=>i._canReceive(t,e,n))}_canReceive(t,e,n){if(!this._clientRect||!U(this._clientRect,e,n)||!this.enterPredicate(t,this))return!1;const i=this._getShadowRoot().elementFromPoint(e,n);if(!i)return!1;const a=(0,r.fI)(this.element);return i===a||a.contains(i)}_startReceiving(t,e){const n=this._activeSiblings;!n.has(t)&&e.every(t=>this.enterPredicate(t,this)||this._draggables.indexOf(t)>-1)&&(n.add(t),this._cacheParentPositions(),this._listenToScrollEvents())}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe()}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scroll.subscribe(t=>{if(this.isDragging()){const e=this._parentPositions.handleScroll(t);e&&(this._itemPositions.forEach(({clientRect:t})=>{I(t,e.top,e.left)}),this._itemPositions.forEach(({drag:t})=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()}))}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){const t=(0,s.kV)((0,r.fI)(this.element));this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){const t=this._activeDraggables.filter(t=>t.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}}function j(t,e){for(let n=0;n<t.length;n++)if(e(t[n],n,t))return n;return-1}function X(t,e){t===window?t.scrollBy(0,e):t.scrollTop+=e}function W(t,e){t===window?t.scrollBy(e,0):t.scrollLeft+=e}function K(t,e){const{top:n,bottom:i,height:a}=t,o=.05*a;return e>=n-o&&e<=n+o?1:e>=i-o&&e<=i+o?2:0}function tt(t,e){const{left:n,right:i,width:a}=t,o=.05*a;return e>=n-o&&e<=n+o?1:e>=i-o&&e<=i+o?2:0}const et=(0,s.i$)({passive:!1,capture:!0});let nt=(()=>{class t{constructor(t,e){this._ngZone=t,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=[],this._globalListeners=new Map,this._draggingPredicate=t=>t.isDragging(),this.pointerMove=new p.xQ,this.pointerUp=new p.xQ,this.scroll=new p.xQ,this._preventDefaultWhileDragging=t=>{this._activeDragInstances.length>0&&t.preventDefault()},this._persistentTouchmoveListener=t=>{this._activeDragInstances.length>0&&(this._activeDragInstances.some(this._draggingPredicate)&&t.preventDefault(),this.pointerMove.next(t))},this._document=e}registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t)}registerDragItem(t){this._dragInstances.add(t),1===this._dragInstances.size&&this._ngZone.runOutsideAngular(()=>{this._document.addEventListener("touchmove",this._persistentTouchmoveListener,et)})}removeDropContainer(t){this._dropInstances.delete(t)}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),0===this._dragInstances.size&&this._document.removeEventListener("touchmove",this._persistentTouchmoveListener,et)}startDragging(t,e){if(!(this._activeDragInstances.indexOf(t)>-1)&&(this._activeDragInstances.push(t),1===this._activeDragInstances.length)){const t=e.type.startsWith("touch");this._globalListeners.set(t?"touchend":"mouseup",{handler:t=>this.pointerUp.next(t),options:!0}).set("scroll",{handler:t=>this.scroll.next(t),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:et}),t||this._globalListeners.set("mousemove",{handler:t=>this.pointerMove.next(t),options:et}),this._ngZone.runOutsideAngular(()=>{this._globalListeners.forEach((t,e)=>{this._document.addEventListener(e,t.handler,t.options)})})}}stopDragging(t){const e=this._activeDragInstances.indexOf(t);e>-1&&(this._activeDragInstances.splice(e,1),0===this._activeDragInstances.length&&this._clearGlobalListeners())}isDragging(t){return this._activeDragInstances.indexOf(t)>-1}ngOnDestroy(){this._dragInstances.forEach(t=>this.removeDragItem(t)),this._dropInstances.forEach(t=>this.removeDropContainer(t)),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach((t,e)=>{this._document.removeEventListener(e,t.handler,t.options)}),this._globalListeners.clear()}}return t.\u0275fac=function(e){return new(e||t)(i.LFG(i.R0b),i.LFG(a.K0))},t.\u0275prov=(0,i.Yz7)({factory:function(){return new t((0,i.LFG)(i.R0b),(0,i.LFG)(a.K0))},token:t,providedIn:"root"}),t})();const it={dragStartThreshold:5,pointerDirectionChangeThreshold:5};let at=(()=>{class t{constructor(t,e,n,i){this._document=t,this._ngZone=e,this._viewportRuler=n,this._dragDropRegistry=i}createDrag(t,e=it){return new L(t,e,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(t){return new G(t,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}return t.\u0275fac=function(e){return new(e||t)(i.LFG(a.K0),i.LFG(i.R0b),i.LFG(o.rL),i.LFG(nt))},t.\u0275prov=(0,i.Yz7)({factory:function(){return new t((0,i.LFG)(a.K0),(0,i.LFG)(i.R0b),(0,i.LFG)(o.rL),(0,i.LFG)(nt))},token:t,providedIn:"root"}),t})();const ot=new i.OlP("CDK_DRAG_PARENT"),st=new i.OlP("CdkDropListGroup"),rt=new i.OlP("CDK_DRAG_CONFIG");let lt=0;const ct=new i.OlP("CdkDropList");let dt=(()=>{class t{constructor(e,n,a,o,s,r,l){this.element=e,this._changeDetectorRef=a,this._scrollDispatcher=o,this._dir=s,this._group=r,this._destroyed=new p.xQ,this.connectedTo=[],this.id="cdk-drop-list-"+lt++,this.enterPredicate=()=>!0,this.sortPredicate=()=>!0,this.dropped=new i.vpe,this.entered=new i.vpe,this.exited=new i.vpe,this.sorted=new i.vpe,this._unsortedItems=new Set,this._dropListRef=n.createDropList(e),this._dropListRef.data=this,l&&this._assignDefaults(l),this._dropListRef.enterPredicate=(t,e)=>this.enterPredicate(t.data,e.data),this._dropListRef.sortPredicate=(t,e,n)=>this.sortPredicate(t,e.data,n.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),t._dropLists.push(this),r&&r._items.add(this)}get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=(0,r.Ig)(t)}addItem(t){this._unsortedItems.add(t),this._dropListRef.isDragging()&&this._syncItemsWithRef()}removeItem(t){this._unsortedItems.delete(t),this._dropListRef.isDragging()&&this._syncItemsWithRef()}getSortedItems(){return Array.from(this._unsortedItems).sort((t,e)=>t._dragRef.getVisibleElement().compareDocumentPosition(e._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){const e=t._dropLists.indexOf(this);e>-1&&t._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe((0,b.O)(this._dir.value),(0,f.R)(this._destroyed)).subscribe(t=>e.withDirection(t)),e.beforeStarted.subscribe(()=>{const n=(0,r.Eq)(this.connectedTo).map(e=>"string"==typeof e?t._dropLists.find(t=>t.id===e):e);if(this._group&&this._group._items.forEach(t=>{-1===n.indexOf(t)&&n.push(t)}),!this._scrollableParentsResolved){const t=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(t=>t.getElementRef().nativeElement);this._dropListRef.withScrollableParents(t),this._scrollableParentsResolved=!0}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=(0,r.Ig)(this.sortingDisabled),e.autoScrollDisabled=(0,r.Ig)(this.autoScrollDisabled),e.autoScrollStep=(0,r.su)(this.autoScrollStep,2),e.connectedTo(n.filter(t=>t&&t!==this).map(t=>t._dropListRef)).withOrientation(this.orientation)})}_handleEvents(t){t.beforeStarted.subscribe(()=>{this._syncItemsWithRef(),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(t=>{this.entered.emit({container:this,item:t.item.data,currentIndex:t.currentIndex})}),t.exited.subscribe(t=>{this.exited.emit({container:this,item:t.item.data}),this._changeDetectorRef.markForCheck()}),t.sorted.subscribe(t=>{this.sorted.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,container:this,item:t.item.data})}),t.dropped.subscribe(t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,item:t.item.data,isPointerOverContainer:t.isPointerOverContainer,distance:t.distance}),this._changeDetectorRef.markForCheck()})}_assignDefaults(t){const{lockAxis:e,draggingDisabled:n,sortingDisabled:i,listAutoScrollDisabled:a,listOrientation:o}=t;this.disabled=null!=n&&n,this.sortingDisabled=null!=i&&i,this.autoScrollDisabled=null!=a&&a,this.orientation=o||"vertical",e&&(this.lockAxis=e)}_syncItemsWithRef(){this._dropListRef.withItems(this.getSortedItems().map(t=>t._dragRef))}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq),i.Y36(at),i.Y36(i.sBO),i.Y36(o.mF),i.Y36(y.Is,8),i.Y36(st,12),i.Y36(rt,8))},t.\u0275dir=i.lG2({type:t,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(t,e){2&t&&(i.uIk("id",e.id),i.ekj("cdk-drop-list-disabled",e.disabled)("cdk-drop-list-dragging",e._dropListRef.isDragging())("cdk-drop-list-receiving",e._dropListRef.isReceiving()))},inputs:{connectedTo:["cdkDropListConnectedTo","connectedTo"],id:"id",enterPredicate:["cdkDropListEnterPredicate","enterPredicate"],sortPredicate:["cdkDropListSortPredicate","sortPredicate"],disabled:["cdkDropListDisabled","disabled"],sortingDisabled:["cdkDropListSortingDisabled","sortingDisabled"],autoScrollDisabled:["cdkDropListAutoScrollDisabled","autoScrollDisabled"],orientation:["cdkDropListOrientation","orientation"],lockAxis:["cdkDropListLockAxis","lockAxis"],data:["cdkDropListData","data"],autoScrollStep:["cdkDropListAutoScrollStep","autoScrollStep"]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[i._Bn([{provide:st,useValue:void 0},{provide:ct,useExisting:t}])]}),t._dropLists=[],t})();const ut=new i.OlP("CdkDragHandle");let pt=(()=>{class t{constructor(t,e){this.element=t,this._stateChanges=new p.xQ,this._disabled=!1,this._parentDrag=e}get disabled(){return this._disabled}set disabled(t){this._disabled=(0,r.Ig)(t),this._stateChanges.next(this)}ngOnDestroy(){this._stateChanges.complete()}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq),i.Y36(ot,12))},t.\u0275dir=i.lG2({type:t,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:["cdkDragHandleDisabled","disabled"]},features:[i._Bn([{provide:ut,useExisting:t}])]}),t})();const gt=new i.OlP("CdkDragPlaceholder"),ht=new i.OlP("CdkDragPreview");let mt=(()=>{class t{constructor(e,n,a,o,s,r,c,d,u,g,h){this.element=e,this.dropContainer=n,this._ngZone=o,this._viewContainerRef=s,this._dir=c,this._changeDetectorRef=u,this._selfHandle=g,this._parentDrag=h,this._destroyed=new p.xQ,this.started=new i.vpe,this.released=new i.vpe,this.ended=new i.vpe,this.entered=new i.vpe,this.exited=new i.vpe,this.dropped=new i.vpe,this.moved=new l.y(t=>{const e=this._dragRef.moved.pipe((0,v.U)(t=>({source:this,pointerPosition:t.pointerPosition,event:t.event,delta:t.delta,distance:t.distance}))).subscribe(t);return()=>{e.unsubscribe()}}),this._dragRef=d.createDrag(e,{dragStartThreshold:r&&null!=r.dragStartThreshold?r.dragStartThreshold:5,pointerDirectionChangeThreshold:r&&null!=r.pointerDirectionChangeThreshold?r.pointerDirectionChangeThreshold:5,zIndex:null==r?void 0:r.zIndex}),this._dragRef.data=this,t._dragInstances.push(this),r&&this._assignDefaults(r),n&&(this._dragRef._withDropContainer(n._dropListRef),n.addItem(this)),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}get disabled(){return this._disabled||this.dropContainer&&this.dropContainer.disabled}set disabled(t){this._disabled=(0,r.Ig)(t),this._dragRef.disabled=this._disabled}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}ngAfterViewInit(){this._ngZone.onStable.pipe((0,_.q)(1),(0,f.R)(this._destroyed)).subscribe(()=>{this._updateRootElement(),this._handles.changes.pipe((0,b.O)(this._handles),(0,Z.b)(t=>{const e=t.filter(t=>t._parentDrag===this).map(t=>t.element);this._selfHandle&&this.rootElementSelector&&e.push(this.element),this._dragRef.withHandles(e)}),(0,x.w)(t=>(0,m.T)(...t.map(t=>t._stateChanges.pipe((0,b.O)(t))))),(0,f.R)(this._destroyed)).subscribe(t=>{const e=this._dragRef,n=t.element.nativeElement;t.disabled?e.disableHandle(n):e.enableHandle(n)}),this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)})}ngOnChanges(t){const e=t.rootElementSelector,n=t.freeDragPosition;e&&!e.firstChange&&this._updateRootElement(),n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this);const e=t._dragInstances.indexOf(this);e>-1&&t._dragInstances.splice(e,1),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()}_updateRootElement(){const t=this.element.nativeElement,e=this.rootElementSelector?ft(t,this.rootElementSelector):t;this._dragRef.withRootElement(e||t)}_getBoundaryElement(){const t=this.boundaryElement;return t?"string"==typeof t?ft(this.element.nativeElement,t):(0,r.fI)(t):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){const t=this._dir,n=this.dragStartDelay,i=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,a=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.dragStartDelay="object"==typeof n&&n?n:(0,r.su)(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(i).withPreviewTemplate(a),t&&e.withDirection(t.value)}}),e.beforeStarted.pipe((0,_.q)(1)).subscribe(()=>{var n,i;if(this._parentDrag)return void e.withParent(this._parentDrag._dragRef);let a=this.element.nativeElement.parentElement;for(;a;){if(null===(n=a.classList)||void 0===n?void 0:n.contains("cdk-drag")){e.withParent((null===(i=t._dragInstances.find(t=>t.element.nativeElement===a))||void 0===i?void 0:i._dragRef)||null);break}a=a.parentElement}})}_handleEvents(t){t.started.subscribe(()=>{this.started.emit({source:this}),this._changeDetectorRef.markForCheck()}),t.released.subscribe(()=>{this.released.emit({source:this})}),t.ended.subscribe(t=>{this.ended.emit({source:this,distance:t.distance}),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(t=>{this.entered.emit({container:t.container.data,item:this,currentIndex:t.currentIndex})}),t.exited.subscribe(t=>{this.exited.emit({container:t.container.data,item:this})}),t.dropped.subscribe(t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,isPointerOverContainer:t.isPointerOverContainer,item:this,distance:t.distance})})}_assignDefaults(t){const{lockAxis:e,dragStartDelay:n,constrainPosition:i,previewClass:a,boundaryElement:o,draggingDisabled:s,rootElementSelector:r}=t;this.disabled=null!=s&&s,this.dragStartDelay=n||0,e&&(this.lockAxis=e),i&&(this.constrainPosition=i),a&&(this.previewClass=a),o&&(this.boundaryElement=o),r&&(this.rootElementSelector=r)}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq),i.Y36(ct,12),i.Y36(a.K0),i.Y36(i.R0b),i.Y36(i.s_b),i.Y36(rt,8),i.Y36(y.Is,8),i.Y36(at),i.Y36(i.sBO),i.Y36(ut,10),i.Y36(ot,12))},t.\u0275dir=i.lG2({type:t,selectors:[["","cdkDrag",""]],contentQueries:function(t,e,n){if(1&t&&(i.Suo(n,ht,5),i.Suo(n,gt,5),i.Suo(n,ut,5)),2&t){let t;i.iGM(t=i.CRH())&&(e._previewTemplate=t.first),i.iGM(t=i.CRH())&&(e._placeholderTemplate=t.first),i.iGM(t=i.CRH())&&(e._handles=t)}},hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(t,e){2&t&&i.ekj("cdk-drag-disabled",e.disabled)("cdk-drag-dragging",e._dragRef.isDragging())},inputs:{disabled:["cdkDragDisabled","disabled"],dragStartDelay:["cdkDragStartDelay","dragStartDelay"],lockAxis:["cdkDragLockAxis","lockAxis"],constrainPosition:["cdkDragConstrainPosition","constrainPosition"],previewClass:["cdkDragPreviewClass","previewClass"],boundaryElement:["cdkDragBoundary","boundaryElement"],rootElementSelector:["cdkDragRootElement","rootElementSelector"],data:["cdkDragData","data"],freeDragPosition:["cdkDragFreeDragPosition","freeDragPosition"]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[i._Bn([{provide:ot,useExisting:t}]),i.TTD]}),t._dragInstances=[],t})();function ft(t,e){let n=t.parentElement;for(;n;){if(n.matches?n.matches(e):n.msMatchesSelector(e))return n;n=n.parentElement}return null}let bt=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i.oAB({type:t}),t.\u0275inj=i.cJS({providers:[at],imports:[o.ZD]}),t})()},79961:function(t,e,n){"use strict";n.d(e,{XC:function(){return D},Bb:function(){return R},ZL:function(){return E}});var i=n(97388),a=n(19861),o=n(93169),s=n(35366),r=n(87064),l=n(87570),c=n(55959),d=n(31450),u=n(31906),p=n(40878),g=n(87254),h=n(61116),m=n(77923),f=n(43725),b=n(99235),v=n(82151),_=n(31041),Z=n(13070),x=n(90611),y=n(44689),A=n(43835),w=n(79996),k=n(66599),T=n(82628),C=n(94720);const q=["panel"];function U(t,e){if(1&t&&(s.TgZ(0,"div",0,1),s.Hsn(2),s.qZA()),2&t){const t=e.id,n=s.oxw();s.Q6J("id",n.id)("ngClass",n._classList),s.uIk("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(t))}}const I=["*"];let M=0;class O{constructor(t,e){this.source=t,this.option=e}}class J{}const P=(0,r.Kr)(J),N=new s.OlP("mat-autocomplete-default-options",{providedIn:"root",factory:function(){return{autoActiveFirstOption:!1}}});let S=(()=>{class t extends P{constructor(t,e,n,i){super(),this._changeDetectorRef=t,this._elementRef=e,this._activeOptionChanges=l.w.EMPTY,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new s.vpe,this.opened=new s.vpe,this.closed=new s.vpe,this.optionActivated=new s.vpe,this._classList={},this.id="mat-autocomplete-"+M++,this.inertGroups=(null==i?void 0:i.SAFARI)||!1,this._autoActiveFirstOption=!!n.autoActiveFirstOption}get isOpen(){return this._isOpen&&this.showPanel}get autoActiveFirstOption(){return this._autoActiveFirstOption}set autoActiveFirstOption(t){this._autoActiveFirstOption=(0,a.Ig)(t)}set classList(t){this._classList=t&&t.length?(0,a.du)(t).reduce((t,e)=>(t[e]=!0,t),{}):{},this._setVisibilityClasses(this._classList),this._elementRef.nativeElement.className=""}ngAfterContentInit(){this._keyManager=new i.s1(this.options).withWrap(),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._activeOptionChanges.unsubscribe()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._setVisibilityClasses(this._classList),this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){const e=new O(this,t);this.optionSelected.emit(e)}_getPanelAriaLabelledby(t){return this.ariaLabel?null:this.ariaLabelledby?(t?t+" ":"")+this.ariaLabelledby:t}_setVisibilityClasses(t){t[this._visibleClass]=this.showPanel,t[this._hiddenClass]=!this.showPanel}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(s.sBO),s.Y36(s.SBq),s.Y36(N),s.Y36(o.t4))},t.\u0275dir=s.lG2({type:t,viewQuery:function(t,e){if(1&t&&(s.Gf(s.Rgc,7),s.Gf(q,5)),2&t){let t;s.iGM(t=s.CRH())&&(e.template=t.first),s.iGM(t=s.CRH())&&(e.panel=t.first)}},inputs:{displayWith:"displayWith",autoActiveFirstOption:"autoActiveFirstOption",classList:["class","classList"],ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],panelWidth:"panelWidth"},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},features:[s.qOj]}),t})(),D=(()=>{class t extends S{constructor(){super(...arguments),this._visibleClass="mat-autocomplete-visible",this._hiddenClass="mat-autocomplete-hidden"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=s.n5z(t)))(n||t)}}(),t.\u0275cmp=s.Xpm({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(t,e,n){if(1&t&&(s.Suo(n,r.K7,5),s.Suo(n,r.ey,5)),2&t){let t;s.iGM(t=s.CRH())&&(e.optionGroups=t),s.iGM(t=s.CRH())&&(e.options=t)}},hostAttrs:[1,"mat-autocomplete"],inputs:{disableRipple:"disableRipple"},exportAs:["matAutocomplete"],features:[s._Bn([{provide:r.HF,useExisting:t}]),s.qOj],ngContentSelectors:I,decls:1,vars:0,consts:[["role","listbox",1,"mat-autocomplete-panel",3,"id","ngClass"],["panel",""]],template:function(t,e){1&t&&(s.F$t(),s.YNc(0,U,3,4,"ng-template"))},directives:[h.mk],styles:[".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}.mat-autocomplete-panel-above .mat-autocomplete-panel{border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}.mat-autocomplete-panel .mat-divider-horizontal{margin-top:-1px}.cdk-high-contrast-active .mat-autocomplete-panel{outline:solid 1px}mat-autocomplete{display:none}\n"],encapsulation:2,changeDetection:0}),t})();const Q=new s.OlP("mat-autocomplete-scroll-strategy"),Y={provide:Q,deps:[m.aV],useFactory:function(t){return()=>t.scrollStrategies.reposition()}},L={provide:_.JU,useExisting:(0,s.Gpc)(()=>E),multi:!0};let F=(()=>{class t{constructor(t,e,n,i,a,o,s,r,p,g,h){this._element=t,this._overlay=e,this._viewContainerRef=n,this._zone=i,this._changeDetectorRef=a,this._dir=s,this._formField=r,this._document=p,this._viewportRuler=g,this._defaults=h,this._componentDestroyed=!1,this._autocompleteDisabled=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=l.w.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new c.xQ,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._overlayAttached=!1,this.optionSelections=(0,d.P)(()=>this.autocomplete&&this.autocomplete.options?(0,u.T)(...this.autocomplete.options.map(t=>t.onSelectionChange)):this._zone.onStable.pipe((0,x.q)(1),(0,y.w)(()=>this.optionSelections))),this._scrollStrategy=o}get autocompleteDisabled(){return this._autocompleteDisabled}set autocompleteDisabled(t){this._autocompleteDisabled=(0,a.Ig)(t)}ngAfterViewInit(){const t=this._getWindow();void 0!==t&&this._zone.runOutsideAngular(()=>t.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){const t=this._getWindow();void 0!==t&&t.removeEventListener("blur",this._windowBlurHandler),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._attachOverlay(),this._floatLabel()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this.autocomplete.closed.emit(),this.autocomplete._isOpen=this._overlayAttached=!1,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._componentDestroyed||this._changeDetectorRef.detectChanges())}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return(0,u.T)(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe((0,A.h)(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe((0,A.h)(()=>this._overlayAttached)):(0,p.of)()).pipe((0,w.U)(t=>t instanceof r.rN?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return(0,u.T)((0,g.R)(this._document,"click"),(0,g.R)(this._document,"auxclick"),(0,g.R)(this._document,"touchend")).pipe((0,A.h)(t=>{const e=this._isInsideShadowRoot&&t.composedPath?t.composedPath()[0]:t.target,n=this._formField?this._formField._elementRef.nativeElement:null,i=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&e!==this._element.nativeElement&&(!n||!n.contains(e))&&(!i||!i.contains(e))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(e)}))}writeValue(t){Promise.resolve(null).then(()=>this._setTriggerValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){const e=t.keyCode;if(e!==b.hY||(0,b.Vb)(t)||t.preventDefault(),this.activeOption&&e===b.K5&&this.panelOpen)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){const n=this.autocomplete._keyManager.activeItem,i=e===b.LH||e===b.JH;this.panelOpen||e===b.Mf?this.autocomplete._keyManager.onKeydown(t):i&&this._canOpen()&&this.openPanel(),(i||this.autocomplete._keyManager.activeItem!==n)&&this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0)}}_handleInput(t){let e=t.target,n=e.value;"number"===e.type&&(n=""==n?null:parseFloat(n)),this._previousValue!==n&&(this._previousValue=n,this._onChange(n),this._canOpen()&&this._document.activeElement===t.target&&this.openPanel())}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_floatLabel(t=!1){this._formField&&"auto"===this._formField.floatLabel&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField.floatLabel="auto",this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){const t=this._zone.onStable.pipe((0,x.q)(1)),e=this.autocomplete.options.changes.pipe((0,k.b)(()=>this._positionStrategy.reapplyLastPosition()),(0,T.g)(0));return(0,u.T)(t,e).pipe((0,y.w)(()=>{const t=this.panelOpen;return this._resetActiveItem(),this.autocomplete._setVisibility(),this.panelOpen&&(this._overlayRef.updatePosition(),t!==this.panelOpen&&this.autocomplete.opened.emit()),this.panelClosingActions}),(0,x.q)(1)).subscribe(t=>this._setValueAndClose(t))}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_setTriggerValue(t){const e=this.autocomplete&&this.autocomplete.displayWith?this.autocomplete.displayWith(t):t,n=null!=e?e:"";this._formField?this._formField._control.value=n:this._element.nativeElement.value=n,this._previousValue=n}_setValueAndClose(t){t&&t.source&&(this._clearPreviousSelectedOption(t.source),this._setTriggerValue(t.source.value),this._onChange(t.source.value),this._element.nativeElement.focus(),this.autocomplete._emitSelectEvent(t.source)),this.closePanel()}_clearPreviousSelectedOption(t){this.autocomplete.options.forEach(e=>{e!==t&&e.selected&&e.deselect()})}_attachOverlay(){var t;null==this._isInsideShadowRoot&&(this._isInsideShadowRoot=!!(0,o.kV)(this._element.nativeElement));let e=this._overlayRef;e?(this._positionStrategy.setOrigin(this._getConnectedElement()),e.updateSize({width:this._getPanelWidth()})):(this._portal=new v.UE(this.autocomplete.template,this._viewContainerRef,{id:null===(t=this._formField)||void 0===t?void 0:t.getLabelId()}),e=this._overlay.create(this._getOverlayConfig()),this._overlayRef=e,e.keydownEvents().subscribe(t=>{(t.keyCode===b.hY&&!(0,b.Vb)(t)||t.keyCode===b.LH&&(0,b.Vb)(t,"altKey"))&&(this._resetActiveItem(),this._closeKeyEventStream.next(),t.stopPropagation(),t.preventDefault())}),this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&e&&e.updateSize({width:this._getPanelWidth()})})),e&&!e.hasAttached()&&(e.attach(this._portal),this._closingActionsSubscription=this._subscribeToClosingActions());const n=this.panelOpen;this.autocomplete._setVisibility(),this.autocomplete._isOpen=this._overlayAttached=!0,this.panelOpen&&n!==this.panelOpen&&this.autocomplete.opened.emit()}_getOverlayConfig(){var t;return new m.X_({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir,panelClass:null===(t=this._defaults)||void 0===t?void 0:t.overlayPanelClass})}_getOverlayPosition(){const t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){const e=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],n=this._aboveClass,i=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:n},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:n}];let a;a="above"===this.position?i:"below"===this.position?e:[...e,...i],t.withPositions(a)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){const t=this.autocomplete;t.autoActiveFirstOption?t._keyManager.setFirstItemActive():t._keyManager.setActiveItem(-1)}_canOpen(){const t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this._autocompleteDisabled}_getWindow(){var t;return(null===(t=this._document)||void 0===t?void 0:t.defaultView)||window}_scrollToOption(t){const e=this.autocomplete,n=(0,r.CB)(t,e.options,e.optionGroups);if(0===t&&1===n)e._setScrollTop(0);else if(e.panel){const n=e.options.toArray()[t];if(n){const t=n._getHostElement(),i=(0,r.jH)(t.offsetTop,t.offsetHeight,e._getScrollTop(),e.panel.nativeElement.offsetHeight);e._setScrollTop(i)}}}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(s.SBq),s.Y36(m.aV),s.Y36(s.s_b),s.Y36(s.R0b),s.Y36(s.sBO),s.Y36(Q),s.Y36(C.Is,8),s.Y36(Z.G_,9),s.Y36(h.K0,8),s.Y36(f.rL),s.Y36(N,8))},t.\u0275dir=s.lG2({type:t,inputs:{position:["matAutocompletePosition","position"],autocompleteAttribute:["autocomplete","autocompleteAttribute"],autocompleteDisabled:["matAutocompleteDisabled","autocompleteDisabled"],autocomplete:["matAutocomplete","autocomplete"],connectedTo:["matAutocompleteConnectedTo","connectedTo"]},features:[s.TTD]}),t})(),E=(()=>{class t extends F{constructor(){super(...arguments),this._aboveClass="mat-autocomplete-panel-above"}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=s.n5z(t)))(n||t)}}(),t.\u0275dir=s.lG2({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-autocomplete-trigger"],hostVars:7,hostBindings:function(t,e){1&t&&s.NdJ("focusin",function(){return e._handleFocus()})("blur",function(){return e._onTouched()})("input",function(t){return e._handleInput(t)})("keydown",function(t){return e._handleKeydown(t)}),2&t&&s.uIk("autocomplete",e.autocompleteAttribute)("role",e.autocompleteDisabled?null:"combobox")("aria-autocomplete",e.autocompleteDisabled?null:"list")("aria-activedescendant",e.panelOpen&&e.activeOption?e.activeOption.id:null)("aria-expanded",e.autocompleteDisabled?null:e.panelOpen.toString())("aria-owns",e.autocompleteDisabled||!e.panelOpen||null==e.autocomplete?null:e.autocomplete.id)("aria-haspopup",!e.autocompleteDisabled)},exportAs:["matAutocompleteTrigger"],features:[s._Bn([L]),s.qOj]}),t})(),R=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=s.oAB({type:t}),t.\u0275inj=s.cJS({providers:[Y],imports:[[m.U8,r.Ng,r.BQ,h.ez],f.ZD,r.Ng,r.BQ]}),t})()},92762:function(t,e,n){"use strict";n.d(e,{Yi:function(){return _},A9:function(){return f},vV:function(){return Z}});var i=n(19861),a=n(58378),o=n(35366),s=n(31041),r=n(87064),l=n(97388);const c=["button"],d=["*"],u=new o.OlP("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS"),p=new o.OlP("MatButtonToggleGroup"),g={provide:s.JU,useExisting:(0,o.Gpc)(()=>f),multi:!0};let h=0;class m{constructor(t,e){this.source=t,this.value=e}}let f=(()=>{class t{constructor(t,e){this._changeDetector=t,this._vertical=!1,this._multiple=!1,this._disabled=!1,this._controlValueAccessorChangeFn=()=>{},this._onTouched=()=>{},this._name="mat-button-toggle-group-"+h++,this.valueChange=new o.vpe,this.change=new o.vpe,this.appearance=e&&e.appearance?e.appearance:"standard"}get name(){return this._name}set name(t){this._name=t,this._buttonToggles&&this._buttonToggles.forEach(t=>{t.name=this._name,t._markForCheck()})}get vertical(){return this._vertical}set vertical(t){this._vertical=(0,i.Ig)(t)}get value(){const t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t.map(t=>t.value):t[0]?t[0].value:void 0}set value(t){this._setSelectionByValue(t),this.valueChange.emit(this.value)}get selected(){const t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t:t[0]||null}get multiple(){return this._multiple}set multiple(t){this._multiple=(0,i.Ig)(t)}get disabled(){return this._disabled}set disabled(t){this._disabled=(0,i.Ig)(t),this._buttonToggles&&this._buttonToggles.forEach(t=>t._markForCheck())}ngOnInit(){this._selectionModel=new a.Ov(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(t=>t.checked))}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_emitChangeEvent(){const t=this.selected,e=Array.isArray(t)?t[t.length-1]:t,n=new m(e,this.value);this._controlValueAccessorChangeFn(n.value),this.change.emit(n)}_syncButtonToggle(t,e,n=!1,i=!1){this.multiple||!this.selected||t.checked||(this.selected.checked=!1),this._selectionModel?e?this._selectionModel.select(t):this._selectionModel.deselect(t):i=!0,i?Promise.resolve().then(()=>this._updateModelValue(n)):this._updateModelValue(n)}_isSelected(t){return this._selectionModel&&this._selectionModel.isSelected(t)}_isPrechecked(t){return void 0!==this._rawValue&&(this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(e=>null!=t.value&&e===t.value):t.value===this._rawValue)}_setSelectionByValue(t){this._rawValue=t,this._buttonToggles&&(this.multiple&&t?(Array.isArray(t),this._clearSelection(),t.forEach(t=>this._selectValue(t))):(this._clearSelection(),this._selectValue(t)))}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(t=>t.checked=!1)}_selectValue(t){const e=this._buttonToggles.find(e=>null!=e.value&&e.value===t);e&&(e.checked=!0,this._selectionModel.select(e))}_updateModelValue(t){t&&this._emitChangeEvent(),this.valueChange.emit(this.value)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.sBO),o.Y36(u,8))},t.\u0275dir=o.lG2({type:t,selectors:[["mat-button-toggle-group"]],contentQueries:function(t,e,n){if(1&t&&o.Suo(n,_,5),2&t){let t;o.iGM(t=o.CRH())&&(e._buttonToggles=t)}},hostAttrs:["role","group",1,"mat-button-toggle-group"],hostVars:5,hostBindings:function(t,e){2&t&&(o.uIk("aria-disabled",e.disabled),o.ekj("mat-button-toggle-vertical",e.vertical)("mat-button-toggle-group-appearance-standard","standard"===e.appearance))},inputs:{appearance:"appearance",name:"name",vertical:"vertical",value:"value",multiple:"multiple",disabled:"disabled"},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[o._Bn([g,{provide:p,useExisting:t}])]}),t})();class b{}const v=(0,r.Kr)(b);let _=(()=>{class t extends v{constructor(t,e,n,i,a,s){super(),this._changeDetectorRef=e,this._elementRef=n,this._focusMonitor=i,this._isSingleSelector=!1,this._checked=!1,this.ariaLabelledby=null,this._disabled=!1,this.change=new o.vpe;const r=Number(a);this.tabIndex=r||0===r?r:null,this.buttonToggleGroup=t,this.appearance=s&&s.appearance?s.appearance:"standard"}get buttonId(){return`${this.id}-button`}get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(t){this._appearance=t}get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(t){const e=(0,i.Ig)(t);e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(t){this._disabled=(0,i.Ig)(t)}ngOnInit(){const t=this.buttonToggleGroup;this._isSingleSelector=t&&!t.multiple,this.id=this.id||"mat-button-toggle-"+h++,this._isSingleSelector&&(this.name=t.name),t&&(t._isPrechecked(this)?this.checked=!0:t._isSelected(this)!==this._checked&&t._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){const t=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),t&&t._isSelected(this)&&t._syncButtonToggle(this,!1,!1,!0)}focus(t){this._buttonElement.nativeElement.focus(t)}_onButtonClick(){const t=!!this._isSingleSelector||!this._checked;t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.change.emit(new m(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(p,8),o.Y36(o.sBO),o.Y36(o.SBq),o.Y36(l.tE),o.$8M("tabindex"),o.Y36(u,8))},t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-button-toggle"]],viewQuery:function(t,e){if(1&t&&o.Gf(c,5),2&t){let t;o.iGM(t=o.CRH())&&(e._buttonElement=t.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:12,hostBindings:function(t,e){1&t&&o.NdJ("focus",function(){return e.focus()}),2&t&&(o.uIk("aria-label",null)("aria-labelledby",null)("id",e.id)("name",null),o.ekj("mat-button-toggle-standalone",!e.buttonToggleGroup)("mat-button-toggle-checked",e.checked)("mat-button-toggle-disabled",e.disabled)("mat-button-toggle-appearance-standard","standard"===e.appearance))},inputs:{disableRipple:"disableRipple",ariaLabelledby:["aria-labelledby","ariaLabelledby"],tabIndex:"tabIndex",appearance:"appearance",checked:"checked",disabled:"disabled",id:"id",name:"name",ariaLabel:["aria-label","ariaLabel"],value:"value"},outputs:{change:"change"},exportAs:["matButtonToggle"],features:[o.qOj],ngContentSelectors:d,decls:6,vars:9,consts:[["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"id","disabled","click"],["button",""],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"]],template:function(t,e){if(1&t&&(o.F$t(),o.TgZ(0,"button",0,1),o.NdJ("click",function(){return e._onButtonClick()}),o.TgZ(2,"span",2),o.Hsn(3),o.qZA(),o.qZA(),o._UZ(4,"span",3),o._UZ(5,"span",4)),2&t){const t=o.MAs(1);o.Q6J("id",e.buttonId)("disabled",e.disabled||null),o.uIk("tabindex",e.disabled?-1:e.tabIndex)("aria-pressed",e.checked)("name",e.name||null)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledby),o.xp6(5),o.Q6J("matRippleTrigger",t)("matRippleDisabled",e.disableRipple||e.disabled)}},directives:[r.wG],styles:[".mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;border-radius:2px;-webkit-tap-highlight-color:transparent}.cdk-high-contrast-active .mat-button-toggle-standalone,.cdk-high-contrast-active .mat-button-toggle-group{outline:solid 1px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:4px}.cdk-high-contrast-active .mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.cdk-high-contrast-active .mat-button-toggle-group-appearance-standard{outline:0}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:1}.cdk-high-contrast-active .mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:.5}.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay{opacity:.04}.mat-button-toggle-appearance-standard.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay{opacity:.12}.cdk-high-contrast-active .mat-button-toggle-appearance-standard.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay{opacity:.5}@media(hover: none){.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;line-height:36px;padding:0 16px;position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{border-radius:inherit;pointer-events:none;opacity:0;top:0;left:0;right:0;bottom:0;position:absolute}.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 36px}.cdk-high-contrast-active .mat-button-toggle-checked .mat-button-toggle-focus-overlay{opacity:.5;height:0}.cdk-high-contrast-active .mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}\n"],encapsulation:2,changeDetection:0}),t})(),Z=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[r.BQ,r.si],r.BQ]}),t})()},95522:function(t,e,n){"use strict";n.d(e,{HS:function(){return T},oH:function(){return N},qn:function(){return J},qH:function(){return C},Hi:function(){return D}});var i=n(99235),a=n(35366),o=n(87064),s=n(19861),r=n(61116),l=n(26136),c=n(55959),d=n(31906),u=n(90611),p=n(25416),g=n(56238),h=n(97388),m=n(58378),f=n(13070),b=n(93169),v=n(94720),_=n(31041);const Z=["*"],x=new a.OlP("MatChipRemove"),y=new a.OlP("MatChipAvatar"),A=new a.OlP("MatChipTrailingIcon");class w{constructor(t){this._elementRef=t}}const k=(0,o.sb)((0,o.pj)((0,o.Kr)(w),"primary"),-1);let T=(()=>{class t extends k{constructor(t,e,n,i,s,r,l,d){super(t),this._elementRef=t,this._ngZone=e,this._changeDetectorRef=s,this._hasFocus=!1,this.chipListSelectable=!0,this._chipListMultiple=!1,this._chipListDisabled=!1,this._selected=!1,this._selectable=!0,this._disabled=!1,this._removable=!0,this._onFocus=new c.xQ,this._onBlur=new c.xQ,this.selectionChange=new a.vpe,this.destroyed=new a.vpe,this.removed=new a.vpe,this._addHostClassName(),this._chipRippleTarget=r.createElement("div"),this._chipRippleTarget.classList.add("mat-chip-ripple"),this._elementRef.nativeElement.appendChild(this._chipRippleTarget),this._chipRipple=new o.IR(this,e,this._chipRippleTarget,n),this._chipRipple.setupTriggerEvents(t),this.rippleConfig=i||{},this._animationsDisabled="NoopAnimations"===l,this.tabIndex=null!=d&&parseInt(d)||-1}get rippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||!!this.rippleConfig.disabled}get selected(){return this._selected}set selected(t){const e=(0,s.Ig)(t);e!==this._selected&&(this._selected=e,this._dispatchSelectionChange())}get value(){return void 0!==this._value?this._value:this._elementRef.nativeElement.textContent}set value(t){this._value=t}get selectable(){return this._selectable&&this.chipListSelectable}set selectable(t){this._selectable=(0,s.Ig)(t)}get disabled(){return this._chipListDisabled||this._disabled}set disabled(t){this._disabled=(0,s.Ig)(t)}get removable(){return this._removable}set removable(t){this._removable=(0,s.Ig)(t)}get ariaSelected(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null}_addHostClassName(){const t=this._elementRef.nativeElement;t.hasAttribute("mat-basic-chip")||"mat-basic-chip"===t.tagName.toLowerCase()?t.classList.add("mat-basic-chip"):t.classList.add("mat-standard-chip")}ngOnDestroy(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()}select(){this._selected||(this._selected=!0,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}deselect(){this._selected&&(this._selected=!1,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}selectViaInteraction(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0),this._changeDetectorRef.markForCheck())}toggleSelected(t=!1){return this._selected=!this.selected,this._dispatchSelectionChange(t),this._changeDetectorRef.markForCheck(),this.selected}focus(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0}remove(){this.removable&&this.removed.emit({chip:this})}_handleClick(t){this.disabled?t.preventDefault():t.stopPropagation()}_handleKeydown(t){if(!this.disabled)switch(t.keyCode){case i.yY:case i.ZH:this.remove(),t.preventDefault();break;case i.L_:this.selectable&&this.toggleSelected(!0),t.preventDefault()}}_blur(){this._ngZone.onStable.pipe((0,u.q)(1)).subscribe(()=>{this._ngZone.run(()=>{this._hasFocus=!1,this._onBlur.next({chip:this})})})}_dispatchSelectionChange(t=!1){this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(a.SBq),a.Y36(a.R0b),a.Y36(b.t4),a.Y36(o.Y2,8),a.Y36(a.sBO),a.Y36(r.K0),a.Y36(l.Qb,8),a.$8M("tabindex"))},t.\u0275dir=a.lG2({type:t,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,e,n){if(1&t&&(a.Suo(n,y,5),a.Suo(n,A,5),a.Suo(n,x,5)),2&t){let t;a.iGM(t=a.CRH())&&(e.avatar=t.first),a.iGM(t=a.CRH())&&(e.trailingIcon=t.first),a.iGM(t=a.CRH())&&(e.removeIcon=t.first)}},hostAttrs:["role","option",1,"mat-chip","mat-focus-indicator"],hostVars:14,hostBindings:function(t,e){1&t&&a.NdJ("click",function(t){return e._handleClick(t)})("keydown",function(t){return e._handleKeydown(t)})("focus",function(){return e.focus()})("blur",function(){return e._blur()}),2&t&&(a.uIk("tabindex",e.disabled?null:e.tabIndex)("disabled",e.disabled||null)("aria-disabled",e.disabled.toString())("aria-selected",e.ariaSelected),a.ekj("mat-chip-selected",e.selected)("mat-chip-with-avatar",e.avatar)("mat-chip-with-trailing-icon",e.trailingIcon||e.removeIcon)("mat-chip-disabled",e.disabled)("_mat-animation-noopable",e._animationsDisabled))},inputs:{color:"color",disableRipple:"disableRipple",tabIndex:"tabIndex",selected:"selected",value:"value",selectable:"selectable",disabled:"disabled",removable:"removable"},outputs:{selectionChange:"selectionChange",destroyed:"destroyed",removed:"removed"},exportAs:["matChip"],features:[a.qOj]}),t})(),C=(()=>{class t{constructor(t,e){this._parentChip=t,"BUTTON"===e.nativeElement.nodeName&&e.nativeElement.setAttribute("type","button")}_handleClick(t){const e=this._parentChip;e.removable&&!e.disabled&&e.remove(),t.stopPropagation()}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(T),a.Y36(a.SBq))},t.\u0275dir=a.lG2({type:t,selectors:[["","matChipRemove",""]],hostAttrs:[1,"mat-chip-remove","mat-chip-trailing-icon"],hostBindings:function(t,e){1&t&&a.NdJ("click",function(t){return e._handleClick(t)})},features:[a._Bn([{provide:x,useExisting:t}])]}),t})();const q=new a.OlP("mat-chips-default-options");class U{constructor(t,e,n,i){this._defaultErrorStateMatcher=t,this._parentForm=e,this._parentFormGroup=n,this.ngControl=i}}const I=(0,o.FD)(U);let M=0;class O{constructor(t,e){this.source=t,this.value=e}}let J=(()=>{class t extends I{constructor(t,e,n,i,o,s,r){super(s,i,o,r),this._elementRef=t,this._changeDetectorRef=e,this._dir=n,this.ngControl=r,this.controlType="mat-chip-list",this._lastDestroyedChipIndex=null,this._destroyed=new c.xQ,this._uid="mat-chip-list-"+M++,this._tabIndex=0,this._userTabIndex=null,this._onTouched=()=>{},this._onChange=()=>{},this._multiple=!1,this._compareWith=(t,e)=>t===e,this._required=!1,this._disabled=!1,this.ariaOrientation="horizontal",this._selectable=!0,this.change=new a.vpe,this.valueChange=new a.vpe,this.ngControl&&(this.ngControl.valueAccessor=this)}get selected(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}get role(){return this.empty?null:"listbox"}get multiple(){return this._multiple}set multiple(t){this._multiple=(0,s.Ig)(t),this._syncChipsState()}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this.writeValue(t),this._value=t}get id(){return this._chipInput?this._chipInput.id:this._uid}get required(){return this._required}set required(t){this._required=(0,s.Ig)(t),this.stateChanges.next()}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get focused(){return this._chipInput&&this._chipInput.focused||this._hasFocusedChip()}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this.chips||0===this.chips.length)}get shouldLabelFloat(){return!this.empty||this.focused}get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=(0,s.Ig)(t),this._syncChipsState()}get selectable(){return this._selectable}set selectable(t){this._selectable=(0,s.Ig)(t),this.chips&&this.chips.forEach(t=>t.chipListSelectable=this._selectable)}set tabIndex(t){this._userTabIndex=t,this._tabIndex=t}get chipSelectionChanges(){return(0,d.T)(...this.chips.map(t=>t.selectionChange))}get chipFocusChanges(){return(0,d.T)(...this.chips.map(t=>t._onFocus))}get chipBlurChanges(){return(0,d.T)(...this.chips.map(t=>t._onBlur))}get chipRemoveChanges(){return(0,d.T)(...this.chips.map(t=>t.destroyed))}ngAfterContentInit(){this._keyManager=new h.Em(this.chips).withWrap().withVerticalOrientation().withHomeAndEnd().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe((0,p.R)(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.tabOut.pipe((0,p.R)(this._destroyed)).subscribe(()=>{this._allowFocusEscape()}),this.chips.changes.pipe((0,g.O)(null),(0,p.R)(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>{this._syncChipsState()}),this._resetChips(),this._initializeSelection(),this._updateTabIndex(),this._updateFocusForDestroyedChips(),this.stateChanges.next()})}ngOnInit(){this._selectionModel=new m.Ov(this.multiple,void 0,!1),this.stateChanges.next()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==this._disabled&&(this.disabled=!!this.ngControl.disabled))}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()}registerInput(t){this._chipInput=t,this._elementRef.nativeElement.setAttribute("data-mat-chip-input",t.id)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}writeValue(t){this.chips&&this._setSelectionByValue(t,!1)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}onContainerClick(t){this._originatesFromChip(t)||this.focus()}focus(t){this.disabled||this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(t),this.stateChanges.next()))}_focusInput(t){this._chipInput&&this._chipInput.focus(t)}_keydown(t){const e=t.target;t.keyCode===i.ZH&&this._isInputEmpty(e)?(this._keyManager.setLastItemActive(),t.preventDefault()):e&&e.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())}_updateTabIndex(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)}_updateFocusForDestroyedChips(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){const t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=null}_isValidIndex(t){return t>=0&&t<this.chips.length}_isInputEmpty(t){return!(!t||"input"!==t.nodeName.toLowerCase()||t.value)}_setSelectionByValue(t,e=!0){if(this._clearSelection(),this.chips.forEach(t=>t.deselect()),Array.isArray(t))t.forEach(t=>this._selectValue(t,e)),this._sortValues();else{const n=this._selectValue(t,e);n&&e&&this._keyManager.setActiveItem(n)}}_selectValue(t,e=!0){const n=this.chips.find(e=>null!=e.value&&this._compareWith(e.value,t));return n&&(e?n.selectViaInteraction():n.select(),this._selectionModel.select(n)),n}_initializeSelection(){Promise.resolve().then(()=>{(this.ngControl||this._value)&&(this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value,!1),this.stateChanges.next())})}_clearSelection(t){this._selectionModel.clear(),this.chips.forEach(e=>{e!==t&&e.deselect()}),this.stateChanges.next()}_sortValues(){this._multiple&&(this._selectionModel.clear(),this.chips.forEach(t=>{t.selected&&this._selectionModel.select(t)}),this.stateChanges.next())}_propagateChanges(t){let e=null;e=Array.isArray(this.selected)?this.selected.map(t=>t.value):this.selected?this.selected.value:t,this._value=e,this.change.emit(new O(this,e)),this.valueChange.emit(e),this._onChange(e),this._changeDetectorRef.markForCheck()}_blur(){this._hasFocusedChip()||this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(()=>{this.focused||this._markAsTouched()}):this._markAsTouched())}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}_allowFocusEscape(){-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(()=>{this._tabIndex=this._userTabIndex||0,this._changeDetectorRef.markForCheck()}))}_resetChips(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()}_dropSubscriptions(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=null)}_listenToChipsSelection(){this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(t=>{t.source.selected?this._selectionModel.select(t.source):this._selectionModel.deselect(t.source),this.multiple||this.chips.forEach(t=>{!this._selectionModel.isSelected(t)&&t.selected&&t.deselect()}),t.isUserInput&&this._propagateChanges()})}_listenToChipsFocus(){this._chipFocusSubscription=this.chipFocusChanges.subscribe(t=>{let e=this.chips.toArray().indexOf(t.chip);this._isValidIndex(e)&&this._keyManager.updateActiveItem(e),this.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(()=>{this._blur(),this.stateChanges.next()})}_listenToChipsRemoved(){this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(t=>{const e=t.chip,n=this.chips.toArray().indexOf(t.chip);this._isValidIndex(n)&&e._hasFocus&&(this._lastDestroyedChipIndex=n)})}_originatesFromChip(t){let e=t.target;for(;e&&e!==this._elementRef.nativeElement;){if(e.classList.contains("mat-chip"))return!0;e=e.parentElement}return!1}_hasFocusedChip(){return this.chips&&this.chips.some(t=>t._hasFocus)}_syncChipsState(){this.chips&&this.chips.forEach(t=>{t._chipListDisabled=this._disabled,t._chipListMultiple=this.multiple})}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(a.SBq),a.Y36(a.sBO),a.Y36(v.Is,8),a.Y36(_.F,8),a.Y36(_.sg,8),a.Y36(o.rD),a.Y36(_.a5,10))},t.\u0275cmp=a.Xpm({type:t,selectors:[["mat-chip-list"]],contentQueries:function(t,e,n){if(1&t&&a.Suo(n,T,5),2&t){let t;a.iGM(t=a.CRH())&&(e.chips=t)}},hostAttrs:[1,"mat-chip-list"],hostVars:15,hostBindings:function(t,e){1&t&&a.NdJ("focus",function(){return e.focus()})("blur",function(){return e._blur()})("keydown",function(t){return e._keydown(t)}),2&t&&(a.Ikx("id",e._uid),a.uIk("tabindex",e.disabled?null:e._tabIndex)("aria-describedby",e._ariaDescribedby||null)("aria-required",e.role?e.required:null)("aria-disabled",e.disabled.toString())("aria-invalid",e.errorState)("aria-multiselectable",e.multiple)("role",e.role)("aria-orientation",e.ariaOrientation),a.ekj("mat-chip-list-disabled",e.disabled)("mat-chip-list-invalid",e.errorState)("mat-chip-list-required",e.required))},inputs:{ariaOrientation:["aria-orientation","ariaOrientation"],multiple:"multiple",compareWith:"compareWith",value:"value",required:"required",placeholder:"placeholder",disabled:"disabled",selectable:"selectable",tabIndex:"tabIndex",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},exportAs:["matChipList"],features:[a._Bn([{provide:f.Eo,useExisting:t}]),a.qOj],ngContentSelectors:Z,decls:2,vars:0,consts:[[1,"mat-chip-list-wrapper"]],template:function(t,e){1&t&&(a.F$t(),a.TgZ(0,"div",0),a.Hsn(1),a.qZA())},styles:['.mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:"";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n'],encapsulation:2,changeDetection:0}),t})(),P=0,N=(()=>{class t{constructor(t,e){this._elementRef=t,this._defaultOptions=e,this.focused=!1,this._addOnBlur=!1,this.separatorKeyCodes=this._defaultOptions.separatorKeyCodes,this.chipEnd=new a.vpe,this.placeholder="",this.id="mat-chip-list-input-"+P++,this._disabled=!1,this._inputElement=this._elementRef.nativeElement}set chipList(t){t&&(this._chipList=t,this._chipList.registerInput(this))}get addOnBlur(){return this._addOnBlur}set addOnBlur(t){this._addOnBlur=(0,s.Ig)(t)}get disabled(){return this._disabled||this._chipList&&this._chipList.disabled}set disabled(t){this._disabled=(0,s.Ig)(t)}get empty(){return!this._inputElement.value}ngOnChanges(){this._chipList.stateChanges.next()}_keydown(t){t&&t.keyCode===i.Mf&&!(0,i.Vb)(t,"shiftKey")&&this._chipList._allowFocusEscape(),this._emitChipEnd(t)}_blur(){this.addOnBlur&&this._emitChipEnd(),this.focused=!1,this._chipList.focused||this._chipList._blur(),this._chipList.stateChanges.next()}_focus(){this.focused=!0,this._chipList.stateChanges.next()}_emitChipEnd(t){!this._inputElement.value&&t&&this._chipList._keydown(t),t&&!this._isSeparatorKey(t)||(this.chipEnd.emit({input:this._inputElement,value:this._inputElement.value}),t&&t.preventDefault())}_onInput(){this._chipList.stateChanges.next()}focus(t){this._inputElement.focus(t)}_isSeparatorKey(t){return!(0,i.Vb)(t)&&new Set(this.separatorKeyCodes).has(t.keyCode)}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(a.SBq),a.Y36(q))},t.\u0275dir=a.lG2({type:t,selectors:[["input","matChipInputFor",""]],hostAttrs:[1,"mat-chip-input","mat-input-element"],hostVars:5,hostBindings:function(t,e){1&t&&a.NdJ("keydown",function(t){return e._keydown(t)})("blur",function(){return e._blur()})("focus",function(){return e._focus()})("input",function(){return e._onInput()}),2&t&&(a.Ikx("id",e.id),a.uIk("disabled",e.disabled||null)("placeholder",e.placeholder||null)("aria-invalid",e._chipList&&e._chipList.ngControl?e._chipList.ngControl.invalid:null)("aria-required",e._chipList&&e._chipList.required||null))},inputs:{separatorKeyCodes:["matChipInputSeparatorKeyCodes","separatorKeyCodes"],placeholder:"placeholder",id:"id",chipList:["matChipInputFor","chipList"],addOnBlur:["matChipInputAddOnBlur","addOnBlur"],disabled:"disabled"},outputs:{chipEnd:"matChipInputTokenEnd"},exportAs:["matChipInput","matChipInputFor"],features:[a.TTD]}),t})();const S={separatorKeyCodes:[i.K5]};let D=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=a.oAB({type:t}),t.\u0275inj=a.cJS({providers:[o.rD,{provide:q,useValue:S}],imports:[[o.BQ]]}),t})()},6489:function(t,e,n){"use strict";n.d(e,{pp:function(){return R},To:function(){return $},ib:function(){return Y},VG:function(){return L},yz:function(){return F},yK:function(){return E}});var i=n(35366),a=n(19861),o=n(55959),s=n(87570),r=n(58378);let l=0;const c=new i.OlP("CdkAccordion");let d=(()=>{class t{constructor(){this._stateChanges=new o.xQ,this._openCloseAllActions=new o.xQ,this.id="cdk-accordion-"+l++,this._multi=!1}get multi(){return this._multi}set multi(t){this._multi=(0,a.Ig)(t)}openAll(){this._multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(t){this._stateChanges.next(t)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=i.lG2({type:t,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:"multi"},exportAs:["cdkAccordion"],features:[i._Bn([{provide:c,useExisting:t}]),i.TTD]}),t})(),u=0,p=(()=>{class t{constructor(t,e,n){this.accordion=t,this._changeDetectorRef=e,this._expansionDispatcher=n,this._openCloseAllSubscription=s.w.EMPTY,this.closed=new i.vpe,this.opened=new i.vpe,this.destroyed=new i.vpe,this.expandedChange=new i.vpe,this.id="cdk-accordion-child-"+u++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=n.listen((t,e)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===e&&this.id!==t&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=(0,a.Ig)(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=(0,a.Ig)(t)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(c,12),i.Y36(i.sBO),i.Y36(r.A8))},t.\u0275dir=i.lG2({type:t,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[i._Bn([{provide:c,useValue:void 0}])]}),t})(),g=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i.oAB({type:t}),t.\u0275inj=i.cJS({}),t})();var h=n(82151),m=n(61116),f=n(87064),b=n(97388),v=n(98720),_=n(56238),Z=n(43835),x=n(90611),y=n(99235),A=n(26136),w=n(34056),k=n(31906),T=n(99713);const C=["body"];function q(t,e){}const U=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],I=["mat-expansion-panel-header","*","mat-action-row"];function M(t,e){if(1&t&&i._UZ(0,"span",2),2&t){const t=i.oxw();i.Q6J("@indicatorRotate",t._getExpandedState())}}const O=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],J=["mat-panel-title","mat-panel-description","*"],P=new i.OlP("MAT_ACCORDION"),N={indicatorRotate:(0,T.X$)("indicatorRotate",[(0,T.SB)("collapsed, void",(0,T.oB)({transform:"rotate(0deg)"})),(0,T.SB)("expanded",(0,T.oB)({transform:"rotate(180deg)"})),(0,T.eR)("expanded <=> collapsed, void => collapsed",(0,T.jt)("225ms cubic-bezier(0.4,0.0,0.2,1)"))]),bodyExpansion:(0,T.X$)("bodyExpansion",[(0,T.SB)("collapsed, void",(0,T.oB)({height:"0px",visibility:"hidden"})),(0,T.SB)("expanded",(0,T.oB)({height:"*",visibility:"visible"})),(0,T.eR)("expanded <=> collapsed, void => collapsed",(0,T.jt)("225ms cubic-bezier(0.4,0.0,0.2,1)"))])};let S=(()=>{class t{constructor(t){this._template=t}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.Rgc))},t.\u0275dir=i.lG2({type:t,selectors:[["ng-template","matExpansionPanelContent",""]]}),t})(),D=0;const Q=new i.OlP("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let Y=(()=>{class t extends p{constructor(t,e,n,a,s,r,l){super(t,e,n),this._viewContainerRef=a,this._animationMode=r,this._hideToggle=!1,this.afterExpand=new i.vpe,this.afterCollapse=new i.vpe,this._inputChanges=new o.xQ,this._headerId="mat-expansion-panel-header-"+D++,this._bodyAnimationDone=new o.xQ,this.accordion=t,this._document=s,this._bodyAnimationDone.pipe((0,v.x)((t,e)=>t.fromState===e.fromState&&t.toState===e.toState)).subscribe(t=>{"void"!==t.fromState&&("expanded"===t.toState?this.afterExpand.emit():"collapsed"===t.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=(0,a.Ig)(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe((0,_.O)(null),(0,Z.h)(()=>this.expanded&&!this._portal),(0,x.q)(1)).subscribe(()=>{this._portal=new h.UE(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,e=this._body.nativeElement;return t===e||e.contains(t)}return!1}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(P,12),i.Y36(i.sBO),i.Y36(r.A8),i.Y36(i.s_b),i.Y36(m.K0),i.Y36(A.Qb,8),i.Y36(Q,8))},t.\u0275cmp=i.Xpm({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(t,e,n){if(1&t&&i.Suo(n,S,5),2&t){let t;i.iGM(t=i.CRH())&&(e._lazyContent=t.first)}},viewQuery:function(t,e){if(1&t&&i.Gf(C,5),2&t){let t;i.iGM(t=i.CRH())&&(e._body=t.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,e){2&t&&i.ekj("mat-expanded",e.expanded)("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-expansion-panel-spacing",e._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[i._Bn([{provide:P,useValue:void 0}]),i.qOj,i.TTD],ngContentSelectors:I,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,e){1&t&&(i.F$t(U),i.Hsn(0),i.TgZ(1,"div",0,1),i.NdJ("@bodyExpansion.done",function(t){return e._bodyAnimationDone.next(t)}),i.TgZ(3,"div",2),i.Hsn(4,1),i.YNc(5,q,0,0,"ng-template",3),i.qZA(),i.Hsn(6,2),i.qZA()),2&t&&(i.xp6(1),i.Q6J("@bodyExpansion",e._getExpandedState())("id",e.id),i.uIk("aria-labelledby",e._headerId),i.xp6(4),i.Q6J("cdkPortalOutlet",e._portal))},directives:[h.Pl],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[N.bodyExpansion]},changeDetection:0}),t})(),L=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=i.lG2({type:t,selectors:[["mat-action-row"]],hostAttrs:[1,"mat-action-row"]}),t})(),F=(()=>{class t{constructor(t,e,n,i,a,o){this.panel=t,this._element=e,this._focusMonitor=n,this._changeDetectorRef=i,this._animationMode=o,this._parentChangeSubscription=s.w.EMPTY;const r=t.accordion?t.accordion._stateChanges.pipe((0,Z.h)(t=>!(!t.hideToggle&&!t.togglePosition))):w.E;this._parentChangeSubscription=(0,k.T)(t.opened,t.closed,r,t._inputChanges.pipe((0,Z.h)(t=>!!(t.hideToggle||t.disabled||t.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe((0,Z.h)(()=>t._containsFocus())).subscribe(()=>n.focusVia(e,"program")),a&&(this.expandedHeight=a.expandedHeight,this.collapsedHeight=a.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case y.L_:case y.K5:(0,y.Vb)(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,e){t?this._focusMonitor.focusVia(this._element,t,e):this._element.nativeElement.focus(e)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(Y,1),i.Y36(i.SBq),i.Y36(b.tE),i.Y36(i.sBO),i.Y36(Q,8),i.Y36(A.Qb,8))},t.\u0275cmp=i.Xpm({type:t,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,e){1&t&&i.NdJ("click",function(){return e._toggle()})("keydown",function(t){return e._keydown(t)}),2&t&&(i.uIk("id",e.panel._headerId)("tabindex",e.disabled?-1:0)("aria-controls",e._getPanelId())("aria-expanded",e._isExpanded())("aria-disabled",e.panel.disabled),i.Udp("height",e._getHeaderHeight()),i.ekj("mat-expanded",e._isExpanded())("mat-expansion-toggle-indicator-after","after"===e._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===e._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},ngContentSelectors:J,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,e){1&t&&(i.F$t(O),i.TgZ(0,"span",0),i.Hsn(1),i.Hsn(2,1),i.Hsn(3,2),i.qZA(),i.YNc(4,M,1,1,"span",1)),2&t&&(i.xp6(4),i.Q6J("ngIf",e._showToggle()))},directives:[m.O5],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[N.indicatorRotate]},changeDetection:0}),t})(),E=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=i.lG2({type:t,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),t})(),R=(()=>{class t extends d{constructor(){super(...arguments),this._ownHeaders=new i.n_E,this._hideToggle=!1,this.displayMode="default",this.togglePosition="after"}get hideToggle(){return this._hideToggle}set hideToggle(t){this._hideToggle=(0,a.Ig)(t)}ngAfterContentInit(){this._headers.changes.pipe((0,_.O)(this._headers)).subscribe(t=>{this._ownHeaders.reset(t.filter(t=>t.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new b.Em(this._ownHeaders).withWrap().withHomeAndEnd()}_handleHeaderKeydown(t){this._keyManager.onKeydown(t)}_handleHeaderFocus(t){this._keyManager.updateActiveItem(t)}ngOnDestroy(){super.ngOnDestroy(),this._ownHeaders.destroy()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=i.n5z(t)))(n||t)}}(),t.\u0275dir=i.lG2({type:t,selectors:[["mat-accordion"]],contentQueries:function(t,e,n){if(1&t&&i.Suo(n,F,5),2&t){let t;i.iGM(t=i.CRH())&&(e._headers=t)}},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(t,e){2&t&&i.ekj("mat-accordion-multi",e.multi)},inputs:{multi:"multi",displayMode:"displayMode",togglePosition:"togglePosition",hideToggle:"hideToggle"},exportAs:["matAccordion"],features:[i._Bn([{provide:P,useExisting:t}]),i.qOj]}),t})(),$=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i.oAB({type:t}),t.\u0275inj=i.cJS({imports:[[m.ez,f.BQ,g,h.eL]]}),t})()},7436:function(t,e,n){"use strict";n.d(e,{U0:function(){return A},VQ:function(){return _},Fk:function(){return w}});var i=n(35366),a=n(87064),o=n(19861),s=n(31041),r=n(26136),l=n(97388),c=n(58378);const d=["input"],u=function(){return{enterDuration:150}},p=["*"],g=new i.OlP("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let h=0;const m={provide:s.JU,useExisting:(0,i.Gpc)(()=>_),multi:!0};class f{constructor(t,e){this.source=t,this.value=e}}const b=new i.OlP("MatRadioGroup");let v=(()=>{class t{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+h++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new i.vpe}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=(0,o.Ig)(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=(0,o.Ig)(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(t=>{t.checked=this.value===t.value,t.checked&&(this._selected=t)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new f(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.sBO))},t.\u0275dir=i.lG2({type:t,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),t})(),_=(()=>{class t extends v{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=i.n5z(t)))(n||t)}}(),t.\u0275dir=i.lG2({type:t,selectors:[["mat-radio-group"]],contentQueries:function(t,e,n){if(1&t&&i.Suo(n,A,5),2&t){let t;i.iGM(t=i.CRH())&&(e._radios=t)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[i._Bn([m,{provide:b,useExisting:t}]),i.qOj]}),t})();class Z{constructor(t){this._elementRef=t}}const x=(0,a.Kr)((0,a.sb)(Z));let y=(()=>{class t extends x{constructor(t,e,n,a,s,r,l,c){super(e),this._changeDetector=n,this._focusMonitor=a,this._radioDispatcher=s,this._animationMode=r,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++h,this.id=this._uniqueId,this.change=new i.vpe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,c&&(this.tabIndex=(0,o.su)(c,0)),this._removeUniqueSelectionListener=s.listen((t,e)=>{t!==this.id&&e===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const e=(0,o.Ig)(t);this._checked!==e&&(this._checked=e,e&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!e&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),e&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled((0,o.Ig)(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=(0,o.Ig)(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,e){e?this._focusMonitor.focusVia(this._inputElement,e,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new f(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputChange(t){t.stopPropagation();const e=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),e&&this.radioGroup._emitChangeEvent())}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(v),i.Y36(i.SBq),i.Y36(i.sBO),i.Y36(l.tE),i.Y36(c.A8),i.Y36(String),i.Y36(void 0),i.Y36(String))},t.\u0275dir=i.lG2({type:t,viewQuery:function(t,e){if(1&t&&i.Gf(d,5),2&t){let t;i.iGM(t=i.CRH())&&(e._inputElement=t.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[i.qOj]}),t})(),A=(()=>{class t extends y{constructor(t,e,n,i,a,o,s,r){super(t,e,n,i,a,o,s,r)}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(b,8),i.Y36(i.SBq),i.Y36(i.sBO),i.Y36(l.tE),i.Y36(c.A8),i.Y36(r.Qb,8),i.Y36(g,8),i.$8M("tabindex"))},t.\u0275cmp=i.Xpm({type:t,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,e){1&t&&i.NdJ("focus",function(){return e._inputElement.nativeElement.focus()}),2&t&&(i.uIk("tabindex",null)("id",e.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),i.ekj("mat-radio-checked",e.checked)("mat-radio-disabled",e.disabled)("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-primary","primary"===e.color)("mat-accent","accent"===e.color)("mat-warn","warn"===e.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[i.qOj],ngContentSelectors:p,decls:13,vars:19,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,e){if(1&t&&(i.F$t(),i.TgZ(0,"label",0,1),i.TgZ(2,"span",2),i._UZ(3,"span",3),i._UZ(4,"span",4),i.TgZ(5,"input",5,6),i.NdJ("change",function(t){return e._onInputChange(t)})("click",function(t){return e._onInputClick(t)}),i.qZA(),i.TgZ(7,"span",7),i._UZ(8,"span",8),i.qZA(),i.qZA(),i.TgZ(9,"span",9),i.TgZ(10,"span",10),i._uU(11,"\xa0"),i.qZA(),i.Hsn(12),i.qZA(),i.qZA()),2&t){const t=i.MAs(1);i.uIk("for",e.inputId),i.xp6(5),i.Q6J("id",e.inputId)("checked",e.checked)("disabled",e.disabled)("tabIndex",e.tabIndex)("required",e.required),i.uIk("name",e.name)("value",e.value)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledby)("aria-describedby",e.ariaDescribedby),i.xp6(2),i.Q6J("matRippleTrigger",t)("matRippleDisabled",e._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",i.DdM(18,u)),i.xp6(2),i.ekj("mat-radio-label-before","before"==e.labelPosition)}},directives:[a.wG],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:transform ease 280ms,background-color ease 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5)}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),t})(),w=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i.oAB({type:t}),t.\u0275inj=i.cJS({imports:[[a.si,a.BQ],a.BQ]}),t})()},79572:function(t,e,n){"use strict";n.d(e,{Rr:function(){return x},rP:function(){return A}});var i=n(27853),a=n(35366),o=n(87064),s=n(19861),r=n(31041),l=n(26136),c=n(97388);const d=["thumbContainer"],u=["toggleBar"],p=["input"],g=function(){return{enterDuration:150}},h=["*"],m=new a.OlP("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let f=0;const b={provide:r.JU,useExisting:(0,a.Gpc)(()=>x),multi:!0};class v{constructor(t,e){this.source=t,this.checked=e}}class _{constructor(t){this._elementRef=t}}const Z=(0,o.sb)((0,o.pj)((0,o.Kr)((0,o.Id)(_)),"accent"));let x=(()=>{class t extends Z{constructor(t,e,n,i,o,s){super(t),this._focusMonitor=e,this._changeDetectorRef=n,this.defaults=o,this._animationMode=s,this._onChange=t=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++f,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new a.vpe,this.toggleChange=new a.vpe,this.tabIndex=parseInt(i)||0}get required(){return this._required}set required(t){this._required=(0,s.Ig)(t)}get checked(){return this._checked}set checked(t){this._checked=(0,s.Ig)(t),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t,e){e?this._focusMonitor.focusVia(this._inputElement,e,t):this._inputElement.nativeElement.focus(t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new v(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(a.SBq),a.Y36(c.tE),a.Y36(a.sBO),a.$8M("tabindex"),a.Y36(m),a.Y36(l.Qb,8))},t.\u0275cmp=a.Xpm({type:t,selectors:[["mat-slide-toggle"]],viewQuery:function(t,e){if(1&t&&(a.Gf(d,5),a.Gf(u,5),a.Gf(p,5)),2&t){let t;a.iGM(t=a.CRH())&&(e._thumbEl=t.first),a.iGM(t=a.CRH())&&(e._thumbBarEl=t.first),a.iGM(t=a.CRH())&&(e._inputElement=t.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,e){2&t&&(a.Ikx("id",e.id),a.uIk("tabindex",e.disabled?null:-1)("aria-label",null)("aria-labelledby",null),a.ekj("mat-checked",e.checked)("mat-disabled",e.disabled)("mat-slide-toggle-label-before","before"==e.labelPosition)("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked"},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[a._Bn([b]),a.qOj],ngContentSelectors:h,decls:16,vars:18,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,e){if(1&t&&(a.F$t(),a.TgZ(0,"label",0,1),a.TgZ(2,"div",2,3),a.TgZ(4,"input",4,5),a.NdJ("change",function(t){return e._onChangeEvent(t)})("click",function(t){return e._onInputClick(t)}),a.qZA(),a.TgZ(6,"div",6,7),a._UZ(8,"div",8),a.TgZ(9,"div",9),a._UZ(10,"div",10),a.qZA(),a.qZA(),a.qZA(),a.TgZ(11,"span",11,12),a.NdJ("cdkObserveContent",function(){return e._onLabelTextChange()}),a.TgZ(13,"span",13),a._uU(14,"\xa0"),a.qZA(),a.Hsn(15),a.qZA(),a.qZA()),2&t){const t=a.MAs(1),n=a.MAs(12);a.uIk("for",e.inputId),a.xp6(2),a.ekj("mat-slide-toggle-bar-no-side-margin",!n.textContent||!n.textContent.trim()),a.xp6(2),a.Q6J("id",e.inputId)("required",e.required)("tabIndex",e.tabIndex)("checked",e.checked)("disabled",e.disabled),a.uIk("name",e.name)("aria-checked",e.checked.toString())("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledby),a.xp6(5),a.Q6J("matRippleTrigger",t)("matRippleDisabled",e.disableRipple||e.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",a.DdM(17,g))}},directives:[o.wG,i.wD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),t})(),y=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=a.oAB({type:t}),t.\u0275inj=a.cJS({}),t})(),A=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=a.oAB({type:t}),t.\u0275inj=a.cJS({imports:[[y,o.si,o.BQ,i.Q8],y,o.BQ]}),t})()},88636:function(t,e,n){var i,a,o;void 0===(o=this)&&void 0!==window&&(o=window),i=[n(45059)],void 0===(a=(function(t){return o["Chartist.plugins.tooltip"]=(e=t,function(t,e,n){"use strict";var i={currency:void 0,currencyFormatCallback:void 0,tooltipOffset:{x:0,y:-20},anchorToPoint:!1,appendToBody:!0,class:void 0,pointClass:"ct-point"};function a(t,e){return(" "+t.getAttribute("class")+" ").indexOf(" "+e+" ")>-1}function o(n){var i;return o in n?((i=n.offsetParent)||(i=e.body.parentElement),i):(i=n.parentNode)?"static"!==t.getComputedStyle(i).position?i:"BODY"===i.tagName?i.parentElement:o(i):e.body.parentElement}n.plugins=n.plugins||{},n.plugins.tooltip=function(s){return s=n.extend({},i,s),function(i){var r=s.pointClass;i instanceof n.Bar?r="ct-bar":i instanceof n.Pie&&(r=i.options.donut?i.options.donutSolid?"ct-slice-donut-solid":"ct-slice-donut":"ct-slice-pie");var l,c=i.container,d=!1,u=o(c);(l=s.appendToBody?e.querySelector(".chartist-tooltip"):c.querySelector(".chartist-tooltip"))||((l=e.createElement("div")).className=s.class?"chartist-tooltip "+s.class:"chartist-tooltip",s.appendToBody?e.body.appendChild(l):c.appendChild(l));var p=l.offsetHeight,g=l.offsetWidth;function h(t,e,n){c.addEventListener(t,function(t){e&&!a(t.target,e)||n(t)})}function m(e){var n=-(g=g||l.offsetWidth)/2+s.tooltipOffset.x,i=-(p=p||l.offsetHeight)+s.tooltipOffset.y,a=!0===s.anchorToPoint&&e.target.x2&&e.target.y2;if(!0===s.appendToBody)if(a){var o=c.getBoundingClientRect(),r=e.target.y2.baseVal.value+o.top+t.pageYOffset;l.style.left=e.target.x2.baseVal.value+o.left+t.pageXOffset+n+"px",l.style.top=r+i+"px"}else l.style.left=e.pageX+n+"px",l.style.top=e.pageY+i+"px";else{var d=u.getBoundingClientRect(),h=-d.left-t.pageXOffset+n,m=-d.top-t.pageYOffset+i;a?(o=c.getBoundingClientRect(),r=e.target.y2.baseVal.value+o.top+t.pageYOffset,l.style.left=e.target.x2.baseVal.value+o.left+t.pageXOffset+h+"px",l.style.top=r+m+"px"):(l.style.left=e.pageX+h+"px",l.style.top=e.pageY+m+"px")}}function f(t){d=!1;var e=new RegExp("tooltip-show\\s*","gi");t.className=t.className.replace(e,"").trim()}f(l),h("mouseover",r,function(t){var r,h=t.target,f="",b=(i instanceof n.Pie?h:h.parentNode)?h.parentNode.getAttribute("ct:meta")||h.parentNode.getAttribute("ct:series-name"):"",v=h.getAttribute("ct:meta")||b||"",_=!!v,Z=h.getAttribute("ct:value");if(s.transformTooltipTextFnc&&"function"==typeof s.transformTooltipTextFnc&&(Z=s.transformTooltipTextFnc(Z)),s.tooltipFnc&&"function"==typeof s.tooltipFnc)f=s.tooltipFnc(v,Z);else{if(s.metaIsHTML){var x=e.createElement("textarea");x.innerHTML=v,v=x.value}if(v='<span class="chartist-tooltip-meta">'+v+"</span>",_)f+=v+"<br>";else if(i instanceof n.Pie){var y=function(t,e){do{t=t.nextSibling}while(t&&!a(t,"ct-label"));return t}(h);y&&(f+=((r=y).innerText||r.textContent)+"<br>")}Z&&(s.currency&&(Z=null!=s.currencyFormatCallback?s.currencyFormatCallback(Z,s):s.currency+Z.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g,"$1,")),f+=Z='<span class="chartist-tooltip-value">'+Z+"</span>")}f&&(l.innerHTML=f,p=l.offsetHeight,g=l.offsetWidth,!0!==s.appendToBody&&(u=o(c)),"absolute"!==l.style.display&&(l.style.display="absolute"),m(t),function(t){d=!0,a(t,"tooltip-show")||(t.className=t.className+" tooltip-show")}(l),p=l.offsetHeight,g=l.offsetWidth)}),h("mouseout",r,function(){f(l)}),h("mousemove",null,function(t){!1===s.anchorToPoint&&d&&m(t)})}}}(window,document,e),e.plugins.tooltip);var e}).apply(e,i))||(t.exports=a)},45059:function(t,e){var n,i;i=this,void 0===(n=(function(){return i.Chartist=function(){var t={version:"0.11.4"};return function(t,e){"use strict";var n=t.window,i=t.document;e.namespaces={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},e.noop=function(t){return t},e.alphaNumerate=function(t){return String.fromCharCode(97+t%26)},e.extend=function(t){var n,i,a;for(t=t||{},n=1;n<arguments.length;n++)for(var o in i=arguments[n])t[o]="object"!=typeof(a=i[o])||null===a||a instanceof Array?a:e.extend(t[o],a);return t},e.replaceAll=function(t,e,n){return t.replace(new RegExp(e,"g"),n)},e.ensureUnit=function(t,e){return"number"==typeof t&&(t+=e),t},e.quantity=function(t){if("string"==typeof t){var e=/^(\d+)\s*(.*)$/g.exec(t);return{value:+e[1],unit:e[2]||void 0}}return{value:t}},e.querySelector=function(t){return t instanceof Node?t:i.querySelector(t)},e.times=function(t){return Array.apply(null,new Array(t))},e.sum=function(t,e){return t+(e||0)},e.mapMultiply=function(t){return function(e){return e*t}},e.mapAdd=function(t){return function(e){return e+t}},e.serialMap=function(t,n){var i=[],a=Math.max.apply(null,t.map(function(t){return t.length}));return e.times(a).forEach(function(e,a){var o=t.map(function(t){return t[a]});i[a]=n.apply(null,o)}),i},e.roundWithPrecision=function(t,n){var i=Math.pow(10,n||e.precision);return Math.round(t*i)/i},e.precision=8,e.escapingMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"},e.serialize=function(t){return null==t?t:("number"==typeof t?t=""+t:"object"==typeof t&&(t=JSON.stringify({data:t})),Object.keys(e.escapingMap).reduce(function(t,n){return e.replaceAll(t,n,e.escapingMap[n])},t))},e.deserialize=function(t){if("string"!=typeof t)return t;t=Object.keys(e.escapingMap).reduce(function(t,n){return e.replaceAll(t,e.escapingMap[n],n)},t);try{t=void 0!==(t=JSON.parse(t)).data?t.data:t}catch(n){}return t},e.createSvg=function(t,n,i,a){var o;return n=n||"100%",i=i||"100%",Array.prototype.slice.call(t.querySelectorAll("svg")).filter(function(t){return t.getAttributeNS(e.namespaces.xmlns,"ct")}).forEach(function(e){t.removeChild(e)}),(o=new e.Svg("svg").attr({width:n,height:i}).addClass(a))._node.style.width=n,o._node.style.height=i,t.appendChild(o._node),o},e.normalizeData=function(t,n,i){var a,o={raw:t,normalized:{}};return o.normalized.series=e.getDataArray({series:t.series||[]},n,i),a=o.normalized.series.every(function(t){return t instanceof Array})?Math.max.apply(null,o.normalized.series.map(function(t){return t.length})):o.normalized.series.length,o.normalized.labels=(t.labels||[]).slice(),Array.prototype.push.apply(o.normalized.labels,e.times(Math.max(0,a-o.normalized.labels.length)).map(function(){return""})),n&&e.reverseData(o.normalized),o},e.safeHasProperty=function(t,e){return null!==t&&"object"==typeof t&&t.hasOwnProperty(e)},e.isDataHoleValue=function(t){return null==t||"number"==typeof t&&isNaN(t)},e.reverseData=function(t){t.labels.reverse(),t.series.reverse();for(var e=0;e<t.series.length;e++)"object"==typeof t.series[e]&&void 0!==t.series[e].data?t.series[e].data.reverse():t.series[e]instanceof Array&&t.series[e].reverse()},e.getDataArray=function(t,n,i){return t.series.map(function t(n){if(e.safeHasProperty(n,"value"))return t(n.value);if(e.safeHasProperty(n,"data"))return t(n.data);if(n instanceof Array)return n.map(t);if(!e.isDataHoleValue(n)){if(i){var a={};return"string"==typeof i?a[i]=e.getNumberOrUndefined(n):a.y=e.getNumberOrUndefined(n),a.x=n.hasOwnProperty("x")?e.getNumberOrUndefined(n.x):a.x,a.y=n.hasOwnProperty("y")?e.getNumberOrUndefined(n.y):a.y,a}return e.getNumberOrUndefined(n)}})},e.normalizePadding=function(t,e){return e=e||0,"number"==typeof t?{top:t,right:t,bottom:t,left:t}:{top:"number"==typeof t.top?t.top:e,right:"number"==typeof t.right?t.right:e,bottom:"number"==typeof t.bottom?t.bottom:e,left:"number"==typeof t.left?t.left:e}},e.getMetaData=function(t,e){var n=t.data?t.data[e]:t[e];return n?n.meta:void 0},e.orderOfMagnitude=function(t){return Math.floor(Math.log(Math.abs(t))/Math.LN10)},e.projectLength=function(t,e,n){return e/n.range*t},e.getAvailableHeight=function(t,n){return Math.max((e.quantity(n.height).value||t.height())-(n.chartPadding.top+n.chartPadding.bottom)-n.axisX.offset,0)},e.getHighLow=function(t,n,i){var a={high:void 0===(n=e.extend({},n,i?n["axis"+i.toUpperCase()]:{})).high?-Number.MAX_VALUE:+n.high,low:void 0===n.low?Number.MAX_VALUE:+n.low},o=void 0===n.high,s=void 0===n.low;return(o||s)&&function t(e){if(void 0!==e)if(e instanceof Array)for(var n=0;n<e.length;n++)t(e[n]);else{var r=i?+e[i]:+e;o&&r>a.high&&(a.high=r),s&&r<a.low&&(a.low=r)}}(t),(n.referenceValue||0===n.referenceValue)&&(a.high=Math.max(n.referenceValue,a.high),a.low=Math.min(n.referenceValue,a.low)),a.high<=a.low&&(0===a.low?a.high=1:a.low<0?a.high=0:(a.high>0||(a.high=1),a.low=0)),a},e.isNumeric=function(t){return null!==t&&isFinite(t)},e.isFalseyButZero=function(t){return!t&&0!==t},e.getNumberOrUndefined=function(t){return e.isNumeric(t)?+t:void 0},e.isMultiValue=function(t){return"object"==typeof t&&("x"in t||"y"in t)},e.getMultiValue=function(t,n){return e.isMultiValue(t)?e.getNumberOrUndefined(t[n||"y"]):e.getNumberOrUndefined(t)},e.rho=function(t){if(1===t)return t;function e(t,n){return t%n==0?n:e(n,t%n)}function n(t){return t*t+1}var i,a=2,o=2;if(t%2==0)return 2;do{a=n(a)%t,o=n(n(o))%t,i=e(Math.abs(a-o),t)}while(1===i);return i},e.getBounds=function(t,n,i,a){var o,s,r,l=0,c={high:n.high,low:n.low};c.valueRange=c.high-c.low,c.oom=e.orderOfMagnitude(c.valueRange),c.step=Math.pow(10,c.oom),c.min=Math.floor(c.low/c.step)*c.step,c.max=Math.ceil(c.high/c.step)*c.step,c.range=c.max-c.min,c.numberOfSteps=Math.round(c.range/c.step);var d=e.projectLength(t,c.step,c)<i,u=a?e.rho(c.range):0;if(a&&e.projectLength(t,1,c)>=i)c.step=1;else if(a&&u<c.step&&e.projectLength(t,u,c)>=i)c.step=u;else for(;;){if(d&&e.projectLength(t,c.step,c)<=i)c.step*=2;else{if(d||!(e.projectLength(t,c.step/2,c)>=i))break;if(c.step/=2,a&&c.step%1!=0){c.step*=2;break}}if(l++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}function p(t,e){return t===(t+=e)&&(t*=1+(e>0?2221e-19:-2221e-19)),t}for(c.step=Math.max(c.step,2221e-19),s=c.min,r=c.max;s+c.step<=c.low;)s=p(s,c.step);for(;r-c.step>=c.high;)r=p(r,-c.step);c.min=s,c.max=r,c.range=c.max-c.min;var g=[];for(o=c.min;o<=c.max;o=p(o,c.step)){var h=e.roundWithPrecision(o);h!==g[g.length-1]&&g.push(h)}return c.values=g,c},e.polarToCartesian=function(t,e,n,i){var a=(i-90)*Math.PI/180;return{x:t+n*Math.cos(a),y:e+n*Math.sin(a)}},e.createChartRect=function(t,n,i){var a=!(!n.axisX&&!n.axisY),o=a?n.axisY.offset:0,s=a?n.axisX.offset:0,r=t.width()||e.quantity(n.width).value||0,l=t.height()||e.quantity(n.height).value||0,c=e.normalizePadding(n.chartPadding,i);r=Math.max(r,o+c.left+c.right),l=Math.max(l,s+c.top+c.bottom);var d={padding:c,width:function(){return this.x2-this.x1},height:function(){return this.y1-this.y2}};return a?("start"===n.axisX.position?(d.y2=c.top+s,d.y1=Math.max(l-c.bottom,d.y2+1)):(d.y2=c.top,d.y1=Math.max(l-c.bottom-s,d.y2+1)),"start"===n.axisY.position?(d.x1=c.left+o,d.x2=Math.max(r-c.right,d.x1+1)):(d.x1=c.left,d.x2=Math.max(r-c.right-o,d.x1+1))):(d.x1=c.left,d.x2=Math.max(r-c.right,d.x1+1),d.y2=c.top,d.y1=Math.max(l-c.bottom,d.y2+1)),d},e.createGrid=function(t,n,i,a,o,s,r,l){var c={};c[i.units.pos+"1"]=t,c[i.units.pos+"2"]=t,c[i.counterUnits.pos+"1"]=a,c[i.counterUnits.pos+"2"]=a+o;var d=s.elem("line",c,r.join(" "));l.emit("draw",e.extend({type:"grid",axis:i,index:n,group:s,element:d},c))},e.createGridBackground=function(t,e,n,i){var a=t.elem("rect",{x:e.x1,y:e.y2,width:e.width(),height:e.height()},n,!0);i.emit("draw",{type:"gridBackground",group:t,element:a})},e.createLabel=function(t,n,a,o,s,r,l,c,d,u,p){var g,h={};if(h[s.units.pos]=t+l[s.units.pos],h[s.counterUnits.pos]=l[s.counterUnits.pos],h[s.units.len]=n,h[s.counterUnits.len]=Math.max(0,r-10),u){var m=i.createElement("span");m.className=d.join(" "),m.setAttribute("xmlns",e.namespaces.xhtml),m.innerText=o[a],m.style[s.units.len]=Math.round(h[s.units.len])+"px",m.style[s.counterUnits.len]=Math.round(h[s.counterUnits.len])+"px",g=c.foreignObject(m,e.extend({style:"overflow: visible;"},h))}else g=c.elem("text",h,d.join(" ")).text(o[a]);p.emit("draw",e.extend({type:"label",axis:s,index:a,group:c,element:g,text:o[a]},h))},e.getSeriesOption=function(t,e,n){if(t.name&&e.series&&e.series[t.name]){var i=e.series[t.name];return i.hasOwnProperty(n)?i[n]:e[n]}return e[n]},e.optionsProvider=function(t,i,a){var o,s,r=e.extend({},t),l=[];function c(t){var l=o;if(o=e.extend({},r),i)for(s=0;s<i.length;s++)n.matchMedia(i[s][0]).matches&&(o=e.extend(o,i[s][1]));a&&t&&a.emit("optionsChanged",{previousOptions:l,currentOptions:o})}if(!n.matchMedia)throw"window.matchMedia not found! Make sure you're using a polyfill.";if(i)for(s=0;s<i.length;s++){var d=n.matchMedia(i[s][0]);d.addListener(c),l.push(d)}return c(),{removeMediaQueryListeners:function(){l.forEach(function(t){t.removeListener(c)})},getCurrentOptions:function(){return e.extend({},o)}}},e.splitIntoSegments=function(t,n,i){i=e.extend({},{increasingX:!1,fillHoles:!1},i);for(var a=[],o=!0,s=0;s<t.length;s+=2)void 0===e.getMultiValue(n[s/2].value)?i.fillHoles||(o=!0):(i.increasingX&&s>=2&&t[s]<=t[s-2]&&(o=!0),o&&(a.push({pathCoordinates:[],valueData:[]}),o=!1),a[a.length-1].pathCoordinates.push(t[s],t[s+1]),a[a.length-1].valueData.push(n[s/2]));return a}}(this||global,t),function(t,e){"use strict";e.Interpolation={},e.Interpolation.none=function(t){return t=e.extend({},{fillHoles:!1},t),function(n,i){for(var a=new e.Svg.Path,o=!0,s=0;s<n.length;s+=2){var r=n[s],l=n[s+1],c=i[s/2];void 0!==e.getMultiValue(c.value)?(o?a.move(r,l,!1,c):a.line(r,l,!1,c),o=!1):t.fillHoles||(o=!0)}return a}},e.Interpolation.simple=function(t){t=e.extend({},{divisor:2,fillHoles:!1},t);var n=1/Math.max(1,t.divisor);return function(i,a){for(var o,s,r,l=new e.Svg.Path,c=0;c<i.length;c+=2){var d=i[c],u=i[c+1],p=(d-o)*n,g=a[c/2];void 0!==g.value?(void 0===r?l.move(d,u,!1,g):l.curve(o+p,s,d-p,u,d,u,!1,g),o=d,s=u,r=g):t.fillHoles||(o=d=r=void 0)}return l}},e.Interpolation.cardinal=function(t){t=e.extend({},{tension:1,fillHoles:!1},t);var n=Math.min(1,Math.max(0,t.tension)),i=1-n;return function a(o,s){var r=e.splitIntoSegments(o,s,{fillHoles:t.fillHoles});if(r.length){if(r.length>1){var l=[];return r.forEach(function(t){l.push(a(t.pathCoordinates,t.valueData))}),e.Svg.Path.join(l)}if(s=r[0].valueData,(o=r[0].pathCoordinates).length<=4)return e.Interpolation.none()(o,s);for(var c=(new e.Svg.Path).move(o[0],o[1],!1,s[0]),d=0,u=o.length;u-2>d;d+=2){var p=[{x:+o[d-2],y:+o[d-1]},{x:+o[d],y:+o[d+1]},{x:+o[d+2],y:+o[d+3]},{x:+o[d+4],y:+o[d+5]}];u-4===d?p[3]=p[2]:d||(p[0]={x:+o[d],y:+o[d+1]}),c.curve(n*(6*p[1].x-p[0].x+p[2].x)/6+i*p[2].x,n*(6*p[1].y-p[0].y+p[2].y)/6+i*p[2].y,n*(p[1].x+6*p[2].x-p[3].x)/6+i*p[2].x,n*(p[1].y+6*p[2].y-p[3].y)/6+i*p[2].y,p[2].x,p[2].y,!1,s[(d+2)/2])}return c}return e.Interpolation.none()([])}},e.Interpolation.monotoneCubic=function(t){return t=e.extend({},{fillHoles:!1},t),function n(i,a){var o=e.splitIntoSegments(i,a,{fillHoles:t.fillHoles,increasingX:!0});if(o.length){if(o.length>1){var s=[];return o.forEach(function(t){s.push(n(t.pathCoordinates,t.valueData))}),e.Svg.Path.join(s)}if(a=o[0].valueData,(i=o[0].pathCoordinates).length<=4)return e.Interpolation.none()(i,a);var r,l,c=[],d=[],u=i.length/2,p=[],g=[],h=[],m=[];for(r=0;r<u;r++)c[r]=i[2*r],d[r]=i[2*r+1];for(r=0;r<u-1;r++)h[r]=d[r+1]-d[r],m[r]=c[r+1]-c[r],g[r]=h[r]/m[r];for(p[0]=g[0],p[u-1]=g[u-2],r=1;r<u-1;r++)0===g[r]||0===g[r-1]||g[r-1]>0!=g[r]>0?p[r]=0:(p[r]=3*(m[r-1]+m[r])/((2*m[r]+m[r-1])/g[r-1]+(m[r]+2*m[r-1])/g[r]),isFinite(p[r])||(p[r]=0));for(l=(new e.Svg.Path).move(c[0],d[0],!1,a[0]),r=0;r<u-1;r++)l.curve(c[r]+m[r]/3,d[r]+p[r]*m[r]/3,c[r+1]-m[r]/3,d[r+1]-p[r+1]*m[r]/3,c[r+1],d[r+1],!1,a[r+1]);return l}return e.Interpolation.none()([])}},e.Interpolation.step=function(t){return t=e.extend({},{postpone:!0,fillHoles:!1},t),function(n,i){for(var a,o,s,r=new e.Svg.Path,l=0;l<n.length;l+=2){var c=n[l],d=n[l+1],u=i[l/2];void 0!==u.value?(void 0===s?r.move(c,d,!1,u):(t.postpone?r.line(c,o,!1,s):r.line(a,d,!1,u),r.line(c,d,!1,u)),a=c,o=d,s=u):t.fillHoles||(a=o=s=void 0)}return r}}}(this||global,t),function(t,e){"use strict";e.EventEmitter=function(){var t=[];return{addEventHandler:function(e,n){t[e]=t[e]||[],t[e].push(n)},removeEventHandler:function(e,n){t[e]&&(n?(t[e].splice(t[e].indexOf(n),1),0===t[e].length&&delete t[e]):delete t[e])},emit:function(e,n){t[e]&&t[e].forEach(function(t){t(n)}),t["*"]&&t["*"].forEach(function(t){t(e,n)})}}}}(this||global,t),function(t,e){"use strict";function n(t){var e=[];if(t.length)for(var n=0;n<t.length;n++)e.push(t[n]);return e}e.Class={extend:function(t,n){var i=n||this.prototype||e.Class,a=Object.create(i);e.Class.cloneDefinitions(a,t);var o=function(){var t,n=a.constructor||function(){};return t=this===e?Object.create(a):this,n.apply(t,Array.prototype.slice.call(arguments,0)),t};return o.prototype=a,o.super=i,o.extend=this.extend,o},cloneDefinitions:function(){var t=n(arguments),e=t[0];return t.splice(1,t.length-1).forEach(function(t){Object.getOwnPropertyNames(t).forEach(function(n){delete e[n],Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}),e}}}(this||global,t),function(t,e){"use strict";var n=t.window;function i(){n.addEventListener("resize",this.resizeListener),this.optionsProvider=e.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.addEventHandler("optionsChanged",(function(){this.update()}).bind(this)),this.options.plugins&&this.options.plugins.forEach((function(t){t instanceof Array?t[0](this,t[1]):t(this)}).bind(this)),this.eventEmitter.emit("data",{type:"initial",data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=void 0}e.Base=e.Class.extend({constructor:function(t,n,a,o,s){this.container=e.querySelector(t),this.data=n||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.defaultOptions=a,this.options=o,this.responsiveOptions=s,this.eventEmitter=e.EventEmitter(),this.supportsForeignObject=e.Svg.isSupported("Extensibility"),this.supportsAnimations=e.Svg.isSupported("AnimationEventsAttribute"),this.resizeListener=(function(){this.update()}).bind(this),this.container&&(this.container.__chartist__&&this.container.__chartist__.detach(),this.container.__chartist__=this),this.initializeTimeoutId=setTimeout(i.bind(this),0)},optionsProvider:void 0,container:void 0,svg:void 0,eventEmitter:void 0,createChart:function(){throw new Error("Base chart type can't be instantiated!")},update:function(t,n,i){return t&&(this.data=t||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.eventEmitter.emit("data",{type:"update",data:this.data})),n&&(this.options=e.extend({},i?this.options:this.defaultOptions,n),this.initializeTimeoutId||(this.optionsProvider.removeMediaQueryListeners(),this.optionsProvider=e.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter))),this.initializeTimeoutId||this.createChart(this.optionsProvider.getCurrentOptions()),this},detach:function(){return this.initializeTimeoutId?n.clearTimeout(this.initializeTimeoutId):(n.removeEventListener("resize",this.resizeListener),this.optionsProvider.removeMediaQueryListeners()),this},on:function(t,e){return this.eventEmitter.addEventHandler(t,e),this},off:function(t,e){return this.eventEmitter.removeEventHandler(t,e),this},version:e.version,supportsForeignObject:!1})}(this||global,t),function(t,e){"use strict";var n=t.document;e.Svg=e.Class.extend({constructor:function(t,i,a,o,s){t instanceof Element?this._node=t:(this._node=n.createElementNS(e.namespaces.svg,t),"svg"===t&&this.attr({"xmlns:ct":e.namespaces.ct})),i&&this.attr(i),a&&this.addClass(a),o&&(s&&o._node.firstChild?o._node.insertBefore(this._node,o._node.firstChild):o._node.appendChild(this._node))},attr:function(t,n){return"string"==typeof t?n?this._node.getAttributeNS(n,t):this._node.getAttribute(t):(Object.keys(t).forEach((function(n){if(void 0!==t[n])if(-1!==n.indexOf(":")){var i=n.split(":");this._node.setAttributeNS(e.namespaces[i[0]],n,t[n])}else this._node.setAttribute(n,t[n])}).bind(this)),this)},elem:function(t,n,i,a){return new e.Svg(t,n,i,this,a)},parent:function(){return this._node.parentNode instanceof SVGElement?new e.Svg(this._node.parentNode):null},root:function(){for(var t=this._node;"svg"!==t.nodeName;)t=t.parentNode;return new e.Svg(t)},querySelector:function(t){var n=this._node.querySelector(t);return n?new e.Svg(n):null},querySelectorAll:function(t){var n=this._node.querySelectorAll(t);return n.length?new e.Svg.List(n):null},getNode:function(){return this._node},foreignObject:function(t,i,a,o){if("string"==typeof t){var s=n.createElement("div");s.innerHTML=t,t=s.firstChild}t.setAttribute("xmlns",e.namespaces.xmlns);var r=this.elem("foreignObject",i,a,o);return r._node.appendChild(t),r},text:function(t){return this._node.appendChild(n.createTextNode(t)),this},empty:function(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this},remove:function(){return this._node.parentNode.removeChild(this._node),this.parent()},replace:function(t){return this._node.parentNode.replaceChild(t._node,this._node),t},append:function(t,e){return e&&this._node.firstChild?this._node.insertBefore(t._node,this._node.firstChild):this._node.appendChild(t._node),this},classes:function(){return this._node.getAttribute("class")?this._node.getAttribute("class").trim().split(/\s+/):[]},addClass:function(t){return this._node.setAttribute("class",this.classes(this._node).concat(t.trim().split(/\s+/)).filter(function(t,e,n){return n.indexOf(t)===e}).join(" ")),this},removeClass:function(t){var e=t.trim().split(/\s+/);return this._node.setAttribute("class",this.classes(this._node).filter(function(t){return-1===e.indexOf(t)}).join(" ")),this},removeAllClasses:function(){return this._node.setAttribute("class",""),this},height:function(){return this._node.getBoundingClientRect().height},width:function(){return this._node.getBoundingClientRect().width},animate:function(t,n,i){return void 0===n&&(n=!0),Object.keys(t).forEach((function(a){function o(t,n){var o,s,r,l={};t.easing&&(r=t.easing instanceof Array?t.easing:e.Svg.Easing[t.easing],delete t.easing),t.begin=e.ensureUnit(t.begin,"ms"),t.dur=e.ensureUnit(t.dur,"ms"),r&&(t.calcMode="spline",t.keySplines=r.join(" "),t.keyTimes="0;1"),n&&(t.fill="freeze",l[a]=t.from,this.attr(l),s=e.quantity(t.begin||0).value,t.begin="indefinite"),o=this.elem("animate",e.extend({attributeName:a},t)),n&&setTimeout((function(){try{o._node.beginElement()}catch(e){l[a]=t.to,this.attr(l),o.remove()}}).bind(this),s),i&&o._node.addEventListener("beginEvent",(function(){i.emit("animationBegin",{element:this,animate:o._node,params:t})}).bind(this)),o._node.addEventListener("endEvent",(function(){i&&i.emit("animationEnd",{element:this,animate:o._node,params:t}),n&&(l[a]=t.to,this.attr(l),o.remove())}).bind(this))}t[a]instanceof Array?t[a].forEach((function(t){o.bind(this)(t,!1)}).bind(this)):o.bind(this)(t[a],n)}).bind(this)),this}}),e.Svg.isSupported=function(t){return n.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#"+t,"1.1")},e.Svg.Easing={easeInSine:[.47,0,.745,.715],easeOutSine:[.39,.575,.565,1],easeInOutSine:[.445,.05,.55,.95],easeInQuad:[.55,.085,.68,.53],easeOutQuad:[.25,.46,.45,.94],easeInOutQuad:[.455,.03,.515,.955],easeInCubic:[.55,.055,.675,.19],easeOutCubic:[.215,.61,.355,1],easeInOutCubic:[.645,.045,.355,1],easeInQuart:[.895,.03,.685,.22],easeOutQuart:[.165,.84,.44,1],easeInOutQuart:[.77,0,.175,1],easeInQuint:[.755,.05,.855,.06],easeOutQuint:[.23,1,.32,1],easeInOutQuint:[.86,0,.07,1],easeInExpo:[.95,.05,.795,.035],easeOutExpo:[.19,1,.22,1],easeInOutExpo:[1,0,0,1],easeInCirc:[.6,.04,.98,.335],easeOutCirc:[.075,.82,.165,1],easeInOutCirc:[.785,.135,.15,.86],easeInBack:[.6,-.28,.735,.045],easeOutBack:[.175,.885,.32,1.275],easeInOutBack:[.68,-.55,.265,1.55]},e.Svg.List=e.Class.extend({constructor:function(t){var n=this;this.svgElements=[];for(var i=0;i<t.length;i++)this.svgElements.push(new e.Svg(t[i]));Object.keys(e.Svg.prototype).filter(function(t){return-1===["constructor","parent","querySelector","querySelectorAll","replace","append","classes","height","width"].indexOf(t)}).forEach(function(t){n[t]=function(){var i=Array.prototype.slice.call(arguments,0);return n.svgElements.forEach(function(n){e.Svg.prototype[t].apply(n,i)}),n}})}})}(this||global,t),function(t,e){"use strict";var n={m:["x","y"],l:["x","y"],c:["x1","y1","x2","y2","x","y"],a:["rx","ry","xAr","lAf","sf","x","y"]},i={accuracy:3};function a(t,n,i,a,o,s){var r=e.extend({command:o?t.toLowerCase():t.toUpperCase()},n,s?{data:s}:{});i.splice(a,0,r)}function o(t,e){t.forEach(function(i,a){n[i.command.toLowerCase()].forEach(function(n,o){e(i,n,a,o,t)})})}e.Svg.Path=e.Class.extend({constructor:function(t,n){this.pathElements=[],this.pos=0,this.close=t,this.options=e.extend({},i,n)},position:function(t){return void 0!==t?(this.pos=Math.max(0,Math.min(this.pathElements.length,t)),this):this.pos},remove:function(t){return this.pathElements.splice(this.pos,t),this},move:function(t,e,n,i){return a("M",{x:+t,y:+e},this.pathElements,this.pos++,n,i),this},line:function(t,e,n,i){return a("L",{x:+t,y:+e},this.pathElements,this.pos++,n,i),this},curve:function(t,e,n,i,o,s,r,l){return a("C",{x1:+t,y1:+e,x2:+n,y2:+i,x:+o,y:+s},this.pathElements,this.pos++,r,l),this},arc:function(t,e,n,i,o,s,r,l,c){return a("A",{rx:+t,ry:+e,xAr:+n,lAf:+i,sf:+o,x:+s,y:+r},this.pathElements,this.pos++,l,c),this},scale:function(t,e){return o(this.pathElements,function(n,i){n[i]*="x"===i[0]?t:e}),this},translate:function(t,e){return o(this.pathElements,function(n,i){n[i]+="x"===i[0]?t:e}),this},transform:function(t){return o(this.pathElements,function(e,n,i,a,o){var s=t(e,n,i,a,o);(s||0===s)&&(e[n]=s)}),this},parse:function(t){var i=t.replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").split(/[\s,]+/).reduce(function(t,e){return e.match(/[A-Za-z]/)&&t.push([]),t[t.length-1].push(e),t},[]);"Z"===i[i.length-1][0].toUpperCase()&&i.pop();var a=i.map(function(t){var i=t.shift(),a=n[i.toLowerCase()];return e.extend({command:i},a.reduce(function(e,n,i){return e[n]=+t[i],e},{}))}),o=[this.pos,0];return Array.prototype.push.apply(o,a),Array.prototype.splice.apply(this.pathElements,o),this.pos+=a.length,this},stringify:function(){var t=Math.pow(10,this.options.accuracy);return this.pathElements.reduce((function(e,i){var a=n[i.command.toLowerCase()].map((function(e){return this.options.accuracy?Math.round(i[e]*t)/t:i[e]}).bind(this));return e+i.command+a.join(",")}).bind(this),"")+(this.close?"Z":"")},clone:function(t){var n=new e.Svg.Path(t||this.close);return n.pos=this.pos,n.pathElements=this.pathElements.slice().map(function(t){return e.extend({},t)}),n.options=e.extend({},this.options),n},splitByCommand:function(t){var n=[new e.Svg.Path];return this.pathElements.forEach(function(i){i.command===t.toUpperCase()&&0!==n[n.length-1].pathElements.length&&n.push(new e.Svg.Path),n[n.length-1].pathElements.push(i)}),n}}),e.Svg.Path.elementDescriptions=n,e.Svg.Path.join=function(t,n,i){for(var a=new e.Svg.Path(n,i),o=0;o<t.length;o++)for(var s=t[o],r=0;r<s.pathElements.length;r++)a.pathElements.push(s.pathElements[r]);return a}}(this||global,t),function(t,e){"use strict";var n={x:{pos:"x",len:"width",dir:"horizontal",rectStart:"x1",rectEnd:"x2",rectOffset:"y2"},y:{pos:"y",len:"height",dir:"vertical",rectStart:"y2",rectEnd:"y1",rectOffset:"x1"}};e.Axis=e.Class.extend({constructor:function(t,e,i,a){this.units=t,this.counterUnits=t===n.x?n.y:n.x,this.chartRect=e,this.axisLength=e[t.rectEnd]-e[t.rectStart],this.gridOffset=e[t.rectOffset],this.ticks=i,this.options=a},createGridAndLabels:function(t,n,i,a,o){var s=a["axis"+this.units.pos.toUpperCase()],r=this.ticks.map(this.projectValue.bind(this)),l=this.ticks.map(s.labelInterpolationFnc);r.forEach((function(c,d){var u,p={x:0,y:0};u=r[d+1]?r[d+1]-c:Math.max(this.axisLength-c,30),e.isFalseyButZero(l[d])&&""!==l[d]||("x"===this.units.pos?(c=this.chartRect.x1+c,p.x=a.axisX.labelOffset.x,p.y="start"===a.axisX.position?this.chartRect.padding.top+a.axisX.labelOffset.y+(i?5:20):this.chartRect.y1+a.axisX.labelOffset.y+(i?5:20)):(c=this.chartRect.y1-c,p.y=a.axisY.labelOffset.y-(i?u:0),p.x="start"===a.axisY.position?i?this.chartRect.padding.left+a.axisY.labelOffset.x:this.chartRect.x1-10:this.chartRect.x2+a.axisY.labelOffset.x+10),s.showGrid&&e.createGrid(c,d,this,this.gridOffset,this.chartRect[this.counterUnits.len](),t,[a.classNames.grid,a.classNames[this.units.dir]],o),s.showLabel&&e.createLabel(c,u,d,l,this,s.offset,p,n,[a.classNames.label,a.classNames[this.units.dir],"start"===s.position?a.classNames[s.position]:a.classNames.end],i,o))}).bind(this))},projectValue:function(t,e,n){throw new Error("Base axis can't be instantiated!")}}),e.Axis.units=n}(this||global,t),function(t,e){"use strict";e.AutoScaleAxis=e.Axis.extend({constructor:function(t,n,i,a){var o=a.highLow||e.getHighLow(n,a,t.pos);this.bounds=e.getBounds(i[t.rectEnd]-i[t.rectStart],o,a.scaleMinSpace||20,a.onlyInteger),this.range={min:this.bounds.min,max:this.bounds.max},e.AutoScaleAxis.super.constructor.call(this,t,i,this.bounds.values,a)},projectValue:function(t){return this.axisLength*(+e.getMultiValue(t,this.units.pos)-this.bounds.min)/this.bounds.range}})}(this||global,t),function(t,e){"use strict";e.FixedScaleAxis=e.Axis.extend({constructor:function(t,n,i,a){var o=a.highLow||e.getHighLow(n,a,t.pos);this.divisor=a.divisor||1,this.ticks=a.ticks||e.times(this.divisor).map((function(t,e){return o.low+(o.high-o.low)/this.divisor*e}).bind(this)),this.ticks.sort(function(t,e){return t-e}),this.range={min:o.low,max:o.high},e.FixedScaleAxis.super.constructor.call(this,t,i,this.ticks,a),this.stepLength=this.axisLength/this.divisor},projectValue:function(t){return this.axisLength*(+e.getMultiValue(t,this.units.pos)-this.range.min)/(this.range.max-this.range.min)}})}(this||global,t),function(t,e){"use strict";e.StepAxis=e.Axis.extend({constructor:function(t,n,i,a){e.StepAxis.super.constructor.call(this,t,i,a.ticks,a);var o=Math.max(1,a.ticks.length-(a.stretch?1:0));this.stepLength=this.axisLength/o},projectValue:function(t,e){return this.stepLength*e}})}(this||global,t),function(t,e){"use strict";var n={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:e.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:e.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,showGridBackground:!1,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};e.Line=e.Base.extend({constructor:function(t,i,a,o){e.Line.super.constructor.call(this,t,i,n,e.extend({},n,a),o)},createChart:function(t){var i=e.normalizeData(this.data,t.reverseData,!0);this.svg=e.createSvg(this.container,t.width,t.height,t.classNames.chart);var a,o,s=this.svg.elem("g").addClass(t.classNames.gridGroup),r=this.svg.elem("g"),l=this.svg.elem("g").addClass(t.classNames.labelGroup),c=e.createChartRect(this.svg,t,n.padding);a=void 0===t.axisX.type?new e.StepAxis(e.Axis.units.x,i.normalized.series,c,e.extend({},t.axisX,{ticks:i.normalized.labels,stretch:t.fullWidth})):t.axisX.type.call(e,e.Axis.units.x,i.normalized.series,c,t.axisX),o=void 0===t.axisY.type?new e.AutoScaleAxis(e.Axis.units.y,i.normalized.series,c,e.extend({},t.axisY,{high:e.isNumeric(t.high)?t.high:t.axisY.high,low:e.isNumeric(t.low)?t.low:t.axisY.low})):t.axisY.type.call(e,e.Axis.units.y,i.normalized.series,c,t.axisY),a.createGridAndLabels(s,l,this.supportsForeignObject,t,this.eventEmitter),o.createGridAndLabels(s,l,this.supportsForeignObject,t,this.eventEmitter),t.showGridBackground&&e.createGridBackground(s,c,t.classNames.gridBackground,this.eventEmitter),i.raw.series.forEach((function(n,s){var l=r.elem("g");l.attr({"ct:series-name":n.name,"ct:meta":e.serialize(n.meta)}),l.addClass([t.classNames.series,n.className||t.classNames.series+"-"+e.alphaNumerate(s)].join(" "));var d=[],u=[];i.normalized.series[s].forEach((function(t,r){var l={x:c.x1+a.projectValue(t,r,i.normalized.series[s]),y:c.y1-o.projectValue(t,r,i.normalized.series[s])};d.push(l.x,l.y),u.push({value:t,valueIndex:r,meta:e.getMetaData(n,r)})}).bind(this));var p={lineSmooth:e.getSeriesOption(n,t,"lineSmooth"),showPoint:e.getSeriesOption(n,t,"showPoint"),showLine:e.getSeriesOption(n,t,"showLine"),showArea:e.getSeriesOption(n,t,"showArea"),areaBase:e.getSeriesOption(n,t,"areaBase")},g=("function"==typeof p.lineSmooth?p.lineSmooth:p.lineSmooth?e.Interpolation.monotoneCubic():e.Interpolation.none())(d,u);if(p.showPoint&&g.pathElements.forEach((function(i){var r=l.elem("line",{x1:i.x,y1:i.y,x2:i.x+.01,y2:i.y},t.classNames.point).attr({"ct:value":[i.data.value.x,i.data.value.y].filter(e.isNumeric).join(","),"ct:meta":e.serialize(i.data.meta)});this.eventEmitter.emit("draw",{type:"point",value:i.data.value,index:i.data.valueIndex,meta:i.data.meta,series:n,seriesIndex:s,axisX:a,axisY:o,group:l,element:r,x:i.x,y:i.y})}).bind(this)),p.showLine){var h=l.elem("path",{d:g.stringify()},t.classNames.line,!0);this.eventEmitter.emit("draw",{type:"line",values:i.normalized.series[s],path:g.clone(),chartRect:c,index:s,series:n,seriesIndex:s,seriesMeta:n.meta,axisX:a,axisY:o,group:l,element:h})}if(p.showArea&&o.range){var m=Math.max(Math.min(p.areaBase,o.range.max),o.range.min),f=c.y1-o.projectValue(m);g.splitByCommand("M").filter(function(t){return t.pathElements.length>1}).map(function(t){var e=t.pathElements[0],n=t.pathElements[t.pathElements.length-1];return t.clone(!0).position(0).remove(1).move(e.x,f).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,f)}).forEach((function(e){var r=l.elem("path",{d:e.stringify()},t.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:i.normalized.series[s],path:e.clone(),series:n,seriesIndex:s,axisX:a,axisY:o,chartRect:c,index:s,group:l,element:r})}).bind(this))}}).bind(this)),this.eventEmitter.emit("created",{bounds:o.bounds,chartRect:c,axisX:a,axisY:o,svg:this.svg,options:t})}})}(this||global,t),function(t,e){"use strict";var n={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:e.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:e.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,referenceValue:0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,showGridBackground:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};e.Bar=e.Base.extend({constructor:function(t,i,a,o){e.Bar.super.constructor.call(this,t,i,n,e.extend({},n,a),o)},createChart:function(t){var i,a;t.distributeSeries?(i=e.normalizeData(this.data,t.reverseData,t.horizontalBars?"x":"y")).normalized.series=i.normalized.series.map(function(t){return[t]}):i=e.normalizeData(this.data,t.reverseData,t.horizontalBars?"x":"y"),this.svg=e.createSvg(this.container,t.width,t.height,t.classNames.chart+(t.horizontalBars?" "+t.classNames.horizontalBars:""));var o=this.svg.elem("g").addClass(t.classNames.gridGroup),s=this.svg.elem("g"),r=this.svg.elem("g").addClass(t.classNames.labelGroup);if(t.stackBars&&0!==i.normalized.series.length){var l=e.serialMap(i.normalized.series,function(){return Array.prototype.slice.call(arguments).map(function(t){return t}).reduce(function(t,e){return{x:t.x+(e&&e.x)||0,y:t.y+(e&&e.y)||0}},{x:0,y:0})});a=e.getHighLow([l],t,t.horizontalBars?"x":"y")}else a=e.getHighLow(i.normalized.series,t,t.horizontalBars?"x":"y");a.high=+t.high||(0===t.high?0:a.high),a.low=+t.low||(0===t.low?0:a.low);var c,d,u,p,g,h=e.createChartRect(this.svg,t,n.padding);d=t.distributeSeries&&t.stackBars?i.normalized.labels.slice(0,1):i.normalized.labels,t.horizontalBars?(c=p=void 0===t.axisX.type?new e.AutoScaleAxis(e.Axis.units.x,i.normalized.series,h,e.extend({},t.axisX,{highLow:a,referenceValue:0})):t.axisX.type.call(e,e.Axis.units.x,i.normalized.series,h,e.extend({},t.axisX,{highLow:a,referenceValue:0})),u=g=void 0===t.axisY.type?new e.StepAxis(e.Axis.units.y,i.normalized.series,h,{ticks:d}):t.axisY.type.call(e,e.Axis.units.y,i.normalized.series,h,t.axisY)):(u=p=void 0===t.axisX.type?new e.StepAxis(e.Axis.units.x,i.normalized.series,h,{ticks:d}):t.axisX.type.call(e,e.Axis.units.x,i.normalized.series,h,t.axisX),c=g=void 0===t.axisY.type?new e.AutoScaleAxis(e.Axis.units.y,i.normalized.series,h,e.extend({},t.axisY,{highLow:a,referenceValue:0})):t.axisY.type.call(e,e.Axis.units.y,i.normalized.series,h,e.extend({},t.axisY,{highLow:a,referenceValue:0})));var m=t.horizontalBars?h.x1+c.projectValue(0):h.y1-c.projectValue(0),f=[];u.createGridAndLabels(o,r,this.supportsForeignObject,t,this.eventEmitter),c.createGridAndLabels(o,r,this.supportsForeignObject,t,this.eventEmitter),t.showGridBackground&&e.createGridBackground(o,h,t.classNames.gridBackground,this.eventEmitter),i.raw.series.forEach((function(n,a){var o,r,l=a-(i.raw.series.length-1)/2;o=t.distributeSeries&&!t.stackBars?u.axisLength/i.normalized.series.length/2:t.distributeSeries&&t.stackBars?u.axisLength/2:u.axisLength/i.normalized.series[a].length/2,(r=s.elem("g")).attr({"ct:series-name":n.name,"ct:meta":e.serialize(n.meta)}),r.addClass([t.classNames.series,n.className||t.classNames.series+"-"+e.alphaNumerate(a)].join(" ")),i.normalized.series[a].forEach((function(s,d){var b,v,_,Z;if(Z=t.distributeSeries&&!t.stackBars?a:t.distributeSeries&&t.stackBars?0:d,b=t.horizontalBars?{x:h.x1+c.projectValue(s&&s.x?s.x:0,d,i.normalized.series[a]),y:h.y1-u.projectValue(s&&s.y?s.y:0,Z,i.normalized.series[a])}:{x:h.x1+u.projectValue(s&&s.x?s.x:0,Z,i.normalized.series[a]),y:h.y1-c.projectValue(s&&s.y?s.y:0,d,i.normalized.series[a])},u instanceof e.StepAxis&&(u.options.stretch||(b[u.units.pos]+=o*(t.horizontalBars?-1:1)),b[u.units.pos]+=t.stackBars||t.distributeSeries?0:l*t.seriesBarDistance*(t.horizontalBars?-1:1)),f[d]=(_=f[d]||m)-(m-b[u.counterUnits.pos]),void 0!==s){var x={};x[u.units.pos+"1"]=b[u.units.pos],x[u.units.pos+"2"]=b[u.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(x[u.counterUnits.pos+"1"]=m,x[u.counterUnits.pos+"2"]=b[u.counterUnits.pos]):(x[u.counterUnits.pos+"1"]=_,x[u.counterUnits.pos+"2"]=f[d]),x.x1=Math.min(Math.max(x.x1,h.x1),h.x2),x.x2=Math.min(Math.max(x.x2,h.x1),h.x2),x.y1=Math.min(Math.max(x.y1,h.y2),h.y1),x.y2=Math.min(Math.max(x.y2,h.y2),h.y1);var y=e.getMetaData(n,d);v=r.elem("line",x,t.classNames.bar).attr({"ct:value":[s.x,s.y].filter(e.isNumeric).join(","),"ct:meta":e.serialize(y)}),this.eventEmitter.emit("draw",e.extend({type:"bar",value:s,index:d,meta:y,series:n,seriesIndex:a,axisX:p,axisY:g,chartRect:h,group:r,element:v},x))}}).bind(this))}).bind(this)),this.eventEmitter.emit("created",{bounds:c.bounds,chartRect:h,axisX:p,axisY:g,svg:this.svg,options:t})}})}(this||global,t),function(t,e){"use strict";var n={width:void 0,height:void 0,chartPadding:5,classNames:{chartPie:"ct-chart-pie",chartDonut:"ct-chart-donut",series:"ct-series",slicePie:"ct-slice-pie",sliceDonut:"ct-slice-donut",sliceDonutSolid:"ct-slice-donut-solid",label:"ct-label"},startAngle:0,total:void 0,donut:!1,donutSolid:!1,donutWidth:60,showLabel:!0,labelOffset:0,labelPosition:"inside",labelInterpolationFnc:e.noop,labelDirection:"neutral",reverseData:!1,ignoreEmptyValues:!1};function i(t,e,n){var i=e.x>t.x;return i&&"explode"===n||!i&&"implode"===n?"start":i&&"implode"===n||!i&&"explode"===n?"end":"middle"}e.Pie=e.Base.extend({constructor:function(t,i,a,o){e.Pie.super.constructor.call(this,t,i,n,e.extend({},n,a),o)},createChart:function(t){var a,o,s,r,l,c=e.normalizeData(this.data),d=[],u=t.startAngle;this.svg=e.createSvg(this.container,t.width,t.height,t.donut?t.classNames.chartDonut:t.classNames.chartPie),o=e.createChartRect(this.svg,t,n.padding),s=Math.min(o.width()/2,o.height()/2),l=t.total||c.normalized.series.reduce(function(t,e){return t+e},0);var p=e.quantity(t.donutWidth);"%"===p.unit&&(p.value*=s/100),s-=t.donut&&!t.donutSolid?p.value/2:0,r="outside"===t.labelPosition||t.donut&&!t.donutSolid?s:"center"===t.labelPosition?0:t.donutSolid?s-p.value/2:s/2,r+=t.labelOffset;var g={x:o.x1+o.width()/2,y:o.y2+o.height()/2},h=1===c.raw.series.filter(function(t){return t.hasOwnProperty("value")?0!==t.value:0!==t}).length;c.raw.series.forEach((function(t,e){d[e]=this.svg.elem("g",null,null)}).bind(this)),t.showLabel&&(a=this.svg.elem("g",null,null)),c.raw.series.forEach((function(n,o){if(0!==c.normalized.series[o]||!t.ignoreEmptyValues){d[o].attr({"ct:series-name":n.name}),d[o].addClass([t.classNames.series,n.className||t.classNames.series+"-"+e.alphaNumerate(o)].join(" "));var m=l>0?u+c.normalized.series[o]/l*360:0,f=Math.max(0,u-(0===o||h?0:.2));m-f>=359.99&&(m=f+359.99);var b,v,_,Z=e.polarToCartesian(g.x,g.y,s,f),x=e.polarToCartesian(g.x,g.y,s,m),y=new e.Svg.Path(!t.donut||t.donutSolid).move(x.x,x.y).arc(s,s,0,m-u>180,0,Z.x,Z.y);t.donut?t.donutSolid&&(b=e.polarToCartesian(g.x,g.y,_=s-p.value,u-(0===o||h?0:.2)),v=e.polarToCartesian(g.x,g.y,_,m),y.line(b.x,b.y),y.arc(_,_,0,m-u>180,1,v.x,v.y)):y.line(g.x,g.y);var A=t.classNames.slicePie;t.donut&&(A=t.classNames.sliceDonut,t.donutSolid&&(A=t.classNames.sliceDonutSolid));var w=d[o].elem("path",{d:y.stringify()},A);if(w.attr({"ct:value":c.normalized.series[o],"ct:meta":e.serialize(n.meta)}),t.donut&&!t.donutSolid&&(w._node.style.strokeWidth=p.value+"px"),this.eventEmitter.emit("draw",{type:"slice",value:c.normalized.series[o],totalDataSum:l,index:o,meta:n.meta,series:n,group:d[o],element:w,path:y.clone(),center:g,radius:s,startAngle:u,endAngle:m}),t.showLabel){var k,T;k=1===c.raw.series.length?{x:g.x,y:g.y}:e.polarToCartesian(g.x,g.y,r,u+(m-u)/2),T=c.normalized.labels&&!e.isFalseyButZero(c.normalized.labels[o])?c.normalized.labels[o]:c.normalized.series[o];var C=t.labelInterpolationFnc(T,o);if(C||0===C){var q=a.elem("text",{dx:k.x,dy:k.y,"text-anchor":i(g,k,t.labelDirection)},t.classNames.label).text(""+C);this.eventEmitter.emit("draw",{type:"label",index:o,group:a,element:q,text:""+C,x:k.x,y:k.y})}}u=m}}).bind(this)),this.eventEmitter.emit("created",{chartRect:o,svg:this.svg,options:t})},determineAnchorPosition:i})}(this||global,t),t}()}).apply(e,[]))||(t.exports=n)},1486:function(t){"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var i,a,o;if(Array.isArray(e)){if((i=e.length)!=n.length)return!1;for(a=i;0!=a--;)if(!t(e[a],n[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((i=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(a=i;0!=a--;)if(!Object.prototype.hasOwnProperty.call(n,o[a]))return!1;for(a=i;0!=a--;){var s=o[a];if(!t(e[s],n[s]))return!1}return!0}return e!=e&&n!=n}},3275:function(t,e,n){"use strict";n.r(e),n.d(e,{AppAdminModule:function(){return Xc}});var i=n(61116),a=n(31041),o=n(35366),s=n(68515),r=n(63337);let l=(()=>{class t{constructor(t,e){this.http=t,this.router=e}resolve(t){return this.http.get("settings").toPromise().then(t=>t,()=>(this.router.navigate(["/admin"]),!1))}}return t.\u0275fac=function(e){return new(e||t)(o.LFG(s.r),o.LFG(r.F0))},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var c=n(78512);let d=(()=>{class t{constructor(){this.loading$=new c.X(!1),this.errors$=new c.X({}),this.initial={server:{},client:{}},this.server={},this.client={}}getModified(){return{server:this.diffSettingObjects("server"),client:this.diffSettingObjects("client")}}diffSettingObjects(t){const e={};for(const n in this[t])this[t][n]!==this.initial[t][n]&&(e[n]=this[t][n]);return e}setAll(t){this.initial=t,this.client=Object.assign({},t.client),this.server=Object.assign({},t.server)}reset(){this.server=Object.assign({},this.initial.server),this.client=Object.assign({},this.initial.client)}updateInitial(t){this.initial={client:Object.assign(Object.assign({},this.initial.client),t.client),server:Object.assign(Object.assign({},this.initial.server),t.server)}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var u=n(79961),p=n(84369),g=n(40994),h=n(95522),m=n(92935),f=n(93169),b=n(19861),v=(n(34056),n(55959));n(87254),n(30810),n(25416);let _=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[f.ud]]}),t})();var Z=n(87064),x=n(13070);const y=new o.OlP("MAT_INPUT_VALUE_ACCESSOR");let A=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({providers:[Z.rD],imports:[[_,x.lN,Z.BQ],_,x.lN]}),t})();var w=n(97070),k=n(27701),T=n(79572),C=n(63589),q=n(24311),U=n(68400);let I=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[i.ez,a.UX,U.N]]}),t})();var M=n(56160),O=n(57173),J=n(7436),P=n(77307),N=n(50615);const S=new o.OlP("RECAPTCHA_ACTIONS");var D=n(86013);let Q=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({providers:[l,d,{provide:S,multi:!0,useValue:[{name:"Registration Recaptcha",key:"recaptcha.enable_for_registration",description:"Enable recaptcha integration for registration page."},{name:"Contact Recaptcha",key:"recaptcha.enable_for_contact",description:'Enable recaptcha integration for "contact us" page.'}]}],imports:[[r.Bz,i.ez,a.u5,a.UX,I,M.G,U.N,N.X,D.b,p.ot,P.Ps,C.ZX,g.p9,q.AV,m.Is,w.Tx,T.rP,u.Bb,A,h.Hi,k.Cv,O.Nh,J.Fk],M.G]}),t})();var Y=n(90164),L=n(97388),F=n(77923),E=n(82151),R=n(43725),$=n(87570),V=n(31906),B=n(40878),H=n(99235),z=n(90611),G=n(56238),j=n(43835),X=n(99713),W=n(94720);const K=["mat-calendar-body",""];function tt(t,e){if(1&t&&(o.TgZ(0,"tr",2),o.TgZ(1,"td",3),o._uU(2),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Udp("padding-top",t._cellPadding)("padding-bottom",t._cellPadding),o.uIk("colspan",t.numCols),o.xp6(1),o.hij(" ",t.label," ")}}function et(t,e){if(1&t&&(o.TgZ(0,"td",7),o._uU(1),o.qZA()),2&t){const t=o.oxw(2);o.Udp("padding-top",t._cellPadding)("padding-bottom",t._cellPadding),o.uIk("colspan",t._firstRowOffset),o.xp6(1),o.hij(" ",t._firstRowOffset>=t.labelMinRequiredCells?t.label:""," ")}}function nt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"td",8),o.NdJ("click",function(e){const n=o.CHM(t).$implicit;return o.oxw(2)._cellClicked(n,e)}),o.TgZ(1,"div",9),o._uU(2),o.qZA(),o._UZ(3,"div",10),o.qZA()}if(2&t){const t=e.$implicit,n=e.index,i=o.oxw().index,a=o.oxw();o.Udp("width",a._cellWidth)("padding-top",a._cellPadding)("padding-bottom",a._cellPadding),o.ekj("mat-calendar-body-disabled",!t.enabled)("mat-calendar-body-active",a._isActiveCell(i,n))("mat-calendar-body-range-start",a._isRangeStart(t.compareValue))("mat-calendar-body-range-end",a._isRangeEnd(t.compareValue))("mat-calendar-body-in-range",a._isInRange(t.compareValue))("mat-calendar-body-comparison-bridge-start",a._isComparisonBridgeStart(t.compareValue,i,n))("mat-calendar-body-comparison-bridge-end",a._isComparisonBridgeEnd(t.compareValue,i,n))("mat-calendar-body-comparison-start",a._isComparisonStart(t.compareValue))("mat-calendar-body-comparison-end",a._isComparisonEnd(t.compareValue))("mat-calendar-body-in-comparison-range",a._isInComparisonRange(t.compareValue))("mat-calendar-body-preview-start",a._isPreviewStart(t.compareValue))("mat-calendar-body-preview-end",a._isPreviewEnd(t.compareValue))("mat-calendar-body-in-preview",a._isInPreview(t.compareValue)),o.Q6J("ngClass",t.cssClasses)("tabindex",a._isActiveCell(i,n)?0:-1),o.uIk("data-mat-row",i)("data-mat-col",n)("aria-label",t.ariaLabel)("aria-disabled",!t.enabled||null)("aria-selected",a._isSelected(t.compareValue)),o.xp6(1),o.ekj("mat-calendar-body-selected",a._isSelected(t.compareValue))("mat-calendar-body-comparison-identical",a._isComparisonIdentical(t.compareValue))("mat-calendar-body-today",a.todayValue===t.compareValue),o.xp6(1),o.hij(" ",t.displayValue," ")}}function it(t,e){if(1&t&&(o.TgZ(0,"tr",4),o.YNc(1,et,2,6,"td",5),o.YNc(2,nt,4,46,"td",6),o.qZA()),2&t){const t=e.$implicit,n=e.index,i=o.oxw();o.xp6(1),o.Q6J("ngIf",0===n&&i._firstRowOffset),o.xp6(1),o.Q6J("ngForOf",t)}}function at(t,e){if(1&t&&(o.TgZ(0,"th",5),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.uIk("aria-label",t.long),o.xp6(1),o.Oqu(t.narrow)}}const ot=["*"];function st(t,e){}function rt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-month-view",5),o.NdJ("activeDateChange",function(e){return o.CHM(t),o.oxw().activeDate=e})("_userSelection",function(e){return o.CHM(t),o.oxw()._dateSelected(e)}),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("activeDate",t.activeDate)("selected",t.selected)("dateFilter",t.dateFilter)("maxDate",t.maxDate)("minDate",t.minDate)("dateClass",t.dateClass)("comparisonStart",t.comparisonStart)("comparisonEnd",t.comparisonEnd)}}function lt(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-year-view",6),o.NdJ("activeDateChange",function(e){return o.CHM(t),o.oxw().activeDate=e})("monthSelected",function(e){return o.CHM(t),o.oxw()._monthSelectedInYearView(e)})("selectedChange",function(e){return o.CHM(t),o.oxw()._goToDateInView(e,"month")}),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("activeDate",t.activeDate)("selected",t.selected)("dateFilter",t.dateFilter)("maxDate",t.maxDate)("minDate",t.minDate)("dateClass",t.dateClass)}}function ct(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-multi-year-view",7),o.NdJ("activeDateChange",function(e){return o.CHM(t),o.oxw().activeDate=e})("yearSelected",function(e){return o.CHM(t),o.oxw()._yearSelectedInMultiYearView(e)})("selectedChange",function(e){return o.CHM(t),o.oxw()._goToDateInView(e,"year")}),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("activeDate",t.activeDate)("selected",t.selected)("dateFilter",t.dateFilter)("maxDate",t.maxDate)("minDate",t.minDate)("dateClass",t.dateClass)}}function dt(t,e){}const ut=["button"];function pt(t,e){1&t&&(o.O4$(),o.TgZ(0,"svg",3),o._UZ(1,"path",4),o.qZA())}const gt=[[["","matDatepickerToggleIcon",""]]],ht=["[matDatepickerToggleIcon]"];let mt=(()=>{class t{constructor(){this.changes=new v.xQ,this.calendarLabel="Calendar",this.openCalendarLabel="Open calendar",this.closeCalendarLabel="Close calendar",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 20 years",this.nextMultiYearLabel="Next 20 years",this.switchToMonthViewLabel="Choose date",this.switchToMultiYearViewLabel="Choose month and year"}formatYearRange(t,e){return`${t} \u2013 ${e}`}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=(0,o.Yz7)({factory:function(){return new t},token:t,providedIn:"root"}),t})();class ft{constructor(t,e,n,i,a={},o=t,s){this.value=t,this.displayValue=e,this.ariaLabel=n,this.enabled=i,this.cssClasses=a,this.compareValue=o,this.rawValue=s}}let bt=(()=>{class t{constructor(t,e){this._elementRef=t,this._ngZone=e,this.numCols=7,this.activeCell=0,this.isRange=!1,this.cellAspectRatio=1,this.previewStart=null,this.previewEnd=null,this.selectedValueChange=new o.vpe,this.previewChange=new o.vpe,this._enterHandler=t=>{if(this._skipNextFocus&&"focus"===t.type)this._skipNextFocus=!1;else if(t.target&&this.isRange){const e=this._getCellFromElement(t.target);e&&this._ngZone.run(()=>this.previewChange.emit({value:e.enabled?e:null,event:t}))}},this._leaveHandler=t=>{null!==this.previewEnd&&this.isRange&&t.target&&vt(t.target)&&this._ngZone.run(()=>this.previewChange.emit({value:null,event:t}))},e.runOutsideAngular(()=>{const e=t.nativeElement;e.addEventListener("mouseenter",this._enterHandler,!0),e.addEventListener("focus",this._enterHandler,!0),e.addEventListener("mouseleave",this._leaveHandler,!0),e.addEventListener("blur",this._leaveHandler,!0)})}_cellClicked(t,e){t.enabled&&this.selectedValueChange.emit({value:t.value,event:e})}_isSelected(t){return this.startValue===t||this.endValue===t}ngOnChanges(t){const e=t.numCols,{rows:n,numCols:i}=this;(t.rows||e)&&(this._firstRowOffset=n&&n.length&&n[0].length?i-n[0].length:0),(t.cellAspectRatio||e||!this._cellPadding)&&(this._cellPadding=50*this.cellAspectRatio/i+"%"),!e&&this._cellWidth||(this._cellWidth=100/i+"%")}ngOnDestroy(){const t=this._elementRef.nativeElement;t.removeEventListener("mouseenter",this._enterHandler,!0),t.removeEventListener("focus",this._enterHandler,!0),t.removeEventListener("mouseleave",this._leaveHandler,!0),t.removeEventListener("blur",this._leaveHandler,!0)}_isActiveCell(t,e){let n=t*this.numCols+e;return t&&(n-=this._firstRowOffset),n==this.activeCell}_focusActiveCell(t=!0){this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe((0,z.q)(1)).subscribe(()=>{const e=this._elementRef.nativeElement.querySelector(".mat-calendar-body-active");e&&(t||(this._skipNextFocus=!0),e.focus())})})}_isRangeStart(t){return _t(t,this.startValue,this.endValue)}_isRangeEnd(t){return Zt(t,this.startValue,this.endValue)}_isInRange(t){return xt(t,this.startValue,this.endValue,this.isRange)}_isComparisonStart(t){return _t(t,this.comparisonStart,this.comparisonEnd)}_isComparisonBridgeStart(t,e,n){if(!this._isComparisonStart(t)||this._isRangeStart(t)||!this._isInRange(t))return!1;let i=this.rows[e][n-1];if(!i){const t=this.rows[e-1];i=t&&t[t.length-1]}return i&&!this._isRangeEnd(i.compareValue)}_isComparisonBridgeEnd(t,e,n){if(!this._isComparisonEnd(t)||this._isRangeEnd(t)||!this._isInRange(t))return!1;let i=this.rows[e][n+1];if(!i){const t=this.rows[e+1];i=t&&t[0]}return i&&!this._isRangeStart(i.compareValue)}_isComparisonEnd(t){return Zt(t,this.comparisonStart,this.comparisonEnd)}_isInComparisonRange(t){return xt(t,this.comparisonStart,this.comparisonEnd,this.isRange)}_isComparisonIdentical(t){return this.comparisonStart===this.comparisonEnd&&t===this.comparisonStart}_isPreviewStart(t){return _t(t,this.previewStart,this.previewEnd)}_isPreviewEnd(t){return Zt(t,this.previewStart,this.previewEnd)}_isInPreview(t){return xt(t,this.previewStart,this.previewEnd,this.isRange)}_getCellFromElement(t){let e;if(vt(t)?e=t:vt(t.parentNode)&&(e=t.parentNode),e){const t=e.getAttribute("data-mat-row"),n=e.getAttribute("data-mat-col");if(t&&n)return this.rows[parseInt(t)][parseInt(n)]}return null}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.SBq),o.Y36(o.R0b))},t.\u0275cmp=o.Xpm({type:t,selectors:[["","mat-calendar-body",""]],hostAttrs:["role","grid","aria-readonly","true",1,"mat-calendar-body"],inputs:{numCols:"numCols",activeCell:"activeCell",isRange:"isRange",cellAspectRatio:"cellAspectRatio",previewStart:"previewStart",previewEnd:"previewEnd",label:"label",rows:"rows",todayValue:"todayValue",startValue:"startValue",endValue:"endValue",labelMinRequiredCells:"labelMinRequiredCells",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd"},outputs:{selectedValueChange:"selectedValueChange",previewChange:"previewChange"},exportAs:["matCalendarBody"],features:[o.TTD],attrs:K,decls:2,vars:2,consts:[["aria-hidden","true",4,"ngIf"],["role","row",4,"ngFor","ngForOf"],["aria-hidden","true"],[1,"mat-calendar-body-label"],["role","row"],["aria-hidden","true","class","mat-calendar-body-label",3,"paddingTop","paddingBottom",4,"ngIf"],["role","gridcell","class","mat-calendar-body-cell",3,"ngClass","tabindex","mat-calendar-body-disabled","mat-calendar-body-active","mat-calendar-body-range-start","mat-calendar-body-range-end","mat-calendar-body-in-range","mat-calendar-body-comparison-bridge-start","mat-calendar-body-comparison-bridge-end","mat-calendar-body-comparison-start","mat-calendar-body-comparison-end","mat-calendar-body-in-comparison-range","mat-calendar-body-preview-start","mat-calendar-body-preview-end","mat-calendar-body-in-preview","width","paddingTop","paddingBottom","click",4,"ngFor","ngForOf"],["aria-hidden","true",1,"mat-calendar-body-label"],["role","gridcell",1,"mat-calendar-body-cell",3,"ngClass","tabindex","click"],[1,"mat-calendar-body-cell-content","mat-focus-indicator"],[1,"mat-calendar-body-cell-preview"]],template:function(t,e){1&t&&(o.YNc(0,tt,3,6,"tr",0),o.YNc(1,it,3,2,"tr",1)),2&t&&(o.Q6J("ngIf",e._firstRowOffset<e.labelMinRequiredCells),o.xp6(1),o.Q6J("ngForOf",e.rows))},directives:[i.O5,i.sg,i.mk],styles:['.mat-calendar-body{min-width:224px}.mat-calendar-body-label{height:0;line-height:0;text-align:left;padding-left:4.7142857143%;padding-right:4.7142857143%}.mat-calendar-body-cell{position:relative;height:0;line-height:0;text-align:center;outline:none;cursor:pointer}.mat-calendar-body-cell::before,.mat-calendar-body-cell::after,.mat-calendar-body-cell-preview{content:"";position:absolute;top:5%;left:0;z-index:0;box-sizing:border-box;height:90%;width:100%}.mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-start::after,.mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,.mat-calendar-body-comparison-start::after,.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:5%;width:95%;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,[dir=rtl] .mat-calendar-body-comparison-start::after,[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:0;border-radius:0;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,.mat-calendar-body-comparison-end::after,.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}[dir=rtl] .mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,[dir=rtl] .mat-calendar-body-comparison-end::after,[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{left:5%;border-radius:0;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-comparison-bridge-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-bridge-end.mat-calendar-body-range-start::after{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end.mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-end.mat-calendar-body-range-start::after{width:90%}.mat-calendar-body-in-preview .mat-calendar-body-cell-preview{border-top:dashed 1px;border-bottom:dashed 1px}.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:dashed 1px}[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:0;border-right:dashed 1px}.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:dashed 1px}[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:0;border-left:dashed 1px}.mat-calendar-body-disabled{cursor:default}.cdk-high-contrast-active .mat-calendar-body-disabled{opacity:.5}.mat-calendar-body-cell-content{top:5%;left:5%;z-index:1;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:1px;border-style:solid;border-radius:999px}.mat-calendar-body-cell-content.mat-focus-indicator{position:absolute}.cdk-high-contrast-active .mat-calendar-body-cell-content{border:none}.mat-datepicker-dialog .mat-dialog-container{position:relative;overflow:visible}.cdk-high-contrast-active .mat-datepicker-popup:not(:empty),.cdk-high-contrast-active .mat-calendar-body-selected{outline:solid 1px}.cdk-high-contrast-active .mat-calendar-body-today{outline:dotted 1px}.cdk-high-contrast-active .cdk-keyboard-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected),.cdk-high-contrast-active .cdk-program-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected){outline:dotted 2px}[dir=rtl] .mat-calendar-body-label{text-align:right}@media(hover: none){.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected){background-color:transparent}}\n'],encapsulation:2,changeDetection:0}),t})();function vt(t){return"TD"===t.nodeName}function _t(t,e,n){return null!==n&&e!==n&&t<n&&t===e}function Zt(t,e,n){return null!==e&&e!==n&&t>=e&&t===n}function xt(t,e,n,i){return i&&null!==e&&null!==n&&e!==n&&t>=e&&t<=n}class yt{constructor(t,e){this.start=t,this.end=e}}let At=(()=>{class t{constructor(t,e){this.selection=t,this._adapter=e,this._selectionChanged=new v.xQ,this.selectionChanged=this._selectionChanged,this.selection=t}updateSelection(t,e){const n=this.selection;this.selection=t,this._selectionChanged.next({selection:t,source:e,oldValue:n})}ngOnDestroy(){this._selectionChanged.complete()}_isValidDateInstance(t){return this._adapter.isDateInstance(t)&&this._adapter.isValid(t)}clone(){return null}}return t.\u0275fac=function(e){return new(e||t)(o.LFG(void 0),o.LFG(Z._A))},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac}),t})(),wt=(()=>{class t extends At{constructor(t){super(null,t)}add(t){super.updateSelection(t,this)}isValid(){return null!=this.selection&&this._isValidDateInstance(this.selection)}isComplete(){return null!=this.selection}clone(){const e=new t(this._adapter);return e.updateSelection(this.selection,this),e}}return t.\u0275fac=function(e){return new(e||t)(o.LFG(Z._A))},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac}),t})();const kt={provide:At,deps:[[new o.FiY,new o.tp0,At],Z._A],useFactory:function(t,e){return t||new wt(e)}},Tt=new o.OlP("MAT_DATE_RANGE_SELECTION_STRATEGY");let Ct=(()=>{class t{constructor(t,e,n,i,a){this._changeDetectorRef=t,this._dateFormats=e,this._dateAdapter=n,this._dir=i,this._rangeStrategy=a,this._rerenderSubscription=$.w.EMPTY,this.selectedChange=new o.vpe,this._userSelection=new o.vpe,this.activeDateChange=new o.vpe,this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(t){const e=this._activeDate,n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(n,this.minDate,this.maxDate),this._hasSameMonthAndYear(e,this._activeDate)||this._init()}get selected(){return this._selected}set selected(t){this._selected=t instanceof yt?t:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t)),this._setRanges(this._selected)}get minDate(){return this._minDate}set minDate(t){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}get maxDate(){return this._maxDate}set maxDate(t){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,G.O)(null)).subscribe(()=>this._init())}ngOnChanges(t){const e=t.comparisonStart||t.comparisonEnd;e&&!e.firstChange&&this._setRanges(this.selected)}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_dateSelected(t){const e=t.value,n=this._dateAdapter.getYear(this.activeDate),i=this._dateAdapter.getMonth(this.activeDate),a=this._dateAdapter.createDate(n,i,e);let o,s;this._selected instanceof yt?(o=this._getDateInCurrentMonth(this._selected.start),s=this._getDateInCurrentMonth(this._selected.end)):o=s=this._getDateInCurrentMonth(this._selected),o===e&&s===e||this.selectedChange.emit(a),this._userSelection.emit({value:a,event:t.event}),this._previewStart=this._previewEnd=null,this._changeDetectorRef.markForCheck()}_handleCalendarBodyKeydown(t){const e=this._activeDate,n=this._isRtl();switch(t.keyCode){case H.oh:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,n?1:-1);break;case H.SV:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,n?-1:1);break;case H.LH:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case H.JH:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case H.Sd:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case H.uR:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case H.Ku:this.activeDate=t.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case H.VM:this.activeDate=t.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case H.K5:case H.L_:return void(this.dateFilter&&!this.dateFilter(this._activeDate)||(this._dateSelected({value:this._dateAdapter.getDate(this._activeDate),event:t}),t.preventDefault()));case H.hY:return void(null==this._previewEnd||(0,H.Vb)(t)||(this._previewStart=this._previewEnd=null,this.selectedChange.emit(null),this._userSelection.emit({value:null,event:t}),t.preventDefault(),t.stopPropagation()));default:return}this._dateAdapter.compareDate(e,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),t.preventDefault()}_init(){this._setRanges(this.selected),this._todayDate=this._getCellCompareValue(this._dateAdapter.today()),this._monthLabel=this._dateFormats.display.monthLabel?this._dateAdapter.format(this.activeDate,this._dateFormats.display.monthLabel):this._dateAdapter.getMonthNames("short")[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();let t=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(7+this._dateAdapter.getDayOfWeek(t)-this._dateAdapter.getFirstDayOfWeek())%7,this._initWeekdays(),this._createWeekCells(),this._changeDetectorRef.markForCheck()}_focusActiveCell(t){this._matCalendarBody._focusActiveCell(t)}_previewChanged({event:t,value:e}){if(this._rangeStrategy){const n=this._rangeStrategy.createPreview(e?e.rawValue:null,this.selected,t);this._previewStart=this._getCellCompareValue(n.start),this._previewEnd=this._getCellCompareValue(n.end),this._changeDetectorRef.detectChanges()}}_initWeekdays(){const t=this._dateAdapter.getFirstDayOfWeek(),e=this._dateAdapter.getDayOfWeekNames("narrow");let n=this._dateAdapter.getDayOfWeekNames("long").map((t,n)=>({long:t,narrow:e[n]}));this._weekdays=n.slice(t).concat(n.slice(0,t))}_createWeekCells(){const t=this._dateAdapter.getNumDaysInMonth(this.activeDate),e=this._dateAdapter.getDateNames();this._weeks=[[]];for(let n=0,i=this._firstWeekOffset;n<t;n++,i++){7==i&&(this._weeks.push([]),i=0);const t=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),n+1),a=this._shouldEnableDate(t),o=this._dateAdapter.format(t,this._dateFormats.display.dateA11yLabel),s=this.dateClass?this.dateClass(t,"month"):void 0;this._weeks[this._weeks.length-1].push(new ft(n+1,e[n],o,a,s,this._getCellCompareValue(t),t))}}_shouldEnableDate(t){return!!t&&(!this.minDate||this._dateAdapter.compareDate(t,this.minDate)>=0)&&(!this.maxDate||this._dateAdapter.compareDate(t,this.maxDate)<=0)&&(!this.dateFilter||this.dateFilter(t))}_getDateInCurrentMonth(t){return t&&this._hasSameMonthAndYear(t,this.activeDate)?this._dateAdapter.getDate(t):null}_hasSameMonthAndYear(t,e){return!(!t||!e||this._dateAdapter.getMonth(t)!=this._dateAdapter.getMonth(e)||this._dateAdapter.getYear(t)!=this._dateAdapter.getYear(e))}_getCellCompareValue(t){if(t){const e=this._dateAdapter.getYear(t),n=this._dateAdapter.getMonth(t),i=this._dateAdapter.getDate(t);return new Date(e,n,i).getTime()}return null}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setRanges(t){t instanceof yt?(this._rangeStart=this._getCellCompareValue(t.start),this._rangeEnd=this._getCellCompareValue(t.end),this._isRange=!0):(this._rangeStart=this._rangeEnd=this._getCellCompareValue(t),this._isRange=!1),this._comparisonRangeStart=this._getCellCompareValue(this.comparisonStart),this._comparisonRangeEnd=this._getCellCompareValue(this.comparisonEnd)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.sBO),o.Y36(Z.sG,8),o.Y36(Z._A,8),o.Y36(W.Is,8),o.Y36(Tt,8))},t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-month-view"]],viewQuery:function(t,e){if(1&t&&o.Gf(bt,5),2&t){let t;o.iGM(t=o.CRH())&&(e._matCalendarBody=t.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd"},outputs:{selectedChange:"selectedChange",_userSelection:"_userSelection",activeDateChange:"activeDateChange"},exportAs:["matMonthView"],features:[o.TTD],decls:7,vars:13,consts:[["role","presentation",1,"mat-calendar-table"],[1,"mat-calendar-table-header"],["scope","col",4,"ngFor","ngForOf"],["colspan","7","aria-hidden","true",1,"mat-calendar-table-header-divider"],["mat-calendar-body","",3,"label","rows","todayValue","startValue","endValue","comparisonStart","comparisonEnd","previewStart","previewEnd","isRange","labelMinRequiredCells","activeCell","selectedValueChange","previewChange","keydown"],["scope","col"]],template:function(t,e){1&t&&(o.TgZ(0,"table",0),o.TgZ(1,"thead",1),o.TgZ(2,"tr"),o.YNc(3,at,2,2,"th",2),o.qZA(),o.TgZ(4,"tr"),o._UZ(5,"th",3),o.qZA(),o.qZA(),o.TgZ(6,"tbody",4),o.NdJ("selectedValueChange",function(t){return e._dateSelected(t)})("previewChange",function(t){return e._previewChanged(t)})("keydown",function(t){return e._handleCalendarBodyKeydown(t)}),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngForOf",e._weekdays),o.xp6(3),o.Q6J("label",e._monthLabel)("rows",e._weeks)("todayValue",e._todayDate)("startValue",e._rangeStart)("endValue",e._rangeEnd)("comparisonStart",e._comparisonRangeStart)("comparisonEnd",e._comparisonRangeEnd)("previewStart",e._previewStart)("previewEnd",e._previewEnd)("isRange",e._isRange)("labelMinRequiredCells",3)("activeCell",e._dateAdapter.getDate(e.activeDate)-1))},directives:[i.sg,bt],encapsulation:2,changeDetection:0}),t})(),qt=(()=>{class t{constructor(t,e,n){this._changeDetectorRef=t,this._dateAdapter=e,this._dir=n,this._rerenderSubscription=$.w.EMPTY,this.selectedChange=new o.vpe,this.yearSelected=new o.vpe,this.activeDateChange=new o.vpe,this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(t){let e=this._activeDate;const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(n,this.minDate,this.maxDate),Ut(this._dateAdapter,e,this._activeDate,this.minDate,this.maxDate)||this._init()}get selected(){return this._selected}set selected(t){this._selected=t instanceof yt?t:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t)),this._setSelectedYear(t)}get minDate(){return this._minDate}set minDate(t){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}get maxDate(){return this._maxDate}set maxDate(t){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,G.O)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_init(){this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());const t=this._dateAdapter.getYear(this._activeDate)-It(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(let e=0,n=[];e<24;e++)n.push(t+e),4==n.length&&(this._years.push(n.map(t=>this._createCellForYear(t))),n=[]);this._changeDetectorRef.markForCheck()}_yearSelected(t){const e=t.value;this.yearSelected.emit(this._dateAdapter.createDate(e,0,1));let n=this._dateAdapter.getMonth(this.activeDate),i=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(e,n,1));this.selectedChange.emit(this._dateAdapter.createDate(e,n,Math.min(this._dateAdapter.getDate(this.activeDate),i)))}_handleCalendarBodyKeydown(t){const e=this._activeDate,n=this._isRtl();switch(t.keyCode){case H.oh:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,n?1:-1);break;case H.SV:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,n?-1:1);break;case H.LH:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-4);break;case H.JH:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,4);break;case H.Sd:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-It(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case H.uR:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,24-It(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case H.Ku:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?-240:-24);break;case H.VM:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?240:24);break;case H.K5:case H.L_:this._yearSelected({value:this._dateAdapter.getYear(this._activeDate),event:t});break;default:return}this._dateAdapter.compareDate(e,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),t.preventDefault()}_getActiveCell(){return It(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_createCellForYear(t){const e=this._dateAdapter.createDate(t,0,1),n=this._dateAdapter.getYearName(e),i=this.dateClass?this.dateClass(e,"multi-year"):void 0;return new ft(t,n,n,this._shouldEnableYear(t),i)}_shouldEnableYear(t){if(null==t||this.maxDate&&t>this._dateAdapter.getYear(this.maxDate)||this.minDate&&t<this._dateAdapter.getYear(this.minDate))return!1;if(!this.dateFilter)return!0;for(let e=this._dateAdapter.createDate(t,0,1);this._dateAdapter.getYear(e)==t;e=this._dateAdapter.addCalendarDays(e,1))if(this.dateFilter(e))return!0;return!1}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setSelectedYear(t){if(this._selectedYear=null,t instanceof yt){const e=t.start||t.end;e&&(this._selectedYear=this._dateAdapter.getYear(e))}else t&&(this._selectedYear=this._dateAdapter.getYear(t))}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.sBO),o.Y36(Z._A,8),o.Y36(W.Is,8))},t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-multi-year-view"]],viewQuery:function(t,e){if(1&t&&o.Gf(bt,5),2&t){let t;o.iGM(t=o.CRH())&&(e._matCalendarBody=t.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass"},outputs:{selectedChange:"selectedChange",yearSelected:"yearSelected",activeDateChange:"activeDateChange"},exportAs:["matMultiYearView"],decls:5,vars:7,consts:[["role","presentation",1,"mat-calendar-table"],[1,"mat-calendar-table-header"],["colspan","4",1,"mat-calendar-table-header-divider"],["mat-calendar-body","",3,"rows","todayValue","startValue","endValue","numCols","cellAspectRatio","activeCell","selectedValueChange","keydown"]],template:function(t,e){1&t&&(o.TgZ(0,"table",0),o.TgZ(1,"thead",1),o.TgZ(2,"tr"),o._UZ(3,"th",2),o.qZA(),o.qZA(),o.TgZ(4,"tbody",3),o.NdJ("selectedValueChange",function(t){return e._yearSelected(t)})("keydown",function(t){return e._handleCalendarBodyKeydown(t)}),o.qZA(),o.qZA()),2&t&&(o.xp6(4),o.Q6J("rows",e._years)("todayValue",e._todayYear)("startValue",e._selectedYear)("endValue",e._selectedYear)("numCols",4)("cellAspectRatio",4/7)("activeCell",e._getActiveCell()))},directives:[bt],encapsulation:2,changeDetection:0}),t})();function Ut(t,e,n,i,a){const o=t.getYear(e),s=t.getYear(n),r=Mt(t,i,a);return Math.floor((o-r)/24)===Math.floor((s-r)/24)}function It(t,e,n,i){return((t.getYear(e)-Mt(t,n,i))%24+24)%24}function Mt(t,e,n){let i=0;return n?i=t.getYear(n)-24+1:e&&(i=t.getYear(e)),i}let Ot=(()=>{class t{constructor(t,e,n,i){this._changeDetectorRef=t,this._dateFormats=e,this._dateAdapter=n,this._dir=i,this._rerenderSubscription=$.w.EMPTY,this.selectedChange=new o.vpe,this.monthSelected=new o.vpe,this.activeDateChange=new o.vpe,this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(t){let e=this._activeDate;const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(n,this.minDate,this.maxDate),this._dateAdapter.getYear(e)!==this._dateAdapter.getYear(this._activeDate)&&this._init()}get selected(){return this._selected}set selected(t){this._selected=t instanceof yt?t:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t)),this._setSelectedMonth(t)}get minDate(){return this._minDate}set minDate(t){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}get maxDate(){return this._maxDate}set maxDate(t){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe((0,G.O)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_monthSelected(t){const e=t.value,n=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1);this.monthSelected.emit(n);const i=this._dateAdapter.getNumDaysInMonth(n);this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,Math.min(this._dateAdapter.getDate(this.activeDate),i)))}_handleCalendarBodyKeydown(t){const e=this._activeDate,n=this._isRtl();switch(t.keyCode){case H.oh:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,n?1:-1);break;case H.SV:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,n?-1:1);break;case H.LH:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case H.JH:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case H.Sd:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case H.uR:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case H.Ku:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?-10:-1);break;case H.VM:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t.altKey?10:1);break;case H.K5:case H.L_:this._monthSelected({value:this._dateAdapter.getMonth(this._activeDate),event:t});break;default:return}this._dateAdapter.compareDate(e,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),t.preventDefault()}_init(){this._setSelectedMonth(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);let t=this._dateAdapter.getMonthNames("short");this._months=[[0,1,2,3],[4,5,6,7],[8,9,10,11]].map(e=>e.map(e=>this._createCellForMonth(e,t[e]))),this._changeDetectorRef.markForCheck()}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_getMonthInCurrentYear(t){return t&&this._dateAdapter.getYear(t)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(t):null}_createCellForMonth(t,e){const n=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),t,1),i=this._dateAdapter.format(n,this._dateFormats.display.monthYearA11yLabel),a=this.dateClass?this.dateClass(n,"year"):void 0;return new ft(t,e.toLocaleUpperCase(),i,this._shouldEnableMonth(t),a)}_shouldEnableMonth(t){const e=this._dateAdapter.getYear(this.activeDate);if(null==t||this._isYearAndMonthAfterMaxDate(e,t)||this._isYearAndMonthBeforeMinDate(e,t))return!1;if(!this.dateFilter)return!0;for(let n=this._dateAdapter.createDate(e,t,1);this._dateAdapter.getMonth(n)==t;n=this._dateAdapter.addCalendarDays(n,1))if(this.dateFilter(n))return!0;return!1}_isYearAndMonthAfterMaxDate(t,e){if(this.maxDate){const n=this._dateAdapter.getYear(this.maxDate),i=this._dateAdapter.getMonth(this.maxDate);return t>n||t===n&&e>i}return!1}_isYearAndMonthBeforeMinDate(t,e){if(this.minDate){const n=this._dateAdapter.getYear(this.minDate),i=this._dateAdapter.getMonth(this.minDate);return t<n||t===n&&e<i}return!1}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setSelectedMonth(t){this._selectedMonth=t instanceof yt?this._getMonthInCurrentYear(t.start)||this._getMonthInCurrentYear(t.end):this._getMonthInCurrentYear(t)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.sBO),o.Y36(Z.sG,8),o.Y36(Z._A,8),o.Y36(W.Is,8))},t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-year-view"]],viewQuery:function(t,e){if(1&t&&o.Gf(bt,5),2&t){let t;o.iGM(t=o.CRH())&&(e._matCalendarBody=t.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass"},outputs:{selectedChange:"selectedChange",monthSelected:"monthSelected",activeDateChange:"activeDateChange"},exportAs:["matYearView"],decls:5,vars:9,consts:[["role","presentation",1,"mat-calendar-table"],[1,"mat-calendar-table-header"],["colspan","4",1,"mat-calendar-table-header-divider"],["mat-calendar-body","",3,"label","rows","todayValue","startValue","endValue","labelMinRequiredCells","numCols","cellAspectRatio","activeCell","selectedValueChange","keydown"]],template:function(t,e){1&t&&(o.TgZ(0,"table",0),o.TgZ(1,"thead",1),o.TgZ(2,"tr"),o._UZ(3,"th",2),o.qZA(),o.qZA(),o.TgZ(4,"tbody",3),o.NdJ("selectedValueChange",function(t){return e._monthSelected(t)})("keydown",function(t){return e._handleCalendarBodyKeydown(t)}),o.qZA(),o.qZA()),2&t&&(o.xp6(4),o.Q6J("label",e._yearLabel)("rows",e._months)("todayValue",e._todayMonth)("startValue",e._selectedMonth)("endValue",e._selectedMonth)("labelMinRequiredCells",2)("numCols",4)("cellAspectRatio",4/7)("activeCell",e._dateAdapter.getMonth(e.activeDate)))},directives:[bt],encapsulation:2,changeDetection:0}),t})(),Jt=0,Pt=(()=>{class t{constructor(t,e,n,i,a){this._intl=t,this.calendar=e,this._dateAdapter=n,this._dateFormats=i,this._buttonDescriptionId="mat-calendar-button-"+Jt++,this.calendar.stateChanges.subscribe(()=>a.markForCheck())}get periodButtonText(){if("month"==this.calendar.currentView)return this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase();if("year"==this.calendar.currentView)return this._dateAdapter.getYearName(this.calendar.activeDate);const t=this._dateAdapter.getYear(this.calendar.activeDate)-It(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate),e=t+24-1,n=this._dateAdapter.getYearName(this._dateAdapter.createDate(t,0,1)),i=this._dateAdapter.getYearName(this._dateAdapter.createDate(e,0,1));return this._intl.formatYearRange(n,i)}get periodButtonLabel(){return"month"==this.calendar.currentView?this._intl.switchToMultiYearViewLabel:this._intl.switchToMonthViewLabel}get prevButtonLabel(){return{month:this._intl.prevMonthLabel,year:this._intl.prevYearLabel,"multi-year":this._intl.prevMultiYearLabel}[this.calendar.currentView]}get nextButtonLabel(){return{month:this._intl.nextMonthLabel,year:this._intl.nextYearLabel,"multi-year":this._intl.nextMultiYearLabel}[this.calendar.currentView]}currentPeriodClicked(){this.calendar.currentView="month"==this.calendar.currentView?"multi-year":"month"}previousClicked(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,-1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?-1:-24)}nextClicked(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?1:24)}previousEnabled(){return!this.calendar.minDate||!this.calendar.minDate||!this._isSameView(this.calendar.activeDate,this.calendar.minDate)}nextEnabled(){return!this.calendar.maxDate||!this._isSameView(this.calendar.activeDate,this.calendar.maxDate)}_isSameView(t,e){return"month"==this.calendar.currentView?this._dateAdapter.getYear(t)==this._dateAdapter.getYear(e)&&this._dateAdapter.getMonth(t)==this._dateAdapter.getMonth(e):"year"==this.calendar.currentView?this._dateAdapter.getYear(t)==this._dateAdapter.getYear(e):Ut(this._dateAdapter,t,e,this.calendar.minDate,this.calendar.maxDate)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(mt),o.Y36((0,o.Gpc)(()=>Nt)),o.Y36(Z._A,8),o.Y36(Z.sG,8),o.Y36(o.sBO))},t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-calendar-header"]],exportAs:["matCalendarHeader"],ngContentSelectors:ot,decls:10,vars:10,consts:[[1,"mat-calendar-header"],[1,"mat-calendar-controls"],["mat-button","","type","button","cdkAriaLive","polite",1,"mat-calendar-period-button",3,"click"],[1,"mat-calendar-arrow"],[1,"mat-calendar-spacer"],["mat-icon-button","","type","button",1,"mat-calendar-previous-button",3,"disabled","click"],["mat-icon-button","","type","button",1,"mat-calendar-next-button",3,"disabled","click"]],template:function(t,e){1&t&&(o.F$t(),o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"button",2),o.NdJ("click",function(){return e.currentPeriodClicked()}),o.TgZ(3,"span"),o._uU(4),o.qZA(),o._UZ(5,"div",3),o.qZA(),o._UZ(6,"div",4),o.Hsn(7),o.TgZ(8,"button",5),o.NdJ("click",function(){return e.previousClicked()}),o.qZA(),o.TgZ(9,"button",6),o.NdJ("click",function(){return e.nextClicked()}),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(2),o.uIk("aria-label",e.periodButtonLabel)("aria-describedby",e._buttonDescriptionId),o.xp6(1),o.uIk("id",e._buttonDescriptionId),o.xp6(1),o.Oqu(e.periodButtonText),o.xp6(1),o.ekj("mat-calendar-invert","month"!==e.calendar.currentView),o.xp6(3),o.Q6J("disabled",!e.previousEnabled()),o.uIk("aria-label",e.prevButtonLabel),o.xp6(1),o.Q6J("disabled",!e.nextEnabled()),o.uIk("aria-label",e.nextButtonLabel))},directives:[p.lW,L.Qr],encapsulation:2,changeDetection:0}),t})(),Nt=(()=>{class t{constructor(t,e,n,i){this._dateAdapter=e,this._dateFormats=n,this._changeDetectorRef=i,this._moveFocusOnNextTick=!1,this.startView="month",this.selectedChange=new o.vpe,this.yearSelected=new o.vpe,this.monthSelected=new o.vpe,this.viewChanged=new o.vpe(!0),this._userSelection=new o.vpe,this.stateChanges=new v.xQ,this._intlChanges=t.changes.subscribe(()=>{i.markForCheck(),this.stateChanges.next()})}get startAt(){return this._startAt}set startAt(t){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}get selected(){return this._selected}set selected(t){this._selected=t instanceof yt?t:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}get minDate(){return this._minDate}set minDate(t){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}get maxDate(){return this._maxDate}set maxDate(t){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}get activeDate(){return this._clampedActiveDate}set activeDate(t){this._clampedActiveDate=this._dateAdapter.clampDate(t,this.minDate,this.maxDate),this.stateChanges.next(),this._changeDetectorRef.markForCheck()}get currentView(){return this._currentView}set currentView(t){const e=this._currentView!==t?t:null;this._currentView=t,this._moveFocusOnNextTick=!0,this._changeDetectorRef.markForCheck(),e&&this.viewChanged.emit(e)}ngAfterContentInit(){this._calendarHeaderPortal=new E.C5(this.headerComponent||Pt),this.activeDate=this.startAt||this._dateAdapter.today(),this._currentView=this.startView}ngAfterViewChecked(){this._moveFocusOnNextTick&&(this._moveFocusOnNextTick=!1,this.focusActiveCell())}ngOnDestroy(){this._intlChanges.unsubscribe(),this.stateChanges.complete()}ngOnChanges(t){const e=t.minDate||t.maxDate||t.dateFilter;if(e&&!e.firstChange){const t=this._getCurrentViewComponent();t&&(this._changeDetectorRef.detectChanges(),t._init())}this.stateChanges.next()}focusActiveCell(){this._getCurrentViewComponent()._focusActiveCell(!1)}updateTodaysDate(){const t=this.currentView;let e;e="month"===t?this.monthView:"year"===t?this.yearView:this.multiYearView,e._init()}_dateSelected(t){const e=t.value;(this.selected instanceof yt||e&&!this._dateAdapter.sameDate(e,this.selected))&&this.selectedChange.emit(e),this._userSelection.emit(t)}_yearSelectedInMultiYearView(t){this.yearSelected.emit(t)}_monthSelectedInYearView(t){this.monthSelected.emit(t)}_goToDateInView(t,e){this.activeDate=t,this.currentView=e}_getCurrentViewComponent(){return this.monthView||this.yearView||this.multiYearView}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(mt),o.Y36(Z._A,8),o.Y36(Z.sG,8),o.Y36(o.sBO))},t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-calendar"]],viewQuery:function(t,e){if(1&t&&(o.Gf(Ct,5),o.Gf(Ot,5),o.Gf(qt,5)),2&t){let t;o.iGM(t=o.CRH())&&(e.monthView=t.first),o.iGM(t=o.CRH())&&(e.yearView=t.first),o.iGM(t=o.CRH())&&(e.multiYearView=t.first)}},hostAttrs:[1,"mat-calendar"],inputs:{startView:"startView",startAt:"startAt",selected:"selected",minDate:"minDate",maxDate:"maxDate",headerComponent:"headerComponent",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd"},outputs:{selectedChange:"selectedChange",yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",_userSelection:"_userSelection"},exportAs:["matCalendar"],features:[o._Bn([kt]),o.TTD],decls:5,vars:5,consts:[[3,"cdkPortalOutlet"],["cdkMonitorSubtreeFocus","","tabindex","-1",1,"mat-calendar-content",3,"ngSwitch"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","activeDateChange","_userSelection",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","monthSelected","selectedChange",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","yearSelected","selectedChange",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","activeDateChange","_userSelection"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","monthSelected","selectedChange"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","yearSelected","selectedChange"]],template:function(t,e){1&t&&(o.YNc(0,st,0,0,"ng-template",0),o.TgZ(1,"div",1),o.YNc(2,rt,1,8,"mat-month-view",2),o.YNc(3,lt,1,6,"mat-year-view",3),o.YNc(4,ct,1,6,"mat-multi-year-view",4),o.qZA()),2&t&&(o.Q6J("cdkPortalOutlet",e._calendarHeaderPortal),o.xp6(1),o.Q6J("ngSwitch",e.currentView),o.xp6(1),o.Q6J("ngSwitchCase","month"),o.xp6(1),o.Q6J("ngSwitchCase","year"),o.xp6(1),o.Q6J("ngSwitchCase","multi-year"))},directives:[E.Pl,L.kH,i.RF,i.n9,Ct,Ot,qt],styles:['.mat-calendar{display:block}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 8px 8px;outline:none}.mat-calendar-controls{display:flex;margin:5% calc(33% / 7 - 16px)}.mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0}.mat-calendar-arrow{display:inline-block;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top-width:5px;border-top-style:solid;margin:0 0 0 5px;vertical-align:middle}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.mat-calendar-previous-button,.mat-calendar-next-button{position:relative}.mat-calendar-previous-button::after,.mat-calendar-next-button::after{top:0;left:0;right:0;bottom:0;position:absolute;content:"";margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-previous-button,[dir=rtl] .mat-calendar-next-button{transform:rotate(180deg)}.mat-calendar-previous-button::after{border-left-width:2px;transform:translateX(2px) rotate(-45deg)}.mat-calendar-next-button::after{border-right-width:2px;transform:translateX(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px 0}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:"";position:absolute;top:0;left:-8px;right:-8px;height:1px}\n'],encapsulation:2,changeDetection:0}),t})();const St={transformPanel:(0,X.X$)("transformPanel",[(0,X.SB)("void",(0,X.oB)({opacity:0,transform:"scale(1, 0.8)"})),(0,X.eR)("void => enter",(0,X.jt)("120ms cubic-bezier(0, 0, 0.2, 1)",(0,X.oB)({opacity:1,transform:"scale(1, 1)"}))),(0,X.eR)("* => void",(0,X.jt)("100ms linear",(0,X.oB)({opacity:0})))]),fadeInCalendar:(0,X.X$)("fadeInCalendar",[(0,X.SB)("void",(0,X.oB)({opacity:0})),(0,X.SB)("enter",(0,X.oB)({opacity:1})),(0,X.eR)("void => *",(0,X.jt)("120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])};let Dt=0;const Qt=new o.OlP("mat-datepicker-scroll-strategy"),Yt={provide:Qt,deps:[F.aV],useFactory:function(t){return()=>t.scrollStrategies.reposition()}};class Lt{constructor(t){this._elementRef=t}}const Ft=(0,Z.pj)(Lt);let Et=(()=>{class t extends Ft{constructor(t,e,n,i,a,o){super(t),this._changeDetectorRef=e,this._globalModel=n,this._dateAdapter=i,this._rangeSelectionStrategy=a,this._subscriptions=new $.w,this._animationState="enter",this._animationDone=new v.xQ,this._actionsPortal=null,this._closeButtonText=(null==o?void 0:o.closeCalendarLabel)||"Close calendar"}ngOnInit(){this._model=this._actionsPortal?this._globalModel.clone():this._globalModel}ngAfterViewInit(){this._subscriptions.add(this.datepicker.stateChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})),this._calendar.focusActiveCell()}ngOnDestroy(){this._subscriptions.unsubscribe(),this._animationDone.complete()}_handleUserSelection(t){const e=this._model.selection,n=t.value,i=e instanceof yt;if(i&&this._rangeSelectionStrategy){const i=this._rangeSelectionStrategy.selectionFinished(n,e,t.event);this._model.updateSelection(i,this)}else!n||!i&&this._dateAdapter.sameDate(n,e)||this._model.add(n);this._model&&!this._model.isComplete()||this._actionsPortal||this.datepicker.close()}_startExitAnimation(){this._animationState="void",this._changeDetectorRef.markForCheck()}_getSelected(){return this._model.selection}_applyPendingSelection(){this._model!==this._globalModel&&this._globalModel.updateSelection(this._model.selection,this)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.SBq),o.Y36(o.sBO),o.Y36(At),o.Y36(Z._A),o.Y36(Tt,8),o.Y36(mt))},t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-datepicker-content"]],viewQuery:function(t,e){if(1&t&&o.Gf(Nt,5),2&t){let t;o.iGM(t=o.CRH())&&(e._calendar=t.first)}},hostAttrs:[1,"mat-datepicker-content"],hostVars:3,hostBindings:function(t,e){1&t&&o.WFA("@transformPanel.done",function(){return e._animationDone.next()}),2&t&&(o.d8E("@transformPanel",e._animationState),o.ekj("mat-datepicker-content-touch",e.datepicker.touchUi))},inputs:{color:"color"},exportAs:["matDatepickerContent"],features:[o.qOj],decls:5,vars:20,consts:[["cdkTrapFocus","",1,"mat-datepicker-content-container"],[3,"id","ngClass","startAt","startView","minDate","maxDate","dateFilter","headerComponent","selected","dateClass","comparisonStart","comparisonEnd","yearSelected","monthSelected","viewChanged","_userSelection"],[3,"cdkPortalOutlet"],["type","button","mat-raised-button","",1,"mat-datepicker-close-button",3,"color","focus","blur","click"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"mat-calendar",1),o.NdJ("yearSelected",function(t){return e.datepicker._selectYear(t)})("monthSelected",function(t){return e.datepicker._selectMonth(t)})("viewChanged",function(t){return e.datepicker._viewChanged(t)})("_userSelection",function(t){return e._handleUserSelection(t)}),o.qZA(),o.YNc(2,dt,0,0,"ng-template",2),o.TgZ(3,"button",3),o.NdJ("focus",function(){return e._closeButtonFocused=!0})("blur",function(){return e._closeButtonFocused=!1})("click",function(){return e.datepicker.close()}),o._uU(4),o.qZA(),o.qZA()),2&t&&(o.ekj("mat-datepicker-content-container-with-actions",e._actionsPortal),o.xp6(1),o.Q6J("id",e.datepicker.id)("ngClass",e.datepicker.panelClass)("startAt",e.datepicker.startAt)("startView",e.datepicker.startView)("minDate",e.datepicker._getMinDate())("maxDate",e.datepicker._getMaxDate())("dateFilter",e.datepicker._getDateFilter())("headerComponent",e.datepicker.calendarHeaderComponent)("selected",e._getSelected())("dateClass",e.datepicker.dateClass)("comparisonStart",e.comparisonStart)("comparisonEnd",e.comparisonEnd)("@fadeInCalendar","enter"),o.xp6(1),o.Q6J("cdkPortalOutlet",e._actionsPortal),o.xp6(1),o.ekj("cdk-visually-hidden",!e._closeButtonFocused),o.Q6J("color",e.color||"primary"),o.xp6(1),o.Oqu(e._closeButtonText))},directives:[L.mK,Nt,i.mk,E.Pl,p.lW],styles:[".mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mat-datepicker-content-touch{display:block;max-height:80vh;overflow:auto;margin:-24px}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:788px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}\n"],encapsulation:2,data:{animation:[St.transformPanel,St.fadeInCalendar]},changeDetection:0}),t})(),Rt=(()=>{class t{constructor(t,e,n,i,a,s,r,l,c){this._dialog=t,this._overlay=e,this._ngZone=n,this._viewContainerRef=i,this._dateAdapter=s,this._dir=r,this._document=l,this._model=c,this._inputStateChanges=$.w.EMPTY,this.startView="month",this._touchUi=!1,this.xPosition="start",this.yPosition="below",this._restoreFocus=!0,this.yearSelected=new o.vpe,this.monthSelected=new o.vpe,this.viewChanged=new o.vpe(!0),this.openedStream=new o.vpe,this.closedStream=new o.vpe,this._opened=!1,this.id="mat-datepicker-"+Dt++,this._focusedElementBeforeOpen=null,this._backdropHarnessClass=`${this.id}-backdrop`,this.stateChanges=new v.xQ,this._scrollStrategy=a}get startAt(){return this._startAt||(this.datepickerInput?this.datepickerInput.getStartValue():null)}set startAt(t){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t))}get color(){return this._color||(this.datepickerInput?this.datepickerInput.getThemePalette():void 0)}set color(t){this._color=t}get touchUi(){return this._touchUi}set touchUi(t){this._touchUi=(0,b.Ig)(t)}get disabled(){return void 0===this._disabled&&this.datepickerInput?this.datepickerInput.disabled:!!this._disabled}set disabled(t){const e=(0,b.Ig)(t);e!==this._disabled&&(this._disabled=e,this.stateChanges.next(void 0))}get restoreFocus(){return this._restoreFocus}set restoreFocus(t){this._restoreFocus=(0,b.Ig)(t)}get panelClass(){return this._panelClass}set panelClass(t){this._panelClass=(0,b.du)(t)}get opened(){return this._opened}set opened(t){(0,b.Ig)(t)?this.open():this.close()}_getMinDate(){return this.datepickerInput&&this.datepickerInput.min}_getMaxDate(){return this.datepickerInput&&this.datepickerInput.max}_getDateFilter(){return this.datepickerInput&&this.datepickerInput.dateFilter}ngOnChanges(t){const e=t.xPosition||t.yPosition;e&&!e.firstChange&&this._popupRef&&(this._setConnectedPositions(this._popupRef.getConfig().positionStrategy),this.opened&&this._popupRef.updatePosition()),this.stateChanges.next(void 0)}ngOnDestroy(){this._destroyPopup(),this.close(),this._inputStateChanges.unsubscribe(),this.stateChanges.complete()}select(t){this._model.add(t)}_selectYear(t){this.yearSelected.emit(t)}_selectMonth(t){this.monthSelected.emit(t)}_viewChanged(t){this.viewChanged.emit(t)}registerInput(t){return this._inputStateChanges.unsubscribe(),this.datepickerInput=t,this._inputStateChanges=t.stateChanges.subscribe(()=>this.stateChanges.next(void 0)),this._model}registerActions(t){this._actionsPortal=t}removeActions(t){t===this._actionsPortal&&(this._actionsPortal=null)}open(){this._opened||this.disabled||(this._document&&(this._focusedElementBeforeOpen=this._document.activeElement),this.touchUi?this._openAsDialog():this._openAsPopup(),this._opened=!0,this.openedStream.emit())}close(){if(!this._opened)return;if(this._popupComponentRef&&this._popupRef){const t=this._popupComponentRef.instance;t._startExitAnimation(),t._animationDone.pipe((0,z.q)(1)).subscribe(()=>this._destroyPopup())}this._dialogRef&&(this._dialogRef.close(),this._dialogRef=null);const t=()=>{this._opened&&(this._opened=!1,this.closedStream.emit(),this._focusedElementBeforeOpen=null)};this._restoreFocus&&this._focusedElementBeforeOpen&&"function"==typeof this._focusedElementBeforeOpen.focus?(this._focusedElementBeforeOpen.focus(),setTimeout(t)):t()}_applyPendingSelection(){var t,e;const n=(null===(t=this._popupComponentRef)||void 0===t?void 0:t.instance)||(null===(e=this._dialogRef)||void 0===e?void 0:e.componentInstance);null==n||n._applyPendingSelection()}_openAsDialog(){this._dialogRef&&this._dialogRef.close(),this._dialogRef=this._dialog.open(Et,{direction:this._dir?this._dir.value:"ltr",viewContainerRef:this._viewContainerRef,panelClass:"mat-datepicker-dialog",hasBackdrop:!0,disableClose:!1,backdropClass:["cdk-overlay-dark-backdrop",this._backdropHarnessClass],width:"",height:"",minWidth:"",minHeight:"",maxWidth:"80vw",maxHeight:"",position:{},autoFocus:!1,restoreFocus:!1}),this._dialogRef.afterClosed().subscribe(()=>this.close()),this._forwardContentValues(this._dialogRef.componentInstance)}_openAsPopup(){const t=new E.C5(Et,this._viewContainerRef);this._destroyPopup(),this._createPopup(),this._popupComponentRef=this._popupRef.attach(t),this._forwardContentValues(this._popupComponentRef.instance),this._ngZone.onStable.pipe((0,z.q)(1)).subscribe(()=>{this._popupRef.updatePosition()})}_forwardContentValues(t){t.datepicker=this,t.color=this.color,t._actionsPortal=this._actionsPortal}_createPopup(){const t=this._overlay.position().flexibleConnectedTo(this.datepickerInput.getConnectedOverlayOrigin()).withTransformOriginOn(".mat-datepicker-content").withFlexibleDimensions(!1).withViewportMargin(8).withLockedPosition(),e=new F.X_({positionStrategy:this._setConnectedPositions(t),hasBackdrop:!0,backdropClass:["mat-overlay-transparent-backdrop",this._backdropHarnessClass],direction:this._dir,scrollStrategy:this._scrollStrategy(),panelClass:"mat-datepicker-popup"});this._popupRef=this._overlay.create(e),this._popupRef.overlayElement.setAttribute("role","dialog"),(0,V.T)(this._popupRef.backdropClick(),this._popupRef.detachments(),this._popupRef.keydownEvents().pipe((0,j.h)(t=>t.keyCode===H.hY&&!(0,H.Vb)(t)||this.datepickerInput&&(0,H.Vb)(t,"altKey")&&t.keyCode===H.LH))).subscribe(t=>{t&&t.preventDefault(),this.close()})}_destroyPopup(){this._popupRef&&(this._popupRef.dispose(),this._popupRef=this._popupComponentRef=null)}_setConnectedPositions(t){const e="end"===this.xPosition?"end":"start",n="start"===e?"end":"start",i="above"===this.yPosition?"bottom":"top",a="top"===i?"bottom":"top";return t.withPositions([{originX:e,originY:a,overlayX:e,overlayY:i},{originX:e,originY:i,overlayX:e,overlayY:a},{originX:n,originY:a,overlayX:n,overlayY:i},{originX:n,originY:i,overlayX:n,overlayY:a}])}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(m.uw),o.Y36(F.aV),o.Y36(o.R0b),o.Y36(o.s_b),o.Y36(Qt),o.Y36(Z._A,8),o.Y36(W.Is,8),o.Y36(i.K0,8),o.Y36(At))},t.\u0275dir=o.lG2({type:t,inputs:{startView:"startView",xPosition:"xPosition",yPosition:"yPosition",startAt:"startAt",color:"color",touchUi:"touchUi",disabled:"disabled",restoreFocus:"restoreFocus",panelClass:"panelClass",opened:"opened",calendarHeaderComponent:"calendarHeaderComponent",dateClass:"dateClass"},outputs:{yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",openedStream:"opened",closedStream:"closed"},features:[o.TTD]}),t})(),$t=(()=>{class t extends Rt{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-datepicker"]],exportAs:["matDatepicker"],features:[o._Bn([kt,{provide:Rt,useExisting:t}]),o.qOj],decls:0,vars:0,template:function(t,e){},encapsulation:2,changeDetection:0}),t})();class Vt{constructor(t,e){this.target=t,this.targetElement=e,this.value=this.target.value}}let Bt=(()=>{class t{constructor(t,e,n){this._elementRef=t,this._dateAdapter=e,this._dateFormats=n,this.dateChange=new o.vpe,this.dateInput=new o.vpe,this.stateChanges=new v.xQ,this._onTouched=()=>{},this._validatorOnChange=()=>{},this._cvaOnChange=()=>{},this._valueChangesSubscription=$.w.EMPTY,this._localeSubscription=$.w.EMPTY,this._parseValidator=()=>this._lastValueValid?null:{matDatepickerParse:{text:this._elementRef.nativeElement.value}},this._filterValidator=t=>{const e=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t.value));return!e||this._matchesFilter(e)?null:{matDatepickerFilter:!0}},this._minValidator=t=>{const e=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t.value)),n=this._getMinDate();return!n||!e||this._dateAdapter.compareDate(n,e)<=0?null:{matDatepickerMin:{min:n,actual:e}}},this._maxValidator=t=>{const e=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t.value)),n=this._getMaxDate();return!n||!e||this._dateAdapter.compareDate(n,e)>=0?null:{matDatepickerMax:{max:n,actual:e}}},this._lastValueValid=!1,this._localeSubscription=e.localeChanges.subscribe(()=>{this._assignValueProgrammatically(this.value)})}get value(){return this._model?this._getValueFromModel(this._model.selection):this._pendingValue}set value(t){this._assignValueProgrammatically(t)}get disabled(){return!!this._disabled||this._parentDisabled()}set disabled(t){const e=(0,b.Ig)(t),n=this._elementRef.nativeElement;this._disabled!==e&&(this._disabled=e,this.stateChanges.next(void 0)),e&&this._isInitialized&&n.blur&&n.blur()}_getValidators(){return[this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator]}_registerModel(t){this._model=t,this._valueChangesSubscription.unsubscribe(),this._pendingValue&&this._assignValue(this._pendingValue),this._valueChangesSubscription=this._model.selectionChanged.subscribe(t=>{if(this._shouldHandleChangeEvent(t)){const e=this._getValueFromModel(t.selection);this._lastValueValid=this._isValidValue(e),this._cvaOnChange(e),this._onTouched(),this._formatValue(e),this.dateInput.emit(new Vt(this,this._elementRef.nativeElement)),this.dateChange.emit(new Vt(this,this._elementRef.nativeElement))}})}ngAfterViewInit(){this._isInitialized=!0}ngOnChanges(t){(function(t,e){const n=Object.keys(t);for(let i of n){const{previousValue:n,currentValue:a}=t[i];if(!e.isDateInstance(n)||!e.isDateInstance(a))return!0;if(!e.sameDate(n,a))return!0}return!1})(t,this._dateAdapter)&&this.stateChanges.next(void 0)}ngOnDestroy(){this._valueChangesSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this.stateChanges.complete()}registerOnValidatorChange(t){this._validatorOnChange=t}validate(t){return this._validator?this._validator(t):null}writeValue(t){this._assignValueProgrammatically(t)}registerOnChange(t){this._cvaOnChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_onKeydown(t){t.altKey&&t.keyCode===H.JH&&!this._elementRef.nativeElement.readOnly&&(this._openPopup(),t.preventDefault())}_onInput(t){const e=this._lastValueValid;let n=this._dateAdapter.parse(t,this._dateFormats.parse.dateInput);this._lastValueValid=this._isValidValue(n),n=this._dateAdapter.getValidDateOrNull(n),this._dateAdapter.sameDate(n,this.value)?(t&&!this.value&&this._cvaOnChange(n),e!==this._lastValueValid&&this._validatorOnChange()):(this._assignValue(n),this._cvaOnChange(n),this.dateInput.emit(new Vt(this,this._elementRef.nativeElement)))}_onChange(){this.dateChange.emit(new Vt(this,this._elementRef.nativeElement))}_onBlur(){this.value&&this._formatValue(this.value),this._onTouched()}_formatValue(t){this._elementRef.nativeElement.value=t?this._dateAdapter.format(t,this._dateFormats.display.dateInput):""}_assignValue(t){this._model?(this._assignValueToModel(t),this._pendingValue=null):this._pendingValue=t}_isValidValue(t){return!t||this._dateAdapter.isValid(t)}_parentDisabled(){return!1}_assignValueProgrammatically(t){t=this._dateAdapter.deserialize(t),this._lastValueValid=this._isValidValue(t),t=this._dateAdapter.getValidDateOrNull(t),this._assignValue(t),this._formatValue(t)}_matchesFilter(t){const e=this._getDateFilter();return!e||e(t)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.SBq),o.Y36(Z._A,8),o.Y36(Z.sG,8))},t.\u0275dir=o.lG2({type:t,inputs:{value:"value",disabled:"disabled"},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[o.TTD]}),t})();const Ht={provide:a.JU,useExisting:(0,o.Gpc)(()=>Gt),multi:!0},zt={provide:a.Cf,useExisting:(0,o.Gpc)(()=>Gt),multi:!0};let Gt=(()=>{class t extends Bt{constructor(t,e,n,i){super(t,e,n),this._formField=i,this._closedSubscription=$.w.EMPTY,this._validator=a.kI.compose(super._getValidators())}set matDatepicker(t){t&&(this._datepicker=t,this._closedSubscription=t.closedStream.subscribe(()=>this._onTouched()),this._registerModel(t.registerInput(this)))}get min(){return this._min}set min(t){const e=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t));this._dateAdapter.sameDate(e,this._min)||(this._min=e,this._validatorOnChange())}get max(){return this._max}set max(t){const e=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(t));this._dateAdapter.sameDate(e,this._max)||(this._max=e,this._validatorOnChange())}get dateFilter(){return this._dateFilter}set dateFilter(t){const e=this._matchesFilter(this.value);this._dateFilter=t,this._matchesFilter(this.value)!==e&&this._validatorOnChange()}getConnectedOverlayOrigin(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef}getThemePalette(){return this._formField?this._formField.color:void 0}getStartValue(){return this.value}ngOnDestroy(){super.ngOnDestroy(),this._closedSubscription.unsubscribe()}_openPopup(){this._datepicker&&this._datepicker.open()}_getValueFromModel(t){return t}_assignValueToModel(t){this._model&&this._model.updateSelection(t,this)}_getMinDate(){return this._min}_getMaxDate(){return this._max}_getDateFilter(){return this._dateFilter}_shouldHandleChangeEvent(t){return t.source!==this}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(o.SBq),o.Y36(Z._A,8),o.Y36(Z.sG,8),o.Y36(x.G_,8))},t.\u0275dir=o.lG2({type:t,selectors:[["input","matDatepicker",""]],hostAttrs:[1,"mat-datepicker-input"],hostVars:6,hostBindings:function(t,e){1&t&&o.NdJ("input",function(t){return e._onInput(t.target.value)})("change",function(){return e._onChange()})("blur",function(){return e._onBlur()})("keydown",function(t){return e._onKeydown(t)}),2&t&&(o.Ikx("disabled",e.disabled),o.uIk("aria-haspopup",e._datepicker?"dialog":null)("aria-owns",(null==e._datepicker?null:e._datepicker.opened)&&e._datepicker.id||null)("min",e.min?e._dateAdapter.toIso8601(e.min):null)("max",e.max?e._dateAdapter.toIso8601(e.max):null)("data-mat-calendar",e._datepicker?e._datepicker.id:null))},inputs:{matDatepicker:"matDatepicker",min:"min",max:"max",dateFilter:["matDatepickerFilter","dateFilter"]},exportAs:["matDatepickerInput"],features:[o._Bn([Ht,zt,{provide:y,useExisting:t}]),o.qOj]}),t})(),jt=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=o.lG2({type:t,selectors:[["","matDatepickerToggleIcon",""]]}),t})(),Xt=(()=>{class t{constructor(t,e,n){this._intl=t,this._changeDetectorRef=e,this._stateChanges=$.w.EMPTY;const i=Number(n);this.tabIndex=i||0===i?i:null}get disabled(){return void 0===this._disabled&&this.datepicker?this.datepicker.disabled:!!this._disabled}set disabled(t){this._disabled=(0,b.Ig)(t)}ngOnChanges(t){t.datepicker&&this._watchStateChanges()}ngOnDestroy(){this._stateChanges.unsubscribe()}ngAfterContentInit(){this._watchStateChanges()}_open(t){this.datepicker&&!this.disabled&&(this.datepicker.open(),t.stopPropagation())}_watchStateChanges(){const t=this.datepicker?this.datepicker.stateChanges:(0,B.of)(),e=this.datepicker&&this.datepicker.datepickerInput?this.datepicker.datepickerInput.stateChanges:(0,B.of)(),n=this.datepicker?(0,V.T)(this.datepicker.openedStream,this.datepicker.closedStream):(0,B.of)();this._stateChanges.unsubscribe(),this._stateChanges=(0,V.T)(this._intl.changes,t,e,n).subscribe(()=>this._changeDetectorRef.markForCheck())}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(mt),o.Y36(o.sBO),o.$8M("tabindex"))},t.\u0275cmp=o.Xpm({type:t,selectors:[["mat-datepicker-toggle"]],contentQueries:function(t,e,n){if(1&t&&o.Suo(n,jt,5),2&t){let t;o.iGM(t=o.CRH())&&(e._customIcon=t.first)}},viewQuery:function(t,e){if(1&t&&o.Gf(ut,5),2&t){let t;o.iGM(t=o.CRH())&&(e._button=t.first)}},hostAttrs:[1,"mat-datepicker-toggle"],hostVars:8,hostBindings:function(t,e){1&t&&o.NdJ("click",function(t){return e._open(t)}),2&t&&(o.uIk("tabindex",null)("data-mat-calendar",e.datepicker?e.datepicker.id:null),o.ekj("mat-datepicker-toggle-active",e.datepicker&&e.datepicker.opened)("mat-accent",e.datepicker&&"accent"===e.datepicker.color)("mat-warn",e.datepicker&&"warn"===e.datepicker.color))},inputs:{tabIndex:"tabIndex",disabled:"disabled",datepicker:["for","datepicker"],ariaLabel:["aria-label","ariaLabel"],disableRipple:"disableRipple"},exportAs:["matDatepickerToggle"],features:[o.TTD],ngContentSelectors:ht,decls:4,vars:6,consts:[["mat-icon-button","","type","button",3,"disabled","disableRipple"],["button",""],["class","mat-datepicker-toggle-default-icon","viewBox","0 0 24 24","width","24px","height","24px","fill","currentColor","focusable","false",4,"ngIf"],["viewBox","0 0 24 24","width","24px","height","24px","fill","currentColor","focusable","false",1,"mat-datepicker-toggle-default-icon"],["d","M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"]],template:function(t,e){1&t&&(o.F$t(gt),o.TgZ(0,"button",0,1),o.YNc(2,pt,2,0,"svg",2),o.Hsn(3),o.qZA()),2&t&&(o.Q6J("disabled",e.disabled)("disableRipple",e.disableRipple),o.uIk("aria-haspopup",e.datepicker?"dialog":null)("aria-label",e.ariaLabel||e._intl.openCalendarLabel)("tabindex",e.disabled?-1:e.tabIndex),o.xp6(2),o.Q6J("ngIf",!e._customIcon))},directives:[p.lW,i.O5],styles:[".mat-form-field-appearance-legacy .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-datepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-datepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-datepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-datepicker-toggle-default-icon{margin:auto}.cdk-high-contrast-active .mat-datepicker-toggle-default-icon{color:CanvasText}\n"],encapsulation:2,changeDetection:0}),t})(),Wt=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({providers:[mt,Yt],imports:[[i.ez,p.ot,m.Is,F.U8,L.rt,E.eL,Z.BQ],R.ZD]}),t})();var Kt=n(6489);const te={admin:{tagTypes:[{name:"custom"}],pages:[]}};var ee=n(60214);let ne=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[i.ez,p.ot,P.Ps]]}),t})();var ie=n(69244),ae=n(14926),oe=n(88195),se=n(86655),re=n(35944),le=n(40450);let ce=(()=>{class t{constructor(t){this.settings=t,this.menu=this.generateMenu()}ngOnInit(){this.menu=this.generateMenu()}getCustomSidebarItems(){return this.settings.get("vebto.admin.pages")}generateMenu(){const t=[{name:"analytics",icon:"pie-chart",permission:"reports.view",route:"analytics"},{name:"appearance",icon:"style",permission:"resources.defaults.permissions.update",route:"appearance"},{name:"settings",icon:"settings",permission:"settings.view",route:"settings"},{name:"plans",icon:"assignment",permission:"plans.view",route:"plans"},{name:"subscriptions",icon:"subscriptions",permission:"subscriptions.view",route:"subscriptions"},...this.getCustomSidebarItems(),{name:"users",icon:"person",permission:"users.view",route:"users"},{name:"roles",icon:"people",permission:"roles.view",route:"roles"},{name:"pages",icon:"page",permission:"pages.view",route:"custom-pages"},{name:"tags",icon:"local-offer",permission:"tags.view",route:"tags"},{name:"files",icon:"file",permission:"files.view",route:"files"},{name:"translations",icon:"translate",permission:"localizations.view",route:"translations"}];return this.settings.get("vebto.admin.ads")&&t.push({name:"ads",icon:"ads",permission:"settings.view",route:"ads"}),t.map(t=>(t.type="route",t.label=t.name,t.action="admin/"+t.route,t.activeExact=!1,t.condition=function(e,n){let i=!0;return"plans"!==t.name&&"subscriptions"!==t.name||(i=n.get("billing.enable")),i&&e.hasPermission(t.permission)},t))}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(oe.Z))},t.\u0275cmp=o.Xpm({type:t,selectors:[["admin"]],viewQuery:function(t,e){if(1&t&&o.Gf(ae._,7),2&t){let t;o.iGM(t=o.CRH())&&(e.sidenav=t.first)}},decls:11,vars:10,consts:[["menuPosition","admin-navbar","color","primary",3,"showToggleButton","toggleButtonClick"],[3,"position","vertical","compact"],[1,"version"],[1,"content-inner"]],template:function(t,e){1&t&&(o.TgZ(0,"material-navbar",0),o.NdJ("toggleButtonClick",function(){return e.sidenav.toggleSidebarMode()}),o.qZA(),o.TgZ(1,"sidenav"),o.TgZ(2,"nav"),o._UZ(3,"custom-menu",1),o.ALo(4,"async"),o.TgZ(5,"div",2),o._uU(6),o.ALo(7,"trans"),o.qZA(),o.qZA(),o.TgZ(8,"main"),o.TgZ(9,"div",3),o._UZ(10,"router-outlet"),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.Q6J("showToggleButton",!0),o.xp6(3),o.Q6J("position",e.menu)("vertical",!0)("compact",o.lcZ(4,6,e.sidenav.isCompact$)),o.xp6(3),o.AsE("",o.lcZ(7,8,"Version:")," ",e.settings.get("version"),""))},directives:[se.e,ae._,re.K,r.lC],pipes:[i.Ov,le.R],styles:["[_nghost-%COMP%]{display:block}material-navbar[_ngcontent-%COMP%]{position:fixed;top:0;left:0}.nav-searchbar[_ngcontent-%COMP%]{display:block;flex:1 1 auto}.version[_ngcontent-%COMP%]{padding:5px 8px;font-size:1.3rem;margin-top:auto}.content-inner[_ngcontent-%COMP%]{padding:25px}@media only screen and (max-width:768px){.content-inner[_ngcontent-%COMP%]{padding:10px}}"],changeDetection:0}),t})();var de=n(87446),ue=n(3162),pe=n(32656),ge=n(92890),he=n(4886),me=n(45905),fe=n(80773),be=n(71453),ve=n(75950),_e=n(45362),Ze=n(11520);function xe(t,e=""){let n=Object.keys(t)[0];if(n){e&&(n=`${e}-${n}`);const t=document.getElementById(n);t&&t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}}var ye=n(73234),Ae=n(24859),we=n(52370),ke=n(25051),Te=n(53319);let Ce=(()=>{class t{constructor(t,e,n,i,a,o,s,r,l,c,d){this.settings=t,this.toast=e,this.http=n,this.modal=i,this.route=a,this.customHomepage=o,this.valueLists=s,this.cd=r,this.router=l,this.social=c,this.state=d}ngOnDestroy(){this.state.reset()}setJson(t,e){this.state.client[t]=JSON.stringify(e)}getJson(t){const e=this.state.client[t];return e?JSON.parse(e):[]}saveSettings(t){this.state.loading$.next(!0);const e=t||this.state.getModified();this.settings.save(e).pipe((0,Ze.x)(()=>this.state.loading$.next(!1))).subscribe(()=>{this.toast.open("Settings saved."),this.clearErrors(),this.state.updateInitial(e)},t=>{this.state.errors$.next(t.errors),xe(this.state.errors$.value)})}clearErrors(){this.state.errors$.next({})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(oe.Z),o.Y36(ye.F),o.Y36(s.r),o.Y36(Ae.u),o.Y36(r.gz),o.Y36(we.Y),o.Y36(ke.l),o.Y36(o.sBO),o.Y36(r.F0),o.Y36(Te.x),o.Y36(d))},t.\u0275dir=o.lG2({type:t}),t})();var qe=n(38116);function Ue(t,e){if(1&t&&(o.TgZ(0,"p",73),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.safebrowsing_group)}}function Ie(t,e){if(1&t&&(o.TgZ(0,"p",73),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.phishtank_group)}}function Me(t,e){if(1&t&&(o.TgZ(0,"option",66),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.host),o.xp6(1),o.hij(" ",t.host," ")}}function Oe(t,e){1&t&&o._UZ(0,"mat-progress-bar",74)}function Je(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4),o.NdJ("ngSubmit",function(){return o.CHM(t),o.oxw().saveSettings()}),o.TgZ(1,"mat-tab-group",5),o.TgZ(2,"mat-tab",6),o.ALo(3,"trans"),o.TgZ(4,"div",7),o.TgZ(5,"div",8),o.TgZ(6,"div",9),o.TgZ(7,"mat-slide-toggle",10),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.enable_type"]=e}),o._uU(8,"Type Selection"),o.qZA(),o.TgZ(9,"p",11),o._uU(10,"Whether user should be able to change type when creating or updating links."),o.qZA(),o.qZA(),o.TgZ(11,"div",12),o.TgZ(12,"label",13),o._uU(13,"Default Link Type"),o.qZA(),o.TgZ(14,"select",14),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.default_type"]=e}),o.TgZ(15,"option",15),o._uU(16,"Direct"),o.qZA(),o.TgZ(17,"option",16),o._uU(18,"Frame"),o.qZA(),o.TgZ(19,"option",17),o._uU(20,"Splash"),o.qZA(),o.qZA(),o.TgZ(21,"p",11),o._uU(22," What type should newly created links have by default (If user did not manually select type). "),o.qZA(),o.qZA(),o.TgZ(23,"div",18),o.TgZ(24,"div",12),o.TgZ(25,"label",19),o._uU(26,"Link Min Length"),o.qZA(),o.TgZ(27,"input",20),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.min_len"]=e}),o.qZA(),o.qZA(),o.TgZ(28,"div",12),o.TgZ(29,"label",21),o._uU(30,"Link Max Length"),o.qZA(),o.TgZ(31,"input",22),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.max_len"]=e}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(32,"p",23),o._uU(33," Specify minimum and maximum length for urls that users will be able to shorten. "),o.qZA(),o.TgZ(34,"div",18),o.TgZ(35,"div",12),o.TgZ(36,"label",24),o._uU(37,"Alias Min Length"),o.qZA(),o.TgZ(38,"input",25),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.alias_min"]=e}),o.qZA(),o.qZA(),o.TgZ(39,"div",12),o.TgZ(40,"label",26),o._uU(41,"Alias Max Length"),o.qZA(),o.TgZ(42,"input",27),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.alias_max"]=e}),o.qZA(),o.qZA(),o.TgZ(43,"div",12),o.TgZ(44,"label",28),o._uU(45,"Alias Content"),o.qZA(),o.TgZ(46,"select",29),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.alias_content"]=e}),o.TgZ(47,"option",30),o._uU(48,"Numbers, letters, underscore and dash"),o.qZA(),o.TgZ(49,"option",31),o._uU(50,"Numbers or letters"),o.qZA(),o.TgZ(51,"option",32),o._uU(52,"Letters only"),o.qZA(),o.TgZ(53,"option",33),o._uU(54,"Numbers only"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(55,"p",23),o._uU(56," Specify minimum and maximum length as well as what characters link alias are allowed to contain. "),o.qZA(),o.qZA(),o.TgZ(57,"div",34),o.TgZ(58,"div",9),o.TgZ(59,"mat-slide-toggle",35),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.retargeting"]=e}),o._uU(60,"Enable Link Retargeting"),o.qZA(),o.TgZ(61,"p",11),o._uU(62,"Whether redirection based on location, device or platform is enabled."),o.qZA(),o.qZA(),o.TgZ(63,"div",9),o.TgZ(64,"mat-slide-toggle",36),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.pixels"]=e}),o._uU(65,"Enable Tracking Pixels"),o.qZA(),o.TgZ(66,"p",11),o._uU(67,"Whether user should be able to apply tracking pixels to links."),o.qZA(),o.qZA(),o.TgZ(68,"div",12),o.TgZ(69,"label",37),o._uU(70,"Splash Page Redirect Time"),o.qZA(),o.TgZ(71,"input",38),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.redirect_time"]=e}),o.qZA(),o.TgZ(72,"p",11),o._uU(73," After how many seconds should user be redirect to their destination on splash page. In Seconds. 0 will disable automatic redirection. "),o.qZA(),o.qZA(),o.qZA(),o.TgZ(74,"div",34),o.TgZ(75,"div",9),o.TgZ(76,"mat-slide-toggle",39),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.homepage_creation"]=e}),o._uU(77,"Homepage Link Creation"),o.qZA(),o.TgZ(78,"p",11),o._uU(79,"Whether non-logged in users can shorten links on homepage."),o.qZA(),o.qZA(),o.TgZ(80,"div",9),o.TgZ(81,"div",12),o.TgZ(82,"label",40),o._uU(83,"Expire links created from homepage"),o.qZA(),o.TgZ(84,"select",41),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.home_expiration"]=e}),o.TgZ(85,"option",42),o._uU(86,"Never"),o.qZA(),o.TgZ(87,"option",43),o._uU(88,"After one day"),o.qZA(),o.TgZ(89,"option",44),o._uU(90,"After three days"),o.qZA(),o.TgZ(91,"option",45),o._uU(92,"After a week"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(93,"div",9),o.TgZ(94,"mat-slide-toggle",46),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.homepage_stats"]=e}),o._uU(95,"Show Homepage Stats"),o.qZA(),o.TgZ(96,"p",11),o._uU(97," Whether statistics about about number of links, clicks and users should be displayed on homepage. "),o.qZA(),o.TgZ(98,"mat-slide-toggle",47),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.dash_footer"]=e}),o._uU(99,"Show Footer in Dashboard"),o.qZA(),o.qZA(),o.TgZ(100,"div",12),o.TgZ(101,"label",48),o._uU(102,"Google Maps Javascript API Key"),o.qZA(),o.TgZ(103,"input",49),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.gchart_api_key"]=e}),o.qZA(),o.TgZ(104,"p",11),o._uU(105,"Required in order to show world geochart on link and group report pages."),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(106,"mat-tab",6),o.ALo(107,"trans"),o.TgZ(108,"div",50),o.TgZ(109,"div",51),o.TgZ(110,"div",12),o.TgZ(111,"label",52),o._uU(112,"Blacklist Keywords"),o.qZA(),o.TgZ(113,"textarea",53),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.blacklist.keywords"]=e}),o.qZA(),o.TgZ(114,"p",11),o._uU(115," Comma separated list of keywords. User will not be able to shorten any URLs that contain specified keywords. "),o.qZA(),o.qZA(),o.TgZ(116,"div",12),o.TgZ(117,"label",54),o._uU(118,"Blacklist Domains"),o.qZA(),o.TgZ(119,"textarea",55),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.blacklist.domains"]=e}),o.qZA(),o.TgZ(120,"p",11),o._uU(121," Comma separated domain list (domain1.com, domain2.com etc.). User will not be able to shorten any URLs from specified domains. "),o.qZA(),o.qZA(),o.qZA(),o.TgZ(122,"div",56),o.TgZ(123,"label",57),o._uU(124,"Google Safe Browsing API Key"),o.qZA(),o.TgZ(125,"input",58),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.google_safe_browsing_key"]=e}),o.qZA(),o.TgZ(126,"p",11),o._uU(127," Entering this API key will prevent urls that are considered unsafe by google from being shortened. "),o.qZA(),o.YNc(128,Ue,2,1,"p",59),o.qZA(),o.TgZ(129,"div",60),o.TgZ(130,"label",61),o._uU(131,"Phishtank API Key"),o.qZA(),o.TgZ(132,"input",62),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.phishtank_key"]=e}),o.qZA(),o.TgZ(133,"p",11),o._uU(134," Entering this API key will prevent urls that are considered unsafe by Phishtank from being shortened. "),o.qZA(),o.YNc(135,Ie,2,1,"p",59),o.qZA(),o.qZA(),o.qZA(),o.TgZ(136,"mat-tab",6),o.ALo(137,"trans"),o.TgZ(138,"div",8),o.TgZ(139,"div",63),o.TgZ(140,"label",64),o._uU(141,"Default Domain"),o.qZA(),o.TgZ(142,"select",65),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["custom_domains.default_host"]=e}),o.TgZ(143,"option",66),o._uU(144),o.qZA(),o.YNc(145,Me,2,2,"option",67),o.ALo(146,"async"),o.qZA(),o.TgZ(147,"p",11),o._uU(148,"Which domain should be used by default for links."),o.qZA(),o.qZA(),o.TgZ(149,"div",68),o.TgZ(150,"mat-slide-toggle",69),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["custom_domains.allow_select"]=e}),o._uU(151,"Allow Domain Selection"),o.qZA(),o.TgZ(152,"p",11),o._uU(153,"Allow users to select which domain they want to use for each link."),o.qZA(),o.qZA(),o.TgZ(154,"div",68),o.TgZ(155,"mat-slide-toggle",70),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["links.subdomain_matching"]=e}),o._uU(156,"Subdomain Link Matching"),o.qZA(),o.TgZ(157,"p",11),o._uU(158,' When this is enabled both "linkId.site.com" or "site.com/linkId" short urls will work. '),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(159,"button",71),o.ALo(160,"async"),o._uU(161," Update "),o.qZA(),o.YNc(162,Oe,1,0,"mat-progress-bar",72),o.ALo(163,"async"),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.xp6(2),o.Q6J("label",o.lcZ(3,37,"Behaviour")),o.xp6(5),o.Q6J("ngModel",n.state.client["links.enable_type"]),o.xp6(7),o.Q6J("ngModel",n.state.client["links.default_type"]),o.xp6(13),o.Q6J("ngModel",n.state.client["links.min_len"]),o.xp6(4),o.Q6J("ngModel",n.state.client["links.max_len"]),o.xp6(7),o.Q6J("ngModel",n.state.client["links.alias_min"]),o.xp6(4),o.Q6J("ngModel",n.state.client["links.alias_max"]),o.xp6(4),o.Q6J("ngModel",n.state.client["links.alias_content"]),o.xp6(13),o.Q6J("ngModel",n.state.client["links.retargeting"]),o.xp6(5),o.Q6J("ngModel",n.state.client["links.pixels"]),o.xp6(7),o.Q6J("ngModel",n.state.client["links.redirect_time"]),o.xp6(5),o.Q6J("ngModel",n.state.client["links.homepage_creation"]),o.xp6(8),o.Q6J("ngModel",n.state.client["links.home_expiration"]),o.xp6(1),o.Q6J("ngValue",null),o.xp6(9),o.Q6J("ngModel",n.state.client["links.homepage_stats"]),o.xp6(4),o.Q6J("ngModel",n.state.client["links.dash_footer"]),o.xp6(5),o.Q6J("ngModel",n.state.client["links.gchart_api_key"]),o.xp6(3),o.Q6J("label",o.lcZ(107,39,"Security")),o.xp6(7),o.Q6J("ngModel",n.state.client["links.blacklist.keywords"]),o.xp6(6),o.Q6J("ngModel",n.state.client["links.blacklist.domains"]),o.xp6(3),o.ekj("has-error",t.safebrowsing_group),o.xp6(3),o.Q6J("ngModel",n.state.client["links.google_safe_browsing_key"]),o.xp6(3),o.Q6J("ngIf",t.safebrowsing_group),o.xp6(1),o.ekj("has-error",t.phishtank_group),o.xp6(3),o.Q6J("ngModel",n.state.client["links.phishtank_key"]),o.xp6(3),o.Q6J("ngIf",t.phishtank_group),o.xp6(1),o.Q6J("label",o.lcZ(137,41,"Domains")),o.xp6(6),o.Q6J("ngModel",n.state.client["custom_domains.default_host"]),o.xp6(1),o.Q6J("value",""),o.xp6(1),o.Oqu(n.defaultDomain),o.xp6(1),o.Q6J("ngForOf",o.lcZ(146,43,n.customDomains$)),o.xp6(5),o.Q6J("ngModel",n.state.client["custom_domains.allow_select"]),o.xp6(5),o.Q6J("ngModel",n.state.client["links.subdomain_matching"]),o.xp6(4),o.Q6J("disabled",o.lcZ(160,45,n.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(163,47,n.state.loading$))}}let Pe=(()=>{class t extends Ce{constructor(){super(...arguments),this.customDomains$=new c.X([])}ngOnInit(){this.valueLists.get(["domains"]).subscribe(t=>{this.customDomains$.next(t.domains)}),this.defaultDomain=this.settings.getBaseUrl()}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["link-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body","ngNativeValidate","",3,"ngSubmit",4,"ngIf"],["ngNativeValidate","",1,"body",3,"ngSubmit"],["color","accent","animationDuration","0"],[3,"label"],[1,"many-inputs"],[1,"error-group"],[1,"setting-toggle-container"],["name","links.enable_type","id","links.enable_type","trans","",3,"ngModel","ngModelChange"],["trans",""],[1,"input-container"],["for","links.default_type","trans",""],["name","links.default_type","id","links.default_type",3,"ngModel","ngModelChange"],["value","direct","trans",""],["value","frame","trans",""],["value","splash","trans",""],[1,"inline-inputs-container"],["for","links.min_len","trans",""],["type","number","id","links.min_len","name","links.min_len","min","1","required","",3,"ngModel","ngModelChange"],["for","links.max_len","trans",""],["type","number","id","links.max_len","name","links.max_len","min","1","max","2000","required","",3,"ngModel","ngModelChange"],["trans","",1,"inline-inputs-description"],["for","links.alias_min","trans",""],["type","number","id","links.alias_min","name","links.alias_min","min","1","required","",3,"ngModel","ngModelChange"],["for","links.alias_max","trans",""],["type","number","id","links.alias_max","name","links.alias_max","min","1","max","50","required","",3,"ngModel","ngModelChange"],["for","links.alias_content"],["id","links.alias_content","name","links.alias_content",3,"ngModel","ngModelChange"],["value","alpha_dash","trans",""],["value","alpha_num","trans",""],["value","alpha","trans",""],["value","numeric","trans",""],[1,"error-group","no-border-top"],["name","links.retargeting","id","links.retargeting","trans","",3,"ngModel","ngModelChange"],["name","links.pixels","id","links.pixels","trans","",3,"ngModel","ngModelChange"],["for","links.redirect_time","trans",""],["type","number","name","links.redirect_time","id","links.redirect_time","min","0","max","60",3,"ngModel","ngModelChange"],["name","links.homepage_creation","id","links.homepage_creation","trans","",3,"ngModel","ngModelChange"],["for","links.home_expiration"],["name","links.home_expiration","id","links.home_expiration","trans","",3,"ngModel","ngModelChange"],["trans","",3,"ngValue"],["value","1day"],["value","3days"],["value","7days"],["name","links.homepage_stats","id","links.homepage_stats","trans","",3,"ngModel","ngModelChange"],["name","links.dash_footer","id","links.dash_footer","trans","",3,"ngModel","ngModelChange"],["for","links.gchart_api_key","trans",""],["type","text","name","links.gchart_api_key","id","links.gchart_api_key",3,"ngModel","ngModelChange"],[1,"many-inputs","security-tab"],[1,"error-group","many-inputs"],["for","links.blacklist.keywords","trans",""],["name","links.blacklist.keywords","id","links.blacklist.keywords",3,"ngModel","ngModelChange"],["for","links.blacklist.domains","trans",""],["name","links.blacklist.domains","id","links.blacklist.domains",3,"ngModel","ngModelChange"],["id","safebrowsing_group",1,"input-container"],["for","links.google_safe_browsing_key","trans",""],["type","text","name","links.google_safe_browsing_key","id","links.google_safe_browsing_key",3,"ngModel","ngModelChange"],["class","error",4,"ngIf"],["id","phishtank_group",1,"input-container"],["for","links.phishtank_key","trans",""],["type","text","name","links.phishtank_key","id","links.phishtank_key",3,"ngModel","ngModelChange"],[1,"input-container","default-domain-input-container"],["for","custom-domains-default-host","trans",""],["id","custom-domains-default-host","name","custom-domains-default-host",3,"ngModel","ngModelChange"],[3,"value"],[3,"value",4,"ngFor","ngForOf"],[1,"setting-toggle-container","margin-top"],["id","custom-domains-allow-select","name","custom-domains-allow-select","trans","",3,"ngModel","ngModelChange"],["id","subdomain-link-match","name","subdomain-link-match","trans","",3,"ngModel","ngModelChange"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"error"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Links"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure various link behaviour across the site."),o.qZA(),o.qZA(),o.YNc(5,Je,164,49,"form",3),o.ALo(6,"async")),2&t&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,e.state.errors$)))},directives:[qe.P,i.O5,a.JL,a.F,O.SP,O.uX,T.Rr,a.JJ,a.On,a.EJ,a.YN,a.Kr,a.qQ,a.wV,a.Fj,a.Q7,a.Fd,i.sg,p.lW,k.pW],pipes:[i.Ov,le.R],styles:[".error-group[_ngcontent-%COMP%]:first-of-type{border-top:none}.default-domain-input-container[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{text-transform:none}.inline-inputs-description[_ngcontent-%COMP%]{color:var(--be-secondary-text);font-size:13px;margin-bottom:25px}"],changeDetection:0}),t})();var Ne=n(34384),Se=n(8889),De=n(20237),Qe=n(4512),Ye=n(38193);const Le=[{path:"links",component:pe.g},{path:"links/:linkId",resolve:{api:ge.F},component:he.G},{path:"biolinks",component:Qe.o},{path:"biolinks/:linkId/edit",component:Ye.w,data:{name:"Edit Bio Link"}},{path:"biolinks/:biolinkId/analytics",component:fe.x,data:{name:"Biolink Statistics"}},{path:"link-groups",component:me.o,data:{name:"Link Groups"}},{path:"link-groups/:groupId/links",component:Se.Z},{path:"link-groups/:groupId/analytics",component:fe.x,data:{name:"Link Group Statistics"}},{path:"custom-domains",component:be.T},{path:"link-overlays",component:ve.m},{path:"link-overlays/new",component:Ne.O,canDeactivate:[De.w]},{path:"link-overlays/edit/:id",component:Ne.O,canDeactivate:[De.w]},{path:"pixels",component:_e.V}],Fe=[{path:"links",component:Pe}];var Ee=n(71294);function Re(t,e){if(1&t&&(o.TgZ(0,"a",19),o.TgZ(1,"div",5),o._uU(2),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.Q6J("routerLink",t.path),o.xp6(2),o.Oqu(t.path.replace("-"," "))}}function $e(t,e){1&t&&(o.TgZ(0,"a",20),o.TgZ(1,"div",5),o._uU(2,"Billing"),o.qZA(),o.qZA())}const Ve=function(){return{panel:"menus"}},Be=function(){return{panel:"seo-settings"}},He=function(){return{panel:"themes"}};function ze(t,e){if(1&t&&(o.TgZ(0,"a",4),o.TgZ(1,"div",5),o._uU(2,"General"),o.qZA(),o.qZA(),o.YNc(3,Re,3,2,"a",6),o.YNc(4,$e,3,0,"a",7),o.TgZ(5,"a",8),o.TgZ(6,"div",5),o._uU(7,"Localization"),o.qZA(),o.qZA(),o.TgZ(8,"a",9),o.TgZ(9,"div",5),o._uU(10,"Authentication"),o.qZA(),o.qZA(),o.TgZ(11,"a",10),o.TgZ(12,"div",5),o._uU(13,"Uploading"),o.qZA(),o.qZA(),o.TgZ(14,"a",11),o.TgZ(15,"div",5),o._uU(16,"Mail"),o.qZA(),o.qZA(),o.TgZ(17,"a",12),o.TgZ(18,"div",5),o._uU(19,"Cache"),o.qZA(),o.qZA(),o.TgZ(20,"a",13),o.TgZ(21,"div",5),o._uU(22,"Analytics"),o.qZA(),o.qZA(),o.TgZ(23,"a",14),o.TgZ(24,"div",5),o._uU(25,"Logging"),o.qZA(),o.qZA(),o.TgZ(26,"a",15),o.TgZ(27,"div",5),o._uU(28,"Queue"),o.qZA(),o.qZA(),o.TgZ(29,"a",16),o.TgZ(30,"div",5),o._uU(31,"Recaptcha"),o.qZA(),o.qZA(),o.TgZ(32,"a",17),o.TgZ(33,"div",5),o._uU(34,"GDPR"),o.qZA(),o.qZA(),o.TgZ(35,"a",18),o.TgZ(36,"div",5),o._uU(37,"Menus"),o.qZA(),o.qZA(),o.TgZ(38,"a",18),o.TgZ(39,"div",5),o._uU(40,"Seo"),o.qZA(),o.qZA(),o.TgZ(41,"a",18),o.TgZ(42,"div",5),o._uU(43,"Themes"),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(3),o.Q6J("ngForOf",t.appRoutes()),o.xp6(1),o.Q6J("ngIf",t.settings.get("billing.integrated")),o.xp6(31),o.Q6J("queryParams",o.DdM(5,Ve)),o.xp6(3),o.Q6J("queryParams",o.DdM(6,Be)),o.xp6(3),o.Q6J("queryParams",o.DdM(7,He))}}function Ge(t,e){1&t&&o.GkF(0)}function je(t,e){if(1&t&&(o.ynx(0),o.TgZ(1,"button",21),o.TgZ(2,"span",5),o._uU(3),o.ALo(4,"async"),o.qZA(),o._UZ(5,"mat-icon",22),o.qZA(),o.TgZ(6,"mat-menu",23,24),o.YNc(8,Ge,1,0,"ng-container",25),o.qZA(),o.BQk()),2&t){const t=o.MAs(7),e=o.oxw(),n=o.MAs(1);o.xp6(1),o.Q6J("matMenuTriggerFor",t),o.xp6(2),o.Oqu(o.lcZ(4,3,e.activePanel$)),o.xp6(5),o.Q6J("ngTemplateOutlet",n)}}function Xe(t,e){1&t&&o.GkF(0)}function We(t,e){if(1&t&&(o.TgZ(0,"aside",26),o.YNc(1,Xe,1,0,"ng-container",25),o.qZA()),2&t){o.oxw();const t=o.MAs(1);o.xp6(1),o.Q6J("ngTemplateOutlet",t)}}let Ke=(()=>{class t{constructor(t,e,n,i,a){this.settings=t,this.route=e,this.router=n,this.state=i,this.breakpoints=a,this.activePanel$=new c.X(this.route.firstChild.routeConfig.path)}ngOnInit(){this.route.data.subscribe(t=>{this.state.setAll(t.settings)}),this.router.events.pipe((0,j.h)(t=>t instanceof r.m2)).subscribe(()=>{this.activePanel$.next(this.route.firstChild.routeConfig.path)})}appRoutes(){return Fe}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(oe.Z),o.Y36(r.gz),o.Y36(r.F0),o.Y36(d),o.Y36(Ee.S))},t.\u0275cmp=o.Xpm({type:t,selectors:[["settings"]],decls:8,vars:4,consts:[["navItems",""],[4,"ngIf","ngIfElse"],["desktopNav",""],[1,"settings-panels-container"],["mat-menu-item","","routerLink","general","routerLinkActive","selected",1,"nav-item"],["trans","",1,"name"],["class","nav-item","mat-menu-item","","routerLinkActive","selected",3,"routerLink",4,"ngFor","ngForOf"],["class","nav-item","mat-menu-item","","routerLink","billing","routerLinkActive","selected",4,"ngIf"],["mat-menu-item","","routerLink","localization","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","authentication","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","uploading","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","mail","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","cache","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","analytics","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","logging","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","queue","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","recaptcha","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","gdpr","routerLinkActive","selected",1,"nav-item"],["mat-menu-item","","routerLink","/admin/appearance","routerLinkActive","selected",1,"nav-item",3,"queryParams"],["mat-menu-item","","routerLinkActive","selected",1,"nav-item",3,"routerLink"],["mat-menu-item","","routerLink","billing","routerLinkActive","selected",1,"nav-item"],[1,"no-style","admin-pill-nav-mobile-selector",3,"matMenuTriggerFor"],["svgIcon","keyboard-arrow-down"],[1,"admin-pill-nav-menu"],["navMenu","matMenu"],[4,"ngTemplateOutlet"],[1,"admin-pill-nav","rounded"]],template:function(t,e){if(1&t&&(o.YNc(0,ze,44,8,"ng-template",null,0,o.W1O),o.YNc(2,je,9,5,"ng-container",1),o.ALo(3,"async"),o.YNc(4,We,2,1,"ng-template",null,2,o.W1O),o.TgZ(6,"div",3),o._UZ(7,"router-outlet"),o.qZA()),2&t){const t=o.MAs(5);o.xp6(2),o.Q6J("ngIf",o.lcZ(3,2,e.breakpoints.isMobile$))("ngIfElse",t)}},directives:[i.O5,r.lC,r.yS,w.OP,r.Od,qe.P,i.sg,w.p6,P.Hw,w.VK,i.tP],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:flex}@media only screen and (max-width:768px){[_nghost-%COMP%]{display:block}}.settings-panels-container[_ngcontent-%COMP%]{flex:1 1 auto}.admin-pill-nav-mobile-selector[_ngcontent-%COMP%]{margin-bottom:20px}"],changeDetection:0}),t})();const tn=function(t,e){return{baseUrl:t,currentUrl:e}};function en(t,e){if(1&t&&(o.TgZ(0,"p",33),o.TgZ(1,"span",34),o._uU(2,'Base site url is set as ":baseUrl" in configuration, but current url is ":currentUrl". It\'s recommended to set the primary url you want to use in configuration file and then redirect all other url versions to this primary version via cpanel or .htaccess file.'),o.qZA(),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("transValues",o.WLB(1,tn,t.state.server.app_url,t.state.server.newAppUrl))}}function nn(t,e){1&t&&(o.TgZ(0,"a",35),o._uU(1,"Learn more. "),o.qZA())}function an(t,e){if(1&t&&(o.TgZ(0,"option",36),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.name),o.xp6(1),o.hij(" ",t.name," ")}}function on(t,e){if(1&t&&(o.TgZ(0,"option",36),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.model_id),o.xp6(1),o.hij(" ",t.label," ")}}function sn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",4),o.TgZ(1,"label",37),o._uU(2),o.qZA(),o.TgZ(3,"select",38),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.client["homepage.value"]=e}),o.YNc(4,on,2,2,"option",17),o.qZA(),o.qZA()}if(2&t){const t=o.oxw().$implicit,e=o.oxw();o.xp6(1),o.Q6J("for",t.name),o.xp6(1),o.Oqu(t.name),o.xp6(1),o.Q6J("id",t.name)("name",t.name)("ngModel",e.state.client["homepage.value"]),o.xp6(1),o.Q6J("ngForOf",t.items)}}function rn(t,e){if(1&t&&(o.ynx(0),o.YNc(1,sn,5,6,"div",20),o.BQk()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(1),o.Q6J("ngIf",n.state.client["homepage.type"]===t.name)}}function ln(t,e){if(1&t&&(o.TgZ(0,"option",42),o._uU(1),o.qZA()),2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("ngValue",t.name),o.xp6(1),o.hij(" ",n.getDisplayName(t)," ")}}function cn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",4),o.TgZ(1,"label",39),o._uU(2,"Application Page"),o.qZA(),o.TgZ(3,"select",40),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["homepage.value"]=e}),o.YNc(4,ln,2,2,"option",41),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(3),o.Q6J("ngModel",t.state.client["homepage.value"]),o.xp6(1),o.Q6J("ngForOf",t.getHomepageComponents())}}function dn(t,e){1&t&&o._UZ(0,"mat-progress-bar",43)}let un=(()=>{class t extends Ce{constructor(){super(...arguments),this.menuItemCategories$=new c.X([]),this.cssThemes=[]}ngOnInit(){this.valueLists.get(["menuItemCategories","themes"]).subscribe(t=>{this.menuItemCategories$.next(t.menuItemCategories),this.cssThemes=t.themes})}getHomepageComponents(){return this.customHomepage.getComponents()}getDisplayName(t){var e;return(null===(e=t.routeConfig)||void 0===e?void 0:e.data)&&t.routeConfig.data.name||t.name.replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())}urlsDontMatch(){return this.state.server.newAppUrl&&this.state.server.newAppUrl!==this.state.server.app_url}createSitemap(){return this.state.loading$.next(!0),this.http.post("sitemap/generate").pipe((0,Ze.x)(()=>this.state.loading$.next(!1))).subscribe(()=>{this.toast.open("Sitemap generated.")})}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["homepage-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:61,vars:26,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["ngNativeValidate","",1,"body","many-inputs",3,"ngSubmit"],[1,"input-container"],["for","app_url","trans",""],["type","text","id","app_url","name","app_url","readonly","readonly","required","",3,"ngModel","ngModelChange"],["class","error",4,"ngIf"],[1,"docs-link"],["svgIcon","link"],["href","https://support.vebto.com/help-center/articles/35/primary-site-url","target","_blank",4,"ngIf"],[1,"error-group","many-inputs"],[1,"inline-inputs-container"],["for","homepage.type","trans",""],["name","homepage.type","id","homepage.type",3,"ngModel","ngModelChange"],["value","default"],["value","component"],[3,"value",4,"ngFor","ngForOf"],["trans",""],[4,"ngFor","ngForOf"],["class","input-container",4,"ngIf"],["for","themes.default_mode","trans",""],["id","themes.default_mode","name","themes.default_mode",3,"ngModel","ngModelChange"],["value","light","trans",""],["value","dark","trans",""],[1,"setting-toggle-container"],["name","themes.user_change","id","themes.user_change","trans","",3,"ngModel","ngModelChange"],[1,"settings-separator"],["type","button","mat-flat-button","","color","accent","trans","",3,"disabled","click"],[1,"sitemap-description"],["target","_blank",3,"href"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"error"],["trans","",3,"transValues"],["href","https://support.vebto.com/help-center/articles/35/primary-site-url","target","_blank"],[3,"value"],["trans","",1,"visually-hidden",3,"for"],[3,"id","name","ngModel","ngModelChange"],["for","homepage.value","trans","",1,"visually-hidden"],["name","homepage.value","id","homepage.value",3,"ngModel","ngModelChange"],["trans","",3,"ngValue",4,"ngFor","ngForOf"],["trans","",3,"ngValue"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"General"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure general site settings."),o.qZA(),o.qZA(),o.TgZ(5,"form",3),o.NdJ("ngSubmit",function(){return e.saveSettings()}),o.TgZ(6,"div",4),o.TgZ(7,"label",5),o._uU(8,"Primary Site Url"),o.qZA(),o.TgZ(9,"input",6),o.NdJ("ngModelChange",function(t){return e.state.server.app_url=t}),o.qZA(),o.YNc(10,en,3,4,"p",7),o.TgZ(11,"p"),o.TgZ(12,"span",8),o._UZ(13,"mat-icon",9),o.YNc(14,nn,2,0,"a",10),o.qZA(),o.qZA(),o.qZA(),o.TgZ(15,"div",11),o.TgZ(16,"div",12),o.TgZ(17,"div",4),o.TgZ(18,"label",13),o._uU(19,"Site Homepage"),o.qZA(),o.TgZ(20,"select",14),o.NdJ("ngModelChange",function(t){return e.state.client["homepage.type"]=t}),o.TgZ(21,"option",15),o._uU(22,"Default"),o.qZA(),o.TgZ(23,"option",16),o._uU(24,"Application Page"),o.qZA(),o.YNc(25,an,2,2,"option",17),o.ALo(26,"async"),o.qZA(),o.TgZ(27,"p",18),o._uU(28,"Type of the homepage."),o.qZA(),o.qZA(),o.YNc(29,rn,2,1,"ng-container",19),o.ALo(30,"async"),o.YNc(31,cn,5,2,"div",20),o.qZA(),o.qZA(),o.TgZ(32,"div",4),o.TgZ(33,"label",21),o._uU(34,"Default Site Theme"),o.qZA(),o.TgZ(35,"select",22),o.NdJ("ngModelChange",function(t){return e.state.client["themes.default_mode"]=t}),o.TgZ(36,"option",23),o._uU(37,"Light"),o.qZA(),o.TgZ(38,"option",24),o._uU(39,"Dark"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(40,"div",25),o.TgZ(41,"mat-slide-toggle",26),o.NdJ("ngModelChange",function(t){return e.state.client["themes.user_change"]=t}),o._uU(42,"Allow Theme Change"),o.qZA(),o.TgZ(43,"p",18),o._uU(44,"Allow user to switch from dark to light mode and vice versa."),o.qZA(),o.qZA(),o._UZ(45,"div",27),o.TgZ(46,"button",28),o.NdJ("click",function(){return e.createSitemap()}),o.ALo(47,"async"),o._uU(48," Generate Sitemap "),o.qZA(),o.TgZ(49,"p",29),o.TgZ(50,"span",18),o._uU(51,"Once generated, sitemap index url will be"),o.qZA(),o._uU(52,": "),o.TgZ(53,"a",30),o._uU(54),o.qZA(),o.qZA(),o._UZ(55,"div",27),o.TgZ(56,"button",31),o.ALo(57,"async"),o._uU(58," Update "),o.qZA(),o.YNc(59,dn,1,0,"mat-progress-bar",32),o.ALo(60,"async"),o.qZA()),2&t&&(o.xp6(6),o.ekj("has-error",e.urlsDontMatch()),o.xp6(3),o.Q6J("ngModel",e.state.server.app_url),o.xp6(1),o.Q6J("ngIf",e.urlsDontMatch()),o.xp6(4),o.Q6J("ngIf",!e.settings.get("site.hide_docs_buttons")),o.xp6(6),o.Q6J("ngModel",e.state.client["homepage.type"]),o.xp6(5),o.Q6J("ngForOf",o.lcZ(26,16,e.menuItemCategories$)),o.xp6(4),o.Q6J("ngForOf",o.lcZ(30,18,e.menuItemCategories$)),o.xp6(2),o.Q6J("ngIf","component"===e.state.client["homepage.type"]),o.xp6(4),o.Q6J("ngModel",e.state.client["themes.default_mode"]),o.xp6(6),o.Q6J("ngModel",e.state.client["themes.user_change"]),o.xp6(5),o.Q6J("disabled",o.lcZ(47,20,e.state.loading$)),o.xp6(7),o.Q6J("href",e.settings.getBaseUrl()+"/storage/sitemaps/sitemap-index.xml",o.LSH),o.xp6(1),o.hij("",e.settings.getBaseUrl(),"/storage/sitemaps/sitemap-index.xml"),o.xp6(2),o.Q6J("disabled",o.lcZ(57,22,e.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(60,24,e.state.loading$)))},directives:[qe.P,a.JL,a.F,a.Fj,a.Q7,a.JJ,a.On,i.O5,P.Hw,a.EJ,a.YN,a.Kr,i.sg,T.Rr,p.lW,k.pW],pipes:[i.Ov],styles:[".sitemap-description[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),t})();function pn(t,e){1&t&&(o.ynx(0),o.TgZ(1,"span",7),o._uU(2,"Outgoing mail method needs to be setup before enabling this setting."),o.qZA(),o._uU(3," "),o.TgZ(4,"a",23),o._uU(5,"Fix now."),o.qZA(),o.BQk())}function gn(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",26),o.TgZ(2,"label",27),o._uU(3,"Envato ID"),o.qZA(),o.TgZ(4,"input",28),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(3).state.server.envato_id=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",26),o.TgZ(6,"label",29),o._uU(7,"Envato Secret"),o.qZA(),o.TgZ(8,"input",30),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(3).state.server.envato_secret=e}),o.qZA(),o.qZA(),o.TgZ(9,"div",26),o.TgZ(10,"label",31),o._uU(11,"Envato Personal Token"),o.qZA(),o.TgZ(12,"input",32),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(3).state.server.envato_personal_token=e}),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(3);o.xp6(4),o.Q6J("ngModel",t.state.server.envato_id),o.xp6(4),o.Q6J("ngModel",t.state.server.envato_secret),o.xp6(4),o.Q6J("ngModel",t.state.server.envato_personal_token)}}function hn(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",24),o.TgZ(2,"mat-slide-toggle",25),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.client["social.envato.enable"]=e}),o._uU(3,"Envato Login"),o.qZA(),o.TgZ(4,"p",7),o._uU(5,"Enable logging into the site via envato."),o.qZA(),o.qZA(),o.YNc(6,gn,13,3,"ng-container",8),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(2),o.Q6J("ngModel",t.state.client["social.envato.enable"]),o.xp6(4),o.Q6J("ngIf",t.state.client["social.envato.enable"])}}function mn(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",26),o.TgZ(2,"label",33),o._uU(3,"Google Client ID"),o.qZA(),o.TgZ(4,"input",34),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.google_id=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",26),o.TgZ(6,"label",35),o._uU(7,"Google Client Secret"),o.qZA(),o.TgZ(8,"input",36),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.google_secret=e}),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(4),o.Q6J("ngModel",t.state.server.google_id),o.xp6(4),o.Q6J("ngModel",t.state.server.google_secret)}}function fn(t,e){if(1&t&&o._UZ(0,"p",37),2&t){const t=o.oxw().ngIf;o.Q6J("innerHTML",t.google_group,o.oJD)}}function bn(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",26),o.TgZ(2,"label",38),o._uU(3,"Facebook App ID"),o.qZA(),o.TgZ(4,"input",39),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.facebook_id=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",26),o.TgZ(6,"label",40),o._uU(7,"Facebook App Secret"),o.qZA(),o.TgZ(8,"input",41),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.facebook_secret=e}),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(4),o.Q6J("ngModel",t.state.server.facebook_id),o.xp6(4),o.Q6J("ngModel",t.state.server.facebook_secret)}}function vn(t,e){if(1&t&&o._UZ(0,"p",37),2&t){const t=o.oxw().ngIf;o.Q6J("innerHTML",t.facebook_group,o.oJD)}}function _n(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",26),o.TgZ(2,"label",42),o._uU(3,"Twitter ID"),o.qZA(),o.TgZ(4,"input",43),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.twitter_id=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",26),o.TgZ(6,"label",44),o._uU(7,"Twitter Secret"),o.qZA(),o.TgZ(8,"input",45),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.twitter_secret=e}),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(4),o.Q6J("ngModel",t.state.server.twitter_id),o.xp6(4),o.Q6J("ngModel",t.state.server.twitter_secret)}}function Zn(t,e){if(1&t&&o._UZ(0,"p",37),2&t){const t=o.oxw().ngIf;o.Q6J("innerHTML",t.twitter_group,o.oJD)}}function xn(t,e){1&t&&o._UZ(0,"mat-progress-bar",46)}function yn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4),o.NdJ("ngSubmit",function(){return o.CHM(t),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"mat-slide-toggle",6),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client.require_email_confirmation=e}),o._uU(3,"Require Email Confirmation"),o.qZA(),o.TgZ(4,"p"),o.TgZ(5,"span",7),o._uU(6,"Require new users to validate their email address before being able to login."),o.qZA(),o._UZ(7,"br"),o.YNc(8,pn,6,0,"ng-container",8),o.qZA(),o.qZA(),o.TgZ(9,"div",5),o.TgZ(10,"mat-slide-toggle",9),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["registration.disable"]=e}),o._uU(11,"Disable Registration"),o.qZA(),o.TgZ(12,"p",7),o._uU(13,"All registration (including social login) will be disabled."),o.qZA(),o.qZA(),o.TgZ(14,"div",5),o.TgZ(15,"mat-slide-toggle",10),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client.single_device_login=e}),o._uU(16,"Single Device Login"),o.qZA(),o.TgZ(17,"p",7),o._uU(18,"Only allow one device to be logged into user account at the same time."),o.qZA(),o.qZA(),o.YNc(19,hn,7,2,"ng-container",8),o.TgZ(20,"div",11),o.TgZ(21,"div",12),o.TgZ(22,"mat-slide-toggle",13),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["social.google.enable"]=e}),o._uU(23,"Google Login"),o.qZA(),o.TgZ(24,"p",7),o._uU(25,"Enable logging into the site via google."),o.qZA(),o.qZA(),o.YNc(26,mn,9,2,"ng-container",8),o.YNc(27,fn,1,1,"p",14),o.qZA(),o.TgZ(28,"div",15),o.TgZ(29,"div",16),o.TgZ(30,"mat-slide-toggle",17),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["social.facebook.enable"]=e}),o._uU(31,"Facebook Login"),o.qZA(),o.TgZ(32,"p",7),o._uU(33,"Enable logging into the site via facebook."),o.qZA(),o.qZA(),o.YNc(34,bn,9,2,"ng-container",8),o.YNc(35,vn,1,1,"p",14),o.qZA(),o.TgZ(36,"div",18),o.TgZ(37,"div",19),o.TgZ(38,"mat-slide-toggle",20),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["social.twitter.enable"]=e}),o._uU(39,"Twitter Login"),o.qZA(),o.TgZ(40,"p",7),o._uU(41,"Enable logging into the site via twitter."),o.qZA(),o.qZA(),o.YNc(42,_n,9,2,"ng-container",8),o.YNc(43,Zn,1,1,"p",14),o.qZA(),o.TgZ(44,"button",21),o.ALo(45,"async"),o._uU(46," Update "),o.qZA(),o.YNc(47,xn,1,0,"mat-progress-bar",22),o.ALo(48,"async"),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.xp6(2),o.Q6J("disabled",!n.state.client.require_email_confirmation&&!n.state.server.mail_setup)("ngModel",n.state.client.require_email_confirmation),o.xp6(6),o.Q6J("ngIf",!n.state.server.mail_setup),o.xp6(2),o.Q6J("ngModel",n.state.client["registration.disable"]),o.xp6(5),o.Q6J("ngModel",n.state.client.single_device_login),o.xp6(4),o.Q6J("ngIf",n.settings.get("envato.enable")),o.xp6(1),o.ekj("has-error",t.google_group),o.xp6(2),o.Q6J("ngModel",n.state.client["social.google.enable"]),o.xp6(4),o.Q6J("ngIf",n.state.client["social.google.enable"]),o.xp6(1),o.Q6J("ngIf",t.google_group),o.xp6(1),o.ekj("has-error",t.facebook_group),o.xp6(2),o.Q6J("ngModel",n.state.client["social.facebook.enable"]),o.xp6(4),o.Q6J("ngIf",n.state.client["social.facebook.enable"]),o.xp6(1),o.Q6J("ngIf",t.facebook_group),o.xp6(1),o.ekj("has-error",t.twitter_group),o.xp6(2),o.Q6J("ngModel",n.state.client["social.twitter.enable"]),o.xp6(4),o.Q6J("ngIf",n.state.client["social.twitter.enable"]),o.xp6(1),o.Q6J("ngIf",t.twitter_group),o.xp6(1),o.Q6J("disabled",o.lcZ(45,23,n.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(48,25,n.state.loading$))}}let An=(()=>{class t extends Ce{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["authentication-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs social-login-container","ngNativeValidate","",3,"ngSubmit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs","social-login-container",3,"ngSubmit"],[1,"setting-toggle-container"],["name","require_email_confirmation","id","require_email_confirmation","trans","",3,"disabled","ngModel","ngModelChange"],["trans",""],[4,"ngIf"],["name","registration.disable","id","registration.disable","trans","",3,"ngModel","ngModelChange"],["name","single_device_login","id","single_device_login","trans","",3,"ngModel","ngModelChange"],["id","google_group",1,"error-group","many-inputs","no-bottom-border"],[1,"setting-toggle-container","google"],["name","social.google.enable","id","social.google.enable","trans","",3,"ngModel","ngModelChange"],["class","error",3,"innerHTML",4,"ngIf"],[1,"error-group","many-inputs","no-bottom-border"],[1,"setting-toggle-container","facebook"],["name","social.facebook.enable","id","social.facebook.enable","trans","",3,"ngModel","ngModelChange"],[1,"error-group","many-inputs"],[1,"setting-toggle-container","twitter"],["name","social.twitter.enable","id","social.twitter.enable","trans","",3,"ngModel","ngModelChange"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["routerLink","/admin/settings/mail","trans",""],[1,"setting-toggle-container","envato"],["name","social.envato.enable","id","social.envato.enable","trans","",3,"ngModel","ngModelChange"],[1,"input-container"],["for","social.envato.id","trans",""],["name","social.envato.id","id","social.envato.id",3,"ngModel","ngModelChange"],["for","social.envato.secret","trans",""],["name","social.envato.secret","id","social.envato.secret",3,"ngModel","ngModelChange"],["for","social.envato.personal_token","trans",""],["name","social.envato.personal_token","id","social.envato.personal_token",3,"ngModel","ngModelChange"],["for","social.google.id","trans",""],["name","social.google.id","id","social.google.id",3,"ngModel","ngModelChange"],["for","social.google.secret","trans",""],["name","social.google.secret","id","social.google.secret",3,"ngModel","ngModelChange"],[1,"error",3,"innerHTML"],["for","social.facebook.id","trans",""],["name","social.facebook.id","id","social.facebook.id",3,"ngModel","ngModelChange"],["for","social.facebook.secret","trans",""],["name","social.facebook.secret","id","social.facebook.secret",3,"ngModel","ngModelChange"],["for","social.twitter.id","trans",""],["name","social.twitter.id","id","social.twitter.id",3,"ngModel","ngModelChange"],["for","social.twitter.secret","trans",""],["name","social.twitter.secret","id","social.twitter.secret",3,"ngModel","ngModelChange"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Authentication"),o.qZA(),o.TgZ(3,"div",2),o._uU(4," Configure registration, social login and related 3rd party integrations. "),o.qZA(),o.qZA(),o.YNc(5,yn,49,27,"form",3),o.ALo(6,"async")),2&t&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,e.state.errors$)))},directives:[qe.P,i.O5,a.JL,a.F,T.Rr,a.JJ,a.On,p.lW,r.yS,a.Fj,k.pW],pipes:[i.Ov],styles:["authentication-settings .twitter .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar{background:#4db5f5}authentication-settings .twitter .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb{background:#1da1f2}authentication-settings .facebook .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar{background:#4c70ba}authentication-settings .facebook .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb,authentication-settings .facebook .pretty-checkbox:checked+label:before{background:#3b5998}authentication-settings .google .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar{background:#dc6e60}authentication-settings .google .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb{background:#d34836}authentication-settings .envato .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar{background:#9bc762}authentication-settings .envato .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb{background:#82b541}"],encapsulation:2,changeDetection:0}),t})();function wn(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",6),o.TgZ(2,"label",21),o._uU(3,"Memcached Host"),o.qZA(),o.TgZ(4,"input",22),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.memcached_host=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",6),o.TgZ(6,"label",23),o._uU(7,"Memcached Port"),o.qZA(),o.TgZ(8,"input",24),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.memcached_port=e}),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(4),o.Q6J("ngModel",t.state.server.memcached_host),o.xp6(4),o.Q6J("ngModel",t.state.server.memcached_port)}}function kn(t,e){if(1&t&&o._UZ(0,"p",25),2&t){const t=o.oxw().ngIf;o.Q6J("innerHTML",t.cache_group,o.oJD)}}function Tn(t,e){1&t&&o._UZ(0,"mat-progress-bar",26)}function Cn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(t),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"label",7),o._uU(4,"Cache Method"),o.qZA(),o.TgZ(5,"select",8),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.server.cache_driver=e})("ngModelChange",function(){return o.CHM(t),o.oxw().clearErrors()}),o.TgZ(6,"option",9),o._uU(7,"File (Default)"),o.qZA(),o.TgZ(8,"option",10),o._uU(9,"None"),o.qZA(),o.TgZ(10,"option",11),o._uU(11,"APC"),o.qZA(),o.TgZ(12,"option",12),o._uU(13,"Memcached"),o.qZA(),o.TgZ(14,"option",13),o._uU(15,"Redis"),o.qZA(),o.qZA(),o.TgZ(16,"p",14),o._uU(17,"Which method should be used for storing and retrieving cached items."),o.qZA(),o.qZA(),o.YNc(18,wn,9,2,"ng-container",15),o.YNc(19,kn,1,1,"p",16),o.qZA(),o.TgZ(20,"button",17),o.NdJ("click",function(){return o.CHM(t),o.oxw().clearCache()}),o._uU(21," Clear Cache "),o.qZA(),o.TgZ(22,"div",18),o.TgZ(23,"div",1),o._uU(24,"Important!"),o.qZA(),o.TgZ(25,"p",14),o._uU(26,' "File" is the best option for most cases and should not be changed, unless you are familiar with another cache method and have it set up on the server already. '),o.qZA(),o.qZA(),o.TgZ(27,"button",19),o.ALo(28,"async"),o._uU(29," Update "),o.qZA(),o.YNc(30,Tn,1,0,"mat-progress-bar",20),o.ALo(31,"async"),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.xp6(1),o.ekj("has-error",t.cache_group),o.xp6(4),o.Q6J("ngModel",n.state.server.cache_driver),o.xp6(13),o.Q6J("ngIf","memcached"===n.state.server.cache_driver),o.xp6(1),o.Q6J("ngIf",t.cache_group),o.xp6(8),o.Q6J("disabled",o.lcZ(28,7,n.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(31,9,n.state.loading$))}}let qn=(()=>{class t extends Ce{clearCache(){this.state.loading$.next(!0),this.http.post("cache/flush").pipe((0,Ze.x)(()=>this.state.loading$.next(!1))).subscribe(()=>{this.toast.open("Cache cleared.")})}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["cache-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["id","cache_group",1,"error-group","many-inputs","no-border-top"],[1,"input-container"],["for","cache.driver","trans",""],["name","cache.driver","id","cache.driver",3,"ngModel","ngModelChange"],["value","file"],["value","array"],["value","apc"],["value","memcached"],["value","redis"],["trans",""],[4,"ngIf"],["class","error",3,"innerHTML",4,"ngIf"],["mat-stroked-button","","color","accent","type","button","trans","",1,"button","flat",3,"click"],[1,"widget","widget-info","widget-important"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["for","cache.memcached_host","trans",""],["name","cache.memcached_host","id","cache.memcached_host","required","",3,"ngModel","ngModelChange"],["for","cache.memcached_port","trans",""],["type","number","name","cache.memcached_port","id","cache.memcached_port","required","",3,"ngModel","ngModelChange"],[1,"error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Cache"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure cache time, method and related 3rd party integrations."),o.qZA(),o.qZA(),o.YNc(5,Cn,32,11,"form",3),o.ALo(6,"async")),2&t&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,e.state.errors$)))},directives:[qe.P,i.O5,a.JL,a.F,a.EJ,a.JJ,a.On,a.YN,a.Kr,p.lW,a.Fj,a.Q7,a.wV,k.pW],pipes:[i.Ov],encapsulation:2,changeDetection:0}),t})();function Un(t,e){if(1&t&&(o.TgZ(0,"p",19),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.certificate)}}function In(t,e){if(1&t&&o._UZ(0,"p",20),2&t){const t=o.oxw().ngIf;o.Q6J("innerHTML",t.analytics_group,o.oJD)}}function Mn(t,e){1&t&&o._UZ(0,"mat-progress-bar",21)}function On(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(t),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"label",7),o._uU(4,"Google Service Account Key File (.json)"),o.qZA(),o.TgZ(5,"input",8,9),o.NdJ("change",function(){o.CHM(t);const e=o.MAs(6);return o.oxw().setCertificateFile(e.files)}),o.qZA(),o.YNc(7,Un,2,1,"p",10),o.qZA(),o.TgZ(8,"div",6),o.TgZ(9,"label",11),o._uU(10,"Google Analytics View ID"),o.qZA(),o.TgZ(11,"input",12),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.server.analytics_view_id=e}),o.qZA(),o.qZA(),o.TgZ(12,"div",6),o.TgZ(13,"label",13),o._uU(14,"Google Analytics Tracking Code"),o.qZA(),o.TgZ(15,"input",14),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["analytics.tracking_code"]=e}),o.qZA(),o.TgZ(16,"p",15),o._uU(17,"Google analytics tracking code only, not the whole javascript code snippet."),o.qZA(),o.qZA(),o.YNc(18,In,1,1,"p",16),o.qZA(),o.TgZ(19,"button",17),o.ALo(20,"async"),o._uU(21," Update "),o.qZA(),o.YNc(22,Mn,1,0,"mat-progress-bar",18),o.ALo(23,"async"),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.xp6(1),o.ekj("has-error",t.analytics_group),o.xp6(1),o.ekj("has-error",t.certificate),o.xp6(5),o.Q6J("ngIf",t.certificate),o.xp6(4),o.Q6J("ngModel",n.state.server.analytics_view_id),o.xp6(4),o.Q6J("ngModel",n.state.client["analytics.tracking_code"]),o.xp6(3),o.Q6J("ngIf",t.analytics_group),o.xp6(1),o.Q6J("disabled",o.lcZ(20,10,n.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(23,12,n.state.loading$))}}let Jn=(()=>{class t extends Ce{saveSettings(t){const e=this.getPayload(t||this.state.getModified());super.saveSettings(e)}getPayload(t){return this.certificateFile&&(t.files={certificate:this.certificateFile}),t}setCertificateFile(t){this.certificateFile=t.item(0)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["analytics-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],[1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["id","analytics_group",1,"error-group","many-inputs","no-spacing"],[1,"input-container"],["for","certificate","trans",""],["type","file","id","certificate","name","certificate","accept",".json",3,"change"],["fileInput",""],["class","error",4,"ngIf"],["for","analytics.view_id","trans",""],["type","number","name","analytics.view_id","id","analytics.view_id",3,"ngModel","ngModelChange"],["for","analytics.tracking_code","trans",""],["name","analytics.tracking_code","id","analytics.tracking_code","min","1","max","20","placeholder","UA-******-2",3,"ngModel","ngModelChange"],["trans",""],["class","error",3,"innerHTML",4,"ngIf"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"error"],[1,"error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Analytics"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure google analytics integration and credentials."),o.qZA(),o.qZA(),o.YNc(5,On,24,14,"form",3),o.ALo(6,"async")),2&t&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,e.state.errors$)))},directives:[qe.P,i.O5,a.JL,a.F,a.wV,a.Fj,a.JJ,a.On,p.lW,k.pW],pipes:[i.Ov],encapsulation:2,changeDetection:0}),t})();var Pn=n(2406);function Nn(t,e){if(1&t&&(o.TgZ(0,"option",22),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.value),o.xp6(1),o.hij(" ",t.text," ")}}function Sn(t,e){if(1&t&&(o.TgZ(0,"optgroup",21),o.YNc(1,Nn,2,2,"option",11),o.qZA()),2&t){const t=e.$implicit;o.Q6J("label",t.key),o.xp6(1),o.Q6J("ngForOf",t.value)}}function Dn(t,e){if(1&t&&(o.TgZ(0,"option",22),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.language),o.xp6(1),o.hij(" ",t.name," ")}}function Qn(t,e){if(1&t&&(o.TgZ(0,"option",22),o._uU(1),o.ALo(2,"formattedDate"),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.Q6J("value",t),o.xp6(1),o.AsE(" ",o.xi3(2,3,n.getCurrentDate(),t)," (",t,") ")}}function Yn(t,e){1&t&&o._UZ(0,"mat-progress-bar",23)}let Ln=(()=>{class t extends Ce{constructor(){super(...arguments),this.selects={timezones:{},localizations:[]},this.defaultDateFormats=["MMMM d, y","yyyy-MM-dd","M/d/y","d/M/y"]}ngOnInit(){const t=this.state.client["dates.format"];this.initialDateFormat=this.defaultDateFormats.includes(t)?t:"custom",this.valueLists.get(["timezones","localizations"]).subscribe(t=>{this.selects=t,this.cd.markForCheck()})}getCurrentDate(){return new Date}updateDateFormat(t){t&&"custom"!==t&&(this.state.client["dates.format"]=t)}selectedDateFormat(){return this.state.client["dates.format"]}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["localization-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:51,vars:28,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],[1,"body","many-inputs",3,"submit"],[1,"input-container"],["for","app.timezone","trans",""],["name","app.timezone","id","app.timezone",3,"ngModel","ngModelChange"],[3,"label",4,"ngFor","ngForOf"],["trans",""],["for","app.locale","trans",""],["name","app.locale","id","app.locale",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["for","dates.format","trans",""],["name","dates.format","id","dates.format","required","",1,"no-capitalize",3,"ngModel","ngModelChange"],["value","custom","trans",""],["for","dates.custom-format","trans",""],["type","text","id","dates.custom-format","name","dates.custom-format","required","",3,"ngModel","ngModelChange"],[1,"setting-toggle-container"],["name","translations","trans","",3,"ngModel","ngModelChange"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[3,"label"],[3,"value"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Localization"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Manage localization settings for the site."),o.qZA(),o.qZA(),o.TgZ(5,"form",3),o.NdJ("submit",function(){return e.saveSettings()}),o.TgZ(6,"div",4),o.TgZ(7,"label",5),o._uU(8,"Timezone"),o.qZA(),o.TgZ(9,"select",6),o.NdJ("ngModelChange",function(t){return e.state.server.app_timezone=t}),o.YNc(10,Sn,2,2,"optgroup",7),o.ALo(11,"keyvalue"),o.qZA(),o.TgZ(12,"p",8),o._uU(13,"Choose either a city in the same timezone as you or a UTC timezone offset."),o.qZA(),o.qZA(),o.TgZ(14,"div",4),o.TgZ(15,"label",9),o._uU(16,"Site Language"),o.qZA(),o.TgZ(17,"select",10),o.NdJ("ngModelChange",function(t){return e.state.server.app_locale=t}),o.YNc(18,Dn,2,2,"option",11),o.qZA(),o.TgZ(19,"p",8),o._uU(20,"Which translation should be selected by default for new users."),o.qZA(),o.qZA(),o.TgZ(21,"div",4),o.TgZ(22,"label",12),o._uU(23,"Date Format"),o.qZA(),o.TgZ(24,"select",13),o.NdJ("ngModelChange",function(t){return e.initialDateFormat=t})("ngModelChange",function(t){return e.updateDateFormat(t)}),o.YNc(25,Qn,3,6,"option",11),o.TgZ(26,"option",14),o._uU(27,"Custom"),o.qZA(),o.qZA(),o.TgZ(28,"p"),o._uU(29),o.ALo(30,"trans"),o._UZ(31,"br"),o._uU(32),o.ALo(33,"trans"),o.TgZ(34,"strong"),o._uU(35),o.ALo(36,"formattedDate"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(37,"div",4),o.TgZ(38,"label",15),o._uU(39,"Custom Date Format"),o.qZA(),o.TgZ(40,"input",16),o.NdJ("ngModelChange",function(t){return e.state.client["dates.format"]=t}),o.qZA(),o.qZA(),o.TgZ(41,"div",17),o.TgZ(42,"mat-slide-toggle",18),o.NdJ("ngModelChange",function(t){return e.state.client["i18n.enable"]=t}),o._uU(43,"Translations"),o.qZA(),o.TgZ(44,"p",8),o._uU(45,"Enable translations functionality for the site."),o.qZA(),o.qZA(),o.TgZ(46,"button",19),o.ALo(47,"async"),o._uU(48," Update "),o.qZA(),o.YNc(49,Yn,1,0,"mat-progress-bar",20),o.ALo(50,"async"),o.qZA()),2&t&&(o.xp6(9),o.Q6J("ngModel",e.state.server.app_timezone),o.xp6(1),o.Q6J("ngForOf",o.lcZ(11,15,e.selects.timezones)),o.xp6(7),o.Q6J("ngModel",e.state.server.app_locale),o.xp6(1),o.Q6J("ngForOf",e.selects.localizations),o.xp6(6),o.Q6J("ngModel",e.initialDateFormat),o.xp6(1),o.Q6J("ngForOf",e.defaultDateFormats),o.xp6(4),o.hij(" ",o.lcZ(30,17,"Default format for dates on the site.")," "),o.xp6(3),o.hij(" ",o.lcZ(33,19,"Preview:")," "),o.xp6(3),o.Oqu(o.xi3(36,21,e.getCurrentDate(),e.selectedDateFormat())),o.xp6(2),o.ekj("hidden","custom"!==e.initialDateFormat),o.xp6(3),o.Q6J("ngModel",e.state.client["dates.format"]),o.xp6(2),o.Q6J("ngModel",e.state.client["i18n.enable"]),o.xp6(4),o.Q6J("disabled",o.lcZ(47,24,e.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(50,26,e.state.loading$)))},directives:[qe.P,a._Y,a.JL,a.F,a.EJ,a.JJ,a.On,i.sg,a.Q7,a.YN,a.Kr,a.Fj,T.Rr,p.lW,i.O5,k.pW],pipes:[i.Nd,le.R,Pn.l,i.Ov],encapsulation:2,changeDetection:0}),t})();function Fn(t,e){1&t&&(o.TgZ(0,"a",42),o._uU(1,"Learn more. "),o.qZA())}function En(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",34),o.TgZ(2,"div",5),o.TgZ(3,"label",35),o._uU(4,"Incoming Mail Method"),o.qZA(),o.TgZ(5,"select",36),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.client["mail.handler"]=e}),o.TgZ(6,"option",37),o._uU(7,"Mailgun"),o.qZA(),o.TgZ(8,"option",38),o._uU(9,"Gmail API"),o.qZA(),o.TgZ(10,"option",39),o._uU(11,"Rest API (Send emails via http API)"),o.qZA(),o.TgZ(12,"option",40),o._uU(13,"Pipe (Pipe emails directly)"),o.qZA(),o.qZA(),o.TgZ(14,"p"),o.TgZ(15,"span",8),o._uU(16,"Which method should be used to handle incoming application emails."),o.qZA(),o.TgZ(17,"span",26),o._UZ(18,"mat-icon",27),o.YNc(19,Fn,2,0,"a",41),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(5),o.Q6J("ngModel",t.state.client["mail.handler"]),o.xp6(14),o.Q6J("ngIf",!t.settings.get("site.hide_docs_buttons"))}}function Rn(t,e){1&t&&(o.TgZ(0,"a",43),o._uU(1,"Learn more. "),o.qZA())}function $n(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",5),o.TgZ(2,"label",44),o._uU(3,"SMTP Host"),o.qZA(),o.TgZ(4,"input",45),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.mail_host=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.TgZ(6,"label",46),o._uU(7,"SMTP Username"),o.qZA(),o.TgZ(8,"input",47),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.mail_username=e}),o.qZA(),o.qZA(),o.TgZ(9,"div",5),o.TgZ(10,"label",48),o._uU(11,"SMTP Password"),o.qZA(),o.TgZ(12,"input",49),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.mail_password=e}),o.qZA(),o.qZA(),o.TgZ(13,"div",5),o.TgZ(14,"label",50),o._uU(15,"SMTP Port"),o.qZA(),o.TgZ(16,"input",51),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.mail_port=e}),o.qZA(),o.qZA(),o.TgZ(17,"div",5),o.TgZ(18,"label",52),o._uU(19,"SMTP Encryption"),o.qZA(),o.TgZ(20,"input",53),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.mail_encryption=e}),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(4),o.Q6J("ngModel",t.state.server.mail_host),o.xp6(4),o.Q6J("ngModel",t.state.server.mail_username),o.xp6(4),o.Q6J("ngModel",t.state.server.mail_password),o.xp6(4),o.Q6J("ngModel",t.state.server.mail_port),o.xp6(4),o.Q6J("ngModel",t.state.server.mail_encryption)}}function Vn(t,e){if(1&t&&(o.TgZ(0,"div",59),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(1),o.Oqu(t.mailgun_domain)}}function Bn(t,e){if(1&t&&(o.TgZ(0,"div",59),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(1),o.Oqu(t.mailgun_secret)}}function Hn(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",5),o.TgZ(2,"label",54),o._uU(3,"Mailgun Domain"),o.qZA(),o.TgZ(4,"input",55),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.mailgun_domain=e}),o.qZA(),o.YNc(5,Vn,2,1,"div",56),o.TgZ(6,"p",8),o._uU(7,"Usually the domain of your site (site.com)"),o.qZA(),o.qZA(),o.TgZ(8,"div",5),o.TgZ(9,"label",57),o._uU(10,"Mailgun API Key"),o.qZA(),o.TgZ(11,"input",58),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.mailgun_secret=e}),o.qZA(),o.YNc(12,Bn,2,1,"div",56),o.TgZ(13,"p",8),o._uU(14,'Should start with "key-"'),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw().ngIf,e=o.oxw();o.xp6(1),o.ekj("has-error",t.mailgun_domain),o.xp6(3),o.Q6J("ngModel",e.state.server.mailgun_domain),o.xp6(1),o.Q6J("ngIf",t.mailgun_domain),o.xp6(3),o.ekj("has-error",t.mailgun_secret),o.xp6(3),o.Q6J("ngModel",e.state.server.mailgun_secret),o.xp6(1),o.Q6J("ngIf",t.mailgun_secret)}}function zn(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",5),o.TgZ(2,"label",60),o._uU(3,"SES Key"),o.qZA(),o.TgZ(4,"input",61),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.ses_key=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.TgZ(6,"label",62),o._uU(7,"SES Secret"),o.qZA(),o.TgZ(8,"input",63),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.ses_secret=e}),o.qZA(),o.qZA(),o.TgZ(9,"div",5),o.TgZ(10,"label",64),o._uU(11,"SES Region"),o.qZA(),o.TgZ(12,"input",65),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.ses_region=e}),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(4),o.Q6J("ngModel",t.state.server.ses_key),o.xp6(4),o.Q6J("ngModel",t.state.server.ses_secret),o.xp6(4),o.Q6J("ngModel",t.state.server.ses_region)}}function Gn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",5),o.TgZ(1,"label",66),o._uU(2,"Sparkpost Secret"),o.qZA(),o.TgZ(3,"input",67),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.sparkpost_secret=e}),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2);o.xp6(3),o.Q6J("ngModel",t.state.server.sparkpost_secret)}}function jn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",5),o.TgZ(1,"label",73),o._uU(2,"Gmail Topic Name"),o.qZA(),o.TgZ(3,"input",74),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(3).state.client["gmail.incoming.topicName"]=e}),o.qZA(),o.TgZ(4,"p",8),o._uU(5,"Google cloud Pub/Sub topic name."),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(3);o.xp6(3),o.Q6J("ngModel",t.state.client["gmail.incoming.topicName"])}}function Xn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",75),o._UZ(1,"img",76),o.TgZ(2,"span",77),o._uU(3),o.qZA(),o.TgZ(4,"button",78),o.NdJ("click",function(){return o.CHM(t),o.oxw(3).connectGmailAccount()}),o._uU(5," Reconnect "),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(3);o.xp6(3),o.hij("Gmail ",t.state.server.connectedGmailAccount,"")}}function Wn(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",79),o.NdJ("click",function(){return o.CHM(t),o.oxw(3).connectGmailAccount()}),o._UZ(1,"img",76),o.TgZ(2,"span",80),o._uU(3,"Connect gmail account"),o.qZA(),o.qZA()}}function Kn(t,e){if(1&t&&(o.TgZ(0,"p",59),o._uU(1),o.qZA()),2&t){const t=e.ngIf;o.xp6(1),o.Oqu(t)}}function ti(t,e){if(1&t&&(o.TgZ(0,"div",68),o.YNc(1,jn,6,1,"div",29),o.TgZ(2,"div",69),o.TgZ(3,"div",70),o._uU(4,"Gmail account:"),o.qZA(),o.YNc(5,Xn,6,1,"div",71),o.YNc(6,Wn,4,0,"button",72),o.YNc(7,Kn,2,1,"p",56),o.ALo(8,"async"),o.qZA(),o.qZA()),2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngIf","gmailApi"===t.state.client["mail.handler"]),o.xp6(4),o.Q6J("ngIf",t.state.server.connectedGmailAccount),o.xp6(1),o.Q6J("ngIf",!t.state.server.connectedGmailAccount),o.xp6(1),o.Q6J("ngIf",o.lcZ(8,4,t.state.errors$).gmail_group)}}function ei(t,e){if(1&t&&o._UZ(0,"p",81),2&t){const t=o.oxw().ngIf;o.Q6J("innerHTML",t.mail_group,o.oJD)}}function ni(t,e){1&t&&o._UZ(0,"mat-progress-bar",82)}const ii=function(t){return{url:t}};function ai(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(t),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"label",6),o._uU(3,"From Address"),o.qZA(),o.TgZ(4,"input",7),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.server.mail_from_address=e}),o.qZA(),o.TgZ(5,"p",8),o._uU(6,"All outgoing application emails will be sent from this email address."),o.qZA(),o.qZA(),o.TgZ(7,"div",5),o.TgZ(8,"label",9),o._uU(9,"Contact Page Address"),o.qZA(),o.TgZ(10,"input",10),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["mail.contact_page_address"]=e}),o.qZA(),o.TgZ(11,"p",11),o._uU(12," Where emails from :url page should be sent to. "),o.qZA(),o.qZA(),o.TgZ(13,"div",5),o.TgZ(14,"label",12),o._uU(15,"From Name"),o.qZA(),o.TgZ(16,"input",13),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.server.mail_from_name=e}),o.qZA(),o.TgZ(17,"p",8),o._uU(18,"All outgoing application emails will be sent using this name."),o.qZA(),o.qZA(),o.TgZ(19,"div",14),o.TgZ(20,"div",1),o._uU(21,"Important!"),o.qZA(),o.TgZ(22,"p",8),o._uU(23," Your selected mail method must be authorized to send emails using this address and name. "),o.qZA(),o.qZA(),o.YNc(24,En,20,2,"ng-container",15),o.TgZ(25,"div",16),o.TgZ(26,"div",5),o.TgZ(27,"label",17),o._uU(28,"Outgoing Mail Method"),o.qZA(),o.TgZ(29,"select",18),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.server.mail_driver=e})("ngModelChange",function(){return o.CHM(t),o.oxw().clearErrors()}),o.TgZ(30,"option",19),o._uU(31,"Mailgun"),o.qZA(),o.TgZ(32,"option",20),o._uU(33,"Gmail Api"),o.qZA(),o.TgZ(34,"option",21),o._uU(35,"SMTP"),o.qZA(),o.TgZ(36,"option",22),o._uU(37,"SparkPost"),o.qZA(),o.TgZ(38,"option",23),o._uU(39,"Ses (Amazon Simple Email Service)"),o.qZA(),o.TgZ(40,"option",24),o._uU(41,"SendMail"),o.qZA(),o.TgZ(42,"option",25),o._uU(43,"Log (Email will be saved to error log)"),o.qZA(),o.qZA(),o.TgZ(44,"p"),o.TgZ(45,"span",8),o._uU(46,"Which method should be used for sending outgoing application emails."),o.qZA(),o.TgZ(47,"span",26),o._UZ(48,"mat-icon",27),o.YNc(49,Rn,2,0,"a",28),o.qZA(),o.qZA(),o.qZA(),o.YNc(50,$n,21,5,"ng-container",15),o.YNc(51,Hn,15,8,"ng-container",15),o.YNc(52,zn,13,3,"ng-container",15),o.YNc(53,Gn,4,1,"div",29),o.YNc(54,ti,9,6,"div",30),o.YNc(55,ei,1,1,"p",31),o.qZA(),o.TgZ(56,"button",32),o.ALo(57,"async"),o._uU(58," Update "),o.qZA(),o.YNc(59,ni,1,0,"mat-progress-bar",33),o.ALo(60,"async"),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.xp6(4),o.Q6J("ngModel",n.state.server.mail_from_address),o.xp6(6),o.Q6J("ngModel",n.state.client["mail.contact_page_address"]),o.xp6(1),o.Q6J("transValues",o.VKq(21,ii,n.settings.getBaseUrl()+"/contact")),o.xp6(5),o.Q6J("ngModel",n.state.server.mail_from_name),o.xp6(8),o.Q6J("ngIf",n.settings.get("vebto.admin.showIncomingMailMethod")),o.xp6(1),o.ekj("has-error",t.mail_group),o.xp6(4),o.Q6J("ngModel",n.state.server.mail_driver),o.xp6(20),o.Q6J("ngIf",!n.settings.get("site.hide_docs_buttons")),o.xp6(1),o.Q6J("ngIf","smtp"===n.state.server.mail_driver),o.xp6(1),o.Q6J("ngIf","mailgun"===n.state.server.mail_driver),o.xp6(1),o.Q6J("ngIf","ses"===n.state.server.mail_driver),o.xp6(1),o.Q6J("ngIf","sparkpost"===n.state.server.mail_driver),o.xp6(1),o.Q6J("ngIf","gmailApi"===n.state.client["mail.handler"]||"gmailApi"===n.state.server.mail_driver),o.xp6(1),o.Q6J("ngIf",t.mail_group),o.xp6(1),o.Q6J("disabled",o.lcZ(57,17,n.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(60,19,n.state.loading$))}}let oi=(()=>{class t extends Ce{connectGmailAccount(){this.social.openNewSocialAuthWindow("secure/settings/mail/gmail/connect").then(t=>{this.state.server.connectedGmailAccount=t.email,this.state.errors$.next({}),this.toast.open(`Connected gmail account: ${t.email}`)})}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["mail-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],[1,"input-container"],["for","env.mail_from_address","trans",""],["type","email","name","env.mail_from_address","id","env.mail_from_address","required","",3,"ngModel","ngModelChange"],["trans",""],["for","mail.contact_page_address","trans",""],["type","email","name","mail.contact_page_address","id","mail.contact_page_address","required","",3,"ngModel","ngModelChange"],["trans","",3,"transValues"],["for","env.mail_from_name","trans",""],["name","env.mail_from_name","id","env.mail_from_name","required","",3,"ngModel","ngModelChange"],[1,"widget","widget-info","widget-important"],[4,"ngIf"],["id","mail_group",1,"error-group","many-inputs"],["for","mail.driver","trans",""],["name","mail.driver","id","mail.driver",3,"ngModel","ngModelChange"],["value","mailgun"],["value","gmailApi"],["value","smtp"],["value","sparkpost"],["value","ses"],["value","sendmail"],["value","log"],[1,"docs-link"],["svgIcon","link"],["href","https://support.vebto.com/help-center/articles/42/44/155/incoming-emails","target","_blank",4,"ngIf"],["class","input-container",4,"ngIf"],["id","gmail_group",4,"ngIf"],["class","error group-error",3,"innerHTML",4,"ngIf"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"error-group","no-bottom-border"],["for","mail.handler","trans",""],["name","mail.handler","id","mail.handler",3,"ngModel","ngModelChange"],["value","mailgun","trans",""],["value","gmailApi","trans",""],["value","null","trans",""],["value","mime","trans",""],["href","https://support.vebto.com/help-center/articles/76/configuring-email-provider","target","_blank",4,"ngIf"],["href","https://support.vebto.com/help-center/articles/76/configuring-email-provider","target","_blank"],["href","https://support.vebto.com/help-center/articles/42/44/155/incoming-emails","target","_blank"],["for","env.mail_host","trans",""],["name","env.mail_host","id","env.mail_host",3,"ngModel","ngModelChange"],["for","env.mail_username","trans",""],["name","env.mail_username","id","env.mail_username",3,"ngModel","ngModelChange"],["for","env.mail_password","trans",""],["type","password","name","env.mail_password","id","env.mail_password",3,"ngModel","ngModelChange"],["for","env.mail_port","trans",""],["name","env.mail_port","id","env.mail_port",3,"ngModel","ngModelChange"],["for","env.mail_encryption","trans",""],["name","env.mail_encryption","id","env.mail_encryption",3,"ngModel","ngModelChange"],["for","mailgun_domain","trans",""],["name","mailgun_domain","id","mailgun_domain",3,"ngModel","ngModelChange"],["class","error",4,"ngIf"],["for","mailgun_secret","trans",""],["name","mailgun_secret","id","mailgun_secret",3,"ngModel","ngModelChange"],[1,"error"],["for","env.ses_key","trans",""],["name","env.ses_key","id","env.ses_key",3,"ngModel","ngModelChange"],["for","env.ses_secret","trans",""],["name","env.ses_secret","id","env.ses_secret",3,"ngModel","ngModelChange"],["for","env.ses_region","trans",""],["name","env.ses_region","id","env.ses_region","placeholder","us-east-1",3,"ngModel","ngModelChange"],["for","env.sparkpost_secret","trans",""],["name","env.sparkpost_secret","id","env.sparkpost_secret",3,"ngModel","ngModelChange"],["id","gmail_group"],[1,"gmail-input-container"],[1,"gmail-label"],["class","authorized-gmail-account",4,"ngIf"],["type","button","mat-flat-button","","color","accent","class","connect-gmail-button",3,"click",4,"ngIf"],["for","gmail.incoming.topicName"],["type","text","id","gmail.incoming.topicName","name","webhook_secret_key","required","","minlength","10",3,"ngModel","ngModelChange"],[1,"authorized-gmail-account"],["src","client/assets/images/gmail.png","alt","",1,"gmail-img"],[1,"text"],["type","button","mat-button","","color","accent","trans","",3,"click"],["type","button","mat-flat-button","","color","accent",1,"connect-gmail-button",3,"click"],["trans","",1,"text"],[1,"error","group-error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Mail"),o.qZA(),o.TgZ(3,"div",2),o._uU(4," Change incoming and outgoing email handlers, email credentials and more. "),o.qZA(),o.qZA(),o.YNc(5,ai,61,23,"form",3),o.ALo(6,"async")),2&t&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,e.state.errors$)))},directives:[qe.P,i.O5,a.JL,a.F,a.Fj,a.Q7,a.JJ,a.On,a.EJ,a.YN,a.Kr,P.Hw,p.lW,a.wO,k.pW],pipes:[i.Ov],styles:[".gmail-input-container[_ngcontent-%COMP%]{margin-bottom:20px}.authorized-gmail-account[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:var(--be-background-alternative);padding:10px;border-radius:4px;border:1px solid var(--be-divider-default)}.authorized-gmail-account[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{margin-left:auto}.connect-gmail-button[_ngcontent-%COMP%]{line-height:58px;width:100%;position:relative}.connect-gmail-button[_ngcontent-%COMP%]   .gmail-img[_ngcontent-%COMP%]{position:absolute;top:15px;left:12px}.gmail-img[_ngcontent-%COMP%]{display:inline-block;width:30px;height:30px;flex-shrink:0;margin-right:10px}.gmail-label[_ngcontent-%COMP%]{color:var(--be-label);padding-bottom:5px}"],changeDetection:0}),t})();function si(t,e){if(1&t&&o._UZ(0,"p",14),2&t){const t=o.oxw().ngIf;o.Q6J("innerHTML",t.logging_group,o.oJD)}}function ri(t,e){1&t&&o._UZ(0,"mat-progress-bar",15)}function li(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(t),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"label",7),o._uU(4,"Sentry DSN"),o.qZA(),o.TgZ(5,"input",8),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.server.sentry_dsn=e}),o.qZA(),o.qZA(),o.YNc(6,si,1,1,"p",9),o.qZA(),o.TgZ(7,"div",10),o.TgZ(8,"div",1),o._uU(9,"Information"),o.qZA(),o.TgZ(10,"p"),o.TgZ(11,"a",11),o._uU(12,"Sentry"),o.qZA(),o.TgZ(13,"span"),o._uU(14),o.ALo(15,"trans"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(16,"button",12),o.ALo(17,"async"),o._uU(18," Update "),o.qZA(),o.YNc(19,ri,1,0,"mat-progress-bar",13),o.ALo(20,"async"),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.xp6(1),o.ekj("has-error",t.logging_group),o.xp6(4),o.Q6J("ngModel",n.state.server.sentry_dsn),o.xp6(1),o.Q6J("ngIf",t.logging_group),o.xp6(8),o.hij(" ",o.lcZ(15,7,"integration provides real-time error tracking and helps identify and fix issues when site is in production."),""),o.xp6(2),o.Q6J("disabled",o.lcZ(17,9,n.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(20,11,n.state.loading$))}}let ci=(()=>{class t extends Ce{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["logging-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["id","logging-group",1,"error-group","many-inputs","no-spacing"],[1,"input-container"],["for","logging.sentry_dsn","trans",""],["type","url","name","logging.sentry_dsn","id","logging.sentry_dsn","minlength","30",3,"ngModel","ngModelChange"],["class","error",3,"innerHTML",4,"ngIf"],[1,"widget","widget-info"],["href","https://sentry.io","target","_blank"],["type","submit","mat-raised-button","","color","accent","trans","",1,"update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Logging"),o.qZA(),o.TgZ(3,"div",2),o._uU(4," Configure site error and access logging and related 3rd party integrations. "),o.qZA(),o.qZA(),o.YNc(5,li,21,13,"form",3),o.ALo(6,"async")),2&t&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,e.state.errors$)))},directives:[qe.P,i.O5,a.JL,a.F,a.Fj,a.wO,a.JJ,a.On,p.lW,k.pW],pipes:[i.Ov,le.R],encapsulation:2,changeDetection:0}),t})();function di(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",9),o.TgZ(2,"label",21),o._uU(3,"SQS Queue Key"),o.qZA(),o.TgZ(4,"input",22),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.sqs_queue_key=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",9),o.TgZ(6,"label",23),o._uU(7,"SQS Queue Secret"),o.qZA(),o.TgZ(8,"input",24),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.sqs_queue_secret=e}),o.qZA(),o.qZA(),o.TgZ(9,"div",9),o.TgZ(10,"label",25),o._uU(11,"SQS Queue Prefix"),o.qZA(),o.TgZ(12,"input",26),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.sqs_queue_prefix=e}),o.qZA(),o.qZA(),o.TgZ(13,"div",9),o.TgZ(14,"label",27),o._uU(15,"SQS Queue Name"),o.qZA(),o.TgZ(16,"input",28),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.sqs_queue_name=e}),o.qZA(),o.qZA(),o.TgZ(17,"div",9),o.TgZ(18,"label",29),o._uU(19,"SQS Queue Region"),o.qZA(),o.TgZ(20,"input",30),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.sqs_queue_region=e}),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(4),o.Q6J("ngModel",t.state.server.sqs_queue_key),o.xp6(4),o.Q6J("ngModel",t.state.server.sqs_queue_secret),o.xp6(4),o.Q6J("ngModel",t.state.server.sqs_queue_prefix),o.xp6(4),o.Q6J("ngModel",t.state.server.sqs_queue_name),o.xp6(4),o.Q6J("ngModel",t.state.server.sqs_queue_region)}}function ui(t,e){if(1&t&&o._UZ(0,"p",31),2&t){const t=o.oxw().ngIf;o.Q6J("innerHTML",t.queue_group,o.oJD)}}function pi(t,e){1&t&&o._UZ(0,"mat-progress-bar",32)}function gi(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(t),o.oxw().saveSettings()}),o.TgZ(1,"div",5),o.TgZ(2,"div",1),o._uU(3,"Information"),o.qZA(),o.TgZ(4,"p",6),o._uU(5," Queues allow to defer time consuming tasks, such as sending an email, until a later time. Deferring these tasks can speed up web requests to the application. "),o.qZA(),o.qZA(),o.TgZ(6,"div",7),o.TgZ(7,"div",1),o._uU(8,"Important"),o.qZA(),o.TgZ(9,"p",6),o._uU(10," All methods except sync require additional setup, which should be performed before changing the queue method. Consult documentation for more information. "),o.qZA(),o.qZA(),o.TgZ(11,"div",8),o.TgZ(12,"div",9),o.TgZ(13,"label",10),o._uU(14,"Queue Method"),o.qZA(),o.TgZ(15,"select",11),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.server.queue_driver=e})("ngModelChange",function(){return o.CHM(t),o.oxw().clearErrors()}),o.TgZ(16,"option",12),o._uU(17,"Sync (Default)"),o.qZA(),o.TgZ(18,"option",13),o._uU(19,"Beanstalkd"),o.qZA(),o.TgZ(20,"option",14),o._uU(21,"Database"),o.qZA(),o.TgZ(22,"option",15),o._uU(23,"SQS (Amazon simple queue service)"),o.qZA(),o.TgZ(24,"option",16),o._uU(25,"Redis"),o.qZA(),o.qZA(),o.qZA(),o.YNc(26,di,21,5,"ng-container",17),o.YNc(27,ui,1,1,"p",18),o.qZA(),o.TgZ(28,"button",19),o.ALo(29,"async"),o._uU(30," Update "),o.qZA(),o.YNc(31,pi,1,0,"mat-progress-bar",20),o.ALo(32,"async"),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.xp6(11),o.ekj("has-error",t.queue_group),o.xp6(4),o.Q6J("ngModel",n.state.server.queue_driver),o.xp6(11),o.Q6J("ngIf","sqs"===n.state.server.queue_driver),o.xp6(1),o.Q6J("ngIf",t.queue_group),o.xp6(1),o.Q6J("disabled",o.lcZ(29,7,n.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(32,9,n.state.loading$))}}let hi=(()=>{class t extends Ce{saveSettings(){const t=this.state.getModified();t.client["realtime.pusher_key"]&&(t.server.pusher_key=t.client["realtime.pusher_key"]),super.saveSettings(t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["queue-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],[1,"widget","widget-info"],["trans",""],[1,"widget","widget-info","widget-important"],["id","queue-group",1,"error-group","many-inputs","no-spacing"],[1,"input-container"],["for","queue.driver","trans",""],["name","queue.driver","id","queue.driver",3,"ngModel","ngModelChange"],["value","sync","trans",""],["value","beanstalkd"],["value","database"],["value","sqs","trans",""],["value","redis"],[4,"ngIf"],["class","error",3,"innerHTML",4,"ngIf"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["for","sqs_queue_key","trans",""],["name","sqs_queue_key","id","sqs_queue_key","required","",3,"ngModel","ngModelChange"],["for","sqs_queue_secret","trans",""],["name","sqs_queue_secret","id","sqs_queue_secret","required","",3,"ngModel","ngModelChange"],["for","sqs_queue_prefix","trans",""],["name","sqs_queue_prefix","id","sqs_queue_prefix",3,"ngModel","ngModelChange"],["for","sqs_queue_name","trans",""],["name","sqs_queue_name","id","sqs_queue_name","required","",3,"ngModel","ngModelChange"],["for","sqs_queue_region","trans",""],["name","sqs_queue_region","id","sqs_queue_region","required","",3,"ngModel","ngModelChange"],[1,"error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Queue"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Select active queue method and enter related 3rd party API keys."),o.qZA(),o.qZA(),o.YNc(5,gi,33,11,"form",3),o.ALo(6,"async")),2&t&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,e.state.errors$)))},directives:[qe.P,i.O5,a.JL,a.F,a.EJ,a.JJ,a.On,a.YN,a.Kr,p.lW,a.Fj,a.Q7,k.pW],pipes:[i.Ov],encapsulation:2,changeDetection:0}),t})();var mi=n(77910);function fi(t,e){1&t&&(o.TgZ(0,"a",29),o._uU(1,"Learn more. "),o.qZA())}function bi(t,e){if(1&t&&o._UZ(0,"p",39),2&t){const t=o.oxw(3).ngIf;o.Q6J("innerHTML",t.paypal_group,o.oJD)}}function vi(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",30),o.TgZ(1,"div",12),o.TgZ(2,"label",31),o._uU(3,"Paypal Client ID"),o.qZA(),o.TgZ(4,"input",32),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(3).state.server.paypal_client_id=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",12),o.TgZ(6,"label",33),o._uU(7,"Paypal Secret"),o.qZA(),o.TgZ(8,"input",34),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(3).state.server.paypal_secret=e}),o.qZA(),o.qZA(),o.TgZ(9,"div",12),o.TgZ(10,"label",35),o._uU(11,"Paypal Webhook ID"),o.qZA(),o.TgZ(12,"input",36),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(3).state.server.paypal_webhook_id=e}),o.qZA(),o.qZA(),o.TgZ(13,"div",8),o.TgZ(14,"mat-slide-toggle",37),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(3).state.client["billing.paypal_test_mode"]=e}),o._uU(15,"Paypal Test Mode"),o.qZA(),o.TgZ(16,"p",10),o._uU(17,"Allows testing PayPal payments with sandbox accounts."),o.qZA(),o.qZA(),o.YNc(18,bi,1,1,"p",38),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.ekj("has-error",t.paypal_group),o.xp6(4),o.Q6J("ngModel",e.state.server.paypal_client_id),o.xp6(4),o.Q6J("ngModel",e.state.server.paypal_secret),o.xp6(4),o.Q6J("ngModel",e.state.server.paypal_webhook_id),o.xp6(2),o.Q6J("ngModel",e.state.client["billing.paypal_test_mode"]),o.xp6(4),o.Q6J("ngIf",t.paypal_group)}}function _i(t,e){1&t&&(o.TgZ(0,"a",40),o._uU(1,"Learn more. "),o.qZA())}function Zi(t,e){if(1&t&&(o.TgZ(0,"div",47),o._uU(1),o.qZA()),2&t){const t=o.oxw(3).ngIf;o.xp6(1),o.Oqu(t.stripe_secret)}}function xi(t,e){if(1&t&&o._UZ(0,"p",39),2&t){const t=o.oxw(3).ngIf;o.Q6J("innerHTML",t.stripe_group,o.oJD)}}function yi(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",41),o.TgZ(1,"div",12),o.TgZ(2,"label",42),o._uU(3,"Stripe Client ID"),o.qZA(),o.TgZ(4,"input",43),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(3).state.server.stripe_key=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",12),o.TgZ(6,"label",44),o._uU(7,"Stripe Secret"),o.qZA(),o.TgZ(8,"input",45),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(3).state.server.stripe_secret=e}),o.qZA(),o.YNc(9,Zi,2,1,"div",46),o.qZA(),o.YNc(10,xi,1,1,"p",38),o.qZA()}if(2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.ekj("has-error",t.stripe_group),o.xp6(4),o.Q6J("ngModel",e.state.server.stripe_key),o.xp6(1),o.ekj("has-error",t.stripe_secret),o.xp6(3),o.Q6J("ngModel",e.state.server.stripe_secret),o.xp6(1),o.Q6J("ngIf",t.stripe_secret),o.xp6(1),o.Q6J("ngIf",t.stripe_group)}}function Ai(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",8),o.TgZ(2,"mat-slide-toggle",19),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.client["billing.paypal.enable"]=e}),o._uU(3,"Paypal Gateway"),o.qZA(),o.TgZ(4,"p"),o.TgZ(5,"span",10),o._uU(6,"Enable PayPal payment gateway."),o.qZA(),o.TgZ(7,"span",20),o._UZ(8,"mat-icon",21),o.YNc(9,fi,2,0,"a",22),o.qZA(),o.qZA(),o.qZA(),o.YNc(10,vi,19,7,"div",23),o.TgZ(11,"div",8),o.TgZ(12,"mat-slide-toggle",24),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.client["billing.stripe.enable"]=e}),o._uU(13,"Stripe Gateway"),o.qZA(),o.TgZ(14,"p"),o.TgZ(15,"span",10),o._uU(16,"Enable Stripe payment gateway."),o.qZA(),o.TgZ(17,"span",20),o._UZ(18,"mat-icon",21),o.YNc(19,_i,2,0,"a",25),o.qZA(),o.qZA(),o.qZA(),o.YNc(20,yi,11,8,"div",26),o.TgZ(21,"div",12),o.TgZ(22,"label",27),o._uU(23,"Accepted Cards"),o.qZA(),o.TgZ(24,"chip-input",28),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).acceptedCards=e}),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(2),o.Q6J("ngModel",t.state.client["billing.paypal.enable"]),o.xp6(7),o.Q6J("ngIf",!t.settings.get("site.hide_docs_buttons")),o.xp6(1),o.Q6J("ngIf",t.state.client["billing.paypal.enable"]),o.xp6(2),o.Q6J("ngModel",t.state.client["billing.stripe.enable"]),o.xp6(7),o.Q6J("ngIf",!t.settings.get("site.hide_docs_buttons")),o.xp6(1),o.Q6J("ngIf",t.state.client["billing.stripe.enable"]),o.xp6(4),o.Q6J("ngModel",t.acceptedCards)}}function wi(t,e){1&t&&o._UZ(0,"mat-progress-bar",48)}function ki(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(t),o.oxw().saveSettings()}),o.TgZ(1,"mat-tab-group",5),o.TgZ(2,"mat-tab",6),o.ALo(3,"trans"),o.TgZ(4,"div",7),o.TgZ(5,"div",8),o.TgZ(6,"mat-slide-toggle",9),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["billing.enable"]=e}),o._uU(7,"Enable Billing"),o.qZA(),o.TgZ(8,"p",10),o._uU(9,"Enable or disable all billing functionality across the site."),o.qZA(),o.qZA(),o.YNc(10,Ai,25,7,"ng-container",11),o.qZA(),o.qZA(),o.TgZ(11,"mat-tab",6),o.ALo(12,"trans"),o.TgZ(13,"div",7),o.TgZ(14,"div",12),o.TgZ(15,"label",13),o._uU(16,"Invoice Address"),o.qZA(),o.TgZ(17,"textarea",14),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["billing.invoice.address"]=e}),o.qZA(),o.TgZ(18,"p",10),o._uU(19,' Address to show under "from" section of user invoice. Supports HTML. Optional. '),o.qZA(),o.qZA(),o.TgZ(20,"div",12),o.TgZ(21,"label",15),o._uU(22,"Invoice Note"),o.qZA(),o.TgZ(23,"textarea",16),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["billing.invoice.notes"]=e}),o.qZA(),o.TgZ(24,"p",10),o._uU(25,'Default notes to show under "notes" section of user invoice. Optional.'),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(26,"button",17),o.ALo(27,"async"),o._uU(28," Update "),o.qZA(),o.YNc(29,wi,1,0,"mat-progress-bar",18),o.ALo(30,"async"),o.qZA()}if(2&t){const t=o.oxw();o.xp6(2),o.Q6J("label",o.lcZ(3,8,"General")),o.xp6(4),o.Q6J("ngModel",t.state.client["billing.enable"]),o.xp6(4),o.Q6J("ngIf",t.state.client["billing.enable"]),o.xp6(1),o.Q6J("label",o.lcZ(12,10,"Invoices")),o.xp6(6),o.Q6J("ngModel",t.state.client["billing.invoice.address"]),o.xp6(6),o.Q6J("ngModel",t.state.client["billing.invoice.notes"]),o.xp6(3),o.Q6J("disabled",o.lcZ(27,12,t.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(30,14,t.state.loading$))}}let Ti=(()=>{class t extends Ce{constructor(){super(...arguments),this.acceptedCards=[]}ngOnInit(){this.acceptedCards=this.settings.getJson("billing.accepted_cards",[])}saveSettings(){const t=this.state.getModified();t.client["billing.accepted_cards"]=JSON.stringify(this.acceptedCards),super.saveSettings(t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["billing-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["color","accent","animationDuration","0"],[3,"label"],[1,"many-inputs","tab-content"],[1,"setting-toggle-container"],["name","billing.enable","id","billing.enable","trans","",3,"ngModel","ngModelChange"],["trans",""],[4,"ngIf"],[1,"input-container"],["for","billing.invoice.address","trans",""],["name","billing.invoice.address","id","billing.invoice.address","rows","5",3,"ngModel","ngModelChange"],["for","billing.invoice.notes","trans",""],["name","billing.invoice.notes","id","billing.invoice.notes","rows","5",3,"ngModel","ngModelChange"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["name","billing.paypal.enable","id","billing.paypal.enable","trans","",3,"ngModel","ngModelChange"],[1,"docs-link"],["svgIcon","link"],["href","https://support.vebto.com/help-center/articles/147/configuring-paypal","target","_blank",4,"ngIf"],["class","error-group many-inputs","id","paypal_group",3,"has-error",4,"ngIf"],["name","billing.enable.stripe","id","billing.enable.stripe","trans","",3,"ngModel","ngModelChange"],["href","https://support.vebto.com/help-center/articles/148/configuring-stripe","target","_blank",4,"ngIf"],["class","error-group many-inputs","id","stripe_group",3,"has-error",4,"ngIf"],["for","accepted-cards","trans",""],["id","accepted-cards","name","accepted-cards","placeholder","+New Card...","trans-placeholder","",3,"ngModel","ngModelChange"],["href","https://support.vebto.com/help-center/articles/147/configuring-paypal","target","_blank"],["id","paypal_group",1,"error-group","many-inputs"],["for","billing.paypal.id","trans",""],["name","billing.paypal.id","id","billing.paypal.id","required","",3,"ngModel","ngModelChange"],["for","billing.paypal.secret","trans",""],["name","billing.paypal.secret","id","billing.paypal.secret","required","",3,"ngModel","ngModelChange"],["for","billing.paypal.webhook_id","trans",""],["name","billing.paypal.webhook_id","id","billing.paypal.webhook_id","required","",3,"ngModel","ngModelChange"],["name","billing.paypal.test_mode","id","billing.paypal.test_mode","trans","",3,"ngModel","ngModelChange"],["class","error",3,"innerHTML",4,"ngIf"],[1,"error",3,"innerHTML"],["href","https://support.vebto.com/help-center/articles/148/configuring-stripe","target","_blank"],["id","stripe_group",1,"error-group","many-inputs"],["for","stripe_key","trans",""],["name","billing.stripe.id","id","stripe_key","required","",3,"ngModel","ngModelChange"],["for","stripe_secret","trans",""],["name","billing.stripe.secret","id","stripe_secret","required","",3,"ngModel","ngModelChange"],["class","error",4,"ngIf"],[1,"error"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Billing"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure billing and subscription settings."),o.qZA(),o.qZA(),o.YNc(5,ki,31,16,"form",3),o.ALo(6,"async")),2&t&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,e.state.errors$)))},directives:[qe.P,i.O5,a.JL,a.F,O.SP,O.uX,T.Rr,a.JJ,a.On,a.Fj,p.lW,P.Hw,mi.S,a.Q7,k.pW],pipes:[i.Ov,le.R],styles:[".settings-panels-container[_nghost-%COMP%]   .header[_ngcontent-%COMP%], .settings-panels-container   [_nghost-%COMP%]   .header[_ngcontent-%COMP%]{margin-bottom:25px}.tab-content[_ngcontent-%COMP%]{padding-top:25px}"],changeDetection:0}),t})();var Ci=n(24831),qi=n(13853),Ui=n(79996),Ii=n(94380),Mi=n(98977);function Oi(t,e){if(1&t&&(o.TgZ(0,"label",5),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.MGl("for","space-input-",t.id,""),o.xp6(1),o.Oqu(t.label)}}function Ji(t,e){if(1&t&&(o.TgZ(0,"option",6),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("ngValue",t),o.xp6(1),o.Oqu(t)}}const Pi=[[["",8,"description"]],[["",8,"error"]]],Ni=[".description",".error"];let Si=(()=>{class t{constructor(){this.inputContainer=!0,this.id=(0,Ci.O)(),this.spaceUnits=qi.L,this.form=new a.cw({unit:new a.NI("MB"),amount:new a.NI(null)})}ngOnInit(){this.form.valueChanges.pipe((0,Ui.U)(t=>(0,Ii.F)(t.amount,t.unit))).subscribe(t=>this.propagateChange(t))}writeValue(t){this.form.setValue(this.fromBytes(t),{emitEvent:!1})}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}fromBytes(t){const e=(0,Mi.H)(t);return e?{amount:e.split(" ")[0],unit:e.split(" ")[1]}:{amount:null,unit:"MB"}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o.Xpm({type:t,selectors:[["space-input"]],hostVars:2,hostBindings:function(t,e){2&t&&o.ekj("input-container",e.inputContainer)},inputs:{label:"label",name:"name"},features:[o._Bn([{provide:a.JU,useExisting:t,multi:!0}])],ngContentSelectors:Ni,decls:7,vars:5,consts:[["trans","",3,"for",4,"ngIf"],[1,"wrapper"],["type","number","min","0","placeholder","Optional...","trans-placeholder","",3,"id","formControl"],[3,"formControl"],["trans","",3,"ngValue",4,"ngFor","ngForOf"],["trans","",3,"for"],["trans","",3,"ngValue"]],template:function(t,e){1&t&&(o.F$t(Pi),o.YNc(0,Oi,2,2,"label",0),o.TgZ(1,"div",1),o._UZ(2,"input",2),o.TgZ(3,"select",3),o.YNc(4,Ji,2,2,"option",4),o.qZA(),o.qZA(),o.Hsn(5),o.Hsn(6,1)),2&t&&(o.Q6J("ngIf",e.label),o.xp6(2),o.MGl("id","space-input-",e.id,""),o.Q6J("formControl",e.form.get("amount")),o.xp6(1),o.Q6J("formControl",e.form.get("unit")),o.xp6(1),o.Q6J("ngForOf",e.spaceUnits))},directives:[i.O5,a.qQ,a.wV,a.Fj,qe.P,a.JJ,a.oH,a.EJ,i.sg,a.YN,a.Kr],styles:["[_nghost-%COMP%]{display:block}.input-container[_nghost-%COMP%]   input[_ngcontent-%COMP%]{flex:1 1 auto;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none}.input-container[_nghost-%COMP%]   select[_ngcontent-%COMP%]{width:80px;flex:0 0 80px;border-top-left-radius:0;border-bottom-left-radius:0}.wrapper[_ngcontent-%COMP%]{display:flex}"],changeDetection:0}),t})(),Di=(()=>{class t{constructor(t){this.state=t}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(d))},t.\u0275cmp=o.Xpm({type:t,selectors:[["ftp-form"]],decls:26,vars:7,consts:[[1,"input-container"],["for","storage_ftp_host","trans",""],["type","text","id","storage_ftp_host","name","storage_ftp_host","required","",3,"ngModel","ngModelChange"],["for","storage_ftp_username","trans",""],["type","text","id","storage_ftp_username","name","storage_ftp_username","required","",3,"ngModel","ngModelChange"],["for","storage_ftp_password","trans",""],["type","password","id","storage_ftp_password","name","storage_ftp_password","required","",3,"ngModel","ngModelChange"],["for","storage_ftp_root","trans",""],["type","text","id","storage_ftp_root","name","storage_ftp_root","placeholder","/",3,"ngModel","ngModelChange"],["for","storage_ftp_port","trans",""],["type","number","id","storage_ftp_port","name","storage_ftp_port","min","0","placeholder","21",3,"ngModel","ngModelChange"],[1,"setting-toggle-container"],["name","storage_ftp_passive","id","storage_ftp_passive","trans","",3,"ngModel","ngModelChange"],["name","storage_ftp_ssl","id","storage_ftp_ssl","trans","",3,"ngModel","ngModelChange"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"FTP Hostname"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(t){return e.state.server.storage_ftp_host=t}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"FTP Username"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(t){return e.state.server.storage_ftp_username=t}),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o.TgZ(9,"label",5),o._uU(10,"FTP Password"),o.qZA(),o.TgZ(11,"input",6),o.NdJ("ngModelChange",function(t){return e.state.server.storage_ftp_password=t}),o.qZA(),o.qZA(),o.TgZ(12,"div",0),o.TgZ(13,"label",7),o._uU(14,"FTP Directory"),o.qZA(),o.TgZ(15,"input",8),o.NdJ("ngModelChange",function(t){return e.state.server.storage_ftp_root=t}),o.qZA(),o.qZA(),o.TgZ(16,"div",0),o.TgZ(17,"label",9),o._uU(18,"FTP Port"),o.qZA(),o.TgZ(19,"input",10),o.NdJ("ngModelChange",function(t){return e.state.server.storage_ftp_port=t}),o.qZA(),o.qZA(),o.TgZ(20,"div",11),o.TgZ(21,"mat-slide-toggle",12),o.NdJ("ngModelChange",function(t){return e.state.server.storage_ftp_passive=t}),o._uU(22,"Passive"),o.qZA(),o.qZA(),o.TgZ(23,"div",11),o.TgZ(24,"mat-slide-toggle",13),o.NdJ("ngModelChange",function(t){return e.state.server.storage_ftp_ssl=t}),o._uU(25,"SSL"),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngModel",e.state.server.storage_ftp_host),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_ftp_username),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_ftp_password),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_ftp_root),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_ftp_port),o.xp6(2),o.Q6J("ngModel",e.state.server.storage_ftp_passive),o.xp6(3),o.Q6J("ngModel",e.state.server.storage_ftp_ssl))},directives:[qe.P,a.Fj,a.Q7,a.JJ,a.On,a.qQ,a.wV,T.Rr],encapsulation:2,changeDetection:0}),t})(),Qi=(()=>{class t{constructor(t){this.state=t}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(d))},t.\u0275cmp=o.Xpm({type:t,selectors:[["dropbox-form"]],decls:8,vars:2,consts:[[1,"input-container"],["for","storage_dropbox_access_token","trans",""],["type","text","id","storage_dropbox_access_token","name","storage_dropbox_access_token","required","",3,"ngModel","ngModelChange"],["for","storage_dropbox_root","trans",""],["type","text","id","storage_dropbox_root","name","storage_dropbox_root","placeholder","/",3,"ngModel","ngModelChange"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"Access Token"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(t){return e.state.server.storage_dropbox_access_token=t}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"Root Directory"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(t){return e.state.server.storage_dropbox_root=t}),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngModel",e.state.server.storage_dropbox_access_token),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_dropbox_root))},directives:[qe.P,a.Fj,a.Q7,a.JJ,a.On],encapsulation:2,changeDetection:0}),t})(),Yi=(()=>{class t{constructor(t){this.state=t}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(d))},t.\u0275cmp=o.Xpm({type:t,selectors:[["rackspace-form"]],decls:16,vars:4,consts:[[1,"input-container"],["for","storage_rackspace_username","trans",""],["type","text","id","storage_rackspace_username","name","storage_rackspace_username","required","",3,"ngModel","ngModelChange"],["for","storage_rackspace_key","trans",""],["type","text","id","storage_rackspace_key","name","storage_rackspace_key","required","",3,"ngModel","ngModelChange"],["for","storage_rackspace_region","trans",""],["type","text","id","storage_rackspace_region","name","storage_rackspace_region","required","",3,"ngModel","ngModelChange"],["for","storage_rackspace_container","trans",""],["type","text","id","storage_rackspace_container","name","storage_rackspace_container","required","",3,"ngModel","ngModelChange"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"Rackspace Username"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(t){return e.state.server.storage_rackspace_username=t}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"Rackspace Key"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(t){return e.state.server.storage_rackspace_key=t}),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o.TgZ(9,"label",5),o._uU(10,"Rackspace Region"),o.qZA(),o.TgZ(11,"input",6),o.NdJ("ngModelChange",function(t){return e.state.server.storage_rackspace_region=t}),o.qZA(),o.qZA(),o.TgZ(12,"div",0),o.TgZ(13,"label",7),o._uU(14,"Rackspace Container"),o.qZA(),o.TgZ(15,"input",8),o.NdJ("ngModelChange",function(t){return e.state.server.storage_rackspace_container=t}),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngModel",e.state.server.storage_rackspace_username),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_rackspace_key),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_rackspace_region),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_rackspace_container))},directives:[qe.P,a.Fj,a.Q7,a.JJ,a.On],encapsulation:2,changeDetection:0}),t})(),Li=(()=>{class t{constructor(t){this.state=t}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(d))},t.\u0275cmp=o.Xpm({type:t,selectors:[["s3-form"]],decls:23,vars:8,consts:[[1,"input-container"],["for","storage_s3_key","trans",""],["type","text","id","storage_s3_key","name","storage_s3_key","required","",3,"ngModel","ngModelChange"],["for","storage_s3_secret","trans",""],["type","text","id","storage_s3_secret","name","storage_s3_secret","required","",3,"ngModel","ngModelChange"],["for","storage_s3_region","trans",""],["type","text","id","storage_s3_region","pattern","[a-z1-9\\-]+","placeholder","us-east-1","name","storage_s3_region","required","",3,"ngModel","ngModelChange"],["for","storage_s3_bucket","trans",""],["type","text","id","storage_s3_bucket","name","storage_s3_bucket","required","",3,"ngModel","ngModelChange"],["for","storage_s3_endpoint","trans",""],["type","url","id","storage_s3_endpoint","name","storage_s3_endpoint",3,"placeholder","ngModel","ngModelChange"],["trans",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"Amazon S3 Key"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(t){return e.state.server.storage_s3_key=t}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"Amazon S3 Secret"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(t){return e.state.server.storage_s3_secret=t}),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o.TgZ(9,"label",5),o._uU(10,"Amazon S3 Region"),o.qZA(),o.TgZ(11,"input",6),o.NdJ("ngModelChange",function(t){return e.state.server.storage_s3_region=t}),o.qZA(),o.qZA(),o.TgZ(12,"div",0),o.TgZ(13,"label",7),o._uU(14,"Amazon S3 Bucket"),o.qZA(),o.TgZ(15,"input",8),o.NdJ("ngModelChange",function(t){return e.state.server.storage_s3_bucket=t}),o.qZA(),o.qZA(),o.TgZ(16,"div",0),o.TgZ(17,"label",9),o._uU(18,"Amazon S3 Endpoint"),o.qZA(),o.TgZ(19,"input",10),o.NdJ("ngModelChange",function(t){return e.state.server.storage_s3_endpoint=t}),o.ALo(20,"trans"),o.qZA(),o.TgZ(21,"p",11),o._uU(22,"Only change endpoint if you are using another S3 compatible storage service."),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngModel",e.state.server.storage_s3_key),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_s3_secret),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_s3_region),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_s3_bucket),o.xp6(4),o.Q6J("placeholder",o.lcZ(20,6,"Optional"))("ngModel",e.state.server.storage_s3_endpoint))},directives:[qe.P,a.Fj,a.Q7,a.JJ,a.On,a.c5],pipes:[le.R],encapsulation:2,changeDetection:0}),t})(),Fi=(()=>{class t{constructor(t){this.state=t}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(d))},t.\u0275cmp=o.Xpm({type:t,selectors:[["digitalocean-form"]],decls:16,vars:4,consts:[[1,"input-container"],["for","storage_digitalocean_key","trans",""],["type","text","id","storage_digitalocean_key","name","storage_digitalocean_key","required","",3,"ngModel","ngModelChange"],["for","storage_digitalocean_secret","trans",""],["type","text","id","storage_digitalocean_secret","name","storage_digitalocean_secret","required","",3,"ngModel","ngModelChange"],["for","storage_digitalocean_region","trans",""],["type","text","id","storage_digitalocean_region","name","storage_digitalocean_region","required","","pattern","[a-z0-9]+","maxlength","5",3,"ngModel","ngModelChange"],["for","storage_digitalocean_bucket","trans",""],["type","text","id","storage_digitalocean_bucket","name","storage_digitalocean_bucket","required","",3,"ngModel","ngModelChange"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"DigitalOcean Key"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(t){return e.state.server.storage_digitalocean_key=t}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"DigitalOcean Secret"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(t){return e.state.server.storage_digitalocean_secret=t}),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o.TgZ(9,"label",5),o._uU(10,"DigitalOcean Region"),o.qZA(),o.TgZ(11,"input",6),o.NdJ("ngModelChange",function(t){return e.state.server.storage_digitalocean_region=t}),o.qZA(),o.qZA(),o.TgZ(12,"div",0),o.TgZ(13,"label",7),o._uU(14,"DigitalOcean Bucket"),o.qZA(),o.TgZ(15,"input",8),o.NdJ("ngModelChange",function(t){return e.state.server.storage_digitalocean_bucket=t}),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngModel",e.state.server.storage_digitalocean_key),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_digitalocean_secret),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_digitalocean_region),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_digitalocean_bucket))},directives:[qe.P,a.Fj,a.Q7,a.JJ,a.On,a.c5,a.nD],encapsulation:2,changeDetection:0}),t})(),Ei=(()=>{class t{constructor(t){this.state=t}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(d))},t.\u0275cmp=o.Xpm({type:t,selectors:[["backblaze-form"]],decls:16,vars:4,consts:[[1,"input-container"],["for","storage_backblaze_key_id","trans",""],["type","text","id","storage_backblaze_key_id","name","storage_backblaze_key_id","required","",3,"ngModel","ngModelChange"],["for","storage_backblaze_application_key","trans",""],["type","text","id","storage_backblaze_application_key","name","storage_backblaze_application_key","required","",3,"ngModel","ngModelChange"],["for","storage_backblaze_bucket","trans",""],["type","text","id","storage_backblaze_bucket","name","storage_backblaze_bucket","required","",3,"ngModel","ngModelChange"],["for","storage_backblaze_region","trans",""],["type","text","id","storage_backblaze_region","pattern","[a-z0-9\\-]+","placeholder","us-west-002","name","storage_backblaze_region","required","",3,"ngModel","ngModelChange"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"label",1),o._uU(2,"Backblaze KeyID"),o.qZA(),o.TgZ(3,"input",2),o.NdJ("ngModelChange",function(t){return e.state.server.storage_backblaze_key_id=t}),o.qZA(),o.qZA(),o.TgZ(4,"div",0),o.TgZ(5,"label",3),o._uU(6,"Backblaze applicationKey"),o.qZA(),o.TgZ(7,"input",4),o.NdJ("ngModelChange",function(t){return e.state.server.storage_backblaze_application_key=t}),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o.TgZ(9,"label",5),o._uU(10,"Backblaze Bucket Name"),o.qZA(),o.TgZ(11,"input",6),o.NdJ("ngModelChange",function(t){return e.state.server.storage_backblaze_bucket=t}),o.qZA(),o.qZA(),o.TgZ(12,"div",0),o.TgZ(13,"label",7),o._uU(14,"Backblaze Region"),o.qZA(),o.TgZ(15,"input",8),o.NdJ("ngModelChange",function(t){return e.state.server.storage_backblaze_region=t}),o.qZA(),o.qZA()),2&t&&(o.xp6(3),o.Q6J("ngModel",e.state.server.storage_backblaze_key_id),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_backblaze_application_key),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_backblaze_bucket),o.xp6(4),o.Q6J("ngModel",e.state.server.storage_backblaze_region))},directives:[qe.P,a.Fj,a.Q7,a.JJ,a.On,a.c5],encapsulation:2,changeDetection:0}),t})();function Ri(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"label",27),o._uU(2,"User Uploads Storage Method"),o.qZA(),o.TgZ(3,"select",28),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.uploads_disk_driver=e})("ngModelChange",function(){return o.CHM(t),o.oxw(2).clearErrors()}),o.TgZ(4,"option",29),o._uU(5,"Local Disk (Default)"),o.qZA(),o.TgZ(6,"option",30),o._uU(7,"Amazon S3"),o.qZA(),o.TgZ(8,"option",31),o._uU(9,"FTP"),o.qZA(),o.TgZ(10,"option",32),o._uU(11,"DigitalOcean Spaces"),o.qZA(),o.TgZ(12,"option",33),o._uU(13,"Backblaze"),o.qZA(),o.TgZ(14,"option",34),o._uU(15,"Dropbox"),o.qZA(),o.TgZ(16,"option",35),o._uU(17,"Rackspace"),o.qZA(),o.qZA(),o.TgZ(18,"p",13),o._uU(19),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2);o.xp6(3),o.Q6J("ngModel",t.state.server.uploads_disk_driver),o.xp6(16),o.Oqu(t.settings.get("vebto.translations.uploads_disk_driver_description"))}}function $i(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"label",36),o._uU(2,"Public Uploads Storage Method"),o.qZA(),o.TgZ(3,"select",37),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.public_disk_driver=e})("ngModelChange",function(){return o.CHM(t),o.oxw(2).clearErrors()}),o.TgZ(4,"option",29),o._uU(5,"Local Disk (Default)"),o.qZA(),o.TgZ(6,"option",30),o._uU(7,"Amazon S3"),o.qZA(),o.TgZ(8,"option",32),o._uU(9,"DigitalOcean"),o.qZA(),o.TgZ(10,"option",33),o._uU(11,"Backblaze"),o.qZA(),o.qZA(),o.TgZ(12,"p",13),o._uU(13),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2);o.xp6(3),o.Q6J("ngModel",t.state.server.public_disk_driver),o.xp6(10),o.Oqu(t.settings.get("vebto.translations.public_disk_driver_description"))}}function Vi(t,e){1&t&&o._UZ(0,"ftp-form",38)}function Bi(t,e){1&t&&o._UZ(0,"dropbox-form",38)}function Hi(t,e){1&t&&o._UZ(0,"rackspace-form",38)}function zi(t,e){1&t&&o._UZ(0,"s3-form",38)}function Gi(t,e){1&t&&o._UZ(0,"digitalocean-form",38)}function ji(t,e){1&t&&o._UZ(0,"backblaze-form",38)}function Xi(t,e){if(1&t&&o._UZ(0,"p",39),2&t){const t=o.oxw().ngIf;o.Q6J("innerHTML",t.storage_group,o.oJD)}}function Wi(t,e){if(1&t&&o._UZ(0,"p",39),2&t){const t=o.oxw(2).ngIf;o.Q6J("innerHTML",t.static_delivery_group,o.oJD)}}function Ki(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"label",40),o._uU(2,"File Delivery Optimization"),o.qZA(),o.TgZ(3,"select",41),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.server.static_file_delivery=e}),o.TgZ(4,"option",42),o._uU(5,"None"),o.qZA(),o.TgZ(6,"option",43),o._uU(7,"X-Sendfile (Apache)"),o.qZA(),o.TgZ(8,"option",44),o._uU(9,"X-Accel (Nginx)"),o.qZA(),o.qZA(),o.TgZ(10,"p",13),o._uU(11," Both X-Sendfile and X-Accel need to be enabled on the server first. When enabled it will reduce server memory and CPU usage when previewing or downloading files, especially for large files. "),o.qZA(),o.YNc(12,Wi,1,1,"p",8),o.qZA()}if(2&t){const t=o.oxw().ngIf,e=o.oxw();o.xp6(3),o.Q6J("ngModel",e.state.server.static_file_delivery),o.xp6(1),o.Q6J("ngValue",null),o.xp6(8),o.Q6J("ngIf",t.static_delivery_group)}}function ta(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"label",45),o._uU(2,"Chunk Size"),o.qZA(),o.TgZ(3,"space-input",46),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.client["uploads.chunk_size"]=e}),o.qZA(),o.TgZ(4,"p",13),o._uU(5," Size for each file chunk. Recommended size is 5MB. It should generally only be changed if maximum upload size on your server is lower then 5MB. Increasing or decreasing chunk size will not affect upload speed. "),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2);o.xp6(3),o.Q6J("ngModel",t.state.client["uploads.chunk_size"])}}function ea(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",11),o.TgZ(1,"mat-slide-toggle",47),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.client["uploads.resume"]=e}),o._uU(2,"Resumable Uploads"),o.qZA(),o.TgZ(3,"p",13),o._uU(4,"Allow users to resume partial or failed uploads."),o.qZA(),o.qZA()}if(2&t){const t=o.oxw(2);o.xp6(1),o.Q6J("ngModel",t.state.client["uploads.resume"])}}function na(t,e){1&t&&o._UZ(0,"mat-progress-bar",48)}function ia(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4),o.NdJ("ngSubmit",function(){return o.CHM(t),o.oxw().saveSettings()}),o.YNc(1,Ri,20,2,"div",5),o.YNc(2,$i,14,2,"div",5),o.TgZ(3,"div",6),o.YNc(4,Vi,1,0,"ftp-form",7),o.YNc(5,Bi,1,0,"dropbox-form",7),o.YNc(6,Hi,1,0,"rackspace-form",7),o.YNc(7,zi,1,0,"s3-form",7),o.YNc(8,Gi,1,0,"digitalocean-form",7),o.YNc(9,ji,1,0,"backblaze-form",7),o.YNc(10,Xi,1,1,"p",8),o.qZA(),o.TgZ(11,"div",9),o.YNc(12,Ki,13,3,"div",5),o.qZA(),o.TgZ(13,"div",10),o.TgZ(14,"div",11),o.TgZ(15,"mat-slide-toggle",12),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["uploads.chunk"]=e}),o._uU(16,"Chunked Uploads"),o.qZA(),o.TgZ(17,"p",13),o._uU(18," When enabled larger files will be uploaded in smaller chunks to improve upload reliability and avoid server max upload size limits. "),o.qZA(),o.qZA(),o.YNc(19,ta,6,1,"div",5),o.TgZ(20,"div",14),o.TgZ(21,"div",1),o._uU(22,"Important"),o.qZA(),o.TgZ(23,"p"),o._uU(24),o.ALo(25,"trans"),o.TgZ(26,"strong"),o._uU(27),o.ALo(28,"async"),o.qZA(),o._uU(29,". "),o.qZA(),o.qZA(),o.YNc(30,ea,5,1,"div",15),o.qZA(),o.TgZ(31,"div",16),o.TgZ(32,"label",17),o._uU(33,"Maximum file size"),o.qZA(),o.TgZ(34,"space-input",18),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["uploads.max_size"]=e}),o.qZA(),o.TgZ(35,"p",13),o._uU(36,"Maximum size for a single file user can upload."),o.qZA(),o.qZA(),o.TgZ(37,"div",16),o.TgZ(38,"label",19),o._uU(39,"Available Space"),o.qZA(),o.TgZ(40,"space-input",20),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["uploads.available_space"]=e}),o.qZA(),o.TgZ(41,"p",13),o._uU(42," Disk space each user uploads are allowed to take up. This can be overridden per user. "),o.qZA(),o.qZA(),o.TgZ(43,"div",16),o.TgZ(44,"label",21),o._uU(45,"Allowed file types"),o.qZA(),o.TgZ(46,"chip-input",22),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().allowedExtensions=e}),o.qZA(),o.TgZ(47,"p",13),o._uU(48," List of allowed file types (jpg, mp3, pdf etc.). Leave empty to allow all file types. "),o.qZA(),o.qZA(),o.TgZ(49,"div",16),o.TgZ(50,"label",23),o._uU(51,"Blocked file types"),o.qZA(),o.TgZ(52,"chip-input",24),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().blockedExtensions=e}),o.qZA(),o.TgZ(53,"p",13),o._uU(54,"Prevent uploading of these file types, even if they are allowed above."),o.qZA(),o.qZA(),o.TgZ(55,"button",25),o.ALo(56,"async"),o._uU(57," Update "),o.qZA(),o.YNc(58,na,1,0,"mat-progress-bar",26),o.ALo(59,"async"),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.xp6(1),o.Q6J("ngIf",n.state.server.uploads_disk_driver),o.xp6(1),o.Q6J("ngIf",n.state.server.public_disk_driver),o.xp6(1),o.ekj("hidden",n.allSelectedDriversAreLocal())("has-error",t.storage_group),o.xp6(1),o.Q6J("ngIf",n.driverSelected("ftp")),o.xp6(1),o.Q6J("ngIf",n.driverSelected("dropbox")),o.xp6(1),o.Q6J("ngIf",n.driverSelected("rackspace")),o.xp6(1),o.Q6J("ngIf",n.driverSelected("s3")),o.xp6(1),o.Q6J("ngIf",n.driverSelected("digitalocean")),o.xp6(1),o.Q6J("ngIf",n.driverSelected("backblaze")),o.xp6(1),o.Q6J("ngIf",t.storage_group),o.xp6(2),o.Q6J("ngIf",n.driverSelected("local")),o.xp6(3),o.Q6J("ngModel",n.state.client["uploads.chunk"]),o.xp6(4),o.Q6J("ngIf",n.state.client["uploads.chunk"]),o.xp6(5),o.hij(" ",o.lcZ(25,25,"Maximum upload size on your server currently is set to")," "),o.xp6(3),o.Oqu(o.lcZ(28,27,n.serverMaxUploadSize$)),o.xp6(3),o.Q6J("ngIf",n.state.client["uploads.chunk"]),o.xp6(4),o.Q6J("ngModel",n.state.client["uploads.max_size"]),o.xp6(6),o.Q6J("ngModel",n.state.client["uploads.available_space"]),o.xp6(6),o.Q6J("ngModel",n.allowedExtensions),o.xp6(6),o.Q6J("ngModel",n.blockedExtensions),o.xp6(3),o.Q6J("disabled",o.lcZ(56,29,n.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(59,31,n.state.loading$))}}let aa=(()=>{class t extends Ce{constructor(){super(...arguments),this.allowedExtensions=[],this.blockedExtensions=[],this.serverMaxUploadSize$=new v.xQ}ngOnInit(){this.allowedExtensions=this.settings.getJson("uploads.allowed_extensions",[]),this.blockedExtensions=this.settings.getJson("uploads.blocked_extensions",[]),this.getServerMaxUploadSize()}saveSettings(){this.setJson("uploads.allowed_extensions",oa(this.allowedExtensions)),this.setJson("uploads.blocked_extensions",oa(this.blockedExtensions)),super.saveSettings()}driverSelected(t){return[this.state.server.uploads_disk_driver,this.state.server.public_disk_driver].includes(t)}allSelectedDriversAreLocal(){return[this.state.server.uploads_disk_driver,this.state.server.public_disk_driver].every(t=>!t||"local"===t)}getServerMaxUploadSize(){this.http.get("uploads/server-max-file-size").subscribe(t=>{this.serverMaxUploadSize$.next(t.maxSize)})}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["uploading-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"ngSubmit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"ngSubmit"],["class","input-container",4,"ngIf"],["id","storage_group",1,"error-group","storage-credentials-group"],["class","many-inputs credentials-form",4,"ngIf"],["class","error",3,"innerHTML",4,"ngIf"],["id","static_delivery_group",1,"error-group","no-bottom-border"],[1,"error-group"],[1,"setting-toggle-container"],["name","uploads.chunk","id","uploads.chunk","trans","",3,"ngModel","ngModelChange"],["trans",""],[1,"widget","widget-important"],["class","setting-toggle-container",4,"ngIf"],[1,"input-container"],["for","uploads.max_size","trans",""],["name","uploads.max_size","id","uploads.max_size",3,"ngModel","ngModelChange"],["for","uploads.available_space","trans",""],["name","uploads.available_space","id","uploads.available_space",3,"ngModel","ngModelChange"],["for","allowed_extensions","trans",""],["id","allowed_extensions","name","allowed_extensions","placeholder","Enter file type...",3,"ngModel","ngModelChange"],["for","blocked_extensions","trans",""],["id","blocked_extensions","name","blocked_extensions","placeholder","Enter file type...",3,"ngModel","ngModelChange"],["mat-raised-button","","color","accent","type","submit","trans","",1,"update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["for","uploads_disk_driver","trans",""],["name","uploads_disk_driver","id","uploads_disk_driver",3,"ngModel","ngModelChange"],["value","local","trans",""],["value","s3"],["value","ftp"],["value","digitalocean"],["value","backblaze"],["value","dropbox"],["value","rackspace"],["for","public_disk_driver","trans",""],["name","public_disk_driver","id","public_disk_driver",3,"ngModel","ngModelChange"],[1,"many-inputs","credentials-form"],[1,"error",3,"innerHTML"],["for","static_file_delivery","trans",""],["name","static_file_delivery","id","static_file_delivery",3,"ngModel","ngModelChange"],["trans","",3,"ngValue"],["value","xsendfile"],["value","xaccel"],["for","uploads.chunk_size","trans",""],["name","uploads.chunk_size","id","uploads.chunk_size",3,"ngModel","ngModelChange"],["name","uploads.resume","id","uploads.resume","trans","",3,"ngModel","ngModelChange"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"User Uploads"),o.qZA(),o.TgZ(3,"div",2),o._uU(4," Configure size and type of files that users are able to upload. This will affect all uploads across the site. "),o.qZA(),o.qZA(),o.YNc(5,ia,60,33,"form",3),o.ALo(6,"async")),2&t&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,e.state.errors$)))},directives:[qe.P,i.O5,a.JL,a.F,T.Rr,a.JJ,a.On,Si,mi.S,p.lW,a.EJ,a.YN,a.Kr,Di,Qi,Yi,Li,Fi,Ei,k.pW],pipes:[i.Ov,le.R],styles:[".storage-credentials-group[_ngcontent-%COMP%]{border-bottom:none}.credentials-form[_ngcontent-%COMP%]{display:block}.credentials-form[_ngcontent-%COMP%]:not(:last-child){margin-bottom:20px;border-bottom:1px solid var(--be-divider-default)}"],changeDetection:0}),t})();function oa(t){return t.map(t=>t.replace(/^\./,""))}function sa(t){return[].concat.apply([],t)}function ra(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"mat-slide-toggle",17),o.NdJ("ngModelChange",function(e){const n=o.CHM(t).$implicit;return o.oxw(2).state.client[n.key]=e}),o._uU(2),o.ALo(3,"trans"),o.qZA(),o.TgZ(4,"p"),o._uU(5),o.ALo(6,"trans"),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("name",t.key)("id",t.key)("ngModel",n.state.client[t.key]),o.xp6(1),o.Oqu(o.lcZ(3,5,t.name)),o.xp6(3),o.Oqu(o.lcZ(6,7,t.description))}}function la(t,e){if(1&t&&(o.TgZ(0,"p",18),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t["recaptcha.site_key"])}}function ca(t,e){if(1&t&&(o.TgZ(0,"p",18),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.hij(" ",t["recaptcha.secret_key"]," ")}}function da(t,e){if(1&t&&o._UZ(0,"p",19),2&t){const t=o.oxw().ngIf;o.Q6J("innerHTML",t.recaptcha_group,o.oJD)}}function ua(t,e){1&t&&o._UZ(0,"mat-progress-bar",20)}function pa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",4),o.NdJ("submit",function(){return o.CHM(t),o.oxw().saveSettings()}),o.YNc(1,ra,7,9,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"div",7),o.TgZ(4,"label",8),o._uU(5,"Recaptcha V3 Site Key"),o.qZA(),o.TgZ(6,"input",9),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["recaptcha.site_key"]=e}),o.qZA(),o.YNc(7,la,2,1,"p",10),o.qZA(),o.TgZ(8,"div",7),o.TgZ(9,"label",11),o._uU(10,"Recaptcha V3 Secret Key"),o.qZA(),o.TgZ(11,"input",12),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["recaptcha.secret_key"]=e}),o.qZA(),o.YNc(12,ca,2,1,"p",10),o.qZA(),o.YNc(13,da,1,1,"p",13),o.qZA(),o.TgZ(14,"button",14),o.ALo(15,"async"),o._uU(16," Update "),o.qZA(),o.YNc(17,ua,1,0,"mat-progress-bar",15),o.ALo(18,"async"),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.xp6(1),o.Q6J("ngForOf",n.actions),o.xp6(1),o.ekj("has-error",t.recaptcha_group),o.xp6(1),o.ekj("has-error",t["recaptcha.site_key"]),o.xp6(3),o.Q6J("ngModel",n.state.client["recaptcha.site_key"]),o.xp6(1),o.Q6J("ngIf",t["recaptcha.site_key"]),o.xp6(1),o.ekj("has-error",t["recaptcha.secret_key"]),o.xp6(3),o.Q6J("ngModel",n.state.client["recaptcha.secret_key"]),o.xp6(1),o.Q6J("ngIf",t["recaptcha.secret_key"]),o.xp6(1),o.Q6J("ngIf",t.recaptcha_group),o.xp6(1),o.Q6J("disabled",o.lcZ(15,14,n.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(18,16,n.state.loading$))}}let ga=(()=>{class t extends Ce{constructor(t,e,n,i,a,o,s,r,l,c,d,u){super(t,e,n,i,a,o,s,r,l,c,d),this.settings=t,this.toast=e,this.http=n,this.modal=i,this.route=a,this.customHomepage=o,this.valueLists=s,this.cd=r,this.router=l,this.social=c,this.state=d,this.recaptchaActions=u,this.actions=sa(this.recaptchaActions).reverse()}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(oe.Z),o.Y36(ye.F),o.Y36(s.r),o.Y36(Ae.u),o.Y36(r.gz),o.Y36(we.Y),o.Y36(ke.l),o.Y36(o.sBO),o.Y36(r.F0),o.Y36(Te.x),o.Y36(d),o.Y36(S))},t.\u0275cmp=o.Xpm({type:t,selectors:[["recaptcha-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:7,vars:3,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["class","body many-inputs","ngNativeValidate","",3,"submit",4,"ngIf"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["class","setting-toggle-container",4,"ngFor","ngForOf"],["id","recaptcha-group",1,"error-group","many-inputs","no-spacing"],[1,"input-container"],["for","recaptcha.site_key","trans",""],["name","recaptcha.site_key","id","recaptcha.site_key",3,"ngModel","ngModelChange"],["class","error",4,"ngIf"],["for","recaptcha.secret_key","trans",""],["name","recaptcha.secret_key","id","recaptcha.secret_key",3,"ngModel","ngModelChange"],["class","error",3,"innerHTML",4,"ngIf"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"setting-toggle-container"],[3,"name","id","ngModel","ngModelChange"],[1,"error"],[1,"error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Recaptcha"),o.qZA(),o.TgZ(3,"div",2),o._uU(4,"Configure google recaptcha integration and credentials."),o.qZA(),o.qZA(),o.YNc(5,pa,19,18,"form",3),o.ALo(6,"async")),2&t&&(o.xp6(5),o.Q6J("ngIf",o.lcZ(6,1,e.state.errors$)))},directives:[qe.P,i.O5,a.JL,a.F,i.sg,a.Fj,a.JJ,a.On,p.lW,T.Rr,k.pW],pipes:[i.Ov,le.R],encapsulation:2,changeDetection:0}),t})();var ha=n(35331),ma=n(36024),fa=n(62424),ba=n(28505),va=n(71228),_a=n(5084),Za=n(6006);class xa{constructor(t,e){this.key=e,this.selected=[],this.selected=[...t],this.key=e||"id"}isSelected(t){return this.findIndex(t)>-1}toggle(t){const e=this.findIndex(t);e>-1?this.selected.splice(e,1):this.selected.push(Object.assign({},t))}updateValue(t){const e=this.findIndex(t);this.selected[e]=Object.assign({},t)}getValue(t){return this.selected.find(e=>e[this.key]===t)}values(){return[...this.selected]}findIndex(t){return this.selected.findIndex(e=>e[this.key]===t[this.key])}}var ya=n(9823);let Aa=(()=>{class t{constructor(t){this.httpClient=t}getRoles(){return this.httpClient.getWithCache("roles?perPage=15")}createNew(t){return this.httpClient.post("roles",t)}update(t,e){return this.httpClient.put("roles/"+t,e)}delete(t){return this.httpClient.delete("roles/"+t)}addUsers(t,e){return this.httpClient.post("roles/"+t+"/add-users",{userIds:e})}removeUsers(t,e){return this.httpClient.post("roles/"+t+"/remove-users",{ids:e})}}return t.\u0275fac=function(e){return new(e||t)(o.LFG(ya.F))},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function wa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"li",10),o.TgZ(1,"div",11),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().selectionModel.toggle(e)}),o.TgZ(2,"div",12),o.TgZ(3,"div",13),o._uU(4),o.qZA(),o.qZA(),o._UZ(5,"mat-pseudo-checkbox",14),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.xp6(4),o.Oqu(t.name),o.xp6(1),o.Q6J("state",n.selectionModel.isSelected(t)?"checked":"unchecked")}}let ka=(()=>{class t{constructor(t,e,n){this.rolesService=t,this.dialogRef=e,this.data=n,this.allRoles$=new c.X([]),this.selectionModel=new xa(this.data.initialRoles||[],"id")}ngOnInit(){this.fetchAllRoles()}confirm(){this.close(this.selectionModel.values())}close(t){this.dialogRef.close(t)}fetchAllRoles(){this.rolesService.getRoles().subscribe(t=>this.allRoles$.next(t.pagination.data))}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Aa),o.Y36(m.so),o.Y36(m.WI))},t.\u0275cmp=o.Xpm({type:t,selectors:[["select-roles-modal"]],decls:15,vars:3,consts:[[1,"modal-header"],["mat-dialog-title","","trans","",1,"modal-title"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"ngSubmit"],[1,"unstyled-list","selection-list"],["class","list-item",4,"ngFor","ngForOf"],[1,"buttons","right","mat-dialog-actions"],["mat-button","","type","button","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans",""],[1,"list-item"],["matRipple","",1,"list-item-header",3,"click"],[1,"meta"],[1,"list-item-name"],[3,"state"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o._uU(2,"Select Roles"),o.qZA(),o.TgZ(3,"button",2),o.NdJ("click",function(){return e.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.TgZ(5,"form",4),o.NdJ("ngSubmit",function(){return e.confirm()}),o.TgZ(6,"mat-dialog-content"),o.TgZ(7,"ul",5),o.YNc(8,wa,6,2,"li",6),o.ALo(9,"async"),o.qZA(),o.qZA(),o.TgZ(10,"mat-dialog-actions",7),o.TgZ(11,"button",8),o.NdJ("click",function(){return e.close()}),o._uU(12,"Cancel"),o.qZA(),o.TgZ(13,"button",9),o._uU(14,"Select"),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(8),o.Q6J("ngForOf",o.lcZ(9,1,e.allRoles$)))},directives:[m.uh,qe.P,P.Hw,a.JL,a.F,m.xY,i.sg,m.H8,p.lW,Z.wG,Z.nP],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.list-item[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),t})();function Ta(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",9),o.TgZ(1,"button",10),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).openSelectRolesModal()}),o._uU(2,"Manage"),o.qZA(),o.qZA()}}function Ca(t,e){1&t&&(o.TgZ(0,"div",11),o._uU(1,"No roles yet."),o.qZA())}function qa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-chip",12),o.NdJ("removed",function(){const e=o.CHM(t).$implicit;return o.oxw(2).detachRole(e)}),o.TgZ(1,"span",13),o._uU(2),o.qZA(),o._UZ(3,"mat-icon",14),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw(2);o.Q6J("removable",!0)("disabled",n.readonly),o.xp6(2),o.Oqu(t.name)}}function Ua(t,e){if(1&t&&(o.TgZ(0,"div",1),o.TgZ(1,"div",2),o.TgZ(2,"div",3),o._uU(3,"Roles"),o.qZA(),o.YNc(4,Ta,3,0,"div",4),o.qZA(),o.TgZ(5,"div",5),o.YNc(6,Ca,2,0,"div",6),o.ALo(7,"async"),o.TgZ(8,"mat-chip-list",7),o.YNc(9,qa,4,3,"mat-chip",8),o.ALo(10,"async"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.oxw();let e;o.xp6(4),o.Q6J("ngIf",!t.readonly),o.xp6(2),o.Q6J("ngIf",!(null!=(e=o.lcZ(7,4,t.roles$))&&e.length)),o.xp6(2),o.Q6J("selectable",!1),o.xp6(1),o.Q6J("ngForOf",o.lcZ(10,6,t.roles$))}}let Ia=(()=>{class t{constructor(t,e,n,i){this.users=t,this.roleApi=e,this.modal=n,this.currentUser=i,this.roles$=new c.X([]),this.readonly=!1}openSelectRolesModal(){this.modal.open(ka,{initialRoles:this.roles$.value}).afterClosed().subscribe(t=>{t&&this.setRoles(t)})}setRoles(t){this.roles$.next(t),this.propagateChange(this.roles$.value)}detachRole(t){const e=this.roles$.value.filter(e=>e.id!==t.id);this.setRoles(e)}writeValue(t){this.roles$.next(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(fa.Q),o.Y36(Aa),o.Y36(Ae.u),o.Y36(ba.I))},t.\u0275cmp=o.Xpm({type:t,selectors:[["role-manager"]],inputs:{readonly:"readonly"},features:[o._Bn([{provide:a.JU,useExisting:t,multi:!0}])],decls:1,vars:1,consts:[["class","panel-outter",4,"ngIf"],[1,"panel-outter"],[1,"header"],["trans","",1,"title"],["class","add-button",4,"ngIf"],[1,"panel-body","roles"],["class","no-permissions","trans","",4,"ngIf"],[3,"selectable"],[3,"removable","disabled","removed",4,"ngFor","ngForOf"],[1,"add-button"],["mat-flat-button","","color","accent","type","button","trans","",1,"select-roles-modal-button",3,"click"],["trans","",1,"no-permissions"],[3,"removable","disabled","removed"],[1,"role-name"],["svgIcon","cancel","matChipRemove",""]],template:function(t,e){1&t&&o.YNc(0,Ua,11,8,"div",0),2&t&&o.Q6J("ngIf",e.currentUser.hasPermission("roles.update"))},directives:[i.O5,qe.P,h.qn,i.sg,p.lW,h.HS,P.Hw,h.qH],pipes:[i.Ov],styles:[".panel-outter[_ngcontent-%COMP%]{margin:10px 0 20px}.header[_ngcontent-%COMP%]{display:flex;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--be-divider-default);align-items:flex-end}.title[_ngcontent-%COMP%]{font-weight:500}.add-button[_ngcontent-%COMP%]{text-align:right;flex:1 1 auto}.role-name[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),t})();var Ma=n(42300);function Oa(t,e){if(1&t&&(o.TgZ(0,"p",21),o._uU(1),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.hij(" ",t.description," ")}}function Ja(t,e){if(1&t&&(o.TgZ(0,"p",31),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).$implicit;o.xp6(1),o.hij(" ",t.description," ")}}function Pa(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",27),o.TgZ(1,"label",28),o._uU(2),o.qZA(),o.TgZ(3,"input",29),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().$implicit.value=e}),o.qZA(),o.YNc(4,Ja,2,1,"p",30),o.qZA()}if(2&t){const t=o.oxw().$implicit,e=o.oxw(2).$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("for",e.name+"-"+t.name),o.xp6(1),o.Oqu(n.viewName(t.name)),o.xp6(1),o.Q6J("id",e.name+"-"+t.name)("ngModel",t.value),o.xp6(1),o.Q6J("ngIf",t.description)}}function Na(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-slide-toggle",34),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).$implicit.value=e}),o._uU(1),o.qZA()}if(2&t){const t=o.oxw(2).$implicit,e=o.oxw(2).$implicit,n=o.oxw(2);o.Q6J("id",e.name+"-"+t.name)("ngModel",t.value),o.xp6(1),o.Oqu(n.viewName(t.name))}}function Sa(t,e){if(1&t&&(o.TgZ(0,"p",31),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).$implicit;o.xp6(1),o.hij(" ",t.description," ")}}function Da(t,e){if(1&t&&(o.TgZ(0,"div",32),o.YNc(1,Na,2,3,"mat-slide-toggle",33),o.YNc(2,Sa,2,1,"p",30),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngSwitchCase","bool"),o.xp6(1),o.Q6J("ngIf",t.description)}}function Qa(t,e){if(1&t&&(o.ynx(0),o.ynx(1,24),o.YNc(2,Pa,5,5,"div",25),o.YNc(3,Da,3,2,"div",26),o.BQk(),o.BQk()),2&t){const t=e.$implicit;o.xp6(1),o.Q6J("ngSwitch",t.type),o.xp6(1),o.Q6J("ngSwitchCase","number"),o.xp6(1),o.Q6J("ngSwitchCase","bool")}}function Ya(t,e){if(1&t&&(o.TgZ(0,"div",22),o.YNc(1,Qa,4,3,"ng-container",23),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",t.restrictions)}}function La(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"li",14),o.TgZ(1,"div",15),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(2).selectionModel.toggle(e)}),o.TgZ(2,"div",16),o.TgZ(3,"div",17),o._uU(4),o.qZA(),o.YNc(5,Oa,2,1,"p",18),o.qZA(),o._UZ(6,"mat-pseudo-checkbox",19),o.qZA(),o.YNc(7,Ya,2,1,"div",20),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw(2);o.xp6(4),o.hij(" ",t.display_name||t.name," "),o.xp6(1),o.Q6J("ngIf",t.description),o.xp6(1),o.Q6J("state",n.selectionModel.isSelected(t)?"checked":"unchecked"),o.xp6(1),o.Q6J("ngIf",!(null!=n.data&&n.data.hideRestrictions)&&(null==t.restrictions?null:t.restrictions.length)&&n.selectionModel.isSelected(t))}}function Fa(t,e){if(1&t&&(o.TgZ(0,"mat-expansion-panel",10),o.TgZ(1,"mat-expansion-panel-header"),o.TgZ(2,"mat-panel-title",11),o._uU(3),o.qZA(),o.qZA(),o.TgZ(4,"ul",12),o.YNc(5,La,8,4,"li",13),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.Q6J("expanded",!1),o.xp6(3),o.Oqu(t.key.replace("_"," ")),o.xp6(2),o.Q6J("ngForOf",t.value)}}let Ea=(()=>{class t{constructor(t,e,n){this.dialogRef=t,this.data=e,this.values=n,this.allPermissions$=new c.X({}),this.filteredPermissions$=new c.X({}),this.loading$=new c.X(!1),this.selectionModel=new xa(this.data.initialPermissions||[],"name"),this.showAdvancedControl=new a.NI(!1)}ngOnInit(){this.fetchAllPermissions(),this.showAdvancedControl.valueChanges.subscribe(()=>{this.setShowAdvanced()})}confirm(){this.close(this.getSelectedPermissions())}close(t){this.dialogRef.close(t)}fetchAllPermissions(){const t=this.data.valueListKey||"permissions";this.loading$.next(!0),this.values.get([t]).pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(e=>{const n=this.mergeRestrictions(e[t]).reduce(function(t,e){return(t[e.group]=t[e.group]||[]).push(e),t},{});this.allPermissions$.next(n),this.setShowAdvanced()})}setShowAdvanced(){const t=this.allPermissions$.value,e={};Object.keys(t).forEach(n=>{const i=t[n].filter(t=>this.showAdvancedControl.value||!t.advanced);i.length&&(e[n]=i)}),this.filteredPermissions$.next(e)}getSelectedPermissions(){return sa(Object.values(this.allPermissions$.value)).filter(t=>this.selectionModel.isSelected(t))}mergeRestrictions(t){return t.map(t=>{const e=this.selectionModel.getValue(t.name);return t.restrictions=(t.restrictions||[]).map(t=>{let n={};return e&&e.restrictions&&(n=e.restrictions.find(e=>e.name===t.name)||{}),Object.assign(Object.assign({},t),n)}),t})}viewName(t){return t.replace(/_/g," ")}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(m.so),o.Y36(m.WI),o.Y36(ke.l))},t.\u0275cmp=o.Xpm({type:t,selectors:[["select-permissions-modal"]],decls:20,vars:9,consts:[[1,"modal-header"],["mat-dialog-title","","trans","",1,"modal-title","mat-dialog-title"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["class","mat-elevation-z2",3,"expanded",4,"ngFor","ngForOf"],[1,"show-advanced-container"],["trans","",3,"formControl"],["mat-button","","type","button","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans","",3,"click"],[1,"overlay","overlay-partial",3,"isVisible"],[1,"mat-elevation-z2",3,"expanded"],["trans",""],[1,"unstyled-list","selection-list"],["class","list-item",4,"ngFor","ngForOf"],[1,"list-item"],["matRipple","",1,"list-item-header",3,"click"],[1,"meta"],["trans","",1,"list-item-name"],["class","list-item-description","trans","",4,"ngIf"],[3,"state"],["class","list-item-restrictions",4,"ngIf"],["trans","",1,"list-item-description"],[1,"list-item-restrictions"],[4,"ngFor","ngForOf"],[3,"ngSwitch"],["class","input-container list-item-restriction",4,"ngSwitchCase"],["class","setting-toggle-container list-item-restriction",4,"ngSwitchCase"],[1,"input-container","list-item-restriction"],[3,"for"],["type","number","min","0",3,"id","ngModel","ngModelChange"],["class","description","trans","",4,"ngIf"],["trans","",1,"description"],[1,"setting-toggle-container","list-item-restriction"],["trans","",3,"id","ngModel","ngModelChange",4,"ngSwitchCase"],["trans","",3,"id","ngModel","ngModelChange"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o._uU(2,"Select Permissions"),o.qZA(),o.TgZ(3,"button",2),o.NdJ("click",function(){return e.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.TgZ(5,"mat-dialog-content"),o.TgZ(6,"mat-accordion"),o.YNc(7,Fa,6,3,"mat-expansion-panel",4),o.ALo(8,"keyvalue"),o.ALo(9,"async"),o.qZA(),o.TgZ(10,"div",5),o.TgZ(11,"mat-slide-toggle",6),o._uU(12,"Show advanced permissions"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(13,"mat-dialog-actions"),o.TgZ(14,"button",7),o.NdJ("click",function(){return e.close()}),o._uU(15,"Cancel"),o.qZA(),o.TgZ(16,"button",8),o.NdJ("click",function(){return e.confirm()}),o._uU(17,"Select"),o.qZA(),o.qZA(),o._UZ(18,"loading-indicator",9),o.ALo(19,"async")),2&t&&(o.xp6(7),o.Q6J("ngForOf",o.lcZ(8,3,o.lcZ(9,5,e.filteredPermissions$))),o.xp6(4),o.Q6J("formControl",e.showAdvancedControl),o.xp6(7),o.Q6J("isVisible",o.lcZ(19,7,e.loading$)))},directives:[m.uh,qe.P,P.Hw,m.xY,Kt.pp,i.sg,T.Rr,a.JJ,a.oH,m.H8,p.lW,Ma.Q,Kt.ib,Kt.yz,Kt.yK,Z.wG,i.O5,Z.nP,i.RF,i.n9,a.qQ,a.wV,a.Fj,a.On],pipes:[i.Nd,i.Ov],styles:["[_nghost-%COMP%]{display:block;width:550px;max-width:100%;position:relative}.mat-expansion-panel-header-title[_ngcontent-%COMP%]{text-transform:capitalize}p[_ngcontent-%COMP%]{color:var(--be-secondary-text);font-size:1.3rem}.setting-toggle-container[_ngcontent-%COMP%]{margin-bottom:0}.show-advanced-container[_ngcontent-%COMP%]{margin-top:25px;margin-bottom:20px}"],changeDetection:0}),t})();function Ra(t,e){1&t&&(o.TgZ(0,"div",7),o._uU(1,"No permissions yet."),o.qZA())}function $a(t,e){if(1&t&&(o.TgZ(0,"span"),o._uU(1),o.ALo(2,"trans"),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.hij("(",o.lcZ(2,1,t.value+" max"),")")}}function Va(t,e){if(1&t&&(o.ynx(0),o.YNc(1,$a,3,3,"span",10),o.BQk()),2&t){const t=e.ngIf;o.xp6(1),o.Q6J("ngIf",t.value)}}function Ba(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-chip",8),o.NdJ("removed",function(){const e=o.CHM(t).$implicit;return o.oxw().removePermission(e.name)}),o.TgZ(1,"span"),o.TgZ(2,"span",9),o._uU(3),o.qZA(),o.YNc(4,Va,2,1,"ng-container",10),o.qZA(),o._UZ(5,"mat-icon",11),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.Q6J("removable",!0),o.xp6(3),o.Oqu(t.name),o.xp6(1),o.Q6J("ngIf",n.getCountRestriction(t))}}let Ha=(()=>{class t{constructor(t){this.modal=t,this.valueListKey="permissions",this.hideRestrictions=!1,this.permissions$=new c.X([])}showSelectPermissionsModal(){this.modal.open(Ea,{initialPermissions:this.permissions$.value,valueListKey:this.valueListKey,hideRestrictions:this.hideRestrictions}).afterClosed().subscribe(t=>{t&&this.setPermissions(t)})}removePermission(t){const e=this.permissions$.value.filter(e=>e.name!==t);this.setPermissions(e)}setPermissions(t){this.permissions$.next(t),this.propagateChange(this.permissions$.value)}getCountRestriction(t){return t.restrictions.find(t=>"count"===t.name)}writeValue(t){this.permissions$.next(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Ae.u))},t.\u0275cmp=o.Xpm({type:t,selectors:[["permission-manager"]],inputs:{valueListKey:"valueListKey",hideRestrictions:"hideRestrictions"},features:[o._Bn([{provide:a.JU,useExisting:t,multi:!0}])],decls:11,vars:7,consts:[[1,"header"],["trans","",1,"title"],["mat-flat-button","","color","accent","type","button","trans","",3,"click"],[1,"manage-permissions"],["class","no-permissions","trans","",4,"ngIf"],[3,"selectable"],[3,"removable","removed",4,"ngFor","ngForOf"],["trans","",1,"no-permissions"],[3,"removable","removed"],["trans",""],[4,"ngIf"],["svgIcon","cancel","matChipRemove",""]],template:function(t,e){if(1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"span",1),o._uU(2,"Permissions"),o.qZA(),o.TgZ(3,"button",2),o.NdJ("click",function(){return e.showSelectPermissionsModal()}),o._uU(4,"Manage"),o.qZA(),o.qZA(),o.TgZ(5,"div",3),o.YNc(6,Ra,2,0,"div",4),o.ALo(7,"async"),o.TgZ(8,"mat-chip-list",5),o.YNc(9,Ba,6,3,"mat-chip",6),o.ALo(10,"async"),o.qZA(),o.qZA()),2&t){let t;o.xp6(6),o.Q6J("ngIf",!(null!=(t=o.lcZ(7,3,e.permissions$))&&t.length)),o.xp6(2),o.Q6J("selectable",!1),o.xp6(1),o.Q6J("ngForOf",o.lcZ(10,5,e.permissions$))}},directives:[qe.P,p.lW,i.O5,h.qn,i.sg,h.HS,P.Hw,h.qH],pipes:[i.Ov,le.R],styles:["[_nghost-%COMP%]{display:block;margin:25px 0 35px}.header[_ngcontent-%COMP%]{display:flex;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--be-divider-default);align-items:flex-end}.title[_ngcontent-%COMP%]{font-weight:500}button[_ngcontent-%COMP%]{margin-left:auto}.error[_ngcontent-%COMP%]{margin-top:10px;color:#f44336}"],changeDetection:0}),t})();function za(t,e){1&t&&(o.TgZ(0,"h2",5),o._uU(1,"Update User Details"),o.qZA())}function Ga(t,e){1&t&&(o.TgZ(0,"h2",5),o._uU(1,"Create a New User"),o.qZA())}function ja(t,e){if(1&t&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(1),o.Oqu(null==t?null:t.email)}}function Xa(t,e){if(1&t&&(o.TgZ(0,"div",13),o.TgZ(1,"label",35),o._uU(2,"Email"),o.qZA(),o._UZ(3,"input",36),o.YNc(4,ja,2,1,"div",12),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(4),o.Q6J("ngIf",null==t?null:t.email)}}function Wa(t,e){if(1&t&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(1),o.Oqu(null==t?null:t.password)}}function Ka(t,e){if(1&t&&(o.TgZ(0,"div",13),o.TgZ(1,"label",38),o._uU(2,"Password"),o.qZA(),o._UZ(3,"input",39),o.YNc(4,Wa,2,1,"div",12),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(4),o.Q6J("ngIf",null==t?null:t.password)}}function to(t,e){if(1&t&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(null==t?null:t.avatar)}}function eo(t,e){if(1&t&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(null==t?null:t.first_name)}}function no(t,e){if(1&t&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(null==t?null:t.last_name)}}function io(t,e){if(1&t&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(null==t?null:t.email_verified_at)}}function ao(t,e){if(1&t&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(null==t?null:t.available_space)}}function oo(t,e){if(1&t&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(null==t?null:t.roles)}}function so(t,e){1&t&&o._UZ(0,"permission-manager",40)}function ro(t,e){if(1&t&&(o.TgZ(0,"div",37),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(null==t?null:t.permissions)}}function lo(t,e){1&t&&(o.TgZ(0,"span",41),o._uU(1,"Update User"),o.qZA())}function co(t,e){1&t&&(o.TgZ(0,"span",41),o._uU(1,"Create User"),o.qZA())}function uo(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",6),o.NdJ("ngSubmit",function(){return o.CHM(t),o.oxw().confirm()}),o.TgZ(1,"mat-dialog-content",7),o.YNc(2,Xa,5,1,"div",8),o.YNc(3,Ka,5,1,"div",8),o.TgZ(4,"div",9),o.TgZ(5,"div",10),o._UZ(6,"upload-image-control",11),o.YNc(7,to,2,1,"div",12),o.qZA(),o.TgZ(8,"div",7),o.TgZ(9,"div",13),o.TgZ(10,"label",14),o._uU(11,"First Name"),o.qZA(),o._UZ(12,"input",15),o.YNc(13,eo,2,1,"div",12),o.qZA(),o.TgZ(14,"div",13),o.TgZ(15,"label",16),o._uU(16,"Last Name"),o.qZA(),o._UZ(17,"input",17),o.YNc(18,no,2,1,"div",12),o.qZA(),o.qZA(),o.qZA(),o.TgZ(19,"div",13),o.TgZ(20,"label",18),o._uU(21,"Email Confirmed"),o.qZA(),o.TgZ(22,"div",19),o.TgZ(23,"select",20),o.TgZ(24,"option",21),o._uU(25,"Yes"),o.qZA(),o.TgZ(26,"option",21),o._uU(27,"No"),o.qZA(),o.qZA(),o.TgZ(28,"button",22),o.NdJ("click",function(){return o.CHM(t),o.oxw().sendEmailConfirmation()}),o.ALo(29,"async"),o._uU(30,"Resend"),o.qZA(),o.qZA(),o.YNc(31,io,2,1,"div",12),o.qZA(),o.TgZ(32,"div",13),o.TgZ(33,"label",23),o._uU(34,"New Password"),o.qZA(),o.TgZ(35,"div",24),o._UZ(36,"input",25),o.TgZ(37,"button",26),o.NdJ("click",function(){return o.CHM(t),o.oxw().generateNewPassword()}),o._uU(38,"Generate"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(39,"space-input",27),o.TgZ(40,"p",28),o._uU(41,'Disk space available to user. If left empty, it will be inherited from value set in "admin -> settings -> uploading" page.'),o.qZA(),o.YNc(42,ao,2,1,"div",12),o.qZA(),o._UZ(43,"role-manager",29),o.YNc(44,oo,2,1,"div",12),o.YNc(45,so,1,0,"permission-manager",30),o.YNc(46,ro,2,1,"div",12),o.qZA(),o.TgZ(47,"div",31),o.TgZ(48,"button",32),o.NdJ("click",function(){return o.CHM(t),o.oxw().close()}),o._uU(49,"Cancel"),o.qZA(),o.TgZ(50,"button",33),o.ALo(51,"async"),o.YNc(52,lo,2,0,"span",34),o.YNc(53,co,2,0,"span",34),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.Q6J("formGroup",n.form),o.xp6(2),o.Q6J("ngIf",!n.data.user),o.xp6(1),o.Q6J("ngIf",!n.data.user),o.xp6(3),o.Q6J("uploadConfig",n.avatarUploadConfig()),o.xp6(1),o.Q6J("ngIf",null==t?null:t.avatar),o.xp6(6),o.Q6J("ngIf",null==t?null:t.first_name),o.xp6(5),o.Q6J("ngIf",null==t?null:t.last_name),o.xp6(1),o.ekj("resend-button-visible",n.shouldShowResendButton()),o.xp6(5),o.Q6J("ngValue",!0),o.xp6(2),o.Q6J("ngValue",!1),o.xp6(2),o.Q6J("disabled",o.lcZ(29,20,n.loading$)),o.xp6(3),o.Q6J("ngIf",null==t?null:t.email_verified_at),o.xp6(11),o.Q6J("ngIf",null==t?null:t.available_space),o.xp6(2),o.Q6J("ngIf",null==t?null:t.roles),o.xp6(1),o.Q6J("ngIf",n.currentUser.hasPermission("permissions.update")),o.xp6(1),o.Q6J("ngIf",null==t?null:t.permissions),o.xp6(4),o.Q6J("disabled",o.lcZ(51,22,n.loading$)),o.xp6(2),o.Q6J("ngIf",n.data.user),o.xp6(1),o.Q6J("ngIf",!n.data.user)}}let po=(()=>{class t{constructor(t,e,n,i,a,o,s,r,l){this.dialogRef=t,this.data=e,this.users=n,this.toast=i,this.currentUser=a,this.fb=o,this.auth=s,this.settings=r,this.avatarValidator=l,this.loading$=new c.X(!1),this.form=this.fb.group({email:[""],password:[""],avatar:[""],first_name:[""],last_name:[""],email_verified_at:[!1],available_space:[""],roles:[],permissions:[]}),this.errors$=new c.X({})}ngOnInit(){this.data.user&&this.form.patchValue(Object.assign(Object.assign({},this.data.user),{password:null,email_verified_at:!!this.data.user.email_verified_at}))}confirm(){if(this.loading$.value)return;let t;const e=this.getPayload();this.loading$.next(!0),t=this.data.user?this.users.update(this.data.user.id,e):this.users.create(e),t.pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.close(t.user),this.toast.open("User "+(this.data.user?"updated":"created"))},t=>this.errors$.next(t.errors))}close(t){this.dialogRef.close(t)}getPayload(){const t=Object.assign({},this.form.value);return t.roles=(t.roles||[]).map(t=>t.id),t.permissions=t.permissions||[],t.password||delete t.password,t.email_verified_at=t.email_verified_at?new Date:null,t}sendEmailConfirmation(){this.loading$.next(!0),this.auth.resendEmailConfirmation(this.data.user.email).pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Verification email re-sent.")},t=>{this.toast.open(t.message||ma.v.Default)})}shouldShowResendButton(){return this.data.user&&this.data.user.id&&this.settings.get("require_email_confirmation")&&!this.form.get("email_verified_at").value}avatarUploadConfig(){return{uri:this.data.user?`users/${this.data.user.id}/avatar`:ha.C.Image,httpParams:{diskPrefix:"avatars"},validator:this.avatarValidator}}generateNewPassword(){this.form.patchValue({password:(0,Ci.O)(15)})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(m.so),o.Y36(m.WI),o.Y36(fa.Q),o.Y36(ye.F),o.Y36(ba.I),o.Y36(a.qu),o.Y36(va.e),o.Y36(oe.Z),o.Y36(_a.m))},t.\u0275cmp=o.Xpm({type:t,selectors:[["crupdate-user-modal"]],decls:7,vars:5,consts:[[1,"modal-header"],["class","modal-title","mat-dialog-title","","trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],["mat-dialog-title","","trans","",1,"modal-title"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"many-inputs"],["class","input-container",4,"ngIf"],[1,"avatar-container"],[1,"input-container","avatar-input-container"],["formControlName","avatar",1,"inherit-size",3,"uploadConfig"],["class","error",4,"ngIf"],[1,"input-container"],["for","crupdate-user-first_name","trans",""],["type","text","id","crupdate-user-first_name","formControlName","first_name"],["for","crupdate-user-last_name","trans",""],["type","text","id","crupdate-user-last_name","formControlName","last_name"],["for","crupdate-user-confirmed","trans",""],[1,"confirmed-select-wrapper"],["id","crupdate-user-confirmed","formControlName","email_verified_at"],["trans","",3,"ngValue"],["mat-flat-button","","color","accent","type","button","trans","",1,"resend-confirmation-button",3,"disabled","click"],["for","crupdate-user-new-password","trans",""],[1,"input-with-action"],["type","text","id","crupdate-user-new-password","formControlName","password"],["type","button","mat-flat-button","","color","accent","trans","",3,"click"],["label","Available Space","formControlName","available_space"],["trans","",1,"description"],["formControlName","roles"],["formControlName","permissions",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["type","button","mat-button","","trans","",1,"button","cancel",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary",3,"disabled"],["trans","",4,"ngIf"],["for","crupdate-user-email","trans",""],["type","email","id","crupdate-user-email","formControlName","email","required",""],[1,"error"],["for","crupdate-user-password","trans",""],["type","password","id","crupdate-user-password","formControlName","password","required",""],["formControlName","permissions"],["trans",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.YNc(1,za,2,0,"h2",1),o.YNc(2,Ga,2,0,"h2",1),o.TgZ(3,"button",2),o.NdJ("click",function(){return e.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.YNc(5,uo,54,24,"form",4),o.ALo(6,"async")),2&t&&(o.xp6(1),o.Q6J("ngIf",e.data.user),o.xp6(1),o.Q6J("ngIf",!e.data.user),o.xp6(3),o.Q6J("ngIf",o.lcZ(6,3,e.errors$)))},directives:[i.O5,P.Hw,m.uh,qe.P,a.JL,a.sg,m.xY,Za.V,a.JJ,a.u,a.Fj,a.EJ,a.YN,a.Kr,p.lW,Si,Ia,m.H8,a.Q7,Ha],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:500px;max-width:100%}.avatar-container[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:20px}.avatar-container[_ngcontent-%COMP%]   .many-inputs[_ngcontent-%COMP%]{flex:1 1 auto}.avatar-container[_ngcontent-%COMP%]   .input-container[_ngcontent-%COMP%]:last-of-type{margin-bottom:0}.avatar-input-container[_ngcontent-%COMP%]{flex-shrink:0;width:170px;height:170px;margin-right:15px}.resend-confirmation-button[_ngcontent-%COMP%]{display:none}.resend-button-visible[_ngcontent-%COMP%]   .confirmed-select-wrapper[_ngcontent-%COMP%]{display:flex}.resend-button-visible[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{flex:1;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none}.resend-button-visible[_ngcontent-%COMP%]   .resend-confirmation-button[_ngcontent-%COMP%]{display:block;border-top-left-radius:0;border-bottom-left-radius:0}"],changeDetection:0}),t})();var go=n(56515),ho=n(59075),mo=n(45523);const fo=[new ho.XQ({type:ho.Bq.Select,key:"email_verified_at",label:"Email",description:"Email verification status",defaultValue:{value:null,operator:ho.pg.ne},defaultOperator:ho.pg.ne,options:[{key:"Confirmed",value:{value:null,operator:ho.pg.ne}},{key:"Not Confirmed",value:{value:null,operator:ho.pg.eq}}]}),new mo.T7({description:"Date user registered or was created"}),new mo.yH({description:"Date user was last updated"}),new ho.XQ({type:ho.Bq.Select,key:"subscriptions",label:"Subscribed",description:"Whether user is subscribed or not",defaultValue:{value:"*",operator:ho.pg.has},defaultOperator:ho.pg.ne,options:[{key:"Yes",value:{value:"*",operator:ho.pg.has}},{key:"No",value:{value:"*",operator:ho.pg.doesntHave}}]})];var bo=n(37123),vo=n(34955),_o=n(13536),Zo=n(80922),xo=n(86668),yo=n(54275),Ao=n(71765),wo=n(47210);function ko(t,e){1&t&&o._UZ(0,"mat-progress-bar",22)}function To(t,e){1&t&&(o.TgZ(0,"th",1),o._uU(1,"Subscribed"),o.qZA())}function Co(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",27),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).maybeDeleteSelectedUsers()}),o._uU(1," Delete "),o.qZA()}}const qo=function(t){return{count:t,resource:"user(s)"}};function Uo(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"th",23),o.TgZ(2,"div",24),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",25),o.YNc(5,Co,2,0,"button",26),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,qo,t)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("users.delete"))}}function Io(t,e){if(1&t&&(o.TgZ(0,"td",36),o._uU(1),o.qZA()),2&t){const t=o.oxw().$implicit;o.xp6(1),o.hij(" ",null!=t.subscriptions&&t.subscriptions.length?"Yes":"No"," ")}}function Mo(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",37),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().showCrupdateUserModal(e)}),o.ALo(1,"trans"),o._UZ(2,"mat-icon",38),o.qZA()}2&t&&o.Q6J("matTooltip",o.lcZ(1,1,"Edit user"))}function Oo(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",37),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().loginAs(e)}),o.ALo(1,"trans"),o._UZ(2,"mat-icon",39),o.qZA()}2&t&&o.Q6J("matTooltip",o.lcZ(1,1,"Login as user"))}function Jo(t,e){if(1&t&&(o.TgZ(0,"tr"),o._UZ(1,"td",28),o.TgZ(2,"td"),o._UZ(3,"user-column",29),o.qZA(),o.YNc(4,Io,2,1,"td",30),o.TgZ(5,"td",31),o._uU(6),o.qZA(),o.TgZ(7,"td",32),o._uU(8),o.qZA(),o.TgZ(9,"td",33),o._uU(10),o.qZA(),o.TgZ(11,"td"),o._uU(12),o.ALo(13,"formattedDate"),o.qZA(),o.TgZ(14,"td",34),o.YNc(15,Mo,3,3,"button",35),o.YNc(16,Oo,3,3,"button",35),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(1),o.Q6J("table-body-checkbox",t.id),o.xp6(2),o.Q6J("user",t),o.xp6(1),o.Q6J("ngIf",n.settings.get("billing.enable")),o.xp6(2),o.Oqu(n.makeRolesList(t.roles)),o.xp6(2),o.Oqu(t.first_name||"-"),o.xp6(2),o.Oqu(t.last_name||"-"),o.xp6(2),o.Oqu(o.lcZ(13,9,t.created_at)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("users.update")),o.xp6(1),o.Q6J("ngIf",n.currentUser.hasPermission("admin"))}}function Po(t,e){1&t&&(o.TgZ(0,"no-results-message",40),o.TgZ(1,"span",41),o._uU(2,"No users have been created yet"),o.qZA(),o.qZA())}let No=(()=>{class t{constructor(t,e,n,i,a,o,s){this.userService=t,this.currentUser=e,this.settings=n,this.toast=i,this.datatable=a,this.csv=o,this.http=s,this.filters=fo,this.users$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:fa.Q.BASE_URI,staticParams:{with:["subscriptions"]}})}ngOnDestroy(){this.datatable.destroy()}makeRolesList(t){return t.slice(0,3).map(t=>t.name).join(", ")}maybeDeleteSelectedUsers(){this.datatable.confirmResourceDeletion("users").subscribe(()=>{this.userService.delete(this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Deleted selected users")},t=>{this.toast.open(t.message||ma.v.Default)})})}showCrupdateUserModal(t){this.datatable.openCrupdateResourceModal(po,{user:t}).subscribe()}exportCsv(){this.csv.export(fa.Q.EXPORT_CSV_URI)}loginAs(t){this.http.post(`admin/users/impersonate/${t.id}`).subscribe(()=>{location.reload()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(fa.Q),o.Y36(ba.I),o.Y36(oe.Z),o.Y36(ye.F),o.Y36(go.x),o.Y36(bo.T),o.Y36(s.r))},t.\u0275cmp=o.Xpm({type:t,selectors:[["user-index"]],features:[o._Bn([go.x])],decls:46,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","users",3,"filters"],[1,"action-buttons"],["mat-raised-button","",1,"btn-with-dropdown-icon",3,"matMenuTriggerFor"],["svgIcon","keyboard-arrow-down"],["menu","matMenu"],["mat-menu-item","",3,"click"],["svgIcon","export-csv"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","email","trans",""],["trans","",4,"ngIf"],["table-sort-header","","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","people.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","8"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["mat-raised-button","","color","warn","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],[3,"user"],["data-label","Subscribed",4,"ngIf"],["data-label","Roles"],["data-label","First Name"],["data-label","Last Name"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["data-label","Subscribed"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["svgIcon","login"],["svgImage","people.svg"],["primary-text","","trans",""]],template:function(t,e){if(1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Users"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o.TgZ(5,"div",4),o.TgZ(6,"button",5),o.TgZ(7,"span",1),o._uU(8,"More Actions"),o.qZA(),o._UZ(9,"mat-icon",6),o.qZA(),o.TgZ(10,"mat-menu",null,7),o.TgZ(12,"button",8),o.NdJ("click",function(){return e.exportCsv()}),o._UZ(13,"mat-icon",9),o.TgZ(14,"span",1),o._uU(15,"Export users in CSV"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(16,"button",10),o.NdJ("click",function(){return e.showCrupdateUserModal()}),o._UZ(17,"mat-icon",11),o.TgZ(18,"span",1),o._uU(19,"Add New User"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(20,"div",12),o.YNc(21,ko,1,0,"mat-progress-bar",13),o.ALo(22,"async"),o.TgZ(23,"table",14),o.TgZ(24,"thead"),o.TgZ(25,"tr"),o._UZ(26,"th",15),o.TgZ(27,"th",16),o._uU(28,"User"),o.qZA(),o.YNc(29,To,2,0,"th",17),o.TgZ(30,"th",1),o._uU(31,"Roles"),o.qZA(),o.TgZ(32,"th",18),o._uU(33,"First Name"),o.qZA(),o.TgZ(34,"th",18),o._uU(35,"Last Name"),o.qZA(),o.TgZ(36,"th",18),o._uU(37,"Created At"),o.qZA(),o._UZ(38,"th"),o.qZA(),o.YNc(39,Uo,6,4,"tr",19),o.qZA(),o.TgZ(40,"tbody"),o.YNc(41,Jo,17,11,"tr",20),o.ALo(42,"async"),o.qZA(),o.qZA(),o.YNc(43,Po,3,0,"no-results-message",21),o.ALo(44,"async"),o._UZ(45,"datatable-footer"),o.qZA()),2&t){const t=o.MAs(11);o.xp6(4),o.Q6J("filters",e.filters),o.xp6(2),o.Q6J("matMenuTriggerFor",t),o.xp6(15),o.Q6J("ngIf",o.lcZ(22,7,e.datatable.paginator&&e.datatable.paginator.loading$)),o.xp6(8),o.Q6J("ngIf",e.settings.get("billing.enable")),o.xp6(10),o.Q6J("ngIf",e.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(42,9,e.users$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(44,11,e.datatable.paginator.noResults$))}},directives:[qe.P,vo.h,p.lW,w.p6,P.Hw,w.VK,w.OP,i.O5,_o.e,Zo.p,i.sg,xo.V,k.pW,yo.O,Ao.r,q.gM,wo.U],pipes:[i.Ov,Pn.l,le.R],styles:[".mat-column-permissions[_ngcontent-%COMP%]{max-height:49px}.mat-column-email[_ngcontent-%COMP%]{margin-right:15px}"],changeDetection:0}),t})();class So{constructor(t={}){for(const e in t)this[e]=t[e]}}var Do=n(4694);function Qo(t,e){1&t&&(o.TgZ(0,"h2",5),o._uU(1,"Update Role"),o.qZA())}function Yo(t,e){1&t&&(o.TgZ(0,"h2",5),o._uU(1,"Create a New Role"),o.qZA())}function Lo(t,e){if(1&t&&(o.TgZ(0,"div",21),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.name)}}function Fo(t,e){1&t&&(o.TgZ(0,"div",8),o.TgZ(1,"label",22),o._uU(2,"Type"),o.qZA(),o.TgZ(3,"select",23),o.TgZ(4,"option",24),o._uU(5,"Site Wide"),o.qZA(),o.TgZ(6,"option",25),o._uU(7,"Workspace"),o.qZA(),o.qZA(),o.qZA())}function Eo(t,e){if(1&t&&(o.TgZ(0,"div",21),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(null==t?null:t.permissions)}}function Ro(t,e){if(1&t&&(o.TgZ(0,"div",21),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(1),o.Oqu(t.default)}}function $o(t,e){if(1&t&&(o.TgZ(0,"div",21),o._uU(1),o.qZA()),2&t){const t=o.oxw(3).ngIf;o.xp6(1),o.Oqu(t.guests)}}function Vo(t,e){if(1&t&&(o.TgZ(0,"div",26),o.TgZ(1,"mat-slide-toggle",30),o._uU(2,"Guests"),o.qZA(),o.TgZ(3,"p",28),o._uU(4,"Assign this role to guests (not logged in users)."),o.qZA(),o.YNc(5,$o,2,1,"div",11),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(5),o.Q6J("ngIf",t.guests)}}function Bo(t,e){if(1&t&&(o.ynx(0),o.TgZ(1,"div",26),o.TgZ(2,"mat-slide-toggle",27),o._uU(3,"Default"),o.qZA(),o.TgZ(4,"p",28),o._uU(5,"Assign this role to new users automatically."),o.qZA(),o.YNc(6,Ro,2,1,"div",11),o.qZA(),o.YNc(7,Vo,6,1,"div",29),o.BQk()),2&t){const t=o.oxw().ngIf,e=o.oxw();o.xp6(6),o.Q6J("ngIf",t.default),o.xp6(1),o.Q6J("ngIf","sitewide"===e.form.get("type").value)}}function Ho(t,e){1&t&&(o.TgZ(0,"span",28),o._uU(1,"Update"),o.qZA())}function zo(t,e){1&t&&(o.TgZ(0,"span",28),o._uU(1,"Create"),o.qZA())}function Go(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",6),o.NdJ("submit",function(){return o.CHM(t),o.oxw().confirm()}),o.TgZ(1,"div",7),o.TgZ(2,"div",8),o.TgZ(3,"label",9),o._uU(4,"Name"),o.qZA(),o._UZ(5,"input",10),o.YNc(6,Lo,2,1,"div",11),o.qZA(),o.TgZ(7,"div",8),o.TgZ(8,"label",12),o._uU(9,"Description"),o.qZA(),o._UZ(10,"textarea",13),o.qZA(),o.YNc(11,Fo,8,0,"div",14),o._UZ(12,"permission-manager",15),o.YNc(13,Eo,2,1,"div",11),o.YNc(14,Bo,8,2,"ng-container",16),o.qZA(),o.TgZ(15,"div",17),o.TgZ(16,"button",18),o.NdJ("click",function(){return o.CHM(t),o.oxw().close()}),o._uU(17,"Cancel"),o.qZA(),o.TgZ(18,"button",19),o.ALo(19,"async"),o.YNc(20,Ho,2,0,"span",20),o.YNc(21,zo,2,0,"span",20),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.Q6J("formGroup",n.form),o.xp6(6),o.Q6J("ngIf",t.name),o.xp6(5),o.Q6J("ngIf",n.settings.get("workspaces.integrated")),o.xp6(1),o.Q6J("valueListKey","workspace"===n.form.get("type").value?"workspacePermissions":"permissions")("hideRestrictions",null==n.data||null==n.data.role?null:n.data.role.guests),o.xp6(1),o.Q6J("ngIf",null==t?null:t.permissions),o.xp6(1),o.Q6J("ngIf",!(null!=n.data.role&&n.data.role.internal)),o.xp6(4),o.Q6J("disabled",o.lcZ(19,10,n.loading$)),o.xp6(2),o.Q6J("ngIf",n.data.role),o.xp6(1),o.Q6J("ngIf",!n.data.role)}}let jo=(()=>{class t{constructor(t,e,n,i,a,o,s){this.toast=t,this.roleService=e,this.modal=n,this.fb=i,this.dialogRef=a,this.settings=o,this.data=s,this.form=this.fb.group({name:[""],description:[""],type:["sitewide"],default:[!1],guests:[!1],permissions:[]}),this.loading$=new c.X(!1),this.errors$=new c.X({})}ngOnInit(){this.resetState(),this.data.role&&this.form.patchValue(this.data.role)}close(t){this.resetState(),this.dialogRef.close(t)}confirm(){let t;this.loading$.next(!0),t=this.data.role?this.roleService.update(this.data.role.id,this.form.value):this.roleService.createNew(this.form.value),t.pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open("Role "+(this.data.role?"Updated":"Created")),this.close(t.data)},t=>this.errors$.next(t.errors))}resetState(){this.form.reset(),this.errors$.next({})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(ye.F),o.Y36(Aa),o.Y36(Ae.u),o.Y36(a.qu),o.Y36(m.so),o.Y36(oe.Z),o.Y36(m.WI))},t.\u0275cmp=o.Xpm({type:t,selectors:[["crupdate-role-modal"]],decls:7,vars:5,consts:[[1,"modal-header"],["class","modal-title mat-dialog-title","mat-dialog-title","","trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"formGroup","submit",4,"ngIf"],["mat-dialog-title","","trans","",1,"modal-title","mat-dialog-title"],["autocomplete","off","ngNativeValidate","",3,"formGroup","submit"],["mat-dialog-content","",1,"many-inputs","mat-dialog-content"],[1,"input-container"],["for","name","trans",""],["type","text","formControlName","name","id","name","required",""],["class","error",4,"ngIf"],["for","description","trans",""],["type","text","id","description","formControlName","description","maxlength","190"],["class","input-container",4,"ngIf"],["formControlName","permissions",3,"valueListKey","hideRestrictions"],[4,"ngIf"],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["type","button","mat-button","","trans","",1,"button","cancel",3,"click"],["type","submit","mat-raised-button","","color","accent",3,"disabled"],["trans","",4,"ngIf"],[1,"error"],["for","type","trans",""],["id","type","formControlName","type"],["value","sitewide","trans",""],["value","workspace","trans",""],[1,"setting-container"],["formControlName","default","id","default","trans",""],["trans",""],["class","setting-container",4,"ngIf"],["id","guest","formControlName","guests","trans",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.YNc(1,Qo,2,0,"h2",1),o.YNc(2,Yo,2,0,"h2",1),o.TgZ(3,"button",2),o.NdJ("click",function(){return e.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.YNc(5,Go,22,12,"form",4),o.ALo(6,"async")),2&t&&(o.xp6(1),o.Q6J("ngIf",e.data.role),o.xp6(1),o.Q6J("ngIf",!e.data.role),o.xp6(3),o.Q6J("ngIf",o.lcZ(6,3,e.errors$)))},directives:[i.O5,P.Hw,m.uh,qe.P,a.JL,a.sg,m.xY,a.Fj,a.JJ,a.u,a.Q7,a.nD,Ha,m.H8,p.lW,a.EJ,a.YN,a.Kr,T.Rr],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.setting-container[_ngcontent-%COMP%]{margin-bottom:25px}.setting-container[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:var(--be-secondary-text);margin:5px 0}"],changeDetection:0}),t})();var Xo=n(44415);const Wo=[{originX:"start",originY:"center",overlayX:"end",overlayY:"center",offsetX:50},{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:50}];var Ko=n(7855),ts=n(80147);function es(t,e){1&t&&o.GkF(0)}let ns=(()=>{class t{constructor(t,e){this.data=t,this.overlayPanelRef=e}close(){this.overlayPanelRef.close()}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Ko.p),o.Y36(ts.L))},t.\u0275cmp=o.Xpm({type:t,selectors:[["datatable-filters-panel"]],hostVars:1,hostBindings:function(t,e){2&t&&o.d8E("@dialogContainer","enter")},decls:9,vars:1,consts:[["svgIcon","filter-list"],["trans",""],[1,"body",3,"ngSubmit"],[4,"ngTemplateOutlet"],["type","button","mat-button","","color","accent","trans","",3,"click"]],template:function(t,e){1&t&&(o.TgZ(0,"header"),o._UZ(1,"mat-icon",0),o.TgZ(2,"span",1),o._uU(3,"Filters"),o.qZA(),o.qZA(),o.TgZ(4,"form",2),o.NdJ("ngSubmit",function(){return e.close()}),o.YNc(5,es,1,0,"ng-container",3),o.qZA(),o.TgZ(6,"footer"),o.TgZ(7,"button",4),o.NdJ("click",function(){return e.close()}),o._uU(8,"Close"),o.qZA(),o.qZA()),2&t&&(o.xp6(5),o.Q6J("ngTemplateOutlet",e.data.filters))},directives:[P.Hw,qe.P,a._Y,a.JL,a.F,i.tP,p.lW],styles:["[_nghost-%COMP%]{display:block;min-width:250px;margin:auto;background-color:var(--be-background);border-radius:4px;box-shadow:0 8px 9px -5px rgba(0,0,0,.2),0 15px 22px 2px rgba(0,0,0,.14),0 6px 28px 5px rgba(0,0,0,.12)}header[_ngcontent-%COMP%]{border-bottom:1px solid var(--be-divider-default);padding:15px 20px;margin-bottom:20px;font-weight:500}header[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{vertical-align:middle;margin-right:5px}.body[_ngcontent-%COMP%]{padding-left:20px;padding-right:20px}footer[_ngcontent-%COMP%]{border-top:1px solid var(--be-divider-default);text-align:right;margin-top:10px;padding:10px 20px}"],data:{animation:[m.Nv.dialogContainer]},changeDetection:0}),t})();var is=n(73709),as=n(98979);function os(t,e){1&t&&o._UZ(0,"mat-icon",3)}let ss=(()=>{class t{constructor(t){this.datatable=t,this.hideIcon=!1}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(go.x))},t.\u0275cmp=o.Xpm({type:t,selectors:[["datatable-header-search-input"]],inputs:{placeholder:"placeholder",hideIcon:"hideIcon"},decls:4,vars:5,consts:[[1,"input-container","search-input-container"],["type","text",1,"search-input",3,"placeholder","formControl"],["svgIcon","search",4,"ngIf"],["svgIcon","search"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o._UZ(1,"input",1),o.ALo(2,"trans"),o.YNc(3,os,1,0,"mat-icon",2),o.qZA()),2&t&&(o.xp6(1),o.Q6J("placeholder",o.lcZ(2,3,e.placeholder))("formControl",e.datatable.searchControl),o.xp6(2),o.Q6J("ngIf",!e.hideIcon))},directives:[a.Fj,a.JJ,a.oH,i.O5,P.Hw],pipes:[le.R],styles:[".input-container[_ngcontent-%COMP%]{min-width:250px;position:relative;flex-shrink:0}.input-container[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{position:absolute;top:calc(50% - 12px);right:5px;color:var(--be-secondary-text)}.icon-left[_nghost-%COMP%]   .mat-icon[_ngcontent-%COMP%], .icon-left   [_nghost-%COMP%]   .mat-icon[_ngcontent-%COMP%]{left:10px;right:0}"],changeDetection:0}),t})(),rs=(()=>{class t extends i.rS{transform(t){return t?super.transform(t.replace("-"," ").replace("_"," ")):""}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275pipe=o.Yjl({name:"titleCase",type:t,pure:!0}),t})();const ls=["tableFilters"],cs=["filterButton"];function ds(t,e){1&t&&o._UZ(0,"mat-progress-bar",7)}function us(t,e){1&t&&(o.TgZ(0,"div",8),o.Hsn(1),o.qZA())}const ps=function(t,e){return{count:t,resource:e}};function gs(t,e){if(1&t&&(o.TgZ(0,"div",9),o._uU(1),o.ALo(2,"trans"),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.hij(" ",o.xi3(2,1,":count :resource selected",o.WLB(4,ps,t.numberOfRowsSelected,t.pluralResourceName))," ")}}function hs(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"mat-chip",18),o.NdJ("removed",function(){const e=o.CHM(t).$implicit;return o.oxw(3).datatable.removeFilter(e.key)}),o._uU(1),o.ALo(2,"trans"),o.ALo(3,"titleCase"),o._UZ(4,"mat-icon",19),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw(3);o.Q6J("removable",!0)("selectable",!1),o.xp6(1),o.AsE(" ",o.lcZ(2,4,o.lcZ(3,6,t.key)),": ",n.isModel(t.value)?t.value.name||t.value.display_name:t.value," ")}}function ms(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"mat-chip-list",13),o.YNc(2,hs,5,8,"mat-chip",14),o.ALo(3,"keyvalue"),o.ALo(4,"async"),o.qZA(),o.TgZ(5,"button",15,16),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).openFiltersPanel()}),o._UZ(7,"mat-icon",17),o.qZA(),o.BQk()}if(2&t){const t=o.oxw(2);o.xp6(2),o.Q6J("ngForOf",o.lcZ(3,3,o.lcZ(4,5,t.filters$))),o.xp6(3),o.ekj("active",t.filterPanelRef)}}function fs(t,e){if(1&t&&(o.TgZ(0,"div",10),o.YNc(1,ms,8,7,"ng-container",11),o._UZ(2,"datatable-header-search-input",12),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",t.filterPanelTemplate),o.xp6(1),o.MGl("placeholder","Search ",t.pluralResourceName,"")}}function bs(t,e){1&t&&(o.TgZ(0,"div",20),o.Hsn(1,1),o.qZA())}const vs=[[["","leftContent",""]],[["","rightContent",""]]],_s=["[leftContent]","[rightContent]"];let Zs=(()=>{class t{constructor(t,e,n){this.datatable=t,this.cd=e,this.overlayPanel=n,this.showSelectedActions=!0,this.subscriptions=[],this.filters$=this.datatable.filters$.pipe((0,Ui.U)(t=>{const e=(0,is.N)(t);return delete e.query,e}))}ngOnInit(){const t=this.datatable.filters$.subscribe(()=>{this.filterPanelRef&&this.filterPanelRef.close()}),e=this.datatable.selectedRows$.subscribe(t=>{this.numberOfRowsSelected=t.length,this.cd.markForCheck()});this.subscriptions=[t,e]}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}openFiltersPanel(){if(this.filterPanelRef)this.filterPanelRef.close();else{const t=Wo.slice();t[0].offsetY=40,t[1].offsetY=40,this.filterPanelRef=this.overlayPanel.open(ns,{origin:this.filterButton,position:t,mobilePosition:"center",data:{filters:this.filterPanelTemplate},maxWidth:"90%"}),this.filterButton.nativeElement.classList.add("active"),this.filterPanelRef.afterClosed().subscribe(()=>{this.filterPanelRef=null,this.filterButton.nativeElement.classList.remove("active")})}}isModel(t){return"object"==typeof t&&t.id}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(go.x),o.Y36(o.sBO),o.Y36(as.T))},t.\u0275cmp=o.Xpm({type:t,selectors:[["datatable-header"]],contentQueries:function(t,e,n){if(1&t&&o.Suo(n,ls,5),2&t){let t;o.iGM(t=o.CRH())&&(e.filterPanelTemplate=t.first)}},viewQuery:function(t,e){if(1&t&&o.Gf(cs,5,o.SBq),2&t){let t;o.iGM(t=o.CRH())&&(e.filterButton=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&o.ekj("rows-selected",e.numberOfRowsSelected)},inputs:{pluralResourceName:"pluralResourceName",showSelectedActions:"showSelectedActions"},ngContentSelectors:_s,decls:8,vars:7,consts:[["mode","indeterminate","color","accent",4,"ngIf"],[1,"left-column"],["class","default-left-content",4,"ngIf"],["class","selected-left-content capitalize",4,"ngIf"],[1,"right-column"],["class","default-right-content",4,"ngIf"],["class","selected-right-actions",4,"ngIf"],["mode","indeterminate","color","accent"],[1,"default-left-content"],[1,"selected-left-content","capitalize"],[1,"default-right-content"],[4,"ngIf"],[3,"placeholder"],["aria-label","Active Filters",1,"filter-chip-list"],[3,"removable","selectable","removed",4,"ngFor","ngForOf"],["mat-icon-button","",1,"filter-button",3,"click"],["filterButton",""],["svgIcon","filter-list"],[3,"removable","selectable","removed"],["matChipRemove","","svgIcon","cancel"],[1,"selected-right-actions"]],template:function(t,e){1&t&&(o.F$t(vs),o.YNc(0,ds,1,0,"mat-progress-bar",0),o.ALo(1,"async"),o.TgZ(2,"div",1),o.YNc(3,us,2,0,"div",2),o.YNc(4,gs,3,7,"div",3),o.qZA(),o.TgZ(5,"div",4),o.YNc(6,fs,3,2,"div",5),o.YNc(7,bs,2,0,"div",6),o.qZA()),2&t&&(o.Q6J("ngIf",o.lcZ(1,5,e.datatable.paginator&&e.datatable.paginator.loading$)),o.xp6(3),o.Q6J("ngIf",!e.showSelectedActions||!e.numberOfRowsSelected),o.xp6(1),o.Q6J("ngIf",e.showSelectedActions&&e.numberOfRowsSelected),o.xp6(2),o.Q6J("ngIf",!e.showSelectedActions||!e.numberOfRowsSelected),o.xp6(1),o.Q6J("ngIf",e.showSelectedActions&&e.numberOfRowsSelected))},directives:[i.O5,k.pW,ss,h.qn,i.sg,p.lW,P.Hw,h.HS,h.qH],pipes:[i.Ov,le.R,i.Nd,rs],styles:[".rows-selected[_nghost-%COMP%], .rows-selected   [_nghost-%COMP%]{background-color:var(--be-accent-emphasis);color:var(--be-secondary-text);font-size:1.5rem;border-color:var(--be-divider-default)}[_nghost-%COMP%]{display:flex;align-items:center;height:85px;padding:15px;border-bottom:1px solid transparent;position:relative}.mat-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0}.left-column[_ngcontent-%COMP%]{margin-right:auto}.right-column[_ngcontent-%COMP%]{margin-left:25px}.default-right-content[_ngcontent-%COMP%]{display:flex;align-items:center}.filter-button[_ngcontent-%COMP%]{margin-right:10px}.active[_ngcontent-%COMP%]{color:var(--be-accent-default)}.mat-chip[_ngcontent-%COMP%]{text-transform:capitalize}  datatable-header info-popover{margin-left:10px}"],changeDetection:0}),t})();function xs(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",15),o.NdJ("click",function(){return o.CHM(t),o.oxw().showCrupdateRoleModal()}),o._uU(1," New Role "),o.qZA()}}function ys(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",22),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(2).selectRole(e)}),o.ALo(1,"async"),o._uU(2),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw(2);o.ekj("selected",o.lcZ(1,3,n.selectedRole$).id===t.id),o.xp6(2),o.hij(" ",t.name," ")}}function As(t,e){if(1&t&&(o.ynx(0),o.TgZ(1,"button",16),o.TgZ(2,"span",17),o._uU(3),o.ALo(4,"async"),o.qZA(),o._UZ(5,"mat-icon",18),o.qZA(),o.TgZ(6,"mat-menu",19,20),o.YNc(8,ys,3,5,"button",21),o.ALo(9,"async"),o.qZA(),o.BQk()),2&t){const t=o.MAs(7),e=o.oxw();o.xp6(1),o.Q6J("matMenuTriggerFor",t),o.xp6(2),o.Oqu(o.lcZ(4,3,e.selectedRole$).name),o.xp6(5),o.Q6J("ngForOf",o.lcZ(9,5,e.roles$))}}function ws(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",32),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw(2).showCrupdateRoleModal(e)}),o._uU(1," Edit "),o.qZA()}}function ks(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",32),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw(2).maybeDeleteRole(e)}),o._uU(1," Delete "),o.qZA()}}function Ts(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",25),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(2).selectRole(e)}),o.ALo(1,"async"),o.TgZ(2,"div",17),o.TgZ(3,"div"),o._uU(4),o.qZA(),o.TgZ(5,"div",26),o._uU(6),o.qZA(),o.qZA(),o.TgZ(7,"div",27),o.TgZ(8,"button",28),o.NdJ("click",function(t){return t.stopPropagation()}),o._UZ(9,"mat-icon",29),o.qZA(),o.TgZ(10,"mat-menu",null,30),o.YNc(12,ws,2,0,"div",31),o.YNc(13,ks,2,0,"div",31),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=o.MAs(11),i=o.oxw(2);o.ekj("selected",o.lcZ(1,7,i.selectedRole$).id===t.id),o.xp6(4),o.Oqu(t.name),o.xp6(2),o.Oqu(t.type),o.xp6(2),o.Q6J("matMenuTriggerFor",n),o.xp6(4),o.Q6J("ngIf",i.currentUser.hasPermission("roles.update")),o.xp6(1),o.Q6J("ngIf",!t.internal&&i.currentUser.hasPermission("roles.delete"))}}function Cs(t,e){if(1&t&&(o.TgZ(0,"aside",23),o.YNc(1,Ts,14,9,"div",24),o.ALo(2,"async"),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngForOf",o.lcZ(2,1,t.roles$))}}function qs(t,e){if(1&t){const t=o.EpF();o.ynx(0,33),o.TgZ(1,"button",34),o.NdJ("click",function(){return o.CHM(t),o.oxw().showAssignUsersModal()}),o._uU(2," Assign Users "),o.qZA(),o.TgZ(3,"button",35),o.NdJ("click",function(){return o.CHM(t),o.oxw().maybeDetachUsers()}),o.ALo(4,"async"),o._uU(5," Unassign Users "),o.qZA(),o.BQk()}if(2&t){const t=o.oxw();o.xp6(1),o.Q6J("disabled",!t.canAssignUsers()),o.xp6(2),o.Q6J("disabled",!o.lcZ(4,2,t.datatable.selectedRows$).length)}}function Us(t,e){if(1&t&&(o.TgZ(0,"tr"),o._UZ(1,"td",36),o.TgZ(2,"td",37),o._UZ(3,"user-column",38),o.qZA(),o.TgZ(4,"td",39),o._uU(5),o.qZA(),o.TgZ(6,"td",40),o._uU(7),o.qZA(),o.TgZ(8,"td",41),o._uU(9),o.ALo(10,"formattedDate"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Q6J("table-body-checkbox",t.id),o.xp6(2),o.Q6J("user",t),o.xp6(2),o.Oqu(t.first_name||"-"),o.xp6(2),o.Oqu(t.last_name||"-"),o.xp6(2),o.Oqu(o.lcZ(10,5,t.created_at))}}function Is(t,e){1&t&&(o.TgZ(0,"no-results-message",44),o.TgZ(1,"span",45),o._uU(2,"This role can't be assigned to users."),o.qZA(),o.qZA())}function Ms(t,e){1&t&&(o.TgZ(0,"no-results-message",44),o.TgZ(1,"span",45),o._uU(2,"No users are assigned this role yet."),o.qZA(),o.qZA())}function Os(t,e){if(1&t&&(o.YNc(0,Ms,3,0,"no-results-message",46),o.ALo(1,"async"),o.ALo(2,"async")),2&t){const t=o.oxw(2);o.Q6J("ngIf",o.lcZ(1,1,t.datatable.paginator.noResults$)&&!o.lcZ(2,3,t.datatable.paginator.loading$))}}function Js(t,e){if(1&t&&(o.ynx(0),o.YNc(1,Is,3,0,"no-results-message",42),o.YNc(2,Os,3,5,"ng-template",null,43,o.W1O),o.BQk()),2&t){const t=e.ngIf,n=o.MAs(3);o.xp6(1),o.Q6J("ngIf",t.guests||"sitewide"!==t.type)("ngIfElse",n)}}function Ps(t,e){1&t&&(o.TgZ(0,"no-results-message",44),o.TgZ(1,"span",45),o._uU(2,"No role selected."),o.qZA(),o.qZA())}let Ns=(()=>{class t{constructor(t,e,n,i,a,o){this.roleApi=t,this.toast=e,this.modal=n,this.currentUser=i,this.breakpoints=a,this.datatable=o,this.roles$=new c.X([]),this.users$=this.datatable.data$,this.selectedRole$=new c.X(new So)}ngOnInit(){this.refreshRoles().then(()=>{var t;this.datatable.init({uri:fa.Q.BASE_URI,staticParams:{role_id:null===(t=this.selectedRole$.value)||void 0===t?void 0:t.id}})})}selectRole(t){this.selectedRole$.value.id!==t.id&&(this.selectedRole$.next(t),this.refreshRoleUsers(t))}refreshRoles(){return new Promise(t=>{this.roleApi.getRoles().subscribe(e=>{if(this.roles$.next(e.pagination.data),this.roles$.value.length)if(this.selectedRole$.value.id){const t=this.roles$.value.find(t=>t.id===this.selectedRole$.value.id);t&&this.selectedRole$.next(t)}else this.selectRole(this.roles$.value[0]);t()})})}refreshRoleUsers(t){this.datatable.reset("sitewide"!==t.type||t.guests?{role_id:999}:{role_id:t.id})}showAssignUsersModal(){this.modal.open(Xo.y).afterClosed().subscribe(t=>{t&&this.roleApi.addUsers(this.selectedRole$.value.id,[t.id]).subscribe(()=>{this.toast.open("User assigned to role"),this.refreshRoleUsers(this.selectedRole$.value)})})}showCrupdateRoleModal(t){this.modal.show(jo,{role:t}).afterClosed().subscribe(t=>{t&&this.refreshRoles()})}maybeDeleteRole(t){this.modal.open(Do.z,{title:"Delete Role",body:"Are you sure you want to delete this role?",ok:"Delete"}).afterClosed().subscribe(e=>{e&&this.deleteRole(t)})}deleteRole(t){this.roleApi.delete(t.id).subscribe(()=>{this.selectedRole$.next(new So),this.refreshRoles().then(()=>{this.refreshRoleUsers(this.selectedRole$.value)})})}maybeDetachUsers(){this.modal.show(Do.z,{title:"Remove users from role",body:"Are you sure you want to remove selected users from this role?",ok:"Remove"}).afterClosed().subscribe(t=>{t&&this.removeUsersFromSelectedRole()})}removeUsersFromSelectedRole(){this.roleApi.removeUsers(this.selectedRole$.value.id,this.datatable.selectedRows$.value).subscribe(()=>{this.refreshRoleUsers(this.selectedRole$.value),this.datatable.selectedRows$.next([]),this.toast.open("Users removed from role.")})}canAssignUsers(){return this.selectedRole$.value.id&&!this.datatable.selectedRows$.value.length&&!this.selectedRole$.value.guests}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Aa),o.Y36(ye.F),o.Y36(Ae.u),o.Y36(ba.I),o.Y36(Ee.S),o.Y36(go.x))},t.\u0275cmp=o.Xpm({type:t,selectors:[["role-index"]],features:[o._Bn([go.x])],decls:30,vars:14,consts:[[1,"admin-pill-nav"],[1,"new-role"],["mat-flat-button","","color","accent","class","new-role-button","trans","",3,"click",4,"ngIf"],[4,"ngIf","ngIfElse"],["desktopNav",""],[1,"datatable","responsive-table"],["pluralResourceName","roles",3,"showSelectedActions"],["leftContent","",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","email","trans",""],["table-sort-header","","trans",""],["table-sort-header","created_at","trans",""],[4,"ngFor","ngForOf"],["noRoleSelected",""],["mat-flat-button","","color","accent","trans","",1,"new-role-button",3,"click"],[1,"no-style","admin-pill-nav-mobile-selector",3,"matMenuTriggerFor"],["trans","",1,"name"],["svgIcon","keyboard-arrow-down"],[1,"admin-pill-nav-menu"],["navMenu","matMenu"],["mat-menu-item","",3,"selected","click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click"],[1,"admin-pill-nav","rounded"],["class","nav-item",3,"selected","click",4,"ngFor","ngForOf"],[1,"nav-item",3,"click"],[1,"role-type"],[1,"actions"],["mat-icon-button","",3,"matMenuTriggerFor","click"],["svgIcon","settings"],["actionsMenu",""],["mat-menu-item","","trans","",3,"click",4,"ngIf"],["mat-menu-item","","trans","",3,"click"],["leftContent",""],["mat-raised-button","","color","accent","trans","",1,"assign-users-button",3,"disabled","click"],["mat-raised-button","","color","accent","trans","",3,"disabled","click"],[3,"table-body-checkbox"],[1,"mobile-no-label"],[3,"user"],["data-label","First Name"],["data-label","Last Name"],["data-label","Assigned At"],["svgImage","people.svg",4,"ngIf","ngIfElse"],["regularRole",""],["svgImage","people.svg"],["primary-text","","trans",""],["svgImage","people.svg",4,"ngIf"]],template:function(t,e){if(1&t&&(o.TgZ(0,"section",0),o.TgZ(1,"div",1),o.YNc(2,xs,2,0,"button",2),o.qZA(),o.YNc(3,As,10,7,"ng-container",3),o.ALo(4,"async"),o.YNc(5,Cs,3,3,"ng-template",null,4,o.W1O),o.qZA(),o.TgZ(7,"div",5),o.TgZ(8,"datatable-header",6),o.YNc(9,qs,6,4,"ng-container",7),o.qZA(),o.TgZ(10,"table",8),o.TgZ(11,"thead"),o.TgZ(12,"tr"),o._UZ(13,"th",9),o.TgZ(14,"th",10),o._uU(15,"User"),o.qZA(),o.TgZ(16,"th",11),o._uU(17,"First Name"),o.qZA(),o.TgZ(18,"th",11),o._uU(19,"Last Name"),o.qZA(),o.TgZ(20,"th",12),o._uU(21,"Assigned At"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(22,"tbody"),o.YNc(23,Us,11,7,"tr",13),o.ALo(24,"async"),o.qZA(),o.qZA(),o.YNc(25,Js,4,2,"ng-container",3),o.ALo(26,"async"),o.YNc(27,Ps,3,0,"ng-template",null,14,o.W1O),o._UZ(29,"datatable-footer"),o.qZA()),2&t){const t=o.MAs(6),n=o.MAs(28);o.xp6(2),o.Q6J("ngIf",e.currentUser.hasPermission("roles.create")),o.xp6(1),o.Q6J("ngIf",o.lcZ(4,8,e.breakpoints.isMobile$))("ngIfElse",t),o.xp6(5),o.Q6J("showSelectedActions",!1),o.xp6(1),o.Q6J("ngIf",e.currentUser.hasPermission("roles.update")),o.xp6(14),o.Q6J("ngForOf",o.lcZ(24,10,e.users$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(26,12,e.selectedRole$))("ngIfElse",n)}},directives:[i.O5,Zs,_o.e,Zo.p,qe.P,i.sg,xo.V,p.lW,w.p6,P.Hw,w.VK,w.OP,yo.O,Ao.r,wo.U],pipes:[i.Ov,Pn.l],styles:["[_nghost-%COMP%]{display:block}@media screen and (min-width:768px){[_nghost-%COMP%]{display:flex}.new-role[_ngcontent-%COMP%]{border-bottom:1px solid var(--be-divider-default);margin-bottom:10px;padding-bottom:10px}}.datatable[_ngcontent-%COMP%]{flex:1 1 auto}.role-type[_ngcontent-%COMP%]{font-size:1.3rem;color:var(--be-secondary-text)}@media screen and (max-width:768px){.admin-pill-nav[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;margin-bottom:20px}.admin-pill-nav-mobile-selector[_ngcontent-%COMP%]{margin-left:15px}.new-role-button[_ngcontent-%COMP%]{height:56px}}.assign-users-button[_ngcontent-%COMP%]{margin-right:5px}"],changeDetection:0}),t})();var Ss=n(70941);function Ds(t,e){1&t&&(o.TgZ(0,"span",6),o._uU(1,"Update Localization"),o.qZA())}function Qs(t,e){1&t&&(o.TgZ(0,"span",6),o._uU(1,"Create Localization"),o.qZA())}function Ys(t,e){if(1&t&&(o.TgZ(0,"div",18),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.name)}}function Ls(t,e){if(1&t&&(o.TgZ(0,"option",19),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.code),o.xp6(1),o.Oqu(t.name)}}function Fs(t,e){1&t&&(o.TgZ(0,"span",6),o._uU(1,"Update"),o.qZA())}function Es(t,e){1&t&&(o.TgZ(0,"span",6),o._uU(1,"Create"),o.qZA())}function Rs(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",7),o.NdJ("ngSubmit",function(){return o.CHM(t),o.oxw().confirm()}),o.TgZ(1,"mat-dialog-content",8),o.TgZ(2,"div",9),o.TgZ(3,"label",10),o._uU(4,"Name"),o.qZA(),o._UZ(5,"input",11),o.YNc(6,Ys,2,1,"div",12),o.qZA(),o.TgZ(7,"div",9),o.TgZ(8,"label",13),o._uU(9,"Language"),o.qZA(),o.TgZ(10,"select",14),o.YNc(11,Ls,2,2,"option",15),o.ALo(12,"async"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(13,"mat-dialog-actions"),o.TgZ(14,"button",16),o.NdJ("click",function(){return o.CHM(t),o.oxw().close()}),o._uU(15,"Cancel"),o.qZA(),o.TgZ(16,"button",17),o.ALo(17,"async"),o.YNc(18,Fs,2,0,"span",2),o.YNc(19,Es,2,0,"span",2),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.Q6J("formGroup",n.form),o.xp6(6),o.Q6J("ngIf",t.name),o.xp6(5),o.Q6J("ngForOf",o.lcZ(12,6,n.languages$)),o.xp6(5),o.Q6J("disabled",o.lcZ(17,8,n.loading$)),o.xp6(2),o.Q6J("ngIf",n.data.localization),o.xp6(1),o.Q6J("ngIf",!n.data.localization)}}let $s=(()=>{class t{constructor(t,e,n,i,a,o){this.fb=t,this.localizations=e,this.dialogRef=n,this.data=i,this.toast=a,this.lists=o,this.loading$=new c.X(!1),this.errors$=new c.X({}),this.languages$=new c.X([]),this.form=this.fb.group({name:[""],language:[""]})}ngOnInit(){this.lists.get(["languages"]).subscribe(t=>{this.languages$.next(t.languages)}),this.data.localization&&this.form.patchValue(this.data.localization.model)}confirm(){this.loading$.next(!0),(this.data.localization?this.updateLocalization():this.createNewLocalization()).pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.close(t.localization),this.toast.open("Localization "+(this.data.localization?"updated":"created"))},t=>this.errors$.next(t.errors))}close(t){this.dialogRef.close(t)}createNewLocalization(){return this.localizations.create(this.form.value)}updateLocalization(){return this.localizations.update(this.data.localization.model.id,this.form.value)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(a.qu),o.Y36(Ss.v),o.Y36(m.so),o.Y36(m.WI),o.Y36(ye.F),o.Y36(ke.l))},t.\u0275cmp=o.Xpm({type:t,selectors:[["crupdate-localization-modal"]],decls:8,vars:5,consts:[[1,"modal-header"],["mat-dialog-title",""],["trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["class","modal-content","ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],["trans",""],["ngNativeValidate","",1,"modal-content",3,"formGroup","ngSubmit"],[1,"many-inputs"],[1,"input-container"],["for","name","trans",""],["type","text","formControlName","name","id","name","pattern","[A-Za-z0-9_-]+","required",""],["class","error",4,"ngIf"],["for","language","trans",""],["id","language","formControlName","language"],["trans","",3,"value",4,"ngFor","ngForOf"],["mat-button","","type","button","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],[1,"error"],["trans","",3,"value"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o.YNc(2,Ds,2,0,"span",2),o.YNc(3,Qs,2,0,"span",2),o.qZA(),o.TgZ(4,"button",3),o.NdJ("click",function(){return e.close()}),o._UZ(5,"mat-icon",4),o.qZA(),o.qZA(),o.YNc(6,Rs,20,10,"form",5),o.ALo(7,"async")),2&t&&(o.xp6(2),o.Q6J("ngIf",e.data.localization),o.xp6(1),o.Q6J("ngIf",!e.data.localization),o.xp6(3),o.Q6J("ngIf",o.lcZ(7,3,e.errors$)))},directives:[m.uh,i.O5,P.Hw,qe.P,a.JL,a.sg,m.xY,a.Fj,a.JJ,a.u,a.c5,a.Q7,a.EJ,i.sg,m.H8,p.lW,a.YN,a.Kr],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}"],changeDetection:0}),t})();var Vs=n(98720);let Bs=(()=>{class t{constructor(t){this.dialogRef=t,this.form=new a.cw({key:new a.NI,value:new a.NI})}confirm(){this.close(this.form.value)}close(t){this.dialogRef.close(t)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(m.so))},t.\u0275cmp=o.Xpm({type:t,selectors:[["new-line-modal"]],decls:24,vars:1,consts:[[1,"modal-header"],["mat-dialog-title","","trans","",1,"mat-dialog-title"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",1,"modal-content",3,"formGroup","ngSubmit"],[1,"many-inputs"],[1,"input-container"],["for","translation-key","trans",""],["type","text","formControlName","key","name","translation-key","id","translation-key","required",""],["trans",""],["for","translation-value","trans",""],["type","text","formControlName","value","name","translation-value","id","translation-value","required",""],["mat-button","","type","button","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o._uU(2,"Add New Translation Line"),o.qZA(),o.TgZ(3,"button",2),o.NdJ("click",function(){return e.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.TgZ(5,"form",4),o.NdJ("ngSubmit",function(){return e.confirm()}),o.TgZ(6,"mat-dialog-content",5),o.TgZ(7,"div",6),o.TgZ(8,"label",7),o._uU(9,"Translation Key"),o.qZA(),o._UZ(10,"input",8),o.TgZ(11,"p",9),o._uU(12,"Word or sentence you want to translate."),o.qZA(),o.qZA(),o.TgZ(13,"div",6),o.TgZ(14,"label",10),o._uU(15,"Translation Value"),o.qZA(),o._UZ(16,"input",11),o.TgZ(17,"p",9),o._uU(18,"What word or sentence should be translated to."),o.qZA(),o.qZA(),o.qZA(),o.TgZ(19,"mat-dialog-actions"),o.TgZ(20,"button",12),o.NdJ("click",function(){return e.close()}),o._uU(21,"Cancel"),o.qZA(),o.TgZ(22,"button",13),o._uU(23,"Add"),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(5),o.Q6J("formGroup",e.form))},directives:[m.uh,qe.P,P.Hw,a.JL,a.sg,m.xY,a.Fj,a.JJ,a.u,a.Q7,m.H8,p.lW],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}"],changeDetection:0}),t})();var Hs=n(26437),zs=n(3950),Gs=n(88798);function js(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",18),o.NdJ("click",function(){return o.CHM(t),o.oxw().showCrupdateLocalizationModal()}),o._UZ(1,"mat-icon",19),o.TgZ(2,"span",15),o._uU(3,"New Localization"),o.qZA(),o.qZA()}}function Xs(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",26),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(2).setSelectedLocalization(e)}),o._uU(1),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw(2);o.ekj("selected",(null==n.selectedLocalization?null:n.selectedLocalization.model.id)==t.model.id),o.xp6(1),o.Oqu(t.model.name)}}function Ws(t,e){if(1&t&&(o.ynx(0),o.TgZ(1,"button",20),o.TgZ(2,"span",21),o._uU(3),o.qZA(),o._UZ(4,"mat-icon",22),o.qZA(),o.TgZ(5,"mat-menu",23,24),o.YNc(7,Xs,2,3,"button",25),o.ALo(8,"async"),o.qZA(),o.BQk()),2&t){const t=o.MAs(6),e=o.oxw();o.xp6(1),o.Q6J("matMenuTriggerFor",t),o.xp6(2),o.Oqu(null==e.selectedLocalization?null:e.selectedLocalization.model.name),o.xp6(4),o.Q6J("ngForOf",o.lcZ(8,3,e.localizations$))}}function Ks(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",35),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw(2).setDefaultLocalization(e)}),o._uU(1,"Set as Default"),o.qZA()}}function tr(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",35),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw(2).showCrupdateLocalizationModal(e)}),o._uU(1,"Update"),o.qZA()}}function er(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",35),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw(2).confirmLocalizationDeletion(e)}),o._uU(1,"Delete"),o.qZA()}}function nr(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",28),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(2).setSelectedLocalization(e)}),o.TgZ(1,"div",29),o._uU(2),o.qZA(),o.TgZ(3,"div",30),o.TgZ(4,"button",31),o.NdJ("click",function(t){return t.stopPropagation()}),o._UZ(5,"mat-icon",32),o.qZA(),o.TgZ(6,"mat-menu",null,33),o.YNc(8,Ks,2,0,"div",34),o.YNc(9,tr,2,0,"div",34),o.YNc(10,er,2,0,"div",34),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=o.MAs(7),i=o.oxw(2);o.ekj("selected",(null==i.selectedLocalization?null:i.selectedLocalization.model.id)==t.model.id),o.Q6J("@fadeIn",void 0),o.xp6(2),o.Oqu(t.model.name.replace("-"," ")),o.xp6(2),o.Q6J("matMenuTriggerFor",n),o.xp6(4),o.Q6J("ngIf",i.currentUser.hasPermission("settings.update")),o.xp6(1),o.Q6J("ngIf","English"!==t.name&&i.currentUser.hasPermission("localizations.update")),o.xp6(1),o.Q6J("ngIf","English"!==t.name&&i.currentUser.hasPermission("localizations.delete"))}}function ir(t,e){1&t&&(o.TgZ(0,"div",37),o._UZ(1,"skeleton",38),o.qZA())}const ar=function(){return[1,2,3,4,5]};function or(t,e){1&t&&(o.TgZ(0,"div"),o.YNc(1,ir,2,0,"div",36),o.qZA()),2&t&&(o.xp6(1),o.Q6J("ngForOf",o.DdM(1,ar)))}function sr(t,e){if(1&t&&(o.YNc(0,nr,11,8,"div",27),o.ALo(1,"async"),o.YNc(2,or,2,2,"div",16),o.ALo(3,"async")),2&t){const t=o.oxw();o.Q6J("ngForOf",o.lcZ(1,3,t.localizations$))("ngForTrackBy",t.trackByFn),o.xp6(2),o.Q6J("ngIf",o.lcZ(3,5,!t.selectedLocalization&&t.loading$))}}function rr(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",39),o.NdJ("click",function(){return o.CHM(t),o.oxw().updateLocalization()}),o.ALo(1,"async"),o._uU(2,"Update"),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("disabled",o.lcZ(1,1,t.loading$))}}function lr(t,e){1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._UZ(2,"skeleton",40),o.qZA(),o.TgZ(3,"td"),o._UZ(4,"skeleton",40),o.qZA(),o.qZA())}const cr=function(){return[1,2,3,4,5,6,7,8,9,10]};function dr(t,e){1&t&&(o.ynx(0),o.YNc(1,lr,5,0,"tr",17),o.BQk()),2&t&&(o.xp6(1),o.Q6J("ngForOf",o.DdM(1,cr)))}function ur(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tr"),o.TgZ(1,"td",41),o._uU(2),o.qZA(),o.TgZ(3,"td",42),o.TgZ(4,"input",43),o.NdJ("ngModelChange",function(e){const n=o.CHM(t).$implicit;return o.oxw().selectedLocalization.lines[n.key]=e}),o.qZA(),o.qZA(),o.TgZ(5,"td",44),o.TgZ(6,"button",45),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw().removeLine(e)}),o.ALo(7,"trans"),o._UZ(8,"mat-icon",46),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=o.oxw();o.Q6J("@fadeIn",void 0),o.xp6(2),o.Oqu(t.key),o.xp6(2),o.s9C("id",t.key),o.Q6J("ngModel",n.selectedLocalization.lines[t.key]),o.xp6(2),o.Q6J("matTooltip",o.lcZ(7,5,"Remove"))}}let pr=(()=>{class t{constructor(t,e,n,i,o,s,r,l){this.toast=t,this.modal=e,this.settings=n,this.i18n=i,this.route=o,this.currentUser=s,this.localizationsApi=r,this.breakpoints=l,this.loading$=new c.X(!1),this.loadingLines$=new c.X(!1),this.searchQuery=new a.NI,this.localizations$=new c.X([]),this.lines$=new c.X([]),this.trackByFn=(t,e)=>e.model.id}ngOnInit(){this.loading$.next(!0),this.localizationsApi.all().pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.setLocalizations(t.localizations),this.bindSearchQuery()})}setLocalizations(t){this.localizations$.next(t);const e=t.find(t=>t.model.language===this.settings.get("i18n.default_localization"))||t[0];e&&this.setSelectedLocalization(e)}setSelectedLocalization(t){var e;(null===(e=this.selectedLocalization)||void 0===e?void 0:e.model.id)!==t.model.id&&(this.selectedLocalization=t,this.searchQuery.setValue(null),t.lines?this.lines$.next(this.originalLines()):(this.selectedLocalization.lines={},this.loadingLines$.next(!0),this.localizationsApi.get(this.selectedLocalization.model.name).pipe((0,Ze.x)(()=>this.loadingLines$.next(!1))).subscribe(e=>{this.selectedLocalization=e.localization;const n=[...this.localizations$.value],i=n.findIndex(e=>e.model.id===t.model.id);n[i]=e.localization,this.localizations$.next(n),this.lines$.next(this.originalLines())})))}addLine(){this.modal.open(Bs).beforeClosed().subscribe(t=>{t&&(this.selectedLocalization.lines[t.key]=t.value,this.lines$.next(this.originalLines()))})}setDefaultLocalization(t){this.selectedLocalization.model.id||this.setSelectedLocalization(t),this.localizationsApi.setDefault(t.model).subscribe(()=>{this.toast.open("Default Localization Changed")},()=>{this.toast.open(ma.v.Default)})}updateLocalization(){this.loading$.next(!0),this.localizationsApi.update(this.selectedLocalization.model.id,this.selectedLocalization).pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Localizations updated"),this.i18n.isActive(this.selectedLocalization.model)&&this.i18n.setLocalization(this.selectedLocalization)})}showCrupdateLocalizationModal(t){this.modal.show($s,{localization:t}).afterClosed().subscribe(e=>{if(!e)return;let n=[...this.localizations$.value];t?n=n.map(t=>t.model.id===e.model.id?e:t):(n.push(e),this.setSelectedLocalization(e)),this.localizations$.next(n)})}confirmLocalizationDeletion(t){this.localizations$.value.length<2?this.toast.open("There must be at least one localization."):this.modal.open(Do.z,{title:"Delete Localization",body:"Are you sure you want to delete this localization?",ok:"Delete"}).afterClosed().subscribe(e=>{e&&this.deleteLocalization(t)})}deleteLocalization(t){this.localizationsApi.delete(t.model.id).subscribe(()=>{this.toast.open("Localization deleted");const e=[...this.localizations$.value];e.splice(e.indexOf(t),1),this.localizations$.next(e),this.selectedLocalization.model.id===t.model.id&&this.setSelectedLocalization(e[0])})}bindSearchQuery(){this.searchQuery.valueChanges.pipe((0,Vs.x)()).subscribe(t=>{const e=this.originalLines();this.lines$.next(t?e.filter(e=>this.filterPredicate(e,t)):e)})}filterPredicate(t,e){const n=Object.keys(t).reduce((e,n)=>e+t[n]+"\u25ec","").toLowerCase(),i=e.trim().toLowerCase();return-1!=n.indexOf(i)}linesToArray(t){const e=[];for(const n in t)e.push({key:n,translation:t[n]});return e}originalLines(){return this.selectedLocalization.lines?this.linesToArray(this.selectedLocalization.lines):[]}removeLine(t){delete this.selectedLocalization.lines[t.key],this.lines$.next(this.originalLines())}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(ye.F),o.Y36(Ae.u),o.Y36(oe.Z),o.Y36(zs.Z),o.Y36(r.gz),o.Y36(ba.I),o.Y36(Ss.v),o.Y36(Ee.S))},t.\u0275cmp=o.Xpm({type:t,selectors:[["localization-index"]],decls:29,vars:13,consts:[[1,"admin-pill-nav"],[1,"new-localization"],["mat-button","",3,"click",4,"ngIf"],[4,"ngIf","ngIfElse"],["desktopNav",""],[1,"update-translations"],["mat-raised-button","","color","accent","trans","",3,"disabled","click",4,"ngIf"],[1,"datatable","responsive-table"],[1,"datatable-header","localizations-datatable-header"],["mat-raised-button","","color","accent","trans","",1,"new-translation-button",3,"click"],[1,"input-container","search-input-container"],["type","text","placeholder","Search Translations","trans-placeholder","",1,"search",3,"formControl"],["svgIcon","search"],[1,"material-table"],["trans","",1,"source-column"],["trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["mat-button","",3,"click"],["svgIcon","add"],[1,"no-style","admin-pill-nav-mobile-selector",3,"matMenuTriggerFor"],["trans","",1,"name"],["svgIcon","keyboard-arrow-down"],[1,"admin-pill-nav-menu"],["navMenu","matMenu"],["mat-menu-item","",3,"selected","click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click"],["class","nav-item",3,"selected","click",4,"ngFor","ngForOf","ngForTrackBy"],[1,"nav-item",3,"click"],[1,"name"],[1,"actions"],["mat-icon-button","",3,"matMenuTriggerFor","click"],["svgIcon","settings",1,"size-22"],["actionsMenu",""],["mat-menu-item","","trans","",3,"click",4,"ngIf"],["mat-menu-item","","trans","",3,"click"],["class","nav-item skeleton-nav-item",4,"ngFor","ngForOf"],[1,"nav-item","skeleton-nav-item"],["variant","text"],["mat-raised-button","","color","accent","trans","",3,"disabled","click"],["variant","text",1,"table-skeleton"],[1,"mobile-no-label","source-column"],[1,"mobile-no-label"],["type","text",1,"translation-input",3,"id","ngModel","ngModelChange"],[1,"edit-column"],["type","button","mat-icon-button","",3,"matTooltip","click"],["svgIcon","close"]],template:function(t,e){if(1&t&&(o.TgZ(0,"aside",0),o.TgZ(1,"div",1),o.YNc(2,js,4,0,"button",2),o.qZA(),o.YNc(3,Ws,9,5,"ng-container",3),o.ALo(4,"async"),o.YNc(5,sr,4,7,"ng-template",null,4,o.W1O),o.TgZ(7,"div",5),o.YNc(8,rr,3,3,"button",6),o.qZA(),o.qZA(),o.TgZ(9,"div",7),o.TgZ(10,"div",8),o.TgZ(11,"button",9),o.NdJ("click",function(){return e.addLine()}),o._uU(12,"Add New Translation"),o.qZA(),o.TgZ(13,"div",10),o._UZ(14,"input",11),o._UZ(15,"mat-icon",12),o.qZA(),o.qZA(),o.TgZ(16,"table",13),o.TgZ(17,"thead"),o.TgZ(18,"tr"),o.TgZ(19,"th",14),o._uU(20,"Source Text"),o.qZA(),o.TgZ(21,"th",15),o._uU(22,"Translation"),o.qZA(),o._UZ(23,"th"),o.qZA(),o.qZA(),o.TgZ(24,"tbody"),o.YNc(25,dr,2,2,"ng-container",16),o.ALo(26,"async"),o.YNc(27,ur,9,7,"tr",17),o.ALo(28,"async"),o.qZA(),o.qZA(),o.qZA()),2&t){const t=o.MAs(6);o.xp6(2),o.Q6J("ngIf",e.currentUser.hasPermission("localizations.create")),o.xp6(1),o.Q6J("ngIf",o.lcZ(4,7,e.breakpoints.isMobile$))("ngIfElse",t),o.xp6(5),o.Q6J("ngIf",e.currentUser.hasPermission("localizations.update")),o.xp6(6),o.Q6J("formControl",e.searchQuery),o.xp6(11),o.Q6J("ngIf",o.lcZ(26,9,e.loadingLines$)),o.xp6(2),o.Q6J("ngForOf",o.lcZ(28,11,e.lines$))}},directives:[i.O5,p.lW,qe.P,a.Fj,a.JJ,a.oH,P.Hw,i.sg,w.p6,w.VK,w.OP,Gs._,a.On,q.gM],pipes:[i.Ov,le.R],styles:["[_nghost-%COMP%]{display:flex}  .localizations-datatable-header{display:flex;align-items:center;height:85px;padding:15px;border-bottom:1px solid transparent;position:relative}.search-input-container[_ngcontent-%COMP%]{margin-left:auto;max-width:300px;position:relative}.search-input-container[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:10px}.search-input-container[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{margin-left:1px}.datatable[_ngcontent-%COMP%]{flex:1 1 auto}.datatable[_ngcontent-%COMP%]   .translation-input[_ngcontent-%COMP%]{position:relative;z-index:1;min-height:40px;border:none;background-color:transparent;padding:0 10px;margin-left:1px;color:inherit;width:98%}.datatable[_ngcontent-%COMP%]   .translation-input[_ngcontent-%COMP%]:focus, .datatable[_ngcontent-%COMP%]   .translation-input[_ngcontent-%COMP%]:hover{outline:var(--be-accent-default) auto 1px}.datatable[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:not(.edit-column){width:50%}.table-skeleton[_ngcontent-%COMP%]{vertical-align:middle;max-width:99%}.skeleton-nav-item[_ngcontent-%COMP%]{pointer-events:none}@media screen and (min-width:768px){.update-translations[_ngcontent-%COMP%]{margin-top:10px;padding-top:10px;border-top:1px solid var(--be-divider-default)}.new-localization[_ngcontent-%COMP%]{border-bottom:1px solid var(--be-divider-default);margin-bottom:10px;padding-bottom:10px}}@media screen and (max-width:768px){[_nghost-%COMP%]{display:block}.admin-pill-nav[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;width:100%;margin-bottom:20px;padding-bottom:20px;border-bottom:1px solid var(--be-divider-lighter);position:relative}.source-column[_ngcontent-%COMP%]{margin-left:10px}.new-localization[_ngcontent-%COMP%]{margin-bottom:5px}.update-translations[_ngcontent-%COMP%]{position:absolute;top:-5px;right:0}.datatable[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{width:auto!important}}"],data:{animation:Hs.B},changeDetection:0}),t})();var gr=n(340);const hr=[new ho.XQ({type:ho.Bq.Select,key:"type",description:"Type of the file",defaultValue:"text",options:[{key:"Text",value:"text"},{key:"Audio",value:"audio"},{key:"Video",value:"video"},{key:"Image",value:"image"},{key:"PDF",value:"pdf"},{key:"Spreadsheet",value:"spreadsheet"},{key:"Word Document",value:"word"},{key:"Photoshop",value:"photoshop"},{key:"Archive",value:"archive"},{key:"Folder",value:"folder"}]}),new ho.XQ({type:ho.Bq.Select,key:"public",label:"status",defaultValue:!1,description:"Whether file is publicly accessible",options:[{key:"Private",value:!1},{key:"Public",value:!0}]}),new mo.T7({description:"Date file was uploaded"}),new mo.yH({description:"Date file was last changed"}),new ho.XQ({type:ho.Bq.SelectModel,key:"owner_id",label:"Uploader",description:"User that this file was uploaded by",component:Xo.y})];var mr=n(25079);function fr(t,e){1&t&&o._UZ(0,"mat-progress-bar",15)}function br(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",20),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).maybeDeleteSelectedEntries()}),o._uU(1," Delete "),o.qZA()}}const vr=function(t){return{count:t,resource:"file(s)"}};function _r(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"th",16),o.TgZ(2,"div",17),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",18),o.YNc(5,br,2,0,"button",19),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,vr,t)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("files.delete"))}}function Zr(t,e){if(1&t&&(o.TgZ(0,"tr"),o._UZ(1,"td",21),o.TgZ(2,"td",22),o._uU(3),o.qZA(),o.TgZ(4,"td",23),o._uU(5),o.qZA(),o.TgZ(6,"td"),o._UZ(7,"user-column",24),o.qZA(),o.TgZ(8,"td",25),o._uU(9),o.qZA(),o.TgZ(10,"td",26),o._uU(11),o.qZA(),o.TgZ(12,"td",27),o._uU(13),o.ALo(14,"formattedFileSize"),o.qZA(),o.TgZ(15,"td"),o._uU(16),o.ALo(17,"formattedDate"),o.qZA(),o.qZA()),2&t){const t=e.$implicit;o.xp6(1),o.Q6J("table-body-checkbox",t.id),o.xp6(2),o.Oqu(t.name),o.xp6(2),o.Oqu(t.file_name),o.xp6(2),o.Q6J("user",t.users[0]),o.xp6(2),o.Oqu(t.type),o.xp6(2),o.Oqu(t.public?"Yes":"No"),o.xp6(2),o.hij(" ",t.file_size?o.lcZ(14,8,t.file_size):"-"," "),o.xp6(3),o.Oqu(o.lcZ(17,10,t.created_at))}}function xr(t,e){1&t&&(o.TgZ(0,"no-results-message",28),o.TgZ(1,"span",29),o._uU(2,"No files have been created yet"),o.qZA(),o.qZA())}let yr=(()=>{class t{constructor(t,e,n,i){this.currentUser=t,this.settings=e,this.uploads=n,this.datatable=i,this.files$=this.datatable.data$,this.filters=hr}ngOnInit(){this.datatable.init({uri:gr.f.BASE_URI})}maybeDeleteSelectedEntries(){this.datatable.confirmResourceDeletion("files").subscribe(()=>{this.uploads.delete({entryIds:this.datatable.selectedRows$.value,deleteForever:!0}).subscribe(()=>{this.datatable.reset()})})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(ba.I),o.Y36(oe.Z),o.Y36(gr.f),o.Y36(go.x))},t.\u0275cmp=o.Xpm({type:t,selectors:[["file-entry-index"]],features:[o._Bn([go.x])],decls:34,vars:11,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","files",3,"filters"],[1,"action-buttons"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","user_id","trans",""],["table-sort-header","created_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","file-searching.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","9"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["mat-raised-button","","color","warn","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["data-label","File Name"],[3,"user"],["data-label","Type"],["data-label","Public"],["data-label","File Size"],["svgImage","file-searching.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Uploaded Files"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o._UZ(5,"div",4),o.qZA(),o.qZA(),o.TgZ(6,"div",5),o.YNc(7,fr,1,0,"mat-progress-bar",6),o.ALo(8,"async"),o.TgZ(9,"table",7),o.TgZ(10,"thead"),o.TgZ(11,"tr"),o._UZ(12,"th",8),o.TgZ(13,"th",9),o._uU(14,"Name"),o.qZA(),o.TgZ(15,"th",9),o._uU(16,"File Name"),o.qZA(),o.TgZ(17,"th",10),o._uU(18,"Owner"),o.qZA(),o.TgZ(19,"th",9),o._uU(20,"Type"),o.qZA(),o.TgZ(21,"th",9),o._uU(22,"Public"),o.qZA(),o.TgZ(23,"th",9),o._uU(24,"File Size"),o.qZA(),o.TgZ(25,"th",11),o._uU(26,"Uploaded At"),o.qZA(),o.qZA(),o.YNc(27,_r,6,4,"tr",12),o.qZA(),o.TgZ(28,"tbody"),o.YNc(29,Zr,18,12,"tr",13),o.ALo(30,"async"),o.qZA(),o.qZA(),o.YNc(31,xr,3,0,"no-results-message",14),o.ALo(32,"async"),o._UZ(33,"datatable-footer"),o.qZA()),2&t&&(o.xp6(4),o.Q6J("filters",e.filters),o.xp6(3),o.Q6J("ngIf",o.lcZ(8,5,e.datatable.paginator&&e.datatable.paginator.loading$)),o.xp6(20),o.Q6J("ngIf",e.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(30,7,e.files$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(32,9,e.datatable.paginator.noResults$)))},directives:[qe.P,vo.h,i.O5,_o.e,Zo.p,i.sg,xo.V,k.pW,p.lW,yo.O,Ao.r,wo.U],pipes:[i.Ov,mr.y,Pn.l],styles:[".title[_ngcontent-%COMP%]{font-size:1.8rem;color:var(--be-secondary-text);margin-left:15px}"],changeDetection:0}),t})(),Ar=(()=>{class t{constructor(t,e){this.data=t,this.overlayPanelRef=e}close(){this.overlayPanelRef.close()}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Ko.p,8),o.Y36(ts.L))},t.\u0275cmp=o.Xpm({type:t,selectors:[["image-zoom-overlay"]],hostVars:1,hostBindings:function(t,e){2&t&&o.d8E("@dialogContainer","enter")},decls:3,vars:2,consts:[[3,"src","alt"],["mat-mini-fab","","color","accent",1,"close-button",3,"click"],["svgIcon","close"]],template:function(t,e){1&t&&(o._UZ(0,"img",0),o.TgZ(1,"button",1),o.NdJ("click",function(){return e.close()}),o._UZ(2,"mat-icon",2),o.qZA()),2&t&&o.Q6J("src",e.data.src,o.LSH)("alt",e.data.alt)},directives:[p.lW,P.Hw],styles:[".image-zoom-overlay-container{margin:auto;top:0;left:0;right:0;bottom:0;max-width:calc(100% - 65px);max-height:calc(100% - 65px)}image-zoom-overlay{display:block;width:100%;height:100%;position:relative;box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 5px 8px 0 rgba(0,0,0,.14),0 1px 14px 0 rgba(0,0,0,.12)}image-zoom-overlay img{max-height:100%;max-width:100%;border-radius:4px;overflow:hidden;-o-object-fit:cover;object-fit:cover}image-zoom-overlay .close-button{position:absolute;top:-15px;right:-15px}"],encapsulation:2,data:{animation:[m.Nv.dialogContainer]},changeDetection:0}),t})(),wr=(()=>{class t{constructor(t){this.overlay=t}zoomImage(){this.overlay.open(Ar,{position:"center",origin:"global",data:{src:this.src,alt:this.alt},panelClass:"image-zoom-overlay-container"})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(as.T))},t.\u0275cmp=o.Xpm({type:t,selectors:[["image-zoom"]],inputs:{src:"src",alt:"alt"},decls:1,vars:2,consts:[[3,"src","alt","click"]],template:function(t,e){1&t&&(o.TgZ(0,"img",0),o.NdJ("click",function(){return e.zoomImage()}),o.qZA()),2&t&&o.Q6J("src",e.src,o.LSH)("alt",e.alt)},styles:["[_nghost-%COMP%]{display:inline-block;border-radius:4px;overflow:hidden;cursor:zoom-in}img[_ngcontent-%COMP%]{max-width:100%;max-height:100%;width:auto;-o-object-fit:cover;object-fit:cover}"],changeDetection:0}),t})();function kr(t,e){if(1&t&&(o.TgZ(0,"div",8),o.TgZ(1,"div",9),o.TgZ(2,"label",10),o._uU(3),o.qZA(),o._UZ(4,"textarea",11),o.qZA(),o._UZ(5,"image-zoom",12),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(2),o.Q6J("for",t.slot),o.xp6(1),o.Oqu(t.description),o.xp6(1),o.Q6J("name",t.slot)("id",t.slot)("formControlName",t.slot),o.xp6(1),o.Q6J("src",n.getPreviewUrl(t))}}function Tr(t,e){1&t&&o._UZ(0,"mat-progress-bar",13)}let Cr=(()=>{class t{constructor(t,e,n){this.settings=t,this.toast=e,this.fb=n,this.loading$=new c.X(!1),this.form=this.fb.group({"ads.disable":[!1]})}ngOnInit(){this.hydrate()}saveAds(){this.loading$.next(!0),this.settings.save({client:this.form.value}).pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Ads updated")},()=>{this.toast.open(ma.v.Default)})}allAds(){return this.settings.get("vebto.admin.ads",[])}getPreviewUrl(t){return`client/assets/images/verts/${t.slot.replace(/\./g,"-").replace("ads-","")}.png`}hydrate(){const t=this.settings.getFlat()||{};this.form.patchValue({"ads.disable":t["ads.disable"]}),this.allAds().forEach(e=>{this.form.addControl(e.slot,this.fb.control(t[e.slot]))})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(oe.Z),o.Y36(ye.F),o.Y36(a.qu))},t.\u0275cmp=o.Xpm({type:t,selectors:[["ads-page"]],decls:14,vars:8,consts:[["ngNativeValidate","",1,"panel",3,"formGroup","ngSubmit"],["trans","",1,"header"],["class","vert-row",4,"ngFor","ngForOf"],[1,"setting-toggle-container","margin-top","margin-bottom"],["name","ads.disable","id","ads.disable","formControlName","ads.disable","trans",""],["trans",""],["type","submit","mat-raised-button","","color","accent","trans","",1,"save-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"vert-row"],[1,"input-container"],["trans","",3,"for"],[3,"name","id","formControlName"],[3,"src"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"form",0),o.NdJ("ngSubmit",function(){return e.saveAds()}),o.TgZ(1,"div",1),o._uU(2,"Predefined AD Slots"),o.qZA(),o.YNc(3,kr,6,6,"div",2),o.TgZ(4,"div",3),o.TgZ(5,"mat-slide-toggle",4),o._uU(6,"Disable Ads"),o.qZA(),o.TgZ(7,"p",5),o._uU(8,"Disable all ad related functionality."),o.qZA(),o.qZA(),o.TgZ(9,"button",6),o.ALo(10,"async"),o._uU(11,"Save"),o.qZA(),o.YNc(12,Tr,1,0,"mat-progress-bar",7),o.ALo(13,"async"),o.qZA()),2&t&&(o.Q6J("formGroup",e.form),o.xp6(3),o.Q6J("ngForOf",e.allAds()),o.xp6(6),o.Q6J("disabled",o.lcZ(10,4,e.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(13,6,e.loading$)))},directives:[a.JL,a.sg,qe.P,i.sg,T.Rr,a.JJ,a.u,p.lW,i.O5,a.Fj,wr,k.pW],pipes:[i.Ov],styles:[".panel[_ngcontent-%COMP%]{border:1px solid var(--be-divider-default);box-shadow:none;border-radius:4px;background-color:var(--be-background)}.header[_ngcontent-%COMP%]{background-color:var(--be-background-alternative);border-bottom:1px solid var(--be-divider-lighter);padding:15px;font-weight:500;color:#555}.header[_ngcontent-%COMP%], .vert-row[_ngcontent-%COMP%]{margin-bottom:25px}.vert-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;padding-left:25px;padding-right:25px}image-zoom[_ngcontent-%COMP%]{margin-left:25px;border:1px solid var(--be-divider-default);height:150px}.input-container[_ngcontent-%COMP%]{max-width:750px}textarea[_ngcontent-%COMP%]{display:block;height:150px}label[_ngcontent-%COMP%]:empty{display:none}.setting-toggle-container[_ngcontent-%COMP%]{margin-left:15px}.save-button[_ngcontent-%COMP%]{margin:0 0 30px 15px}@media only screen and (max-width:768px){.vert-row[_ngcontent-%COMP%]{display:block;border-bottom:1px solid var(--be-divider-lighter);margin-bottom:30px;padding-bottom:25px}image-zoom[_ngcontent-%COMP%]{margin-left:0;margin-top:15px}}"],changeDetection:0}),t})();var qr=n(33427);function Ur(t,e){1&t&&(o.TgZ(0,"h2",6),o._uU(1,"Update Plan Details"),o.qZA())}function Ir(t,e){1&t&&(o.TgZ(0,"h2",6),o._uU(1,"Create a New Plan"),o.qZA())}function Mr(t,e){if(1&t&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.name)}}function Or(t,e){if(1&t&&(o.TgZ(0,"option",24),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("ngValue",t.id),o.xp6(1),o.Oqu(t.name)}}function Jr(t,e){if(1&t&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.parent_id)}}function Pr(t,e){1&t&&(o.ynx(0),o.TgZ(1,"p",17),o._uU(2,"How much subscribers of this plan should be charged. (Dollars, euros etc.)"),o.qZA(),o.TgZ(3,"p",17),o._uU(4,"For example, Amount=100, Interval=Year and Interval Count=1, will charge user 100 dollars every year."),o.qZA(),o.BQk())}function Nr(t,e){1&t&&(o.TgZ(0,"p",17),o._uU(1,"Plan amount can't be changed once plan has already been created, however you can add a new child plan with a different price or delete this plan and create a new one."),o.qZA())}function Sr(t,e){if(1&t&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(1),o.Oqu(t.amount)}}function Dr(t,e){if(1&t&&(o.TgZ(0,"option",24),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("ngValue",t.code),o.xp6(1),o.AsE("",t.code," - ",t.name,"")}}function Qr(t,e){if(1&t&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&t){const t=o.oxw(3).ngIf;o.xp6(1),o.Oqu(t.currency)}}function Yr(t,e){if(1&t&&(o.TgZ(0,"div",9),o.TgZ(1,"label",30),o._uU(2,"Currency"),o.qZA(),o.TgZ(3,"select",31),o.YNc(4,Dr,2,3,"option",16),o.ALo(5,"async"),o.qZA(),o.YNc(6,Qr,2,1,"div",12),o.qZA()),2&t){const t=o.oxw(2).ngIf,e=o.oxw();o.xp6(4),o.Q6J("ngForOf",o.lcZ(5,2,e.currencies$)),o.xp6(2),o.Q6J("ngIf",t.currency)}}function Lr(t,e){if(1&t&&(o.TgZ(0,"option",24),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("ngValue",t),o.xp6(1),o.Oqu(t)}}function Fr(t,e){if(1&t&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(1),o.Oqu(t.interval)}}function Er(t,e){if(1&t&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&t){const t=o.oxw(3).ngIf;o.xp6(1),o.Oqu(t.interval_count)}}function Rr(t,e){if(1&t&&(o.TgZ(0,"div",9),o.TgZ(1,"label",32),o._uU(2,"Interval Count"),o.qZA(),o._UZ(3,"input",33),o.TgZ(4,"p",17),o._uU(5,"The number of intervals (specified in the interval property above) between each subscription billing. For example, Interval=Month and Interval Count=3 bills every 3 months."),o.qZA(),o.YNc(6,Er,2,1,"div",12),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(6),o.Q6J("ngIf",t.interval_count)}}function $r(t,e){if(1&t&&(o.ynx(0),o.TgZ(1,"div",9),o.TgZ(2,"label",25),o._uU(3,"Amount"),o.qZA(),o._UZ(4,"input",26),o.YNc(5,Pr,5,0,"ng-container",18),o.YNc(6,Nr,2,0,"p",22),o.YNc(7,Sr,2,1,"div",12),o.qZA(),o.YNc(8,Yr,7,4,"div",27),o.TgZ(9,"div",9),o.TgZ(10,"label",28),o._uU(11,"Interval"),o.qZA(),o.TgZ(12,"select",29),o.YNc(13,Lr,2,2,"option",16),o.qZA(),o.TgZ(14,"p",17),o._uU(15,"The frequency with which a subscription should be billed."),o.qZA(),o.YNc(16,Fr,2,1,"div",12),o.qZA(),o.YNc(17,Rr,7,1,"div",27),o.BQk()),2&t){const t=o.oxw().ngIf,e=o.oxw();o.xp6(4),o.Q6J("min",e.getMinAmount())("max",e.getMaxAmount()),o.xp6(1),o.Q6J("ngIf",!e.data.plan),o.xp6(1),o.Q6J("ngIf",e.data.plan),o.xp6(1),o.Q6J("ngIf",t.amount),o.xp6(1),o.Q6J("ngIf",!e.formValue().parent_id),o.xp6(5),o.Q6J("ngForOf",e.intervals),o.xp6(3),o.Q6J("ngIf",t.interval),o.xp6(1),o.Q6J("ngIf","year"!==e.formValue().interval)}}function Vr(t,e){if(1&t&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(1),o.Oqu(t.position)}}function Br(t,e){1&t&&(o.TgZ(0,"div",36),o.TgZ(1,"mat-slide-toggle",53),o._uU(2,"Free"),o.qZA(),o.TgZ(3,"p",17),o._uU(4,"Basic free plan that will be assigned to new users that have not upgraded to other plans."),o.qZA(),o.qZA())}function Hr(t,e){if(1&t&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(1),o.Oqu(null==t?null:t.permissions)}}function zr(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"li",54),o.TgZ(1,"button",55),o._UZ(2,"mat-icon",56),o.qZA(),o.TgZ(3,"div",57),o._uU(4),o.qZA(),o.TgZ(5,"button",58),o.NdJ("click",function(){const e=o.CHM(t).$implicit;return o.oxw(3).removeFeature(e)}),o._UZ(6,"mat-icon",59),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit;o.uIk("data-id",t.id),o.xp6(4),o.Oqu(t.content)}}function Gr(t,e){1&t&&(o.TgZ(0,"p",17),o._uU(1,"No custom features yet."),o.qZA())}function jr(t,e){if(1&t&&(o.TgZ(0,"div",23),o._uU(1),o.qZA()),2&t){const t=o.oxw(2).ngIf;o.xp6(1),o.Oqu(t.available_space)}}function Xr(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",9),o.TgZ(2,"label",34),o._uU(3,"Position"),o.qZA(),o.TgZ(4,"select",35),o.TgZ(5,"option",24),o._uU(6,"1"),o.qZA(),o.TgZ(7,"option",24),o._uU(8,"2"),o.qZA(),o.TgZ(9,"option",24),o._uU(10,"3"),o.qZA(),o.TgZ(11,"option",24),o._uU(12,"4"),o.qZA(),o.TgZ(13,"option",24),o._uU(14,"5"),o.qZA(),o.TgZ(15,"option",24),o._uU(16,"6"),o.qZA(),o.TgZ(17,"option",24),o._uU(18,"7"),o.qZA(),o.TgZ(19,"option",24),o._uU(20,"8"),o.qZA(),o.qZA(),o.TgZ(21,"p",17),o._uU(22,"Order of plans. Lower position will appear first."),o.qZA(),o.YNc(23,Vr,2,1,"div",12),o.qZA(),o.TgZ(24,"div",36),o.TgZ(25,"mat-slide-toggle",37),o._uU(26,"Recommended"),o.qZA(),o.TgZ(27,"p",17),o._uU(28,'Plan will be marked as "Most Popular" and emphasized to users.'),o.qZA(),o.qZA(),o.YNc(29,Br,5,0,"div",38),o.TgZ(30,"div",36),o.TgZ(31,"mat-slide-toggle",39),o._uU(32,"Show Permissions"),o.qZA(),o.TgZ(33,"p",17),o._uU(34,"Whether plan permissions should be displayed as features to users."),o.qZA(),o.qZA(),o.TgZ(35,"div",36),o.TgZ(36,"mat-slide-toggle",40),o._uU(37,"Hidden"),o.qZA(),o.TgZ(38,"p",17),o._uU(39,"Whether this plan should be hidden on upgrade and pricing pages."),o.qZA(),o.qZA(),o._UZ(40,"permission-manager",41),o.YNc(41,Hr,2,1,"div",12),o.TgZ(42,"div",42),o.TgZ(43,"div",43),o._uU(44,"Custom Features"),o.qZA(),o.TgZ(45,"ul",44),o.NdJ("cdkDropListDropped",function(e){return o.CHM(t),o.oxw(2).reorderPlanFeatures(e)}),o.YNc(46,zr,7,2,"li",45),o.ALo(47,"async"),o.qZA(),o.YNc(48,Gr,2,0,"p",22),o.ALo(49,"async"),o.TgZ(50,"form",46),o.NdJ("ngSubmit",function(){return o.CHM(t),o.oxw(2).addFeature()}),o.TgZ(51,"div",9),o.TgZ(52,"div",47),o.TgZ(53,"input",48),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).newFeature=e}),o.qZA(),o.TgZ(54,"button",49),o._uU(55,"Add"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(56,"div",50),o.TgZ(57,"div",43),o._uU(58,"Available Space"),o.qZA(),o.TgZ(59,"space-input",51),o.TgZ(60,"p",52),o._uU(61,"Hard drive space available to users subscribed to this plan."),o.qZA(),o.YNc(62,jr,2,1,"div",12),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw().ngIf,e=o.oxw();o.xp6(5),o.Q6J("ngValue",1),o.xp6(2),o.Q6J("ngValue",2),o.xp6(2),o.Q6J("ngValue",3),o.xp6(2),o.Q6J("ngValue",4),o.xp6(2),o.Q6J("ngValue",5),o.xp6(2),o.Q6J("ngValue",6),o.xp6(2),o.Q6J("ngValue",7),o.xp6(2),o.Q6J("ngValue",8),o.xp6(4),o.Q6J("ngIf",t.position),o.xp6(6),o.Q6J("ngIf",!e.data.plan||e.data.plan.free),o.xp6(12),o.Q6J("ngIf",null==t?null:t.permissions),o.xp6(5),o.Q6J("ngForOf",o.lcZ(47,15,e.features$)),o.xp6(2),o.Q6J("ngIf",!o.lcZ(49,17,e.features$).length),o.xp6(5),o.Q6J("ngModel",e.newFeature),o.xp6(9),o.Q6J("ngIf",t.available_space)}}function Wr(t,e){1&t&&(o.TgZ(0,"span",17),o._uU(1,"Update Plan"),o.qZA())}function Kr(t,e){1&t&&(o.TgZ(0,"span",17),o._uU(1,"Create Plan"),o.qZA())}function tl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",7),o.NdJ("ngSubmit",function(){return o.CHM(t),o.oxw().confirm()}),o.TgZ(1,"div",8),o.TgZ(2,"div",9),o.TgZ(3,"label",10),o._uU(4,"Name"),o.qZA(),o._UZ(5,"input",11),o.YNc(6,Mr,2,1,"div",12),o.qZA(),o.TgZ(7,"div",9),o.TgZ(8,"label",13),o._uU(9,"Parent Plan"),o.qZA(),o.TgZ(10,"select",14),o.TgZ(11,"option",15),o._uU(12,"None"),o.qZA(),o.YNc(13,Or,2,2,"option",16),o.qZA(),o.TgZ(14,"p",17),o._uU(15,"Used for creating yearly, weekly etc versions of base plan. Child plans will inherit their parent permissions/features."),o.qZA(),o.YNc(16,Jr,2,1,"div",12),o.qZA(),o.YNc(17,$r,18,9,"ng-container",18),o.YNc(18,Xr,63,19,"ng-container",18),o.qZA(),o.TgZ(19,"div",19),o.TgZ(20,"button",20),o.NdJ("click",function(){return o.CHM(t),o.oxw().close()}),o._uU(21,"Cancel"),o.qZA(),o.TgZ(22,"button",21),o.ALo(23,"async"),o.YNc(24,Wr,2,0,"span",22),o.YNc(25,Kr,2,0,"span",22),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.Q6J("formGroup",n.form),o.xp6(6),o.Q6J("ngIf",t.name),o.xp6(5),o.Q6J("ngValue",null),o.xp6(2),o.Q6J("ngForOf",n.getBasePlans(n.data.plan)),o.xp6(3),o.Q6J("ngIf",t.parent_id),o.xp6(1),o.Q6J("ngIf",!n.formValue().free),o.xp6(1),o.Q6J("ngIf",!n.formValue().parent_id),o.xp6(4),o.Q6J("disabled",o.lcZ(23,10,n.loading$)),o.xp6(2),o.Q6J("ngIf",n.data.plan),o.xp6(1),o.Q6J("ngIf",!n.data.plan)}}let el=(()=>{class t{constructor(t,e,n,i,a,o){this.dialogRef=t,this.data=e,this.plans=n,this.toast=i,this.valueLists=a,this.fb=o,this.loading$=new c.X(!1),this.features$=new c.X([]),this.errors$=new c.X({}),this.currencies$=new c.X([]),this.intervals=["day","week","month","year"],this.allPlans$=new c.X([]),this.form=this.fb.group({name:[""],parent_id:[],free:[!1],hidden:[!1],recommended:[!1],show_permissions:[!1],amount:[],currency:[],interval:[],interval_count:[],position:[],available_space:[],permissions:[[]]})}ngOnInit(){this.resetState(),this.allPlans$.next(this.data.plans||[]),this.valueLists.get(["currencies"]).subscribe(t=>{this.currencies$.next(Object.values(t.currencies))}),this.data.plan&&this.hydrateModel(this.data.plan)}confirm(){let t;this.loading$.next(!0),t=this.data.plan?this.plans.update(this.data.plan.id,this.getPayload()):this.plans.create(this.getPayload()),t.pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.close(t.plan),this.toast.open("Plan has been "+(this.data.plan?"updated":"created"))},t=>{this.errors$.next(t.errors)})}getPayload(){const t=Object.assign({},this.form.getRawValue());t.features=this.features$.value.map(t=>t.content);const e=this.currencies$.value.find(e=>e.code===t.currency);return t.currency_symbol=e.symbol,"year"===t.interval&&(t.interval_count=1),t}close(t){this.resetState(),this.dialogRef.close(t)}addFeature(){!(this.features$.value.findIndex(t=>t.content===this.newFeature)>-1)&&this.newFeature&&(this.features$.next([...this.features$.value,{content:this.newFeature,id:(0,Ci.O)(5)}]),this.newFeature=null)}removeFeature(t){const e=this.features$.value.filter(e=>e.id!==t.id);this.features$.next(e)}getBasePlans(t){return this.allPlans$.value.filter(e=>!(e.parent_id||e.free||t&&t.id===e.id))}hydrateModel(t){this.form.patchValue(t);const e=t.features.map(t=>({content:t,id:(0,Ci.O)(5)}));this.form.get("amount").disable(),this.features$.next(e)}resetState(){this.form.reset({currency:"USD",interval:"month",interval_count:1,position:1,permissions:[],free:!1,recommended:!1,show_permissions:!1}),this.features$.next([]),this.errors$.next({})}reorderPlanFeatures(t){const e=[...this.features$.value];(0,ie.bA)(e,t.previousIndex,t.currentIndex),this.features$.next(e)}formValue(){return this.form.value}getMinAmount(){return this.form.get("parent_id").value?1:0}getMaxAmount(){return null}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(m.so),o.Y36(m.WI),o.Y36(qr.o),o.Y36(ye.F),o.Y36(ke.l),o.Y36(a.qu))},t.\u0275cmp=o.Xpm({type:t,selectors:[["crupdate-plan-modal"]],decls:9,vars:8,consts:[[1,"modal-header"],["class","modal-title","mat-dialog-title","","trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],[1,"overlay",3,"isVisible"],["mat-dialog-title","","trans","",1,"modal-title"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content","",1,"many-inputs","mat-dialog-content"],[1,"input-container"],["for","plan-modal-name","trans",""],["type","text","id","plan-modal-name","formControlName","name","required",""],["class","error",4,"ngIf"],["for","parent_id","trans",""],["id","parent_id","formControlName","parent_id","required",""],["trans","",3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["trans",""],[4,"ngIf"],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["type","button","mat-button","","trans","",1,"button","cancel",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary",3,"disabled"],["trans","",4,"ngIf"],[1,"error"],[3,"ngValue"],["for","amount","trans",""],["type","number","step","0.01","id","amount","formControlName","amount","required","",3,"min","max"],["class","input-container",4,"ngIf"],["for","interval","trans",""],["id","interval","formControlName","interval","required","",1,"interval-select"],["for","currency","trans",""],["id","currency","formControlName","currency","required",""],["for","interval_count","trans",""],["type","number","id","interval_count","formControlName","interval_count","required","","min","1","max","12"],["for","position","trans",""],["type","text","id","position","formControlName","position","required",""],[1,"setting-toggle-container"],["id","recommended","formControlName","recommended","trans",""],["class","setting-toggle-container",4,"ngIf"],["id","show_permissions","formControlName","show_permissions","trans",""],["id","plan-modal-hidden","formControlName","hidden","trans",""],["formControlName","permissions"],[1,"plan-features"],["trans","",1,"section-title"],["cdkDropList","",1,"unstyled-list","feature-list",3,"cdkDropListDropped"],["class","feature-list-item","cdkDrag","",4,"ngFor","ngForOf"],["ngNativeValidate","",3,"ngSubmit"],[1,"input-with-action"],["type","text","name","new-feature","placeholder","+New Feature","trans-placeholder","","autocomplete","false","required","",3,"ngModel","ngModelChange"],["type","submit","mat-flat-button","","color","accent","trans",""],[1,"available-space"],["formControlName","available_space"],["trans","",1,"description"],["id","free","formControlName","free","trans",""],["cdkDrag","",1,"feature-list-item"],["cdkDragHandle","","mat-icon-button","",1,"drag-handle"],["svgIcon","drag-handle","matListIcon",""],[1,"text"],["mat-icon-button","",1,"delete-button",3,"click"],["svgIcon","delete","matListIcon",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.YNc(1,Ur,2,0,"h2",1),o.YNc(2,Ir,2,0,"h2",1),o.TgZ(3,"button",2),o.NdJ("click",function(){return e.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.YNc(5,tl,26,12,"form",4),o.ALo(6,"async"),o._UZ(7,"loading-indicator",5),o.ALo(8,"async")),2&t&&(o.xp6(1),o.Q6J("ngIf",e.data.plan),o.xp6(1),o.Q6J("ngIf",!e.data.plan),o.xp6(3),o.Q6J("ngIf",o.lcZ(6,4,e.errors$)),o.xp6(2),o.Q6J("isVisible",o.lcZ(8,6,e.loading$)))},directives:[i.O5,P.Hw,Ma.Q,m.uh,qe.P,a.JL,a.sg,m.xY,a.Fj,a.JJ,a.u,a.Q7,a.EJ,a.YN,a.Kr,i.sg,m.H8,p.lW,a.wV,a.qQ,a.Fd,T.Rr,Ha,ie.Wj,a.F,a.On,Si,ie.Zt,ie.Bh],pipes:[i.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.section-title[_ngcontent-%COMP%]{font-weight:500;border-bottom:1px solid var(--be-divider-default);padding-bottom:5px;margin-bottom:5px}.feature-list-item[_ngcontent-%COMP%]{display:flex;align-items:center;padding:10px 0;font-size:1.6rem}.feature-list-item[_ngcontent-%COMP%]   .text[_ngcontent-%COMP%]{padding:0 10px;white-space:nowrap;text-overflow:ellipsis}.feature-list-item[_ngcontent-%COMP%]   .delete-button[_ngcontent-%COMP%]{color:#f44336;margin-left:auto}.feature-list-item[_ngcontent-%COMP%]   .drag-handle[_ngcontent-%COMP%]{cursor:move}.plan-features[_ngcontent-%COMP%]{margin-bottom:20px;padding-bottom:20px;border-bottom:1px solid var(--be-divider-default)}.interval-select[_ngcontent-%COMP%]{text-transform:capitalize}.available-space[_ngcontent-%COMP%]   .section-title[_ngcontent-%COMP%]{border-bottom:none}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%], .cdk-drop-list-dragging[_ngcontent-%COMP%]   .cdk-drag[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}"],changeDetection:0}),t})();const nl=[new ho.XQ({type:ho.Bq.Select,key:"parent_id",label:"Type",description:"Whether plan is a child or not",defaultValue:null,options:[{key:"Any",value:null},{key:"Child",value:{value:null,operator:"!="}},{key:"Parent",value:{value:null,operator:"="}}]}),new ho.XQ({type:ho.Bq.Select,key:"currency",description:"Currency assigned to the plan",defaultValue:"USD",options:[{key:"USD",value:"USD"},{key:"EUR",value:"EUR"},{key:"Pound Sterling",value:"GBP"},{key:"Canadian Dollar",value:"CAD"}]}),new ho.XQ({type:ho.Bq.Select,key:"interval",description:"Currency assigned to the plan",defaultValue:"USD",options:[{key:"Day",value:"day"},{key:"Week",value:"week"},{key:"Month",value:"month"},{key:"Year",value:"yea"}]}),new mo.T7({description:"Date plan was created"}),new mo.yH({description:"Date plan was last updated"})];function il(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",22),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).maybeDeleteSelectedPlans()}),o._uU(1," Delete "),o.qZA()}}const al=function(t){return{count:t,resource:"plan(s)"}};function ol(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"th",18),o.TgZ(2,"div",19),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",20),o.YNc(5,il,2,0,"button",21),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,al,t)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("plans.delete"))}}function sl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",34),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().showCrupdatePlanModal(e)}),o.ALo(1,"trans"),o._UZ(2,"mat-icon",35),o.qZA()}2&t&&o.Q6J("matTooltip",o.lcZ(1,1,"Edit plan"))}function rl(t,e){if(1&t&&(o.TgZ(0,"tr"),o._UZ(1,"td",23),o.TgZ(2,"td",24),o._uU(3),o.qZA(),o.TgZ(4,"td",25),o._uU(5),o.qZA(),o.TgZ(6,"td",26),o._uU(7),o.ALo(8,"currency"),o.qZA(),o.TgZ(9,"td",27),o._uU(10),o.qZA(),o.TgZ(11,"td",28),o._uU(12),o.qZA(),o.TgZ(13,"td",29),o._uU(14),o.qZA(),o.TgZ(15,"td",30),o._uU(16),o.qZA(),o.TgZ(17,"td",31),o._uU(18),o.ALo(19,"formattedDate"),o.qZA(),o.TgZ(20,"td",32),o.YNc(21,sl,3,3,"button",33),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(1),o.Q6J("table-body-checkbox",t.id),o.xp6(2),o.Oqu(t.name),o.xp6(2),o.Oqu(t.parent?t.parent.name:"-"),o.xp6(2),o.hij(" ",t.free?"Free":o.xi3(8,10,t.amount,t.currency)," "),o.xp6(3),o.Oqu(t.free?"Free":t.currency),o.xp6(2),o.Oqu(t.free?"Free":t.interval),o.xp6(2),o.hij(" ",t.parent_id?"-":t.recommended?"Yes":"No"," "),o.xp6(2),o.Oqu(t.parent_id?"-":t.position),o.xp6(2),o.Oqu(o.lcZ(19,13,t.updated_at)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("plans.update"))}}function ll(t,e){1&t&&(o.TgZ(0,"no-results-message",36),o.TgZ(1,"span",37),o._uU(2,"No plans have been created yet"),o.qZA(),o.qZA())}let cl=(()=>{class t{constructor(t,e,n,i){this.plans=t,this.currentUser=e,this.toast=n,this.datatable=i,this.filters=nl,this.loading$=new c.X(!1),this.plans$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:qr.o.BASE_URI})}maybeDeleteSelectedPlans(){this.datatable.confirmResourceDeletion("plans").subscribe(()=>{this.loading$.next(!0),this.plans.delete(this.datatable.selectedRows$.value).pipe((0,Ze.x)(()=>{this.loading$.next(!1),this.datatable.reset()})).subscribe()})}showCrupdatePlanModal(t){this.datatable.openCrupdateResourceModal(el,{plan:t,plans:this.datatable.data$.value}).subscribe()}syncPlans(){this.loading$.next(!0),this.plans.sync().pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Synced plans across all enabled payment gateways")})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(qr.o),o.Y36(ba.I),o.Y36(ye.F),o.Y36(go.x))},t.\u0275cmp=o.Xpm({type:t,selectors:[["plan-index"]],features:[o._Bn([go.x])],decls:44,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","plans",3,"filters"],[1,"action-buttons"],["mat-raised-button","",1,"btn-with-dropdown-icon",3,"disabled","matTooltip","click"],["svgIcon","sync"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"disabled","click"],["svgIcon","add"],[1,"datatable","responsive-table"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","parent_id","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","online-payments.svg",4,"ngIf"],["colspan","10"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["mat-raised-button","","color","warn","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["data-label","Parent Plan"],["data-label","Amount"],["data-label","Currency"],["data-label","Interval"],["data-label","Recommended"],["data-label","Position"],["data-label","Last Updated"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["svgImage","online-payments.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Subscription Plans"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o.TgZ(5,"div",4),o.TgZ(6,"button",5),o.NdJ("click",function(){return e.syncPlans()}),o.ALo(7,"async"),o.TgZ(8,"span",1),o._uU(9,"Sync"),o.qZA(),o._UZ(10,"mat-icon",6),o.qZA(),o.TgZ(11,"button",7),o.NdJ("click",function(){return e.showCrupdatePlanModal()}),o._UZ(12,"mat-icon",8),o.TgZ(13,"span",1),o._uU(14,"Add New Plan"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(15,"div",9),o.TgZ(16,"table",10),o.TgZ(17,"thead"),o.TgZ(18,"tr"),o._UZ(19,"th",11),o.TgZ(20,"th",12),o._uU(21,"Name"),o.qZA(),o.TgZ(22,"th",13),o._uU(23,"Parent Plan"),o.qZA(),o.TgZ(24,"th",12),o._uU(25,"Amount"),o.qZA(),o.TgZ(26,"th",12),o._uU(27,"Currency"),o.qZA(),o.TgZ(28,"th",12),o._uU(29,"Interval"),o.qZA(),o.TgZ(30,"th",12),o._uU(31,"Recommended"),o.qZA(),o.TgZ(32,"th",12),o._uU(33,"Position"),o.qZA(),o.TgZ(34,"th",14),o._uU(35,"Last Updated"),o.qZA(),o._UZ(36,"th"),o.qZA(),o.YNc(37,ol,6,4,"tr",15),o.qZA(),o.TgZ(38,"tbody"),o.YNc(39,rl,22,15,"tr",16),o.ALo(40,"async"),o.qZA(),o.qZA(),o.YNc(41,ll,3,0,"no-results-message",17),o.ALo(42,"async"),o._UZ(43,"datatable-footer"),o.qZA()),2&t&&(o.xp6(4),o.Q6J("filters",e.filters),o.xp6(2),o.Q6J("disabled",o.lcZ(7,7,e.loading$))("matTooltip","Sync if one of payment gateways was enabled after plan has already been created"),o.xp6(5),o.Q6J("disabled",!e.currentUser.hasPermission("plans.create")),o.xp6(26),o.Q6J("ngIf",e.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(40,9,e.plans$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(42,11,e.datatable.paginator.noResults$)))},directives:[qe.P,vo.h,p.lW,q.gM,P.Hw,_o.e,Zo.p,i.O5,i.sg,xo.V,yo.O,wo.U],pipes:[i.Ov,i.H9,Pn.l,le.R],styles:[""],changeDetection:0}),t})();var dl=n(6153),ul=n(47701),pl=n(44689),gl=n(17455),hl=n(83927);function ml(t,e){1&t&&(o.TgZ(0,"h2",6),o._uU(1,"Update Subscription Details"),o.qZA())}function fl(t,e){1&t&&(o.TgZ(0,"h2",6),o._uU(1,"Create a New Subscription"),o.qZA())}function bl(t,e){if(1&t&&(o.TgZ(0,"div",35),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.user_id)}}function vl(t,e){if(1&t&&(o.TgZ(0,"mat-option",36),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t),o.xp6(1),o.Oqu(t.email)}}function _l(t,e){if(1&t&&(o.TgZ(0,"option",37),o._UZ(1,"full-plan-name",38),o._uU(2),o.ALo(3,"currency"),o.qZA()),2&t){const t=e.$implicit;o.Q6J("ngValue",t.id),o.xp6(1),o.Q6J("plan",t),o.xp6(1),o.hij(" (",o.xi3(3,3,t.amount,t.currency),") ")}}function Zl(t,e){if(1&t&&(o.TgZ(0,"div",35),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.description)}}function xl(t,e){if(1&t&&(o.TgZ(0,"div",35),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.renews_at)}}function yl(t,e){if(1&t&&(o.TgZ(0,"div",35),o._uU(1),o.qZA()),2&t){const t=o.oxw().ngIf;o.xp6(1),o.Oqu(t.ends_at)}}function Al(t,e){1&t&&(o.TgZ(0,"span",26),o._uU(1,"Update"),o.qZA())}function wl(t,e){1&t&&(o.TgZ(0,"span",26),o._uU(1,"Create"),o.qZA())}function kl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"form",7),o.NdJ("ngSubmit",function(){return o.CHM(t),o.oxw().confirm()}),o.TgZ(1,"div",8),o.TgZ(2,"div",9),o.TgZ(3,"label",10),o._uU(4,"User"),o.qZA(),o._UZ(5,"input",11),o.YNc(6,bl,2,1,"div",12),o.TgZ(7,"mat-autocomplete",13,14),o.YNc(9,vl,2,2,"mat-option",15),o.ALo(10,"async"),o.qZA(),o.qZA(),o.ynx(11,16),o.TgZ(12,"div",9),o.TgZ(13,"label",17),o._uU(14,"Plan"),o.qZA(),o.TgZ(15,"select",18),o.YNc(16,_l,4,6,"option",19),o.qZA(),o.qZA(),o.TgZ(17,"div",9),o.TgZ(18,"label",20),o._uU(19,"Description"),o.qZA(),o._UZ(20,"textarea",21),o.YNc(21,Zl,2,1,"div",12),o.qZA(),o.TgZ(22,"div",22),o.TgZ(23,"label",23),o._uU(24,"Renews At"),o.qZA(),o.TgZ(25,"input",24),o.NdJ("click",function(){o.CHM(t);const e=o.MAs(31);return o.oxw().toggleDatePicker(e)}),o.qZA(),o._UZ(26,"mat-datepicker-toggle",25),o.TgZ(27,"p",26),o._uU(28,"This will only change local records. User will continue to be billed on their original cycle on the payment gateway."),o.qZA(),o.YNc(29,xl,2,1,"div",12),o._UZ(30,"mat-datepicker",null,27),o.qZA(),o.TgZ(32,"div",22),o.TgZ(33,"label",28),o._uU(34,"Ends At"),o.qZA(),o.TgZ(35,"input",29),o.NdJ("click",function(){o.CHM(t);const e=o.MAs(41);return o.oxw().toggleDatePicker(e)}),o.qZA(),o.TgZ(36,"p",26),o._uU(37,"This will only change local records. User will continue to be billed on their original cycle on the payment gateway."),o.qZA(),o.YNc(38,yl,2,1,"div",12),o._UZ(39,"mat-datepicker-toggle",25),o._UZ(40,"mat-datepicker",null,30),o.qZA(),o.BQk(),o.qZA(),o.TgZ(42,"div",31),o.TgZ(43,"button",32),o.NdJ("click",function(){return o.CHM(t),o.oxw().close()}),o._uU(44,"Cancel"),o.qZA(),o.TgZ(45,"button",33),o.ALo(46,"async"),o.YNc(47,Al,2,0,"span",34),o.YNc(48,wl,2,0,"span",34),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.ngIf,n=o.MAs(8),i=o.MAs(31),a=o.MAs(41),s=o.oxw();o.xp6(5),o.Q6J("formControl",s.userAutocomplete)("matAutocomplete",n),o.xp6(1),o.Q6J("ngIf",t.user_id),o.xp6(1),o.Q6J("displayWith",s.displayFn),o.xp6(2),o.Q6J("ngForOf",o.lcZ(10,17,s.filteredUsers)),o.xp6(2),o.Q6J("formGroup",s.form),o.xp6(5),o.Q6J("ngForOf",s.plans),o.xp6(5),o.Q6J("ngIf",t.description),o.xp6(4),o.Q6J("matDatepicker",i),o.xp6(1),o.Q6J("for",i),o.xp6(3),o.Q6J("ngIf",t.renews_at),o.xp6(6),o.Q6J("matDatepicker",a),o.xp6(3),o.Q6J("ngIf",t.ends_at),o.xp6(1),o.Q6J("for",a),o.xp6(6),o.Q6J("disabled",o.lcZ(46,19,s.loading$)),o.xp6(2),o.Q6J("ngIf",s.data.subscription),o.xp6(1),o.Q6J("ngIf",!s.data.subscription)}}let Tl=(()=>{class t{constructor(t,e,n,i,o,s,r){this.dialogRef=t,this.data=e,this.subscriptions=n,this.toast=i,this.users=o,this.plansApi=s,this.fb=r,this.loading$=new c.X(!1),this.form=this.fb.group({plan_id:[""],description:[""],renews_at:[""],ends_at:[""]}),this.errors$=new c.X({}),this.userAutocomplete=new a.NI(null),this.filteredUsers=new v.xQ,this.plans=[],this.resetState()}ngOnInit(){this.resetState(),this.bindToUserAutocomplete(),this.fetchPlans(),this.form.get("ends_at").valueChanges.pipe((0,Vs.x)()).subscribe(t=>{t?this.form.get("renews_at").disable():this.form.get("renews_at").enable()}),this.form.get("renews_at").valueChanges.pipe((0,Vs.x)()).subscribe(t=>{t?this.form.get("ends_at").disable():this.form.get("ends_at").enable()}),this.data.subscription&&this.hydrateModel(this.data.subscription)}confirm(){let t;this.loading$.next(!0),t=this.data.subscription?this.subscriptions.update(this.data.subscription.id,this.getPayload()):this.subscriptions.create(this.getPayload()),t.pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.close(t.subscription),this.toast.open("Subscription "+(this.data.subscription?"updated":"created"))},t=>this.errors$.next(t.errors))}close(t){this.resetState(),this.dialogRef.close(t)}displayFn(t){return t?t.email:null}hydrateModel(t){const e=Object.assign({},t);t.user_id&&this.userAutocomplete.setValue(t.user),this.form.patchValue(e)}getPayload(){const t=this.form.value;return!this.data.subscription&&this.userAutocomplete.value&&(t.user_id=this.userAutocomplete.value.id),t}resetState(){this.form.reset(),this.errors$.next({})}toggleDatePicker(t){t.opened?t.close():t.open()}bindToUserAutocomplete(){this.filteredUsers=this.userAutocomplete.valueChanges.pipe((0,ul.b)(400),(0,pl.w)(t=>t?this.users.getAll({query:t}):(0,B.of)([])))}fetchPlans(){this.plansApi.all().subscribe(t=>{this.plans=t.pagination.data,!this.form.value.plan_id&&this.plans.length&&this.form.patchValue({plan_id:this.plans[0].id})})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(m.so),o.Y36(m.WI),o.Y36(gl.t),o.Y36(ye.F),o.Y36(fa.Q),o.Y36(qr.o),o.Y36(a.qu))},t.\u0275cmp=o.Xpm({type:t,selectors:[["crupdate-subscription-modal"]],decls:9,vars:8,consts:[[1,"modal-header"],["class","modal-title","mat-dialog-title","","trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"ngSubmit",4,"ngIf"],[1,"overlay",3,"isVisible"],["mat-dialog-title","","trans","",1,"modal-title"],["autocomplete","off","ngNativeValidate","",3,"ngSubmit"],["mat-dialog-content","",1,"many-inputs","mat-dialog-content"],[1,"input-container"],["for","user","trans",""],["type","text","id","user","placeholder","Search for user...","required","",3,"formControl","matAutocomplete"],["class","error",4,"ngIf"],[3,"displayWith"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],[3,"formGroup"],["for","plan","trans",""],["id","plan","formControlName","plan_id","required",""],[3,"ngValue",4,"ngFor","ngForOf"],["for","description","trans",""],["id","description","formControlName","description"],[1,"input-container","date-picker-input-container"],["for","renews_at","trans",""],["id","renews_at","formControlName","renews_at",3,"matDatepicker","click"],[3,"for"],["trans",""],["renewsAtDatePicker",""],["for","ends_at","trans",""],["id","ends_at","formControlName","ends_at",3,"matDatepicker","click"],["endsAtDatePicker",""],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["type","button","mat-button","","trans","",1,"button","cancel",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary",3,"disabled"],["trans","",4,"ngIf"],[1,"error"],[3,"value"],[3,"ngValue"],[3,"plan"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.YNc(1,ml,2,0,"h2",1),o.YNc(2,fl,2,0,"h2",1),o.TgZ(3,"button",2),o.NdJ("click",function(){return e.close()}),o._UZ(4,"mat-icon",3),o.qZA(),o.qZA(),o.YNc(5,kl,49,21,"form",4),o.ALo(6,"async"),o._UZ(7,"loading-indicator",5),o.ALo(8,"async")),2&t&&(o.xp6(1),o.Q6J("ngIf",e.data.subscription),o.xp6(1),o.Q6J("ngIf",!e.data.subscription),o.xp6(3),o.Q6J("ngIf",o.lcZ(6,4,e.errors$)),o.xp6(2),o.Q6J("isVisible",o.lcZ(8,6,e.loading$)))},directives:[i.O5,P.Hw,Ma.Q,m.uh,qe.P,a.JL,a.F,m.xY,a.Fj,u.ZL,a.Q7,a.JJ,a.oH,u.XC,i.sg,a.sg,a.EJ,a.u,Gt,Xt,$t,m.H8,p.lW,Z.ey,a.YN,a.Kr,hl.T],pipes:[i.Ov,i.H9],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.date-picker-input-container[_ngcontent-%COMP%]{position:relative}.mat-datepicker-toggle[_ngcontent-%COMP%]{position:absolute;top:29px;right:0}.mat-autocomplete-panel[_ngcontent-%COMP%]   .mat-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0}"],changeDetection:0}),t})();const Cl=[new ho.XQ({type:ho.Bq.Select,key:"ends_at",label:"Status",description:"Whether subscription is active or cancelled",defaultValue:{value:null,operator:ho.pg.eq},options:[{key:"Active",value:{value:null,operator:ho.pg.eq}},{key:"Cancelled",value:{value:null,operator:ho.pg.ne}}]}),new ho.XQ({type:ho.Bq.Select,key:"gateway_name",label:"Gateway",description:"With which payment provider was subscription created",defaultValue:"stripe",options:[{key:"Stripe",value:"stripe"},{key:"Paypal",value:"paypal"},{key:"None",value:null}]}),new mo.T7({description:"Date subscription was created"}),new mo.yH({description:"Date subscription was last updated"})];function ql(t,e){1&t&&o._UZ(0,"mat-icon",25)}function Ul(t,e){1&t&&(o.TgZ(0,"span"),o._uU(1,"-"),o.qZA())}function Il(t,e){1&t&&o._UZ(0,"mat-icon",25)}function Ml(t,e){1&t&&(o.TgZ(0,"span"),o._uU(1,"-"),o.qZA())}function Ol(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"button",26),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().openCrupdateSubscriptionModal(e)}),o.ALo(2,"trans"),o._UZ(3,"mat-icon",27),o.qZA(),o.TgZ(4,"button",28),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().maybeCancelSubscription(e)}),o.ALo(5,"trans"),o._UZ(6,"mat-icon",29),o.qZA(),o.TgZ(7,"button",26),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().maybeDeleteSubscription(e)}),o.ALo(8,"trans"),o._UZ(9,"mat-icon",30),o.qZA(),o.BQk()}if(2&t){const t=o.oxw().$implicit;o.xp6(1),o.Q6J("matTooltip",o.lcZ(2,4,"Edit")),o.xp6(3),o.Q6J("disabled",t.cancelled)("matTooltip",o.lcZ(5,6,"Cancel/Suspend")),o.xp6(3),o.Q6J("matTooltip",o.lcZ(8,8,"Delete"))}}function Jl(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"td"),o._UZ(2,"user-column",15),o.qZA(),o.TgZ(3,"td",16),o._uU(4),o.qZA(),o.TgZ(5,"td",17),o.YNc(6,ql,1,0,"mat-icon",18),o.YNc(7,Ul,2,0,"span",19),o.qZA(),o.TgZ(8,"td",20),o.YNc(9,Il,1,0,"mat-icon",18),o.YNc(10,Ml,2,0,"span",19),o.qZA(),o.TgZ(11,"td",21),o._uU(12),o.ALo(13,"formattedDate"),o.qZA(),o.TgZ(14,"td",22),o._uU(15),o.ALo(16,"formattedDate"),o.qZA(),o.TgZ(17,"td",23),o._uU(18),o.ALo(19,"formattedDate"),o.qZA(),o.TgZ(20,"td",24),o.YNc(21,Ol,10,10,"ng-container",19),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(2),o.Q6J("user",t.user),o.xp6(2),o.Oqu(t.gateway_name),o.xp6(2),o.Q6J("ngIf",t.cancelled),o.xp6(1),o.Q6J("ngIf",!t.cancelled),o.xp6(2),o.Q6J("ngIf",t.on_grace_period),o.xp6(1),o.Q6J("ngIf",!t.on_grace_period),o.xp6(2),o.Oqu(t.renews_at?o.lcZ(13,10,t.renews_at):"-"),o.xp6(3),o.Oqu(t.ends_at?o.lcZ(16,12,t.ends_at):"-"),o.xp6(3),o.Oqu(o.lcZ(19,14,t.created_at)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("subscriptions.delete"))}}function Pl(t,e){1&t&&(o.TgZ(0,"no-results-message",31),o.TgZ(1,"span",32),o._uU(2,"No subscriptions have been created yet"),o.qZA(),o.qZA())}let Nl=(()=>{class t{constructor(t,e,n,i,a){this.modal=t,this.subscriptions=e,this.currentUser=n,this.toast=i,this.datatable=a,this.filters=Cl,this.loading$=new c.X(!1),this.subscriptions$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:gl.t.BASE_URI})}maybeCancelSubscription(t){this.modal.open(Do.z,{title:"Cancel Subscription",body:"Are you sure you want to cancel this subscription?",bodyBold:"This will cancel or suspend subscription based on its gateway and put user on grace period until their next scheduled renewal date and allow them to renew the subscription.",ok:"Cancel",cancel:"Go Back"}).afterClosed().subscribe(e=>{e&&this.cancelOrDeleteSubscription(t,{delete:!1})})}maybeDeleteSubscription(t){this.modal.open(Do.z,{title:"Delete Subscription",body:"Are you sure you want to delete this subscription?",bodyBold:"This will permanently delete user subscription and immediately cancel it on billing gateway.",ok:"Delete",cancel:"Go Back"}).afterClosed().subscribe(e=>{e&&this.cancelOrDeleteSubscription(t,{delete:!0})})}cancelOrDeleteSubscription(t,e={}){this.loading$.next(!0),this.subscriptions.cancel(t.id,{delete:e.delete}).pipe((0,Ze.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.datatable.reset(),this.toast.open("Subscription cancelled.")})}openCrupdateSubscriptionModal(t){this.modal.open(Tl,{subscription:t}).afterClosed().subscribe(t=>{t&&this.datatable.reset()})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Ae.u),o.Y36(gl.t),o.Y36(ba.I),o.Y36(ye.F),o.Y36(go.x))},t.\u0275cmp=o.Xpm({type:t,selectors:[["subscription-index"]],features:[o._Bn([go.x])],decls:35,vars:8,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","subscriptions",3,"filters"],[1,"action-buttons"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"disabled","click"],["svgIcon","add"],[1,"datatable","responsive-table"],[1,"material-table"],["table-sort-header","user_id","trans",""],["table-sort-header","","trans",""],["table-sort-header","ends_at","trans",""],["table-sort-header","created_at","trans",""],[4,"ngFor","ngForOf"],["svgImage","subscriptions.svg",4,"ngIf"],[3,"user"],["data-label","Gateway"],["data-label","Cancelled"],["svgIcon","check",4,"ngIf"],[4,"ngIf"],["data-label","On Grace Period"],["data-label","Renews At"],["data-label","Ends At"],["data-label","Created At"],[1,"edit-column"],["svgIcon","check"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["mat-icon-button","",3,"disabled","matTooltip","click"],["svgIcon","pause"],["svgIcon","delete"],["svgImage","subscriptions.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Subscriptions"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o.TgZ(5,"div",4),o.TgZ(6,"button",5),o.NdJ("click",function(){return e.openCrupdateSubscriptionModal()}),o._UZ(7,"mat-icon",6),o.TgZ(8,"span",1),o._uU(9,"Add New Subscription"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(10,"div",7),o.TgZ(11,"table",8),o.TgZ(12,"thead"),o.TgZ(13,"tr"),o.TgZ(14,"th",9),o._uU(15,"User"),o.qZA(),o.TgZ(16,"th",10),o._uU(17,"Gateway"),o.qZA(),o.TgZ(18,"th",11),o._uU(19,"Cancelled"),o.qZA(),o.TgZ(20,"th",1),o._uU(21,"On Grace Period"),o.qZA(),o.TgZ(22,"th",10),o._uU(23,"Renews At"),o.qZA(),o.TgZ(24,"th",10),o._uU(25,"Ends At"),o.qZA(),o.TgZ(26,"th",12),o._uU(27,"Created At"),o.qZA(),o._UZ(28,"th"),o.qZA(),o.qZA(),o.TgZ(29,"tbody"),o.YNc(30,Jl,22,16,"tr",13),o.ALo(31,"async"),o.qZA(),o.qZA(),o.YNc(32,Pl,3,0,"no-results-message",14),o.ALo(33,"async"),o._UZ(34,"datatable-footer"),o.qZA()),2&t&&(o.xp6(4),o.Q6J("filters",e.filters),o.xp6(2),o.Q6J("disabled",!e.currentUser.hasPermission("subscriptions.create")),o.xp6(24),o.Q6J("ngForOf",o.lcZ(31,4,e.subscriptions$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(33,6,e.datatable.paginator.noResults$)))},directives:[qe.P,vo.h,p.lW,P.Hw,Zo.p,i.sg,i.O5,xo.V,Ao.r,q.gM,wo.U],pipes:[i.Ov,Pn.l,le.R],styles:[""],changeDetection:0}),t})();function Sl(t,e){if(1&t&&(o.TgZ(0,"option",26),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.action),o.xp6(1),o.hij(" ",t.label," ")}}function Dl(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",17),o.TgZ(1,"label",22),o._uU(2,"Learn More Link"),o.qZA(),o.TgZ(3,"select",23),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw(2).state.client["cookie_notice.learn_more"]=e}),o.TgZ(4,"option",24),o._uU(5,"None (Hide learn more link)"),o.qZA(),o.YNc(6,Sl,2,2,"option",25),o.qZA(),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw(2);o.xp6(3),o.Q6J("ngModel",n.state.client["cookie_notice.learn_more"]),o.xp6(3),o.Q6J("ngForOf",t.items)}}function Ql(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",15),o.YNc(1,Dl,7,2,"div",16),o.ALo(2,"async"),o.TgZ(3,"div",17),o.TgZ(4,"div",17),o.TgZ(5,"label",18),o._uU(6,"Cookie Notice Position"),o.qZA(),o.TgZ(7,"select",19),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.client["cookie_notice.position"]=e}),o.TgZ(8,"option",20),o._uU(9,"Top"),o.qZA(),o.TgZ(10,"option",21),o._uU(11,"Bottom"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(1),o.Q6J("ngIf",o.lcZ(2,2,t.customPages$)),o.xp6(6),o.Q6J("ngModel",t.state.client["cookie_notice.position"])}}function Yl(t,e){if(1&t&&o._UZ(0,"input",39),2&t){const t=o.oxw().index;o.MGl("id","policy-action-",t,"")}}function Ll(t,e){if(1&t&&(o.TgZ(0,"option",26),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.action),o.xp6(1),o.hij(" ",t.label," ")}}function Fl(t,e){if(1&t&&(o.TgZ(0,"select",40),o.YNc(1,Ll,2,2,"option",25),o.ALo(2,"async"),o.qZA()),2&t){const t=o.oxw().index,e=o.oxw();o.MGl("id","policy-action-",t,""),o.xp6(1),o.Q6J("ngForOf",o.lcZ(2,2,e.customPages$).items)}}function El(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"li",27),o.TgZ(1,"div",17),o.TgZ(2,"label",28),o.TgZ(3,"span",6),o._uU(4,"Name"),o.qZA(),o.TgZ(5,"button",29),o.NdJ("click",function(){const e=o.CHM(t).index;return o.oxw().removeRegisterPolicy(e)}),o._UZ(6,"mat-icon",30),o.qZA(),o.qZA(),o._UZ(7,"input",31),o.qZA(),o.TgZ(8,"div",17),o.TgZ(9,"label",32),o._uU(10,"Link"),o.qZA(),o.TgZ(11,"div",33),o.TgZ(12,"select",34),o.NdJ("change",function(){const e=o.CHM(t).$implicit;return o.oxw().onPolicyTypeChange(e)}),o.TgZ(13,"option",35),o._uU(14,"Page"),o.qZA(),o.TgZ(15,"option",36),o._uU(16,"Link"),o.qZA(),o.qZA(),o.YNc(17,Yl,1,1,"input",37),o.YNc(18,Fl,3,4,"select",38),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.$implicit,n=e.index;o.Q6J("formGroup",t),o.xp6(2),o.MGl("for","policy-name-",n,""),o.xp6(3),o.Q6J("disableRipple",!0),o.xp6(2),o.MGl("id","policy-name-",n,""),o.xp6(2),o.MGl("for","policy-action-",n,""),o.xp6(3),o.MGl("id","policy-type-",n,""),o.xp6(5),o.Q6J("ngIf","link"===t.value.type),o.xp6(1),o.Q6J("ngIf","page"===t.value.type)}}function Rl(t,e){1&t&&o._UZ(0,"mat-progress-bar",41)}let $l=(()=>{class t extends Ce{constructor(){super(...arguments),this.customPages$=new c.X({name:"",items:[]}),this.registerPolicies=new a.Oe([])}ngOnInit(){this.valueLists.get(["menuItemCategories"]).subscribe(t=>{this.customPages$.next(t.menuItemCategories.find(t=>"Custom Page"===t.name))}),this.settings.getJson("register_policies",[]).forEach(t=>{this.addRegisterPolicy(t)})}saveSettings(){const t=this.state.getModified();t.client.register_policies=JSON.stringify(this.registerPolicies.value),super.saveSettings(t)}addRegisterPolicy(t={}){this.registerPolicies.push(new a.cw({label:new a.NI(t.label||""),action:new a.NI(t.action||this.getFirstCustomPageAction()),type:new a.NI(t.type||"page")}))}removeRegisterPolicy(t){this.registerPolicies.removeAt(t)}onPolicyTypeChange(t){t.get("action").reset(),"page"===t.get("type").value&&t.get("action").setValue(this.getFirstCustomPageAction())}getFirstCustomPageAction(){return this.customPages$.value.items[0]&&this.customPages$.value.items[0].action}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["gdpr-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:27,vars:9,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["ngNativeValidate","",1,"body","many-inputs",3,"ngSubmit"],[1,"setting-toggle-container"],["name","cookie_notice.enable","id","cookie_notice.enable","trans","",3,"ngModel","ngModelChange"],["trans",""],["class","error-group many-inputs",4,"ngIf"],[1,"error-group","no-border-top","no-bottom-border","policies-group"],["type","button","mat-icon-button","","color","accent",1,"add-policy-button",3,"click"],["svgIcon","add"],[1,"unstyled-list"],["class","many-inputs policy-list-item",3,"formGroup",4,"ngFor","ngForOf"],["mat-raised-button","","color","accent","type","submit","trans","",1,"button","primary","update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],[1,"error-group","many-inputs"],["class","input-container",4,"ngIf"],[1,"input-container"],["for","cookie-notice-position","trans",""],["id","cookie-notice-position","name","cookie-notice-position",3,"ngModel","ngModelChange"],["value","top","trans",""],["value","bottom","trans",""],["for","cookie_notice.learn_more"],["id","cookie_notice.learn_more","name","cookie_notice.learn_more",3,"ngModel","ngModelChange"],["value","","trans",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"many-inputs","policy-list-item",3,"formGroup"],[1,"policy-name-label",3,"for"],["mat-icon-button","","color","warn",3,"disableRipple","click"],["svgIcon","remove"],["type","text","formControlName","label","required","",3,"id"],["trans","",3,"for"],[1,"inline-inputs"],["formControlName","type",1,"policy-type-select",3,"id","change"],["value","page","trans",""],["value","link","trans",""],["type","url","class","policy-action-input","formControlName","action","placeholder","Optional...","trans-placeholder","",3,"id",4,"ngIf"],["class","policy-action-input","formControlName","action",3,"id",4,"ngIf"],["type","url","formControlName","action","placeholder","Optional...","trans-placeholder","",1,"policy-action-input",3,"id"],["formControlName","action",1,"policy-action-input",3,"id"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"GDPR"),o.qZA(),o.TgZ(3,"div",2),o._uU(4," Configure settings related to EU General Data Protection Regulation. "),o.qZA(),o.qZA(),o.TgZ(5,"form",3),o.NdJ("ngSubmit",function(){return e.saveSettings()}),o.TgZ(6,"div",4),o.TgZ(7,"mat-slide-toggle",5),o.NdJ("ngModelChange",function(t){return e.state.client["cookie_notice.enable"]=t}),o._uU(8,"Enable Cookie Notice"),o.qZA(),o.TgZ(9,"p",6),o._uU(10," Whether cookie notice should be shown automatically to users from EU until it is accepted. "),o.qZA(),o.qZA(),o.YNc(11,Ql,12,4,"div",7),o.TgZ(12,"div",8),o.TgZ(13,"h2"),o.TgZ(14,"span"),o._uU(15,"Registration Page Policies"),o.qZA(),o.TgZ(16,"button",9),o.NdJ("click",function(){return e.addRegisterPolicy()}),o._UZ(17,"mat-icon",10),o.qZA(),o.qZA(),o.TgZ(18,"p",6),o._uU(19," Here you can create policies that will be shown on registration page and user will be required to accept them by toggling a checkbox. "),o.qZA(),o.TgZ(20,"ul",11),o.YNc(21,El,19,8,"li",12),o.qZA(),o.qZA(),o.TgZ(22,"button",13),o.ALo(23,"async"),o._uU(24," Update "),o.qZA(),o.YNc(25,Rl,1,0,"mat-progress-bar",14),o.ALo(26,"async"),o.qZA()),2&t&&(o.xp6(7),o.Q6J("ngModel",e.state.client["cookie_notice.enable"]),o.xp6(4),o.Q6J("ngIf",e.state.client["cookie_notice.enable"]),o.xp6(10),o.Q6J("ngForOf",e.registerPolicies.controls),o.xp6(1),o.Q6J("disabled",o.lcZ(23,5,e.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(26,7,e.state.loading$)))},directives:[qe.P,a.JL,a.F,T.Rr,a.JJ,a.On,i.O5,p.lW,P.Hw,i.sg,a.EJ,a.YN,a.Kr,a.sg,a.Fj,a.u,a.Q7,k.pW],pipes:[i.Ov],styles:[".error-group[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:0}.add-policy-button[_ngcontent-%COMP%]{flex-shrink:0;margin-left:auto}.inline-inputs[_ngcontent-%COMP%]{display:flex}.input-container[_ngcontent-%COMP%]   .policy-type-select[_ngcontent-%COMP%]{max-width:100px;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.policy-action-input[_ngcontent-%COMP%]{border-bottom-left-radius:0;border-top-left-radius:0}.policy-list-item[_ngcontent-%COMP%]:not(:last-of-type){border-bottom:1px solid var(--be-divider-lighter);margin-bottom:20px}.policies-group[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:var(--be-secondary-text);margin:0 0 20px}.policy-name-label[_ngcontent-%COMP%]{display:flex;align-items:center}.policy-name-label[_ngcontent-%COMP%]   .mat-icon-button[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0;width:20px;height:20px;line-height:20px}"],changeDetection:0}),t})(),Vl=(()=>{class t{constructor(t){this.http=t}index(e){return this.http.get(t.BASE_URI,e)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}}return t.BASE_URI="tags",t.\u0275fac=function(e){return new(e||t)(o.LFG(s.r))},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();function Bl(t,e){1&t&&(o.TgZ(0,"span",10),o._uU(1,"Update Tag"),o.qZA())}function Hl(t,e){1&t&&(o.TgZ(0,"span",10),o._uU(1,"Create a New Tag"),o.qZA())}function zl(t,e){if(1&t&&(o.TgZ(0,"div",19),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Oqu(t.errors.name)}}function Gl(t,e){if(1&t&&(o.TgZ(0,"div",19),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Oqu(t.errors.display_name)}}function jl(t,e){if(1&t&&(o.TgZ(0,"option",20),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("value",t.name),o.xp6(1),o.Oqu(t.name)}}function Xl(t,e){if(1&t&&(o.TgZ(0,"div",19),o._uU(1),o.qZA()),2&t){const t=o.oxw();o.xp6(1),o.Oqu(t.errors.type)}}function Wl(t,e){1&t&&(o.TgZ(0,"span",10),o._uU(1,"Update"),o.qZA())}function Kl(t,e){1&t&&(o.TgZ(0,"span",10),o._uU(1,"Create"),o.qZA())}let tc=(()=>{class t{constructor(t,e,n,i,o){this.dialogRef=t,this.data=e,this.toast=n,this.tags=i,this.settings=o,this.errors={},this.isSystemTag=!1,this.form=new a.cw({name:new a.NI(""),display_name:new a.NI(""),type:new a.NI("")}),this.hydrate()}close(t){this.errors={},this.dialogRef.close(t)}hydrate(){var t,e,n;this.tagTypes=this.settings.get("vebto.admin.tagTypes",[]),this.data.tag?this.form.patchValue(this.data.tag):this.form.get("type").patchValue(this.data.forceType||(null===(t=this.tagTypes[0])||void 0===t?void 0:t.name)||"");const i=this.data.forceType||(null===(e=this.data.tag)||void 0===e?void 0:e.type);this.isSystemTag=null===(n=this.tagTypes.find(t=>t.name===i))||void 0===n?void 0:n.system,(this.isSystemTag||this.data.forceType)&&this.form.get("type").disable(),this.isSystemTag&&this.form.get("name").disable()}confirm(){(this.data.tag?this.tags.update(this.data.tag.id,this.form.getRawValue()):this.tags.create(this.form.getRawValue())).subscribe(t=>{this.toast.open("Tag "+(this.data.tag?"Updated":"Created")),this.close(t.tag)},t=>this.errors=t.errors)}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(m.so),o.Y36(m.WI),o.Y36(ye.F),o.Y36(Vl),o.Y36(oe.Z))},t.\u0275cmp=o.Xpm({type:t,selectors:[["crupdate-tag-modal"]],decls:34,vars:9,consts:[[1,"modal-header"],["mat-dialog-title",""],["trans","",4,"ngIf"],["type","button","mat-icon-button","","tabindex","-1",1,"close-button",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"many-inputs"],[1,"input-container"],["for","crupdate-tag-modal-name","trans",""],["type","text","id","crupdate-tag-modal-name","formControlName","name","required",""],["trans",""],["class","error",4,"ngIf"],["for","display_name","trans",""],["type","text","formControlName","display_name","id","display_name"],["for","crupdate_tag_modal_type","trans",""],["formControlName","type","id","crupdate_tag_modal_type","required","",1,"capitalize"],["trans","",3,"value",4,"ngFor","ngForOf"],["type","button","mat-button","","trans","",1,"cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"submit-button"],[1,"error"],["trans","",3,"value"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h2",1),o.YNc(2,Bl,2,0,"span",2),o.YNc(3,Hl,2,0,"span",2),o.qZA(),o.TgZ(4,"button",3),o.NdJ("click",function(){return e.close()}),o._UZ(5,"mat-icon",4),o.qZA(),o.qZA(),o.TgZ(6,"form",5),o.NdJ("ngSubmit",function(){return e.confirm()}),o.TgZ(7,"mat-dialog-content",6),o.TgZ(8,"div",7),o.TgZ(9,"label",8),o._uU(10,"Name"),o.qZA(),o._UZ(11,"input",9),o.TgZ(12,"p",10),o._uU(13,"Unique tag identifier."),o.qZA(),o.YNc(14,zl,2,1,"div",11),o.qZA(),o.TgZ(15,"div",7),o.TgZ(16,"label",12),o._uU(17,"Display Name"),o.qZA(),o._UZ(18,"input",13),o.TgZ(19,"p",10),o._uU(20,"User friendly tag name."),o.qZA(),o.YNc(21,Gl,2,1,"div",11),o.qZA(),o.TgZ(22,"div",7),o.TgZ(23,"label",14),o._uU(24,"Type"),o.qZA(),o.TgZ(25,"select",15),o.YNc(26,jl,2,2,"option",16),o.qZA(),o.YNc(27,Xl,2,1,"div",11),o.qZA(),o.qZA(),o.TgZ(28,"mat-dialog-actions"),o.TgZ(29,"button",17),o.NdJ("click",function(){return e.close()}),o._uU(30,"Cancel"),o.qZA(),o.TgZ(31,"button",18),o.YNc(32,Wl,2,0,"span",2),o.YNc(33,Kl,2,0,"span",2),o.qZA(),o.qZA(),o.qZA()),2&t&&(o.xp6(2),o.Q6J("ngIf",e.data.tag),o.xp6(1),o.Q6J("ngIf",!e.data.tag),o.xp6(3),o.Q6J("formGroup",e.form),o.xp6(8),o.Q6J("ngIf",e.errors.name),o.xp6(7),o.Q6J("ngIf",e.errors.display_name),o.xp6(5),o.Q6J("ngForOf",e.tagTypes),o.xp6(1),o.Q6J("ngIf",e.errors.type),o.xp6(5),o.Q6J("ngIf",e.data.tag),o.xp6(1),o.Q6J("ngIf",!e.data.tag))},directives:[m.uh,i.O5,p.lW,P.Hw,a.JL,a.sg,m.xY,qe.P,a.Fj,a.JJ,a.u,a.Q7,a.EJ,i.sg,m.H8,a.YN,a.Kr],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.capitalize[_ngcontent-%COMP%]{text-transform:capitalize}"]}),t})();function ec(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",15),o.NdJ("click",function(){return o.CHM(t),o.oxw().showCrupdateTagModal()}),o._UZ(1,"mat-icon",16),o.TgZ(2,"span",1),o._uU(3,"Add New Tag"),o.qZA(),o.qZA()}}function nc(t,e){1&t&&o._UZ(0,"mat-progress-bar",17)}const ic=function(t){return{count:t,resource:"tag(s)"}};function ac(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"tr"),o.TgZ(1,"th",18),o.TgZ(2,"div",19),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",20),o.TgZ(5,"button",21),o.NdJ("click",function(){return o.CHM(t),o.oxw().maybeDeleteSelectedTags()}),o._uU(6," Delete "),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=e.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,ic,t)),o.xp6(3),o.Q6J("disabled",!n.currentUser.hasPermission("tags.delete"))}}function oc(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",29),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().showCrupdateTagModal(e)}),o.ALo(1,"trans"),o._UZ(2,"mat-icon",30),o.qZA()}2&t&&o.Q6J("matTooltip",o.lcZ(1,1,"Edit tag"))}function sc(t,e){if(1&t&&(o.TgZ(0,"tr"),o._UZ(1,"td",22),o.TgZ(2,"td",23),o._uU(3),o.qZA(),o.TgZ(4,"td",24),o._uU(5),o.qZA(),o.TgZ(6,"td",25),o._uU(7),o.qZA(),o.TgZ(8,"td",26),o._uU(9),o.ALo(10,"formattedDate"),o.qZA(),o.TgZ(11,"td",27),o.YNc(12,oc,3,3,"button",28),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(1),o.Q6J("table-body-checkbox",t.id),o.xp6(2),o.Oqu(t.name),o.xp6(2),o.Oqu(t.type),o.xp6(2),o.Oqu(t.display_name),o.xp6(2),o.hij(" ",t.updated_at?o.lcZ(10,6,t.updated_at):"-"," "),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("tags.update"))}}function rc(t,e){1&t&&(o.TgZ(0,"no-results-message",31),o.TgZ(1,"span",32),o._uU(2,"No tags have been created yet"),o.qZA(),o.qZA())}let lc=(()=>{class t{constructor(t,e,n,i){var a;this.tags=t,this.currentUser=e,this.datatable=n,this.settings=i,this.filters=(a=this.settings.get("vebto.admin.tagTypes"),[new ho.XQ({type:ho.Bq.Select,key:"type",description:"Type of the link",defaultValue:a[0].name,options:a.map(t=>({key:t.name,value:t.name}))}),new mo.T7({description:"Date tag was created"}),new mo.yH({description:"Date tag was last updated"})]),this.tags$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:Vl.BASE_URI})}maybeDeleteSelectedTags(){this.datatable.confirmResourceDeletion("tags").subscribe(()=>{this.tags.delete(this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset()})})}showCrupdateTagModal(t){this.datatable.openCrupdateResourceModal(tc,{tag:t}).subscribe()}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(Vl),o.Y36(ba.I),o.Y36(go.x),o.Y36(oe.Z))},t.\u0275cmp=o.Xpm({type:t,selectors:[["tags"]],features:[o._Bn([go.x])],decls:31,vars:12,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","tags",3,"filters"],[1,"action-buttons"],["mat-raised-button","","color","accent","class","button-with-icon",3,"click",4,"ngIf"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","folder.svg",4,"ngIf"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","6"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["type","button","mat-raised-button","","color","warn","trans","",3,"disabled","click"],[3,"table-body-checkbox"],["data-label","Name"],["data-label","Type"],["data-label","Display Name"],["data-label","Last Updated"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["svgImage","folder.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o.TgZ(2,"span",1),o._uU(3,"Tags"),o.qZA(),o.qZA(),o.TgZ(4,"div",2),o._UZ(5,"datatable-filters",3),o.TgZ(6,"div",4),o.YNc(7,ec,4,0,"button",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",6),o.YNc(9,nc,1,0,"mat-progress-bar",7),o.ALo(10,"async"),o.TgZ(11,"table",8),o.TgZ(12,"thead"),o.TgZ(13,"tr"),o._UZ(14,"th",9),o.TgZ(15,"th",10),o._uU(16,"Name"),o.qZA(),o.TgZ(17,"th",10),o._uU(18,"Type"),o.qZA(),o.TgZ(19,"th",10),o._uU(20,"Display Name"),o.qZA(),o.TgZ(21,"th",11),o._uU(22,"Last Updated"),o.qZA(),o._UZ(23,"th"),o.qZA(),o.YNc(24,ac,7,4,"tr",12),o.qZA(),o.TgZ(25,"tbody"),o.YNc(26,sc,13,8,"tr",13),o.ALo(27,"async"),o.qZA(),o.qZA(),o.YNc(28,rc,3,0,"no-results-message",14),o.ALo(29,"async"),o._UZ(30,"datatable-footer"),o.qZA()),2&t&&(o.xp6(5),o.Q6J("filters",e.filters),o.xp6(2),o.Q6J("ngIf",e.currentUser.hasPermission("tags.create")),o.xp6(2),o.Q6J("ngIf",o.lcZ(10,6,e.datatable.paginator&&e.datatable.paginator.loading$)),o.xp6(15),o.Q6J("ngIf",e.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(27,8,e.tags$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(29,10,e.datatable.paginator.noResults$)))},directives:[qe.P,vo.h,i.O5,_o.e,Zo.p,i.sg,xo.V,p.lW,P.Hw,k.pW,yo.O,q.gM,wo.U],pipes:[i.Ov,Pn.l,le.R],encapsulation:2}),t})();var cc=n(98034),dc=n(99208);function uc(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"div",5),o.TgZ(1,"label",27),o._uU(2,"Mysql Mode"),o.qZA(),o.TgZ(3,"select",28),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.server.scout_mysql_mode=e})("ngModelChange",function(){return o.CHM(t),o.oxw().clearErrors()}),o.TgZ(4,"option",29),o._uU(5,"Basic"),o.qZA(),o.TgZ(6,"option",30),o._uU(7,"Extended"),o.qZA(),o.TgZ(8,"option",31),o._uU(9,"Fulltext"),o.qZA(),o.qZA(),o.qZA()}if(2&t){const t=o.oxw();o.xp6(3),o.Q6J("ngModel",t.state.server.scout_mysql_mode)}}function pc(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",5),o.TgZ(2,"label",32),o._uU(3,"Algolia App ID"),o.qZA(),o.TgZ(4,"input",33),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.server.algolia_app_id=e}),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.TgZ(6,"label",34),o._uU(7,"Algolia Secret"),o.qZA(),o.TgZ(8,"input",35),o.NdJ("ngModelChange",function(e){return o.CHM(t),o.oxw().state.server.algolia_secret=e}),o.qZA(),o.qZA(),o.BQk()}if(2&t){const t=o.oxw();o.xp6(4),o.Q6J("ngModel",t.state.server.algolia_app_id),o.xp6(4),o.Q6J("ngModel",t.state.server.algolia_secret)}}function gc(t,e){1&t&&o._UZ(0,"p",36),2&t&&o.Q6J("innerHTML",e.ngIf,o.oJD)}function hc(t,e){1&t&&(o.TgZ(0,"div",37),o.TgZ(1,"div",1),o._uU(2,"Important!"),o.qZA(),o.TgZ(3,"p",13),o.TgZ(4,"a",38),o._uU(5,'"Meilisearch"'),o.qZA(),o._uU(6," needs to be installed and running for this method to work. "),o.qZA(),o.qZA())}function mc(t,e){1&t&&(o.TgZ(0,"div",37),o.TgZ(1,"div",1),o._uU(2,"Important!"),o.qZA(),o.TgZ(3,"p",13),o.TgZ(4,"a",39),o._uU(5,'"Elasticsearch"'),o.qZA(),o._uU(6," needs to be installed and running for this method to work. "),o.qZA(),o.qZA())}function fc(t,e){if(1&t&&(o.TgZ(0,"option",22),o._uU(1),o.qZA()),2&t){const t=e.$implicit;o.Q6J("ngValue",t.model),o.xp6(1),o.hij(" ",t.name," ")}}function bc(t,e){1&t&&o._UZ(0,"mat-progress-bar",40)}let vc=(()=>{class t extends Ce{constructor(){super(...arguments),this.models$=new c.X([]),this.searchableModelControl=new a.NI(null)}importRecords(){this.state.loading$.next(!0),this.http.post("admin/search/import",{model:this.searchableModelControl.value,driver:this.state.server.scout_driver}).pipe((0,Ze.x)(()=>this.state.loading$.next(!1))).subscribe(()=>{this.toast.open("Records imported")},t=>{this.state.errors$.next({search_group:"Could not import records: "+t.message}),xe(this.state.errors$.value)})}ngOnInit(){this.http.get("admin/search/models").subscribe(t=>{this.models$.next(t.models)})}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=o.n5z(t)))(n||t)}}(),t.\u0275cmp=o.Xpm({type:t,selectors:[["search-settings"]],hostAttrs:[1,"settings-panel"],features:[o.qOj],decls:53,vars:22,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["id","search_group",1,"error-group","many-inputs","no-border-top"],[1,"input-container"],["for","scout.driver","trans",""],["name","scout.driver","id","scout.driver",3,"ngModel","ngModelChange"],["value","mysql"],["value","meilisearch"],["value","tntsearch"],["value","Matchish\\ScoutElasticSearch\\Engines\\ElasticSearchEngine"],["value","algolia"],["trans",""],["class","input-container",4,"ngIf"],[4,"ngIf"],["class","error",3,"innerHTML",4,"ngIf"],["class","widget widget-info widget-important",4,"ngIf"],[1,"widget","widget-flat"],[1,"import-flex"],["for","searchable-model","trans","",1,"hidden"],["id","searchable-model",3,"formControl"],["trans","",3,"ngValue"],["trans","",3,"ngValue",4,"ngFor","ngForOf"],["type","button","mat-stroked-button","","color","accent","trans","",3,"disabled","click"],["mat-raised-button","","color","accent","type","submit","trans","",1,"update-button",3,"disabled"],["mode","indeterminate","color","accent",4,"ngIf"],["for","mysql-mode","trans",""],["name","mysql-mode","id","mysql-mode",3,"ngModel","ngModelChange"],["value","basic"],["value","extended"],["value","fulltext"],["for","scout.algolia_app_id","trans",""],["name","scout.algolia_app_id","id","scout.algolia_app_id","required","",3,"ngModel","ngModelChange"],["for","scout.algolia_secret","trans",""],["name","scout.algolia_secret","id","scout.algolia_secret","required","",3,"ngModel","ngModelChange"],[1,"error",3,"innerHTML"],[1,"widget","widget-info","widget-important"],["href","https://www.meilisearch.com","target","_blank"],["href","https://www.elastic.co/elasticsearch","target","_blank"],["mode","indeterminate","color","accent"]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._uU(2,"Search"),o.qZA(),o.TgZ(3,"div",2),o._uU(4," Configure search method used on the site as well as related 3rd party integrations. "),o.qZA(),o.qZA(),o.TgZ(5,"form",3),o.NdJ("submit",function(){return e.saveSettings()}),o.TgZ(6,"div",4),o.TgZ(7,"div",5),o.TgZ(8,"label",6),o._uU(9,"Search Method"),o.qZA(),o.TgZ(10,"select",7),o.NdJ("ngModelChange",function(t){return e.state.server.scout_driver=t})("ngModelChange",function(){return e.clearErrors()}),o.TgZ(11,"option",8),o._uU(12,"Mysql"),o.qZA(),o.TgZ(13,"option",9),o._uU(14,"Meilisearch"),o.qZA(),o.TgZ(15,"option",10),o._uU(16,"TNTSearch"),o.qZA(),o.TgZ(17,"option",11),o._uU(18," Elasticsearch "),o.qZA(),o.TgZ(19,"option",12),o._uU(20,"Algolia"),o.qZA(),o.qZA(),o.TgZ(21,"p",13),o._uU(22,"Which method should be used for search related functionality across the site."),o.qZA(),o.qZA(),o.YNc(23,uc,10,1,"div",14),o.YNc(24,pc,9,2,"ng-container",15),o.YNc(25,gc,1,1,"p",16),o.ALo(26,"async"),o.qZA(),o.YNc(27,hc,7,0,"div",17),o.YNc(28,mc,7,0,"div",17),o.TgZ(29,"div",18),o.TgZ(30,"div",1),o._uU(31,"Import Records"),o.qZA(),o.TgZ(32,"p",13),o._uU(33," Whenever a new search method is enabled, records that already exist in database need to be imported into the index. All records created after search method is enabled will be imported automatically. "),o.qZA(),o.TgZ(34,"p"),o._uU(35," Depending on number of records in database, importing could take some time. Don't close this window while it is in progress. "),o.qZA(),o.TgZ(36,"div",19),o.TgZ(37,"div",5),o.TgZ(38,"label",20),o._uU(39,"Record Type"),o.qZA(),o.TgZ(40,"select",21),o.TgZ(41,"option",22),o._uU(42,"All"),o.qZA(),o.YNc(43,fc,2,2,"option",23),o.ALo(44,"async"),o.qZA(),o.qZA(),o.TgZ(45,"button",24),o.NdJ("click",function(){return e.importRecords()}),o.ALo(46,"async"),o._uU(47," Import Now "),o.qZA(),o.qZA(),o.qZA(),o.TgZ(48,"button",25),o.ALo(49,"async"),o._uU(50," Update "),o.qZA(),o.YNc(51,bc,1,0,"mat-progress-bar",26),o.ALo(52,"async"),o.qZA()),2&t&&(o.xp6(10),o.Q6J("ngModel",e.state.server.scout_driver),o.xp6(13),o.Q6J("ngIf","mysql"===e.state.server.scout_driver),o.xp6(1),o.Q6J("ngIf","algolia"===e.state.server.scout_driver),o.xp6(1),o.Q6J("ngIf",o.lcZ(26,12,e.state.errors$).search_group),o.xp6(2),o.Q6J("ngIf","meilisearch"===e.state.server.scout_driver),o.xp6(1),o.Q6J("ngIf","elastic"===e.state.server.scout_driver),o.xp6(12),o.Q6J("formControl",e.searchableModelControl),o.xp6(1),o.Q6J("ngValue",null),o.xp6(2),o.Q6J("ngForOf",o.lcZ(44,14,e.models$)),o.xp6(2),o.Q6J("disabled",o.lcZ(46,16,e.state.loading$)),o.xp6(3),o.Q6J("disabled",o.lcZ(49,18,e.state.loading$)),o.xp6(3),o.Q6J("ngIf",o.lcZ(52,20,e.state.loading$)))},directives:[qe.P,a.JL,a.F,a.EJ,a.JJ,a.On,a.YN,a.Kr,i.O5,a.oH,i.sg,p.lW,a.Fj,a.Q7,k.pW],pipes:[i.Ov],styles:[".import-flex[_ngcontent-%COMP%]{display:flex;align-items:center;margin-top:15px}.import-flex[_ngcontent-%COMP%]   .input-container[_ngcontent-%COMP%]{max-width:100px}.import-flex[_ngcontent-%COMP%]   .mat-stroked-button[_ngcontent-%COMP%]{line-height:46px;margin-top:0;margin-left:10px}"]}),t})(),_c=(()=>{class t{constructor(t){this.http=t}all(e){return this.http.get(t.BASE_URI,e)}forCommentable(t){return this.http.get("commentable/comments",t)}get(e){return this.http.get(`${t.BASE_URI}/${e}`)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}restore(e){return this.http.post(`${t.BASE_URI}/restore`,{commentIds:e})}}return t.BASE_URI="comment",t.\u0275fac=function(e){return new(e||t)(o.LFG(s.r))},t.\u0275prov=o.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const Zc=[new ho.XQ({type:ho.Bq.Select,key:"deleted",label:"Type",defaultValue:!1,description:"Whether comment is active or deleted.",options:[{key:"Active",value:!1},{key:"Deleted",value:!0}]}),new ho.XQ({type:ho.Bq.SelectModel,key:"user_id",label:"User",description:"User comment was created by",component:Xo.y}),new mo.T7({description:"Date comment was created"}),new mo.yH({description:"Date comment was last updated"})];var xc=n(60994);function yc(t,e){1&t&&o._UZ(0,"mat-progress-bar",13)}function Ac(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",18),o.NdJ("click",function(){return o.CHM(t),o.oxw(2).maybeDeleteComments()}),o._uU(1," Delete "),o.qZA()}}const wc=function(t){return{count:t,resource:"comment(s)"}};function kc(t,e){if(1&t&&(o.TgZ(0,"tr"),o.TgZ(1,"th",14),o.TgZ(2,"div",15),o._uU(3," :count :resource selected: "),o.qZA(),o.TgZ(4,"div",16),o.YNc(5,Ac,2,0,"button",17),o.qZA(),o.qZA(),o.qZA()),2&t){const t=e.ngIf,n=o.oxw();o.xp6(2),o.Q6J("transValues",o.VKq(2,wc,t)),o.xp6(3),o.Q6J("ngIf",n.currentUser.hasPermission("comments.delete"))}}function Tc(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",30),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().maybeDeleteComments(e)}),o._uU(1," Delete "),o.qZA()}}function Cc(t,e){if(1&t){const t=o.EpF();o.TgZ(0,"button",31),o.NdJ("click",function(){o.CHM(t);const e=o.oxw().$implicit;return o.oxw().restoreComment(e)}),o._uU(1," Restore "),o.qZA()}}function qc(t,e){if(1&t&&(o.TgZ(0,"tr"),o._UZ(1,"td",19),o.TgZ(2,"td",20),o._uU(3),o.qZA(),o.TgZ(4,"td"),o.TgZ(5,"div",21),o._UZ(6,"img",22),o.TgZ(7,"a",23),o.TgZ(8,"div"),o._uU(9),o.qZA(),o.TgZ(10,"div",24),o._uU(11),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(12,"td"),o._UZ(13,"user-column",25),o.qZA(),o.TgZ(14,"td",26),o._uU(15),o.ALo(16,"formattedDate"),o.qZA(),o.TgZ(17,"td",27),o.YNc(18,Tc,2,0,"button",28),o.YNc(19,Cc,2,0,"button",29),o.qZA(),o.qZA()),2&t){const t=e.$implicit,n=o.oxw();o.xp6(1),o.Q6J("table-body-checkbox",t.id),o.xp6(2),o.Oqu(t.content),o.xp6(3),o.Q6J("src",t.commentable.image,o.LSH),o.xp6(1),o.Q6J("routerLink",n.url.generate(t.commentable)),o.xp6(2),o.Oqu(t.commentable.name),o.xp6(2),o.Oqu(t.commentable.model_type),o.xp6(2),o.Q6J("user",t.user),o.xp6(2),o.Oqu(o.lcZ(16,10,t.created_at)),o.xp6(3),o.Q6J("ngIf",!t.deleted),o.xp6(1),o.Q6J("ngIf",t.deleted)}}function Uc(t,e){1&t&&(o.TgZ(0,"no-results-message",32),o.TgZ(1,"span",33),o._uU(2,"No comments have been created yet"),o.qZA(),o.qZA())}const Ic=[{path:"",component:ce,canActivate:[de.a,ue.d],canActivateChild:[de.a,ue.d],data:{permissions:["admin.access"],adminRoot:!0},children:[{path:"",redirectTo:"analytics",pathMatch:"full"},{path:"analytics",loadChildren:()=>n.e(817).then(n.bind(n,11817)).then(t=>t.AnalyticsModule),canActivate:[de.a],canActivateChild:[de.a],data:{permissions:["reports.view"]}},{path:"users",component:No,data:{permissions:["users.view"]}},{path:"roles",component:Ns,data:{permissions:["roles.view"]}},{path:"translations",component:pr,data:{permissions:["localizations.view"]}},{path:"tags",component:lc,data:{permissions:["tags.view"]}},{path:"files",component:yr,data:{permissions:["files.view"]}},{path:"comments",component:(()=>{class t{constructor(t,e,n,i,a,o){this.comments=t,this.currentUser=e,this.settings=n,this.toast=i,this.datatable=a,this.url=o,this.comments$=this.datatable.data$,this.filters=Zc}ngOnInit(){this.datatable.init({uri:_c.BASE_URI,staticParams:{with:["commentable"]}})}ngOnDestroy(){this.datatable.destroy()}makeRolesList(t){return t.slice(0,3).map(t=>t.name).join(", ")}maybeDeleteComments(t){this.datatable.confirmResourceDeletion("comments").subscribe(()=>{this.comments.delete(t?[t.id]:this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Comments deleted")},t=>{this.toast.open(t.message||ma.v.Default)})})}restoreComment(t){this.comments.restore([t.id]).subscribe(()=>{this.datatable.reset(),this.toast.open("Comment restored")})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(_c),o.Y36(ba.I),o.Y36(oe.Z),o.Y36(ye.F),o.Y36(go.x),o.Y36(xc.o))},t.\u0275cmp=o.Xpm({type:t,selectors:[["user-index"]],features:[o._Bn([go.x])],decls:28,vars:11,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","comments",3,"filters"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","user_id","trans",""],["table-sort-header","","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","public-discussion.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","6"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["mat-raised-button","","color","warn","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Content"],[1,"column-with-image"],["alt","",3,"src"],["target","_blank",1,"link",3,"routerLink"],[1,"secondary","capitalize"],[3,"user"],["data-label","Created At"],[1,"edit-column"],["mat-button","","color","warn","trans","",3,"click",4,"ngIf"],["mat-button","","color","accent","trans","",3,"click",4,"ngIf"],["mat-button","","color","warn","trans","",3,"click"],["mat-button","","color","accent","trans","",3,"click"],["svgImage","public-discussion.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(o.TgZ(0,"div",0),o.TgZ(1,"h1",1),o._uU(2,"Comments"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"datatable-filters",3),o.qZA(),o.qZA(),o.TgZ(5,"div",4),o.YNc(6,yc,1,0,"mat-progress-bar",5),o.ALo(7,"async"),o.TgZ(8,"table",6),o.TgZ(9,"thead"),o.TgZ(10,"tr"),o._UZ(11,"th",7),o.TgZ(12,"th",1),o._uU(13,"Content"),o.qZA(),o.TgZ(14,"th",1),o._uU(15,"Commentable"),o.qZA(),o.TgZ(16,"th",8),o._uU(17,"User"),o.qZA(),o.TgZ(18,"th",9),o._uU(19,"Created At"),o.qZA(),o._UZ(20,"th"),o.qZA(),o.YNc(21,kc,6,4,"tr",10),o.qZA(),o.TgZ(22,"tbody"),o.YNc(23,qc,20,12,"tr",11),o.ALo(24,"async"),o.qZA(),o.qZA(),o.YNc(25,Uc,3,0,"no-results-message",12),o.ALo(26,"async"),o._UZ(27,"datatable-footer"),o.qZA()),2&t&&(o.xp6(4),o.Q6J("filters",e.filters),o.xp6(2),o.Q6J("ngIf",o.lcZ(7,5,e.datatable.paginator&&e.datatable.paginator.loading$)),o.xp6(15),o.Q6J("ngIf",e.datatable.selectedRows$.value.length),o.xp6(2),o.Q6J("ngForOf",o.lcZ(24,7,e.comments$)),o.xp6(2),o.Q6J("ngIf",o.lcZ(26,9,e.datatable.paginator.noResults$)))},directives:[qe.P,vo.h,i.O5,_o.e,Zo.p,i.sg,xo.V,k.pW,p.lW,yo.O,r.yS,Ao.r,wo.U],pipes:[i.Ov,Pn.l],styles:[".mat-column-email[_ngcontent-%COMP%]{margin-right:15px}"],changeDetection:0}),t})(),data:{permissions:["comments.view"]}},{path:"ads",component:Cr,data:{permissions:["ads.update"]}},{path:"custom-pages",component:cc.c,data:{permissions:["custom_pages.view"],name:"Custom Pages"}},{path:"custom-pages/new",component:dc.e,data:{permissions:["custom_pages.create"],name:"Add New Page"}},{path:"custom-pages/:id/edit",component:dc.e,data:{permissions:["custom_pages.update"],name:"Edit Page"}},{path:"plans",component:cl,canActivate:[dl.Y],data:{permissions:["plans.view"]}},{path:"subscriptions",component:Nl,canActivate:[dl.Y],data:{permissions:["subscriptions.view"]}},...Le,{path:"settings",component:Ke,resolve:{settings:l},data:{permissions:["settings.view"]},children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",component:un,pathMatch:"full"},{path:"authentication",component:An},{path:"cache",component:qn},{path:"analytics",component:Jn},{path:"localization",component:Ln},{path:"mail",component:oi},{path:"logging",component:ci},{path:"queue",component:hi},{path:"billing",component:Ti},{path:"uploading",component:aa},{path:"recaptcha",component:ga},{path:"gdpr",component:$l},{path:"search",component:vc},...Fe]}]},{path:"appearance",loadChildren:()=>n.e(540).then(n.bind(n,35540)).then(t=>t.AppAppearanceModule),canActivate:[de.a],canActivateChild:[de.a],data:{permissions:["appearance.update"]}}];let Mc=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[r.Bz.forChild(Ic)],r.Bz]}),t})();var Oc=n(99808);let Jc=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[i.ez,a.UX,U.N,Oc.p,P.Ps,m.Is]]}),t})();var Pc=n(20673),Nc=n(29779),Sc=n(58666),Dc=n(90723);let Qc=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[i.ez,m.Is,p.ot,P.Ps],P.Ps]}),t})();var Yc=n(29828);let Lc=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[i.ez,U.N,p.ot,P.Ps,h.Hi]]}),t})();var Fc=n(47878),Ec=n(68692),Rc=n(4182),$c=n(15595),Vc=n(51685);let Bc=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({imports:[[i.ez,U.N,a.u5,a.UX],i.ez]}),t})();var Hc=n(85786),zc=n(63380);let Gc=(()=>{class t{constructor(t){this.settings=t,this.settings.merge({vebto:te})}}return t.\u0275fac=function(e){return new(e||t)(o.LFG(oe.Z))},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({providers:[Ae.u],imports:[[r.Bz,i.ez,a.u5,a.UX,Y.y,Q,Pc.l,Nc.N,ee.J,I,Vc.x,N.X,U.N,Sc.u,Oc.p,Dc.a,Qc,Yc.I,Lc,Mc,Fc.k,Bc,Hc.c,zc.M,p.ot,P.Ps,q.AV,m.Is,w.Tx,T.rP,h.Hi,u.Bb,ie._t,k.Cv,Kt.To,Z.us,Wt,Z.XK,Ec.X,Rc.S,ne,Z.si,Jc,$c.m],r.Bz,i.ez,a.u5,a.UX,Y.y,Q,U.N,N.X,Qc,Vc.x,p.ot,P.Ps,C.ZX,g.p9,q.AV,m.Is,w.Tx,T.rP,h.Hi]}),t})();var jc=n(66445);let Xc=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=o.oAB({type:t}),t.\u0275inj=o.cJS({providers:[{provide:S,multi:!0,useValue:[{name:"Link Creation",key:"recaptcha.enable_for_link_creation",description:"Enable recaptcha integration when creating links from homepage or user dashboard."}]}],imports:[[i.ez,a.UX,Gc,Qc,jc.DashboardModule,M.G,k.Cv,O.Nh]]}),t})()},38193:function(t,e,n){"use strict";n.d(e,{w:function(){return Un}});var i=n(56238),a=n(78512),o=n(11520),s=n(66599),r=n(87829),l=n(4694),c=n(35366),d=n(76512),u=n(73234),p=n(31041),g=n(68515);let h=(()=>{class t{constructor(t){this.http=t}create(t,e,n,i){return this.http.post(`biolink/${t}/widget`,{type:e,position:n,config:i})}update(t,e,n){return this.http.put(`biolink/${t}/widget/${e}`,{config:n})}delete(t,e){return this.http.delete(`biolink/${t}/widget/${e}`)}}return t.BASE_URI="biolink-widgets",t.\u0275fac=function(e){return new(e||t)(c.LFG(g.r))},t.\u0275prov=c.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var m=n(24859);const f={links:0,appearance:1,settings:2};let b=(()=>{class t{constructor(t,e,n,i,o){this.biolinks=t,this.toast=e,this.fb=n,this.widgets=i,this.modal=o,this.biolink$=new a.X(null),this.loading$=new a.X(!1),this.activeTab$=new a.X(f.links),this.appearanceForm=this.fb.group({fontConfig:{},btnConfig:this.fb.group({color:this.fb.control(""),variant:this.fb.control(""),type:this.fb.control("")}),bgConfig:{}})}saveAppearance(){return this.loading$.next(!0),this.biolinks.saveAppearance(this.biolink$.value.id,this.appearanceForm.value).pipe((0,o.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Appearance saved")})}reloadBiolink(t){t=t||this.biolink$.value.id,this.loading$.next(!0),this.biolinks.get(t,{with:["appearance","rules","pixels","domain"]}).pipe((0,o.x)(()=>this.loading$.next(!1))).subscribe(t=>{var e;this.biolink$.next(t.biolink),this.appearanceForm.patchValue(null===(e=t.biolink.appearance)||void 0===e?void 0:e.config)})}crupdateWidget(t,e,n){return this.loading$.next(!0),(t?this.widgets.update(this.biolink$.value.id,t,n):this.widgets.create(this.biolink$.value.id,e,this.biolink$.value.content.length+1,n)).pipe((0,o.x)(()=>this.loading$.next(!1)),(0,s.b)(()=>this.reloadBiolink()))}openCrupdateLinkDialog(t,e={}){this.modal.open(r.P,Object.assign(Object.assign({},{groups:{[this.biolink$.value.id]:t?{}:{position:this.biolink$.value.content.length+1}},link:t,featuresToHide:{alias:!0,domain:!0,linkGroups:!0,tags:!0}}),e)).afterClosed().subscribe(t=>{t&&this.reloadBiolink()})}maybeDeleteContentItem(t){this.modal.open(l.z,{title:"Delete Widget",body:`Are you sure you want to delete this ${t.model_type}?`,ok:"Delete"}).afterClosed().subscribe(e=>{e&&(this.loading$.next(!0),this.biolinks.detach(this.biolink$.value.id,t).pipe((0,o.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.reloadBiolink(this.biolink$.value.id)}))})}updateContentItemConfig(t,e){this.loading$.next(!0),this.biolinks.updateContentItemConfig(this.biolink$.value.id,t,e).pipe((0,o.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.reloadBiolink()})}}return t.\u0275fac=function(e){return new(e||t)(c.LFG(d.n),c.LFG(u.F),c.LFG(p.qu),c.LFG(h),c.LFG(m.u))},t.\u0275prov=c.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var v=n(63337),_=n(88195),Z=n(57173),x=n(61116),y=n(24637),A=n(92935),w=n(77307),k=n(6006),T=n(38116),C=n(84369);function q(t,e){1&t&&(c.TgZ(0,"span",19),c._uU(1,"Update image widget"),c.qZA())}function U(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add image widget"),c.qZA())}function I(t,e){1&t&&(c.TgZ(0,"span",19),c._uU(1,"Update"),c.qZA())}function M(t,e){1&t&&(c.TgZ(0,"span",19),c._uU(1,"Add"),c.qZA())}let O=(()=>{class t{constructor(t,e,n){this.dialogRef=t,this.data=e,this.editor=n,this.form=new p.cw({url:new p.NI,destinationUrl:new p.NI,type:new p.NI("default")}),e.config&&this.form.patchValue(e.config)}createOrUpdate(){this.editor.crupdateWidget(this.data.widgetId,"image",this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(A.so),c.Y36(A.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["image-widget-modal"]],decls:28,vars:8,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content","",1,"many-inputs"],["formControlName","url"],[1,"input-container"],["for","image-widget-type","trans","",1,"capitalize"],["id","image-widget-type","formControlName","type"],["value","default","trans",""],["value","avatar","trans",""],["for","image-widget-link","cdkFocusInitial","","trans","",1,"capitalize"],["type","url","id","image-widget-link","placeholder","Optional...","trans-placeholder","","formControlName","destinationUrl"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,q,2,0,"span",2),c.YNc(3,U,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c._UZ(8,"upload-image-control",8),c.TgZ(9,"div",9),c.TgZ(10,"label",10),c._uU(11,"Type"),c.qZA(),c.TgZ(12,"select",11),c.TgZ(13,"option",12),c._uU(14,"Default"),c.qZA(),c.TgZ(15,"option",13),c._uU(16,"Avatar"),c.qZA(),c.qZA(),c.qZA(),c.TgZ(17,"div",9),c.TgZ(18,"label",14),c._uU(19,"Destination Url"),c.qZA(),c._UZ(20,"input",15),c.qZA(),c.qZA(),c.TgZ(21,"div",16),c.TgZ(22,"button",17),c.NdJ("click",function(){return e.close()}),c._uU(23," Cancel "),c.qZA(),c.TgZ(24,"button",18),c.ALo(25,"async"),c.YNc(26,I,2,0,"span",2),c.YNc(27,M,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(18),c.Q6J("disabled",c.lcZ(25,6,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[A.uh,x.O5,w.Hw,p.JL,p.sg,A.xY,k.V,p.JJ,p.u,T.P,p.EJ,p.YN,p.Kr,p.Fj,A.H8,C.lW],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();var J=n(10487);function P(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update youtube widget"),c.qZA())}function N(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add youtube widget"),c.qZA())}function S(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function D(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function Q(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let Y=(()=>{class t{constructor(t,e,n){var i,o;this.dialogRef=t,this.data=e,this.editor=n,this.errors$=new a.X({}),this.form=new p.cw({url:new p.NI("")}),(null===(i=e.config)||void 0===i?void 0:i.url)&&this.form.patchValue({url:null===(o=e.config)||void 0===o?void 0:o.url})}createOrUpdate(){if(!(0,J.Z)(this.form.value.url).id)return this.errors$.next({url:"This is not a valid youtube url."});this.editor.crupdateWidget(this.data.widgetId,t.type,this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.type="youtubeEmbed",t.\u0275fac=function(e){return new(e||t)(c.Y36(A.so),c.Y36(A.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["youtube-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","youtube-widget-url","trans",""],["type","url","id","youtube-widget-url","formControlName","url","placeholder","https://www.youtube.com/watch?v=YE7VzlLtp-4","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,P,2,0,"span",2),c.YNc(3,N,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Youtube Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,S,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,D,2,0,"span",2),c.YNc(20,Q,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[A.uh,x.O5,w.Hw,p.JL,p.sg,A.xY,T.P,p.Fj,p.JJ,p.u,p.Q7,A.H8,C.lW],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();function L(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update soundcloud widget"),c.qZA())}function F(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add soundcloud widget"),c.qZA())}function E(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function R(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function $(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let V=(()=>{class t{constructor(t,e,n,i){this.dialogRef=t,this.data=e,this.http=n,this.editor=i,this.errors$=new a.X({}),this.form=new p.cw({url:new p.NI("")}),e.config&&this.form.patchValue(e.config)}createOrUpdate(){this.editor.loading$.next(!0);const e=encodeURIComponent(this.form.value.url);this.http.get("https://soundcloud.com/oembed?format=json&url="+e).subscribe(e=>{let n=e.html;if(!n)return this.editor.loading$.next(!1),this.errors$.next({url:"This is not a valid soundcloud url."});n=n.replace('height="400"','height="180"'),this.editor.crupdateWidget(this.data.widgetId,t.type,{embedCode:n,url:this.form.value.url}).subscribe(t=>{this.dialogRef.close(t.widget)})},()=>{this.editor.loading$.next(!1),this.errors$.next({url:"Could not get soundcloud embed code, try again later."})})}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(A.so),c.Y36(A.WI),c.Y36(g.r),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["soundcloud-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","soundcloud-widget-url","trans",""],["type","url","id","soundcloud-widget-url","formControlName","url","placeholder","https://soundcloud.com/arianagrande/ariana-grande-test-drive","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,L,2,0,"span",2),c.YNc(3,F,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Soundcloud Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,E,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,R,2,0,"span",2),c.YNc(20,$,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[A.uh,x.O5,w.Hw,p.JL,p.sg,A.xY,T.P,p.Fj,p.JJ,p.u,p.Q7,A.H8,C.lW],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();function B(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update vimeo widget"),c.qZA())}function H(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add vimeo widget"),c.qZA())}function z(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function G(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function j(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let X=(()=>{class t{constructor(t,e,n){var i,o;this.dialogRef=t,this.data=e,this.editor=n,this.errors$=new a.X({}),this.form=new p.cw({url:new p.NI("")}),(null===(i=e.config)||void 0===i?void 0:i.url)&&this.form.patchValue({url:null===(o=e.config)||void 0===o?void 0:o.url})}createOrUpdate(){if(!(0,J.Z)(this.form.value.url).id)return this.errors$.next({url:"This is not a valid vimeo url."});this.editor.crupdateWidget(this.data.widgetId,t.widgetType,this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.widgetType="vimeoEmbed",t.\u0275fac=function(e){return new(e||t)(c.Y36(A.so),c.Y36(A.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["vimeo-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","youtube-widget-url","trans",""],["type","url","id","youtube-widget-url","formControlName","url","placeholder","https://vimeo.com/1084537","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,B,2,0,"span",2),c.YNc(3,H,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Vimeo Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,z,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,G,2,0,"span",2),c.YNc(20,j,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[A.uh,x.O5,w.Hw,p.JL,p.sg,A.xY,T.P,p.Fj,p.JJ,p.u,p.Q7,A.H8,C.lW],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();var W=n(70110);function K(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update spotify widget"),c.qZA())}function tt(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add spotify widget"),c.qZA())}function et(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function nt(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function it(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let at=(()=>{class t{constructor(t,e,n){var i,o;this.dialogRef=t,this.data=e,this.editor=n,this.errors$=new a.X({}),this.form=new p.cw({url:new p.NI("")}),(null===(i=e.config)||void 0===i?void 0:i.url)&&this.form.patchValue({url:null===(o=e.config)||void 0===o?void 0:o.url})}createOrUpdate(){if(!("id"in W(this.form.value.url)))return this.errors$.next({url:"This is not a valid spotify url."});this.editor.crupdateWidget(this.data.widgetId,t.type,this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.type="spotifyEmbed",t.\u0275fac=function(e){return new(e||t)(c.Y36(A.so),c.Y36(A.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["spotify-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","spotify-widget-url","trans",""],["type","url","id","spotify-widget-url","formControlName","url","placeholder","https://open.spotify.com/track/2sqfLwGKXDw1nGjFhH3GGX?si=f329040f45804ec5","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,K,2,0,"span",2),c.YNc(3,tt,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Spotify Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,et,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,nt,2,0,"span",2),c.YNc(20,it,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[A.uh,x.O5,w.Hw,p.JL,p.sg,A.xY,T.P,p.Fj,p.JJ,p.u,p.Q7,A.H8,C.lW],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();function ot(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update twitch widget"),c.qZA())}function st(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add twitch widget"),c.qZA())}function rt(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function lt(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function ct(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let dt=(()=>{class t{constructor(t,e,n){var i,o;this.dialogRef=t,this.data=e,this.editor=n,this.errors$=new a.X({}),this.form=new p.cw({url:new p.NI("")}),(null===(i=e.config)||void 0===i?void 0:i.url)&&this.form.patchValue({url:null===(o=e.config)||void 0===o?void 0:o.url})}createOrUpdate(){if(!this.form.value.url.includes("twitch.tv/"))return this.errors$.next({url:"This is not a valid twitch url."});this.editor.crupdateWidget(this.data.widgetId,t.type,this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.type="twitchEmbed",t.\u0275fac=function(e){return new(e||t)(c.Y36(A.so),c.Y36(A.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["twitch-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","twitch-widget-url","trans",""],["type","url","id","twitch-widget-url","formControlName","url","placeholder","https://www.twitch.tv/kasparovchess","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,ot,2,0,"span",2),c.YNc(3,st,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Twitch Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,rt,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,lt,2,0,"span",2),c.YNc(20,ct,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[A.uh,x.O5,w.Hw,p.JL,p.sg,A.xY,T.P,p.Fj,p.JJ,p.u,p.Q7,A.H8,C.lW],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();function ut(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update tiktok widget"),c.qZA())}function pt(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add tiktok widget"),c.qZA())}function gt(t,e){if(1&t&&(c.TgZ(0,"div",16),c._uU(1),c.qZA()),2&t){const t=e.ngIf;c.xp6(1),c.Oqu(t)}}function ht(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Update"),c.qZA())}function mt(t,e){1&t&&(c.TgZ(0,"span",15),c._uU(1,"Add"),c.qZA())}let ft=(()=>{class t{constructor(t,e,n){var i,o;this.dialogRef=t,this.data=e,this.editor=n,this.errors$=new a.X({}),this.form=new p.cw({url:new p.NI("")}),(null===(i=e.config)||void 0===i?void 0:i.url)&&this.form.patchValue({url:null===(o=e.config)||void 0===o?void 0:o.url})}createOrUpdate(){if(!this.form.value.url.includes("tiktok.com/"))return this.errors$.next({url:"This is not a valid tiktok url."});this.editor.crupdateWidget(this.data.widgetId,t.type,this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.type="tiktokEmbed",t.\u0275fac=function(e){return new(e||t)(c.Y36(A.so),c.Y36(A.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["tiktok-widget-modal"]],decls:21,vars:11,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content",""],[1,"input-container"],["for","tiktok-widget-url","trans",""],["type","url","id","tiktok-widget-url","formControlName","url","placeholder","https://www.tiktok.com/@bts_official_bighit/video/6964945720885464322","cdkFocusInitial","","required",""],["class","error","trans","",4,"ngIf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],["trans","",1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,ut,2,0,"span",2),c.YNc(3,pt,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"TikTok Url"),c.qZA(),c._UZ(11,"input",10),c.YNc(12,gt,2,1,"div",11),c.ALo(13,"async"),c.qZA(),c.qZA(),c.TgZ(14,"div",12),c.TgZ(15,"button",13),c.NdJ("click",function(){return e.close()}),c._uU(16," Cancel "),c.qZA(),c.TgZ(17,"button",14),c.ALo(18,"async"),c.YNc(19,ht,2,0,"span",2),c.YNc(20,mt,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(6),c.Q6J("ngIf",c.lcZ(13,7,e.errors$).url),c.xp6(5),c.Q6J("disabled",c.lcZ(18,9,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[A.uh,x.O5,w.Hw,p.JL,p.sg,A.xY,T.P,p.Fj,p.JJ,p.u,p.Q7,A.H8,C.lW],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})();function bt(t,e){1&t&&(c.TgZ(0,"span",16),c._uU(1,"Update text widget"),c.qZA())}function vt(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add text widget"),c.qZA())}function _t(t,e){1&t&&(c.TgZ(0,"span",16),c._uU(1,"Update"),c.qZA())}function Zt(t,e){1&t&&(c.TgZ(0,"span",16),c._uU(1,"Add"),c.qZA())}const xt=[{name:"Email",type:"mail",placeholder:"your@email.com",inputType:"email"},{name:"Facebook Url",type:"facebook",placeholder:"https://facebook.com/username",pattern:"https://facebook.com/[a-zA-Z0-9._]+$",inputType:"url"},{name:"Twitter Handle",type:"twitter",placeholder:"@yourtwitterhandle",pattern:"^@[A-Za-z0-9_]{1,15}$"},{name:"Instagram Username",type:"instagram",placeholder:"@instagramusername",pattern:"^@[a-zA-Z0-9._]+$"},{name:"TikTok Username",type:"tiktok",placeholder:"@tiktokusername",pattern:"^@[a-zA-Z0-9._]+$"},{name:"Youtube Channel Url",type:"youtube",placeholder:"https://youtube.com/channel/youtubechannelurl",inputType:"url",pattern:"https://youtube.com/channel/[a-zA-Z0-9._]+$"},{name:"SoundCloud Url",type:"soundcloud",placeholder:"https://soundcloud.com/username",inputType:"url",pattern:"https://soundcloud.com/[a-zA-Z0-9._]+$"},{name:"Bandcamp Url",type:"bandcamp",placeholder:"https://you.bandcamp.com",inputType:"url",pattern:"https://[a-zA-Z0-9._]+.bandcamp.com$"},{name:"LinkedIn Url",type:"linkedin",placeholder:"https://linkedin.com/in/username",inputType:"url",pattern:"https://linkedin.com/in/[a-zA-Z0-9._]+$"},{name:"WhatsApp",type:"whatsapp",placeholder:"+00000000000",pattern:"^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$"},{name:"Telegram Url",type:"telegram",placeholder:"https://t.me/",inputType:"url",pattern:"https://t.me/[a-zA-Z0-9._]+$"},{name:"Twitch Url",type:"twitch",placeholder:"https://twitch.tv/username",inputType:"url",pattern:"https://twitch.tv/[a-zA-Z0-9._]+$"},{name:"Patreon Url",type:"patreon",placeholder:"https://patreon.com/username",inputType:"url",pattern:"https://patreon.com/[a-zA-Z0-9._]+$"},{name:"Pinterest Url",type:"pinterest",placeholder:"https://pinterest.com/",inputType:"url",pattern:"https://pinterest.com/.+"},{name:"Spotify Artist Url",type:"spotify",placeholder:"https://open.spotify.com/artist/artistname",inputType:"url",pattern:"https://open.spotify.com/artist/[a-zA-Z0-9._]+$"},{name:"Amazon Shop Url",type:"amazon",placeholder:"https://amazon.com/shop/yourshopname",inputType:"url",pattern:"https://amazon.com/shop/[a-zA-Z0-9._]+$"},{name:"Snapchat Url",type:"snapchat",placeholder:"https://www.snapchat.com/add/yourusername",inputType:"url",pattern:"https://www.snapchat.com/add/[a-zA-Z0-9._]+$"},{name:"Apple Music Url",type:"apple",placeholder:"https://music.apple.com/us/album/youralbum",inputType:"url",pattern:"https://music.apple.com/.+"}];function yt(t,e){1&t&&(c.TgZ(0,"span",12),c._uU(1,"Update social links"),c.qZA())}function At(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"Add social links"),c.qZA())}function wt(t,e){if(1&t&&(c.TgZ(0,"div",13),c.TgZ(1,"label",14),c._uU(2),c.qZA(),c._UZ(3,"input",15),c.qZA()),2&t){const t=e.$implicit;c.xp6(1),c.Q6J("for",t.name),c.xp6(1),c.Oqu(t.name),c.xp6(1),c.Q6J("type",t.inputType||"text")("pattern",t.pattern)("placeholder",t.placeholder)("id",t.name)("formControlName",t.type)}}function kt(t,e){1&t&&(c.TgZ(0,"span",12),c._uU(1,"Update"),c.qZA())}function Tt(t,e){1&t&&(c.TgZ(0,"span",12),c._uU(1,"Add"),c.qZA())}const Ct=[{type:"image",image:"image.png",description:"Upload an image and optionally add a link it will redirect to when clicked.",component:O},{type:"text",image:"text.png",description:"Add title and optional description. Can be used as a header for the whole biolink or a group of multiple widgets.",component:(()=>{class t{constructor(t,e,n){this.dialogRef=t,this.data=e,this.editor=n,this.form=new p.cw({title:new p.NI,description:new p.NI}),e.config&&this.form.patchValue(e.config)}createOrUpdate(){this.editor.crupdateWidget(this.data.widgetId,"text",this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(A.so),c.Y36(A.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["text-widget-modal"]],decls:23,vars:8,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content","",1,"many-inputs"],[1,"input-container"],["for","text-widget-title","trans","",1,"capitalize"],["cdkFocusInitial","","type","text","id","text-widget-title","formControlName","title","required",""],["for","text-widget-description","trans","",1,"capitalize"],["type","text","id","text-widget-description","formControlName","description"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,bt,2,0,"span",2),c.YNc(3,vt,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.TgZ(8,"div",8),c.TgZ(9,"label",9),c._uU(10,"Title"),c.qZA(),c._UZ(11,"input",10),c.qZA(),c.qZA(),c.TgZ(12,"div",8),c.TgZ(13,"label",11),c._uU(14,"Description"),c.qZA(),c._UZ(15,"input",12),c.qZA(),c.TgZ(16,"div",13),c.TgZ(17,"button",14),c.NdJ("click",function(){return e.close()}),c._uU(18," Cancel "),c.qZA(),c.TgZ(19,"button",15),c.ALo(20,"async"),c.YNc(21,_t,2,0,"span",2),c.YNc(22,Zt,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(13),c.Q6J("disabled",c.lcZ(20,6,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[A.uh,x.O5,w.Hw,p.JL,p.sg,A.xY,T.P,p.Fj,p.JJ,p.u,p.Q7,A.H8,C.lW],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})()},{type:"socials",name:"Social Links",image:"socials.png",description:"Add your socials links to display them as icon buttons.",component:(()=>{class t{constructor(t,e,n){this.dialogRef=t,this.data=e,this.editor=n,this.services=xt,this.form=new p.cw({}),this.services.forEach(t=>{this.form.addControl(t.type,new p.NI)}),e.config&&this.form.patchValue(e.config)}createOrUpdate(){this.editor.crupdateWidget(this.data.widgetId,"socials",this.form.value).subscribe(t=>{this.dialogRef.close(t.widget)})}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(A.so),c.Y36(A.WI),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["socials-widget-modal"]],decls:16,vars:9,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["trans","",4,"ngIf"],[4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content","",1,"many-inputs"],["class","input-container",4,"ngFor","ngForOf"],["mat-dialog-actions","",1,"buttons","right"],["type","button","mat-button","","trans","",1,"button","cancel","cancel-button",3,"click"],["type","submit","mat-raised-button","","color","accent",1,"button","primary","submit-button",3,"disabled"],["trans",""],[1,"input-container"],["trans","",1,"capitalize",3,"for"],["autocomplete","false",3,"type","pattern","placeholder","id","formControlName"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c.YNc(2,yt,2,0,"span",2),c.YNc(3,At,2,0,"span",3),c.qZA(),c.TgZ(4,"button",4),c.NdJ("click",function(){return e.close()}),c._UZ(5,"mat-icon",5),c.qZA(),c.qZA(),c.TgZ(6,"form",6),c.NdJ("ngSubmit",function(){return e.createOrUpdate()}),c.TgZ(7,"div",7),c.YNc(8,wt,4,7,"div",8),c.qZA(),c.TgZ(9,"div",9),c.TgZ(10,"button",10),c.NdJ("click",function(){return e.close()}),c._uU(11," Cancel "),c.qZA(),c.TgZ(12,"button",11),c.ALo(13,"async"),c.YNc(14,kt,2,0,"span",2),c.YNc(15,Tt,2,0,"span",2),c.qZA(),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config),c.xp6(3),c.Q6J("formGroup",e.form),c.xp6(2),c.Q6J("ngForOf",e.services),c.xp6(4),c.Q6J("disabled",c.lcZ(13,7,e.editor.loading$)),c.xp6(2),c.Q6J("ngIf",e.data.config),c.xp6(1),c.Q6J("ngIf",!e.data.config))},directives:[A.uh,x.O5,w.Hw,p.JL,p.sg,A.xY,x.sg,A.H8,C.lW,T.P,p.Fj,p.c5,p.JJ,p.u],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}upload-image-control[_ngcontent-%COMP%]{margin:0 auto 25px}"],changeDetection:0}),t})()},{name:"Youtube Video",type:"youtubeEmbed",image:"youtube.png",description:"Paste a YouTube video URL to show it as a video embed in your profile.",component:Y},{name:"Soundcloud Video",type:"soundcloudEmbed",image:"soundcloud.png",description:"Paste a SoundCloud URL to show it as a playable song in your profile.",component:V},{name:"Vimeo Video",type:"vimeoEmbed",image:"vimeo.jpeg",description:"Paste a vimeo URL to show it as a video embed in your profile.",component:X},{name:"Spotify Embed",type:"spotifyEmbed",image:"spotify.png",description:"Paste a spotify song, album, artist, playlist, podcast or episode url to show it as an embed in your profile.",component:at},{name:"Twitch Embed",type:"twitchEmbed",image:"twitch.svg",description:"Paste twitch profile or clip url to show it as an embed in your profile.",component:dt},{name:"TikTok Embed",type:"tiktokEmbed",image:"tiktok.png",description:"Paste TikTok video url to show it as an embed in your profile.",component:ft}];var qt=n(87064);function Ut(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",7),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().openWidgetDialog(e.component)}),c._UZ(1,"img",8),c.TgZ(2,"div",9),c._uU(3),c.qZA(),c.TgZ(4,"div",10),c._uU(5),c.qZA(),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.xp6(1),c.Q6J("src",n.settings.getAssetUrl("images/widgets/"+t.image),c.LSH),c.xp6(2),c.Oqu(t.name||t.type),c.xp6(2),c.Oqu(t.description)}}let It=(()=>{class t{constructor(t,e,n,i){this.dialogRef=t,this.data=e,this.settings=n,this.modal=i,this.widgets=Ct}openWidgetDialog(t){this.close(),this.modal.open(t,this.data)}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(A.so),c.Y36(A.WI),c.Y36(_.Z),c.Y36(m.u))},t.\u0275cmp=c.Xpm({type:t,selectors:[["widget-list-modal"]],decls:8,vars:1,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["mat-dialog-content",""],[1,"widgets"],["class","widget","mat-ripple","",3,"click",4,"ngFor","ngForOf"],["mat-ripple","",1,"widget",3,"click"],["alt","",1,"widget-img",3,"src"],["trans","",1,"name"],["trans","",1,"description"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c._uU(2,"Add New Widget"),c.qZA(),c.TgZ(3,"button",2),c.NdJ("click",function(){return e.close()}),c._UZ(4,"mat-icon",3),c.qZA(),c.qZA(),c.TgZ(5,"div",4),c.TgZ(6,"div",5),c.YNc(7,Ut,6,3,"div",6),c.qZA(),c.qZA()),2&t&&(c.xp6(7),c.Q6J("ngForOf",e.widgets))},directives:[A.uh,w.Hw,A.xY,x.sg,qt.wG,T.P],styles:["[_nghost-%COMP%]{display:block;width:700px;max-width:100%;background-color:var(--be-background-alternative)}.widgets[_ngcontent-%COMP%]{display:grid;grid-column-gap:10px;grid-row-gap:10px;grid-template-columns:repeat(3,1fr)}.widget[_ngcontent-%COMP%]{cursor:pointer;border:1px solid #ececec;border-radius:4px;padding:10px;background-color:var(--be-background);box-shadow:0 2px 4px 0 #ececec}.widget[_ngcontent-%COMP%]:hover{background-color:var(--be-hover)}.widget-img[_ngcontent-%COMP%]{width:55px;height:55px;margin-bottom:20px;margin-right:auto}.name[_ngcontent-%COMP%]{text-transform:capitalize;font-size:2rem;font-weight:500;color:var(--be-accent-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),t})();var Mt=n(69244),Ot=n(26437),Jt=n(24311),Pt=n(3080),Nt=n(99713),St=n(47701),Dt=n(79996),Qt=n(48865),Yt=n(79572),Lt=n(40450);const Ft=["*"];let Et=(()=>{class t{constructor(){this.closed=new c.vpe,this.visible$=new a.X(!1)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-slideout-panel"]],inputs:{title:"title"},outputs:{closed:"closed"},ngContentSelectors:Ft,decls:8,vars:3,consts:[[1,"header"],[1,"title"],["type","button","mat-icon-button","",3,"click"],["svgIcon","close"],[1,"body"]],template:function(t,e){1&t&&(c.F$t(),c.TgZ(0,"div",0),c.TgZ(1,"div",1),c._uU(2),c.ALo(3,"trans"),c.qZA(),c.TgZ(4,"button",2),c.NdJ("click",function(){return e.closed.emit()}),c._UZ(5,"mat-icon",3),c.qZA(),c.qZA(),c.TgZ(6,"div",4),c.Hsn(7),c.qZA()),2&t&&(c.xp6(2),c.Oqu(c.lcZ(3,1,e.title)))},directives:[C.lW,w.Hw],pipes:[Lt.R],styles:["[_nghost-%COMP%]{display:block;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);border-bottom-left-radius:4px;border-bottom-right-radius:4px;overflow:hidden}.header[_ngcontent-%COMP%]{display:flex;align-items:center;padding:0 20px;background-color:var(--be-background-alternative);border-top:1px solid var(--be-divider-lighter);border-bottom:1px solid var(--be-divider-lighter)}.header[_ngcontent-%COMP%]   .mat-icon-button[_ngcontent-%COMP%]{margin-left:15px}.title[_ngcontent-%COMP%]{flex:1 1 auto;margin-right:auto;font-weight:500}.body[_ngcontent-%COMP%]{background-color:var(--be-background);padding:15px}"],changeDetection:0}),t})();const Rt=["bounce","flash","pulse","rubberBand","shakeX","shakeY","headShake","swing","tada","wobble","jello","heartBeat"];var $t=n(78733);function Vt(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",5),c.NdJ("mouseenter",function(e){const n=c.CHM(t).$implicit;return c.oxw().onMouseEnter(e,n)})("mouseleave",function(e){const n=c.CHM(t).$implicit;return c.oxw().onMouseLeave(e,n)})("click",function(){const e=c.CHM(t).$implicit;return c.oxw().selectAnimation(e)}),c.ALo(1,"async"),c._uU(2),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.ekj("selected",c.lcZ(1,3,n.selectedAnimation$)===t),c.xp6(2),c.hij(" ",t," ")}}let Bt=(()=>{class t{constructor(t){this.lazyLoader=t,this.animationList=Rt,this.selectedAnimation$=new a.X(null)}ngOnInit(){this.lazyLoader.loadAsset("https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css",{type:"css",id:"animate.css"})}registerOnChange(t){this.propagateChange=t}writeValue(t){this.selectedAnimation$.next(t)}registerOnTouched(t){}selectAnimation(t){this.propagateChange(t),this.selectedAnimation$.next(t)}onMouseEnter(t,e){t.target.classList.add(`animate__${e}`)}onMouseLeave(t,e){t.target.classList.remove(`animate__${e}`)}}return t.\u0275fac=function(e){return new(e||t)(c.Y36($t.j))},t.\u0275cmp=c.Xpm({type:t,selectors:[["animation-selector"]],features:[c._Bn([{provide:p.JU,useExisting:t,multi:!0}])],decls:10,vars:5,consts:[[1,"description"],["trans",""],[1,"animation-list"],["type","button","mat-stroked-button","","trans","",3,"click"],["type","button","mat-stroked-button","","class","animate__animated","trans","",3,"selected","mouseenter","mouseleave","click",4,"ngFor","ngForOf"],["type","button","mat-stroked-button","","trans","",1,"animate__animated",3,"mouseenter","mouseleave","click"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"div",1),c._uU(2,"Add an animation to draw attention to this link."),c.qZA(),c.TgZ(3,"div",1),c._uU(4,"Selected animation will repeat five times by default."),c.qZA(),c.qZA(),c.TgZ(5,"div",2),c.TgZ(6,"button",3),c.NdJ("click",function(){return e.selectAnimation(null)}),c.ALo(7,"async"),c._uU(8," None "),c.qZA(),c.YNc(9,Vt,3,5,"button",4),c.qZA()),2&t&&(c.xp6(6),c.ekj("selected",!c.lcZ(7,3,e.selectedAnimation$)),c.xp6(3),c.Q6J("ngForOf",e.animationList))},directives:[T.P,C.lW,x.sg],pipes:[x.Ov],styles:[".description[_ngcontent-%COMP%]{text-align:center;margin-bottom:18px}button[_ngcontent-%COMP%]{line-height:60px;text-transform:uppercase;border-width:2px;font-size:1.3rem;padding:0 5px}button.selected[_ngcontent-%COMP%]{border-color:var(--be-accent-default)}.animation-list[_ngcontent-%COMP%]{display:grid;grid-gap:15px;grid-template-columns:repeat(auto-fill,minmax(95px,1fr))}"],changeDetection:0}),t})();var Ht=n(98720),zt=n(98081);function Gt(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",1),c.TgZ(1,"div",2),c._uU(2,"Temporarily send all visitors directly to this link."),c.qZA(),c.TgZ(3,"div",2),c._uU(4,"You can only have one active Leap Link at a time."),c.qZA(),c.TgZ(5,"button",3),c.NdJ("click",function(){return c.CHM(t),c.oxw().enableLeapLink()}),c._uU(6," Enable Leap Link "),c.qZA(),c.qZA()}}function jt(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",1),c.TgZ(1,"div",4),c._uU(2,"Set an end time for the Leap Link. Your Biolink will automatically restore when the Leap Link expires."),c.qZA(),c._UZ(3,"datetime-input",5),c.TgZ(4,"button",3),c.NdJ("click",function(){return c.CHM(t),c.oxw().disableLeapLink()}),c._uU(5," Disable Leap Link "),c.qZA(),c.qZA()}if(2&t){const t=c.oxw();c.xp6(3),c.Q6J("formControl",t.leapUntilControl)}}let Xt=(()=>{class t{constructor(){this.leapUntilControl=new p.NI(null),this.leapIsActive$=new a.X(!1),this.sub=this.leapUntilControl.valueChanges.pipe((0,i.O)(null),(0,Dt.U)(t=>!!t)).subscribe(t=>{this.leapIsActive$.next(t)})}ngAfterViewInit(){this.leapUntilControl.valueChanges.pipe((0,Ht.x)()).subscribe(t=>{this.propagateChange(t)})}ngOnDestroy(){this.sub.unsubscribe()}registerOnChange(t){this.propagateChange=t}writeValue(t){this.leapUntilControl.setValue(t)}registerOnTouched(t){}enableLeapLink(){const t=new Date;t.setDate(t.getDate()+1),this.leapUntilControl.setValue(t.toISOString())}disableLeapLink(){this.leapUntilControl.setValue(null)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=c.Xpm({type:t,selectors:[["leap-link-panel"]],features:[c._Bn([{provide:p.JU,useExisting:t,multi:!0}])],decls:4,vars:6,consts:[["class","enable-panel",4,"ngIf"],[1,"enable-panel"],["trans",""],["type","button","mat-flat-button","","color","accent","trans","",1,"enable-leap-btn",3,"click"],["trans","",1,"description"],[3,"formControl"]],template:function(t,e){1&t&&(c.YNc(0,Gt,7,0,"div",0),c.ALo(1,"async"),c.YNc(2,jt,6,1,"div",0),c.ALo(3,"async")),2&t&&(c.Q6J("ngIf",!c.lcZ(1,2,e.leapIsActive$)),c.xp6(2),c.Q6J("ngIf",c.lcZ(3,4,e.leapIsActive$)))},directives:[x.O5,T.P,C.lW,zt.k,p.JJ,p.oH],pipes:[x.Ov],styles:["[_nghost-%COMP%]{text-align:center}.enable-leap-btn[_ngcontent-%COMP%]{margin-top:18px;width:100%;min-height:40px}.enable-panel[_ngcontent-%COMP%]   .description[_ngcontent-%COMP%]{margin-bottom:10px}"],changeDetection:0}),t})();var Wt=n(62147),Kt=n(66457),te=n(67139),ee=n(35331),ne=n(57125);function ie(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",2),c.TgZ(1,"div",3),c._uU(2,"Upload a thumbnail for this link."),c.qZA(),c.TgZ(3,"button",4),c.NdJ("click",function(){return c.CHM(t),c.oxw().openUploadWindow()}),c._uU(4," Upload Thumbnail "),c.qZA(),c.qZA()}}function ae(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",5),c._UZ(1,"img",6),c.ALo(2,"async"),c.TgZ(3,"div",7),c.TgZ(4,"button",8),c.NdJ("click",function(){return c.CHM(t),c.oxw().openUploadWindow()}),c._uU(5," Change "),c.qZA(),c.TgZ(6,"button",9),c.NdJ("click",function(){return c.CHM(t),c.oxw().removeImage()}),c._uU(7," Remove "),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=c.oxw();c.xp6(1),c.Q6J("src",c.lcZ(2,1,t.src$),c.LSH)}}let oe=(()=>{class t{constructor(t,e){this.uploadQueue=t,this.imageValidator=e,this.src$=new a.X(null)}ngOnInit(){}registerOnChange(t){this.propagateChange=t}writeValue(t){this.src$.next(t)}registerOnTouched(t){}openUploadWindow(){(0,Wt.r)({multiple:!1,types:[te.j.image]}).then(t=>{this.uploadQueue.start(t,{httpParams:{diskPrefix:"biolink-thumbnails"},uri:ee.C.Image,validator:this.imageValidator}).subscribe(t=>{this.src$.next(t.fileEntry.url),this.propagateChange(t.fileEntry.url)})})}removeImage(){this.src$.next(null),this.propagateChange(null)}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(Kt.A),c.Y36(ne.G))},t.\u0275cmp=c.Xpm({type:t,selectors:[["link-thumbnail-panel"]],features:[c._Bn([Kt.A,{provide:p.JU,useExisting:t,multi:!0}])],decls:4,vars:6,consts:[["class","upload-panel",4,"ngIf"],["class","change-panel",4,"ngIf"],[1,"upload-panel"],["trans","",1,"description"],["type","button","mat-flat-button","","color","accent","trans","",1,"action-button",3,"click"],[1,"change-panel"],["alt","",1,"preview",3,"src"],[1,"upload-buttons"],["type","button","mat-flat-button","","color","accent","trans","",1,"action-button","change-button",3,"click"],["type","button","mat-stroked-button","","color","accent","trans","",1,"action-button",3,"click"]],template:function(t,e){1&t&&(c.YNc(0,ie,5,0,"div",0),c.ALo(1,"async"),c.YNc(2,ae,8,3,"div",1),c.ALo(3,"async")),2&t&&(c.Q6J("ngIf",!c.lcZ(1,2,e.src$)),c.xp6(2),c.Q6J("ngIf",c.lcZ(3,4,e.src$)))},directives:[x.O5,T.P,C.lW],pipes:[x.Ov],styles:[".change-panel[_ngcontent-%COMP%]{display:flex}.description[_ngcontent-%COMP%]{margin-bottom:10px;text-align:center}.preview[_ngcontent-%COMP%]{display:block;width:90px;height:90px;-o-object-fit:cover;object-fit:cover;margin-right:10px;border-radius:4px;overflow:hidden;flex-shrink:0}.upload-buttons[_ngcontent-%COMP%]{flex:1 1 auto}.action-button[_ngcontent-%COMP%]{display:block;width:100%;min-height:40px}.change-button[_ngcontent-%COMP%]{margin-bottom:10px}"],changeDetection:0}),t})();var se=n(77830),re=n(40985);function le(t,e){if(1&t&&c._UZ(0,"img",29),2&t){const t=c.oxw();c.Q6J("src",t.link.image,c.LSH)}}function ce(t,e){if(1&t&&(c._UZ(0,"img",29),c.ALo(1,"favicon")),2&t){const t=c.oxw();c.Q6J("src",c.lcZ(1,1,t.link.long_url),c.LSH)}}function de(t,e){1&t&&(c.TgZ(0,"div",30),c.TgZ(1,"div",31),c._uU(2,"This link is inactive due to its schedule."),c.qZA(),c.qZA())}function ue(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"biolink-slideout-panel",32),c.NdJ("closed",function(){return c.CHM(t),c.oxw().activeSlideOutPanel$.next(null)}),c._UZ(1,"animation-selector",33),c.qZA()}2&t&&c.Q6J("title","Animation")("@slideOutPanelAnimation",void 0)}function pe(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"biolink-slideout-panel",32),c.NdJ("closed",function(){return c.CHM(t),c.oxw().activeSlideOutPanel$.next(null)}),c._UZ(1,"leap-link-panel",34),c.qZA()}2&t&&c.Q6J("title","Leap Link")("@slideOutPanelAnimation",void 0)}function ge(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"biolink-slideout-panel",35),c.NdJ("closed",function(){return c.CHM(t),c.oxw().activeSlideOutPanel$.next(null)}),c._UZ(1,"link-thumbnail-panel",34),c.qZA()}2&t&&c.Q6J("@slideOutPanelAnimation",void 0)}const he=function(){return{resource:"link"}};function me(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"biolink-slideout-panel",36),c.NdJ("closed",function(){return c.CHM(t),c.oxw().activeSlideOutPanel$.next(null)}),c.TgZ(1,"p",37),c._uU(2," Enter a date when :resource should be active. Both start and end dates are optional. "),c.qZA(),c.TgZ(3,"div",38),c.TgZ(4,"div",39),c.TgZ(5,"datetime-input",40),c._uU(6,"Start Date"),c.qZA(),c.qZA(),c.TgZ(7,"div",39),c.TgZ(8,"datetime-input",41),c._uU(9,"End Date"),c.qZA(),c.qZA(),c.qZA(),c.qZA()}2&t&&(c.Q6J("@slideOutPanelAnimation",void 0),c.xp6(1),c.Q6J("transValues",c.DdM(2,he)))}const fe=function(t,e){return["/",t,"links",e]};let be=(()=>{class t{constructor(t,e,n){this.editor=t,this.fb=e,this.section=n,this.activeSlideOutPanel$=new a.X(null),this.form=this.fb.group({active:!0,animation:null,leap_until:null,image:null,expires_at:null,activates_at:null})}ngOnChanges(){var t,e;null===(t=this.formSub)||void 0===t||t.unsubscribe(),null===(e=this.animSub)||void 0===e||e.unsubscribe(),this.form.patchValue(this.link),this.link.active_locked?this.form.get("active").disable():this.form.get("active").enable(),this.formSub=this.form.valueChanges.pipe((0,St.b)(400)).subscribe(()=>{this.editor.updateContentItemConfig(this.link,this.getDirtyFromValues())}),this.animSub=this.form.get("animation").valueChanges.subscribe(()=>{this.activeSlideOutPanel$.next(null)})}ngOnInit(){this.leapActive$=this.activeObservable("leap_until"),this.animationActive$=this.activeObservable("animation"),this.imageActive$=this.activeObservable("image"),this.scheduleActive$=(0,Pt.aj)(this.activeObservable("expires_at"),this.activeObservable("activates_at")).pipe((0,Dt.U)(t=>t[0]||t[1]))}toggleAnimationPanel(t){this.activeSlideOutPanel$.next(this.activeSlideOutPanel$.value===t?null:t)}openEditLinkDialog(){this.editor.openCrupdateLinkDialog(this.link)}getParentRoute(){return this.section.admin?"admin":"dashboard"}enableLeapLink(){this.form.patchValue({leap_link:!0})}clearFormField(t){this.form.patchValue({[t]:null})}activeObservable(t){return this.form.get(t).valueChanges.pipe((0,i.O)(this.link[t]),(0,Dt.U)(t=>!!t))}getDirtyFromValues(){const t={};return Object.entries(this.form.controls).forEach(([e,n])=>{n.dirty&&(t[e]=n.value)}),t}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(b),c.Y36(p.qu),c.Y36(Qt.W))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor-link"]],inputs:{link:"link"},features:[c.TTD],decls:58,vars:85,consts:[[3,"formGroup"],[1,"content-item-wrapper"],[1,"drag-handle-container"],["type","button","mat-icon-button","","cdkDragHandle",""],["svgIcon","drag-indicator"],[1,"content-item-body"],[1,"header"],[1,"title"],["formControlName","active"],[1,"subheader"],["class","favicon-img","alt","",3,"src",4,"ngIf"],[1,"url"],[1,"actions"],["type","button","mat-icon-button","",1,"action-button",3,"disabled","matTooltip","click"],["svgIcon","edit"],["type","button","mat-icon-button","",1,"action-button","image-action-btn",3,"disabled","matTooltip","click"],["svgIcon","image"],["target","_blank","mat-icon-button","",1,"action-button",3,"routerLink","disabled","matTooltip"],["svgIcon","analytics"],["svgIcon","animation"],["svgIcon","shortcut"],["type","button","mat-icon-button","",1,"action-button","schedule-action-btn",3,"disabled","matTooltip","click"],["svgIcon","more-time"],["type","button","mat-icon-button","",1,"action-button","delete-action",3,"disabled","click"],["svgIcon","delete"],["class","locked-notif",4,"ngIf"],[3,"title","closed",4,"ngIf"],["title","Thumbnail",3,"closed",4,"ngIf"],["title","Schedule Link",3,"closed",4,"ngIf"],["alt","",1,"favicon-img",3,"src"],[1,"locked-notif"],["trans","",1,"locked-notif-msg"],[3,"title","closed"],["formControlName","animation"],["formControlName","image"],["title","Thumbnail",3,"closed"],["title","Schedule Link",3,"closed"],["trans","",1,"schedule-description",3,"transValues"],[1,"inline-inputs-container"],["permission-aware-input-container","expiration",1,"input-container"],["id","bio_exp_at","formControlName","activates_at","trans",""],["id","bio_act_at","formControlName","expires_at"]],template:function(t,e){1&t&&(c.ynx(0,0),c.TgZ(1,"div",1),c.ALo(2,"async"),c.TgZ(3,"div",2),c.TgZ(4,"button",3),c._UZ(5,"mat-icon",4),c.qZA(),c.qZA(),c.TgZ(6,"div",5),c.TgZ(7,"div",6),c.TgZ(8,"div",7),c._uU(9),c.qZA(),c._UZ(10,"mat-slide-toggle",8),c.qZA(),c.TgZ(11,"div",9),c.YNc(12,le,1,1,"img",10),c.YNc(13,ce,2,3,"img",10),c.TgZ(14,"span",11),c._uU(15),c.qZA(),c.qZA(),c.TgZ(16,"div",12),c.TgZ(17,"button",13),c.NdJ("click",function(){return e.openEditLinkDialog()}),c.ALo(18,"async"),c.ALo(19,"trans"),c._UZ(20,"mat-icon",14),c.qZA(),c.TgZ(21,"button",15),c.NdJ("click",function(){return e.toggleAnimationPanel("image")}),c.ALo(22,"async"),c.ALo(23,"async"),c.ALo(24,"trans"),c._UZ(25,"mat-icon",16),c.qZA(),c.TgZ(26,"a",17),c.ALo(27,"async"),c.ALo(28,"trans"),c._UZ(29,"mat-icon",18),c.qZA(),c.TgZ(30,"button",13),c.NdJ("click",function(){return e.toggleAnimationPanel("animation")}),c.ALo(31,"async"),c.ALo(32,"async"),c.ALo(33,"trans"),c._UZ(34,"mat-icon",19),c.qZA(),c.TgZ(35,"button",13),c.NdJ("click",function(){return e.toggleAnimationPanel("leapLink")}),c.ALo(36,"async"),c.ALo(37,"async"),c.ALo(38,"trans"),c._UZ(39,"mat-icon",20),c.qZA(),c.TgZ(40,"button",21),c.NdJ("click",function(){return e.toggleAnimationPanel("schedule")}),c.ALo(41,"async"),c.ALo(42,"async"),c.ALo(43,"trans"),c._UZ(44,"mat-icon",22),c.qZA(),c.TgZ(45,"button",23),c.NdJ("click",function(){return e.editor.maybeDeleteContentItem(e.link)}),c.ALo(46,"async"),c._UZ(47,"mat-icon",24),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.YNc(48,de,3,0,"div",25),c.ALo(49,"async"),c.YNc(50,ue,2,2,"biolink-slideout-panel",26),c.ALo(51,"async"),c.YNc(52,pe,2,2,"biolink-slideout-panel",26),c.ALo(53,"async"),c.YNc(54,ge,2,1,"biolink-slideout-panel",27),c.ALo(55,"async"),c.YNc(56,me,10,3,"biolink-slideout-panel",28),c.ALo(57,"async"),c.BQk()),2&t&&(c.Q6J("formGroup",e.form),c.xp6(1),c.ekj("slide-out-panel-active",c.lcZ(2,36,e.activeSlideOutPanel$))("active-locked",e.link.active_locked),c.xp6(8),c.Oqu(e.link.name),c.xp6(3),c.Q6J("ngIf",e.link.image),c.xp6(1),c.Q6J("ngIf",!e.link.image),c.xp6(2),c.Oqu(e.link.long_url),c.xp6(2),c.Q6J("disabled",c.lcZ(18,38,e.editor.loading$))("matTooltip",c.lcZ(19,40,"Edit")),c.xp6(4),c.ekj("active",c.lcZ(22,42,e.imageActive$)),c.Q6J("disabled",c.lcZ(23,44,e.editor.loading$))("matTooltip",c.lcZ(24,46,"Change Thumbnail")),c.xp6(5),c.Q6J("routerLink",c.WLB(82,fe,e.getParentRoute(),e.link.id))("disabled",c.lcZ(27,48,e.editor.loading$))("matTooltip",c.lcZ(28,50,"Statistics")),c.xp6(4),c.ekj("active",c.lcZ(31,52,e.animationActive$)),c.Q6J("disabled",c.lcZ(32,54,e.editor.loading$))("matTooltip",c.lcZ(33,56,"Animation")),c.xp6(5),c.ekj("active",c.lcZ(36,58,e.leapActive$)),c.Q6J("disabled",c.lcZ(37,60,e.editor.loading$))("matTooltip",c.lcZ(38,62,"Leap Link")),c.xp6(5),c.ekj("active",c.lcZ(41,64,e.scheduleActive$)),c.Q6J("disabled",c.lcZ(42,66,e.editor.loading$))("matTooltip",c.lcZ(43,68,"Schedule")),c.xp6(5),c.Q6J("disabled",c.lcZ(46,70,e.editor.loading$)),c.xp6(3),c.Q6J("ngIf",e.link.active_locked&&!c.lcZ(49,72,e.activeSlideOutPanel$)),c.xp6(2),c.Q6J("ngIf","animation"===c.lcZ(51,74,e.activeSlideOutPanel$)),c.xp6(2),c.Q6J("ngIf","leapLink"===c.lcZ(53,76,e.activeSlideOutPanel$)),c.xp6(2),c.Q6J("ngIf","image"===c.lcZ(55,78,e.activeSlideOutPanel$)),c.xp6(2),c.Q6J("ngIf","schedule"===c.lcZ(57,80,e.activeSlideOutPanel$)))},directives:[p.JL,p.sg,C.lW,Mt.Bh,w.Hw,Yt.Rr,p.JJ,p.u,x.O5,Jt.gM,C.zs,v.yS,T.P,Et,Bt,Xt,oe,se.o,zt.k],pipes:[x.Ov,Lt.R,re.K],styles:[".locked-notif[_ngcontent-%COMP%]{background-color:var(--be-background);border:1px solid var(--be-accent-lighter);border-top:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.locked-notif-msg[_ngcontent-%COMP%]{padding:12px 15px;background-color:var(--be-accent-emphasis);font-size:1.5rem}.schedule-description[_ngcontent-%COMP%]{text-align:center;margin:0 0 15px}@media only screen and (max-width:768px){.image-action-btn[_ngcontent-%COMP%], .schedule-action-btn[_ngcontent-%COMP%]{display:none}}"],data:{animation:[(0,Nt.X$)("slideOutPanelAnimation",[(0,Nt.eR)(":enter",[(0,Nt.oB)({height:"0px",opacity:0}),(0,Nt.jt)("225ms cubic-bezier(0.4,0.0,0.2,1)",(0,Nt.oB)({height:"*",opacity:1}))]),(0,Nt.eR)(":leave",[(0,Nt.oB)({height:"*",opacity:1}),(0,Nt.jt)("225ms cubic-bezier(0.4,0.0,0.2,1)",(0,Nt.oB)({height:"0px",opacity:0}))])])]},changeDetection:0}),t})();var ve=n(62181),_e=n(29476);function Ze(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"div",15),c.TgZ(2,"div",16),c._UZ(3,"image-or-icon",17),c.TgZ(4,"div",18),c._uU(5),c.qZA(),c.qZA(),c._UZ(6,"mat-slide-toggle",19),c.qZA(),c.BQk()),2&t){const t=c.oxw().ngIf,e=c.oxw();c.xp6(3),c.Q6J("src",e.widget.config.url),c.xp6(2),c.Oqu(t.name||t.type)}}function xe(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"div",15),c.TgZ(2,"div",20),c.TgZ(3,"div",21),c._uU(4),c.qZA(),c.TgZ(5,"div",22),c.TgZ(6,"div",23),c._uU(7),c.qZA(),c.TgZ(8,"div",24),c._uU(9),c.qZA(),c.qZA(),c.qZA(),c._UZ(10,"mat-slide-toggle",19),c.qZA(),c.BQk()),2&t){const t=c.oxw().ngIf,e=c.oxw();c.xp6(4),c.Oqu(t.name||t.type),c.xp6(3),c.Oqu(e.widget.config.title),c.xp6(2),c.Oqu(e.widget.config.description)}}function ye(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"div",15),c.TgZ(2,"div",25),c._uU(3),c.qZA(),c._UZ(4,"mat-slide-toggle",19),c.qZA(),c.TgZ(5,"div",26),c._UZ(6,"social-button-list",27),c.qZA(),c.BQk()),2&t){const t=c.oxw().ngIf,e=c.oxw();c.xp6(3),c.Oqu(t.name||t.type),c.xp6(3),c.Q6J("config",e.widget.config)}}function Ae(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"div",15),c.TgZ(2,"div",25),c._uU(3),c.qZA(),c._UZ(4,"mat-slide-toggle",19),c.qZA(),c.TgZ(5,"div",26),c._UZ(6,"img",28),c.TgZ(7,"span",29),c._uU(8),c.qZA(),c.qZA(),c.BQk()),2&t){const t=c.oxw().ngIf,e=c.oxw();c.xp6(3),c.Oqu(t.name||t.type),c.xp6(3),c.Q6J("src",e.settings.getAssetUrl("images/widgets/"+t.image),c.LSH),c.xp6(2),c.Oqu(e.widget.config.url)}}function we(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",6),c.ynx(1,7),c.YNc(2,Ze,7,2,"ng-container",8),c.YNc(3,xe,11,3,"ng-container",8),c.YNc(4,ye,7,2,"ng-container",8),c.YNc(5,Ae,9,3,"ng-container",9),c.BQk(),c.TgZ(6,"div",10),c.TgZ(7,"button",11),c.NdJ("click",function(){c.CHM(t);const e=c.oxw();return e.openEditWidgetDialog(e.widget)}),c.ALo(8,"async"),c.ALo(9,"trans"),c._UZ(10,"mat-icon",12),c.qZA(),c.TgZ(11,"button",13),c.NdJ("click",function(){c.CHM(t);const e=c.oxw();return e.editor.maybeDeleteContentItem(e.widget)}),c.ALo(12,"async"),c._UZ(13,"mat-icon",14),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=e.ngIf,n=c.oxw();c.xp6(1),c.Q6J("ngSwitch",t.type),c.xp6(1),c.Q6J("ngSwitchCase","image"),c.xp6(1),c.Q6J("ngSwitchCase","text"),c.xp6(1),c.Q6J("ngSwitchCase","socials"),c.xp6(3),c.Q6J("disabled",c.lcZ(8,7,n.editor.loading$))("matTooltip",c.lcZ(9,9,"Edit")),c.xp6(4),c.Q6J("disabled",c.lcZ(12,11,n.editor.loading$))}}let ke=(()=>{class t{constructor(t,e,n,i){this.settings=t,this.fb=e,this.editor=n,this.modal=i,this.form=this.fb.group({active:!0})}ngOnInit(){this.form.patchValue(this.widget),this.form.valueChanges.subscribe(t=>{this.editor.updateContentItemConfig(this.widget,t)})}getWidgetConfig(t){return Ct.find(e=>e.type===t)}openEditWidgetDialog(t){const e=this.getWidgetConfig(t.type);this.modal.open(e.component,{config:t.config,widgetId:t.id})}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(_.Z),c.Y36(p.qu),c.Y36(b),c.Y36(m.u))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor-widget"]],inputs:{widget:"widget"},decls:6,vars:2,consts:[[3,"formGroup"],[1,"content-item-wrapper"],[1,"drag-handle-container"],["type","button","mat-icon-button","","cdkDragHandle",""],["svgIcon","drag-indicator"],["class","content-item-body",4,"ngIf"],[1,"content-item-body"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"actions"],["type","button","mat-icon-button","",1,"action-button",3,"disabled","matTooltip","click"],["svgIcon","edit"],["type","button","mat-icon-button","",1,"action-button","delete-action",3,"disabled","click"],["svgIcon","delete"],[1,"header"],[1,"title","image-title"],[1,"inherit-size",3,"src"],["trans","",1,"capitalize"],["formControlName","active"],[1,"title"],["trans","",1,"capitalize","centered"],[1,"text-widget-body"],[1,"text-widget-title","centered"],[1,"text-widget-description","centered"],["trans","",1,"title","capitalize"],[1,"subheader"],[3,"config"],["alt","",1,"favicon-img",3,"src"],[1,"url"]],template:function(t,e){1&t&&(c.ynx(0,0),c.TgZ(1,"div",1),c.TgZ(2,"div",2),c.TgZ(3,"button",3),c._UZ(4,"mat-icon",4),c.qZA(),c.qZA(),c.YNc(5,we,14,13,"div",5),c.qZA(),c.BQk()),2&t&&(c.Q6J("formGroup",e.form),c.xp6(5),c.Q6J("ngIf",e.getWidgetConfig(e.widget.type)))},directives:[p.JL,p.sg,C.lW,Mt.Bh,w.Hw,x.O5,x.RF,x.n9,x.ED,Jt.gM,ve.A,T.P,Yt.Rr,p.JJ,p.u,_e.W],pipes:[x.Ov,Lt.R],styles:[".centered[_ngcontent-%COMP%]{text-align:center}.image-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding-top:22px;font-size:1.6rem}.image-title[_ngcontent-%COMP%]   image-or-icon[_ngcontent-%COMP%]{width:25px;height:25px;margin-right:10px;display:block;border-radius:4px;overflow:hidden}.text-widget-body[_ngcontent-%COMP%]{font-weight:400;font-size:1.3rem;margin-top:5px}social-button-list[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),t})();var Te=n(47210),Ce=n(88798);function qe(t,e){if(1&t&&c._UZ(0,"biolink-editor-link",11),2&t){const t=c.oxw().$implicit;c.Q6J("link",t)}}function Ue(t,e){if(1&t&&c._UZ(0,"biolink-editor-widget",12),2&t){const t=c.oxw().$implicit;c.Q6J("widget",t)}}function Ie(t,e){if(1&t&&(c.ynx(0),c.YNc(1,qe,1,1,"biolink-editor-link",9),c.YNc(2,Ue,1,1,"biolink-editor-widget",10),c.BQk()),2&t){const t=e.$implicit;c.xp6(1),c.Q6J("ngIf","link"===t.model_type),c.xp6(1),c.Q6J("ngIf","biolinkWidget"===t.model_type)}}function Me(t,e){1&t&&(c.TgZ(0,"no-results-message",13),c.TgZ(1,"span",14),c._uU(2,"No links or widgets have been added yet"),c.qZA(),c.qZA())}function Oe(t,e){if(1&t){const t=c.EpF();c.ynx(0),c.TgZ(1,"div",6),c.NdJ("cdkDropListDropped",function(e){return c.CHM(t),c.oxw().reorderContent(e)}),c.ALo(2,"async"),c.YNc(3,Ie,3,2,"ng-container",7),c.YNc(4,Me,3,0,"no-results-message",8),c.qZA(),c.BQk()}if(2&t){const t=e.ngIf,n=c.oxw();c.xp6(1),c.Q6J("cdkDropListDisabled",c.lcZ(2,5,n.editor.loading$))("@fadeIn",void 0),c.xp6(2),c.Q6J("ngForOf",t.content)("ngForTrackBy",n.trackByFn),c.xp6(1),c.Q6J("ngIf",!t.content.length)}}function Je(t,e){1&t&&(c.TgZ(0,"div",17),c.TgZ(1,"div",18),c.TgZ(2,"div",19),c._UZ(3,"skeleton",20),c.qZA(),c.TgZ(4,"div",21),c._UZ(5,"skeleton",22),c._UZ(6,"skeleton"),c._UZ(7,"skeleton"),c.qZA(),c.qZA(),c.qZA())}function Pe(t,e){if(1&t&&(c.TgZ(0,"div",15),c.YNc(1,Je,8,0,"div",16),c.qZA()),2&t){const t=c.oxw();c.Q6J("@fadeOut",void 0),c.xp6(1),c.Q6J("ngForOf",t.skeletonIterator)}}let Ne=(()=>{class t{constructor(t,e,n,i,a){this.modal=t,this.editor=e,this.toast=n,this.biolinks=i,this.settings=a,this.skeletonIterator=Array(5),this.trackByFn=(t,e)=>e.id}openNewLinkDialog(){this.editor.openCrupdateLinkDialog(null,{createMsg:"Link added"})}openWidgetListDialog(){this.modal.open(It,{biolinkId:this.editor.biolink$.value.id})}reorderContent(t){if(t.previousIndex===t.currentIndex)return;const e=[...this.editor.biolink$.value.content];(0,Mt.bA)(e,t.previousIndex,t.currentIndex),this.editor.biolink$.next(Object.assign(Object.assign({},this.editor.biolink$.value),{content:e}));const n=e.map(t=>({id:t.id,model_type:t.model_type}));this.editor.loading$.next(!0),this.biolinks.changeOrder(this.editor.biolink$.value.id,n).pipe((0,o.x)(()=>this.editor.loading$.next(!1))).subscribe()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(m.u),c.Y36(b),c.Y36(u.F),c.Y36(d.n),c.Y36(_.Z))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor-content"]],decls:10,vars:7,consts:[[1,"links-tab","left-col-spacer"],["type","button","mat-raised-button","","color","accent","trans","",1,"add-new-link-btn",3,"click"],["type","button","mat-raised-button","","color","accent",1,"add-widget-btn",3,"matTooltip","click"],["svgIcon","widgets"],[4,"ngIf","ngIfElse"],["loading",""],["cdkDropList","",1,"link-list",3,"cdkDropListDisabled","cdkDropListDropped"],[4,"ngFor","ngForOf","ngForTrackBy"],["svgImage","share-link.svg",4,"ngIf"],["class","biolink-content-item","cdkDrag","",3,"link",4,"ngIf"],["class","biolink-content-item","cdkDrag","",3,"widget",4,"ngIf"],["cdkDrag","",1,"biolink-content-item",3,"link"],["cdkDrag","",1,"biolink-content-item",3,"widget"],["svgImage","share-link.svg"],["primary-text","","trans",""],[1,"link-list"],["class","biolink-content-item",4,"ngFor","ngForOf"],[1,"biolink-content-item"],[1,"content-item-wrapper"],[1,"drag-handle-container"],["variant","icon"],[1,"content-item-body"],["animation",""]],template:function(t,e){if(1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"button",1),c.NdJ("click",function(){return e.openNewLinkDialog()}),c._uU(2," Add New Link "),c.qZA(),c.TgZ(3,"button",2),c.NdJ("click",function(){return e.openWidgetListDialog()}),c.ALo(4,"trans"),c._UZ(5,"mat-icon",3),c.qZA(),c.YNc(6,Oe,5,7,"ng-container",4),c.ALo(7,"async"),c.YNc(8,Pe,2,2,"ng-template",null,5,c.W1O),c.qZA()),2&t){const t=c.MAs(9);c.xp6(3),c.Q6J("matTooltip",c.lcZ(4,3,"Add widget")),c.xp6(3),c.Q6J("ngIf",c.lcZ(7,5,e.editor.biolink$))("ngIfElse",t)}},directives:[C.lW,T.P,Jt.gM,w.Hw,x.O5,Mt.Wj,x.sg,be,Mt.Zt,ke,Te.U,Ce._],pipes:[Lt.R,x.Ov],styles:["[_nghost-%COMP%]{display:block}.add-new-link-btn[_ngcontent-%COMP%]{width:calc(100% - 79px);height:48px;margin:auto}.add-widget-btn[_ngcontent-%COMP%]{height:48px;width:48px;margin-left:15px}.link-list[_ngcontent-%COMP%]{margin-top:50px}  .biolink-content-item{display:block;margin-bottom:20px}  .biolink-content-item .content-item-wrapper{display:flex;border-radius:4px;background-color:var(--be-background);border:1px solid transparent;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12)}  .biolink-content-item .content-item-wrapper.active-locked{border-color:var(--be-accent-lighter)}  .biolink-content-item .content-item-wrapper.active-locked,   .biolink-content-item .content-item-wrapper.slide-out-panel-active{border-bottom-left-radius:0;border-bottom-right-radius:0}  .biolink-content-item .drag-handle-container{display:flex;align-items:center;border-right:1px solid var(--be-divider-default)}  .biolink-content-item .content-item-body{padding:20px 20px 15px;flex:1 1 auto;overflow:hidden}  .biolink-content-item .header{display:flex;align-items:center;margin-bottom:3px}  .biolink-content-item .header .title{flex:1 1 auto;margin-right:auto;font-weight:500;font-size:1.5rem}  .biolink-content-item .header .mat-slide-toggle{flex-shrink:0;margin-left:10px}  .biolink-content-item .subheader{display:flex;align-items:center}  .biolink-content-item .url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--be-secondary-text)}  .biolink-content-item .favicon-img{margin-right:8px;width:16px;height:16px;border-radius:4px;overflow:hidden}  .biolink-content-item .actions{display:flex;align-items:center;margin-top:5px;color:var(--be-secondary-text)}  .biolink-content-item .action-button.active{color:var(--be-accent-default)}  .biolink-content-item .delete-action{margin-left:auto}"],data:{animation:Ot.B},changeDetection:0}),t})();var Se=n(64762);const De={configId:"uploadedImg",configLabel:"Image",backgroundSize:"cover",repeat:"no-repeat",position:"center center"},Qe={configId:"flat",configLabel:"Color",backgroundColor:"rgb(209, 246, 255)",color:null},Ye=[De,Qe,{configId:"gradient",configLabel:"Gradient",backgroundImage:"linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%)"},{configId:"img1",backgroundColor:"#ffdd55",backgroundImage:"svg-bgs/Angled-Focus.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img2",backgroundColor:"#220044",backgroundImage:"svg-bgs/Circular-Focus.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img3",backgroundColor:"#000000",backgroundImage:"svg-bgs/Farseeing-Eyeball.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img4",backgroundColor:"#ff0000",backgroundImage:"svg-bgs/Canyon-Funnel.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img5",backgroundColor:"#11ddaa",backgroundImage:"svg-bgs/Looney-Loops.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#000"},{configId:"img6",backgroundColor:"#070014",backgroundImage:"svg-bgs/Hurricane-Aperture.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img7",backgroundColor:"#ccffff",backgroundImage:"svg-bgs/Icy-Explosion.svg",backgroundAttachment:"fixed",backgroundSize:"cover",backgroundRepeat:"no-repeat",color:"#000"},{configId:"img8",backgroundColor:"#442233",backgroundImage:"svg-bgs/Nuclear-Focalpoint.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img9",backgroundColor:"#ee5522;",backgroundImage:"svg-bgs/Protruding-Squares.svg",color:"#fff"},{configId:"img10",backgroundColor:"#fff",backgroundImage:"svg-bgs/Alternating-Triangles.svg",color:"#000"},{configId:"img11",backgroundColor:"#002200",backgroundImage:"svg-bgs/Monstera-Patch.svg",color:"#fff"},{configId:"img11",backgroundColor:"#aa3333",backgroundImage:"svg-bgs/Confetti-Doodles.svg",color:"#fff",backgroundAttachment:"fixed"},{configId:"img12",backgroundColor:"#ffdd99",backgroundImage:"svg-bgs/Threads-Ahead.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#000"},{configId:"img13",backgroundColor:"#00bbff",backgroundImage:"svg-bgs/Launch-Day.svg",backgroundAttachment:"fixed",backgroundSize:"cover",color:"#fff"},{configId:"img14",backgroundImage:"svg-bgs/Sprinkle.svg"},{configId:"img15",backgroundImage:"svg-bgs/Circuit-Board.svg"},{configId:"img15",backgroundImage:"svg-bgs/Snow.svg"}];var Le=n(72674),Fe=n(25416);const Ee=[{configId:"grd1",backgroundImage:"linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%)"},{configId:"grd2",backgroundImage:"linear-gradient(to right, #ff8177 0%, #ff867a 0%, #ff8c7f 21%, #f99185 52%, #cf556c 78%, #b12a5b 100%)"},{configId:"grd3",backgroundImage:"linear-gradient(to top, #fbc2eb 0%, #a6c1ee 100%)"},{configId:"grd4",backgroundImage:"linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%)"},{configId:"grd5",backgroundImage:"linear-gradient(to top, #30cfd0 0%, #330867 100%)",color:"#fff"},{configId:"grd6",backgroundImage:"linear-gradient(135deg, #FDEB71 10%, #F8D800 100%)"},{configId:"grd7",backgroundImage:"linear-gradient( 135deg, #F05F57 10%, #360940 100%)"},{configId:"grd8",color:"#4158D0",backgroundImage:"linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%)"},{configId:"grd9",color:"#FBAB7E",backgroundImage:"linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)"},{configId:"grd10",color:"#21D4FD",backgroundImage:"linear-gradient(19deg, #21D4FD 0%, #B721FF 100%)"},{configId:"grd11",backgroundImage:"linear-gradient( 109.5deg,  rgba(76,221,242,1) 11.2%, rgba(92,121,255,1) 91.1% )"},{configId:"grd12",backgroundImage:"linear-gradient( 112.1deg,  rgba(32,38,57,1) 11.4%, rgba(63,76,119,1) 70.2% )",color:"#fff"}];var Re=n(7855),$e=n(80147);function Ve(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",2),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().selectGradient(e)}),c._UZ(1,"div",3),c._UZ(2,"div",4),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.ekj("active",(null==n.data.active?null:n.data.active.configId)===t.configId),c.xp6(1),c.Udp("background-image",t.backgroundImage)}}let Be=(()=>{class t{constructor(t,e){this.data=t,this.overlayPanelRef=e,this.gradients=Ee}selectGradient(t){this.overlayPanelRef.close(t)}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(Re.p,8),c.Y36($e.L))},t.\u0275cmp=c.Xpm({type:t,selectors:[["background-selector-gradient"]],decls:2,vars:1,consts:[[1,"auto-height-grid"],["class","grid-item",3,"active","click",4,"ngFor","ngForOf"],[1,"grid-item",3,"click"],[1,"grid-content"],[1,"grid-label"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.YNc(1,Ve,3,4,"div",1),c.qZA()),2&t&&(c.xp6(1),c.Q6J("ngForOf",e.gradients))},directives:[x.sg],styles:["[_nghost-%COMP%]{display:block;padding:15px;background-color:var(--be-background);width:500px;max-width:95%;border-radius:4px}"],changeDetection:0}),t})();var He=n(98979),ze=n(58901);let Ge=(()=>{class t{constructor(t,e,n,i){this.uploadQueue=t,this.imgValidator=e,this.el=n,this.bgUrl=i,this.imgUploaded=new c.vpe}ngOnChanges(){this.el.nativeElement.style.backgroundImage=this.selectedBg&&"uploadedImg"===this.selectedBg.configId?this.bgUrl.transform(this.selectedBg.backgroundImage):null}openUploadDialog(){(0,Wt.r)({types:[te.j.image]}).then(t=>{this.uploadQueue.start(t,{validator:this.imgValidator,httpParams:{diskPrefix:"biolink",disk:"public"}}).subscribe(t=>{this.imgUploaded.emit(Object.assign(Object.assign({},De),{backgroundImage:t.fileEntry.url}))})})}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(Kt.A),c.Y36(ne.G),c.Y36(c.SBq),c.Y36(ze.j))},t.\u0275cmp=c.Xpm({type:t,selectors:[["background-selector-img"]],hostBindings:function(t,e){1&t&&c.NdJ("click",function(t){return e.openUploadDialog(t.target)})},inputs:{selectedBg:"selectedBg"},outputs:{imgUploaded:"imgUploaded"},features:[c.TTD],decls:2,vars:0,consts:[[1,"icon-container"],["svgIcon","add-photo-alternate"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c._UZ(1,"mat-icon",1),c.qZA())},directives:[w.Hw],styles:["[_nghost-%COMP%]{color:#fff;position:relative}.icon-container[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;background-color:rgba(0,0,0,.3);padding:4px 4px 6px 6px;border-radius:4px;width:50px;height:50px}.mat-icon[_ngcontent-%COMP%]{width:40px;height:40px}"],changeDetection:0}),t})(),je=(()=>{class t{transform(t){if(t)return t.split("/").pop().split(".")[0].replace("-"," ")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=c.Yjl({name:"labelFromFilename",type:t,pure:!0}),t})();function Xe(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"background-selector-img",7),c.NdJ("imgUploaded",function(e){return c.CHM(t),c.oxw(2).selectBackground(e)}),c.ALo(1,"async"),c.qZA()}if(2&t){const t=c.oxw(2);c.Q6J("selectedBg",c.lcZ(1,1,t.selectedBg$))}}function We(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",8),c.NdJ("click",function(e){c.CHM(t);const n=c.oxw().$implicit;return c.oxw().onBgClick(n,e)}),c.ALo(1,"backgroundUrl"),c.qZA()}if(2&t){const t=c.oxw().$implicit;c.Udp("background-color",t.color)("background-image",c.lcZ(1,4,t.backgroundImage))}}function Ke(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"div"),c.TgZ(2,"div",2),c.ALo(3,"async"),c.ynx(4,3),c.YNc(5,Xe,2,3,"background-selector-img",4),c.YNc(6,We,2,6,"div",5),c.BQk(),c.qZA(),c.TgZ(7,"div",6),c._uU(8),c.ALo(9,"trans"),c.ALo(10,"labelFromFilename"),c.qZA(),c.qZA(),c.BQk()),2&t){const t=e.$implicit,n=c.oxw();let i;c.xp6(2),c.ekj("active",(null==(i=c.lcZ(3,5,n.selectedBg$))?null:i.id)===t.configId),c.xp6(2),c.Q6J("ngSwitch",t.configId),c.xp6(1),c.Q6J("ngSwitchCase","uploadedImg"),c.xp6(3),c.hij(" ",c.lcZ(9,7,t.configLabel||c.lcZ(10,9,t.backgroundImage))," ")}}let tn=(()=>{class t{constructor(t){this.overlay=t,this.backgrounds=Ye,this.selectedBg$=new a.X(null)}registerOnChange(t){this.propagateChange=t}writeValue(t){this.selectedBg$.next(t)}registerOnTouched(t){}onBgClick(t,e){var n;"flat"===t.configId?(this.setFlatColorBg(null===(n=this.selectedBg$.value)||void 0===n?void 0:n.color),this.openColorPicker(e)):"gradient"===t.configId?this.overlay.open(Be,{origin:new c.SBq(e.target),position:Le.Z,data:{active:this.selectedBg$.value}}).afterClosed().subscribe(t=>{t&&this.selectBackground(t)}):this.selectBackground(t)}selectBackground(t){var e;const n=null===(e=this.selectedBg$.value)||void 0===e?void 0:e.color,i=Object.assign({},t);!i.color&&n&&(i.color=n),this.propagateChange(i),this.selectedBg$.next(i)}setFlatColorBg(t){this.selectBackground(Object.assign(Object.assign({},Qe),{color:t}))}openColorPicker(t){var e;return(0,Se.mG)(this,void 0,void 0,function*(){const{BeColorPickerModule:i}=yield n.e(378).then(n.bind(n,49378)),a=this.overlay.open(i.components.panel,{origin:new c.SBq(t.target),position:Le.Z,data:{color:null===(e=this.selectedBg$.value)||void 0===e?void 0:e.color}});a.valueChanged().pipe((0,Fe.R)(a.afterClosed())).subscribe(t=>{this.setFlatColorBg(t)})})}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(He.T))},t.\u0275cmp=c.Xpm({type:t,selectors:[["background-selector"]],features:[c._Bn([{provide:p.JU,useExisting:t,multi:!0}])],decls:2,vars:1,consts:[[1,"auto-height-grid"],[4,"ngFor","ngForOf"],[1,"grid-item"],[3,"ngSwitch"],["class","grid-content","matRipple","",3,"selectedBg","imgUploaded",4,"ngSwitchCase"],["class","grid-content","matRipple","",3,"background-color","background-image","click",4,"ngSwitchDefault"],[1,"grid-label"],["matRipple","",1,"grid-content",3,"selectedBg","imgUploaded"],["matRipple","",1,"grid-content",3,"click"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.YNc(1,Ke,11,11,"ng-container",1),c.qZA()),2&t&&(c.xp6(1),c.Q6J("ngForOf",e.backgrounds))},directives:[x.sg,x.RF,x.n9,x.ED,Ge,qt.wG],pipes:[x.Ov,Lt.R,je,ze.j],styles:[".auto-height-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}.grid-item[_ngcontent-%COMP%]{padding-top:140%}.grid-content[_ngcontent-%COMP%]{background-size:cover;background-position:50%;border-radius:4px}background-selector-img.grid-content[_ngcontent-%COMP%]{border:1px dashed var(--be-secondary-text)}"],changeDetection:0}),t})();var en=n(9636);const nn=[{family:"Impact, Charcoal, sans-serif",category:"sans-serif"},{family:"Arial, Helvetica Neue, Helvetica, sans-serif",category:"serif"},{family:'"Comic Sans MS", cursive, sans-serif',category:"Handwriting"},{family:"Century Gothic, sans-serif",category:"sans-serif"},{family:'"Courier New", Courier, monospace',category:"monospace"},{family:'"Lucida Sans Unicode", "Lucida Grande", sans-serif',category:"sans-serif"},{family:'"Times New Roman", Times, serif',category:"serif"},{family:'"Lucida Console", Monaco, monospace',category:"monospace"},{family:'"Andele Mono", monospace, sans-serif',category:"sans-serif"},{family:"Verdana, Geneva, sans-serif",category:"sans-serif"},{family:'"Helvetica Neue", Helvetica, Arial, sans-serif',category:"sans-serif"}];var an=n(39404);let on=(()=>{class t{transform(t){return t?t.split(",")[0].replace(/"/g,"").trim():null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=c.Yjl({name:"fontDisplayName",type:t,pure:!0}),t})();function sn(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",19),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().selectFamily(e.family)}),c.ALo(1,"async"),c.TgZ(2,"div",20),c.TgZ(3,"div",21),c.O4$(),c.TgZ(4,"svg",22),c.TgZ(5,"text",23),c._uU(6,"Aa"),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.kcU(),c.TgZ(7,"div",24),c._uU(8),c.ALo(9,"fontDisplayName"),c.qZA(),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.ekj("active",c.lcZ(1,5,n.selectedFamily$)===t.family),c.xp6(5),c.Udp("font-family",t.family),c.xp6(3),c.Oqu(c.lcZ(9,7,t.family))}}let rn=(()=>{class t{constructor(t){this.googleFonts=t,this.activePage$=new a.X(0),this.chunkedFonts$=new a.X(null),this.selectedFamily$=new a.X(null),this.filters=new p.cw({query:new p.NI,category:new p.NI(null)}),this.from$=this.activePage$.pipe((0,Dt.U)(t=>t*this.perPage+1)),this.total$=new a.X(1052),this.to$=this.from$.pipe((0,Dt.U)(t=>Math.min(t+this.perPage-1),this.total$.value)),this.fonts$=(0,Pt.aj)(this.activePage$,this.chunkedFonts$).pipe((0,Dt.U)(([t,e])=>e?e[t]:[])),this.perPage=20}ngOnInit(){this.allFonts=[...nn],this.googleFonts.getAll().subscribe(t=>{this.allFonts=[...this.allFonts,...t],this.chunkFonts(this.allFonts)}),this.fontSub=this.fonts$.subscribe(t=>{this.loadIntoDom(t)}),this.formSub=this.filters.valueChanges.subscribe(t=>{var e;let n=(null===(e=t.query)||void 0===e?void 0:e.length)?(0,en.D)(this.allFonts,t.query):this.allFonts;n=t.category?n.filter(e=>e.category.toLowerCase()===t.category.toLowerCase()):n,this.activePage$.next(0),this.chunkFonts(n)})}ngOnDestroy(){this.formSub.unsubscribe(),this.fontSub.unsubscribe()}selectFamily(t){this.selectedFamily$.next(t),this.propagateChange({family:t})}haveNext(){var t;return(null===(t=this.chunkedFonts$.value)||void 0===t?void 0:t.length)>this.activePage$.value+1}havePrev(){return this.activePage$.value>0}nextPage(){this.activePage$.next(this.activePage$.value+1)}prevPage(){this.activePage$.next(this.activePage$.value-1)}registerOnChange(t){this.propagateChange=t}writeValue(t){this.selectedFamily$.next(null==t?void 0:t.family)}registerOnTouched(t){}chunkFonts(t){const e=this.perPage,n=[];for(let i=0,a=t.length;i<a;i+=e)n.push(t.slice(i,i+e));this.chunkedFonts$.next(n),this.total$.next(t.length)}loadIntoDom(t){this.googleFonts.loadIntoDom(t,"google-font-selector")}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(an.I))},t.\u0275cmp=c.Xpm({type:t,selectors:[["google-font-selector"]],features:[c._Bn([{provide:p.JU,useExisting:t,multi:!0}])],decls:36,vars:21,consts:[[1,"filters","inline-inputs-container","many-inputs",3,"formGroup"],[1,"input-container"],["for","font-selector-search","trans","",1,"hidden"],["type","text","id","font-selector-search","formControlName","query","placeholder","Search..."],["for","font-selector-category","trans","",1,"hidden"],["id","font-selector-category","formControlName","category"],["trans","",3,"ngValue"],["value","serif","trans",""],["value","sans-serif","trans",""],["value","display","trans",""],["value","handwriting","trans",""],["value","monospace","trans",""],[1,"font-grid"],["class","font",3,"active","click",4,"ngFor","ngForOf"],[1,"range-actions"],[1,"range-label"],["type","button","mat-icon-button","",1,"range-button",3,"disabled","click"],["svgIcon","chevron-left"],["svgIcon","chevron-right"],[1,"font",3,"click"],["role","button","matRipple","",1,"grid-item"],[1,"grid-content"],["viewBox","0 0 100 100"],["x","50%","y","50%"],[1,"label"]],template:function(t,e){1&t&&(c.TgZ(0,"form",0),c.TgZ(1,"div",1),c.TgZ(2,"label",2),c._uU(3,"Search"),c.qZA(),c._UZ(4,"input",3),c.qZA(),c.TgZ(5,"div",1),c.TgZ(6,"label",4),c._uU(7,"Category"),c.qZA(),c.TgZ(8,"select",5),c.TgZ(9,"option",6),c._uU(10,"All Categories"),c.qZA(),c.TgZ(11,"option",7),c._uU(12,"Serif"),c.qZA(),c.TgZ(13,"option",8),c._uU(14,"Sans Serif"),c.qZA(),c.TgZ(15,"option",9),c._uU(16,"Display"),c.qZA(),c.TgZ(17,"option",10),c._uU(18,"Handwriting"),c.qZA(),c.TgZ(19,"option",11),c._uU(20,"monospace"),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.TgZ(21,"div",12),c.YNc(22,sn,10,9,"div",13),c.ALo(23,"async"),c.qZA(),c.TgZ(24,"div",14),c.TgZ(25,"div",15),c._uU(26),c.ALo(27,"async"),c.ALo(28,"async"),c.ALo(29,"trans"),c.ALo(30,"number"),c.ALo(31,"async"),c.qZA(),c.TgZ(32,"button",16),c.NdJ("click",function(){return e.prevPage()}),c._UZ(33,"mat-icon",17),c.qZA(),c.TgZ(34,"button",16),c.NdJ("click",function(){return e.nextPage()}),c._UZ(35,"mat-icon",18),c.qZA(),c.qZA()),2&t&&(c.Q6J("formGroup",e.filters),c.xp6(9),c.Q6J("ngValue",null),c.xp6(13),c.Q6J("ngForOf",c.lcZ(23,9,e.fonts$)),c.xp6(4),c.HOy(" ",c.lcZ(27,11,e.from$)," - ",c.lcZ(28,13,e.to$)," ",c.lcZ(29,15,"of")," ",c.lcZ(30,17,c.lcZ(31,19,e.total$))," "),c.xp6(6),c.Q6J("disabled",!e.havePrev()),c.xp6(2),c.Q6J("disabled",!e.haveNext()))},directives:[p._Y,p.JL,p.sg,T.P,p.Fj,p.JJ,p.u,p.EJ,p.YN,p.Kr,x.sg,C.lW,w.Hw,qt.wG],pipes:[x.Ov,Lt.R,x.JJ,on],styles:["[_nghost-%COMP%]{display:block}.font-grid[_ngcontent-%COMP%]{display:grid;grid-gap:15px;grid-template-columns:repeat(auto-fill,minmax(99px,1fr))}.grid-item[_ngcontent-%COMP%]{padding-top:100%;position:relative;cursor:pointer}.grid-item[_ngcontent-%COMP%]:hover{background-color:var(--be-hover)}.active[_ngcontent-%COMP%]   .grid-content[_ngcontent-%COMP%]{border-color:var(--be-accent-default)}.grid-content[_ngcontent-%COMP%]{border:1px solid var(--be-divider-default);border-radius:4px;position:absolute;top:0;left:0;right:0;bottom:0;margin:auto}.label[_ngcontent-%COMP%]{margin-top:6px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 5px}.preview[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;font-size:4rem;height:100%}svg[_ngcontent-%COMP%]{width:100%;height:100%}svg[_ngcontent-%COMP%]   text[_ngcontent-%COMP%]{font-size:4rem;dominant-baseline:central;text-anchor:middle}.range-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;margin-top:25px}.range-label[_ngcontent-%COMP%]{margin:0 32px 0 24px;font-size:1.2rem}.range-button[_ngcontent-%COMP%], .range-label[_ngcontent-%COMP%]{color:var(--be-secondary-text)}.range-button[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{width:28px;height:28px;line-height:28px}"],changeDetection:0}),t})(),ln=(()=>{class t{constructor(t){this.editor=t}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor-fonts"]],decls:4,vars:1,consts:[["trans",""],[1,"material-panel"],[3,"formControl"]],template:function(t,e){1&t&&(c.TgZ(0,"h3",0),c._uU(1,"Fonts"),c.qZA(),c.TgZ(2,"div",1),c._UZ(3,"google-font-selector",2),c.qZA()),2&t&&(c.xp6(3),c.Q6J("formControl",e.editor.appearanceForm.get("fontConfig")))},directives:[T.P,rn,p.JJ,p.oH],styles:[""],changeDetection:0}),t})();var cn=n(69042);function dn(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",2),c.TgZ(1,"h4",0),c._uU(2,"Raised"),c.qZA(),c.TgZ(3,"div",3),c.TgZ(4,"div",4),c.TgZ(5,"button",5),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("raised","square")}),c._uU(6," Square "),c.qZA(),c.qZA(),c.TgZ(7,"div",4),c.TgZ(8,"button",6),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("raised","rounded")}),c._uU(9," Rounded "),c.qZA(),c.qZA(),c.TgZ(10,"div",4),c.TgZ(11,"button",7),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("raised","pill")}),c._uU(12," Pill "),c.qZA(),c.qZA(),c.qZA(),c.TgZ(13,"h4",0),c._uU(14,"Flat"),c.qZA(),c.TgZ(15,"div",3),c.TgZ(16,"div",4),c.TgZ(17,"button",8),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("flat","square")}),c._uU(18," Square "),c.qZA(),c.qZA(),c.TgZ(19,"div",4),c.TgZ(20,"button",9),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("flat","rounded")}),c._uU(21," Rounded "),c.qZA(),c.qZA(),c.TgZ(22,"div",4),c.TgZ(23,"button",10),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("flat","pill")}),c._uU(24," Pill "),c.qZA(),c.qZA(),c.qZA(),c.TgZ(25,"h4",0),c._uU(26,"Outline"),c.qZA(),c.TgZ(27,"div",3),c.TgZ(28,"div",4),c.TgZ(29,"button",11),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("stroked","square")}),c._uU(30," Square "),c.qZA(),c.qZA(),c.TgZ(31,"div",4),c.TgZ(32,"button",12),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("stroked","rounded")}),c._uU(33," Rounded "),c.qZA(),c.qZA(),c.TgZ(34,"div",4),c.TgZ(35,"button",13),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("stroked","pill")}),c._uU(36," Pill "),c.qZA(),c.qZA(),c.qZA(),c.TgZ(37,"h4",0),c._uU(38,"Basic"),c.qZA(),c.TgZ(39,"div",3),c.TgZ(40,"div",4),c.TgZ(41,"button",14),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("basic","square")}),c._uU(42," Square "),c.qZA(),c.qZA(),c.TgZ(43,"div",4),c.TgZ(44,"button",15),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("basic","rounded")}),c._uU(45," Rounded "),c.qZA(),c.qZA(),c.TgZ(46,"div",4),c.TgZ(47,"button",16),c.NdJ("click",function(){return c.CHM(t),c.oxw().changeBtnType("basic","pill")}),c._uU(48," Pill "),c.qZA(),c.qZA(),c.qZA(),c.TgZ(49,"color-picker-input",17),c._uU(50,"Button Color"),c.qZA(),c.qZA()}if(2&t){const t=e.ngIf,n=c.oxw();c.xp6(4),c.ekj("active","raised"===t.type&&"square"===t.variant),c.xp6(3),c.ekj("active","raised"===t.type&&"rounded"===t.variant),c.xp6(3),c.ekj("active","raised"===t.type&&"pill"===t.variant),c.xp6(6),c.ekj("active","flat"===t.type&&"square"===t.variant),c.xp6(3),c.ekj("active","flat"===t.type&&"rounded"===t.variant),c.xp6(3),c.ekj("active","flat"===t.type&&"pill"===t.variant),c.xp6(6),c.ekj("active","stroked"===t.type&&"square"===t.variant),c.xp6(3),c.ekj("active","stroked"===t.type&&"rounded"===t.variant),c.xp6(3),c.ekj("active","stroked"===t.type&&"pill"===t.variant),c.xp6(6),c.ekj("active","basic"===t.type&&"square"===t.variant),c.xp6(3),c.ekj("active","basic"===t.type&&"rounded"===t.variant),c.xp6(3),c.ekj("active","basic"===t.type&&"pill"===t.variant),c.xp6(3),c.Q6J("formControl",n.colorControl)}}let un=(()=>{class t{constructor(t){this.editor=t,this.colorControl=new p.NI,this.active$=this.editor.appearanceForm.get("btnConfig").valueChanges.pipe((0,i.O)({}),(0,Dt.U)(t=>null!=t?t:{}))}ngOnInit(){this.colorControl.valueChanges.subscribe(t=>{this.editor.appearanceForm.get("btnConfig.color").setValue(t),this.editor.appearanceForm.markAsDirty()})}changeBtnType(t,e){this.editor.appearanceForm.patchValue({btnConfig:{type:t,variant:e}}),this.editor.appearanceForm.markAsDirty()}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor-buttons"]],decls:4,vars:3,consts:[["trans",""],["class","material-panel",4,"ngIf"],[1,"material-panel"],[1,"row"],[1,"border"],["type","button","color","accent","mat-raised-button","","trans","",1,"btn-square",3,"click"],["type","button","color","accent","mat-raised-button","","trans","",3,"click"],["type","button","color","accent","mat-raised-button","","trans","",1,"btn-pill",3,"click"],["type","button","color","accent","mat-flat-button","","trans","",1,"btn-square",3,"click"],["type","button","color","accent","mat-flat-button","","trans","",3,"click"],["type","button","color","accent","mat-flat-button","","trans","",1,"btn-pill",3,"click"],["type","button","color","accent","mat-stroked-button","","trans","",1,"btn-square",3,"click"],["type","button","color","accent","mat-stroked-button","","trans","",3,"click"],["type","button","color","accent","mat-stroked-button","","trans","",1,"btn-pill",3,"click"],["type","button","color","accent","mat-button","","trans","",1,"btn-square","basic-btn",3,"click"],["type","button","color","accent","mat-button","","trans","",1,"basic-btn",3,"click"],["type","button","color","accent","mat-button","","trans","",1,"btn-pill","basic-btn",3,"click"],["trans","",3,"formControl"]],template:function(t,e){1&t&&(c.TgZ(0,"h3",0),c._uU(1,"Buttons"),c.qZA(),c.YNc(2,dn,51,25,"div",1),c.ALo(3,"async")),2&t&&(c.xp6(2),c.Q6J("ngIf",c.lcZ(3,1,e.active$)))},directives:[T.P,x.O5,C.lW,cn.M,p.JJ,p.oH],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block}h4[_ngcontent-%COMP%]{font-size:1.4rem;margin:0 0 10px}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:24px;margin:0 -10px 20px}button[_ngcontent-%COMP%]{min-height:45px;width:100%}.btn-square[_ngcontent-%COMP%]{border-radius:0}.btn-pill[_ngcontent-%COMP%]{border-radius:30px}.basic-btn[_ngcontent-%COMP%]{border:1px dashed var(--be-divider-lighter)}.border[_ngcontent-%COMP%]{border:4px solid transparent;border-radius:4px;padding:5px}.border.active[_ngcontent-%COMP%]{border-color:var(--be-divider-default)}"],changeDetection:0}),t})(),pn=(()=>{class t{constructor(t){this.editor=t}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-appearance"]],decls:13,vars:4,consts:[["trans",""],["trans","",1,"tab-description"],["mat-raised-button","","type","button","color","accent","trans","",1,"save-button",3,"disabled","click"],[1,"material-panel"],[3,"formControl"]],template:function(t,e){1&t&&(c.TgZ(0,"h2",0),c._uU(1,"Custom Appearance"),c.qZA(),c.TgZ(2,"p",1),c._uU(3," Fully customize your Biolink. Change background color or select gradients and images. Choose button style, text color, typeface and more.\n"),c.qZA(),c.TgZ(4,"button",2),c.NdJ("click",function(){return e.editor.saveAppearance()}),c.ALo(5,"async"),c._uU(6," Save Changes\n"),c.qZA(),c.TgZ(7,"h3",0),c._uU(8,"Background"),c.qZA(),c.TgZ(9,"div",3),c._UZ(10,"background-selector",4),c.qZA(),c._UZ(11,"biolink-editor-fonts"),c._UZ(12,"biolink-editor-buttons")),2&t&&(c.xp6(4),c.Q6J("disabled",c.lcZ(5,2,e.editor.loading$)||e.editor.appearanceForm.pristine),c.xp6(6),c.Q6J("formControl",e.editor.appearanceForm.get("bgConfig")))},directives:[T.P,C.lW,tn,p.JJ,p.oH,ln,un],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font-size:2.4rem;margin:0 0 10px}h3[_ngcontent-%COMP%]{font-size:2rem}.tab-description[_ngcontent-%COMP%]{margin:0 0 15px}.save-button[_ngcontent-%COMP%]{margin:0 0 40px}  .mat-tab-label-content{text-transform:capitalize}.material-panel[_ngcontent-%COMP%]{max-height:550px;overflow:auto}"],changeDetection:0}),t})();var gn=n(32198),hn=n(43835),mn=n(90611),fn=n(25051),bn=n(28505),vn=n(53129),_n=n(29738);function Zn(t,e){if(1&t&&(c.TgZ(0,"div",14),c._uU(1),c.qZA()),2&t){const t=c.oxw().ngIf;c.xp6(1),c.Oqu(t.name)}}function xn(t,e){if(1&t&&(c.TgZ(0,"div",14),c._uU(1),c.qZA()),2&t){const t=c.oxw().ngIf;c.xp6(1),c.Oqu(t.hash)}}function yn(t,e){if(1&t&&(c.TgZ(0,"div",4),c.TgZ(1,"div",5),c.TgZ(2,"label",6),c._uU(3,"Name"),c.qZA(),c._UZ(4,"input",7),c.YNc(5,Zn,2,1,"div",8),c.qZA(),c.TgZ(6,"div",9),c._UZ(7,"slug-control",10),c.ALo(8,"async"),c.YNc(9,xn,2,1,"div",8),c.qZA(),c.TgZ(10,"div",11),c.TgZ(11,"label",12),c._uU(12,"Description"),c.qZA(),c._UZ(13,"textarea",13),c.qZA(),c.qZA()),2&t){const t=e.ngIf,n=c.oxw();c.Q6J("formGroup",n.linkForm.formGroup),c.xp6(5),c.Q6J("ngIf",t.name),c.xp6(2),c.Q6J("baseUri",c.lcZ(8,4,n.slugBaseUri$)),c.xp6(2),c.Q6J("ngIf",t.hash)}}let An=(()=>{class t{constructor(t,e,n,i,o,s,r){this.linkForm=t,this.valueLists=e,this.currentUser=n,this.fb=i,this.settings=o,this.editor=s,this.toast=r,this.hiddenFeatures={alias:!0,linkGroups:!0,details:!0},this.slugBaseUri$=new a.X(null),this.options$=new a.X(null),this.form=this.fb.group({name:""}),this.errors$=new a.X({})}ngOnInit(){this.valueLists.get(["countries","domains","pixels"],{userId:this.currentUser.get("id")}).subscribe(t=>{this.options$.next(t)}),(0,Pt.aj)(this.linkForm.formGroup.get("domain_id").valueChanges,this.options$.pipe((0,hn.h)(t=>!!t))).subscribe(([t,e])=>{this.setSlugBaseUri(t)}),this.editor.biolink$.pipe((0,hn.h)(t=>!!t),(0,mn.q)(1)).subscribe(t=>{this.linkForm.patchValue(t)})}saveSettings(){return this.editor.loading$.next(!0),this.editor.biolinks.update(this.editor.biolink$.value.id,this.linkForm.value()).pipe((0,o.x)(()=>this.editor.loading$.next(!1))).subscribe(()=>{this.toast.open("Biolink updated")},t=>this.errors$.next(t.errors))}setSlugBaseUri(t){this.slugBaseUri$.next(t?this.options$.value.domains.find(e=>e.id===t).host:this.settings.getBaseUrl())}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(gn.l),c.Y36(fn.l),c.Y36(bn.I),c.Y36(p.qu),c.Y36(_.Z),c.Y36(b),c.Y36(u.F))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-settings"]],features:[c._Bn([gn.l])],decls:8,vars:10,consts:[["ngNativeValidate","",1,"material-panel",3,"ngSubmit"],[3,"formGroup",4,"ngIf"],["resourceName","biolink",3,"featuresToHide","linkOptions"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],[3,"formGroup"],[1,"input-container","name-container"],["for","link-group-name","trans",""],["type","text","id","link-group-name","formControlName","name","required","","minlength","3"],["class","error",4,"ngIf"],[1,"input-container","slug-container"],["formControlName","hash",3,"baseUri"],[1,"input-container"],["for","link-group-description","trans",""],["id","link-group-description","formControlName","description"],[1,"error"]],template:function(t,e){1&t&&(c.TgZ(0,"form",0),c.NdJ("ngSubmit",function(){return e.saveSettings()}),c.YNc(1,yn,14,6,"div",1),c.ALo(2,"async"),c._UZ(3,"link-options-form",2),c.ALo(4,"async"),c.TgZ(5,"button",3),c.ALo(6,"async"),c._uU(7," Save "),c.qZA(),c.qZA()),2&t&&(c.xp6(1),c.Q6J("ngIf",c.lcZ(2,4,e.errors$)),c.xp6(2),c.Q6J("featuresToHide",e.hiddenFeatures)("linkOptions",c.lcZ(4,6,e.options$)),c.xp6(2),c.Q6J("disabled",c.lcZ(6,8,e.editor.loading$)))},directives:[p.JL,p.F,x.O5,vn.O,C.lW,T.P,p.sg,p.Fj,p.JJ,p.u,p.Q7,p.wO,_n.b],pipes:[x.Ov],styles:["[_nghost-%COMP%]{display:block}.slug-container[_ngcontent-%COMP%]{margin:8px 0 20px}link-options-form[_ngcontent-%COMP%]{margin-top:10px}"],changeDetection:0}),t})();var wn=n(78671);function kn(t,e){1&t&&c._UZ(0,"biolink-editor-content",8)}function Tn(t,e){1&t&&c._UZ(0,"biolink-appearance",8)}function Cn(t,e){1&t&&c._UZ(0,"biolink-settings",8)}function qn(t,e){if(1&t&&(c.TgZ(0,"div",9),c.TgZ(1,"div",10),c.TgZ(2,"a",11),c._uU(3),c.qZA(),c.qZA(),c._UZ(4,"share-link-btns",12),c.qZA()),2&t){const t=e.ngIf;c.xp6(2),c.Q6J("href",t.short_url,c.LSH),c.xp6(1),c.Oqu(t.short_url),c.xp6(1),c.Q6J("showCopyBtn",!0)("colored",!0)("link",t)}}let Un=(()=>{class t{constructor(t,e,n,a,o,s,r,l){this.modal=t,this.biolinks=e,this.widgets=n,this.route=a,this.toast=o,this.settings=s,this.router=r,this.editor=l,this.appearance$=this.editor.appearanceForm.valueChanges.pipe((0,i.O)({}))}ngOnInit(){this.route.params.subscribe(t=>{this.editor.reloadBiolink(t.linkId)}),this.route.queryParams.subscribe(t=>{this.editor.activeTab$.next(f[t.tab||"links"])})}tabChanged(t){this.router.navigate([],{queryParams:{tab:Object.entries(f)[t.index][0]},replaceUrl:!0})}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(m.u),c.Y36(d.n),c.Y36(h),c.Y36(v.gz),c.Y36(u.F),c.Y36(_.Z),c.Y36(v.F0),c.Y36(b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["biolink-editor"]],decls:19,vars:21,consts:[[1,"left-col"],["dynamicHeight","","color","accent","animationDuration","0",3,"selectedIndex","selectedTabChange"],[3,"label"],["matTabContent",""],[1,"right-col"],["class","preview-title",4,"ngIf"],[1,"phone-preview"],[3,"biolink","appearance"],[1,"left-col-spacer"],[1,"preview-title"],[1,"link"],["target","_blank",3,"href"],[3,"showCopyBtn","colored","link"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"mat-tab-group",1),c.NdJ("selectedTabChange",function(t){return e.tabChanged(t)}),c.ALo(2,"async"),c.TgZ(3,"mat-tab",2),c.ALo(4,"trans"),c.YNc(5,kn,1,0,"ng-template",3),c.qZA(),c.TgZ(6,"mat-tab",2),c.ALo(7,"trans"),c.YNc(8,Tn,1,0,"ng-template",3),c.qZA(),c.TgZ(9,"mat-tab",2),c.ALo(10,"trans"),c.YNc(11,Cn,1,0,"ng-template",3),c.qZA(),c.qZA(),c.qZA(),c.TgZ(12,"div",4),c.YNc(13,qn,5,5,"div",5),c.ALo(14,"async"),c.TgZ(15,"div",6),c._UZ(16,"biolink-page",7),c.ALo(17,"async"),c.ALo(18,"async"),c.qZA(),c.qZA()),2&t&&(c.xp6(1),c.Q6J("selectedIndex",c.lcZ(2,7,e.editor.activeTab$)),c.xp6(2),c.Q6J("label",c.lcZ(4,9,"Content")),c.xp6(3),c.Q6J("label",c.lcZ(7,11,"Appearance")),c.xp6(3),c.Q6J("label",c.lcZ(10,13,"Settings")),c.xp6(4),c.Q6J("ngIf",c.lcZ(14,15,e.editor.biolink$)),c.xp6(3),c.Q6J("biolink",c.lcZ(17,17,e.editor.biolink$))("appearance",c.lcZ(18,19,e.appearance$)))},directives:[Z.SP,Z.uX,Z.Vc,x.O5,y.v,Ne,pn,An,wn.t],pipes:[x.Ov,Lt.R],styles:["@media only screen and (min-width:768px){[_nghost-%COMP%]{display:flex}}[_nghost-%COMP%]     .mat-tab-label-content{text-transform:capitalize}.left-col[_ngcontent-%COMP%]{flex:1 1 auto}@media only screen and (min-width:768px){.left-col[_ngcontent-%COMP%]{padding-right:40px}}.left-col-spacer[_ngcontent-%COMP%]{max-width:650px;margin:0 auto;position:relative;padding:40px 0}.right-col[_ngcontent-%COMP%]{padding:0 40px 40px;border-left:1px solid var(--be-divider-default);flex-shrink:0}@media only screen and (max-width:768px){.right-col[_ngcontent-%COMP%]{display:none}}.preview-title[_ngcontent-%COMP%]{display:flex;align-items:center;padding-bottom:8px;margin-bottom:55px;border-bottom:1px solid var(--be-divider-default)}.preview-title[_ngcontent-%COMP%]   .link[_ngcontent-%COMP%]{flex:1 1 auto;margin-right:auto;color:var(--be-link);text-decoration:underline;max-width:175px;overflow:hidden;text-overflow:ellipsis}.preview-title[_ngcontent-%COMP%]   share-link-btns[_ngcontent-%COMP%]{flex-shrink:0;margin-left:15px}.phone-preview[_ngcontent-%COMP%]{width:352px;height:724px;border-radius:64px;box-shadow:0 0 30px rgba(0,0,0,.2);border:12px solid #444546;overflow:hidden;position:sticky;top:135px}biolink-page[_ngcontent-%COMP%]{height:100%;width:100%;min-height:100%}"],changeDetection:0}),t})()},4512:function(t,e,n){"use strict";n.d(e,{o:function(){return z}});var i=n(56515),a=n(36024),o=n(90832),s=n(28577),r=n(76512),l=n(35366),c=n(28505),d=n(73234),u=n(63337),p=n(36501),g=n(48865),h=n(95157),m=n(24859),f=n(38116),b=n(49517),v=n(34955),_=n(56361),Z=n(84369),x=n(77307),y=n(61116),A=n(13536),w=n(80922),k=n(86668),T=n(27701),C=n(54275),q=n(24311),U=n(19708),I=n(71765),M=n(47210),O=n(2406),J=n(40450);function P(t,e){1&t&&l._UZ(0,"mat-progress-bar",22)}function N(t,e){1&t&&(l.TgZ(0,"th",23),l._uU(1,"Owner"),l.qZA())}const S=function(t){return{count:t,resource:"biolink(s)"}};function D(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l.TgZ(1,"th",24),l.TgZ(2,"div",25),l._uU(3," :count :resource selected: "),l.qZA(),l.TgZ(4,"div",26),l.TgZ(5,"permission-aware-button",27),l.TgZ(6,"button",28),l.NdJ("click",function(){return l.CHM(t),l.oxw().maybeDeleteSelectedBiolinks()}),l._uU(7," Delete "),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.ngIf;l.xp6(2),l.Q6J("transValues",l.VKq(1,S,t))}}function Q(t,e){if(1&t&&(l.TgZ(0,"td",48),l._UZ(1,"user-column",49),l.qZA()),2&t){const t=l.oxw().$implicit;l.xp6(1),l.Q6J("user",t.user)}}function Y(t,e){1&t&&l._UZ(0,"mat-icon",50)}function L(t,e){1&t&&(l.TgZ(0,"span"),l._uU(1,"-"),l.qZA())}function F(t,e){1&t&&l._UZ(0,"mat-icon",50)}function E(t,e){1&t&&(l.TgZ(0,"span"),l._uU(1,"-"),l.qZA())}const R=function(t){return["/",t]},$=function(t){return[t,"analytics"]},V=function(t){return[t,"edit"]};function B(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l._UZ(1,"td",29),l.TgZ(2,"td",30),l.TgZ(3,"a",31),l._uU(4),l.qZA(),l.qZA(),l.YNc(5,Q,2,1,"td",32),l.TgZ(6,"td",33),l._uU(7),l.qZA(),l.TgZ(8,"td",34),l.YNc(9,Y,1,0,"mat-icon",35),l.YNc(10,L,2,0,"span",19),l.qZA(),l.TgZ(11,"td",36),l.YNc(12,F,1,0,"mat-icon",35),l.YNc(13,E,2,0,"span",19),l.qZA(),l.TgZ(14,"td",37),l._uU(15),l.ALo(16,"formattedDate"),l.qZA(),l.TgZ(17,"td",38),l.TgZ(18,"button",39),l.ALo(19,"trans"),l._UZ(20,"mat-icon",40),l.qZA(),l.TgZ(21,"permission-aware-button",41),l.TgZ(22,"button",42),l.ALo(23,"trans"),l._UZ(24,"mat-icon",43),l.qZA(),l.qZA(),l._UZ(25,"copy-link-btn",44),l.TgZ(26,"permission-aware-button",45),l.TgZ(27,"button",46),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().maybeDeleteSelectedBiolinks([e.id])}),l._UZ(28,"mat-icon",47),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.xp6(1),l.Q6J("table-body-checkbox",t.id),l.xp6(2),l.Q6J("routerLink",l.VKq(22,R,t.hash)),l.xp6(1),l.Oqu(t.name),l.xp6(1),l.Q6J("ngIf",n.showUserColumn()),l.xp6(2),l.Oqu(t.links_count),l.xp6(2),l.Q6J("ngIf",t.active),l.xp6(1),l.Q6J("ngIf",!t.active),l.xp6(2),l.Q6J("ngIf",t.rotator),l.xp6(1),l.Q6J("ngIf",!t.rotator),l.xp6(2),l.Oqu(l.lcZ(16,16,t.updated_at)),l.xp6(3),l.Q6J("routerLink",l.VKq(24,$,t.id))("matTooltip",l.lcZ(19,18,"Analytics")),l.xp6(3),l.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),l.xp6(1),l.Q6J("routerLink",l.VKq(26,V,t.id))("matTooltip",l.lcZ(23,20,"Edit")),l.xp6(3),l.Q6J("model",t)}}function H(t,e){1&t&&(l.TgZ(0,"no-results-message",51),l.TgZ(1,"span",52),l._uU(2,"No biolinks have been created yet"),l.qZA(),l.qZA())}let z=(()=>{class t{constructor(t,e,n,i,a,s,r,l,c,d){this.datatable=t,this.currentUser=e,this.biolinks=n,this.toast=i,this.route=a,this.linkUsage=s,this.activeSection=r,this.workspaces=l,this.modal=c,this.router=d,this.biolinks$=this.datatable.data$,this.filters=o.L}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:r.n.BASE_URI,staticParams:{with:["user"],withCount:["links"],userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}maybeDeleteSelectedBiolinks(t){this.datatable.confirmResourceDeletion("biolinks").subscribe(()=>{this.biolinks.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Biolink deleted")},t=>{this.toast.open(t.message||a.v.Default)})})}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=o.L.filter(t=>"user_id"!==t.key||this.showUserColumn())}openCreateBiolinkModal(){this.modal.open(s.L,{type:"biolink"}).afterClosed().subscribe(t=>{t&&this.router.navigate(["/",this.activeSection.admin?"admin":"dashboard","biolinks",t.id,"edit"])})}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(i.x),l.Y36(c.I),l.Y36(r.n),l.Y36(d.F),l.Y36(u.gz),l.Y36(p.F),l.Y36(g.W),l.Y36(h.b),l.Y36(m.u),l.Y36(u.F0))},t.\u0275cmp=l.Xpm({type:t,selectors:[["biolink-index"]],features:[l._Bn([i.x])],decls:43,vars:12,consts:[[1,"datatable-page-header"],["trans",""],["trans","",1,"title"],[1,"header"],["pluralName","biolinks",3,"filters"],[1,"action-buttons"],["permission","biolinks.create"],["mat-raised-button","","color","accent","trans","",1,"button-with-icon",3,"click"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","user_id","trans","",4,"ngIf"],["table-sort-header","links_count","trans",""],["table-sort-header","public","trans",""],["table-sort-header","rotator","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","marketing.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","user_id","trans",""],["colspan","6"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["permission","biolinks.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["target","_blank",1,"link-group-name",3,"routerLink"],["data-label","Owner",4,"ngIf"],["data-label","Link Count"],["data-label","Public"],["svgIcon","check",4,"ngIf"],["data-label","Rotator"],["data-label","Last Updated"],[1,"edit-column"],["type","button","mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","bar-chart"],["permission","biolinks.update",3,"userOwnsResource"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","edit"],[3,"model"],["permission","biolinks.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgIcon","check"],["svgImage","marketing.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"h1"),l.TgZ(2,"span",1),l._uU(3,"Biolinks"),l.qZA(),l.TgZ(4,"info-popover"),l.TgZ(5,"div",2),l._uU(6,"Link in Bio"),l.qZA(),l.TgZ(7,"div",1),l._uU(8,"Offer multiple choices to your followers when they click on your Biolink. Share all your Social Media profiles, videos, songs, articles and other important links with just one url."),l.qZA(),l.qZA(),l.qZA(),l.TgZ(9,"div",3),l._UZ(10,"datatable-filters",4),l.TgZ(11,"div",5),l.TgZ(12,"permission-aware-button",6),l.TgZ(13,"button",7),l.NdJ("click",function(){return e.openCreateBiolinkModal()}),l._UZ(14,"mat-icon",8),l.TgZ(15,"span",1),l._uU(16,"Add New Biolink"),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.TgZ(17,"div",9),l.YNc(18,P,1,0,"mat-progress-bar",10),l.ALo(19,"async"),l.TgZ(20,"table",11),l.TgZ(21,"thead"),l.TgZ(22,"tr"),l._UZ(23,"th",12),l.TgZ(24,"th",13),l._uU(25,"Name"),l.qZA(),l.YNc(26,N,2,0,"th",14),l.TgZ(27,"th",15),l._uU(28,"Links"),l.qZA(),l.TgZ(29,"th",16),l._uU(30,"Public"),l.qZA(),l.TgZ(31,"th",17),l._uU(32,"Rotator"),l.qZA(),l.TgZ(33,"th",18),l._uU(34,"Last Updated"),l.qZA(),l._UZ(35,"th"),l.qZA(),l.YNc(36,D,8,3,"tr",19),l.qZA(),l.TgZ(37,"tbody"),l.YNc(38,B,29,28,"tr",20),l.ALo(39,"async"),l.qZA(),l.qZA(),l.YNc(40,H,3,0,"no-results-message",21),l.ALo(41,"async"),l._UZ(42,"datatable-footer"),l.qZA()),2&t&&(l.xp6(10),l.Q6J("filters",e.filters),l.xp6(8),l.Q6J("ngIf",l.lcZ(19,6,e.datatable.paginator&&e.datatable.paginator.loading$)),l.xp6(8),l.Q6J("ngIf",e.showUserColumn()),l.xp6(10),l.Q6J("ngIf",e.datatable.selectedRows$.value.length),l.xp6(2),l.Q6J("ngForOf",l.lcZ(39,8,e.biolinks$)),l.xp6(2),l.Q6J("ngIf",l.lcZ(41,10,e.datatable.paginator.noResults$)))},directives:[f.P,b.N,v.h,_.v,Z.lW,x.Hw,y.O5,A.e,w.p,y.sg,k.V,T.pW,C.O,u.yS,u.rH,q.gM,U.b,I.r,M.U],pipes:[y.Ov,O.l,J.R],styles:["h1[_ngcontent-%COMP%]{display:flex;align-items:center}"],changeDetection:0}),t})()},76512:function(t,e,n){"use strict";n.d(e,{n:function(){return o}});var i=n(35366),a=n(68515);let o=(()=>{class t{constructor(t){this.http=t}get(e,n){return this.http.get(`${t.BASE_URI}/${e}`,n)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}detach(e,n){return this.http.post(`${t.BASE_URI}/${e}/detach`,{contentItem:n})}changeOrder(e,n){return this.http.post(`${t.BASE_URI}/${e}/change-order`,{order:n})}analytics(t){return this.http.get(this.analyticsEndpoint(t))}analyticsEndpoint(e){return`${t.BASE_URI}/${e}/analytics`}saveAppearance(e,n){return this.http.post(`${t.BASE_URI}/${e}/appearance`,{config:n})}updateContentItemConfig(e,n,i){return this.http.post(`${t.BASE_URI}/${e}/update-content-config`,Object.assign({item_id:n.id,item_model_type:n.model_type},i))}}return t.BASE_URI="biolink",t.\u0275fac=function(e){return new(e||t)(i.LFG(a.r))},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},93836:function(t,e,n){"use strict";n.d(e,{z:function(){return N}});var i=n(84222),a=n(31041),o=n(43835),s=n(66599),r=n(11520),l=n(79996),c=n(78512),d=n(3080),u=n(83693),p=n(18948),g=n(35366),h=n(78733),m=n(131),f=n(88195),b=n(3950),v=n(68515),_=n(61116),Z=n(42300),x=n(92762),y=n(38116),A=n(92007);const w=["*"];let k=(()=>{class t{constructor(t){this.fb=t,this.setDefaultDate=!1,this.showLabels=!1,this.datePattern="([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]))",this.initiated=!1,this.form=this.fb.group({from:[""],to:[""]}),this.defaultFrom=this.getDefaultDate(7),this.defaultTo=this.getDefaultDate()}writeValue(t){Array.isArray(t)||(t=(t||"").split(":"));let[e,n]=t;!this.initiated&&this.setDefaultDate&&(e=e||this.defaultFrom,n=n||this.defaultTo),this.initiated=!0,this.form.patchValue({from:e,to:n})}registerOnChange(t){this.propagateChange=t,this.form.valueChanges.pipe((0,o.h)(t=>t.from&&t.to)).subscribe(t=>{this.propagateChange(`${t.from}:${t.to}`)})}registerOnTouched(){}getDefaultDate(t=0){const e=new Date;e.setDate(e.getDate()-t);const n=this.addZero(e.getMonth()+1),i=this.addZero(e.getDate());return`${e.getFullYear()}-${n}-${i}`}addZero(t){return t<10?"0"+t:""+t}}return t.\u0275fac=function(e){return new(e||t)(g.Y36(a.qu))},t.\u0275cmp=g.Xpm({type:t,selectors:[["between-input"]],inputs:{setDefaultDate:"setDefaultDate",showLabels:"showLabels"},features:[g._Bn([{provide:a.JU,useExisting:t,multi:!0}])],ngContentSelectors:w,decls:12,vars:9,consts:[[3,"formGroup"],["trans",""],[1,"inline-inputs-container"],[1,"input-container"],["for","from","trans",""],["type","date","id","from","formControlName","from","required","",3,"placeholder","pattern"],["for","to","trans",""],["type","date","id","to","formControlName","to","required","",3,"placeholder","pattern"]],template:function(t,e){1&t&&(g.F$t(),g.TgZ(0,"fieldset",0),g.TgZ(1,"legend",1),g.Hsn(2),g.qZA(),g.TgZ(3,"div",2),g.TgZ(4,"div",3),g.TgZ(5,"label",4),g._uU(6,"From"),g.qZA(),g._UZ(7,"input",5),g.qZA(),g.TgZ(8,"div",3),g.TgZ(9,"label",6),g._uU(10,"To"),g.qZA(),g._UZ(11,"input",7),g.qZA(),g.qZA(),g.qZA()),2&t&&(g.Q6J("formGroup",e.form),g.xp6(5),g.ekj("hidden",!e.showLabels),g.xp6(2),g.Q6J("placeholder",e.defaultFrom)("pattern",e.datePattern),g.xp6(2),g.ekj("hidden",!e.showLabels),g.xp6(2),g.Q6J("placeholder",e.defaultTo)("pattern",e.datePattern))},directives:[a.JL,a.sg,y.P,a.Fj,a.JJ,a.u,a.Q7,a.c5],styles:["legend[_ngcontent-%COMP%]{text-transform:capitalize}legend[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0}),t})();var T=n(84369),C=n(40450);const q=["countryChartPlaceholder"];function U(t,e){if(1&t){const t=g.EpF();g.TgZ(0,"div",31),g._UZ(1,"between-input",32),g.TgZ(2,"button",33),g.NdJ("click",function(){g.CHM(t);const e=g.oxw(2);return e.customRange$.next(e.customRangeControl.value)}),g.ALo(3,"async"),g._uU(4,"Apply"),g.qZA(),g.qZA()}if(2&t){const t=g.oxw(2);g.xp6(1),g.Q6J("formControl",t.customRangeControl),g.xp6(1),g.Q6J("disabled",!g.lcZ(3,2,t.customRangeControl.valueChanges))}}function I(t,e){if(1&t&&(g.TgZ(0,"a",38),g._uU(1),g.qZA()),2&t){const t=g.oxw().$implicit;g.Q6J("href",t.label,g.LSH),g.xp6(1),g.Oqu(t.label)}}function M(t,e){1&t&&(g.TgZ(0,"div",39),g._uU(1,"Direct, Email, SMS"),g.qZA())}function O(t,e){if(1&t&&(g.TgZ(0,"li",34),g.YNc(1,I,2,2,"a",35),g.YNc(2,M,2,0,"ng-template",null,36,g.W1O),g.TgZ(4,"div",37),g._uU(5),g.qZA(),g.qZA()),2&t){const t=e.$implicit,n=g.MAs(3);g.xp6(1),g.Q6J("ngIf",t.label)("ngIfElse",n),g.xp6(4),g.Oqu(t.count)}}function J(t,e){if(1&t&&(g.TgZ(0,"div",40),g.TgZ(1,"span",41),g._uU(2),g.qZA(),g._uU(3),g.qZA()),2&t){const t=e.$implicit;g.xp6(2),g.Oqu(t.label),g.xp6(1),g.hij(" (",t.percentage,"%) ")}}function P(t,e){if(1&t&&(g.ynx(0),g.TgZ(1,"header",2),g.TgZ(2,"mat-button-toggle-group",3),g.TgZ(3,"mat-button-toggle",4),g._uU(4,"Hourly"),g.qZA(),g.TgZ(5,"mat-button-toggle",5),g._uU(6,"Weekly"),g.qZA(),g.TgZ(7,"mat-button-toggle",6),g._uU(8,"Monthly"),g.qZA(),g.TgZ(9,"mat-button-toggle",7),g._uU(10,"Yearly"),g.qZA(),g.TgZ(11,"mat-button-toggle",8),g._uU(12,"Custom"),g.qZA(),g.qZA(),g.YNc(13,U,5,4,"div",9),g.ALo(14,"async"),g.qZA(),g.TgZ(15,"div",10),g.TgZ(16,"div",11),g.TgZ(17,"chart",12),g.TgZ(18,"div",13),g.TgZ(19,"div",14),g.TgZ(20,"div",15),g._uU(21),g.ALo(22,"trans"),g.qZA(),g.TgZ(23,"div",16),g._uU(24),g.ALo(25,"trans"),g.qZA(),g.qZA(),g.qZA(),g.qZA(),g.qZA(),g.TgZ(26,"div",17),g.TgZ(27,"chart",18),g.TgZ(28,"div",19),g.TgZ(29,"div",15),g._uU(30,"Top Devices"),g.qZA(),g.TgZ(31,"div",20),g._uU(32,"Click count by device"),g.qZA(),g.qZA(),g.qZA(),g.qZA(),g.qZA(),g.TgZ(33,"div",10),g.TgZ(34,"div",21),g.TgZ(35,"div",22),g.TgZ(36,"div",19),g.TgZ(37,"div",15),g._uU(38,"Referrers"),g.qZA(),g.TgZ(39,"div",20),g._uU(40,"Click count by referrer"),g.qZA(),g.qZA(),g.TgZ(41,"ul",23),g.YNc(42,O,6,3,"li",24),g.qZA(),g.qZA(),g.qZA(),g.TgZ(43,"div",25),g.TgZ(44,"div",22),g.TgZ(45,"div",19),g.TgZ(46,"div",15),g._uU(47,"Top Locations"),g.qZA(),g.TgZ(48,"div",20),g._uU(49,"Click count by country"),g.qZA(),g.qZA(),g.TgZ(50,"div",26),g._UZ(51,"div",27,28),g.TgZ(53,"div",29),g.YNc(54,J,4,2,"div",30),g.qZA(),g.qZA(),g.qZA(),g.qZA(),g.qZA(),g.TgZ(55,"div",10),g.TgZ(56,"div",17),g.TgZ(57,"chart",18),g.TgZ(58,"div",19),g.TgZ(59,"div",15),g._uU(60,"Top Browsers"),g.qZA(),g.TgZ(61,"div",20),g._uU(62,"Click count by browser"),g.qZA(),g.qZA(),g.qZA(),g.qZA(),g.TgZ(63,"div",17),g.TgZ(64,"chart",18),g.TgZ(65,"div",19),g.TgZ(66,"div",15),g._uU(67,"Top Platforms"),g.qZA(),g.TgZ(68,"div",20),g._uU(69,"Click count by OS"),g.qZA(),g.qZA(),g.qZA(),g.qZA(),g.qZA(),g.BQk()),2&t){const t=e.ngIf,n=g.oxw();g.xp6(2),g.Q6J("formControl",n.range),g.xp6(11),g.Q6J("ngIf","custom"===g.lcZ(14,11,n.range.valueChanges)),g.xp6(4),g.Q6J("chartConfig",t.clicks),g.xp6(4),g.Oqu(g.lcZ(22,13,"Clicks this "+n.getRangeName())),g.xp6(3),g.AsE("",t.totalClicks," ",g.lcZ(25,15,"Total Clicks"),""),g.xp6(3),g.Q6J("chartConfig",t.devices),g.xp6(15),g.Q6J("ngForOf",t.referrers),g.xp6(12),g.Q6J("ngForOf",t.locations),g.xp6(3),g.Q6J("chartConfig",t.browsers),g.xp6(7),g.Q6J("chartConfig",t.platforms)}}let N=(()=>{class t{constructor(t,e,n,o,s){this.loader=t,this.theme=e,this.settings=n,this.i18n=o,this.http=s,this.endpoint=`${i.M.BASE_URI}/analytics`,this.transformedReports$=new c.X({}),this.loading$=new c.X(!1),this.range=new a.NI("weekly"),this.customRangeControl=new a.NI,this.customRange$=new c.X("")}ngOnChanges(t){t.reports&&t.reports.currentValue&&(this.updateCharts(t.reports.currentValue),this.initGoogleWorldMap())}ngOnInit(){(0,d.aj)([this.range.valueChanges,this.customRange$]).pipe((0,o.h)(([t,e])=>"custom"!==t||!!e),(0,s.b)(()=>this.loading$.next(!0))).subscribe(([t,e])=>{this.getUpdateDataRequest(t,e).pipe((0,r.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.updateCharts(t),this.drawGoogleChart()})}),this.theme.selectedTheme$.subscribe(()=>{this.googleChart&&this.drawGoogleChart()})}getRangeName(){return"custom"===this.range.value?"period":this.range.value.replace("ly","")}getUpdateDataRequest(t,e){return this.http.get(this.endpoint,{range:t,customRange:e}).pipe((0,l.U)(t=>(0,p.w)("mainData",t)?t.mainData:t.analytics))}updateCharts(t){const e=Object.assign(Object.assign({},t),{browsers:this.transformData(null==t?void 0:t.browsers,u.o.PIE),platforms:this.transformData(null==t?void 0:t.platforms,u.o.PIE),devices:this.transformData(null==t?void 0:t.devices,u.o.PIE,!0),clicks:this.transformData(null==t?void 0:t.clicks,u.o.LINE)});this.transformedReports$.next(e)}transformData(t,e=u.o.LINE,n=!1){return t?{type:e,labels:t.map(t=>n?this.i18n.t(t.label):t.label),data:e===u.o.LINE?[t.map(t=>t.count)]:t.map(t=>t.count),legend:!1,tooltip:this.i18n.t("Click Count"),options:{showLabel:!0,donut:!0}}:{}}initGoogleWorldMap(){this.loader.loadAsset("https://www.gstatic.com/charts/loader.js",{type:"js"}).then(()=>{const t=window.google;t.charts.load("current",{packages:["geochart"],mapsApiKey:this.settings.get("links.gchart_api_key")}),t.charts.setOnLoadCallback(()=>{this.drawGoogleChart()})})}drawGoogleChart(){const t=window.google;let e=this.transformedReports$.value.locations.map(t=>[t.label,t.count]);e.unshift(["Country","Popularity"]),e=t.visualization.arrayToDataTable(e);const n={colorAxis:{colors:["#4662fa"]},backgroundColor:this.theme.selectedTheme$.value.is_dark?"#1D1D1D":null,datalessRegionColor:this.theme.selectedTheme$.value.is_dark?"#e9ecfe":null};this.googleChart||(this.googleChart=new t.visualization.GeoChart(this.iframe.nativeElement)),this.googleChart.draw(e,n)}}return t.\u0275fac=function(e){return new(e||t)(g.Y36(h.j),g.Y36(m.f),g.Y36(f.Z),g.Y36(b.Z),g.Y36(v.r))},t.\u0275cmp=g.Xpm({type:t,selectors:[["click-charts"]],viewQuery:function(t,e){if(1&t&&g.Gf(q,5),2&t){let t;g.iGM(t=g.CRH())&&(e.iframe=t.first)}},inputs:{reports:"reports",endpoint:"endpoint"},features:[g.TTD],decls:4,vars:6,consts:[[4,"ngIf"],[1,"overlay",3,"isVisible"],[1,"date-header"],[1,"right",3,"formControl"],["value","hourly","trans",""],["value","weekly","trans",""],["value","monthly","trans",""],["value","yearly","trans",""],["value","custom","trans",""],["class","custom-date-container",4,"ngIf"],[1,"chart-row"],[1,"chart-wrapper"],["height","400",1,"clicks-chart",3,"chartConfig"],[1,"chart-header","clicks-chart-header"],[1,"left"],["trans","",1,"title"],[1,"subtitle"],[1,"chart-wrapper","pie-wrapper"],["height","385",3,"chartConfig"],[1,"chart-header"],["trans","",1,"subtitle"],[1,"chart-wrapper","referrers-panel"],[1,"chart"],[1,"unstyled-list"],["class","referrer",4,"ngFor","ngForOf"],[1,"chart-wrapper","locations-panel"],[1,"chart-body"],[1,"country-chart-placeholder"],["countryChartPlaceholder",""],[1,"country-list"],["class","country",4,"ngFor","ngForOf"],[1,"custom-date-container"],[1,"click-charts-date-input",3,"formControl"],["type","button","mat-raised-button","","color","accent","trans","",1,"apply-custom-range-button",3,"disabled","click"],[1,"referrer"],["class","url","target","_blank",3,"href",4,"ngIf","ngIfElse"],["direct",""],[1,"count"],["target","_blank",1,"url",3,"href"],["trans",""],[1,"country"],[1,"country-name"]],template:function(t,e){1&t&&(g.YNc(0,P,70,17,"ng-container",0),g.ALo(1,"async"),g._UZ(2,"loading-indicator",1),g.ALo(3,"async")),2&t&&(g.Q6J("ngIf",g.lcZ(1,2,e.transformedReports$)),g.xp6(2),g.Q6J("isVisible",g.lcZ(3,4,e.loading$)))},directives:[_.O5,Z.Q,x.A9,a.JJ,a.oH,x.Yi,y.P,A.x,_.sg,k,T.lW],pipes:[_.Ov,C.R],styles:["[_nghost-%COMP%]{display:block;overflow:hidden}.clicks-chart[_ngcontent-%COMP%]   .chart-body[_ngcontent-%COMP%]{padding-right:15px}.date-header[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:25px}.custom-date-container[_ngcontent-%COMP%]{display:flex;align-items:center;margin-left:auto}@media only screen and (max-width:845px){.date-header[_ngcontent-%COMP%]{display:block;overflow-x:auto}.custom-date-container[_ngcontent-%COMP%]{margin-top:25px}}  .click-charts-date-input input{background-color:var(--be-background)}.apply-custom-range-button[_ngcontent-%COMP%]{margin-left:10px}.title[_ngcontent-%COMP%]{text-transform:capitalize}.referrers-panel[_ngcontent-%COMP%]{overflow:auto}.referrers-panel[_ngcontent-%COMP%]   .chart-header[_ngcontent-%COMP%]{margin-bottom:5px}.referrers-panel[_ngcontent-%COMP%]   .referrer[_ngcontent-%COMP%]{display:flex;align-items:center;padding:5px 20px}.referrers-panel[_ngcontent-%COMP%]   .count[_ngcontent-%COMP%]{background-color:var(--be-accent-default);color:var(--be-accent-contrast);font-size:1.2rem;padding:5px 10px;border-radius:4px;margin-left:auto;line-height:10px}.referrers-panel[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:85%}.referrers-panel[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{text-decoration:underline}.locations-panel[_ngcontent-%COMP%]{max-width:700px}.locations-panel[_ngcontent-%COMP%]   .chart-body[_ngcontent-%COMP%]{display:flex;padding:0 15px}@media only screen and (max-width:768px){.locations-panel[_ngcontent-%COMP%]{height:auto;max-height:none}.locations-panel[_ngcontent-%COMP%]   .chart-body[_ngcontent-%COMP%]{display:block}.locations-panel[_ngcontent-%COMP%]   .country-list[_ngcontent-%COMP%]{padding:10px 0}}.locations-panel[_ngcontent-%COMP%]   .country-chart-placeholder[_ngcontent-%COMP%]{flex:1 1 auto;height:100%}.locations-panel[_ngcontent-%COMP%]   .country[_ngcontent-%COMP%]{padding:4px 0;white-space:nowrap;overflow:hidden;font-size:1.3rem}.locations-panel[_ngcontent-%COMP%]   .country-name[_ngcontent-%COMP%]{display:inline-block;vertical-align:middle;max-width:150px;overflow:hidden;text-overflow:ellipsis}iframe[_ngcontent-%COMP%]{border:none;width:100%;height:100%}"],changeDetection:0}),t})()},69193:function(t,e,n){"use strict";n.d(e,{a:function(){return g}});var i=n(61116),a=n(20653),o=n(84369),s=n(77307),r=n(92762),l=n(68400),c=n(31041),d=n(99808),u=n(68692),p=n(35366);let g=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=p.oAB({type:t}),t.\u0275inj=p.cJS({imports:[[i.ez,a.m,l.N,c.UX,d.p,u.X,o.ot,s.Ps,r.vV]]}),t})()},66445:function(t,e,n){"use strict";n.r(e),n.d(e,{DashboardModule:function(){return In}});var i=n(61116),a=n(63337),o=n(84698),s=n(25051),r=n(14926),l=n(35366),c=n(36501),d=n(88195),u=n(70549),p=n(95157),g=n(86655),h=n(97070),m=n(36024),f=n(4694),b=n(43835),v=n(72798),_=n(24859),Z=n(28505),x=n(73234),y=n(38116),A=n(77307),w=n(84369),k=n(40450);function T(t,e){1&t&&(l.TgZ(0,"span",12),l._uU(1,"Personal workspace"),l.qZA())}const C=function(t){return{count:t}};function q(t,e){if(1&t&&(l.TgZ(0,"span",12),l._uU(1),l.ALo(2,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(l.xi3(2,1,":count members",l.VKq(4,C,(null==t?null:t.members_count)||0)))}}function U(t,e){if(1&t&&(l.TgZ(0,"div",5),l.TgZ(1,"div",6),l.TgZ(2,"div",7),l._uU(3),l.qZA(),l.TgZ(4,"div",8),l.YNc(5,T,2,0,"span",9),l.YNc(6,q,3,6,"span",9),l.qZA(),l.qZA(),l.TgZ(7,"div",10),l._UZ(8,"mat-icon",11),l.qZA(),l.qZA()),2&t){const t=e.ngIf;l.oxw();const n=l.MAs(3);l.Q6J("matMenuTriggerFor",n),l.xp6(3),l.Oqu(t.name),l.xp6(2),l.Q6J("ngIf",t.default),l.xp6(1),l.Q6J("ngIf",!t.default)}}function I(t,e){1&t&&(l.TgZ(0,"span",12),l._uU(1,"Personal workspace"),l.qZA())}function M(t,e){if(1&t&&(l.TgZ(0,"span",12),l._uU(1),l.ALo(2,"trans"),l.qZA()),2&t){const t=l.oxw().$implicit;l.xp6(1),l.Oqu(l.xi3(2,1,":count members",l.VKq(4,C,(null==t?null:t.members_count)||0)))}}function O(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"button",17),l.NdJ("click",function(e){l.CHM(t);const n=l.oxw().$implicit;return l.oxw().openWorkspaceMembersModal(n),e.stopPropagation()}),l._UZ(1,"mat-icon",18),l.qZA()}}function J(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"div",13),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().selectWorkspace(e)}),l.ALo(1,"async"),l._UZ(2,"mat-icon",14),l.ALo(3,"async"),l.TgZ(4,"div"),l.TgZ(5,"div",15),l._uU(6),l.qZA(),l.TgZ(7,"div",8),l.YNc(8,I,2,0,"span",9),l.YNc(9,M,3,6,"span",9),l.qZA(),l.qZA(),l.YNc(10,O,2,0,"button",16),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.ekj("active",l.lcZ(1,8,n.workspaces.activeId$)===t.id),l.xp6(2),l.ekj("visually-hidden",l.lcZ(3,10,n.workspaces.activeId$)!==t.id),l.xp6(4),l.Oqu(t.name),l.xp6(2),l.Q6J("ngIf",t.default),l.xp6(1),l.Q6J("ngIf",!t.default),l.xp6(1),l.Q6J("ngIf",!t.default)}}function P(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"div",19),l.NdJ("click",function(){return l.CHM(t),l.oxw().openCrupdateWorkspaceModal()}),l._UZ(1,"mat-icon",20),l.TgZ(2,"span",12),l._uU(3,"Create new workspace"),l.qZA(),l.qZA()}}let N=(()=>{class t{constructor(t,e,n,i,a,o){this.modal=t,this.workspaces=e,this.currentUser=n,this.toast=i,this.vcr=a,this.cd=o}ngOnInit(){this.workspaces.indexUserWorkspaces().subscribe()}openCrupdateWorkspaceModal(t){Promise.resolve().then(n.bind(n,75428)).then(e=>{this.modal.open(e.WorkspaceModule.components.crupdateModal,{workspace:t},{viewContainerRef:this.vcr}),this.cd.markForCheck()})}openWorkspaceMembersModal(t){Promise.resolve().then(n.bind(n,75428)).then(e=>{this.modal.open(e.WorkspaceModule.components.manageMembers,{workspace:t},{viewContainerRef:this.vcr}),this.cd.markForCheck(),this.menuTrigger.closeMenu()})}maybeDeleteWorkspace(t){const e=Object.assign(Object.assign({},v.M),{replacements:{resource:"workspace"}});this.modal.open(f.z,e).afterClosed().pipe((0,b.h)(t=>t)).subscribe(()=>{this.workspaces.delete([t.id]).subscribe(()=>{this.toast.open("Workspace deleted.")},t=>{this.toast.open(t.message||m.v.Default)})})}selectWorkspace(t){this.workspaces.select(t.id),this.menuTrigger.closeMenu()}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(_.u),l.Y36(p.b),l.Y36(Z.I),l.Y36(x.F),l.Y36(l.s_b),l.Y36(l.sBO))},t.\u0275cmp=l.Xpm({type:t,selectors:[["workspace-selector"]],viewQuery:function(t,e){if(1&t&&l.Gf(h.p6,5),2&t){let t;l.iGM(t=l.CRH())&&(e.menuTrigger=t.first)}},decls:7,vars:7,consts:[[3,"matMenuTriggerFor",4,"ngIf"],[1,"workspace-menu"],["workspaceMenu","matMenu"],["mat-menu-item","","class","workspace-menu-item",3,"active","click",4,"ngFor","ngForOf"],["mat-menu-item","","class","new-workspace-menu-item",3,"click",4,"ngIf"],[3,"matMenuTriggerFor"],[1,"left"],["trans","",1,"role-name"],[1,"member-count"],["trans","",4,"ngIf"],[1,"right"],["svgIcon","unfold-more"],["trans",""],["mat-menu-item","",1,"workspace-menu-item",3,"click"],["svgIcon","check"],["trans","",1,"name"],["type","button","class","settings-button","mat-icon-button","",3,"click",4,"ngIf"],["type","button","mat-icon-button","",1,"settings-button",3,"click"],["svgIcon","settings"],["mat-menu-item","",1,"new-workspace-menu-item",3,"click"],["svgIcon","add"]],template:function(t,e){1&t&&(l.YNc(0,U,9,4,"div",0),l.ALo(1,"async"),l.TgZ(2,"mat-menu",1,2),l.YNc(4,J,11,12,"div",3),l.ALo(5,"async"),l.YNc(6,P,4,0,"div",4),l.qZA()),2&t&&(l.Q6J("ngIf",l.lcZ(1,3,e.workspaces.activeWorkspace$)),l.xp6(4),l.Q6J("ngForOf",l.lcZ(5,5,e.workspaces.available$)),l.xp6(2),l.Q6J("ngIf",e.currentUser.hasPermission("workspaces.create")))},directives:[i.O5,h.VK,i.sg,h.p6,y.P,A.Hw,h.OP,w.lW],pipes:[i.Ov,k.R],styles:[".mat-menu-trigger[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;cursor:pointer;height:100%}.right[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.role-name[_ngcontent-%COMP%]{font-weight:500;text-transform:capitalize}.workspace-menu-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:normal;min-width:248px;line-height:normal;height:52px}.workspace-menu-item.active[_ngcontent-%COMP%]{color:var(--be-accent-default)}.workspace-menu-item.active[_ngcontent-%COMP%]   .member-count[_ngcontent-%COMP%]{color:inherit}.workspace-menu-item[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{flex-shrink:0;color:inherit}.workspace-menu-item[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{margin-right:10px;flex:1 1 auto;font-size:1.5rem;text-transform:capitalize}.new-workspace-menu-item[_ngcontent-%COMP%]{border-top:1px solid var(--be-divider-default);margin-top:8px;padding-top:4px;font-size:1.5rem}.member-count[_ngcontent-%COMP%]{color:var(--be-secondary-text);font-size:1.3rem}.settings-button[_ngcontent-%COMP%]{margin-left:auto;color:var(--be-secondary-text);width:30px;height:30px;line-height:30px}.settings-button[_ngcontent-%COMP%]:hover{color:var(--be-accent-default)}.settings-button[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{width:18px;height:18px;line-height:18px;margin-right:0}"],changeDetection:0}),t})();var S=n(35944),D=n(2406);function Q(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"number"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.ALo(5,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(l.lcZ(2,1,t.links.used)+" "+l.lcZ(3,3,"out of")+" "+(t.links.total||l.lcZ(4,5,"Unlimited"))+" "+l.lcZ(5,7,"Links"))}}function Y(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"number"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.ALo(5,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(l.lcZ(2,1,t.biolinks.used)+" "+l.lcZ(3,3,"out of")+" "+(t.biolinks.total||l.lcZ(4,5,"Unlimited"))+" "+l.lcZ(5,7,"Biolinks"))}}function L(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"number"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.ALo(5,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(l.lcZ(2,1,t.link_clicks.used)+" "+l.lcZ(3,3,"out of")+" "+(t.link_clicks.total||l.lcZ(4,5,"Unlimited"))+" "+l.lcZ(5,7,"Visitors"))}}function F(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"trans"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.link_overlays.used+" "+l.lcZ(2,1,"out of")+" "+(t.link_overlays.total||l.lcZ(3,3,"Unlimited"))+" "+l.lcZ(4,5,"Link Overlays"))}}function E(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"trans"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.custom_pages.used+" "+l.lcZ(2,1,"out of")+" "+(t.custom_pages.total||l.lcZ(3,3,"Unlimited"))+" "+l.lcZ(4,5,"Custom Link Pages"))}}function R(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"trans"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.custom_domains.used+" "+l.lcZ(2,1,"out of")+" "+(t.custom_domains.total||l.lcZ(3,3,"Unlimited"))+" "+l.lcZ(4,5,"Custom Domains"))}}function $(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"number"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.ALo(5,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(l.lcZ(2,1,t.link_groups.used)+" "+l.lcZ(3,3,"out of")+" "+(t.link_groups.total||l.lcZ(4,5,"Unlimited"))+" "+l.lcZ(5,7,"Link Groups"))}}function V(t,e){if(1&t&&(l.TgZ(0,"li"),l._uU(1),l.ALo(2,"trans"),l.ALo(3,"trans"),l.ALo(4,"trans"),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.tracking_pixels.used+" "+l.lcZ(2,1,"out of")+" "+(t.tracking_pixels.total||l.lcZ(3,3,"Unlimited"))+" "+l.lcZ(4,5,"Tracking Pixels"))}}function B(t,e){if(1&t&&(l.TgZ(0,"ul",4),l.YNc(1,Q,6,9,"li",5),l.YNc(2,Y,6,9,"li",5),l.YNc(3,L,6,9,"li",5),l.YNc(4,F,5,7,"li",5),l.YNc(5,E,5,7,"li",5),l.YNc(6,R,5,7,"li",5),l.YNc(7,$,6,9,"li",5),l.YNc(8,V,5,7,"li",5),l.qZA()),2&t){const t=e.ngIf;l.xp6(1),l.Q6J("ngIf",t.links.create),l.xp6(1),l.Q6J("ngIf",t.biolinks.create),l.xp6(1),l.Q6J("ngIf",t.link_clicks.create),l.xp6(1),l.Q6J("ngIf",t.link_overlays.create),l.xp6(1),l.Q6J("ngIf",t.custom_pages.create),l.xp6(1),l.Q6J("ngIf",t.custom_domains.create),l.xp6(1),l.Q6J("ngIf",t.link_groups.create),l.xp6(1),l.Q6J("ngIf",t.tracking_pixels.create)}}let H=(()=>{class t{constructor(t,e){this.linkUsage=t,this.currentUser=e}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(c.F),l.Y36(Z.I))},t.\u0275cmp=l.Xpm({type:t,selectors:[["link-usage-info"]],decls:12,vars:15,consts:[[1,"header"],[1,"current-plan"],[1,"next-payment"],["class","unstyled-list",4,"ngIf"],[1,"unstyled-list"],[4,"ngIf"]],template:function(t,e){if(1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"div",1),l._uU(2),l.ALo(3,"trans"),l.ALo(4,"trans"),l.qZA(),l.TgZ(5,"div",2),l._uU(6),l.ALo(7,"trans"),l.ALo(8,"formattedDate"),l.ALo(9,"trans"),l.qZA(),l.qZA(),l.YNc(10,B,9,8,"ul",3),l.ALo(11,"async")),2&t){let t,n;l.xp6(2),l.hij(" ",l.lcZ(3,3,"Current Plan")+": "+((null==(t=e.currentUser.getSubscription())||null==t.plan?null:t.plan.name)||l.lcZ(4,5,"Free"))," "),l.xp6(4),l.hij(" ",l.lcZ(7,7,"Next Payment")+": "+(l.lcZ(8,9,null==(n=e.currentUser.getSubscription())?null:n.renews_at)||l.lcZ(9,11,"Never"))," "),l.xp6(4),l.Q6J("ngIf",l.lcZ(11,13,e.linkUsage.response$).usage)}},directives:[i.O5],pipes:[k.R,D.l,i.Ov,i.JJ],styles:["[_nghost-%COMP%]{display:block;background-color:var(--be-background);box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);border-radius:4px;padding:15px}.header[_ngcontent-%COMP%]{margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid var(--be-divider-lighter)}.current-plan[_ngcontent-%COMP%]{font-weight:500;font-size:1.5rem}.next-payment[_ngcontent-%COMP%]{font-size:1.3rem;color:var(--be-secondary-text)}li[_ngcontent-%COMP%]{padding:5px 0;font-size:1.5rem}"],changeDetection:0}),t})();var z=n(72674),G=n(98979),j=n(27701);const X=["infoIcon"],W=function(t,e){return{number:t,total:e}};function K(t,e){if(1&t){const t=l.EpF();l.ynx(0),l._UZ(1,"mat-progress-bar",6),l.TgZ(2,"div",7),l.TgZ(3,"div",8),l.ALo(4,"number"),l.ALo(5,"trans"),l.ALo(6,"number"),l._uU(7," :number of :total links created "),l.qZA(),l.TgZ(8,"mat-icon",9,10),l.NdJ("click",function(){return l.CHM(t),l.oxw(3).togglePopover()})("mouseenter",function(){return l.CHM(t),l.oxw(3).openPopover()})("mouseleave",function(){return l.CHM(t),l.oxw(3).closePopover()}),l.qZA(),l.qZA(),l.BQk()}if(2&t){const t=l.oxw().ngIf;l.xp6(1),l.Q6J("value",t.usage.links.used/t.usage.links.total*100),l.xp6(2),l.Q6J("transValues",l.WLB(8,W,l.lcZ(4,2,t.usage.links.used),l.lcZ(5,4,l.lcZ(6,6,t.usage.links.total)||"Unlimited")))}}function tt(t,e){1&t&&(l.TgZ(0,"a",11),l._uU(1,"Upgrade Account"),l.qZA())}function et(t,e){1&t&&(l.TgZ(0,"a",12),l._uU(1,"Upgrade"),l.qZA())}function nt(t,e){if(1&t&&(l.TgZ(0,"div",2),l.YNc(1,K,10,11,"ng-container",0),l.TgZ(2,"div",3),l.YNc(3,tt,2,0,"a",4),l.YNc(4,et,2,0,"a",5),l.qZA(),l.qZA()),2&t){const t=e.ngIf,n=l.oxw(2);l.xp6(1),l.Q6J("ngIf",t.usage.links),l.xp6(2),l.Q6J("ngIf",!n.compact),l.xp6(1),l.Q6J("ngIf",n.compact)}}function it(t,e){if(1&t&&(l.ynx(0),l.YNc(1,nt,5,3,"div",1),l.ALo(2,"async"),l.BQk()),2&t){const t=l.oxw();l.xp6(1),l.Q6J("ngIf",l.lcZ(2,1,t.linkUsage.response$))}}let at=(()=>{class t{constructor(t,e,n,i){this.settings=t,this.linkUsage=e,this.currentUser=n,this.overlay=i,this.compact=!1}ngOnInit(){this.linkUsage.reload()}openPopover(){this.overlayRef&&this.closePopover(),Object.assign({},z.Z)[0].offsetY=-15,this.overlayRef=this.overlay.open(H,{origin:this.infoIcon,position:z.Z,hasBackdrop:!1})}closePopover(){this.overlayRef&&this.overlayRef.close(),this.overlayRef=null}togglePopover(){this.overlayRef?this.closePopover():this.openPopover()}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(d.Z),l.Y36(c.F),l.Y36(Z.I),l.Y36(G.T))},t.\u0275cmp=l.Xpm({type:t,selectors:[["upgrade-panel"]],viewQuery:function(t,e){if(1&t&&l.Gf(X,5,l.SBq),2&t){let t;l.iGM(t=l.CRH())&&(e.infoIcon=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&l.ekj("compact",e.compact)},inputs:{compact:"compact"},decls:1,vars:1,consts:[[4,"ngIf"],["class","upgrade-panel",4,"ngIf"],[1,"upgrade-panel"],[1,"upgrade-link-container"],["routerLink","/billing/upgrade","target","_blank","trans","",4,"ngIf"],["routerLink","/billing/upgrade","class","compact-link","target","_blank","trans","",4,"ngIf"],["mode","determinate","color","accent",3,"value"],[1,"usage-info"],["trans","",1,"text",3,"transValues"],["svgIcon","info",1,"info-icon",3,"click","mouseenter","mouseleave"],["infoIcon",""],["routerLink","/billing/upgrade","target","_blank","trans",""],["routerLink","/billing/upgrade","target","_blank","trans","",1,"compact-link"]],template:function(t,e){1&t&&l.YNc(0,it,3,3,"ng-container",0),2&t&&l.Q6J("ngIf",e.settings.get("billing.enable"))},directives:[i.O5,j.pW,y.P,A.Hw,a.yS],pipes:[i.Ov,i.JJ,k.R],styles:["[_nghost-%COMP%]{margin-top:auto;padding:15px 15px 0}.usage-info[_ngcontent-%COMP%]{display:flex;align-items:center;margin:5px 0;font-size:1.3rem;color:var(--be-secondary-text)}.usage-info[_ngcontent-%COMP%]   .info-icon[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0;width:18px;height:18px}.usage-info[_ngcontent-%COMP%]   .info-icon[_ngcontent-%COMP%]:hover{color:var(--be-primary-default)}.compact[_nghost-%COMP%], .compact   [_nghost-%COMP%]{padding:15px 5px 0}.compact[_nghost-%COMP%]   .mat-progress-bar[_ngcontent-%COMP%], .compact   [_nghost-%COMP%]   .mat-progress-bar[_ngcontent-%COMP%]{display:none}.compact[_nghost-%COMP%]   .text[_ngcontent-%COMP%], .compact   [_nghost-%COMP%]   .text[_ngcontent-%COMP%]{display:none}.compact[_nghost-%COMP%]   .info-icon[_ngcontent-%COMP%], .compact   [_nghost-%COMP%]   .info-icon[_ngcontent-%COMP%]{margin-right:auto}.compact[_nghost-%COMP%]   .link-container[_ngcontent-%COMP%], .compact   [_nghost-%COMP%]   .link-container[_ngcontent-%COMP%]{text-align:center;font-size:1.3rem}"],changeDetection:0}),t})();var ot=n(60467),st=n(30307);function rt(t,e){1&t&&l._UZ(0,"app-footer")}let lt=(()=>{class t{constructor(t,e,n,i){this.linkUsage=t,this.settings=e,this.notifications=n,this.workspaces=i,this.subscriptions=[]}ngOnInit(){this.bindToNotificationClick(),this.bindToWorkspaceChange()}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}onPageChange(t){this.activePage=t}bindToWorkspaceChange(){const t=this.workspaces.activeId$.pipe((0,o.T)(1)).subscribe(()=>{var t;null===(t=this.activePage.datatable)||void 0===t||t.reset(),this.linkUsage.reload()});this.subscriptions.push(t)}bindToNotificationClick(){const t=this.workspaces.bindToNotificationClick();this.subscriptions.push(t)}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(c.F),l.Y36(d.Z),l.Y36(u.g),l.Y36(p.b))},t.\u0275cmp=l.Xpm({type:t,selectors:[["dashboard-host"]],viewQuery:function(t,e){if(1&t&&l.Gf(r._,7),2&t){let t;l.iGM(t=l.CRH())&&(e.sidenav=t.first)}},features:[l._Bn([s.l])],decls:13,vars:9,consts:[["menuPosition","dashboard-navbar",3,"showToggleButton","toggleButtonClick"],["position","dashboard-sidebar",1,"vertical",3,"vertical","compact"],[3,"compact"],["slot","ads.dashboard.top"],[1,"dashboard-page"],[3,"activate"],[4,"ngIf"]],template:function(t,e){1&t&&(l.TgZ(0,"material-navbar",0),l.NdJ("toggleButtonClick",function(){return e.sidenav.toggleSidebarMode()}),l._UZ(1,"workspace-selector"),l.qZA(),l.TgZ(2,"sidenav"),l.TgZ(3,"nav"),l._UZ(4,"custom-menu",1),l.ALo(5,"async"),l._UZ(6,"upgrade-panel",2),l.ALo(7,"async"),l.qZA(),l.TgZ(8,"main"),l._UZ(9,"ad-host",3),l.TgZ(10,"div",4),l.TgZ(11,"router-outlet",5),l.NdJ("activate",function(t){return e.onPageChange(t)}),l.qZA(),l.qZA(),l.YNc(12,rt,1,0,"app-footer",6),l.qZA(),l.qZA()),2&t&&(l.Q6J("showToggleButton",!0),l.xp6(4),l.Q6J("vertical",!0)("compact",l.lcZ(5,5,e.sidenav.isCompact$)),l.xp6(2),l.Q6J("compact",l.lcZ(7,7,e.sidenav.isCompact$)),l.xp6(6),l.Q6J("ngIf",e.settings.get("links.dash_footer")))},directives:[g.e,N,r._,S.K,at,ot.i,a.lC,i.O5,st.q],pipes:[i.Ov],styles:["material-navbar[_ngcontent-%COMP%]{position:fixed;top:0;left:0;z-index:2}workspace-selector[_ngcontent-%COMP%]{min-width:200px;height:100%;margin-left:5px;margin-right:auto;border-left:1px solid hsla(0,0%,100%,.12);border-right:1px solid hsla(0,0%,100%,.12);padding:0 15px}workspace-selector[_ngcontent-%COMP%]     .member-count{color:hsla(0,0%,100%,.7)}@media only screen and (max-width:768px){workspace-selector[_ngcontent-%COMP%]{display:none}}@media only screen and (min-width:768px){material-navbar[_ngcontent-%COMP%]     .right-side-actions{margin-left:0}}.ads-dashboard-top-host[_ngcontent-%COMP%]{margin-bottom:25px}.dashboard-page[_ngcontent-%COMP%]{flex:1 1 auto;padding:25px}@media only screen and (max-width:768px){.dashboard-page[_ngcontent-%COMP%]{padding:15px}}app-footer[_ngcontent-%COMP%]{background-color:var(--be-background);padding:30px;border-top:1px solid var(--be-divider-default)}"],changeDetection:0}),t})();var ct=n(32656),dt=n(4886),ut=n(92890),pt=n(47727),gt=n(73982),ht=n(34056),mt=n(40878),ft=n(68515),bt=n(84222);let vt=(()=>{class t{constructor(t,e,n){this.router=t,this.http=e,this.link=n}resolve(t,e){return this.link.getCurrentUserReports().pipe((0,pt.K)(()=>(this.router.navigate(["/dashboard"]),ht.E)),(0,gt.zg)(t=>t?(0,mt.of)(t.analytics):(this.router.navigate(["/dashboard"]),ht.E)))}}return t.\u0275fac=function(e){return new(e||t)(l.LFG(a.F0),l.LFG(ft.r),l.LFG(bt.M))},t.\u0275prov=l.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var _t=n(78512),Zt=n(93836);let xt=(()=>{class t{constructor(t,e,n){this.route=t,this.workspaces=e,this.links=n,this.reports$=new _t.X(null)}ngOnInit(){this.route.data.subscribe(t=>{this.reports$.next(t.reports)}),this.workspaceSub=this.workspaces.activeId$.pipe((0,o.T)(1)).subscribe(()=>{this.links.getCurrentUserReports().subscribe(t=>{this.reports$.next(t.analytics)})})}ngOnDestroy(){this.workspaceSub.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(a.gz),l.Y36(p.b),l.Y36(bt.M))},t.\u0275cmp=l.Xpm({type:t,selectors:[["dashboard-home"]],decls:2,vars:3,consts:[[3,"reports"]],template:function(t,e){1&t&&(l._UZ(0,"click-charts",0),l.ALo(1,"async")),2&t&&l.Q6J("reports",l.lcZ(1,1,e.reports$))},directives:[Zt.z],pipes:[i.Ov],styles:[""],changeDetection:0}),t})();var yt=n(45905),At=n(80773),wt=n(75950),kt=n(45362),Tt=n(99208),Ct=n(71453),qt=n(56515),Ut=n(14732),It=n(83381),Mt=n(48865),Ot=n(34955),Jt=n(56361),Pt=n(13536),Nt=n(80922),St=n(86668),Dt=n(54275),Qt=n(24311),Yt=n(71765),Lt=n(47210),Ft=n(40985);function Et(t,e){1&t&&l._UZ(0,"mat-progress-bar",18)}function Rt(t,e){1&t&&(l.TgZ(0,"th",19),l._uU(1,"Owner"),l.qZA())}const $t=function(t){return{count:t,resource:"domain(s)"}};function Vt(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l.TgZ(1,"th",20),l.TgZ(2,"div",21),l._uU(3," :count :resource selected: "),l.qZA(),l.TgZ(4,"div",22),l.TgZ(5,"permission-aware-button",23),l.TgZ(6,"button",24),l.NdJ("click",function(){return l.CHM(t),l.oxw().maybeDeleteSelectedDomains()}),l._uU(7," Delete "),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.ngIf;l.xp6(2),l.Q6J("transValues",l.VKq(1,$t,t))}}function Bt(t,e){if(1&t&&(l.TgZ(0,"td",37),l._UZ(1,"user-column",38),l.qZA()),2&t){const t=l.oxw().$implicit;l.xp6(1),l.Q6J("user",t.user)}}function Ht(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l._UZ(1,"td",25),l.TgZ(2,"td",26),l._UZ(3,"img",27),l.ALo(4,"favicon"),l.TgZ(5,"span"),l._uU(6),l.qZA(),l.qZA(),l.YNc(7,Bt,2,1,"td",28),l.TgZ(8,"td",29),l._uU(9),l.ALo(10,"formattedDate"),l.qZA(),l.TgZ(11,"td",30),l.TgZ(12,"permission-aware-button",31),l.TgZ(13,"button",32),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().showCrupdateDomainModal(e)}),l.ALo(14,"trans"),l._UZ(15,"mat-icon",33),l.qZA(),l.qZA(),l.TgZ(16,"permission-aware-button",34),l.TgZ(17,"button",35),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().maybeDeleteSelectedDomains([e.id])}),l._UZ(18,"mat-icon",36),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.xp6(1),l.Q6J("table-body-checkbox",t.id),l.xp6(2),l.Q6J("src",l.lcZ(4,7,t.host),l.LSH),l.xp6(3),l.Oqu(t.host),l.xp6(1),l.Q6J("ngIf",n.showUserColumn()),l.xp6(2),l.Oqu(l.lcZ(10,9,t.updated_at)),l.xp6(3),l.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),l.xp6(1),l.Q6J("matTooltip",l.lcZ(14,11,"Edit domain"))}}function zt(t,e){1&t&&(l.TgZ(0,"no-results-message",39),l.TgZ(1,"span",40),l._uU(2,"No custom domains have been added yet"),l.qZA(),l.qZA())}let Gt=(()=>{class t extends Ct.T{constructor(t,e,n,i,a,o,s,r){super(t,e,n,i,a),this.datatable=t,this.currentUser=e,this.customDomains=n,this.toast=i,this.router=a,this.route=o,this.workspaces=s,this.activeSection=r}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:Ut.c.BASE_URI,staticParams:{userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=It.r.filter(t=>("user_id"!==t.key||this.showUserColumn())&&"global"!==t.key)}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(qt.x),l.Y36(Z.I),l.Y36(Ut.c),l.Y36(x.F),l.Y36(a.F0),l.Y36(a.gz),l.Y36(p.b),l.Y36(Mt.W))},t.\u0275cmp=l.Xpm({type:t,selectors:[["link-domain"]],features:[l._Bn([qt.x]),l.qOj],decls:31,vars:12,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","domains",3,"filters"],[1,"action-buttons"],["permission","custom_domains.create"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","user_id","trans","",4,"ngIf"],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","custom-domain.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","user_id","trans",""],["colspan","5"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["permission","custom_domains.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Host"],["alt","",1,"favicon-img",3,"src"],["data-label","Owner",4,"ngIf"],["data-label","Updated At"],[1,"edit-column"],["permission","custom_domains.update",3,"userOwnsResource"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["permission","custom_domains.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgImage","custom-domain.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"h1",1),l._uU(2,"Custom Domains"),l.qZA(),l.TgZ(3,"div",2),l._UZ(4,"datatable-filters",3),l.TgZ(5,"div",4),l.TgZ(6,"permission-aware-button",5),l.TgZ(7,"button",6),l.NdJ("click",function(){return e.showCrupdateDomainModal()}),l._UZ(8,"mat-icon",7),l.TgZ(9,"span",1),l._uU(10,"Connect New Domain"),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.TgZ(11,"div",8),l.YNc(12,Et,1,0,"mat-progress-bar",9),l.ALo(13,"async"),l.TgZ(14,"table",10),l.TgZ(15,"thead"),l.TgZ(16,"tr"),l._UZ(17,"th",11),l.TgZ(18,"th",12),l._uU(19,"Host"),l.qZA(),l.YNc(20,Rt,2,0,"th",13),l.TgZ(21,"th",14),l._uU(22,"Last Updated"),l.qZA(),l._UZ(23,"th"),l.qZA(),l.YNc(24,Vt,8,3,"tr",15),l.qZA(),l.TgZ(25,"tbody"),l.YNc(26,Ht,19,13,"tr",16),l.ALo(27,"async"),l.qZA(),l.qZA(),l.YNc(28,zt,3,0,"no-results-message",17),l.ALo(29,"async"),l._UZ(30,"datatable-footer"),l.qZA()),2&t&&(l.xp6(4),l.Q6J("filters",e.filters),l.xp6(8),l.Q6J("ngIf",l.lcZ(13,6,e.datatable.paginator&&e.datatable.paginator.loading$)),l.xp6(8),l.Q6J("ngIf",e.showUserColumn()),l.xp6(4),l.Q6J("ngIf",e.datatable.selectedRows$.value.length),l.xp6(2),l.Q6J("ngForOf",l.lcZ(27,8,e.domains$)),l.xp6(2),l.Q6J("ngIf",l.lcZ(29,10,e.datatable.paginator.noResults$)))},directives:[y.P,Ot.h,Jt.v,w.lW,A.Hw,i.O5,Pt.e,Nt.p,i.sg,St.V,j.pW,Dt.O,Qt.gM,Yt.r,Lt.U],pipes:[i.Ov,Ft.K,D.l,k.R],styles:[".favicon-img[_ngcontent-%COMP%]{display:inline-block;margin-right:5px;vertical-align:middle;flex-shrink:0}"],changeDetection:0}),t})();var jt=n(34384),Xt=n(8889),Wt=n(98034),Kt=n(4954),te=n(38053);function ee(t,e){1&t&&l._UZ(0,"mat-progress-bar",19)}function ne(t,e){1&t&&(l.TgZ(0,"th",12),l._uU(1,"Owner"),l.qZA())}function ie(t,e){1&t&&(l.TgZ(0,"th",20),l._uU(1,"Type"),l.qZA())}const ae=function(t){return{count:t,resource:"page(s)"}};function oe(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l.TgZ(1,"th",21),l.TgZ(2,"div",22),l._uU(3," :count :resource selected: "),l.qZA(),l.TgZ(4,"div",23),l.TgZ(5,"button",24),l.NdJ("click",function(){return l.CHM(t),l.oxw().maybeDeleteSelectedPages()}),l._uU(6," Delete "),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.ngIf;l.xp6(2),l.Q6J("transValues",l.VKq(1,ae,t))}}function se(t,e){if(1&t&&(l.TgZ(0,"td",39),l._UZ(1,"user-column",40),l.qZA()),2&t){const t=l.oxw().$implicit;l.xp6(1),l.Q6J("user",t.user)}}function re(t,e){if(1&t&&(l.TgZ(0,"td",41),l._uU(1),l.qZA()),2&t){const t=l.oxw().$implicit,e=l.oxw();l.xp6(1),l.hij(" ",t.type?e.viewName(t.type):"default"," ")}}const le=function(t){return[t,"edit"]};function ce(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l._UZ(1,"td",25),l.TgZ(2,"td",26),l.TgZ(3,"a",27),l._uU(4),l.qZA(),l.qZA(),l.YNc(5,se,2,1,"td",28),l.TgZ(6,"td",29),l._uU(7),l.qZA(),l.YNc(8,re,2,1,"td",30),l.TgZ(9,"td",31),l._uU(10),l.ALo(11,"formattedDate"),l.qZA(),l.TgZ(12,"td",32),l.TgZ(13,"permission-aware-button",33),l.TgZ(14,"button",34),l.ALo(15,"trans"),l._UZ(16,"mat-icon",35),l.qZA(),l.qZA(),l.TgZ(17,"permission-aware-button",36),l.TgZ(18,"button",37),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().maybeDeleteSelectedPages([e.id])}),l._UZ(19,"mat-icon",38),l.qZA(),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.xp6(1),l.Q6J("table-body-checkbox",t.id),l.xp6(2),l.Q6J("href",n.getPageUrl(t),l.LSH),l.xp6(1),l.Oqu(t.slug),l.xp6(1),l.Q6J("ngIf",n.showUserColumn()),l.xp6(2),l.Oqu(t.body),l.xp6(1),l.Q6J("ngIf",!n.endpoint),l.xp6(2),l.Oqu(l.lcZ(11,10,t.updated_at)),l.xp6(3),l.Q6J("userOwnsResource",t.user_id===n.currentUser.get("id")),l.xp6(1),l.Q6J("routerLink",l.VKq(14,le,t.id))("matTooltip",l.lcZ(15,12,"Edit page"))}}function de(t,e){1&t&&(l.TgZ(0,"no-results-message",42),l.TgZ(1,"span",43),l._uU(2,"No pages have been created yet"),l.qZA(),l.qZA())}let ue=(()=>{class t extends Wt.c{constructor(t,e,n,i,a,o,s,r,l){super(t,e,n,i,a,o,s),this.settings=t,this.datatable=e,this.currentUser=n,this.customPages=i,this.toast=a,this.router=o,this.route=s,this.workspaces=r,this.activeSection=l}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:"link-page",staticParams:{with:["user"],userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=Kt.I.filter(t=>"user_id"!==t.key||this.showUserColumn())}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(d.Z),l.Y36(qt.x),l.Y36(Z.I),l.Y36(te.i),l.Y36(x.F),l.Y36(a.F0),l.Y36(a.gz),l.Y36(p.b),l.Y36(Mt.W))},t.\u0275cmp=l.Xpm({type:t,selectors:[["link-page-index"]],features:[l._Bn([qt.x]),l.qOj],decls:35,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","pages",3,"filters"],[1,"action-buttons"],["permission","custom_pages.create"],["mat-raised-button","","color","accent","routerLink","new",1,"button-with-icon"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","","trans","",4,"ngIf"],["trans","",1,"body-column"],["class","type-column","table-sort-header","","trans","",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","custom-page.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","","trans","",1,"type-column"],["colspan","7"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Slug"],["target","_blank",3,"href"],["data-label","Owner",4,"ngIf"],["data-label","Body",1,"body-column"],["data-label","Type","class","type-column",4,"ngIf"],["data-label","Last Updated"],[1,"edit-column"],["permission","custom_pages.update",3,"userOwnsResource"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","edit"],["permission","custom_pages.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["data-label","Type",1,"type-column"],["svgImage","custom-page.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"h1",1),l.TgZ(2,"span",1),l._uU(3,"Link Pages"),l.qZA(),l.qZA(),l.TgZ(4,"div",2),l._UZ(5,"datatable-filters",3),l.TgZ(6,"div",4),l.TgZ(7,"permission-aware-button",5),l.TgZ(8,"button",6),l._UZ(9,"mat-icon",7),l.TgZ(10,"span",1),l._uU(11,"Add New Page"),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.qZA(),l.TgZ(12,"div",8),l.YNc(13,ee,1,0,"mat-progress-bar",9),l.ALo(14,"async"),l.TgZ(15,"table",10),l.TgZ(16,"thead"),l.TgZ(17,"tr"),l._UZ(18,"th",11),l.TgZ(19,"th",12),l._uU(20,"Slug"),l.qZA(),l.YNc(21,ne,2,0,"th",13),l.TgZ(22,"th",14),l._uU(23,"Body"),l.qZA(),l.YNc(24,ie,2,0,"th",15),l.TgZ(25,"th",1),l._uU(26,"Last Updated"),l.qZA(),l._UZ(27,"th"),l.qZA(),l.YNc(28,oe,7,3,"tr",16),l.qZA(),l.TgZ(29,"tbody"),l.YNc(30,ce,20,16,"tr",17),l.ALo(31,"async"),l.qZA(),l.qZA(),l.YNc(32,de,3,0,"no-results-message",18),l.ALo(33,"async"),l._UZ(34,"datatable-footer"),l.qZA()),2&t&&(l.xp6(5),l.Q6J("filters",e.filters),l.xp6(8),l.Q6J("ngIf",l.lcZ(14,7,e.datatable.paginator&&e.datatable.paginator.loading$)),l.xp6(8),l.Q6J("ngIf",e.showUserColumn()),l.xp6(3),l.Q6J("ngIf",!e.endpoint),l.xp6(4),l.Q6J("ngIf",e.datatable.selectedRows$.value.length),l.xp6(2),l.Q6J("ngForOf",l.lcZ(31,9,e.pages$)),l.xp6(2),l.Q6J("ngIf",l.lcZ(33,11,e.datatable.paginator.noResults$)))},directives:[y.P,Ot.h,Jt.v,w.lW,a.rH,A.Hw,i.O5,Pt.e,Nt.p,i.sg,St.V,j.pW,Dt.O,Qt.gM,Yt.r,Lt.U],pipes:[i.Ov,D.l,k.R],styles:[".body-column[_ngcontent-%COMP%]{margin-right:25px;overflow:hidden}.type-column[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),t})();var pe=n(20237),ge=n(36957),he=n(36402);let me=(()=>{class t{constructor(t,e,n,i){this.currentUser=t,this.router=e,this.workspaces=n,this.localStorage=i}canActivate(t,e){return this.handle()}canActivateChild(t,e){return this.handle()}canLoad(t){return this.handle()}handle(){return!(this.currentUser.isLoggedIn()&&!this.currentUser.isSubscribed()&&!this.workspaces.activeId$.value&&this.localStorage.get(ge.b)&&(this.localStorage.remove(ge.b),this.router.navigate(["/billing/upgrade"]),1))}}return t.\u0275fac=function(e){return new(e||t)(l.LFG(Z.I),l.LFG(a.F0),l.LFG(p.b),l.LFG(he.m))},t.\u0275prov=l.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var fe=n(12440),be=n(77044),ve=n(75183);const _e=new l.OlP("WORKSPACE_CONFIG");var Ze=n(49517);function xe(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"button",13),l.NdJ("click",function(){return l.CHM(t),l.oxw().showCrupdateWorkspaceModal()}),l._UZ(1,"mat-icon",14),l.TgZ(2,"span",1),l._uU(3,"Add New Workspace"),l.qZA(),l.qZA()}}function ye(t,e){if(1&t){const t=l.EpF();l.ynx(0),l.TgZ(1,"button",22),l.NdJ("click",function(){l.CHM(t);const e=l.oxw().$implicit;return l.oxw().showCrupdateWorkspaceModal(e)}),l.ALo(2,"trans"),l._UZ(3,"mat-icon",25),l.qZA(),l.TgZ(4,"button",22),l.NdJ("click",function(){l.CHM(t);const e=l.oxw().$implicit;return l.oxw().maybeDeleteWorkspace(e)}),l.ALo(5,"trans"),l._UZ(6,"mat-icon",26),l.qZA(),l.BQk()}2&t&&(l.xp6(1),l.Q6J("matTooltip",l.lcZ(2,2,"Edit workspace")),l.xp6(3),l.Q6J("matTooltip",l.lcZ(5,4,"Delete workspace")))}function Ae(t,e){if(1&t){const t=l.EpF();l.ynx(0),l.TgZ(1,"button",22),l.NdJ("click",function(){l.CHM(t);const e=l.oxw().$implicit;return l.oxw().maybeLeaveWorkspace(e)}),l.ALo(2,"trans"),l._UZ(3,"mat-icon",27),l.qZA(),l.BQk()}2&t&&(l.xp6(1),l.Q6J("matTooltip",l.lcZ(2,1,"Leave workspace")))}function we(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"tr"),l.TgZ(1,"td",15),l._uU(2),l.qZA(),l.TgZ(3,"td",16),l._UZ(4,"user-column",17),l.qZA(),l.TgZ(5,"td",18),l._uU(6),l.qZA(),l.TgZ(7,"td",19),l._uU(8),l.qZA(),l.TgZ(9,"td",20),l._uU(10),l.ALo(11,"formattedDate"),l.qZA(),l.TgZ(12,"td",21),l.TgZ(13,"button",22),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().openWorkspaceMembersModal(e)}),l.ALo(14,"trans"),l._UZ(15,"mat-icon",23),l.qZA(),l.YNc(16,ye,7,6,"ng-container",24),l.YNc(17,Ae,4,3,"ng-container",24),l.qZA(),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.xp6(2),l.Oqu(t.name),l.xp6(2),l.Q6J("user",t.owner),l.xp6(2),l.Oqu((null==t.currentUser?null:t.currentUser.role_name)||"-"),l.xp6(2),l.Oqu(t.members_count||"-"),l.xp6(2),l.Oqu(l.lcZ(11,8,t.updated_at)),l.xp6(3),l.Q6J("matTooltip",l.lcZ(14,10,"Manage Members")),l.xp6(3),l.Q6J("ngIf",t.owner_id===n.currentUser.get("id")),l.xp6(1),l.Q6J("ngIf",t.owner_id!==n.currentUser.get("id"))}}function ke(t,e){1&t&&(l.TgZ(0,"no-results-message",28),l.TgZ(1,"span",29),l._uU(2,"No workspaces have been created yet"),l.qZA(),l.qZA())}let Te=(()=>{class t{constructor(t,e,n,i,a,o,s){this.datatable=t,this.currentUser=e,this.workspaces=n,this.toast=i,this.router=a,this.modal=o,this.workspaceConfig=s,this.workspaces$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:p.b.BASE_URI,staticParams:{userId:this.currentUser.get("id")}})}maybeDeleteWorkspace(t){this.datatable.confirmResourceDeletion("workspace").subscribe(()=>{this.workspaces.delete([t.id]).subscribe(()=>{this.datatable.reset(),this.toast.open("Workspace deleted.")},t=>{this.toast.open(t.message||m.v.Default)})})}showCrupdateWorkspaceModal(t){this.datatable.openCrupdateResourceModal(fe.Z,{workspace:t}).subscribe()}openWorkspaceMembersModal(t){this.modal.open(be.t,{workspace:t})}filterByUser(){return-1===this.router.url.indexOf("admin")}maybeLeaveWorkspace(t){this.modal.open(f.z,ve.W).afterClosed().subscribe(e=>{e&&this.workspaces.deleteMember(t.id,this.currentUser.get("id")).subscribe(()=>this.datatable.reset())})}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(qt.x),l.Y36(Z.I),l.Y36(p.b),l.Y36(x.F),l.Y36(a.F0),l.Y36(_.u),l.Y36(_e))},t.\u0275cmp=l.Xpm({type:t,selectors:[["workspace-index"]],features:[l._Bn([qt.x])],decls:34,vars:8,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","workspaces"],[1,"action-buttons"],["mat-raised-button","","color","accent","class","button-with-icon",3,"click",4,"ngIf"],[1,"datatable","responsive-table"],[1,"material-table"],["table-sort-header","","trans",""],["table-sort-header","owner_id","trans",""],["table-sort-header","members_count","trans",""],[4,"ngFor","ngForOf"],["svgImage","shared-workspace.svg",4,"ngIf"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],["data-label","Name"],["data-label","Owner"],[3,"user"],["data-label","Your Role","trans",""],["data-label","Members"],["data-label","Last Updated"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","group-add"],[4,"ngIf"],["svgIcon","edit"],["svgIcon","delete"],["svgIcon","exit-to-app"],["svgImage","shared-workspace.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"h1",1),l.TgZ(2,"span",1),l._uU(3,"Workspaces"),l.qZA(),l.TgZ(4,"info-popover"),l.TgZ(5,"strong",1),l._uU(6,"Workspaces and Teammates"),l.qZA(),l.TgZ(7,"p",1),l._uU(8),l.qZA(),l.qZA(),l.qZA(),l.TgZ(9,"div",2),l._UZ(10,"datatable-filters",3),l.TgZ(11,"div",4),l.YNc(12,xe,4,0,"button",5),l.qZA(),l.qZA(),l.qZA(),l.TgZ(13,"div",6),l.TgZ(14,"table",7),l.TgZ(15,"thead"),l.TgZ(16,"tr"),l.TgZ(17,"th",8),l._uU(18,"Name"),l.qZA(),l.TgZ(19,"th",9),l._uU(20,"Owner"),l.qZA(),l.TgZ(21,"th",1),l._uU(22,"Your Role"),l.qZA(),l.TgZ(23,"th",10),l._uU(24,"Members"),l.qZA(),l.TgZ(25,"th",1),l._uU(26,"Last Updated"),l.qZA(),l._UZ(27,"th"),l.qZA(),l.qZA(),l.TgZ(28,"tbody"),l.YNc(29,we,18,12,"tr",11),l.ALo(30,"async"),l.qZA(),l.qZA(),l.YNc(31,ke,3,0,"no-results-message",12),l.ALo(32,"async"),l._UZ(33,"datatable-footer"),l.qZA()),2&t&&(l.xp6(8),l.Oqu(e.workspaceConfig.description),l.xp6(4),l.Q6J("ngIf",e.currentUser.hasPermission("workspaces.create")),l.xp6(17),l.Q6J("ngForOf",l.lcZ(30,4,e.workspaces$)),l.xp6(2),l.Q6J("ngIf",l.lcZ(32,6,e.datatable.paginator.noResults$)))},directives:[y.P,Ze.N,Ot.h,i.O5,Nt.p,i.sg,St.V,w.lW,A.Hw,Yt.r,Qt.gM,Lt.U],pipes:[i.Ov,D.l,k.R],styles:["h1[_ngcontent-%COMP%]{display:flex;align-items:center}"],changeDetection:0}),t})();var Ce=n(4512),qe=n(38193);const Ue=[{path:"",component:lt,canActivate:[me],children:[{path:"",resolve:{reports:vt},component:xt,data:{name:"Dashboard"}},{path:"links",component:ct.g},{path:"links/:linkId",resolve:{api:ut.F},component:dt.G,data:{name:"Link Statistics"}},{path:"biolinks",component:Ce.o},{path:"biolinks/:linkId/edit",component:qe.w,data:{name:"Edit Bio Link"}},{path:"biolinks/:biolinkId/analytics",component:At.x,data:{name:"Biolink Statistics"}},{path:"link-groups",component:yt.o},{path:"link-groups/:groupId/links",component:Xt.Z},{path:"link-groups/:groupId/analytics",component:At.x,data:{name:"Link Group Statistics"}},{path:"custom-domains",component:Gt,data:{name:"Custom Domains"}},{path:"link-overlays",component:wt.m,data:{name:"Link Overlays"}},{path:"link-overlays/new",component:jt.O,canDeactivate:[pe.w]},{path:"link-overlays/edit/:id",component:jt.O,canDeactivate:[pe.w]},{path:"pixels",component:kt.V,data:{name:"Tracking Pixels"}},{path:"workspaces",component:Te,data:{name:"Workspaces"}},{path:"link-pages",component:ue,data:{name:"Link Pages",endpoint:"link-page"}},{path:"link-pages/new",component:Tt.e,data:{name:"Add New Page",hideSlug:!0,endpoint:"link-page"}},{path:"link-pages/:id/edit",component:Tt.e,data:{name:"Edit Page",hideSlug:!0,endpoint:"link-page"}}]}];let Ie=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[a.Bz.forChild(Ue)],a.Bz]}),t})();var Me=n(92762),Oe=n(92935),Je=n(56160),Pe=n(87829),Ne=n(20653),Se=n(75425),De=n(79572),Qe=n(68400),Ye=n(58666),Le=n(50615),Fe=n(31041),Ee=n(51685),Re=n(99808);let $e=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Qe.N,Ye.u,Le.X,Fe.u5,Fe.UX,Ee.x,Re.p,A.Ps,w.ot,Qt.AV,Oe.Is,De.rP,j.Cv]]}),t})();var Ve=n(57173);const Be=["rootMenu"];function He(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"button",9),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().selectValue("page:"+e.id)}),l._uU(1),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.ekj("active",n.value==="page:"+t.id),l.xp6(1),l.Oqu(t.title)}}function ze(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"button",9),l.NdJ("click",function(){const e=l.CHM(t).$implicit;return l.oxw().selectValue("overlay:"+e.id)}),l._uU(1),l.qZA()}if(2&t){const t=e.$implicit,n=l.oxw();l.ekj("active",n.value==="overlay:"+t.id),l.xp6(1),l.Oqu(t.name)}}const Ge=function(t){return{siteName:t}};let je=(()=>{class t{constructor(t,e){this.cd=t,this.settings=e}writeValue(t){this.value=t,this.cd.detectChanges()}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}selectValue(t){this.value=t,this.propagateChange(t)}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(l.sBO),l.Y36(d.Z))},t.\u0275cmp=l.Xpm({type:t,selectors:[["link-type-menu"]],viewQuery:function(t,e){if(1&t&&l.Gf(Be,7),2&t){let t;l.iGM(t=l.CRH())&&(e.matMenu=t.first)}},inputs:{linkOptions:"linkOptions"},features:[l._Bn([{provide:Fe.JU,useExisting:t,multi:!0}])],decls:33,vars:24,consts:[["rootMenu",""],["mat-menu-item","",1,"multiline-mat-menu-item",3,"click"],["trans","",1,"title"],["trans","",1,"description"],["trans","",1,"description",3,"transValues"],["mat-menu-item","",1,"multiline-mat-menu-item",3,"matMenuTriggerFor"],["customPagesMenu",""],["mat-menu-item","",3,"active","click",4,"ngFor","ngForOf"],["overlayMenu",""],["mat-menu-item","",3,"click"]],template:function(t,e){if(1&t&&(l.TgZ(0,"mat-menu",null,0),l.TgZ(2,"div",1),l.NdJ("click",function(){return e.selectValue("direct")}),l.TgZ(3,"div",2),l._uU(4,"Direct"),l.qZA(),l.TgZ(5,"div",3),l._uU(6,"Redirect user to url instantly."),l.qZA(),l.qZA(),l.TgZ(7,"div",1),l.NdJ("click",function(){return e.selectValue("frame")}),l.TgZ(8,"div",2),l._uU(9,"Frame"),l.qZA(),l.TgZ(10,"div",4),l._uU(11,"Show url inside iframe with :siteName navigation bar."),l.qZA(),l.qZA(),l.TgZ(12,"div",1),l.NdJ("click",function(){return e.selectValue("splash")}),l.TgZ(13,"div",2),l._uU(14,"Splash"),l.qZA(),l.TgZ(15,"div",3),l._uU(16,"Show splash page with optional ads and redirect user to url after a delay."),l.qZA(),l.qZA(),l.TgZ(17,"div",5),l.TgZ(18,"div",2),l._uU(19,"Link Page"),l.qZA(),l.TgZ(20,"div",4),l._uU(21,"Show specified link page with :siteName navigation bar and button to open long url."),l.qZA(),l.qZA(),l.TgZ(22,"div",5),l.TgZ(23,"div",2),l._uU(24,"Overlay"),l.qZA(),l.TgZ(25,"div",3),l._uU(26,"Redirect user instantly and show specified overlay over the link."),l.qZA(),l.qZA(),l.qZA(),l.TgZ(27,"mat-menu",null,6),l.YNc(29,He,2,3,"button",7),l.qZA(),l.TgZ(30,"mat-menu",null,8),l.YNc(32,ze,2,3,"button",7),l.qZA()),2&t){const t=l.MAs(28),n=l.MAs(31);l.xp6(2),l.ekj("active","direct"===e.value),l.xp6(5),l.ekj("active","frame"===e.value),l.xp6(3),l.Q6J("transValues",l.VKq(20,Ge,e.settings.get("branding.site_name"))),l.xp6(2),l.ekj("active","splash"===e.value),l.xp6(5),l.ekj("hidden",!(null!=e.linkOptions&&e.linkOptions.pages.length))("active",e.value.includes("page")),l.Q6J("matMenuTriggerFor",t),l.xp6(3),l.Q6J("transValues",l.VKq(22,Ge,e.settings.get("branding.site_name"))),l.xp6(2),l.ekj("hidden",!(null!=e.linkOptions&&e.linkOptions.overlays.length))("active",e.value.includes("overlay")),l.Q6J("matMenuTriggerFor",n),l.xp6(7),l.Q6J("ngForOf",null==e.linkOptions?null:e.linkOptions.pages),l.xp6(3),l.Q6J("ngForOf",null==e.linkOptions?null:e.linkOptions.overlays)}},directives:[h.VK,h.OP,y.P,h.p6,i.sg],styles:[""],changeDetection:0}),t})(),Xe=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Fe.UX,Qe.N,w.ot]]}),t})();var We=n(69193),Ke=n(37604),tn=n(86013),en=n(20673),nn=n(12188),an=n(29828),on=n(7436),sn=n(4182),rn=n(15595),ln=n(47878),cn=n(63380),dn=n(90723),un=n(87254);let pn=(()=>{class t{constructor(t){this.el=t,this.enterPressed=new l.vpe}ngOnInit(){this.subscription=(0,un.R)(this.el.nativeElement,"keydown").subscribe(t=>{13===t.keyCode&&(t.preventDefault(),t.stopPropagation(),this.el.nativeElement.blur(),this.enterPressed.emit(t))})}ngOnDestroy(){this.subscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(l.SBq))},t.\u0275dir=l.lG2({type:t,selectors:[["","enterKeybind",""]],outputs:{enterPressed:"enterPressed"}}),t})();var gn=n(59447),hn=n(75428);let mn=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Qe.N,h.Tx,w.ot,A.Ps]]}),t})();var fn=n(41816),bn=n(45052),vn=n(87064),_n=n(8424),Zn=n(69244);let xn=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Qe.N,Fe.UX,Fe.u5,vn.si,w.ot,A.Ps]]}),t})(),yn=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Qe.N,vn.si,Le.X,w.ot,A.Ps,Fe.UX,on.Fk,Me.vV]]}),t})();var An=n(13070),wn=n(13841);let kn=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Fe.UX,Qe.N,Xe,dn.a,Je.G,w.ot,A.Ps,An.lN,wn.LD]]}),t})(),Tn=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,Fe.u5,Fe.UX,a.Bz,Le.X,Qe.N,Ye.u,rn.m,_n._,dn.a,Ke.x,xn,yn,kn,an.I,Se.m,Xe,bn.T,A.Ps,w.ot,Qt.AV,Oe.Is,Zn._t,Ve.Nh,vn.si,De.rP]]}),t})();var Cn=n(85786),qn=n(53129),Un=n(78671);let In=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({providers:[_.u,{provide:_e,useValue:{description:"Workspaces are like folders for your links, domains, groups and other resources. They're great for organising your campaigns, collaborating with teammates and managing different projects."}}],imports:[[i.ez,a.Bz,Ie,Qe.N,Le.X,We.a,Fe.u5,Fe.UX,Ke.x,Re.p,Ye.u,tn.b,en.l,nn.v,an.I,cn.M,dn.a,gn.a,fn.J,hn.WorkspaceModule,mn,kn,Cn.c,rn.m,Ee.x,sn.S,Se.m,Ne.m,$e,ln.k,Je.G,Xe,Tn,w.ot,A.Ps,Qt.AV,Oe.Is,Me.vV,Ve.Nh,h.Tx,j.Cv,De.rP,on.Fk,bn.T,vn.si]]}),t})();l.B6R(Pe.P,[Oe.uh,i.O5,y.P,A.Hw,Fe.JL,Fe.F,Oe.xY,Fe.sg,Fe.Fj,Fe.JJ,Fe.u,pn,Fe.Q7,Fe.wO,Fe.nD,w.lW,h.p6,je,qn.O,Oe.H8,Un.t],[i.Ov])},28577:function(t,e,n){"use strict";n.d(e,{L:function(){return U}});var i=n(78512),a=n(92935),o=n(31041),s=n(11520),r=n(24831),l=n(35366),c=n(16980),d=n(76512),u=n(73234),p=n(25051),g=n(88195),h=n(61116),m=n(77307),f=n(38116),b=n(29738),v=n(13571),_=n(79572),Z=n(84369);function x(t,e){if(1&t&&(l.TgZ(0,"span",6),l._uU(1),l.qZA()),2&t){const t=l.oxw();l.xp6(1),l.hij("Create ",t.resourceName,"")}}function y(t,e){if(1&t&&(l.TgZ(0,"span",6),l._uU(1),l.qZA()),2&t){const t=l.oxw();l.xp6(1),l.hij("Update ",t.resourceName,"")}}function A(t,e){if(1&t&&(l.TgZ(0,"div",25),l._uU(1),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.name)}}function w(t,e){if(1&t&&(l.TgZ(0,"div",25),l._uU(1),l.qZA()),2&t){const t=l.oxw().ngIf;l.xp6(1),l.Oqu(t.hash)}}function k(t,e){1&t&&(l.TgZ(0,"div",18),l.TgZ(1,"mat-slide-toggle",26),l._uU(2,"Rotator"),l.qZA(),l.TgZ(3,"p",6),l._uU(4," When checked, url above will redirect to random link from the group, instead of showing all links belonging to group. "),l.qZA(),l.qZA())}function T(t,e){1&t&&(l.TgZ(0,"span"),l._uU(1,"Update"),l.qZA())}function C(t,e){1&t&&(l.TgZ(0,"span"),l._uU(1,"Create"),l.qZA())}function q(t,e){if(1&t){const t=l.EpF();l.TgZ(0,"form",7),l.NdJ("ngSubmit",function(){return l.CHM(t),l.oxw().confirm()}),l.TgZ(1,"mat-dialog-content",8),l.TgZ(2,"div",9),l.TgZ(3,"label",10),l._uU(4,"Name"),l.qZA(),l._UZ(5,"input",11),l.YNc(6,A,2,1,"div",12),l.qZA(),l.TgZ(7,"div",13),l._UZ(8,"slug-control",14),l.ALo(9,"async"),l.YNc(10,w,2,1,"div",12),l.qZA(),l._UZ(11,"domain-form-control",15),l.ALo(12,"async"),l.TgZ(13,"div",13),l.TgZ(14,"label",16),l._uU(15,"Description"),l.qZA(),l._UZ(16,"textarea",17),l.qZA(),l.TgZ(17,"div",18),l.TgZ(18,"mat-slide-toggle",19),l._uU(19,"Active"),l.qZA(),l.TgZ(20,"p",6),l._uU(21),l.qZA(),l.qZA(),l.YNc(22,k,5,0,"div",20),l.qZA(),l.TgZ(23,"mat-dialog-actions"),l.TgZ(24,"button",21),l.NdJ("click",function(){return l.CHM(t),l.oxw().close()}),l._uU(25,"Cancel"),l.qZA(),l.TgZ(26,"button",22),l.ALo(27,"async"),l.YNc(28,T,2,0,"span",23),l.ALo(29,"async"),l.YNc(30,C,2,0,"ng-template",null,24,l.W1O),l.qZA(),l.qZA(),l.qZA()}if(2&t){const t=e.ngIf,n=l.MAs(31),i=l.oxw();l.Q6J("formGroup",i.form),l.xp6(6),l.Q6J("ngIf",t.name),l.xp6(2),l.Q6J("baseUri",l.lcZ(9,10,i.slugBaseUri$)),l.xp6(2),l.Q6J("ngIf",t.hash),l.xp6(1),l.Q6J("domains",l.lcZ(12,12,i.domains$)),l.xp6(10),l.hij("Whether this ",i.resourceName," is viewable publicly."),l.xp6(1),l.Q6J("ngIf","biolink"!==i.data.type),l.xp6(4),l.Q6J("disabled",l.lcZ(27,14,i.loading$)),l.xp6(2),l.Q6J("ngIf",l.lcZ(29,16,i.updating$))("ngIfElse",n)}}let U=(()=>{class t{constructor(t,e,n,a,s,l,c){this.dialogRef=t,this.data=e,this.groups=n,this.biolinks=a,this.toast=s,this.valueLists=l,this.settings=c,this.loading$=new i.X(!1),this.updating$=new i.X(!1),this.errors$=new i.X({}),this.form=new o.cw({name:new o.NI,active:new o.NI(!0),description:new o.NI(""),hash:new o.NI((0,r.O)(6)),rotator:new o.NI(!1),domain_id:new o.NI(null)}),this.slugBaseUri$=new i.X(null),this.domains$=new i.X([])}get resourceName(){return"biolink"===this.data.type?"biolink":"link group"}ngOnInit(){this.updating$.next(!!this.data.linkGroup),this.data.linkGroup&&this.form.patchValue(this.data.linkGroup),this.valueLists.get(["domains"]).subscribe(t=>{this.domains$.next(t.domains),this.setSlugBaseUri(this.form.value.domain_id)}),this.form.get("domain_id").valueChanges.subscribe(t=>{this.setSlugBaseUri(t)})}confirm(){this.loading$.next(!0),(this.updating$.value?this.api().update(this.data.linkGroup.id,this.form.value):this.api().create(this.form.value)).pipe((0,s.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open(this.updating$.value?`${this.resourceName} updated`:`${this.resourceName} created`),this.close(t.linkGroup||t.biolink)},t=>this.errors$.next(t.errors))}close(t){this.dialogRef.close(t)}api(){return"biolink"===this.data.type?this.biolinks:this.groups}setSlugBaseUri(t){this.slugBaseUri$.next(t?this.domains$.value.find(e=>e.id===t).host:this.settings.getBaseUrl())}}return t.\u0275fac=function(e){return new(e||t)(l.Y36(a.so),l.Y36(a.WI),l.Y36(c.L),l.Y36(d.n),l.Y36(u.F),l.Y36(p.l),l.Y36(g.Z))},t.\u0275cmp=l.Xpm({type:t,selectors:[["crupdate-link-group-modal"]],decls:8,vars:5,consts:[[1,"modal-header"],["mat-dialog-title","",1,"capitalize"],["trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],["trans",""],["ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"many-inputs"],[1,"input-container","name-container"],["for","link-group-name","trans",""],["type","text","id","link-group-name","formControlName","name","required","","minlength","3"],["class","error",4,"ngIf"],[1,"input-container"],["formControlName","hash",3,"baseUri"],["controlName","domain_id",1,"many-inputs",3,"domains"],["for","link-group-description","trans",""],["id","link-group-description","formControlName","description"],[1,"setting-toggle-container"],["formControlName","active","id","link-group-active","trans","",1,"capitalize"],["class","setting-toggle-container",4,"ngIf"],["type","button","mat-button","","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],[4,"ngIf","ngIfElse"],["creating",""],[1,"error"],["formControlName","rotator","id","link-group-rotator","trans",""]],template:function(t,e){1&t&&(l.TgZ(0,"div",0),l.TgZ(1,"h2",1),l.YNc(2,x,2,1,"span",2),l.YNc(3,y,2,1,"span",2),l.qZA(),l.TgZ(4,"button",3),l.NdJ("click",function(){return e.close()}),l._UZ(5,"mat-icon",4),l.qZA(),l.qZA(),l.YNc(6,q,32,18,"form",5),l.ALo(7,"async")),2&t&&(l.xp6(2),l.Q6J("ngIf",!e.data.linkGroup),l.xp6(1),l.Q6J("ngIf",e.data.linkGroup),l.xp6(3),l.Q6J("ngIf",l.lcZ(7,3,e.errors$)))},directives:[a.uh,h.O5,m.Hw,f.P,o.JL,o.sg,a.xY,o.Fj,o.JJ,o.u,o.Q7,o.wO,b.b,v.z,_.Rr,a.H8,Z.lW],pipes:[h.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.name-container[_ngcontent-%COMP%]{margin-bottom:8px}"],changeDetection:0}),t})()},80773:function(t,e,n){"use strict";n.d(e,{x:function(){return v}});var i=n(55959),a=n(26437),o=n(35366),s=n(63337),r=n(24859),l=n(16980),c=n(76512),d=n(61116),u=n(93836),p=n(84369),g=n(77307),h=n(88798),m=n(40450);function f(t,e){if(1&t&&(o.TgZ(0,"div"),o.TgZ(1,"h1",2),o.TgZ(2,"a",3),o._UZ(3,"mat-icon",4),o.qZA(),o._uU(4),o.ALo(5,"trans"),o.qZA(),o.qZA()),2&t){const t=e.ngIf;o.Q6J("@fadeIn",void 0),o.xp6(4),o.AsE(" ",t.name," ",o.lcZ(5,3,"Analytics")," ")}}function b(t,e){1&t&&(o.TgZ(0,"h1"),o._UZ(1,"skeleton",5),o.qZA()),2&t&&o.Q6J("@fadeOut",void 0)}let v=(()=>{class t{constructor(t,e,n,a){this.route=t,this.modal=e,this.groups=n,this.biolinks=a,this.analytics$=new i.xQ,this.linkGroup$=new i.xQ}ngOnInit(){this.route.params.subscribe(t=>{const e=t.groupId||t.biolinkId,n=t.groupId?this.groups:this.biolinks;this.analyticsEndpoint=n.analyticsEndpoint(e),n.analytics(e).subscribe(t=>{this.analytics$.next(t.analytics),this.linkGroup$.next(t.linkGroup||t.biolink)})})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(s.gz),o.Y36(r.u),o.Y36(l.L),o.Y36(c.n))},t.\u0275cmp=o.Xpm({type:t,selectors:[["link-group-analytics-page"]],decls:7,vars:10,consts:[[4,"ngIf"],[3,"reports","endpoint"],[1,"name"],["routerLink","../../","mat-icon-button",""],["svgIcon","arrow-back"],["variant","text"]],template:function(t,e){1&t&&(o.TgZ(0,"header"),o.YNc(1,f,6,5,"div",0),o.ALo(2,"async"),o.YNc(3,b,2,1,"h1",0),o.ALo(4,"async"),o.qZA(),o._UZ(5,"click-charts",1),o.ALo(6,"async")),2&t&&(o.xp6(1),o.Q6J("ngIf",o.lcZ(2,4,e.linkGroup$)),o.xp6(2),o.Q6J("ngIf",!o.lcZ(4,6,e.linkGroup$)),o.xp6(2),o.Q6J("reports",o.lcZ(6,8,e.analytics$))("endpoint",e.analyticsEndpoint))},directives:[d.O5,u.z,s.yS,p.zs,g.Hw,h._],pipes:[d.Ov,m.R],styles:["header[_ngcontent-%COMP%]{position:relative}h1[_ngcontent-%COMP%]{font-size:2rem;text-transform:capitalize;margin:0 0 10px;font-weight:400;height:40px}skeleton[_ngcontent-%COMP%]{max-width:350px}.mat-icon-button[_ngcontent-%COMP%]{color:var(--be-secondary-text);vertical-align:middle}"],data:{animation:a.B},changeDetection:0}),t})()},90832:function(t,e,n){"use strict";n.d(e,{L:function(){return s}});var i=n(44415),a=n(59075),o=n(45523);const s=[new a.XQ({type:a.Bq.Select,key:"active",label:"status",defaultValue:!1,description:"Whether group is public or not",options:[{key:"Disabled",value:!1},{key:"Active",value:!0}]}),new a.XQ({type:a.Bq.Select,key:"rotator",label:"rotator",defaultValue:!1,description:"Whether group is used as link rotator",options:[{key:"Yes",value:!0},{key:"No",value:!1}]}),new o.T7({description:"Date link group was created"}),new o.yH({description:"Date link group was last updated"}),new a.XQ({type:a.Bq.SelectModel,key:"user_id",label:"User",description:"User group was created by",component:i.y})]},45905:function(t,e,n){"use strict";n.d(e,{o:function(){return z}});var i=n(56515),a=n(36024),o=n(16980),s=n(67455),r=n(28577),l=n(90832),c=n(35366),d=n(28505),u=n(73234),p=n(63337),g=n(36501),h=n(48865),m=n(95157),f=n(38116),b=n(49517),v=n(34955),_=n(56361),Z=n(84369),x=n(77307),y=n(61116),A=n(13536),w=n(80922),k=n(86668),T=n(27701),C=n(54275),q=n(24311),U=n(19708),I=n(71765),M=n(47210),O=n(2406),J=n(40450);function P(t,e){1&t&&c._UZ(0,"mat-progress-bar",23)}function N(t,e){1&t&&(c.TgZ(0,"th",24),c._uU(1,"Owner"),c.qZA())}const S=function(t){return{count:t,resource:"group(s)"}};function D(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"tr"),c.TgZ(1,"th",25),c.TgZ(2,"div",26),c._uU(3," :count :resource selected: "),c.qZA(),c.TgZ(4,"div",27),c.TgZ(5,"permission-aware-button",28),c.TgZ(6,"button",29),c.NdJ("click",function(){return c.CHM(t),c.oxw().maybeDeleteSelectedGroups()}),c._uU(7," Delete "),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=e.ngIf;c.xp6(2),c.Q6J("transValues",c.VKq(1,S,t))}}function Q(t,e){if(1&t&&(c.TgZ(0,"td",50),c._UZ(1,"user-column",51),c.qZA()),2&t){const t=c.oxw().$implicit;c.xp6(1),c.Q6J("user",t.user)}}function Y(t,e){1&t&&c._UZ(0,"mat-icon",52)}function L(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"-"),c.qZA())}function F(t,e){1&t&&c._UZ(0,"mat-icon",52)}function E(t,e){1&t&&(c.TgZ(0,"span"),c._uU(1,"-"),c.qZA())}const R=function(t){return["/",t]},$=function(t){return[t,"analytics"]},V=function(t){return[t,"links"]};function B(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"tr"),c._UZ(1,"td",30),c.TgZ(2,"td",31),c.TgZ(3,"a",32),c._uU(4),c.qZA(),c.qZA(),c.YNc(5,Q,2,1,"td",33),c.TgZ(6,"td",34),c._uU(7),c.qZA(),c.TgZ(8,"td",35),c.YNc(9,Y,1,0,"mat-icon",36),c.YNc(10,L,2,0,"span",20),c.qZA(),c.TgZ(11,"td",37),c.YNc(12,F,1,0,"mat-icon",36),c.YNc(13,E,2,0,"span",20),c.qZA(),c.TgZ(14,"td",38),c._uU(15),c.ALo(16,"formattedDate"),c.qZA(),c.TgZ(17,"td",39),c.TgZ(18,"button",40),c.ALo(19,"trans"),c._UZ(20,"mat-icon",41),c.qZA(),c.TgZ(21,"permission-aware-button",42),c.TgZ(22,"button",40),c.ALo(23,"trans"),c._UZ(24,"mat-icon",43),c.qZA(),c.qZA(),c.TgZ(25,"permission-aware-button",42),c.TgZ(26,"button",44),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().showCrupdateGroupModal(e)}),c.ALo(27,"trans"),c._UZ(28,"mat-icon",45),c.qZA(),c.qZA(),c._UZ(29,"copy-link-btn",46),c.TgZ(30,"permission-aware-button",47),c.TgZ(31,"button",48),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().maybeDeleteSelectedGroups([e.id])}),c._UZ(32,"mat-icon",49),c.qZA(),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.xp6(1),c.Q6J("table-body-checkbox",t.id),c.xp6(2),c.Q6J("routerLink",c.VKq(26,R,t.hash)),c.xp6(1),c.Oqu(t.name),c.xp6(1),c.Q6J("ngIf",n.showUserColumn()),c.xp6(2),c.Oqu(t.links_count),c.xp6(2),c.Q6J("ngIf",t.active),c.xp6(1),c.Q6J("ngIf",!t.active),c.xp6(2),c.Q6J("ngIf",t.rotator),c.xp6(1),c.Q6J("ngIf",!t.rotator),c.xp6(2),c.Oqu(c.lcZ(16,18,t.updated_at)),c.xp6(3),c.Q6J("routerLink",c.VKq(28,$,t.id))("matTooltip",c.lcZ(19,20,"Analytics")),c.xp6(3),c.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),c.xp6(1),c.Q6J("routerLink",c.VKq(30,V,t.id))("matTooltip",c.lcZ(23,22,"Manage Links")),c.xp6(3),c.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),c.xp6(1),c.Q6J("matTooltip",c.lcZ(27,24,"Edit")),c.xp6(3),c.Q6J("model",t)}}function H(t,e){1&t&&(c.TgZ(0,"no-results-message",53),c.TgZ(1,"span",54),c._uU(2,"No link groups have been created yet"),c.qZA(),c.qZA())}let z=(()=>{class t{constructor(t,e,n,i,a,o,s,r){this.datatable=t,this.currentUser=e,this.linkGroups=n,this.toast=i,this.route=a,this.linkUsage=o,this.activeSection=s,this.workspaces=r,this.groups$=this.datatable.data$,this.filters=l.L}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:o.L.BASE_URI,staticParams:{with:["user"],withCount:["links"],userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}maybeDeleteSelectedGroups(t){this.datatable.confirmResourceDeletion("link groups").subscribe(()=>{this.linkGroups.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open(s.V.LINK_GROUP_DELETE_SUCCESS)},t=>{this.toast.open(t.message||a.v.Default)})})}showCrupdateGroupModal(t){this.datatable.openCrupdateResourceModal(r.L,{linkGroup:t}).subscribe(()=>this.linkUsage.reload())}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=l.L.filter(t=>"user_id"!==t.key||this.showUserColumn())}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(i.x),c.Y36(d.I),c.Y36(o.L),c.Y36(u.F),c.Y36(p.gz),c.Y36(g.F),c.Y36(h.W),c.Y36(m.b))},t.\u0275cmp=c.Xpm({type:t,selectors:[["link-group-index"]],features:[c._Bn([i.x])],decls:50,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[3,"wider"],["trans","",1,"title"],[1,"header"],["pluralName","groups",3,"filters"],[1,"action-buttons"],["permission","link_groups.create"],["mat-raised-button","","color","accent","trans","",1,"button-with-icon",3,"click"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","user_id","trans","",4,"ngIf"],["table-sort-header","links_count","trans",""],["table-sort-header","active","trans",""],["table-sort-header","rotator","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","marketing.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","user_id","trans",""],["colspan","6"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["permission","link_groups.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["target","_blank",1,"link-group-name",3,"routerLink"],["data-label","Owner",4,"ngIf"],["data-label","Link Count"],["data-label","Active"],["svgIcon","check",4,"ngIf"],["data-label","Rotator"],["data-label","Last Updated"],[1,"edit-column"],["type","button","mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","bar-chart"],["permission","link_groups.update",3,"userOwnsResource"],["svgIcon","list-alt"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],[3,"model"],["permission","link_groups.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgIcon","check"],["svgImage","marketing.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h1"),c.TgZ(2,"span",1),c._uU(3,"Link Groups"),c.qZA(),c.TgZ(4,"info-popover",2),c.TgZ(5,"div",3),c._uU(6,"Group links together to:"),c.qZA(),c.TgZ(7,"ul"),c.TgZ(8,"li",1),c._uU(9,"Simplify multiple link management."),c.qZA(),c.TgZ(10,"li",1),c._uU(11,"View statistics for a whole group instead of individual links."),c.qZA(),c.TgZ(12,"li",1),c._uU(13,"Share all links in the group with one link."),c.qZA(),c.TgZ(14,"li",1),c._uU(15,"And more."),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.TgZ(16,"div",4),c._UZ(17,"datatable-filters",5),c.TgZ(18,"div",6),c.TgZ(19,"permission-aware-button",7),c.TgZ(20,"button",8),c.NdJ("click",function(){return e.showCrupdateGroupModal()}),c._UZ(21,"mat-icon",9),c.TgZ(22,"span",1),c._uU(23,"Add New Group"),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.TgZ(24,"div",10),c.YNc(25,P,1,0,"mat-progress-bar",11),c.ALo(26,"async"),c.TgZ(27,"table",12),c.TgZ(28,"thead"),c.TgZ(29,"tr"),c._UZ(30,"th",13),c.TgZ(31,"th",14),c._uU(32,"Name"),c.qZA(),c.YNc(33,N,2,0,"th",15),c.TgZ(34,"th",16),c._uU(35,"Links"),c.qZA(),c.TgZ(36,"th",17),c._uU(37,"Active"),c.qZA(),c.TgZ(38,"th",18),c._uU(39,"Rotator"),c.qZA(),c.TgZ(40,"th",19),c._uU(41,"Last Updated"),c.qZA(),c._UZ(42,"th"),c.qZA(),c.YNc(43,D,8,3,"tr",20),c.qZA(),c.TgZ(44,"tbody"),c.YNc(45,B,33,32,"tr",21),c.ALo(46,"async"),c.qZA(),c.qZA(),c.YNc(47,H,3,0,"no-results-message",22),c.ALo(48,"async"),c._UZ(49,"datatable-footer"),c.qZA()),2&t&&(c.xp6(4),c.Q6J("wider",!0),c.xp6(13),c.Q6J("filters",e.filters),c.xp6(8),c.Q6J("ngIf",c.lcZ(26,7,e.datatable.paginator&&e.datatable.paginator.loading$)),c.xp6(8),c.Q6J("ngIf",e.showUserColumn()),c.xp6(10),c.Q6J("ngIf",e.datatable.selectedRows$.value.length),c.xp6(2),c.Q6J("ngForOf",c.lcZ(46,9,e.groups$)),c.xp6(2),c.Q6J("ngIf",c.lcZ(48,11,e.datatable.paginator.noResults$)))},directives:[f.P,b.N,v.h,_.v,Z.lW,x.Hw,y.O5,A.e,w.p,y.sg,k.V,T.pW,C.O,p.yS,p.rH,q.gM,U.b,I.r,M.U],pipes:[y.Ov,O.l,J.R],styles:["h1[_ngcontent-%COMP%]{display:flex;align-items:center}.link-group-name[_ngcontent-%COMP%]{color:inherit}.link-group-name[_ngcontent-%COMP%]:hover{text-decoration:underline}info-popover[_ngcontent-%COMP%]  .info-popover-panel{max-width:450px!important}"],changeDetection:0}),t})()},8889:function(t,e,n){"use strict";n.d(e,{Z:function(){return f}});var i=n(78512),a=n(56515),o=n(26437),s=n(85706),r=n(35366),l=n(63337),c=n(24859),d=n(36501),u=n(16980),p=n(84222),g=n(73234),h=n(28505),m=n(32656);let f=(()=>{class t{constructor(t,e,n,a,o,s,r,l,c){this.route=t,this.modal=e,this.datatable=n,this.linkUsage=a,this.linkGroups=o,this.links=s,this.toast=r,this.router=l,this.currentUser=c,this.loading$=new i.X(!1),this.groupId$=new i.X(null)}ngOnInit(){this.route.params.subscribe(t=>{this.groupId$.next(t.groupId)})}filterByUser(){return-1===this.router.url.indexOf("admin")}setFilters(){this.filters=s.f.filter(t=>"user_id"!==t.key||!this.filterByUser())}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(l.gz),r.Y36(c.u),r.Y36(a.x),r.Y36(d.F),r.Y36(u.L),r.Y36(p.M),r.Y36(g.F),r.Y36(l.F0),r.Y36(h.I))},t.\u0275cmp=r.Xpm({type:t,selectors:[["link-group-links-index"]],features:[r._Bn([a.x])],decls:1,vars:1,consts:[[3,"groupId"]],template:function(t,e){1&t&&r._UZ(0,"link-index",0),2&t&&r.Q6J("groupId",e.route.snapshot.params.groupId)},directives:[m.g],styles:["header[_ngcontent-%COMP%]{position:relative}h1[_ngcontent-%COMP%]{font-size:2rem;text-transform:capitalize;margin:0 0 10px;font-weight:400;line-height:40px}skeleton[_ngcontent-%COMP%]{max-width:350px}.mat-icon-button[_ngcontent-%COMP%]{color:var(--be-secondary-text);vertical-align:middle}"],data:{animation:o.B},changeDetection:0}),t})()},34384:function(t,e,n){"use strict";n.d(e,{O:function(){return U}});var i=n(34500),a=n(67455),o=n(11520),s=n(78512),r=n(35366),l=n(31041),c=n(72686),d=n(73234),u=n(3950),p=n(63337),g=n(61116),h=n(57173),m=n(38116),f=n(84369),b=n(6006);let v=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=r.Xpm({type:t,selectors:[["generic-page-preview"]],decls:31,vars:0,consts:[[1,"navbar"],[1,"os-button"],[1,"page-body"],[1,"top-row"],[1,"circle"],[1,"line"],[1,"middle-row"],[1,"flex-container"],[1,"left"],[1,"rect"],[1,"line","fat-line"],[1,"separator"],[1,"right"],[1,"fat-line","line"]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r._UZ(1,"div",1),r._UZ(2,"div",1),r._UZ(3,"div",1),r.qZA(),r.TgZ(4,"div",2),r.TgZ(5,"div",3),r._UZ(6,"div",4),r._UZ(7,"div",5),r._UZ(8,"div",5),r._UZ(9,"div",5),r.qZA(),r.TgZ(10,"div",6),r._UZ(11,"div",5),r._UZ(12,"div",5),r._UZ(13,"div",5),r._UZ(14,"div",5),r.qZA(),r.TgZ(15,"div",7),r.TgZ(16,"div",8),r._UZ(17,"div",9),r._UZ(18,"div",10),r._UZ(19,"div",5),r._UZ(20,"div",5),r._UZ(21,"div",11),r._UZ(22,"div",9),r._UZ(23,"div",5),r.qZA(),r.TgZ(24,"div",12),r._UZ(25,"div",9),r._UZ(26,"div",5),r._UZ(27,"div",13),r._UZ(28,"div",5),r._UZ(29,"div",11),r._UZ(30,"div",5),r.qZA(),r.qZA(),r.qZA())},styles:["[_nghost-%COMP%]{display:block;background-color:var(--be-background);height:100%;overflow:hidden}.navbar[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:var(--be-background-alternative);height:40px;width:100%}.os-button[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:50%;margin-left:15px}.os-button[_ngcontent-%COMP%]:first-child{background-color:#d7665d}.os-button[_ngcontent-%COMP%]:nth-child(2){background-color:#deab54}.os-button[_ngcontent-%COMP%]:nth-child(3){background-color:#6fb54c}.page-body[_ngcontent-%COMP%]{padding:25px}.top-row[_ngcontent-%COMP%]{display:flex;align-items:center;height:60px;background-color:var(--be-background-alternative);padding:10px;margin-bottom:25px}.top-row[_ngcontent-%COMP%]   .line[_ngcontent-%COMP%]{width:15%;margin-left:15px}.circle[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:50%;margin-right:auto}.circle[_ngcontent-%COMP%], .line[_ngcontent-%COMP%]{background-color:var(--be-disabled-button)}.line[_ngcontent-%COMP%]{height:20px;border-radius:4px}.middle-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-direction:column;height:260px;background-color:var(--be-background-alternative);margin:25px 0}.middle-row[_ngcontent-%COMP%]   .line[_ngcontent-%COMP%]{height:15px;margin-bottom:5px;width:50%;background-color:var(--be-disabled-toggle)}.middle-row[_ngcontent-%COMP%]   .line[_ngcontent-%COMP%]:first-child{height:35px;margin-bottom:20px;width:65%;background-color:var(--be-disabled-button)}.flex-container[_ngcontent-%COMP%]{display:flex}.fat-line[_ngcontent-%COMP%]{background-color:var(--be-chip);height:35px;margin-bottom:25px}.separator[_ngcontent-%COMP%]{height:1px;background-color:var(--be-divider-default);margin-bottom:25px;margin-top:25px}.left[_ngcontent-%COMP%]{width:30%}.left[_ngcontent-%COMP%]   .rect[_ngcontent-%COMP%]{height:150px;background-color:var(--be-disabled-toggle);margin-bottom:5px}.left[_ngcontent-%COMP%]   .rect[_ngcontent-%COMP%]:last-of-type{height:250px}.left[_ngcontent-%COMP%]   .line[_ngcontent-%COMP%]{margin-bottom:10px}.right[_ngcontent-%COMP%]{width:70%;padding-left:25px}.right[_ngcontent-%COMP%]   .rect[_ngcontent-%COMP%]{height:300px;margin-bottom:35px;background-color:var(--be-chip)}.right[_ngcontent-%COMP%]   .line[_ngcontent-%COMP%]{margin-bottom:10px}"],changeDetection:0}),t})();var _=n(27701),Z=n(69042),x=n(40450);function y(t,e){1&t&&r._UZ(0,"mat-progress-bar",37)}function A(t,e){if(1&t&&(r.TgZ(0,"div",38),r._uU(1),r.qZA()),2&t){const t=r.oxw();r.xp6(1),r.Oqu(t.errors.name)}}function w(t,e){if(1&t&&(r.TgZ(0,"div",38),r._uU(1),r.qZA()),2&t){const t=r.oxw();r.xp6(1),r.Oqu(t.errors.message)}}function k(t,e){if(1&t&&(r.TgZ(0,"div",38),r._uU(1),r.qZA()),2&t){const t=r.oxw();r.xp6(1),r.Oqu(t.errors.label)}}function T(t,e){if(1&t&&(r.TgZ(0,"div",38),r._uU(1),r.qZA()),2&t){const t=r.oxw();r.xp6(1),r.Oqu(t.errors.btn_link)}}function C(t,e){if(1&t&&(r.TgZ(0,"div",38),r._uU(1),r.qZA()),2&t){const t=r.oxw();r.xp6(1),r.Oqu(t.errors.btn_text)}}function q(t,e){if(1&t&&(r.TgZ(0,"color-picker-input",39),r._uU(1),r.qZA()),2&t){const t=e.$implicit,n=r.oxw();r.Q6J("formControlName",t.key),r.xp6(1),r.Oqu(n.colorViewName(t.key))}}let U=(()=>{class t{constructor(t,e,n,i,a,o,r){this.fb=t,this.linkOverlays=e,this.toast=n,this.i18n=i,this.cd=a,this.router=o,this.route=r,this.loading$=new s.X(!1),this.errors={},this.form=this.fb.group({name:[""],position:[""],theme:[""],message:[""],label:[""],label_position:[""],btn_link:[""],btn_text:[""],colors:this.fb.group({"bg-image":this.fb.control(null),"bg-color":this.fb.control(""),"text-color":this.fb.control(""),"label-bg-color":this.fb.control(""),"label-color":this.fb.control(""),"btn-bg-color":this.fb.control(""),"btn-text-color":this.fb.control("")})})}ngOnInit(){this.route.params.subscribe(t=>{t.id&&(this.loading$.next(!0),this.linkOverlays.get(t.id).pipe((0,o.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.overlay=t.linkOverlay,this.form.patchValue(Object.assign({},this.overlay))}))})}ngAfterViewInit(){this.route.snapshot.params.id||this.form.patchValue(Object.assign({},this.getDefaultValue()))}canDeactivate(){return!this.form.dirty}confirm(){this.loading$.next(!0);const t=this.overlay?this.linkOverlays.update(this.overlay.id,this.form.value):this.linkOverlays.create(this.form.value),e=this.overlay?a.V.LINK_OVERLAY_UPDATE_SUCCESS:a.V.LINK_OVERLAY_CREATE_SUCCESS;t.pipe((0,o.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open(e),this.form.markAsPristine(),this.router.navigate([this.route.snapshot.params.id?"../../":"../"],{relativeTo:this.route})},t=>{this.errors=t.errors,this.cd.markForCheck()})}colorControls(){return this.form.get("colors").controls}colorViewName(t){return t.replace(/-/g," ").replace("bg","background").replace("btn","button")}getDefaultValue(){const t={position:"bottom-left",theme:"default",message:this.i18n.t("Your message here"),label:this.i18n.t("Label"),btn_text:this.i18n.t("Button Text"),btn_link:"https://google.com",colors:{}},e=this.overlayCmp.getComputedStyle();return Object.keys(this.colorControls()).forEach(n=>{t.colors[n]=e.getPropertyValue("--"+n).trim()}),t}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(l.qu),r.Y36(c.S),r.Y36(d.F),r.Y36(u.Z),r.Y36(r.sBO),r.Y36(p.F0),r.Y36(p.gz))},t.\u0275cmp=r.Xpm({type:t,selectors:[["crupdate-link-overlay-page"]],viewQuery:function(t,e){if(1&t&&r.Gf(i.a,7),2&t){let t;r.iGM(t=r.CRH())&&(e.overlayCmp=t.first)}},decls:74,vars:29,consts:[[1,"left"],["mode","indeterminate","color","accent",4,"ngIf"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["color","accent","animationDuration","200ms"],[3,"label"],[1,"many-inputs","tab-body-wrapper"],[1,"input-container"],["for","name","trans",""],["type","text","id","name","formControlName","name","required",""],["class","error",4,"ngIf"],["for","position","trans",""],["id","position","formControlName","position","required",""],["value","top-left","trans",""],["value","top-right","trans",""],["value","bottom-left","trans",""],["value","bottom-right","trans",""],["for","link-overlay-theme","trans",""],["id","link-overlay-theme","formControlName","theme","required",""],["value","default","trans",""],["value","full-width","trans",""],["value","rounded","trans",""],["value","pill","trans",""],["for","message","trans",""],["id","message","formControlName","message","maxlength","200","required",""],["for","label","trans",""],["type","text","id","label","formControlName","label","maxlength","8"],["for","btn_link","trans",""],["type","url","id","btn_link","formControlName","btn_link"],["for","btn_text","trans",""],["type","text","id","btn_text","formControlName","btn_text","maxlength","30"],["mat-raised-button","","color","accent","trans","",3,"disabled"],["formGroupName","colors",1,"tab-body-wrapper"],["formControlName","bg-image","diskPrefix","link-overlay-images",1,"overlay-bg-input"],[3,"formControlName",4,"ngFor","ngForOf"],[1,"right"],[3,"overlay"],[1,"cdk-overlay-backdrop","cdk-overlay-backdrop-showing","cdk-overlay-dark-backdrop"],["mode","indeterminate","color","accent"],[1,"error"],[3,"formControlName"]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r.YNc(1,y,1,0,"mat-progress-bar",1),r.ALo(2,"async"),r.TgZ(3,"form",2),r.NdJ("ngSubmit",function(){return e.confirm()}),r.TgZ(4,"mat-tab-group",3),r.TgZ(5,"mat-tab",4),r.ALo(6,"trans"),r.TgZ(7,"div",5),r.TgZ(8,"div",6),r.TgZ(9,"label",7),r._uU(10,"Name"),r.qZA(),r._UZ(11,"input",8),r.YNc(12,A,2,1,"div",9),r.qZA(),r.TgZ(13,"div",6),r.TgZ(14,"label",10),r._uU(15,"Position"),r.qZA(),r.TgZ(16,"select",11),r.TgZ(17,"option",12),r._uU(18,"Top Left"),r.qZA(),r.TgZ(19,"option",13),r._uU(20,"Top Right"),r.qZA(),r.TgZ(21,"option",14),r._uU(22,"Bottom Left"),r.qZA(),r.TgZ(23,"option",15),r._uU(24,"Bottom Right"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(25,"div",6),r.TgZ(26,"label",16),r._uU(27,"Theme"),r.qZA(),r.TgZ(28,"select",17),r.TgZ(29,"option",18),r._uU(30,"Default"),r.qZA(),r.TgZ(31,"option",19),r._uU(32,"Full Width"),r.qZA(),r.TgZ(33,"option",20),r._uU(34,"Rounded"),r.qZA(),r.TgZ(35,"option",21),r._uU(36,"Pill"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(37,"div",6),r.TgZ(38,"label",22),r._uU(39,"Message"),r.qZA(),r._UZ(40,"textarea",23),r.YNc(41,w,2,1,"div",9),r.qZA(),r.TgZ(42,"div",6),r.TgZ(43,"label",24),r._uU(44,"Label"),r.qZA(),r._UZ(45,"input",25),r.YNc(46,k,2,1,"div",9),r.qZA(),r.TgZ(47,"div",6),r.TgZ(48,"label",26),r._uU(49,"Button Link"),r.qZA(),r._UZ(50,"input",27),r.YNc(51,T,2,1,"div",9),r.qZA(),r.TgZ(52,"div",6),r.TgZ(53,"label",28),r._uU(54,"Button Text"),r.qZA(),r._UZ(55,"input",29),r.YNc(56,C,2,1,"div",9),r.qZA(),r.TgZ(57,"button",30),r.ALo(58,"async"),r._uU(59),r.qZA(),r.qZA(),r.qZA(),r.TgZ(60,"mat-tab",4),r.ALo(61,"trans"),r.TgZ(62,"div",31),r._UZ(63,"upload-image-control",32),r.YNc(64,q,2,2,"color-picker-input",33),r.ALo(65,"keyvalue"),r.TgZ(66,"button",30),r.ALo(67,"async"),r._uU(68),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.TgZ(69,"div",34),r._UZ(70,"generic-page-preview"),r._UZ(71,"link-overlay",35),r.ALo(72,"async"),r._UZ(73,"div",36),r.qZA()),2&t&&(r.xp6(1),r.Q6J("ngIf",r.lcZ(2,15,e.loading$)),r.xp6(2),r.Q6J("formGroup",e.form),r.xp6(2),r.Q6J("label",r.lcZ(6,17,"General")),r.xp6(7),r.Q6J("ngIf",e.errors.name),r.xp6(29),r.Q6J("ngIf",e.errors.message),r.xp6(5),r.Q6J("ngIf",e.errors.label),r.xp6(5),r.Q6J("ngIf",e.errors.btn_link),r.xp6(5),r.Q6J("ngIf",e.errors.btn_text),r.xp6(1),r.Q6J("disabled",r.lcZ(58,19,e.loading$)),r.xp6(2),r.hij(" ",e.overlay?"Update":"Create"," "),r.xp6(1),r.Q6J("label",r.lcZ(61,21,"Design")),r.xp6(4),r.Q6J("ngForOf",r.lcZ(65,23,e.colorControls())),r.xp6(2),r.Q6J("disabled",r.lcZ(67,25,e.loading$)),r.xp6(2),r.hij(" ",e.overlay?"Update":"Create"," "),r.xp6(3),r.Q6J("overlay",r.lcZ(72,27,e.form.valueChanges)))},directives:[g.O5,l.JL,l.sg,h.SP,h.uX,m.P,l.Fj,l.JJ,l.u,l.Q7,l.EJ,l.YN,l.Kr,l.nD,f.lW,l.x0,b.V,g.sg,v,i.a,_.pW,Z.M],pipes:[g.Ov,x.R,g.Nd],styles:["[_nghost-%COMP%]{display:flex;height:calc(100vh - 70px);margin:-25px}.left[_ngcontent-%COMP%], .right[_ngcontent-%COMP%]{flex:1 1 auto}.left[_ngcontent-%COMP%]{max-width:300px;padding:10px 20px 20px;background-color:var(--be-background);border-right:1px solid var(--be-divider-default);overflow:auto;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);z-index:1}.left[_ngcontent-%COMP%], .right[_ngcontent-%COMP%]{position:relative}.mat-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0}  crupdate-link-overlay-page .mat-tab-label{width:50%;min-width:0;min-width:auto}.tab-body-wrapper[_ngcontent-%COMP%]{padding-top:15px}link-overlay[_ngcontent-%COMP%]{z-index:1001}.overlay-bg-input[_ngcontent-%COMP%]{margin-bottom:10px;height:80px;width:100%;border:1px solid var(--be-divider-default)}.overlay-bg-input[_ngcontent-%COMP%] .action-buttons{bottom:23px}"],changeDetection:0}),t})()},75950:function(t,e,n){"use strict";n.d(e,{m:function(){return R}});var i=n(67455),a=n(36024),o=n(72686),s=n(56515),r=n(44415),l=n(59075),c=n(45523);const d=[new l.XQ({type:l.Bq.Select,key:"theme",defaultValue:"default",description:"Active theme for link overlay",options:[{key:"default",value:"default"},{key:"full-width",value:"full-width"},{key:"rounded",value:"rounded"},{key:"pill",value:"pill"}]}),new c.T7({description:"Date overlay was created"}),new c.yH({description:"Date overlay was last updated"}),new l.XQ({type:l.Bq.SelectModel,key:"user_id",label:"User",description:"User overlay was created by",component:r.y})];var u=n(35366),p=n(28505),g=n(36501),h=n(73234),m=n(63337),f=n(95157),b=n(48865),v=n(38116),_=n(49517),Z=n(34955),x=n(56361),y=n(84369),A=n(77307),w=n(61116),k=n(13536),T=n(80922),C=n(86668),q=n(27701),U=n(54275),I=n(24311),M=n(71765),O=n(47210),J=n(2406),P=n(40450);function N(t,e){1&t&&u._UZ(0,"mat-progress-bar",18)}function S(t,e){1&t&&(u.TgZ(0,"th",1),u._uU(1,"Owner"),u.qZA())}const D=function(t){return{count:t,resource:"overlay(s)"}};function Q(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"tr"),u.TgZ(1,"th",19),u.TgZ(2,"div",20),u._uU(3," :count :resource selected: "),u.qZA(),u.TgZ(4,"div",21),u.TgZ(5,"permission-aware-button",22),u.TgZ(6,"button",23),u.NdJ("click",function(){return u.CHM(t),u.oxw().maybeDeleteSelectedOverlays()}),u._uU(7," Delete "),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.qZA()}if(2&t){const t=e.ngIf;u.xp6(2),u.Q6J("transValues",u.VKq(1,D,t))}}function Y(t,e){if(1&t&&(u.TgZ(0,"td",39),u._UZ(1,"user-column",40),u.qZA()),2&t){const t=u.oxw().$implicit;u.xp6(1),u.Q6J("user",t.user)}}const L=function(t){return["edit",t]};function F(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"tr"),u._UZ(1,"td",24),u.TgZ(2,"td",25),u._uU(3),u.qZA(),u.YNc(4,Y,2,1,"td",26),u.TgZ(5,"td",27),u._uU(6),u.qZA(),u.TgZ(7,"td",28),u._uU(8),u.qZA(),u.TgZ(9,"td",29),u._UZ(10,"mat-icon",30),u.qZA(),u.TgZ(11,"td",31),u._uU(12),u.ALo(13,"formattedDate"),u.qZA(),u.TgZ(14,"td",32),u.TgZ(15,"permission-aware-button",33),u.TgZ(16,"button",34),u.ALo(17,"trans"),u._UZ(18,"mat-icon",35),u.qZA(),u.qZA(),u.TgZ(19,"permission-aware-button",36),u.TgZ(20,"button",37),u.NdJ("click",function(){const e=u.CHM(t).$implicit;return u.oxw().maybeDeleteSelectedOverlays([e.id])}),u._UZ(21,"mat-icon",38),u.qZA(),u.qZA(),u.qZA(),u.qZA()}if(2&t){const t=e.$implicit,n=u.oxw();u.xp6(1),u.Q6J("table-body-checkbox",t.id),u.xp6(2),u.Oqu(t.name),u.xp6(1),u.Q6J("ngIf",n.showUserColumn()),u.xp6(2),u.Oqu(t.message),u.xp6(2),u.Oqu(t.btn_text),u.xp6(2),u.Udp("color",t.colors["bg-color"]),u.xp6(2),u.Oqu(u.lcZ(13,11,t.updated_at)),u.xp6(3),u.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),u.xp6(1),u.Q6J("routerLink",u.VKq(15,L,t.id))("matTooltip",u.lcZ(17,13,"Edit overlay"))}}function E(t,e){1&t&&(u.TgZ(0,"no-results-message",41),u.TgZ(1,"span",42),u._uU(2,"No link overlays have been created yet"),u.qZA(),u.qZA())}let R=(()=>{class t{constructor(t,e,n,i,a,o,s,r){this.datatable=t,this.currentUser=e,this.linkUsage=n,this.linkOverlays=i,this.toast=a,this.route=o,this.workspaces=s,this.activeSection=r,this.filters=d,this.overlays$=this.datatable.data$}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:o.S.BASE_URI,staticParams:{with:["user"],userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}maybeDeleteSelectedOverlays(t){this.datatable.confirmResourceDeletion("link overlays").subscribe(()=>{this.linkOverlays.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.linkUsage.reload(),this.toast.open(i.V.LINK_OVERLAY_DELETE_SUCCESS)},t=>{this.toast.open(t.message||a.v.Default)})})}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=d.filter(t=>"user_id"!==t.key||this.showUserColumn())}}return t.\u0275fac=function(e){return new(e||t)(u.Y36(s.x),u.Y36(p.I),u.Y36(g.F),u.Y36(o.S),u.Y36(h.F),u.Y36(m.gz),u.Y36(f.b),u.Y36(b.W))},t.\u0275cmp=u.Xpm({type:t,selectors:[["link-overlay-index"]],features:[u._Bn([s.x])],decls:41,vars:12,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","overlays",3,"filters"],[1,"action-buttons"],["permission","link_overlays.create"],["mat-raised-button","","color","accent","routerLink","new",1,"button-with-icon"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["trans","",4,"ngIf"],["table-sort-header","clicks_count"],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","popular.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","8"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["permission","link_overlays.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["data-label","Owner",4,"ngIf"],["data-label","Message"],["data-label","Action"],["data-label","Color"],["svgIcon","drop-custom",1,"color-icon"],["data-label","Last Updated"],[1,"edit-column"],["permission","link_overlays.update",3,"userOwnsResource"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","edit"],["permission","link_overlays.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgImage","popular.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(u.TgZ(0,"div",0),u.TgZ(1,"h1",1),u.TgZ(2,"span",1),u._uU(3,"Link Overlays"),u.qZA(),u.TgZ(4,"info-popover"),u.TgZ(5,"span",1),u._uU(6,"Display fully customizable overlay with a message and call-to-action button over destination website."),u.qZA(),u.qZA(),u.qZA(),u.TgZ(7,"div",2),u._UZ(8,"datatable-filters",3),u.TgZ(9,"div",4),u.TgZ(10,"permission-aware-button",5),u.TgZ(11,"button",6),u._UZ(12,"mat-icon",7),u.TgZ(13,"span",1),u._uU(14,"Add New Overlay"),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.TgZ(15,"div",8),u.YNc(16,N,1,0,"mat-progress-bar",9),u.ALo(17,"async"),u.TgZ(18,"table",10),u.TgZ(19,"thead"),u.TgZ(20,"tr"),u._UZ(21,"th",11),u.TgZ(22,"th",12),u._uU(23,"Name"),u.qZA(),u.YNc(24,S,2,0,"th",13),u.TgZ(25,"th",14),u._uU(26,"Message"),u.qZA(),u.TgZ(27,"th",1),u._uU(28,"Action"),u.qZA(),u.TgZ(29,"th",1),u._uU(30,"Color"),u.qZA(),u.TgZ(31,"th",1),u._uU(32,"Last Updated"),u.qZA(),u._UZ(33,"th"),u.qZA(),u.YNc(34,Q,8,3,"tr",15),u.qZA(),u.TgZ(35,"tbody"),u.YNc(36,F,22,17,"tr",16),u.ALo(37,"async"),u.qZA(),u.qZA(),u.YNc(38,E,3,0,"no-results-message",17),u.ALo(39,"async"),u._UZ(40,"datatable-footer"),u.qZA()),2&t&&(u.xp6(8),u.Q6J("filters",e.filters),u.xp6(8),u.Q6J("ngIf",u.lcZ(17,6,e.datatable.paginator&&e.datatable.paginator.loading$)),u.xp6(8),u.Q6J("ngIf",e.showUserColumn()),u.xp6(10),u.Q6J("ngIf",e.datatable.selectedRows$.value.length),u.xp6(2),u.Q6J("ngForOf",u.lcZ(37,8,e.overlays$)),u.xp6(2),u.Q6J("ngIf",u.lcZ(39,10,e.datatable.paginator.noResults$)))},directives:[v.P,_.N,Z.h,x.v,y.lW,m.rH,A.Hw,w.O5,k.e,T.p,w.sg,C.V,q.pW,U.O,I.gM,M.r,O.U],pipes:[w.Ov,J.l,P.R],styles:["h1[_ngcontent-%COMP%]{display:flex;align-items:center}.info-button[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),t})()},72686:function(t,e,n){"use strict";n.d(e,{S:function(){return o}});var i=n(35366),a=n(68515);let o=(()=>{class t{constructor(t){this.http=t}index(e={}){return this.http.get(`${t.BASE_URI}`,e)}get(e){return this.http.get(`${t.BASE_URI}/${e}`)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}}return t.BASE_URI="link-overlay",t.\u0275fac=function(e){return new(e||t)(i.LFG(a.r))},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},87829:function(t,e,n){"use strict";n.d(e,{P:function(){return R}});var i,a,o=n(64762),s=n(92935),r=n(78512),l=n(32198),c=n(67455),d=n(99713),u=n(11520),p=n(8839),g="function"==typeof Map?new Map:(i=[],a=[],{has:function(t){return i.indexOf(t)>-1},get:function(t){return a[i.indexOf(t)]},set:function(t,e){-1===i.indexOf(t)&&(i.push(t),a.push(e))},delete:function(t){var e=i.indexOf(t);e>-1&&(i.splice(e,1),a.splice(e,1))}}),h=function(t){return new Event(t,{bubbles:!0})};try{new Event("test")}catch(i){h=function(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!1),e}}function m(t){var e=g.get(t);e&&e.destroy()}function f(t){var e=g.get(t);e&&e.update()}var b=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((b=function(t){return t}).destroy=function(t){return t},b.update=function(t){return t}):((b=function(t,e){return t&&Array.prototype.forEach.call(t.length?t:[t],function(t){return function(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!g.has(t)){var e,n=null,i=null,a=null,o=function(){t.clientWidth!==i&&c()},s=(function(e){window.removeEventListener("resize",o,!1),t.removeEventListener("input",c,!1),t.removeEventListener("keyup",c,!1),t.removeEventListener("autosize:destroy",s,!1),t.removeEventListener("autosize:update",c,!1),Object.keys(e).forEach(function(n){t.style[n]=e[n]}),g.delete(t)}).bind(t,{height:t.style.height,resize:t.style.resize,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",s,!1),"onpropertychange"in t&&"oninput"in t&&t.addEventListener("keyup",c,!1),window.addEventListener("resize",o,!1),t.addEventListener("input",c,!1),t.addEventListener("autosize:update",c,!1),t.style.overflowX="hidden",t.style.wordWrap="break-word",g.set(t,{destroy:s,update:c}),"vertical"===(e=window.getComputedStyle(t,null)).resize?t.style.resize="none":"both"===e.resize&&(t.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),c()}function r(e){var n=t.style.width;t.style.width="0px",t.style.width=n,t.style.overflowY=e}function l(){if(0!==t.scrollHeight){var e=function(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&e.push({node:t.parentNode,scrollTop:t.parentNode.scrollTop}),t=t.parentNode;return e}(t),a=document.documentElement&&document.documentElement.scrollTop;t.style.height="",t.style.height=t.scrollHeight+n+"px",i=t.clientWidth,e.forEach(function(t){t.node.scrollTop=t.scrollTop}),a&&(document.documentElement.scrollTop=a)}}function c(){l();var e=Math.round(parseFloat(t.style.height)),n=window.getComputedStyle(t,null),i="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):t.offsetHeight;if(i<e?"hidden"===n.overflowY&&(r("scroll"),l(),i="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(t,null).height)):t.offsetHeight):"hidden"!==n.overflowY&&(r("hidden"),l(),i="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(t,null).height)):t.offsetHeight),a!==i){a=i;var o=h("autosize:resized");try{t.dispatchEvent(o)}catch(t){}}}}(t)}),t}).destroy=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],m),t},b.update=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],f),t});var v=b,_=n(63589),Z=n(35366),x=n(38116),y=n(61116),A=n(78671);function w(t,e){if(1&t&&Z._UZ(0,"share-link-btns",2),2&t){const t=Z.oxw();Z.Q6J("showCopyBtn",!0)("link",t.data.link)}}let k=(()=>{class t{constructor(t){this.data=t,this.message=this.data.createMsg||c.V.LINK_CREATE_SUCCESS}}return t.\u0275fac=function(e){return new(e||t)(Z.Y36(_.qD))},t.\u0275cmp=Z.Xpm({type:t,selectors:[["link-created-message"]],decls:3,vars:2,consts:[["trans",""],[3,"showCopyBtn","link",4,"ngIf"],[3,"showCopyBtn","link"]],template:function(t,e){1&t&&(Z.TgZ(0,"div",0),Z._uU(1),Z.qZA(),Z.YNc(2,w,1,2,"share-link-btns",1)),2&t&&(Z.xp6(1),Z.Oqu(e.message),Z.xp6(1),Z.Q6J("ngIf",e.data.link))},directives:[x.P,y.O5,A.t],styles:["[_nghost-%COMP%]{display:flex;align-items:center}share-link-btns[_ngcontent-%COMP%]{margin-left:auto}  .link-created-snackbar{padding-top:4px;padding-bottom:4px}"],changeDetection:0}),t})();var T=n(84222),C=n(73234),q=n(541),U=n(28505),I=n(88195),M=n(3950),O=n(2862);const J=["textarea"];function P(t,e){1&t&&(Z.TgZ(0,"span"),Z._uU(1,"Edit Link"),Z.qZA())}function N(t,e){1&t&&(Z.TgZ(0,"span",10),Z._uU(1,"New Link"),Z.qZA())}function S(t,e){if(1&t&&(Z.TgZ(0,"div",23),Z._uU(1),Z.qZA()),2&t){const t=Z.oxw(2).ngIf;Z.xp6(1),Z.Oqu(t.long_urls)}}function D(t,e){if(1&t&&(Z.TgZ(0,"div",18),Z.TgZ(1,"label",19),Z._uU(2,"Multiple URLs (one per line)"),Z.qZA(),Z._UZ(3,"textarea",20,21),Z.YNc(5,S,2,1,"div",22),Z.qZA()),2&t){const t=Z.oxw().ngIf;Z.xp6(5),Z.Q6J("ngIf",t.long_urls)}}function Q(t,e){if(1&t&&(Z.ynx(0),Z.TgZ(1,"button",29),Z.TgZ(2,"span",10),Z._uU(3),Z.qZA(),Z._UZ(4,"mat-icon",30),Z.qZA(),Z._UZ(5,"link-type-menu",31,32),Z.ALo(7,"async"),Z.BQk()),2&t){const t=Z.MAs(6),e=Z.oxw(3);Z.xp6(1),Z.Q6J("matMenuTriggerFor",t.matMenu),Z.xp6(2),Z.Oqu(e.typeViewName()),Z.xp6(2),Z.Q6J("linkOptions",Z.lcZ(7,3,e.linkOptions$))}}function Y(t,e){if(1&t&&(Z.TgZ(0,"div",23),Z._uU(1),Z.qZA()),2&t){const t=Z.oxw(2).ngIf;Z.xp6(1),Z.Oqu(t.long_url)}}function L(t,e){if(1&t){const t=Z.EpF();Z.TgZ(0,"div",24),Z.TgZ(1,"label",25),Z._uU(2,"Paste long url"),Z.qZA(),Z.TgZ(3,"div",26),Z.TgZ(4,"textarea",27,21),Z.NdJ("enterPressed",function(){return Z.CHM(t),Z.oxw(2).createOrUpdate()}),Z.qZA(),Z.YNc(6,Q,8,5,"ng-container",28),Z.qZA(),Z.YNc(7,Y,2,1,"div",22),Z.qZA()}if(2&t){const t=Z.oxw().ngIf,e=Z.oxw();Z.xp6(4),Z.Q6J("minlength",e.minLen)("maxlength",e.maxLen),Z.xp6(2),Z.Q6J("ngIf",e.settings.get("links.enable_type")),Z.xp6(1),Z.Q6J("ngIf",t.long_url)}}function F(t,e){if(1&t){const t=Z.EpF();Z.ynx(0,11),Z.YNc(1,D,6,1,"div",12),Z.YNc(2,L,8,4,"ng-template",null,13,Z.W1O),Z.TgZ(4,"div",14),Z.TgZ(5,"button",15),Z.NdJ("click",function(){return Z.CHM(t),Z.oxw().toggleOptions()}),Z._UZ(6,"mat-icon",16),Z.TgZ(7,"span",10),Z._uU(8,"Advanced Options"),Z.qZA(),Z.qZA(),Z.qZA(),Z._UZ(9,"link-options-form",17),Z.ALo(10,"async"),Z.ALo(11,"async"),Z.BQk()}if(2&t){const t=Z.MAs(3),e=Z.oxw();Z.Q6J("formGroup",e.linkForm.formGroup),Z.xp6(1),Z.Q6J("ngIf",e.data.batch)("ngIfElse",t),Z.xp6(8),Z.Q6J("featuresToHide",e.data.featuresToHide)("@bodyExpansion",Z.lcZ(10,7,e.optionsVisible$))("linkOptions",Z.lcZ(11,9,e.linkOptions$))("batch",e.data.batch)}}function E(t,e){if(1&t&&Z._UZ(0,"share-link-btns",33),2&t){const t=Z.oxw();Z.Q6J("showCopyBtn",!0)("link",t.data.link)}}let R=(()=>{class t{constructor(t,e,n,i,a,o,s,l,c,d){this.dialogRef=t,this.data=e,this.linkForm=n,this.links=i,this.toast=a,this.selectValues=o,this.currentUser=s,this.settings=l,this.i18n=c,this.recaptcha=d,this.loading$=new r.X(!1),this.updating$=new r.X(!1),this.optionsVisible$=new r.X(!1),this.linkOptions$=new r.X(null),this.minLen=this.settings.get("links.min_len"),this.maxLen=this.settings.get("links.max_len"),e.link&&(this.updating$.next(!0),this.linkForm.patchValue(e.link))}ngOnInit(){this.selectValues.get().subscribe(t=>{this.linkOptions$.next(t)})}ngAfterViewInit(){v(this.textarea.nativeElement)}createOrUpdate(){return(0,o.mG)(this,void 0,void 0,function*(){const t=this.getPayload();return this.urlInvalid(t.long_url)?this.linkForm.setErrors({long_url:this.i18n.t("This url is invalid.")}):(this.loading$.next(!0),(yield this.recaptcha.verify("link_creation"))?void(this.updating$.value?this.links.update(this.data.link.id,t):this.links.create(t)).pipe((0,u.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.updating$.value?this.toast.open(c.V.LINK_UPDATE_SUCCESS):this.toast.openComponent(k,{data:{link:t.link,createMsg:this.data.createMsg},duration:6e3,panelClass:"link-created-snackbar"}),this.close(t.link)},t=>this.linkForm.setErrors(t.errors)):this.loading$.next(!1))})}shortenBatchUrls(){return(0,o.mG)(this,void 0,void 0,function*(){const t=this.getPayload();return t.long_urls.some(t=>this.urlInvalid(t))?this.linkForm.setErrors({long_urls:this.i18n.t("Some of the urls are not valid.")}):(this.loading$.next(!0),(yield this.recaptcha.verify("link_creation"))?void this.links.createBatch(t).pipe((0,u.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open(c.V.MULTIPLE_LINKS_CREATE_SUCCESS),this.close(t.links)},t=>this.linkForm.setErrors(t.errors)):this.loading$.next(!1))})}close(t){this.dialogRef.close(t)}toggleOptions(){this.optionsVisible$.next(!this.optionsVisible$.value)}typeViewName(){return this.linkForm.formGroup.get("type").value.split(":")[0]}getPayload(){const t=this.linkForm.value();return this.data.groups&&(t.groups=Object.assign(Object.assign({},t.groups),this.data.groups)),t}urlInvalid(t){return!p({exact:!0,strict:!1}).test(t)}}return t.\u0275fac=function(e){return new(e||t)(Z.Y36(s.so),Z.Y36(s.WI),Z.Y36(l.l),Z.Y36(T.M),Z.Y36(C.F),Z.Y36(q.U),Z.Y36(U.I),Z.Y36(I.Z),Z.Y36(M.Z),Z.Y36(O.K))},t.\u0275cmp=Z.Xpm({type:t,selectors:[["crupdate-link-modal"]],viewQuery:function(t,e){if(1&t&&Z.Gf(J,5),2&t){let t;Z.iGM(t=Z.CRH())&&(e.textarea=t.first)}},features:[Z._Bn([l.l])],decls:18,vars:11,consts:[[1,"modal-header"],["mat-dialog-title",""],[4,"ngIf","ngIfElse"],["creating",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"ngSubmit"],[3,"formGroup",4,"ngIf"],["class","colored dialog-actions-left",3,"showCopyBtn","link",4,"ngIf"],["type","submit","mat-raised-button","","color","accent","trans","",1,"submit-button",3,"disabled"],["trans",""],[3,"formGroup"],["class","input-container",4,"ngIf","ngIfElse"],["single",""],[1,"actions"],["type","button","mat-button","",1,"advanced-options-btn",3,"click"],["svgIcon","settings"],[3,"featuresToHide","linkOptions","batch"],[1,"input-container"],["for","link-dialog-multiple-urls","trans",""],["name","link-dialog-multiple-urls","id","link-dialog-multiple-urls","autocomplete","off","spellcheck","false","formControlName","long_urls",1,"multiple-link-textarea"],["textarea",""],["class","error",4,"ngIf"],[1,"error"],[1,"input-container","link-input-container"],["for","link-dialog-long-url","trans","",1,"hidden"],[1,"input-with-action"],["type","text","id","link-dialog-long-url","autocomplete","off","spellcheck","false","enterKeybind","","formControlName","long_url","placeholder","Enter long url...","trans-placeholder","","required","",1,"single-link-textarea",3,"minlength","maxlength","enterPressed"],[4,"ngIf"],["mat-flat-button","","color","gray","type","button",1,"type-button",3,"matMenuTriggerFor"],["svgIcon","arrow-drop-down"],["formControlName","type",3,"linkOptions"],["linkTypeMenu",""],[1,"colored","dialog-actions-left",3,"showCopyBtn","link"]],template:function(t,e){if(1&t&&(Z.TgZ(0,"div",0),Z.TgZ(1,"h2",1),Z.GkF(2),Z.YNc(3,P,2,0,"span",2),Z.ALo(4,"async"),Z.YNc(5,N,2,0,"ng-template",null,3,Z.W1O),Z.qZA(),Z.TgZ(7,"button",4),Z.NdJ("click",function(){return e.close()}),Z._UZ(8,"mat-icon",5),Z.qZA(),Z.qZA(),Z.TgZ(9,"form",6),Z.NdJ("ngSubmit",function(){return e.data.batch?e.shortenBatchUrls():e.createOrUpdate()}),Z.TgZ(10,"mat-dialog-content"),Z.YNc(11,F,12,11,"ng-container",7),Z.ALo(12,"async"),Z.qZA(),Z.TgZ(13,"mat-dialog-actions"),Z.YNc(14,E,1,2,"share-link-btns",8),Z.TgZ(15,"button",9),Z.ALo(16,"async"),Z._uU(17," Confirm "),Z.qZA(),Z.qZA(),Z.qZA()),2&t){const t=Z.MAs(6);Z.xp6(3),Z.Q6J("ngIf",Z.lcZ(4,5,e.updating$))("ngIfElse",t),Z.xp6(8),Z.Q6J("ngIf",Z.lcZ(12,7,e.linkForm.errors$)),Z.xp6(3),Z.Q6J("ngIf",e.data.link),Z.xp6(1),Z.Q6J("disabled",Z.lcZ(16,9,e.loading$))}},styles:["[_nghost-%COMP%]{display:block;width:650px;max-width:100%}.single-link-textarea[_ngcontent-%COMP%]{max-height:130px;height:46px;border-right:1px solid var(--be-divider-default)!important}.multiple-link-textarea[_ngcontent-%COMP%]{height:242px;max-height:300px}textarea[_ngcontent-%COMP%]{resize:vertical;word-break:break-all;font-size:1.5rem;line-height:1.5}.link-input-container[_ngcontent-%COMP%]{margin-bottom:5px}.type-container[_ngcontent-%COMP%]{margin-left:auto;width:auto;min-width:100px}.type-button[_ngcontent-%COMP%]{text-transform:capitalize;max-height:46px}.type-button[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{margin-bottom:3px}.advanced-options-btn[_ngcontent-%COMP%]{padding:0 6px;margin-left:-6px;overflow:hidden}.advanced-options-btn[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{margin-right:5px}.dialog-actions-left[_ngcontent-%COMP%]{margin-right:auto}.mat-dialog-actions[_ngcontent-%COMP%]{margin-top:15px}.submit-button[_ngcontent-%COMP%]{width:120px;line-height:40px}@media screen and (max-width:768px){.multiple-toggle[_ngcontent-%COMP%]{display:none}}"],data:{animation:[(0,d.X$)("bodyExpansion",[(0,d.SB)("false",(0,d.oB)({height:"0px",visibility:"hidden"})),(0,d.SB)("true",(0,d.oB)({height:"*",visibility:"visible"})),(0,d.eR)("true <=> false",(0,d.jt)("225ms cubic-bezier(0.4,0.0,0.2,1)"))])]},changeDetection:0}),t})()},541:function(t,e,n){"use strict";n.d(e,{U:function(){return r}});var i=n(25051),a=n(35366),o=n(9823),s=n(28505);let r=(()=>{class t{constructor(t,e){this.http=t,this.currentUser=e}get(){return this.http.getWithCache(`${i.l.BASE_URI}/${["countries","domains","pages","overlays","pixels","groups"].join(",")}`,{userId:this.currentUser.get("id"),pageType:"link_page"})}clearCache(){this.http.clearCache()}}return t.\u0275fac=function(e){return new(e||t)(a.LFG(o.F),a.LFG(s.I))},t.\u0275prov=a.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},85706:function(t,e,n){"use strict";n.d(e,{f:function(){return s}});var i=n(59075),a=n(45523),o=n(44415);const s=[new i.XQ({type:i.Bq.Select,key:"type",description:"Type of the link",defaultValue:"direct",options:[{key:"All",value:""},{key:"Direct",value:"direct"},{key:"Overlay",value:"overlay"},{key:"Frame",value:"frame"},{key:"Custom Page",value:"link_page"}]}),new i.XQ({type:i.Bq.Select,key:"active",label:"status",defaultValue:!1,description:"Whether link is disabled or not",options:[{key:"enabled",value:!1},{key:"disabled",value:!0}]}),new i.XQ({type:i.Bq.Select,key:"password",description:"Whether link is password protected",options:[{key:"any",value:""},{key:"does not have password",value:{value:null,operator:i.pg.eq}},{key:"has password",value:{value:null,operator:i.pg.ne}}]}),new i.XQ({type:i.Bq.Input,inputType:"number",key:"clicks_count",label:"Click Count",description:"Total number of clicks for link",defaultValue:1,defaultOperator:i.pg.gte,operators:i.Hi}),new a.k4({key:"clicked_at",label:"Clicked At",description:"Date the link was last clicked"}),new a.k4({key:"expires_at",label:"Expires At",description:"Date the link will expire"}),new a.T7({description:"Date link was created"}),new a.yH({description:"Date link was last updated"}),new i.XQ({type:i.Bq.SelectModel,key:"user_id",label:"User",description:"User link was created by",component:o.y})]},32656:function(t,e,n){"use strict";n.d(e,{g:function(){return vt}});var i=n(36024),a=n(87829),o=n(84222),s=n(56515),r=n(67455),l=n(85706),c=n(16980),d=n(78512),u=n(4694),p=n(92935),g=n(40878),h=n(31041),m=n(56238),f=n(47701),b=n(98720),v=n(44689),_=n(47727),Z=n(11520),x=n(79996),y=n(35366),A=n(28505),w=n(73234),k=n(48865),T=n(95157),C=n(38116),q=n(77307),U=n(61116),I=n(27701),M=n(47210),O=n(40985);function J(t,e){1&t&&y._UZ(0,"mat-progress-bar",8)}function P(t,e){if(1&t){const t=y.EpF();y.TgZ(0,"div",12),y.NdJ("click",function(){const e=y.CHM(t).$implicit;return y.oxw(2).confirm(e)}),y._UZ(1,"img",13),y.ALo(2,"favicon"),y.TgZ(3,"button",14),y.ALo(4,"async"),y.TgZ(5,"span",15),y._uU(6),y.qZA(),y.TgZ(7,"span",16),y._uU(8),y.qZA(),y.qZA(),y.qZA()}if(2&t){const t=e.$implicit,n=y.oxw(2);y.xp6(1),y.Q6J("src",y.lcZ(2,4,t.long_url),y.LSH),y.xp6(2),y.Q6J("disabled",y.lcZ(4,6,n.loading$)),y.xp6(3),y.Oqu(t.long_url),y.xp6(2),y.Oqu(t.short_url)}}function N(t,e){1&t&&(y.TgZ(0,"div",17),y.TgZ(1,"no-results-message"),y.TgZ(2,"span",18),y._uU(3,"Could not find any links matching this query."),y.qZA(),y.qZA(),y.qZA())}function S(t,e){if(1&t&&(y.TgZ(0,"div",9),y.YNc(1,P,9,8,"div",10),y.YNc(2,N,4,0,"div",11),y.qZA()),2&t){const t=e.ngIf;y.xp6(1),y.Q6J("ngForOf",t),y.xp6(1),y.Q6J("ngIf",!t.length)}}let D=(()=>{class t{constructor(t,e,n,i,a,o,s,r){this.dialogRef=t,this.data=e,this.linkGroup=n,this.link=i,this.currentUser=a,this.toast=o,this.activeSection=s,this.workspaces=r,this.loading$=new d.X(!1),this.links$=new d.X(null),this.searchControl=new h.NI}ngOnInit(){this.searchControl.valueChanges.pipe((0,m.O)(""),(0,f.b)(250),(0,b.x)(),(0,v.w)(t=>this.findLinks(t)),(0,_.K)(()=>(0,g.of)([]))).subscribe(t=>{this.links$.next(t),this.loading$.next(!1)})}close(t){this.dialogRef.close(t)}confirm(t){this.loading$.next(!0),this.linkGroup.attach(this.data.groupId,[t.id]).pipe((0,Z.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open(r.V.LINK_ATTACH_SUCCESS),this.close(t)})}findLinks(t){this.loading$.next(!0);const e="!"+this.data.groupId,n=this.forCurrentUser()?this.currentUser.get("id"):null;return this.link.index({query:t,userId:n,groupId:e,per_page:8}).pipe((0,x.U)(t=>t.pagination.data))}forCurrentUser(){return!this.activeSection.admin&&!this.workspaces.activeId$.value}}return t.\u0275fac=function(e){return new(e||t)(y.Y36(p.so),y.Y36(p.WI),y.Y36(c.L),y.Y36(o.M),y.Y36(A.I),y.Y36(w.F),y.Y36(k.W),y.Y36(T.b))},t.\u0275cmp=y.Xpm({type:t,selectors:[["attach-link-modal"]],decls:12,vars:7,consts:[[1,"modal-header"],["mat-dialog-title","","trans",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],[1,"input-container"],["type","text","placeholder","Search for links...",3,"formControl"],["mode","indeterminate","color","accent",4,"ngIf"],["class","links",4,"ngIf"],["mode","indeterminate","color","accent"],[1,"links"],["class","link",3,"click",4,"ngFor","ngForOf"],["class","link",4,"ngIf"],[1,"link",3,"click"],[3,"src"],[1,"meta","overflow-hidden","no-style",3,"disabled"],[1,"long-url","overflow-hidden"],[1,"short-url","overflow-hidden"],[1,"link"],["secondary-text","","trans",""]],template:function(t,e){1&t&&(y.TgZ(0,"div",0),y.TgZ(1,"h2",1),y._uU(2,"Add Existing Links to Group"),y.qZA(),y.TgZ(3,"button",2),y.NdJ("click",function(){return e.close()}),y._UZ(4,"mat-icon",3),y.qZA(),y.qZA(),y.TgZ(5,"mat-dialog-content"),y.TgZ(6,"div",4),y._UZ(7,"input",5),y.YNc(8,J,1,0,"mat-progress-bar",6),y.ALo(9,"async"),y.qZA(),y.YNc(10,S,3,2,"div",7),y.ALo(11,"async"),y.qZA()),2&t&&(y.xp6(7),y.Q6J("formControl",e.searchControl),y.xp6(1),y.Q6J("ngIf",y.lcZ(9,3,e.loading$)),y.xp6(2),y.Q6J("ngIf",y.lcZ(11,5,e.links$)))},directives:[p.uh,C.P,q.Hw,p.xY,h.Fj,h.JJ,h.oH,U.O5,I.pW,U.sg,M.U],pipes:[U.Ov,O.K],styles:["[_nghost-%COMP%]{display:block;width:450px;max-width:100%}.modal-header[_ngcontent-%COMP%]{margin-bottom:15px}.input-container[_ngcontent-%COMP%]{width:100%;margin-bottom:30px;position:relative}.mat-progress-bar[_ngcontent-%COMP%]{position:absolute;bottom:0}.link[_ngcontent-%COMP%]{display:flex;margin-bottom:20px;cursor:pointer}.link[_ngcontent-%COMP%]:hover   .overflow-hidden[_ngcontent-%COMP%]{color:var(--be-primary-default)}.link[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:25px;height:25px;flex-shrink:0;margin-right:10px;border-radius:4px;overflow:hidden}.link[_ngcontent-%COMP%]   .long-url[_ngcontent-%COMP%]{color:var(--be-text);font-weight:500;margin-bottom:5px}.link[_ngcontent-%COMP%]   .short-url[_ngcontent-%COMP%]{color:var(--be-secondary-text);font-size:1.3rem}.overflow-hidden[_ngcontent-%COMP%]{display:block;overflow:hidden;text-overflow:ellipsis}"],changeDetection:0}),t})();var Q=n(63337),Y=n(36501),L=n(37123),F=n(24859),E=n(34955),R=n(84369),$=n(97070),V=n(56361),B=n(13536),H=n(80922),z=n(86668),G=n(54275),j=n(24311),X=n(19708),W=n(71765);let K=(()=>{class t{transform(t){return t&&t.replace(/(^\w+:|^)\/\//,"")}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=y.Yjl({name:"removeProtocol",type:t,pure:!0}),t})();var tt=n(40450),et=n(2406);const nt=function(t){return{groupName:t}};function it(t,e){1&t&&(y.TgZ(0,"span",30),y._uU(1,' Links for ":groupName" '),y.qZA()),2&t&&y.Q6J("transValues",y.VKq(1,nt,e.ngIf.name))}function at(t,e){if(1&t&&(y.ynx(0),y.TgZ(1,"a",27),y._UZ(2,"mat-icon",28),y.qZA(),y.YNc(3,it,2,3,"span",29),y.ALo(4,"async"),y.BQk()),2&t){const t=y.oxw();y.xp6(3),y.Q6J("ngIf",y.lcZ(4,1,t.group$))}}function ot(t,e){1&t&&(y.TgZ(0,"span",7),y._uU(1,"Links"),y.qZA())}function st(t,e){if(1&t){const t=y.EpF();y.TgZ(0,"permission-aware-button",31),y.TgZ(1,"button",12),y.NdJ("click",function(){return y.CHM(t),y.oxw().showAttachLinksToGroupModal()}),y._UZ(2,"mat-icon",32),y.TgZ(3,"span",7),y._uU(4,"Move existing links to this group"),y.qZA(),y.qZA(),y.qZA()}}function rt(t,e){1&t&&y._UZ(0,"mat-progress-bar",33)}function lt(t,e){1&t&&(y.ynx(0),y.TgZ(1,"th",34),y._uU(2,"Owner"),y.qZA(),y.BQk())}function ct(t,e){if(1&t){const t=y.EpF();y.TgZ(0,"button",41),y.NdJ("click",function(){return y.CHM(t),y.oxw(2).maybeDetachLinksFromGroup()}),y._uU(1," Detach from group "),y.qZA()}}const dt=function(t){return{count:t,resource:"link(s)"}};function ut(t,e){if(1&t){const t=y.EpF();y.TgZ(0,"tr"),y.TgZ(1,"th",35),y.TgZ(2,"div",36),y._uU(3," :count :resource selected: "),y.qZA(),y.TgZ(4,"div",37),y.YNc(5,ct,2,0,"button",38),y.TgZ(6,"permission-aware-button",39),y.TgZ(7,"button",40),y.NdJ("click",function(){return y.CHM(t),y.oxw().maybeDeleteSelectedLinks()}),y._uU(8," Delete "),y.qZA(),y.qZA(),y.qZA(),y.qZA(),y.qZA()}if(2&t){const t=e.ngIf,n=y.oxw();y.xp6(2),y.Q6J("transValues",y.VKq(2,dt,t)),y.xp6(3),y.Q6J("ngIf",n.groupId)}}function pt(t,e){if(1&t&&(y.TgZ(0,"td",65),y._UZ(1,"user-column",66),y.qZA()),2&t){const t=y.oxw().$implicit;y.xp6(1),y.Q6J("user",t.user)}}function gt(t,e){1&t&&y._UZ(0,"mat-icon",67)}function ht(t,e){1&t&&(y.TgZ(0,"span"),y._uU(1,"-"),y.qZA())}const mt=function(t,e){return["/",t,"links",e]};function ft(t,e){if(1&t){const t=y.EpF();y.TgZ(0,"tr"),y._UZ(1,"td",42),y.TgZ(2,"td",43),y.TgZ(3,"a",44),y._UZ(4,"img",45),y.ALo(5,"favicon"),y.TgZ(6,"span"),y._uU(7),y.ALo(8,"slice"),y.ALo(9,"removeProtocol"),y.qZA(),y.qZA(),y.TgZ(10,"div",46),y.TgZ(11,"a",47),y._uU(12),y.qZA(),y.qZA(),y.qZA(),y.YNc(13,pt,2,1,"td",48),y.TgZ(14,"td",49),y._uU(15),y.ALo(16,"number"),y.qZA(),y.TgZ(17,"td",50),y._uU(18),y.qZA(),y.TgZ(19,"td",51),y.YNc(20,gt,1,0,"mat-icon",52),y.YNc(21,ht,2,0,"span",1),y.qZA(),y.TgZ(22,"td",53),y._uU(23),y.ALo(24,"trans"),y.ALo(25,"formattedDate"),y.qZA(),y.TgZ(26,"td",54),y._uU(27),y.ALo(28,"formattedDate"),y.qZA(),y.TgZ(29,"td",55),y.TgZ(30,"a",56),y.ALo(31,"trans"),y._UZ(32,"mat-icon",57),y.qZA(),y._UZ(33,"copy-link-btn",58),y.TgZ(34,"permission-aware-button",59),y.TgZ(35,"button",60),y.NdJ("click",function(){const e=y.CHM(t).$implicit;return y.oxw().showCrupdateLinkModal(e)}),y.ALo(36,"trans"),y._UZ(37,"mat-icon",61),y.qZA(),y.qZA(),y.TgZ(38,"permission-aware-button",62),y.TgZ(39,"button",63),y.NdJ("click",function(){const e=y.CHM(t).$implicit;return y.oxw().maybeDeleteSelectedLinks([e.id])}),y.ALo(40,"trans"),y._UZ(41,"mat-icon",64),y.qZA(),y.qZA(),y.qZA(),y.qZA()}if(2&t){const t=e.$implicit,n=y.oxw();y.xp6(1),y.Q6J("table-body-checkbox",t.id),y.xp6(2),y.Q6J("href",t.long_url,y.LSH),y.xp6(1),y.Q6J("src",y.lcZ(5,20,t.long_url),y.LSH),y.xp6(3),y.Oqu(y.Dn7(8,22,y.lcZ(9,26,t.long_url),0,50)),y.xp6(4),y.Q6J("href",t.short_url,y.LSH),y.xp6(1),y.Oqu(t.short_url),y.xp6(1),y.Q6J("ngIf",n.showUserColumn()),y.xp6(2),y.Oqu(y.lcZ(16,28,t.clicks_count)),y.xp6(3),y.Oqu(t.type),y.xp6(2),y.Q6J("ngIf",t.has_password),y.xp6(1),y.Q6J("ngIf",!t.has_password),y.xp6(2),y.hij(" ",t.deleted_at?y.lcZ(24,30,"Expired"):t.expires_at?y.lcZ(25,32,t.expires_at):"-"," "),y.xp6(4),y.Oqu(t.clicked_at?y.lcZ(28,34,t.clicked_at):"-"),y.xp6(3),y.Q6J("routerLink",y.WLB(42,mt,n.getParentRoute(),t.id))("matTooltip",y.lcZ(31,36,"Link Statistics")),y.xp6(3),y.Q6J("model",t),y.xp6(1),y.Q6J("userOwnsResource",t.user_id===n.currentUser.get("id")),y.xp6(1),y.Q6J("matTooltip",y.lcZ(36,38,"Edit link")),y.xp6(3),y.Q6J("userOwnsResource",t.user_id===n.currentUser.get("id")),y.xp6(1),y.Q6J("matTooltip",y.lcZ(40,40,"Delete link"))}}function bt(t,e){1&t&&(y.TgZ(0,"no-results-message",68),y.TgZ(1,"span",69),y._uU(2,"No links have been added yet"),y.qZA(),y.qZA())}let vt=(()=>{class t{constructor(t,e,n,i,a,o,s,r,l,c,u,p){this.datatable=t,this.currentUser=e,this.links=n,this.toast=i,this.route=a,this.linkUsage=o,this.csv=s,this.router=r,this.modal=l,this.groups=c,this.workspaces=u,this.activeSection=p,this.group$=new d.X(null),this.links$=this.datatable.data$}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:this.groupId?`${c.L.BASE_URI}/${this.groupId}/links`:o.M.BASE_URI,staticParams:{with:["user"],userId:this.showUserColumn()?null:this.currentUser.get("id")}}),this.groupId&&this.datatable.paginator.response$.subscribe(t=>{this.group$.next(null==t?void 0:t.linkGroup)})}ngOnDestroy(){this.workspaceSub.unsubscribe()}maybeDeleteSelectedLinks(t){this.datatable.confirmResourceDeletion("links").subscribe(()=>{this.links.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.linkUsage.reload(),this.toast.open(r.V.LINK_DELETE_SUCCESS)},t=>{this.toast.open(t.message||i.v.Default)})})}showAttachLinksToGroupModal(){this.modal.open(D,{groupId:this.groupId}).beforeClosed().subscribe(t=>{t&&this.datatable.reset()})}maybeDetachLinksFromGroup(){this.modal.open(u.z,{title:"Detach Links",body:"Are you sure you want to detach selected links from this group?",ok:"Detach"}).afterClosed().subscribe(t=>{t&&this.groups.detach(this.groupId,this.datatable.selectedRows$.value).subscribe(()=>this.datatable.reset(),t=>{this.toast.open(t.message||i.v.Default)})})}showCrupdateLinkModal(t,e){this.datatable.openCrupdateResourceModal(a.P,{link:t,groups:{[this.groupId]:{}},batch:e}).subscribe(()=>this.linkUsage.reload())}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=l.f.filter(t=>"user_id"!==t.key||this.showUserColumn())}exportCsv(){this.csv.export(o.M.EXPORT_CSV_URI,{type:this.activeSection.admin?"all":null})}getParentRoute(){return this.activeSection.admin?"admin":"dashboard"}}return t.\u0275fac=function(e){return new(e||t)(y.Y36(s.x),y.Y36(A.I),y.Y36(o.M),y.Y36(w.F),y.Y36(Q.gz),y.Y36(Y.F),y.Y36(L.T),y.Y36(Q.F0),y.Y36(F.u),y.Y36(c.L),y.Y36(T.b),y.Y36(k.W))},t.\u0275cmp=y.Xpm({type:t,selectors:[["link-index"]],inputs:{groupId:"groupId"},features:[y._Bn([s.x])],decls:56,vars:18,consts:[[1,"datatable-page-header"],[4,"ngIf"],["trans","",4,"ngIf"],[1,"header"],["pluralName","links",3,"filters"],[1,"action-buttons"],["mat-raised-button","",1,"btn-with-dropdown-icon",3,"matMenuTriggerFor"],["trans",""],["svgIcon","keyboard-arrow-down"],["menu","matMenu"],["permission","link_groups.update",4,"ngIf"],["permission","links.create"],["mat-menu-item","",3,"click"],["svgIcon","add-link"],["svgIcon","export-csv"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","clicks_count"],["table-sort-header","","trans",""],["table-sort-header","expires_at","trans",""],["table-sort-header","clicked_at","trans",""],[4,"ngFor","ngForOf"],["svgImage","share-link.svg",4,"ngIf"],["routerLink","../../","mat-icon-button","",1,"back-button"],["svgIcon","arrow-back"],["trans","",3,"transValues",4,"ngIf"],["trans","",3,"transValues"],["permission","link_groups.update"],["svgIcon","shortcut"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","user_id","trans",""],["colspan","9"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["type","button","mat-raised-button","","color","accent","trans","",3,"click",4,"ngIf"],["permission","links.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],["type","button","mat-raised-button","","color","accent","trans","",3,"click"],[3,"table-body-checkbox"],[1,"link-summary-column","mobile-no-label"],["target","_blank",1,"long-url",3,"href"],["alt","Link favicon",1,"favicon-img",3,"src"],[1,"short-url"],["target","_blank",3,"href"],["data-label","Owner",4,"ngIf"],["data-label","Clicks"],["data-label","Type",1,"capitalize"],["data-label","Password"],["svgIcon","check",4,"ngIf"],["data-label","Expires At"],["data-label","Last Clicked"],[1,"edit-column"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","analytics"],[3,"model"],["permission","links.update",3,"userOwnsResource"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["permission","links.delete",3,"userOwnsResource"],["mat-icon-button","",1,"visible-on-mobile",3,"matTooltip","click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgIcon","check"],["svgImage","share-link.svg"],["primary-text","","trans",""]],template:function(t,e){if(1&t&&(y.TgZ(0,"div",0),y.TgZ(1,"h1"),y.YNc(2,at,5,3,"ng-container",1),y.YNc(3,ot,2,0,"span",2),y.qZA(),y.TgZ(4,"div",3),y._UZ(5,"datatable-filters",4),y.TgZ(6,"div",5),y.TgZ(7,"button",6),y.TgZ(8,"span",7),y._uU(9,"More Actions"),y.qZA(),y._UZ(10,"mat-icon",8),y.qZA(),y.TgZ(11,"mat-menu",null,9),y.YNc(13,st,5,0,"permission-aware-button",10),y.TgZ(14,"permission-aware-button",11),y.TgZ(15,"button",12),y.NdJ("click",function(){return e.showCrupdateLinkModal(null,!0)}),y._UZ(16,"mat-icon",13),y.TgZ(17,"span",7),y._uU(18),y.qZA(),y.qZA(),y.qZA(),y.TgZ(19,"button",12),y.NdJ("click",function(){return e.exportCsv()}),y._UZ(20,"mat-icon",14),y.TgZ(21,"span",7),y._uU(22,"Export links in CSV"),y.qZA(),y.qZA(),y.qZA(),y.TgZ(23,"permission-aware-button",11),y.TgZ(24,"button",15),y.NdJ("click",function(){return e.showCrupdateLinkModal()}),y._UZ(25,"mat-icon",16),y.TgZ(26,"span",7),y._uU(27),y.qZA(),y.qZA(),y.qZA(),y.qZA(),y.qZA(),y.qZA(),y.TgZ(28,"div",17),y.YNc(29,rt,1,0,"mat-progress-bar",18),y.ALo(30,"async"),y.TgZ(31,"table",19),y.TgZ(32,"thead"),y.TgZ(33,"tr"),y._UZ(34,"th",20),y.TgZ(35,"th",7),y._uU(36,"Summary"),y.qZA(),y.YNc(37,lt,3,0,"ng-container",1),y.TgZ(38,"th",21),y._uU(39,"Clicks"),y.qZA(),y.TgZ(40,"th",22),y._uU(41,"Type"),y.qZA(),y.TgZ(42,"th",22),y._uU(43,"Password"),y.qZA(),y.TgZ(44,"th",23),y._uU(45,"Expires At"),y.qZA(),y.TgZ(46,"th",24),y._uU(47,"Last Clicked"),y.qZA(),y._UZ(48,"th"),y.qZA(),y.YNc(49,ut,9,4,"tr",1),y.qZA(),y.TgZ(50,"tbody"),y.YNc(51,ft,42,45,"tr",25),y.ALo(52,"async"),y.qZA(),y.qZA(),y.YNc(53,bt,3,0,"no-results-message",26),y.ALo(54,"async"),y._UZ(55,"datatable-footer"),y.qZA()),2&t){const t=y.MAs(12);y.xp6(2),y.Q6J("ngIf",e.groupId),y.xp6(1),y.Q6J("ngIf",!e.groupId),y.xp6(2),y.Q6J("filters",e.filters),y.xp6(2),y.Q6J("matMenuTriggerFor",t),y.xp6(6),y.Q6J("ngIf",e.groupId),y.xp6(5),y.Oqu(e.groupId?"Add multiple links":"Shorten multiple links"),y.xp6(9),y.Oqu(e.groupId?"Add Link":"Shorten Link"),y.xp6(2),y.Q6J("ngIf",y.lcZ(30,12,e.datatable.paginator&&e.datatable.paginator.loading$)),y.xp6(8),y.Q6J("ngIf",e.showUserColumn()),y.xp6(12),y.Q6J("ngIf",e.datatable.selectedRows$.value.length),y.xp6(2),y.Q6J("ngForOf",y.lcZ(52,14,e.links$)),y.xp6(2),y.Q6J("ngIf",y.lcZ(54,16,e.datatable.paginator.noResults$))}},directives:[U.O5,E.h,R.lW,$.p6,C.P,q.Hw,$.VK,V.v,$.OP,B.e,H.p,U.sg,z.V,Q.yS,R.zs,I.pW,G.O,j.gM,X.b,W.r,M.U],pipes:[U.Ov,O.K,U.OU,K,U.JJ,tt.R,et.l],styles:["h1[_ngcontent-%COMP%]{display:flex;align-items:center}.back-button[_ngcontent-%COMP%]{color:var(--be-secondary-text)}.export-csv-button[_ngcontent-%COMP%]{border-color:var(--be-accent-default);min-width:0;min-width:auto;width:42px;padding:0}.export-csv-button[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{margin-bottom:4px}.favicon-img[_ngcontent-%COMP%]{display:inline-block;vertical-align:middle;margin-right:5px}.long-url[_ngcontent-%COMP%]{display:block;font-weight:500;font-size:1.5rem;color:inherit;max-width:90%;overflow:hidden;text-overflow:ellipsis}.short-url[_ngcontent-%COMP%]{display:block;color:var(--be-secondary-text);font-size:1.3rem;white-space:nowrap}.short-url[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:inherit}"],changeDetection:0}),t})()},13571:function(t,e,n){"use strict";n.d(e,{z:function(){return g}});var i=n(78512),a=n(35366),o=n(31041),s=n(25051),r=n(88195),l=n(38116),c=n(61116);function d(t,e){if(1&t&&(a.TgZ(0,"option",5),a._uU(1),a.qZA()),2&t){const t=a.oxw().$implicit;a.Q6J("ngValue",t.id),a.xp6(1),a.hij(" ",t.host," ")}}function u(t,e){if(1&t&&(a.ynx(0),a.YNc(1,d,2,2,"option",7),a.BQk()),2&t){const t=e.$implicit,n=a.oxw().ngIf;a.xp6(1),a.Q6J("ngIf",n!==t.host)}}function p(t,e){if(1&t&&(a.ynx(0),a.TgZ(1,"option",5),a._uU(2),a.qZA(),a.YNc(3,u,2,1,"ng-container",6),a.BQk()),2&t){const t=e.ngIf,n=a.oxw();a.xp6(1),a.Q6J("ngValue",0),a.xp6(1),a.Oqu(t),a.xp6(1),a.Q6J("ngForOf",n.domains)}}let g=(()=>{class t{constructor(t,e,n){this.groupDirective=t,this.valueLists=e,this.settings=n,this.domains=[],this.hideLabel=!1,this.defaultHost$=new i.X(null)}ngOnChanges(){this.domains.length&&this.setDefaultHost()}ngOnInit(){this.formControl=this.groupDirective.form.controls[this.controlName]}setDefaultHost(){const t=this.settings.get("custom_domains.default_host");if(t)this.defaultHost$.next(this.domains.find(e=>e.host===t).host);else{const t=this.settings.getBaseUrl().replace(/\/$/,"").replace(/(^\w+:|^)\/\//,"");this.defaultHost$.next(t)}}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(o.sg),a.Y36(s.l),a.Y36(r.Z))},t.\u0275cmp=a.Xpm({type:t,selectors:[["domain-form-control"]],inputs:{controlName:"controlName",domains:"domains",hideLabel:"hideLabel"},features:[a.TTD],decls:8,vars:7,consts:[[1,"input-container"],["for","crupdate_group_domain_id","trans",""],["id","crupdate_group_domain_id",3,"formControl"],["trans","",3,"ngValue"],[4,"ngIf"],[3,"ngValue"],[4,"ngFor","ngForOf"],[3,"ngValue",4,"ngIf"]],template:function(t,e){1&t&&(a.TgZ(0,"div",0),a.TgZ(1,"label",1),a._uU(2,"Domain"),a.qZA(),a.TgZ(3,"select",2),a.TgZ(4,"option",3),a._uU(5,"All my domains (including default)"),a.qZA(),a.YNc(6,p,4,3,"ng-container",4),a.ALo(7,"async"),a.qZA(),a.qZA()),2&t&&(a.xp6(1),a.ekj("hidden",e.hideLabel),a.xp6(2),a.Q6J("formControl",e.formControl),a.xp6(1),a.Q6J("ngValue",null),a.xp6(2),a.Q6J("ngIf",a.lcZ(7,5,e.defaultHost$)))},directives:[l.P,o.EJ,o.JJ,o.oH,o.YN,o.Kr,c.O5,c.sg],pipes:[c.Ov],styles:[""],changeDetection:0}),t})()},53129:function(t,e,n){"use strict";n.d(e,{O:function(){return j}});var i=n(74899),a=n(78512),o=n(92935),s=n(73709),r=n(35366),l=n(31041),c=n(38116),d=n(77307),u=n(84369);let p=(()=>{class t{constructor(t,e,n){this.dialogRef=t,this.data=e,this.fb=n,this.form=this.fb.group({utm_source:this.fb.control(null),utm_medium:this.fb.control(null),utm_campaign:this.fb.control(null),utm_term:this.fb.control(null),utm_content:this.fb.control(null)})}ngOnInit(){this.hydrateForm()}save(){this.dialogRef.close(this.formToUrlParams().toString())}close(){this.dialogRef.close()}hydrateForm(){if(this.data.utmQuery){const t=new URLSearchParams(this.data.utmQuery),e={};t.forEach((t,n)=>{e[n]=t}),this.form.patchValue(e)}}formToUrlParams(){return new URLSearchParams((0,s.N)(this.form.value))}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(o.so),r.Y36(o.WI),r.Y36(l.qu))},t.\u0275cmp=r.Xpm({type:t,selectors:[["utm-builder-dialog"]],decls:36,vars:1,consts:[[1,"modal-header"],["mat-dialog-title","","trans",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"inline-inputs-container","many-inputs"],[1,"input-container"],["for","utm-source","trans",""],["type","text","id","utm-source","placeholder","e.g: adwords, google, facebook","trans-placeholder","","formControlName","utm_source"],["for","utm-medium","trans",""],["type","text","id","utm-medium","placeholder","e.g: banner, email, social post","trans-placeholder","","formControlName","utm_medium"],["for","utm-campaign","trans",""],["type","text","id","utm-campaign","placeholder","e.g: holiday special, birthday promo","trans-placeholder","","formControlName","utm_campaign"],["for","utm-term","trans",""],["type","text","id","utm-term","placeholder","Use to identify ppc keywords","trans-placeholder","","formControlName","utm_term"],["for","utm-content","trans",""],["type","text","id","utm-content","placeholder","Use to differentiate ads or words on a page","trans-placeholder","","formControlName","utm_content"],[1,"widget","widget-info"],["trans",""],["type","submit","mat-raised-button","","color","accent","trans",""]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r.TgZ(1,"h2",1),r._uU(2,"UTM Builder"),r.qZA(),r.TgZ(3,"button",2),r.NdJ("click",function(){return e.close()}),r._UZ(4,"mat-icon",3),r.qZA(),r.qZA(),r.TgZ(5,"form",4),r.NdJ("ngSubmit",function(){return e.save()}),r.TgZ(6,"mat-dialog-content"),r.TgZ(7,"div",5),r.TgZ(8,"div",6),r.TgZ(9,"label",7),r._uU(10,"Source"),r.qZA(),r._UZ(11,"input",8),r.qZA(),r.TgZ(12,"div",6),r.TgZ(13,"label",9),r._uU(14,"Medium"),r.qZA(),r._UZ(15,"input",10),r.qZA(),r.qZA(),r.TgZ(16,"div",5),r.TgZ(17,"div",6),r.TgZ(18,"label",11),r._uU(19,"Campaign"),r.qZA(),r._UZ(20,"input",12),r.qZA(),r.TgZ(21,"div",6),r.TgZ(22,"label",13),r._uU(23,"Term"),r.qZA(),r._UZ(24,"input",14),r.qZA(),r.qZA(),r.TgZ(25,"div",5),r.TgZ(26,"div",6),r.TgZ(27,"label",15),r._uU(28,"Content"),r.qZA(),r._UZ(29,"input",16),r.qZA(),r.qZA(),r.TgZ(30,"div",17),r.TgZ(31,"div",18),r._uU(32," UTM codes specified here will be applied to the link automatically when redirecting from short url to destination url. "),r.qZA(),r.qZA(),r.qZA(),r.TgZ(33,"mat-dialog-actions"),r.TgZ(34,"button",19),r._uU(35,"Save"),r.qZA(),r.qZA(),r.qZA()),2&t&&(r.xp6(5),r.Q6J("formGroup",e.form))},directives:[o.uh,c.P,d.Hw,l.JL,l.sg,o.xY,l.Fj,l.JJ,l.u,o.H8,u.lW],styles:["[_nghost-%COMP%]{display:block;width:500px;max-width:100%}.widget[_ngcontent-%COMP%]{background-color:#f3fbf7;max-width:100%;padding:14px;margin:10px 0;border-radius:3px;overflow-wrap:break-word;border-left:5px solid #5ac891}"],changeDetection:0}),t})();var g=n(32198),h=n(88195),m=n(24859),f=n(61116),b=n(77830),v=n(56361),_=n(98081),Z=n(13571),x=n(13070),y=n(13841),A=n(87064),w=n(6006),k=n(77910);function T(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw(2).ngIf;r.xp6(1),r.Oqu(t.alias)}}function C(t,e){if(1&t&&(r.TgZ(0,"div",32),r.TgZ(1,"label",33),r._uU(2,"Custom Link ID"),r.qZA(),r._UZ(3,"input",34),r.YNc(4,T,2,1,"p",12),r.qZA()),2&t){const t=r.oxw().ngIf,e=r.oxw();r.xp6(3),r.Q6J("minlength",e.alias.min)("maxlength",e.alias.max)("placeholder",e.linkForm.linkHash.value),r.xp6(1),r.Q6J("ngIf",t.alias)}}function q(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw().ngIf;r.xp6(1),r.Oqu(t.password)}}function U(t,e){if(1&t&&(r.TgZ(0,"div",16),r.TgZ(1,"header"),r.TgZ(2,"div",17),r.TgZ(3,"h3",18),r._uU(4,"Domain"),r.qZA(),r.TgZ(5,"p",18),r._uU(6,"Select on which domain should this short link be accessible."),r.qZA(),r.qZA(),r.qZA(),r._UZ(7,"domain-form-control",36),r.qZA()),2&t){const t=r.oxw(2);r.xp6(7),r.Q6J("domains",t.linkOptions.domains)("hideLabel",!0)}}function I(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw().ngIf;r.xp6(1),r.Oqu(t.activates_at)}}function M(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw().ngIf;r.xp6(1),r.Oqu(t.expires_at)}}function O(t,e){if(1&t&&(r.TgZ(0,"mat-option",40),r._uU(1),r.qZA()),2&t){const t=e.$implicit,n=r.oxw(3);r.Q6J("value",t.id),r.xp6(1),r.Oqu(n.capitalize(t.name))}}function J(t,e){if(1&t&&(r.TgZ(0,"div",16),r.TgZ(1,"header"),r.TgZ(2,"div",17),r.TgZ(3,"h3",18),r._uU(4,"Link Groups"),r.qZA(),r.TgZ(5,"p",18),r._uU(6,"Groups this link should be attached to."),r.qZA(),r.qZA(),r.qZA(),r.TgZ(7,"mat-form-field",37),r.TgZ(8,"mat-label",18),r._uU(9,"Select Groups"),r.qZA(),r.TgZ(10,"mat-select",38),r.YNc(11,O,2,2,"mat-option",39),r.qZA(),r.qZA(),r.qZA()),2&t){const t=r.oxw(2);r.xp6(11),r.Q6J("ngForOf",t.linkOptions.groups)}}function P(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw(2).ngIf;r.xp6(1),r.Oqu(t.name)}}function N(t,e){1&t&&(r.TgZ(0,"div",5),r.TgZ(1,"label",48),r._uU(2,"Tags"),r.qZA(),r._UZ(3,"chip-input",49),r.qZA())}function S(t,e){if(1&t&&(r.TgZ(0,"p",35),r._uU(1),r.qZA()),2&t){const t=r.oxw(2).ngIf;r.xp6(1),r.Oqu(t.description)}}function D(t,e){if(1&t&&(r.TgZ(0,"div",41),r.TgZ(1,"header"),r.TgZ(2,"div",17),r.TgZ(3,"h3",18),r._uU(4,"Details"),r.qZA(),r.TgZ(5,"p",18),r._uU(6,"Add title, description and upload an image to personalize the link."),r.qZA(),r.qZA(),r.qZA(),r.TgZ(7,"div",3),r._UZ(8,"upload-image-control",42),r.TgZ(9,"div",5),r.TgZ(10,"label",43),r._uU(11,"Title"),r.qZA(),r._UZ(12,"input",44),r.YNc(13,P,2,1,"p",12),r.qZA(),r.qZA(),r.YNc(14,N,4,0,"div",45),r.TgZ(15,"div",5),r.TgZ(16,"label",46),r._uU(17,"Description"),r.qZA(),r._UZ(18,"textarea",47),r.YNc(19,S,2,1,"p",12),r.qZA(),r.qZA()),2&t){const t=r.oxw().ngIf,e=r.oxw();r.xp6(8),r.Q6J("compact",!0),r.xp6(5),r.Q6J("ngIf",t.name),r.xp6(1),r.Q6J("ngIf",!(null!=e.featuresToHide&&e.featuresToHide.tags)),r.xp6(5),r.Q6J("ngIf",t.description)}}function Q(t,e){if(1&t&&(r.TgZ(0,"mat-option",40),r._uU(1),r.qZA()),2&t){const t=e.$implicit,n=r.oxw(3);r.Q6J("value",t.id),r.xp6(1),r.Oqu(n.capitalize(t.name))}}function Y(t,e){if(1&t&&(r.TgZ(0,"div",16),r.TgZ(1,"header"),r.TgZ(2,"div",17),r.TgZ(3,"h3",18),r._uU(4,"Tracking Pixel"),r.qZA(),r.TgZ(5,"p",18),r._uU(6,"Select tracking pixels that should be used for this link."),r.qZA(),r.qZA(),r.qZA(),r.TgZ(7,"mat-form-field",37),r.TgZ(8,"mat-label",18),r._uU(9,"Select Pixels"),r.qZA(),r.TgZ(10,"mat-select",50),r.YNc(11,Q,2,2,"mat-option",39),r.qZA(),r.qZA(),r.qZA()),2&t){const t=r.oxw(2);r.xp6(11),r.Q6J("ngForOf",t.linkOptions.pixels)}}function L(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"button",55),r.NdJ("click",function(){return r.CHM(t),r.oxw(3).linkForm.addNewGeoRule()}),r._UZ(1,"mat-icon",56),r.qZA()}}function F(t,e){if(1&t&&(r.TgZ(0,"option",40),r._uU(1),r.qZA()),2&t){const t=e.$implicit;r.Q6J("value",t.code),r.xp6(1),r.hij(" ",t.name," ")}}function E(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"li",57),r.TgZ(1,"div",58),r.TgZ(2,"label",59),r._uU(3,"Country"),r.qZA(),r.TgZ(4,"select",60),r.YNc(5,F,2,2,"option",39),r.qZA(),r.qZA(),r.TgZ(6,"div",61),r.TgZ(7,"label",59),r._uU(8,"Url"),r.qZA(),r._UZ(9,"input",62),r.qZA(),r.TgZ(10,"button",63),r.NdJ("click",function(){const e=r.CHM(t).index;return r.oxw(3).linkForm.geoRules.removeAt(e)}),r._UZ(11,"mat-icon",64),r.qZA(),r.qZA()}if(2&t){const t=e.$implicit,n=e.index,i=r.oxw(3);r.xp6(1),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_country-"+n),r.xp6(2),r.Q6J("id","link_dialog_country-"+n),r.xp6(1),r.Q6J("ngForOf",i.linkOptions.countries),r.xp6(1),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_geo_url-"+n),r.xp6(2),r.Q6J("id","link_dialog_geo_url-"+n),r.xp6(1),r.Q6J("disabled",t.disabled)}}function R(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"button",55),r.NdJ("click",function(){return r.CHM(t),r.oxw(3).linkForm.addNewDeviceRule()}),r._UZ(1,"mat-icon",56),r.qZA()}}function $(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"li",57),r.TgZ(1,"div",65),r.TgZ(2,"label",59),r._uU(3,"Device"),r.qZA(),r.TgZ(4,"select",60),r.TgZ(5,"option",66),r._uU(6,"Desktop"),r.qZA(),r.TgZ(7,"option",67),r._uU(8,"Tablet"),r.qZA(),r.TgZ(9,"option",68),r._uU(10,"Mobile"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(11,"div",61),r.TgZ(12,"label",59),r._uU(13,"Url"),r.qZA(),r._UZ(14,"input",62),r.qZA(),r.TgZ(15,"button",69),r.NdJ("click",function(){const e=r.CHM(t).index;return r.oxw(3).linkForm.deviceRules.removeAt(e)}),r._UZ(16,"mat-icon",64),r.qZA(),r.qZA()}if(2&t){const t=e.$implicit,n=e.index;r.xp6(1),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_device-"+n),r.xp6(2),r.Q6J("id","link_dialog_device-"+n),r.xp6(7),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_device_url-"+n),r.xp6(2),r.Q6J("id","link_dialog_device_url-"+n),r.xp6(1),r.Q6J("disabled",t.disabled)}}function V(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"button",55),r.NdJ("click",function(){return r.CHM(t),r.oxw(3).linkForm.addNewPlatformRule()}),r._UZ(1,"mat-icon",56),r.qZA()}}function B(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"li",57),r.TgZ(1,"div",65),r.TgZ(2,"label",59),r._uU(3,"Platform"),r.qZA(),r.TgZ(4,"select",60),r.TgZ(5,"option",70),r._uU(6,"Windows"),r.qZA(),r.TgZ(7,"option",71),r._uU(8,"Linux"),r.qZA(),r.TgZ(9,"option",72),r._uU(10,"MacOS"),r.qZA(),r.TgZ(11,"option",73),r._uU(12,"iOS"),r.qZA(),r.TgZ(13,"option",74),r._uU(14,"Android"),r.qZA(),r.qZA(),r.qZA(),r.TgZ(15,"div",61),r.TgZ(16,"label",59),r._uU(17,"Url"),r.qZA(),r._UZ(18,"input",62),r.qZA(),r.TgZ(19,"button",69),r.NdJ("click",function(){const e=r.CHM(t).index;return r.oxw(3).linkForm.platformRules.removeAt(e)}),r._UZ(20,"mat-icon",64),r.qZA(),r.qZA()}if(2&t){const t=e.$implicit,n=e.index;r.xp6(1),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_platform-"+n),r.xp6(2),r.Q6J("id","link_dialog_platform-"+n),r.xp6(11),r.Q6J("formGroup",t),r.xp6(1),r.Q6J("for","link_dialog_platform_url-"+n),r.xp6(2),r.Q6J("id","link_dialog_platform_url-"+n),r.xp6(1),r.Q6J("disabled",t.disabled)}}function H(t,e){if(1&t&&(r.ynx(0),r.TgZ(1,"div",51),r.TgZ(2,"header"),r.TgZ(3,"div",17),r.TgZ(4,"h3",18),r._uU(5,"Location Targeting"),r.qZA(),r.TgZ(6,"p",18),r._uU(7,"Redirect users to different url based on their location."),r.qZA(),r.qZA(),r.YNc(8,L,2,0,"button",52),r.qZA(),r.TgZ(9,"ul",53),r.YNc(10,E,12,8,"li",54),r.qZA(),r.qZA(),r.TgZ(11,"div",51),r.TgZ(12,"header"),r.TgZ(13,"div",17),r.TgZ(14,"h3",18),r._uU(15,"Device Targeting"),r.qZA(),r.TgZ(16,"p",18),r._uU(17,"Redirect users to different url based on their device."),r.qZA(),r.qZA(),r.YNc(18,R,2,0,"button",52),r.qZA(),r.TgZ(19,"ul",53),r.YNc(20,$,17,7,"li",54),r.qZA(),r.qZA(),r.TgZ(21,"div",51),r.TgZ(22,"header"),r.TgZ(23,"div",17),r.TgZ(24,"h3",18),r._uU(25,"Platform Targeting"),r.qZA(),r.TgZ(26,"p",18),r._uU(27,"Redirect users to different url based on their platform."),r.qZA(),r.qZA(),r.YNc(28,V,2,0,"button",52),r.qZA(),r.TgZ(29,"ul",53),r.YNc(30,B,21,7,"li",54),r.qZA(),r.qZA(),r.BQk()),2&t){const t=r.oxw(2);r.xp6(1),r.Q6J("controlGroup",t.linkForm.geoRules),r.xp6(7),r.Q6J("ngIf",!t.linkForm.geoRules.disabled),r.xp6(2),r.Q6J("ngForOf",t.linkForm.geoRules.controls),r.xp6(1),r.Q6J("controlGroup",t.linkForm.deviceRules),r.xp6(7),r.Q6J("ngIf",!t.linkForm.geoRules.disabled),r.xp6(2),r.Q6J("ngForOf",t.linkForm.deviceRules.controls),r.xp6(1),r.Q6J("controlGroup",t.linkForm.platformRules),r.xp6(7),r.Q6J("ngIf",!t.linkForm.geoRules.disabled),r.xp6(2),r.Q6J("ngForOf",t.linkForm.platformRules.controls)}}const z=function(t){return{resource:t}};function G(t,e){if(1&t){const t=r.EpF();r.ynx(0,1),r.TgZ(1,"div",2),r.TgZ(2,"div",3),r.YNc(3,C,5,4,"div",4),r.TgZ(4,"div",5),r.TgZ(5,"label",6),r._uU(6,"Status"),r.qZA(),r.TgZ(7,"select",7),r.TgZ(8,"option",8),r._uU(9,"Activate"),r.qZA(),r.TgZ(10,"option",8),r._uU(11,"Disabled"),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.TgZ(12,"div",3),r.TgZ(13,"div",9),r.TgZ(14,"label",10),r._uU(15,"Password"),r.qZA(),r._UZ(16,"input",11),r.YNc(17,q,2,1,"p",12),r.qZA(),r.qZA(),r.TgZ(18,"permission-aware-button",13),r.TgZ(19,"button",14),r.NdJ("click",function(){return r.CHM(t),r.oxw().openUtmBuilder()}),r._uU(20," UTM Builder "),r.qZA(),r.qZA(),r.qZA(),r.YNc(21,U,8,2,"div",15),r.TgZ(22,"div",16),r.TgZ(23,"header"),r.TgZ(24,"div",17),r.TgZ(25,"h3",18),r._uU(26,"Schedule"),r.qZA(),r.TgZ(27,"p",19),r._uU(28," Enter a date when :resource should be active. Both start and end dates are optional. "),r.qZA(),r.qZA(),r.qZA(),r.TgZ(29,"div",3),r.TgZ(30,"div",20),r.TgZ(31,"datetime-input",21),r._uU(32,"Start Date"),r.qZA(),r.YNc(33,I,2,1,"p",12),r.qZA(),r.TgZ(34,"div",20),r.TgZ(35,"datetime-input",22),r._uU(36,"End Date"),r.qZA(),r.YNc(37,M,2,1,"p",12),r.qZA(),r.qZA(),r.qZA(),r.YNc(38,J,12,1,"div",15),r.YNc(39,D,20,4,"div",23),r.YNc(40,Y,12,1,"div",15),r.TgZ(41,"div",24),r.TgZ(42,"header"),r.TgZ(43,"div",17),r.TgZ(44,"h3",18),r._uU(45,"Expiration Clicks"),r.qZA(),r.TgZ(46,"p"),r.TgZ(47,"span",19),r._uU(48,"After :resource is visited specified amount of times, it will no longer be accessible."),r.qZA(),r._UZ(49,"br"),r.TgZ(50,"span",19),r._uU(51,"Optionally, after click amount is reached :resource can redirect to specified url instead."),r.qZA(),r.qZA(),r.qZA(),r.qZA(),r.TgZ(52,"div",25),r.TgZ(53,"div",26),r.TgZ(54,"label",27),r._uU(55,"Max Clicks"),r.qZA(),r._UZ(56,"input",28),r.qZA(),r.TgZ(57,"div",5),r.TgZ(58,"label",29),r._uU(59,"Redirect Url"),r.qZA(),r._UZ(60,"input",30),r.qZA(),r.qZA(),r.qZA(),r.YNc(61,H,31,9,"ng-container",31),r.BQk()}if(2&t){const t=e.ngIf,n=r.oxw();r.Q6J("formGroup",n.linkForm.formGroup),r.xp6(3),r.Q6J("ngIf",!(n.batch||null!=n.featuresToHide&&n.featuresToHide.alias)),r.xp6(5),r.Q6J("ngValue",!0),r.xp6(2),r.Q6J("ngValue",!1),r.xp6(7),r.Q6J("ngIf",t.password),r.xp6(4),r.Q6J("ngIf",(null==n.linkOptions||null==n.linkOptions.domains?null:n.linkOptions.domains.length)&&!(null!=n.featuresToHide&&n.featuresToHide.domain)&&n.settings.get("custom_domains.allow_select")),r.xp6(6),r.Q6J("transValues",r.VKq(16,z,n.resourceName)),r.xp6(6),r.Q6J("ngIf",t.activates_at),r.xp6(4),r.Q6J("ngIf",t.expires_at),r.xp6(1),r.Q6J("ngIf",!(null!=n.featuresToHide&&n.featuresToHide.linkGroups)&&(null==n.linkOptions||null==n.linkOptions.groups?null:n.linkOptions.groups.length)),r.xp6(1),r.Q6J("ngIf",!(null!=n.featuresToHide&&n.featuresToHide.details)),r.xp6(1),r.Q6J("ngIf",(null==n.linkOptions||null==n.linkOptions.pixels?null:n.linkOptions.pixels.length)&&n.settings.get("links.pixels")),r.xp6(1),r.Q6J("controlGroup",n.linkForm.expClicksRule),r.xp6(6),r.Q6J("transValues",r.VKq(18,z,n.resourceName)),r.xp6(3),r.Q6J("transValues",r.VKq(20,z,n.resourceName)),r.xp6(11),r.Q6J("ngIf",n.linkOptions&&n.settings.get("links.retargeting"))}}let j=(()=>{class t{constructor(t,e,n){this.linkForm=t,this.settings=e,this.modal=n,this.batch=!1,this.featuresToHide={},this.resourceName="link",this.defaultHost$=new a.X(null),this.alias={min:this.settings.get("links.alias_min"),max:this.settings.get("links.alias_max")}}ngOnChanges(t){if(t.linkOptions.currentValue){const t=this.settings.get("custom_domains.default_host");if(t)this.defaultHost$.next(this.linkOptions.domains.find(e=>e.host===t).host);else{const t=this.settings.getBaseUrl().replace(/\/$/,"").replace(/(^\w+:|^)\/\//,"");this.defaultHost$.next(t)}}}capitalize(t){return(0,i.z)(t)}openUtmBuilder(){this.modal.open(p,{utmQuery:this.linkForm.formGroup.get("utm").value}).afterClosed().subscribe(t=>{t&&this.linkForm.formGroup.patchValue({utm:t})})}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(g.l),r.Y36(h.Z),r.Y36(m.u))},t.\u0275cmp=r.Xpm({type:t,selectors:[["link-options-form"]],inputs:{linkOptions:"linkOptions",batch:"batch",featuresToHide:"featuresToHide",resourceName:"resourceName"},features:[r.TTD],decls:2,vars:3,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],[1,"group","first-group"],[1,"inline-inputs-container"],["class","input-container","permission-aware-input-container","alias",4,"ngIf"],[1,"input-container"],["for","link_dialog_active","trans",""],["id","link_dialog_active","formControlName","active"],["trans","",3,"ngValue"],["permission-aware-input-container","password",1,"input-container"],["for","link-dialog-password","trans",""],["type","password","id","link-dialog-password","formControlName","password","autocomplete","new-password"],["class","error",4,"ngIf"],["permission","links.create","restriction","utm"],["type","button","mat-stroked-button","","color","accent","trans","",3,"click"],["class","group",4,"ngIf"],[1,"group"],[1,"header-text"],["trans",""],["trans","",3,"transValues"],["permission-aware-input-container","expiration",1,"input-container"],["id","link_dialog_activates_at","formControlName","activates_at","trans",""],["id","link_dialog_expires_at","formControlName","expires_at","trans",""],["class","group many-inputs",4,"ngIf"],["permission-aware-input-container","expiration",1,"group","retargeting-group",3,"controlGroup"],["formGroupName","exp_clicks_rule",1,"inline-inputs-container","rule-inline-inputs"],[1,"input-container","country-input-container"],["for","link_dialog_exp_clicks","trans",""],["type","number","min","1","id","link_dialog_exp_clicks","formControlName","key"],["for","link_dialog_exp_link","trans",""],["type","url","id","link_dialog_exp_link","formControlName","value","placeholder","(Optional)","trans-placeholder",""],[4,"ngIf"],["permission-aware-input-container","alias",1,"input-container"],["for","link-dialog-alias","trans",""],["type","text","id","link-dialog-alias","formControlName","alias","pattern","[A-Za-z0-9_-]+",3,"minlength","maxlength","placeholder"],[1,"error"],["controlName","domain_id",3,"domains","hideLabel"],["appearance","outline"],["formControlName","groups","multiple",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"group","many-inputs"],["formControlName","image",3,"compact"],["for","link_dialog_title","trans",""],["type","text","id","link_dialog_title","formControlName","name","maxlength","140"],["class","input-container",4,"ngIf"],["for","link_dialog_description","trans",""],["id","link_dialog_description","formControlName","description","maxlength","240"],["for","link_dialog_tags","trans",""],["id","link_dialog_tags","formControlName","tags","placeholder","+New tag","trans-placeholder",""],["formControlName","pixels","multiple",""],["permission-aware-input-container","retargeting",1,"group","retargeting-group",3,"controlGroup"],["mat-icon-button","","color","accent","type","button",3,"click",4,"ngIf"],[1,"unstyled-list"],["class","inline-inputs-container rule-inline-inputs",4,"ngFor","ngForOf"],["mat-icon-button","","color","accent","type","button",3,"click"],["svgIcon","add"],[1,"inline-inputs-container","rule-inline-inputs"],[1,"input-container","country-input-container",3,"formGroup"],["trans","",3,"for"],["formControlName","key",3,"id"],[1,"input-container",3,"formGroup"],["type","url","formControlName","value",3,"id"],["mat-icon-button","","color","warn","type","button",1,"remove-rule-btn",3,"disabled","click"],["svgIcon","close"],[1,"input-container","device-input-container",3,"formGroup"],["value","desktop","trans",""],["value","tablet","trans",""],["value","mobile","trans",""],["mat-icon-button","","type","button","color","warn",1,"remove-rule-btn",3,"disabled","click"],["value","windows","trans",""],["value","linux","trans",""],["value","osx","trans",""],["value","ios","trans",""],["value","androidos","trans",""]],template:function(t,e){1&t&&(r.YNc(0,G,62,22,"ng-container",0),r.ALo(1,"async")),2&t&&r.Q6J("ngIf",r.lcZ(1,1,e.linkForm.errors$))},directives:[f.O5,l.JL,l.sg,c.P,l.EJ,l.JJ,l.u,l.YN,l.Kr,b.o,l.Fj,v.v,u.lW,_.k,l.x0,l.qQ,l.wV,l.c5,l.wO,l.nD,Z.z,x.KE,x.hX,y.gD,f.sg,A.ey,w.V,k.S,d.Hw],pipes:[f.Ov],styles:["[_nghost-%COMP%]{display:block;overflow:hidden}label[_ngcontent-%COMP%]{text-transform:capitalize}.group[_ngcontent-%COMP%]{border-bottom:1px solid var(--be-divider-default);margin-bottom:20px;padding-bottom:20px}.retargeting-group[_ngcontent-%COMP%]     .lock-icon{right:8px;top:5px}.first-group[_ngcontent-%COMP%]{margin-top:15px;padding-top:15px;border-top:1px solid var(--be-divider-default)}header[_ngcontent-%COMP%]{display:flex;align-items:center}header[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{margin-left:auto;align-self:flex-start}h3[_ngcontent-%COMP%]{margin:0}p[_ngcontent-%COMP%]{margin-top:3px;color:var(--be-secondary-text);max-width:650px}.inline-inputs-container[_ngcontent-%COMP%]{margin-bottom:20px;align-items:flex-end}.remove-rule-btn[_ngcontent-%COMP%]{margin-top:29px;margin-left:5px;flex-shrink:0}.input-wrapper[_ngcontent-%COMP%]{position:relative}.host-input[_ngcontent-%COMP%]{font-size:1.6rem}.base-url-prefix[_ngcontent-%COMP%]{position:absolute;top:0;left:0;line-height:46px;text-align:right}.mat-form-field[_ngcontent-%COMP%]{width:100%}upload-image-control[_ngcontent-%COMP%]{width:66px;height:66px;margin-right:15px}@media screen and (max-width:768px){.inline-inputs-container[_ngcontent-%COMP%]{display:block;position:relative}.country-input-container[_ngcontent-%COMP%], .device-input-container[_ngcontent-%COMP%]{margin-bottom:15px}.remove-rule-btn[_ngcontent-%COMP%]{position:absolute;top:-15px;right:-5px;margin:0}.rule-inline-inputs[_ngcontent-%COMP%]:not(:last-of-type){margin-bottom:25px;padding-bottom:25px;border-bottom:1px solid var(--be-divider-lighter)}}"],changeDetection:0}),t})()},92890:function(t,e,n){"use strict";n.d(e,{F:function(){return u}});var i=n(47727),a=n(73982),o=n(34056),s=n(40878),r=n(35366),l=n(63337),c=n(68515),d=n(84222);let u=(()=>{class t{constructor(t,e,n){this.router=t,this.http=e,this.link=n}resolve(t,e){return this.link.get(t.params.linkId).pipe((0,i.K)(()=>(this.router.navigate(["/dashboard/links"]),o.E)),(0,a.zg)(t=>t?(0,s.of)(t):(this.router.navigate(["/dashboard/links"]),o.E)))}}return t.\u0275fac=function(e){return new(e||t)(r.LFG(l.F0),r.LFG(c.r),r.LFG(d.M))},t.\u0275prov=r.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},4886:function(t,e,n){"use strict";n.d(e,{G:function(){return h}});var i=n(84222),a=n(78512),o=n(35366),s=n(63337),r=n(88195),l=n(61116),c=n(19708),d=n(78671),u=n(93836),p=n(40985);function g(t,e){if(1&t&&(o.ynx(0),o.TgZ(1,"header"),o._UZ(2,"img",1),o.ALo(3,"favicon"),o.TgZ(4,"a",2),o._uU(5),o.qZA(),o._UZ(6,"copy-link-btn",3),o._UZ(7,"share-link-btns",4),o.qZA(),o._UZ(8,"click-charts",5),o.BQk()),2&t){const t=e.ngIf,n=o.oxw();o.xp6(2),o.Q6J("src",o.lcZ(3,8,t.link.long_url),o.LSH),o.xp6(2),o.Q6J("href",t.link.long_url,o.LSH),o.xp6(1),o.Oqu(t.link.long_url),o.xp6(1),o.Q6J("model",t.link),o.xp6(1),o.Q6J("colored",!0)("link",t.link),o.xp6(1),o.Q6J("reports",t.analytics)("endpoint",n.analyticsEndpoint)}}let h=(()=>{class t{constructor(t,e){this.route=t,this.settings=e,this.data$=new a.X(null)}ngOnInit(){this.route.data.subscribe(t=>{this.data$.next(t.api),this.analyticsEndpoint=`${i.M.BASE_URI}/${t.api.link.id}`})}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(s.gz),o.Y36(r.Z))},t.\u0275cmp=o.Xpm({type:t,selectors:[["link-show"]],decls:2,vars:3,consts:[[4,"ngIf"],["alt","link favicon",3,"src"],["target","_blank",1,"long-url",3,"href"],[3,"model"],[3,"colored","link"],[3,"reports","endpoint"]],template:function(t,e){1&t&&(o.YNc(0,g,9,10,"ng-container",0),o.ALo(1,"async")),2&t&&o.Q6J("ngIf",o.lcZ(1,1,e.data$))},directives:[l.O5,c.b,d.t,u.z],pipes:[l.Ov,p.K],styles:["header[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:15px;font-size:1.8rem;flex-wrap:wrap}header[_ngcontent-%COMP%]   .long-url[_ngcontent-%COMP%]{max-width:60%;overflow:hidden;text-overflow:ellipsis}@media only screen and (max-width:768px){header[_ngcontent-%COMP%]   .long-url[_ngcontent-%COMP%]{width:calc(100% - 32px)}header[_ngcontent-%COMP%]   .long-url[_ngcontent-%COMP%], header[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{margin-bottom:15px}}@media only screen and (min-width:768px){header[_ngcontent-%COMP%]   share-link-btns[_ngcontent-%COMP%]{margin-left:auto}header[_ngcontent-%COMP%]   .edit-btn[_ngcontent-%COMP%]{margin-left:10px}}header[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{margin-right:10px;width:22px;height:22px;flex-shrink:0}header[_ngcontent-%COMP%]   .edit-btn[_ngcontent-%COMP%], header[_ngcontent-%COMP%]   copy-link-btn[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),t})()},77830:function(t,e,n){"use strict";n.d(e,{o:function(){return b}});var i=n(35366),a=n(31041),o=n(40149),s=n(35096),r=n(78512),l=n(98979),c=n(88195),d=n(28505),u=n(36501),p=n(77307),g=n(61116);const h=["lockIcon"],m=["permission-aware-input-container",""],f=["*"];let b=(()=>{class t{constructor(t,e,n,i,a,o){this.cd=t,this.overlay=e,this.viewContainerRef=n,this.settings=i,this.currentUser=a,this.usage=o,this.lockIconHidden$=new r.X(!0)}ngAfterViewInit(){setTimeout(()=>{this.usageSub=this.usage.response$.subscribe(t=>{t.usage.links[this.permission]||this.currentUser.isAdmin()||(this.lockIconHidden$.next(!1),this.controlGroup?this.controlGroup.disable():this.controlName&&this.controlName.control.disable(),this.lockIcon&&this.createHoverListener())})})}ngOnDestroy(){var t;null===(t=this.usageSub)||void 0===t||t.unsubscribe()}createHoverListener(){this.listeningToHover||(this.lockIcon.nativeElement.addEventListener("mouseenter",()=>{this.cd.markForCheck(),this.showMessage()}),this.lockIcon.nativeElement.addEventListener("mouseleave",t=>{var e;const n=t.relatedTarget;"upgrade-overlay"!==(null===(e=null==n?void 0:n.nodeName)||void 0===e?void 0:e.toLowerCase())&&this.hideMessage()}),this.listeningToHover=!0)}showMessage(){this.overlayRef&&this.hideMessage(),this.overlayRef=this.overlay.open(s.O,{origin:this.lockIcon,position:o.x,hasBackdrop:!1,scrollStrategy:"close",viewContainerRef:this.viewContainerRef,data:{config:{resource:"links",createMsgType:this.permission}}}),this.overlayRef.getPanelEl().addEventListener("mouseleave",()=>{this.hideMessage()})}hideMessage(){this.overlayRef&&(this.overlayRef.close(),this.overlayRef=null)}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.sBO),i.Y36(l.T),i.Y36(i.s_b),i.Y36(c.Z),i.Y36(d.I),i.Y36(u.F))},t.\u0275cmp=i.Xpm({type:t,selectors:[["","permission-aware-input-container",""]],contentQueries:function(t,e,n){if(1&t&&i.Suo(n,a.u,5),2&t){let t;i.iGM(t=i.CRH())&&(e.controlName=t.first)}},viewQuery:function(t,e){if(1&t&&i.Gf(h,5,i.SBq),2&t){let t;i.iGM(t=i.CRH())&&(e.lockIcon=t.first)}},inputs:{permission:["permission-aware-input-container","permission"],controlGroup:"controlGroup"},attrs:m,ngContentSelectors:f,decls:4,vars:4,consts:[["svgIcon","lock",1,"lock-icon"],["lockIcon",""]],template:function(t,e){1&t&&(i.F$t(),i.Hsn(0),i.TgZ(1,"mat-icon",0,1),i.ALo(3,"async"),i.qZA()),2&t&&(i.xp6(1),i.ekj("hidden",i.lcZ(3,2,e.lockIconHidden$)))},directives:[p.Hw],pipes:[g.Ov],styles:["[_nghost-%COMP%]{display:block;position:relative;margin-top:8px}.lock-icon[_ngcontent-%COMP%]{position:absolute;right:0;top:-6px;color:var(--be-secondary-text)}"],changeDetection:0}),t})()},56361:function(t,e,n){"use strict";n.d(e,{v:function(){return v}});var i=n(84369),a=n(35096),o=n(40149),s=n(7855),r=n(35366),l=n(77307),c=n(38116);let d=(()=>{class t{constructor(t){this.data=t}ngOnInit(){this.message=function(t,e=!1,n,i){return"overQuota"===i?`You have created the maximum allowed number of ${t}.`:function(t,e,n){return t=t.replace("_"," "),e?`You are not allowed to ${n} ${t} in this workspace.`:`You are not allowed to ${n} ${t}.`}(t,e,n)}(this.data.config.resource,this.data.config.forWorkspace,this.data.config.action,this.data.config.createMsgType)}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(s.p))},t.\u0275cmp=r.Xpm({type:t,selectors:[["simple-permission-overlay"]],hostAttrs:[1,"permission-overlay"],decls:4,vars:1,consts:[[1,"overlay"],["svgIcon","lock",1,"lock-icon"],["trans",""]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r._UZ(1,"mat-icon",1),r.TgZ(2,"span",2),r._uU(3),r.qZA(),r.qZA()),2&t&&(r.xp6(3),r.Oqu(e.message))},directives:[l.Hw,c.P],styles:["[_nghost-%COMP%]{display:block;padding:5px 0}.overlay[_ngcontent-%COMP%]{display:flex;align-items:flex-start;background-color:var(--be-background);box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);border-radius:4px;padding:15px;max-width:350px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lock-icon[_ngcontent-%COMP%]{width:28px;height:28px;flex-shrink:0;margin-right:10px;color:var(--be-secondary-text)}"],changeDetection:0}),t})();var u=n(97070),p=n(98979),g=n(88195),h=n(28505),m=n(36501);const f=["permission-aware-button",""],b=["*"];let v=(()=>{class t{constructor(t,e,n,i,a,o,s){this.cd=t,this.overlay=e,this.viewContainerRef=n,this.settings=i,this.currentUser=a,this.el=o,this.linkUsage=s}ngAfterViewInit(){setTimeout(()=>{this.matButton||this.matMenuItem||(this.regularButton=this.el.nativeElement.querySelector("button")),this.usageSub=this.linkUsage.response$.subscribe(t=>{this.hydrateConfig(t),this.config.hasPermission||this.userOwnsResource?(this.toggleButtonState(!1),this.overlayCmp=null):(this.toggleButtonState(!0),this.setOverlayCmp()),this.cd.markForCheck()}),this.createHoverListener()})}ngOnDestroy(){var t;null===(t=this.usageSub)||void 0===t||t.unsubscribe()}hydrateConfig(t){const[e,n]=this.permission.split(".");this.config={resource:e,action:n,hasPermission:t.usage[e][this.restriction||n]||this.currentUser.isAdmin(),forWorkspace:t.forWorkspace,createMsgType:t.usage[e].createMsgType||this.restriction,userOwnsWorkspace:t.userOwnsWorkspace}}setOverlayCmp(){this.overlayCmp=this.shouldShowUpgradeOverlay()?a.O:d}shouldShowUpgradeOverlay(){return this.settings.get("billing.enable")&&"create"===this.config.action&&!this.config.hasPermission&&"noWorkspacePermission"!==this.config.createMsgType}createHoverListener(){this.el.nativeElement.addEventListener("mouseenter",()=>{this.overlayCmp&&(this.cd.markForCheck(),this.showMessage())}),this.el.nativeElement.addEventListener("mouseleave",t=>{this.overlayRef&&!t.relatedTarget.classList.contains("permission-overlay")&&this.hideMessage()})}toggleButtonState(t){(this.matButton||this.matMenuItem||this.regularButton).disabled=t}showMessage(){this.overlayRef&&this.hideMessage(),this.overlayRef=this.overlay.open(this.overlayCmp,{origin:this.matButton._elementRef,position:o.x,hasBackdrop:!1,scrollStrategy:"close",viewContainerRef:this.viewContainerRef,data:{config:this.config}}),this.overlayRef.getPanelEl().addEventListener("mouseleave",()=>{this.hideMessage()})}hideMessage(){this.overlayRef&&(this.overlayRef.close(),this.overlayRef=null)}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(r.sBO),r.Y36(p.T),r.Y36(r.s_b),r.Y36(g.Z),r.Y36(h.I),r.Y36(r.SBq),r.Y36(m.F))},t.\u0275cmp=r.Xpm({type:t,selectors:[["","permission-aware-button",""],["permission-aware-button"]],contentQueries:function(t,e,n){if(1&t&&(r.Suo(n,i.lW,5),r.Suo(n,u.OP,5)),2&t){let t;r.iGM(t=r.CRH())&&(e.matButton=t.first),r.iGM(t=r.CRH())&&(e.matMenuItem=t.first)}},inputs:{permission:"permission",restriction:"restriction",userOwnsResource:"userOwnsResource"},attrs:f,ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(r.F$t(),r.Hsn(0))},styles:[""],changeDetection:0}),t})()},35096:function(t,e,n){"use strict";n.d(e,{O:function(){return p}});var i=n(7855),a=n(35366),o=n(80147),s=n(88195),r=n(38116),l=n(84369),c=n(63337),d=n(92552);const u=function(t){return{siteName:t}};let p=(()=>{class t{constructor(t,e,n){this.overlayPanelRef=t,this.data=e,this.settings=n}ngOnInit(){var t,e;this.message=(e=this.data.config.createMsgType,t=(t=this.data.config.resource).replace("_"," "),"overQuota"===e?`You've reached the maximum number of ${t} allowed for your current plan.`:"alias"===e?"Your current plan doesn't allow setting custom link ID.":"expiration"===e?"Your current plan doesn't allow setting link expiration.":"password"===e?"Your current plan doesn't allow setting a password for links.":"utm"===e?"Your current plan doesn't include utm builder functionality.":"retargeting"===e?"Your current plan doesn't include retargeting functionality.":`Your current plan doesn't allow creating ${t}.`),this.siteName=this.settings.get("branding.site_name")}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(o.L),a.Y36(i.p),a.Y36(s.Z))},t.\u0275cmp=a.Xpm({type:t,selectors:[["upgrade-overlay"]],hostAttrs:[1,"permission-overlay"],decls:11,vars:4,consts:[[1,"overlay"],[1,"content"],["trans",""],["trans","",3,"transValues"],["mat-raised-button","","color","accent","routerLink","/billing/pricing","trans","",1,"upgrade-button"],["name","upgrade"]],template:function(t,e){1&t&&(a.TgZ(0,"div",0),a.TgZ(1,"div",1),a.TgZ(2,"div",2),a.TgZ(3,"span",2),a._uU(4),a.qZA(),a._uU(5," "),a.TgZ(6,"span",3),a._uU(7," Upgrade to get more out of :siteName. "),a.qZA(),a.qZA(),a.TgZ(8,"a",4),a._uU(9,"Upgrade Now"),a.qZA(),a.qZA(),a._UZ(10,"svg-image",5),a.qZA()),2&t&&(a.xp6(4),a.Oqu(e.message),a.xp6(2),a.Q6J("transValues",a.VKq(2,u,e.siteName)))},directives:[r.P,l.zs,c.yS,d.L],styles:["[_nghost-%COMP%]{display:block;padding:5px 0}.overlay[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:var(--be-background);box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);border-radius:4px;padding:20px;max-width:350px}.content[_ngcontent-%COMP%]{flex:1 1 auto}svg-image[_ngcontent-%COMP%]{height:80px;width:auto;flex-shrink:0;margin-left:15px}.upgrade-button[_ngcontent-%COMP%]{margin-top:20px}"],changeDetection:0}),t})()},45362:function(t,e,n){"use strict";n.d(e,{V:function(){return ot}});var i=n(67455),a=n(36024),o=n(56515),s=n(35366),r=n(68515);let l=(()=>{class t{constructor(t){this.http=t}index(e={}){return this.http.get(`${t.BASE_URI}`,e)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}}return t.BASE_URI="pixel",t.\u0275fac=function(e){return new(e||t)(s.LFG(r.r))},t.\u0275prov=s.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var c=n(92935),d=n(11520),u=n(78512);const p=[{name:"facebook",type:"number"},{name:"twitter",type:"number"},{name:"google-tag-manager",type:"text",pattern:"GTM-[a-zA-Z0-9]+"},{name:"google-analytics",type:"text"},{name:"adwords",type:"number"},{name:"bing",type:"number"},{name:"pinterest",type:"number"},{name:"linkedin",type:"text"},{name:"quora",type:"text",pattern:"[a-z0-9]+"},{name:"adroll",type:"text"},{name:"nexus-segment",type:"text"},{name:"custom",type:"text"}];var g=n(31041),h=n(73234),m=n(61116),f=n(77307),b=n(84369),v=n(38116);function _(t,e){1&t&&(s.TgZ(0,"span",11),s._uU(1,"Update Pixel"),s.qZA())}function Z(t,e){1&t&&(s.TgZ(0,"span",11),s._uU(1,"Create New Pixel"),s.qZA())}function x(t,e){if(1&t&&(s.TgZ(0,"div",20),s._uU(1),s.qZA()),2&t){const t=s.oxw().ngIf;s.xp6(1),s.Oqu(t.name)}}function y(t,e){if(1&t&&(s.TgZ(0,"option",21),s._uU(1),s.qZA()),2&t){const t=e.$implicit,n=s.oxw(2);s.Q6J("value",t.name),s.xp6(1),s.Oqu(n.viewTypeName(t.name))}}function A(t,e){if(1&t&&(s.TgZ(0,"div",20),s._uU(1),s.qZA()),2&t){const t=s.oxw(3).ngIf;s.xp6(1),s.Oqu(t.pixel_id)}}function w(t,e){if(1&t&&(s.TgZ(0,"div",13),s.TgZ(1,"label",23),s._uU(2,"Pixel ID"),s.qZA(),s._UZ(3,"input",24),s.YNc(4,A,2,1,"div",16),s.qZA()),2&t){const t=s.oxw().ngIf,e=s.oxw().ngIf;s.xp6(3),s.Q6J("type",t.type)("pattern",t.pattern),s.xp6(1),s.Q6J("ngIf",e.pixel_id)}}function k(t,e){1&t&&(s.TgZ(0,"div",12),s.TgZ(1,"div",13),s.TgZ(2,"label",25),s._uU(3,"Custom Code for Page Head"),s.qZA(),s._UZ(4,"textarea",26),s.qZA(),s.TgZ(5,"div",13),s.TgZ(6,"label",27),s._uU(7,"Custom Code for Page Body"),s.qZA(),s._UZ(8,"textarea",28),s.qZA(),s.qZA())}function T(t,e){if(1&t&&(s.ynx(0),s.YNc(1,w,5,3,"div",22),s.YNc(2,k,9,0,"div",7),s.BQk()),2&t){const t=e.ngIf;s.xp6(1),s.Q6J("ngIf","custom"!==t.name),s.xp6(1),s.Q6J("ngIf","custom"===t.name)}}function C(t,e){if(1&t&&(s.TgZ(0,"mat-dialog-content",12),s.TgZ(1,"div",13),s.TgZ(2,"label",14),s._uU(3,"Name"),s.qZA(),s._UZ(4,"input",15),s.YNc(5,x,2,1,"div",16),s.qZA(),s.TgZ(6,"div",13),s.TgZ(7,"label",17),s._uU(8,"Type"),s.qZA(),s.TgZ(9,"select",18),s.YNc(10,y,2,2,"option",19),s.qZA(),s.qZA(),s.YNc(11,T,3,2,"ng-container",10),s.ALo(12,"async"),s.qZA()),2&t){const t=e.ngIf,n=s.oxw();s.xp6(5),s.Q6J("ngIf",t.name),s.xp6(5),s.Q6J("ngForOf",n.types),s.xp6(1),s.Q6J("ngIf",s.lcZ(12,3,n.selectedType$))}}function q(t,e){1&t&&(s.TgZ(0,"span"),s._uU(1,"Update"),s.qZA())}function U(t,e){1&t&&(s.TgZ(0,"span"),s._uU(1,"Create"),s.qZA())}let I=(()=>{class t{constructor(t,e,n,i,a){this.dialogRef=t,this.data=e,this.fb=n,this.pixels=i,this.toast=a,this.types=p,this.loading$=new u.X(!1),this.errors$=new u.X({}),this.selectedType$=new u.X(this.types[0]),this.form=this.fb.group({name:[""],type:[this.types[0].name],head_code:[""],body_code:[""],pixel_id:[""]})}ngOnInit(){this.form.get("type").valueChanges.subscribe(t=>{this.selectedType$.next(this.types.find(e=>e.name===t))}),this.data.pixel&&this.form.patchValue(this.data.pixel)}confirm(){this.loading$.next(!0);const t=this.data.pixel?this.pixels.update(this.data.pixel.id,this.getPayload()):this.pixels.create(this.getPayload()),e=this.data.pixel?i.V.TRACKING_PIXEL_UPDATE_SUCCESS:i.V.TRACKING_PIXEL_CREATE_SUCCESS;t.pipe((0,d.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open(e),this.close(t.pixel)},t=>this.errors$.next(t.errors))}close(t){this.dialogRef.close(t)}getPayload(){return Object.assign({},this.form.value)}viewTypeName(t){return t.replace(/-/g," ")}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(c.so),s.Y36(c.WI),s.Y36(g.qu),s.Y36(l),s.Y36(h.F))},t.\u0275cmp=s.Xpm({type:t,selectors:[["crupdate-tracking-pixel-modal"]],decls:17,vars:11,consts:[[1,"modal-header"],["mat-dialog-title",""],["trans","",4,"ngIf","ngIfElse"],["creating",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit"],["class","many-inputs",4,"ngIf"],["type","button","mat-button","","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],[4,"ngIf"],["trans",""],[1,"many-inputs"],[1,"input-container"],["for","name","trans",""],["type","text","id","name","formControlName","name","required",""],["class","error",4,"ngIf"],["for","type","trans",""],["id","type","formControlName","type","required","",1,"type-select"],[3,"value",4,"ngFor","ngForOf"],[1,"error"],[3,"value"],["class","input-container",4,"ngIf"],["for","pixel_id","trans",""],["id","pixel_id","formControlName","pixel_id","required","",3,"type","pattern"],["for","head-code","trans",""],["name","head-code","id","head-code","rows","10","formControlName","head_code"],["for","body-code","trans",""],["name","body-code","id","body-code","rows","10","formControlName","body_code"]],template:function(t,e){if(1&t&&(s.TgZ(0,"div",0),s.TgZ(1,"h2",1),s.YNc(2,_,2,0,"span",2),s.YNc(3,Z,2,0,"ng-template",null,3,s.W1O),s.qZA(),s.TgZ(5,"button",4),s.NdJ("click",function(){return e.close()}),s._UZ(6,"mat-icon",5),s.qZA(),s.qZA(),s.TgZ(7,"form",6),s.NdJ("ngSubmit",function(){return e.confirm()}),s.YNc(8,C,13,5,"mat-dialog-content",7),s.ALo(9,"async"),s.TgZ(10,"mat-dialog-actions"),s.TgZ(11,"button",8),s.NdJ("click",function(){return e.close()}),s._uU(12,"Cancel"),s.qZA(),s.TgZ(13,"button",9),s.ALo(14,"async"),s.YNc(15,q,2,0,"span",10),s.YNc(16,U,2,0,"span",10),s.qZA(),s.qZA(),s.qZA()),2&t){const t=s.MAs(4);s.xp6(2),s.Q6J("ngIf",e.data.pixel)("ngIfElse",t),s.xp6(5),s.Q6J("formGroup",e.form),s.xp6(1),s.Q6J("ngIf",s.lcZ(9,7,e.errors$)),s.xp6(5),s.Q6J("disabled",s.lcZ(14,9,e.loading$)),s.xp6(2),s.Q6J("ngIf",e.data.pixel),s.xp6(1),s.Q6J("ngIf",!e.data.pixel)}},directives:[c.uh,m.O5,f.Hw,g.JL,g.sg,c.H8,b.lW,v.P,c.xY,g.Fj,g.JJ,g.u,g.Q7,g.EJ,m.sg,g.YN,g.Kr,g.c5],pipes:[m.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.type-select[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),t})();var M=n(59075),O=n(45523),J=n(44415);const P=[new M.XQ({type:M.Bq.Select,key:"type",defaultValue:"facebook",description:"Tracking pixel type",options:p.map(t=>({key:t.name,value:t.name}))}),new O.T7({description:"Date pixel was created"}),new O.yH({description:"Date pixel was last updated"}),new M.XQ({type:M.Bq.SelectModel,key:"user_id",label:"User",description:"User overlay was created by",component:J.y})];var N=n(28505),S=n(36501),D=n(63337),Q=n(95157),Y=n(48865),L=n(34955),F=n(56361),E=n(13536),R=n(80922),$=n(86668),V=n(27701),B=n(54275),H=n(24311),z=n(71765),G=n(47210),j=n(2406),X=n(40450);function W(t,e){1&t&&s._UZ(0,"mat-progress-bar",17)}function K(t,e){1&t&&(s.TgZ(0,"th",12),s._uU(1,"Owner"),s.qZA())}const tt=function(t){return{count:t,resource:"pixel(s)"}};function et(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"tr"),s.TgZ(1,"th",18),s.TgZ(2,"div",19),s._uU(3," :count :resource selected: "),s.qZA(),s.TgZ(4,"div",20),s.TgZ(5,"permission-aware-button",21),s.TgZ(6,"button",22),s.NdJ("click",function(){return s.CHM(t),s.oxw().maybeDeleteSelectedPixels()}),s._uU(7," Delete "),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA()}if(2&t){const t=e.ngIf;s.xp6(2),s.Q6J("transValues",s.VKq(1,tt,t))}}function nt(t,e){if(1&t&&(s.TgZ(0,"td",36),s._UZ(1,"user-column",37),s.qZA()),2&t){const t=s.oxw().$implicit;s.xp6(1),s.Q6J("user",t.user)}}function it(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"tr"),s._UZ(1,"td",23),s.TgZ(2,"td",24),s._uU(3),s.qZA(),s.YNc(4,nt,2,1,"td",25),s.TgZ(5,"td",26),s._uU(6),s.qZA(),s.TgZ(7,"td",27),s._uU(8),s.qZA(),s.TgZ(9,"td",28),s._uU(10),s.ALo(11,"formattedDate"),s.qZA(),s.TgZ(12,"td",29),s.TgZ(13,"permission-aware-button",30),s.TgZ(14,"button",31),s.NdJ("click",function(){const e=s.CHM(t).$implicit;return s.oxw().showCrupdatePixelModal(e)}),s.ALo(15,"trans"),s._UZ(16,"mat-icon",32),s.qZA(),s.qZA(),s.TgZ(17,"permission-aware-button",33),s.TgZ(18,"button",34),s.NdJ("click",function(){const e=s.CHM(t).$implicit;return s.oxw().maybeDeleteSelectedPixels([e.id])}),s._UZ(19,"mat-icon",35),s.qZA(),s.qZA(),s.qZA(),s.qZA()}if(2&t){const t=e.$implicit,n=s.oxw();s.xp6(1),s.Q6J("table-body-checkbox",t.id),s.xp6(2),s.Oqu(t.name),s.xp6(1),s.Q6J("ngIf",n.showUserColumn()),s.xp6(2),s.Oqu(t.type),s.xp6(2),s.Oqu(t.pixel_id),s.xp6(2),s.Oqu(s.lcZ(11,8,t.updated_at)),s.xp6(3),s.Q6J("userOwnsResource",n.currentUser.get("id")===t.user_id),s.xp6(1),s.Q6J("matTooltip",s.lcZ(15,10,"Edit tracking pixel"))}}function at(t,e){1&t&&(s.TgZ(0,"no-results-message",38),s.TgZ(1,"span",39),s._uU(2,"No tracking pixels have been created yet"),s.qZA(),s.qZA())}let ot=(()=>{class t{constructor(t,e,n,i,a,o,s,r){this.datatable=t,this.currentUser=e,this.linkUsage=n,this.trackingPixels=i,this.toast=a,this.route=o,this.workspaces=s,this.activeSection=r,this.filters=P,this.pixels$=this.datatable.data$}ngOnInit(){this.workspaceSub=this.workspaces.activeId$.subscribe(()=>{this.setFilters()}),this.datatable.init({uri:l.BASE_URI,staticParams:{with:["user"],userId:this.showUserColumn()?null:this.currentUser.get("id")}})}ngOnDestroy(){this.workspaceSub.unsubscribe()}maybeDeleteSelectedPixels(t){this.datatable.confirmResourceDeletion("tracking pixels").subscribe(()=>{this.trackingPixels.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.linkUsage.reload(),this.toast.open(i.V.TRACKING_PIXEL_DELETE_SUCCESS)},t=>{this.toast.open(t.message||a.v.Default)})})}showCrupdatePixelModal(t){this.datatable.openCrupdateResourceModal(I,{pixel:t}).subscribe(()=>{this.linkUsage.reload()})}showUserColumn(){return this.activeSection.admin||!!this.workspaces.activeId$.value}setFilters(){this.filters=P.filter(t=>"user_id"!==t.key||this.showUserColumn())}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(o.x),s.Y36(N.I),s.Y36(S.F),s.Y36(l),s.Y36(h.F),s.Y36(D.gz),s.Y36(Q.b),s.Y36(Y.W))},t.\u0275cmp=s.Xpm({type:t,selectors:[["tracking-pixel-index"]],features:[s._Bn([o.x])],decls:35,vars:12,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","pixels",3,"filters"],[1,"action-buttons"],["permission","tracking_pixels.create"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"click"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","","trans","",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","location-tracking.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["colspan","7"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["permission","tracking_pixels.delete"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Name"],["data-label","Owner",4,"ngIf"],["data-label","Type"],["data-label","Pixel ID"],["data-label","Last Updated"],[1,"edit-column"],["permission","tracking_pixels.update",3,"userOwnsResource"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["permission","tracking_pixels.delete",1,"visible-on-mobile"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgImage","location-tracking.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(s.TgZ(0,"div",0),s.TgZ(1,"h1",1),s._uU(2,"Tracking Pixels"),s.qZA(),s.TgZ(3,"div",2),s._UZ(4,"datatable-filters",3),s.TgZ(5,"div",4),s.TgZ(6,"permission-aware-button",5),s.TgZ(7,"button",6),s.NdJ("click",function(){return e.showCrupdatePixelModal()}),s._UZ(8,"mat-icon",7),s.TgZ(9,"span",1),s._uU(10,"Add New Pixel"),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.TgZ(11,"div",8),s.YNc(12,W,1,0,"mat-progress-bar",9),s.ALo(13,"async"),s.TgZ(14,"table",10),s.TgZ(15,"thead"),s.TgZ(16,"tr"),s._UZ(17,"th",11),s.TgZ(18,"th",12),s._uU(19,"Name"),s.qZA(),s.YNc(20,K,2,0,"th",13),s.TgZ(21,"th",12),s._uU(22,"Type"),s.qZA(),s.TgZ(23,"th",1),s._uU(24,"Pixel ID"),s.qZA(),s.TgZ(25,"th",1),s._uU(26,"Last Updated"),s.qZA(),s._UZ(27,"th"),s.qZA(),s.YNc(28,et,8,3,"tr",14),s.qZA(),s.TgZ(29,"tbody"),s.YNc(30,it,20,12,"tr",15),s.ALo(31,"async"),s.qZA(),s.qZA(),s.YNc(32,at,3,0,"no-results-message",16),s.ALo(33,"async"),s._UZ(34,"datatable-footer"),s.qZA()),2&t&&(s.xp6(4),s.Q6J("filters",e.filters),s.xp6(8),s.Q6J("ngIf",s.lcZ(13,6,e.datatable.paginator&&e.datatable.paginator.loading$)),s.xp6(8),s.Q6J("ngIf",e.showUserColumn()),s.xp6(8),s.Q6J("ngIf",e.datatable.selectedRows$.value.length),s.xp6(2),s.Q6J("ngForOf",s.lcZ(31,8,e.pixels$)),s.xp6(2),s.Q6J("ngIf",s.lcZ(33,10,e.datatable.paginator.noResults$)))},directives:[v.P,L.h,F.v,b.lW,f.Hw,m.O5,E.e,R.p,m.sg,$.V,V.pW,B.O,H.gM,z.r,G.U],pipes:[m.Ov,j.l,X.R],styles:[".mat-column-type[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),t})()},36501:function(t,e,n){"use strict";n.d(e,{F:function(){return r}});var i=n(66994),a=n(35366),o=n(68515),s=n(541);let r=(()=>{class t{constructor(t,e){this.http=t,this.selectValues=e,this.response$=new i.t(1)}reload(){this.selectValues.clearCache(),this.http.get("link/usage").subscribe(t=>{this.response$.next(t)})}}return t.\u0275fac=function(e){return new(e||t)(a.LFG(o.r),a.LFG(s.U))},t.\u0275prov=a.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},32198:function(t,e,n){"use strict";n.d(e,{l:function(){return r}});var i=n(78512),a=n(35366),o=n(31041),s=n(88195);let r=(()=>{class t{constructor(t,e){this.fb=t,this.settings=e,this.errors$=new i.X({}),this.build(),this.linkHash=this.formGroup.get("hash")}value(){const t=Object.assign({},this.formGroup.value);return t.rules=(t.geo_rules||[]).concat(t.device_rules).concat(t.platform_rules).filter(t=>(null==t?void 0:t.key)&&(null==t?void 0:t.value)),delete t.geo_rules,delete t.device_rules,delete t.platform_rules,t.type.indexOf(":")>-1&&(t.type_id=parseInt(t.type.split(":")[1]),t.type=t.type.split(":")[0]),t.long_urls?(t.long_urls=t.long_urls.split(/\n/g),delete t.long_url,delete t.alias):delete t.long_urls,this.formGroup.get("password").dirty||delete t.password,t}build(){const t=this.settings.get("links.default_type","direct");this.formGroup=this.fb.group({type:[t],name:[""],long_url:[""],long_urls:[""],domain_id:[null],hash:[""],alias:[""],image:[""],utm:[""],password:[""],active:[!0],expires_at:[""],activates_at:[""],description:[""],tags:[[]],pixels:[[]],groups:[[]],geo_rules:this.fb.array([]),device_rules:this.fb.array([]),platform_rules:this.fb.array([]),exp_clicks_rule:this.fb.group({key:[""],value:[""]})}),this.geoRules=this.formGroup.controls.geo_rules,this.deviceRules=this.formGroup.controls.device_rules,this.platformRules=this.formGroup.controls.platform_rules,this.expClicksRule=this.formGroup.controls.exp_clicks_rule,this.addNewGeoRule(),this.addNewDeviceRule(),this.addNewPlatformRule(),this.formGroup.get("long_urls").valueChanges.subscribe(t=>{t?this.formGroup.get("alias").disable():this.formGroup.get("alias").enable()})}patchValue(t){if(t){const e=Object.assign({},t);"type_id"in t&&t.type_id&&(e.type=`${t.type}:${t.type_id}`);const n=t.rules||[];e.geo_rules=n.filter(t=>"geo"===t.type),e.device_rules=n.filter(t=>"device"===t.type),e.platform_rules=n.filter(t=>"platform"===t.type),e.exp_clicks_rule=n.find(t=>"exp_clicks"===t.type),e.tags=(e.tags||[]).map(t=>t.name),e.pixels=(e.pixels||[]).map(t=>t.id),e.groups=(e.groups||[]).map(t=>t.id),t.has_password&&(e.password="******"),this.formGroup.patchValue(e),e.geo_rules.length&&(this.geoRules.clear(),e.geo_rules.forEach(t=>{this.addNewGeoRule(t.key,t.value)})),e.device_rules.length&&(this.deviceRules.clear(),e.device_rules.forEach(t=>{this.addNewDeviceRule(t.key,t.value)})),e.platform_rules.length&&(this.platformRules.clear(),e.platform_rules.forEach(t=>{this.addNewPlatformRule(t.key,t.value)}))}}addNewGeoRule(t="us",e=""){this.geoRules.push(this.fb.group({key:[t],value:[e],type:"geo"}))}addNewDeviceRule(t="mobile",e=""){this.deviceRules.push(this.fb.group({key:[t],value:[e],type:"device"}))}addNewPlatformRule(t="windows",e=""){this.platformRules.push(this.fb.group({key:[t],value:[e],type:"platform"}))}setErrors(t){this.errors$.next(t||{})}}return t.\u0275fac=function(e){return new(e||t)(a.LFG(o.qu),a.LFG(s.Z))},t.\u0275prov=a.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},57125:function(t,e,n){"use strict";n.d(e,{G:function(){return l}});var i=n(16930),a=n(20274),o=n(94380),s=n(73033),r=n(35366);let l=(()=>{class t extends i.c{constructor(){super(...arguments),this.DEFAULT_MAX_SIZE_MB=5}initValidations(){const t=[new a.p({maxSize:(0,o.F)(this.DEFAULT_MAX_SIZE_MB,"MB")},this.i18n),new s.p({types:["image"]},this.i18n)];this.validations.push(...t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=r.n5z(t)))(n||t)}}(),t.\u0275prov=r.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},44415:function(t,e,n){"use strict";n.d(e,{y:function(){return v}});var i=n(31041),a=n(47701),o=n(98720),s=n(44689),r=n(47727),l=n(78512),c=n(40878),d=n(35366),u=n(92935),p=n(62424),g=n(38116),h=n(77307),m=n(42300),f=n(61116);function b(t,e){if(1&t){const t=d.EpF();d.TgZ(0,"div",9),d.NdJ("click",function(){const e=d.CHM(t).$implicit;return d.oxw().close(e)}),d._UZ(1,"img",10),d.TgZ(2,"div",11),d.TgZ(3,"div",12),d._uU(4),d.qZA(),d.TgZ(5,"div",13),d._uU(6),d.qZA(),d.qZA(),d.qZA()}if(2&t){const t=e.$implicit;d.xp6(1),d.Q6J("src",t.avatar,d.LSH),d.xp6(3),d.Oqu(t.display_name),d.xp6(2),d.Oqu(t.email)}}let v=(()=>{class t{constructor(t,e){this.dialogRef=t,this.users=e,this.searchFormControl=new i.NI,this.loading$=new l.X(!1),this.users$=new l.X([])}ngOnInit(){this.searchFormControl.valueChanges.pipe((0,a.b)(250),(0,o.x)(),(0,s.w)(t=>this.searchUsers(t)),(0,r.K)(()=>(0,c.of)([]))).subscribe(t=>{this.users$.next(t),this.loading$.next(!1)})}close(t){this.dialogRef.close(this.normalizeUser(t))}searchUsers(t){return this.loading$.next(!0),t?this.users.getAll({query:t}):(0,c.of)([])}normalizeUser(t){return t?{id:t.id,name:t.display_name,image:t.avatar,model_type:t.model_type}:null}}return t.\u0275fac=function(e){return new(e||t)(d.Y36(u.so),d.Y36(p.Q))},t.\u0275cmp=d.Xpm({type:t,selectors:[["find-user-modal"]],decls:13,vars:7,consts:[[1,"modal-header"],["mat-dialog-title","","trans",""],["type","button","tabindex","-1",1,"no-style","close-button",3,"click"],["svgIcon","close"],[1,"input-container","search-input-container"],["type","text","placeholder","Search for user by name or email...",3,"formControl"],[1,"small",3,"isVisible"],[1,"users"],["class","user",3,"click",4,"ngFor","ngForOf"],[1,"user",3,"click"],[3,"src"],[1,"meta","overflow-hidden"],[1,"name","overflow-hidden"],[1,"email","overflow-hidden"]],template:function(t,e){1&t&&(d.TgZ(0,"div",0),d.TgZ(1,"h2",1),d._uU(2,"Find User"),d.qZA(),d.TgZ(3,"button",2),d.NdJ("click",function(){return e.close()}),d._UZ(4,"mat-icon",3),d.qZA(),d.qZA(),d.TgZ(5,"mat-dialog-content"),d.TgZ(6,"div",4),d._UZ(7,"input",5),d._UZ(8,"loading-indicator",6),d.ALo(9,"async"),d.qZA(),d.TgZ(10,"div",7),d.YNc(11,b,7,3,"div",8),d.ALo(12,"async"),d.qZA(),d.qZA()),2&t&&(d.xp6(7),d.Q6J("formControl",e.searchFormControl),d.xp6(1),d.Q6J("isVisible",d.lcZ(9,3,e.loading$)),d.xp6(3),d.Q6J("ngForOf",d.lcZ(12,5,e.users$)))},directives:[u.uh,g.P,h.Hw,u.xY,i.Fj,i.JJ,i.oH,m.Q,f.sg],pipes:[f.Ov],styles:["[_nghost-%COMP%]{display:block;width:500px;max-width:100%}.modal-header[_ngcontent-%COMP%]{margin-bottom:15px}.search-input-container[_ngcontent-%COMP%]{width:100%;margin-bottom:20px;position:relative}loading-indicator[_ngcontent-%COMP%]{top:12px;right:12px}.users[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:space-between;margin:0 -15px}.user[_ngcontent-%COMP%]{display:flex;align-items:center;width:calc(50% - 10px);flex-shrink:0;min-width:0;padding:12px;border-radius:4px;cursor:pointer}.user[_ngcontent-%COMP%]:hover{background-color:var(--be-hover)}.user[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:50px;height:50px;flex-shrink:0;margin-right:10px;border-radius:4px;overflow:hidden}.user[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{color:var(--be-text);font-size:1.5rem;margin-bottom:5px}.user[_ngcontent-%COMP%]   .email[_ngcontent-%COMP%]{color:var(--be-secondary-text)}.overflow-hidden[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis}"],changeDetection:0}),t})()},68692:function(t,e,n){"use strict";n.d(e,{X:function(){return r}});var i=n(61116),a=n(68400),o=n(31041),s=n(35366);let r=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=s.oAB({type:t}),t.\u0275inj=s.cJS({imports:[[i.ez,a.N,o.UX]]}),t})()},77910:function(t,e,n){"use strict";n.d(e,{S:function(){return T}});var i=n(31041),a=n(78512),o=n(40878),s=n(47701),r=n(98720),l=n(44689),c=n(47727),d=n(35366),u=n(95522),p=n(61116),g=n(79961),h=n(77307),m=n(87064),f=n(40450);const b=["auto"],v=["inputEl"],_=["selectModeTemplate"];function Z(t,e){if(1&t){const t=d.EpF();d.TgZ(0,"mat-chip",8),d.NdJ("removed",function(){const e=d.CHM(t).index;return d.oxw().remove(e)}),d._uU(1),d._UZ(2,"mat-icon",9),d.qZA()}if(2&t){const t=e.$implicit,n=d.oxw();d.Q6J("selectable",!1)("removable",!n.selectMode),d.xp6(1),d.hij(" ",n.displayChipValue(t)," ")}}const x=function(t){return{elementRef:t}};function y(t,e){if(1&t){const t=d.EpF();d.TgZ(0,"input",10,11),d.NdJ("matChipInputTokenEnd",function(e){return d.CHM(t),d.oxw().addFromChipInput(e.value)}),d.ALo(2,"trans"),d.qZA()}if(2&t){const t=d.oxw(),e=d.MAs(1),n=d.MAs(6);d.Q6J("placeholder",d.lcZ(2,7,t.placeholder))("type",t.type)("matChipInputFor",e)("matChipInputAddOnBlur",!0)("matAutocomplete",n)("matAutocompleteConnectedTo",d.VKq(9,x,t.el))("formControl",t.formControl)}}function A(t,e){if(1&t&&(d.TgZ(0,"mat-option",12),d._uU(1),d.qZA()),2&t){const t=e.$implicit,n=d.oxw();d.Q6J("value",t),d.xp6(1),d.Oqu(n.displayChipValue(t))}}function w(t,e){if(1&t&&(d.TgZ(0,"mat-option",12),d._uU(1),d.qZA()),2&t){const t=e.$implicit,n=d.oxw(2);d.Q6J("value",t),d.xp6(1),d.Oqu(n.displayChipValue(t))}}function k(t,e){1&t&&d.YNc(0,w,2,2,"mat-option",6),2&t&&d.Q6J("ngForOf",e.suggestions)}let T=(()=>{class t{constructor(t){this.el=t,this.type="text",this.emailsInput=!1,this.selectMode=!1,this.formControl=new i.NI,this.items$=new a.X([]),this.suggestedValues$=new a.X([])}set suggestedValues(t){this.suggestedValues$.next(t)}ngOnInit(){this.suggestFn&&this.bindToSearchControl()}ngAfterViewInit(){this.emailsInput&&this.parseEmailsOnPaste()}remove(t){const e=[...this.items$.value];e.splice(t,1),this.items$.next(e),this.propagateChange(this.items$.value)}addFromChipInput(t,e=!0){!t||this.matAutocomplete.isOpen||this.selectMode||this.add(t,e)}addFromAutocomplete(t,e=!0){this.add(t,e)}add(t,e=!0){t="string"==typeof t?t.trim():t;const n=this.findValueIndex(t)>-1;t&&!n&&(this.items$.next([...this.items$.value,t]),e&&this.propagateChange(this.items$.value)),this.inputEl&&(this.inputEl.nativeElement.value=""),this.formControl.setValue(null),this.suggestedValues$.next([])}findValueIndex(t){return"string"==typeof t?this.items$.value.indexOf(t):this.items$.value.findIndex(e=>e.id===t.id)}writeValue(t=[]){this.items$.next(t||[])}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}bindToSearchControl(){this.formControl.valueChanges.pipe((0,s.b)(150),(0,r.x)(),(0,l.w)(t=>t?this.suggestFn(t):(0,o.of)([])),(0,c.K)(()=>(0,o.of)([]))).subscribe(t=>{const e=t.filter(t=>-1===this.findValueIndex(t));this.suggestedValues$.next(e)})}displayChipValue(t){return"object"==typeof t?t.name:t}parseEmailsOnPaste(){this.inputEl.nativeElement.addEventListener("paste",t=>{const e=(t.clipboardData||window.clipboardData).getData("text").match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);if(e){t.preventDefault();const n=window.getSelection();n.rangeCount&&(n.deleteFromDocument(),e.forEach(t=>this.add(t)))}})}}return t.\u0275fac=function(e){return new(e||t)(d.Y36(d.SBq))},t.\u0275cmp=d.Xpm({type:t,selectors:[["chip-input"]],viewQuery:function(t,e){if(1&t&&(d.Gf(b,5),d.Gf(v,5),d.Gf(_,5)),2&t){let t;d.iGM(t=d.CRH())&&(e.matAutocomplete=t.first),d.iGM(t=d.CRH())&&(e.inputEl=t.first),d.iGM(t=d.CRH())&&(e.selectModeTemplate=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&d.ekj("select-mode",e.selectMode)},inputs:{placeholder:"placeholder",type:"type",emailsInput:"emailsInput",suggestFn:"suggestFn",selectMode:"selectMode",suggestedValues:"suggestedValues"},features:[d._Bn([{provide:i.JU,useExisting:t,multi:!0}])],decls:11,vars:9,consts:[[3,"selectable"],["chipList",""],[3,"selectable","removable","removed",4,"ngFor","ngForOf"],["class","mat-chip-input mat-input-element",3,"placeholder","type","matChipInputFor","matChipInputAddOnBlur","matAutocomplete","matAutocompleteConnectedTo","formControl","matChipInputTokenEnd",4,"ngIf"],[1,"chip-input-autocomplete-panel",3,"autoActiveFirstOption","optionSelected"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["selectModeTemplate",""],[3,"selectable","removable","removed"],["matChipRemove","","svgIcon","cancel"],[1,"mat-chip-input","mat-input-element",3,"placeholder","type","matChipInputFor","matChipInputAddOnBlur","matAutocomplete","matAutocompleteConnectedTo","formControl","matChipInputTokenEnd"],["inputEl",""],[3,"value"]],template:function(t,e){1&t&&(d.TgZ(0,"mat-chip-list",0,1),d.YNc(2,Z,3,3,"mat-chip",2),d.ALo(3,"async"),d.YNc(4,y,3,11,"input",3),d.qZA(),d.TgZ(5,"mat-autocomplete",4,5),d.NdJ("optionSelected",function(t){return e.addFromAutocomplete(t.option.value)}),d.YNc(7,A,2,2,"mat-option",6),d.ALo(8,"async"),d.qZA(),d.YNc(9,k,1,1,"ng-template",null,7,d.W1O)),2&t&&(d.Q6J("selectable",!1),d.xp6(2),d.Q6J("ngForOf",d.lcZ(3,5,e.items$)),d.xp6(2),d.Q6J("ngIf",!e.selectMode),d.xp6(1),d.Q6J("autoActiveFirstOption",!0),d.xp6(2),d.Q6J("ngForOf",d.lcZ(8,7,e.suggestedValues$)))},directives:[u.qn,p.sg,p.O5,g.XC,u.HS,h.Hw,u.qH,u.oH,g.ZL,i.Fj,i.JJ,i.oH,m.ey],pipes:[p.Ov,f.R],styles:["chip-input{display:block;min-height:46px}chip-input .mat-chip-list-wrapper{width:100%;height:100%;color:inherit;border:1px solid var(--be-divider-default);padding:6px;line-height:normal;font-size:1.4rem;font-family:inherit;background-color:inherit;box-sizing:border-box;border-radius:2px;margin:0}chip-input .mat-chip-input{height:24px;font:inherit;background:0 0;color:currentColor;border:none;outline:0;padding:0;margin:0;width:0;max-width:100%;vertical-align:bottom;text-align:inherit}chip-input .mat-chip-input:focus{outline:none;box-shadow:none}.chip-input-select-panel{background-color:var(--be-background);min-width:180px;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}"],encapsulation:2,changeDetection:0}),t})()},56160:function(t,e,n){"use strict";n.d(e,{G:function(){return p}});var i=n(61116),a=n(95522),o=n(77307),s=n(31041),r=n(68400),l=n(79961),c=n(84369),d=n(87064),u=n(35366);let p=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=u.oAB({type:t}),t.\u0275inj=u.cJS({imports:[[i.ez,a.Hi,l.Bb,s.UX,r.N,c.ot,o.Ps,d.si]]}),t})()},69042:function(t,e,n){"use strict";n.d(e,{M:function(){return h}});var i=n(64762),a=n(35366),o=n(31041),s=n(40149),r=n(78512),l=n(98979),c=n(87064),d=n(77307),u=n(38116),p=n(61116);const g=["*"];let h=(()=>{class t{constructor(t){this.overlayPanel=t,this.color$=new r.X(null)}ngOnDestroy(){this.pickerSub&&this.pickerSub.unsubscribe()}writeValue(t){this.color$.next(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}openColorPicker(t){return(0,i.mG)(this,void 0,void 0,function*(){const{BeColorPickerModule:e}=yield n.e(378).then(n.bind(n,49378));this.pickerSub=this.overlayPanel.open(e.components.panel,{origin:new a.SBq(t.target),position:s.x,data:{color:this.color$.value}}).valueChanged().subscribe(t=>{this.color$.next(t),this.propagateChange(this.color$.value)})})}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(l.T))},t.\u0275cmp=a.Xpm({type:t,selectors:[["color-picker-input"]],features:[a._Bn([{provide:o.JU,useExisting:t,multi:!0}])],ngContentSelectors:g,decls:7,vars:4,consts:[["type","button","matRipple","",1,"no-style","color-picker-btn",3,"click"],["svgIcon","drop-custom",1,"color-icon"],["trans","",1,"name"],["trans","",1,"change"]],template:function(t,e){1&t&&(a.F$t(),a.TgZ(0,"button",0),a.NdJ("click",function(t){return e.openColorPicker(t)}),a.TgZ(1,"mat-icon",1),a.ALo(2,"async"),a.qZA(),a.TgZ(3,"span",2),a.Hsn(4),a.qZA(),a.TgZ(5,"span",3),a._uU(6,"Change"),a.qZA(),a.qZA()),2&t&&(a.xp6(1),a.Udp("color",a.lcZ(2,2,e.color$)))},directives:[c.wG,d.Hw,u.P],pipes:[p.Ov],styles:[".color-picker-btn[_ngcontent-%COMP%]{display:flex;align-items:center;padding:0 10px 0 15px;margin-bottom:15px;border-radius:4px;border:1px solid var(--be-divider-default);background-color:var(--be-background);cursor:pointer;height:57px;font-size:1.5rem;overflow:hidden;width:100%}.color-picker-btn[_ngcontent-%COMP%]   .color-icon[_ngcontent-%COMP%]{width:35px;height:35px}.color-picker-btn[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{margin-left:3px;margin-top:3px;font-size:1.4rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:160px;text-transform:capitalize}.color-picker-btn[_ngcontent-%COMP%]   .change[_ngcontent-%COMP%]{color:var(--be-link);font-size:1.3rem;margin-left:auto}"],changeDetection:0}),t})()},37604:function(t,e,n){"use strict";n.d(e,{x:function(){return l}});var i=n(61116),a=n(68400),o=n(77307),s=n(87064),r=n(35366);let l=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=r.oAB({type:t}),t.\u0275inj=r.cJS({imports:[[i.ez,a.N,o.Ps,s.si]]}),t})()},98081:function(t,e,n){"use strict";n.d(e,{k:function(){return d}});var i=n(31041),a=n(35366),o=n(61116),s=n(38116),r=n(84369);function l(t,e){if(1&t){const t=a.EpF();a.TgZ(0,"button",8),a.NdJ("click",function(){return a.CHM(t),a.oxw().clearValue()}),a._uU(1," Clear "),a.qZA()}}const c=["*"];let d=(()=>{class t{constructor(t,e){this.fb=t,this.cd=e,this.currentDateAsDefault=!1,this.initiated=!1,this.form=this.fb.group({date:[""],time:[""]}),this.setCurrentDatetime()}writeValue(t){t=(t||"").replace("Z","");let[e,n]=t.includes("T")?t.split("T"):t.split(" ");n=n?n.substr(0,5):"",!this.initiated&&this.currentDateAsDefault&&(e=e||this.currentDate,n=n||this.currentTime),this.initiated=!0,this.form.patchValue({date:e,time:n})}registerOnChange(t){this.propagateChange=t,this.form.valueChanges.subscribe(t=>{let e;t.date?(t.time||(t.time="00:00"),e=`${t.date} ${t.time}`,2===e.split(":").length&&(e+=":00")):e=null,this.propagateChange(e)})}registerOnTouched(){}setDisabledState(t){t?this.form.disable():this.form.enable(),this.cd.markForCheck()}clearValue(){this.form.patchValue({date:null,time:null})}setCurrentDatetime(){const[t,e]=(new Date).toISOString().replace("Z","").split("T"),[n,i]=e.split(":");this.currentDate=t,this.currentTime=`${n}:${i}`}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(i.qu),a.Y36(a.sBO))},t.\u0275cmp=a.Xpm({type:t,selectors:[["datetime-input"]],inputs:{id:"id",currentDateAsDefault:"currentDateAsDefault"},features:[a._Bn([{provide:i.JU,useExisting:t,multi:!0}])],ngContentSelectors:c,decls:14,vars:8,consts:[[3,"formGroup"],[1,"legend-label"],["class","clear-btn","type","button","mat-button","","trans","",3,"click",4,"ngIf"],[1,"inline-inputs-container"],[1,"input-container"],["trans","",1,"hidden",3,"for"],["type","date","formControlName","date",1,"date-input",3,"id","placeholder"],["type","time","formControlName","time",1,"time-input",3,"id","placeholder"],["type","button","mat-button","","trans","",1,"clear-btn",3,"click"]],template:function(t,e){1&t&&(a.F$t(),a.TgZ(0,"fieldset",0),a.TgZ(1,"legend"),a.TgZ(2,"span",1),a.Hsn(3),a.qZA(),a.YNc(4,l,2,0,"button",2),a.qZA(),a.TgZ(5,"div",3),a.TgZ(6,"div",4),a.TgZ(7,"label",5),a._uU(8,"Date"),a.qZA(),a._UZ(9,"input",6),a.qZA(),a.TgZ(10,"div",4),a.TgZ(11,"label",5),a._uU(12,"Time"),a.qZA(),a._UZ(13,"input",7),a.qZA(),a.qZA(),a.qZA()),2&t&&(a.Q6J("formGroup",e.form),a.xp6(4),a.Q6J("ngIf",!e.form.disabled),a.xp6(3),a.Q6J("for",e.id+"-date"),a.xp6(2),a.Q6J("id",e.id+"-date")("placeholder",e.currentDate),a.xp6(2),a.Q6J("for",e.id+"-time"),a.xp6(2),a.Q6J("id",e.id+"-time")("placeholder",e.currentTime))},directives:[i.JL,i.sg,o.O5,s.P,i.Fj,i.JJ,i.u,r.lW],styles:[".date-input[_ngcontent-%COMP%]{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.time-input[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}.input-container[_ngcontent-%COMP%]{margin-right:0}legend[_ngcontent-%COMP%]{display:flex;align-items:center;color:var(--be-label);width:100%}.legend-label[_ngcontent-%COMP%]{margin-right:auto}.clear-btn[_ngcontent-%COMP%]{margin-left:10px;line-height:28px}"],changeDetection:0}),t})()},49517:function(t,e,n){"use strict";n.d(e,{N:function(){return p}});var i=n(35366),a=n(72674),o=n(98979),s=n(84369),r=n(77307);const l=["infoIcon"],c=["popoverContent"];function d(t,e){1&t&&i.Hsn(0)}const u=["*"];let p=(()=>{class t{constructor(t,e){this.overlay=t,this.viewContainerRef=e}openPopover(){this.overlayRef&&this.closePopover(),Object.assign({},a.Z)[0].offsetY=-15,this.overlayRef=this.overlay.open(this.content,{origin:this.infoButton,position:a.Z,hasBackdrop:!1,scrollStrategy:"close",viewContainerRef:this.viewContainerRef,panelClass:["info-popover-panel",this.wider?"wider":null]}),this.overlayRef.getPanelEl().addEventListener("mouseleave",()=>{this.closePopover()})}closePopover(){this.overlayRef&&(this.overlayRef.close(),this.overlayRef=null)}togglePopover(){this.overlayRef?this.closePopover():this.openPopover()}onMouseLeave(t){const e=t.toElement||t.relatedTarget;e&&e.classList.contains("info-popover-panel")||this.closePopover()}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(o.T),i.Y36(i.s_b))},t.\u0275cmp=i.Xpm({type:t,selectors:[["info-popover"]],viewQuery:function(t,e){if(1&t&&(i.Gf(l,5,i.SBq),i.Gf(c,5)),2&t){let t;i.iGM(t=i.CRH())&&(e.infoButton=t.first),i.iGM(t=i.CRH())&&(e.content=t.first)}},inputs:{wider:"wider"},ngContentSelectors:u,decls:5,vars:0,consts:[["type","button","mat-icon-button","",3,"click","mouseenter","mouseleave"],["svgIcon","info",1,"info-icon"],["infoIcon",""],["popoverContent",""]],template:function(t,e){1&t&&(i.F$t(),i.TgZ(0,"button",0),i.NdJ("click",function(){return e.togglePopover()})("mouseenter",function(){return e.openPopover()})("mouseleave",function(t){return e.onMouseLeave(t)}),i._UZ(1,"mat-icon",1,2),i.qZA(),i.YNc(3,d,1,0,"ng-template",null,3,i.W1O))},directives:[s.lW,r.Hw],styles:["info-popover .mat-icon-button{vertical-align:middle;color:var(--be-secondary-text);cursor:help}.info-popover-panel{display:block;background-color:var(--be-background);box-shadow:0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);border-radius:4px;padding:15px;max-width:350px}.info-popover-panel.wider{max-width:550px}.info-popover-panel .title{font-size:1.6rem;margin-bottom:8px}.info-popover-panel .description{margin-bottom:5px;color:var(--be-secondary-text)}.info-popover-panel .link{margin-top:5px;padding-top:5px;border-top:var(--be-divider-default)}.info-popover-panel .link .mat-icon{vertical-align:middle;margin-right:5px;color:var(--be-link)}.info-popover-panel .link a:hover{text-decoration:underline}.info-popover-panel ol,.info-popover-panel ul{padding-left:15px;margin:0}"],encapsulation:2,changeDetection:0}),t})()},86013:function(t,e,n){"use strict";n.d(e,{b:function(){return r}});var i=n(61116),a=n(77307),o=n(84369),s=n(35366);let r=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=s.oAB({type:t}),t.\u0275inj=s.cJS({imports:[[i.ez,a.Ps,o.ot]]}),t})()},72674:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});const i=[{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:5},{originX:"start",originY:"center",overlayX:"end",overlayY:"center",offsetX:5}]},4182:function(t,e,n){"use strict";n.d(e,{S:function(){return u}});var i=n(61116),a=n(84369),o=n(77307),s=n(97070),r=n(68400),l=n(31041),c=n(99808),d=n(35366);let u=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=d.oAB({type:t}),t.\u0275inj=d.cJS({imports:[[i.ez,a.ot,s.Tx,r.N,l.UX,o.Ps,c.p]]}),t})()},26437:function(t,e,n){"use strict";n.d(e,{B:function(){return a}});var i=n(99713);const a=[(0,i.X$)("fadeIn",[(0,i.eR)(":enter",[(0,i.oB)({opacity:0}),(0,i.jt)("325ms ease-in",(0,i.oB)({opacity:1}))])]),(0,i.X$)("fadeOut",[(0,i.eR)(":leave",[(0,i.oB)({opacity:1,position:"absolute",left:"0",right:"0"}),(0,i.jt)("325ms ease-out",(0,i.oB)({opacity:0}))])])]},73709:function(t,e,n){"use strict";function i(t){const e=Object.assign({},t);return Object.keys(e).forEach(t=>{null!=e[t]&&""!==e[t]||delete e[t]}),e}n.d(e,{N:function(){return i}})},37123:function(t,e,n){"use strict";n.d(e,{T:function(){return u}});var i=n(35366),a=n(92935),o=n(77307),s=n(38116),r=n(84369);let l=(()=>{class t{constructor(t){this.dialogRef=t}close(){this.dialogRef.close()}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(a.so))},t.\u0275cmp=i.Xpm({type:t,selectors:[["csv-export-info-dialog"]],decls:13,vars:0,consts:[[1,"modal-header"],["mat-dialog-title","",1,"modal-title"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["mat-dialog-content","",1,"mat-dialog-contents"],[1,"message-container"],["svgIcon","check","color","su",1,"success-icon"],["trans",""],["mat-dialog-actions","",1,"buttons","right","mat-dialog-actions"],["mat-raised-button","","color","accent","cdkFocusInitial","","trans","",1,"button","primary","submit-button",3,"click"]],template:function(t,e){1&t&&(i.TgZ(0,"div",0),i.TgZ(1,"h2",1),i._uU(2,"CSV Export"),i.qZA(),i.TgZ(3,"button",2),i.NdJ("click",function(){return e.close()}),i._UZ(4,"mat-icon",3),i.qZA(),i.qZA(),i.TgZ(5,"div",4),i.TgZ(6,"div",5),i._UZ(7,"mat-icon",6),i.TgZ(8,"div",7),i._uU(9," Your request is being processed. We'll email you when the report is ready to download. In certain cases, it might take a little longer, depending on the number of items beings exported and the volume of activity. "),i.qZA(),i.qZA(),i.qZA(),i.TgZ(10,"div",8),i.TgZ(11,"button",9),i.NdJ("click",function(){return e.close()}),i._uU(12," Got it "),i.qZA(),i.qZA())},directives:[a.uh,o.Hw,a.xY,s.P,a.H8,r.lW],styles:["[_nghost-%COMP%]{display:block;max-width:500px}.modal-header[_ngcontent-%COMP%]{margin-bottom:10px}.message-container[_ngcontent-%COMP%]{display:flex;align-items:flex-start;margin-bottom:10px}.success-icon[_ngcontent-%COMP%]{color:#43a047;margin-right:10px;flex-shrink:0}"],changeDetection:0}),t})();var c=n(68515),d=n(24859);let u=(()=>{class t{constructor(t,e){this.http=t,this.modal=e}export(t,e={}){return this.http.post(t,e).subscribe(t=>{t.downloadPath?function(t,e){const n=document.createElement("a");n.href=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}(t.downloadPath):this.modal.open(l)})}}return t.\u0275fac=function(e){return new(e||t)(i.LFG(c.r),i.LFG(d.u))},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},63380:function(t,e,n){"use strict";n.d(e,{M:function(){return l}});var i=n(77307),a=n(84369),o=n(92935),s=n(68400),r=n(35366);let l=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=r.oAB({type:t}),t.\u0275inj=r.cJS({imports:[[s.N,i.Ps,a.ot,o.Is]]}),t})()},83381:function(t,e,n){"use strict";n.d(e,{r:function(){return s}});var i=n(59075),a=n(44415),o=n(45523);const s=[new i.XQ({type:i.Bq.Select,key:"global",defaultValue:!1,description:"Whether domain is set as global or not",options:[{key:"No",value:!1},{key:"Yes",value:!0}]}),new o.yH({description:"Date the domain was last updated"}),new o.T7({description:"Date the domain was created"}),new i.XQ({type:i.Bq.SelectModel,key:"user_id",label:"User",description:"User domain was created by",component:a.y})]},71453:function(t,e,n){"use strict";n.d(e,{T:function(){return st}});var i=n(36024),a=n(56515),o=n(78512),s=n(92935),r=n(31041),l=n(11520),c=n(35366),d=n(14732),u=n(73234),p=n(88195),g=n(63337),h=n(28505),m=n(38116),f=n(77307),b=n(61116),v=n(84369),_=n(79572),Z=n(42300),x=n(40450);function y(t,e){if(1&t&&(c.TgZ(0,"div",23),c._uU(1),c.qZA()),2&t){const t=c.oxw(3).ngIf;c.xp6(1),c.Oqu(t.host)}}function A(t,e){1&t&&(c.TgZ(0,"div",24),c.TgZ(1,"mat-slide-toggle",25),c._uU(2,"Global"),c.qZA(),c.TgZ(3,"p",20),c._uU(4,"Whether all users should be able to select this domain."),c.qZA(),c.qZA())}function w(t,e){if(1&t&&(c.TgZ(0,"div",16),c.TgZ(1,"div",17),c.TgZ(2,"label",18),c._uU(3,"Host"),c.qZA(),c._UZ(4,"input",19),c.TgZ(5,"p",20),c._uU(6),c.qZA(),c.YNc(7,y,2,1,"div",21),c.qZA(),c.YNc(8,A,5,0,"div",22),c.qZA()),2&t){const t=c.oxw(2).ngIf,e=c.oxw();c.xp6(6),c.hij(" Enter the exact domain name you want your ",e.data.resourceName||"links"," to be accessible with. It can be a subdomain (example.yourdomain.com) or root domain (yourdomain.com). "),c.xp6(1),c.Q6J("ngIf",t.host),c.xp6(1),c.Q6J("ngIf",e.insideAdmin())}}function k(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"p",20),c._uU(2," Add this CNAME record to your domain by visiting your DNS provider or registrar. "),c.qZA(),c.TgZ(3,"div",27),c.TgZ(4,"div",28),c.TgZ(5,"strong"),c._uU(6,"CNAME"),c.qZA(),c._uU(7),c.qZA(),c.qZA(),c.BQk()),2&t){const t=c.oxw(4);c.xp6(7),c.hij(" ",t.baseUrl(),"")}}function T(t,e){if(1&t&&(c.ynx(0),c.TgZ(1,"p",20),c._uU(2," Add this A record to your domain by visiting your DNS provider or registrar. "),c.qZA(),c.TgZ(3,"div",27),c.TgZ(4,"div",28),c.TgZ(5,"strong"),c._uU(6,"A"),c.qZA(),c._uU(7),c.qZA(),c.qZA(),c.BQk()),2&t){const t=c.oxw(4);c.xp6(7),c.hij(" ",t.serverIp,"")}}function C(t,e){if(1&t&&(c.TgZ(0,"div",26),c.YNc(1,k,8,1,"ng-container",6),c.ALo(2,"async"),c.YNc(3,T,8,1,"ng-container",6),c.ALo(4,"async"),c.qZA()),2&t){const t=c.oxw(3);c.xp6(1),c.Q6J("ngIf",c.lcZ(2,2,t.isSubdomain$)),c.xp6(2),c.Q6J("ngIf",!c.lcZ(4,4,t.isSubdomain$))}}function q(t,e){1&t&&(c.TgZ(0,"div",27),c._UZ(1,"loading-indicator",32),c.TgZ(2,"div",33),c._uU(3,"Checking DNS configuration..."),c.qZA(),c.qZA()),2&t&&(c.xp6(1),c.Q6J("isVisible",!0))}const U=function(t){return{host:t}};function I(t,e){if(1&t&&(c.TgZ(0,"div",39),c._uU(1,' DNS records for the domain are setup, however it seems that your server is not configured to handle requests from "host" '),c.qZA()),2&t){const t=c.oxw(5);c.Q6J("transValues",c.VKq(1,U,t.form.value.host))}}const M=function(t){return{location:t}};function O(t,e){if(1&t&&(c.TgZ(0,"div",39),c.ALo(1,"async"),c._uU(2),c.ALo(3,"async"),c.qZA()),2&t){const t=c.oxw(5);c.Q6J("transValues",c.VKq(6,M,c.lcZ(1,2,t.isSubdomain$)?t.baseUrl():t.serverIp)),c.xp6(2),c.hij(" The domain is missing ",c.lcZ(3,4,t.isSubdomain$)?"CNAME":"A"," record pointing to :location or the changes haven't propagated yet. ")}}function J(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"div",34),c._UZ(1,"mat-icon",35),c.YNc(2,I,2,3,"div",36),c.ALo(3,"async"),c.YNc(4,O,4,8,"ng-template",null,37,c.W1O),c.qZA(),c.TgZ(6,"p"),c._uU(7),c.ALo(8,"trans"),c.TgZ(9,"button",38),c.NdJ("click",function(){return c.CHM(t),c.oxw(4).validateDnsForDomain()}),c.ALo(10,"async"),c._uU(11," refresh "),c.qZA(),c.qZA()}if(2&t){const t=c.MAs(5),e=c.oxw(4);c.xp6(2),c.Q6J("ngIf","serverNotConfigured"===c.lcZ(3,4,e.validationFailReason$)&&e.currentUserIsAdmin)("ngIfElse",t),c.xp6(5),c.hij(" ",c.lcZ(8,6,"You can wait and try again later or")," "),c.xp6(2),c.Q6J("disabled",c.lcZ(10,8,e.loading$))}}function P(t,e){if(1&t&&(c.TgZ(0,"div",29),c.YNc(1,q,4,1,"div",30),c.ALo(2,"async"),c.YNc(3,J,12,10,"ng-template",null,31,c.W1O),c.qZA()),2&t){const t=c.MAs(4),e=c.oxw(3);c.xp6(1),c.Q6J("ngIf",c.lcZ(2,2,e.loading$))("ngIfElse",t)}}function N(t,e){1&t&&(c.TgZ(0,"div",40),c.TgZ(1,"div",27),c._UZ(2,"loading-indicator",32),c.TgZ(3,"div",33),c._uU(4,"Connecting domain..."),c.qZA(),c.qZA(),c.TgZ(5,"p",20),c._uU(6,"Don't close this window until domain is connected."),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Q6J("isVisible",!0))}function S(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"button",41),c.NdJ("click",function(){return c.CHM(t),c.oxw(3).previousStep()}),c._UZ(1,"mat-icon",42),c._uU(2," Previous "),c.qZA()}}function D(t,e){if(1&t){const t=c.EpF();c.ynx(0),c.TgZ(1,"mat-dialog-content"),c.YNc(2,w,9,3,"div",7),c.YNc(3,C,5,6,"div",8),c.YNc(4,P,5,4,"div",9),c.YNc(5,N,7,1,"div",10),c.qZA(),c.TgZ(6,"mat-dialog-actions"),c.TgZ(7,"button",11),c.NdJ("click",function(){return c.CHM(t),c.oxw(2).close()}),c._uU(8," Cancel "),c.qZA(),c.TgZ(9,"div",12),c.YNc(10,S,3,0,"button",13),c.TgZ(11,"button",14),c.ALo(12,"async"),c.ALo(13,"async"),c._uU(14," Next "),c._UZ(15,"mat-icon",15),c.qZA(),c.qZA(),c.qZA(),c.BQk()}if(2&t){const t=e.ngIf,n=c.oxw(2);c.xp6(2),c.Q6J("ngIf",t===n.Steps.Host),c.xp6(1),c.Q6J("ngIf",t===n.Steps.Info),c.xp6(1),c.Q6J("ngIf",t===n.Steps.Validate),c.xp6(1),c.Q6J("ngIf",t===n.Steps.Finalize),c.xp6(5),c.Q6J("ngIf",t>1),c.xp6(1),c.Q6J("disabled",c.lcZ(12,6,n.loading$)||c.lcZ(13,8,n.disabled$))}}function Q(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"form",5),c.NdJ("ngSubmit",function(){return c.CHM(t),c.oxw().nextStep()}),c.YNc(1,D,16,10,"ng-container",6),c.ALo(2,"async"),c.qZA()}if(2&t){const t=c.oxw();c.Q6J("formGroup",t.form),c.xp6(1),c.Q6J("ngIf",c.lcZ(2,2,t.currentStep$))}}var Y=function(t){return t[t.Host=1]="Host",t[t.Info=2]="Info",t[t.Validate=3]="Validate",t[t.Finalize=4]="Finalize",t}({});let L=(()=>{class t{constructor(t,e,n,i,a,s,l){this.dialogRef=t,this.data=e,this.customDomains=n,this.toast=i,this.settings=a,this.router=s,this.currentUser=l,this.Steps=Y,this.currentStep$=new o.X(1),this.loading$=new o.X(!1),this.disabled$=new o.X(!1),this.updating$=new o.X(!1),this.errors$=new o.X({}),this.validationFailReason$=new o.X(null),this.isSubdomain$=new o.X(!1),this.form=new r.cw({host:new r.NI,global:new r.NI(!1)}),this.updating$.next(!!e.domain),this.currentUserIsAdmin=this.currentUser.isAdmin(),e.domain&&this.form.patchValue(e.domain)}ngOnInit(){this.form.get("host").valueChanges.subscribe(t=>{this.isSubdomain$.next((t.replace("www.","").match(/\./g)||[]).length>1)})}connectDomain(){this.loading$.next(!0),(this.updating$.value?this.customDomains.update(this.data.domain.id,this.form.value):this.customDomains.create(this.form.value)).pipe((0,l.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open("Domain connected"),this.close(t.domain)},t=>{this.errors$.next(t.errors)})}validateDnsForDomain(){this.disabled$.next(!0),this.loading$.next(!0),this.customDomains.validate(this.form.value.host).pipe((0,l.x)(()=>this.loading$.next(!1))).subscribe(t=>{t&&"connected"===t.result&&this.nextStep()},t=>{this.validationFailReason$.next(t.failReason)})}authorizeCrupdate(){this.loading$.next(!0);const t=Object.assign({},this.form.value);this.data.domain&&(t.domainId=this.data.domain.id),this.customDomains.authorizeCrupdate(t).pipe((0,l.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.serverIp=t.serverIp,this.nextStep(!0)},t=>this.errors$.next(t.errors))}close(t){this.dialogRef.close(t)}previousStep(){this.currentStep$.value>Y.Host&&this.currentStep$.next(this.currentStep$.value-1)}nextStep(t=!1){if(this.currentStep$.value===Y.Host&&!t)return this.authorizeCrupdate();this.currentStep$.next(this.currentStep$.value+1),this.currentStep$.value===Y.Validate?this.data.domain&&this.form.value.host===this.data.domain.host?this.connectDomain():this.validateDnsForDomain():this.currentStep$.value===Y.Finalize&&this.connectDomain()}baseUrl(){return this.settings.getBaseUrl().replace(/\/$/,"")}insideAdmin(){return this.router.url.indexOf("admin")>-1}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(s.so),c.Y36(s.WI),c.Y36(d.c),c.Y36(u.F),c.Y36(p.Z),c.Y36(g.F0),c.Y36(h.I))},t.\u0275cmp=c.Xpm({type:t,selectors:[["crupdate-custom-domain-modal"]],decls:7,vars:3,consts:[[1,"modal-header"],["mat-dialog-title","","trans",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],["ngNativeValidate","",3,"formGroup","ngSubmit"],[4,"ngIf"],["class","host-step",4,"ngIf"],["class","info-step",4,"ngIf"],["class","validate-step",4,"ngIf"],["class","finalize-step",4,"ngIf"],["type","button","mat-button","","trans","",1,"cancel-button",3,"click"],[1,"submit-btns"],["mat-button","","color","accent","class","step-btn","type","button","trans","",3,"click",4,"ngIf"],["type","submit","mat-raised-button","","color","accent","trans","",1,"step-btn",3,"disabled"],["svgIcon","keyboard-arrow-right",1,"step-icon"],[1,"host-step"],[1,"input-container"],["for","host","trans",""],["type","text","id","host","formControlName","host","placeholder","https://example.com","maxlength","100","required","",1,"host-input"],["trans",""],["class","error",4,"ngIf"],["class","setting-toggle-container global-toggle",4,"ngIf"],[1,"error"],[1,"setting-toggle-container","global-toggle"],["id","global","formControlName","global","trans",""],[1,"info-step"],[1,"message-widget"],[1,"message"],[1,"validate-step"],["class","message-widget",4,"ngIf","ngIfElse"],["notLoading",""],[1,"small","icon",3,"isVisible"],["trans","",1,"message"],[1,"message-widget","warning-color"],["svgIcon","warning",1,"icon"],["class","message","trans","",3,"transValues",4,"ngIf","ngIfElse"],["dnsNotSetup",""],["type","button","trans","",1,"no-style","refresh-btn",3,"disabled","click"],["trans","",1,"message",3,"transValues"],[1,"finalize-step"],["mat-button","","color","accent","type","button","trans","",1,"step-btn",3,"click"],["svgIcon","keyboard-arrow-left",1,"step-icon"]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h2",1),c._uU(2,"Connect Domain"),c.qZA(),c.TgZ(3,"button",2),c.NdJ("click",function(){return e.close()}),c._UZ(4,"mat-icon",3),c.qZA(),c.qZA(),c.YNc(5,Q,3,4,"form",4),c.ALo(6,"async")),2&t&&(c.xp6(5),c.Q6J("ngIf",c.lcZ(6,1,e.errors$)))},directives:[s.uh,m.P,f.Hw,b.O5,r.JL,r.sg,s.xY,s.H8,v.lW,r.Fj,r.JJ,r.u,r.nD,r.Q7,_.Rr,Z.Q],pipes:[b.Ov,x.R],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.host-input[_ngcontent-%COMP%]{font-size:1.6rem}.mat-dialog-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-top:25px;margin-top:25px;border-top:1px solid var(--be-divider-lighter)}.modal-header[_ngcontent-%COMP%]{border-bottom:1px solid var(--be-divider-lighter);margin-bottom:20px;padding-bottom:25px}.message-widget[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px;border-radius:4px;background-color:#ecf3ff;color:var(--be-accent-default);font-size:1.6rem}.message-widget[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.message-widget.warning-color[_ngcontent-%COMP%]{background-color:#fef0e2;color:#f77d05}.message-widget[_ngcontent-%COMP%]   .icon[_ngcontent-%COMP%]{flex-shrink:0;position:static;margin-right:15px}p[_ngcontent-%COMP%]{font-size:1.3rem;color:var(--be-secondary-text);margin:8px 0}.mat-button[_ngcontent-%COMP%], .mat-raised-button[_ngcontent-%COMP%]{min-width:105px;line-height:40px}.refresh-btn[_ngcontent-%COMP%]{color:var(--be-accent-default);text-decoration:underline}.step-icon[_ngcontent-%COMP%]{vertical-align:middle;margin-right:5px}.global-toggle[_ngcontent-%COMP%]{border-top:1px solid var(--be-divider-lighter);margin-top:20px;padding-top:20px;margin-bottom:0}@media only screen and (max-width:768px){.cancel-button[_ngcontent-%COMP%]{display:none}}"],changeDetection:0}),t})();var F=n(83381),E=n(34955),R=n(13536),$=n(80922),V=n(86668),B=n(27701),H=n(54275),z=n(24311),G=n(71765),j=n(47210),X=n(40985),W=n(2406);function K(t,e){1&t&&c._UZ(0,"mat-progress-bar",17)}function tt(t,e){1&t&&(c.TgZ(0,"th",18),c._uU(1,"Owner"),c.qZA())}const et=function(t){return{count:t,resource:"domain(s)"}};function nt(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"tr"),c.TgZ(1,"th",19),c.TgZ(2,"div",20),c._uU(3," :count :resource selected: "),c.qZA(),c.TgZ(4,"div",21),c.TgZ(5,"button",22),c.NdJ("click",function(){return c.CHM(t),c.oxw().maybeDeleteSelectedDomains()}),c._uU(6," Delete "),c.qZA(),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=e.ngIf,n=c.oxw();c.xp6(2),c.Q6J("transValues",c.VKq(2,et,t)),c.xp6(3),c.Q6J("disabled",!n.currentUser.hasPermission("custom_domains.delete"))}}function it(t,e){if(1&t&&(c.TgZ(0,"td",34),c._UZ(1,"user-column",35),c.qZA()),2&t){const t=c.oxw().$implicit;c.xp6(1),c.Q6J("user",t.user)}}function at(t,e){if(1&t){const t=c.EpF();c.TgZ(0,"tr"),c._UZ(1,"td",23),c.TgZ(2,"td",24),c._UZ(3,"img",25),c.ALo(4,"favicon"),c.TgZ(5,"span"),c._uU(6),c.qZA(),c.qZA(),c.YNc(7,it,2,1,"td",26),c.TgZ(8,"td",27),c._uU(9),c.qZA(),c.TgZ(10,"td",28),c._uU(11),c.ALo(12,"formattedDate"),c.qZA(),c.TgZ(13,"td",29),c.TgZ(14,"button",30),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().showCrupdateDomainModal(e)}),c.ALo(15,"trans"),c._UZ(16,"mat-icon",31),c.qZA(),c.TgZ(17,"button",32),c.NdJ("click",function(){const e=c.CHM(t).$implicit;return c.oxw().maybeDeleteSelectedDomains([e.id])}),c._UZ(18,"mat-icon",33),c.qZA(),c.qZA(),c.qZA()}if(2&t){const t=e.$implicit,n=c.oxw();c.xp6(1),c.Q6J("table-body-checkbox",t.id),c.xp6(2),c.Q6J("src",c.lcZ(4,7,t.host),c.LSH),c.xp6(3),c.Oqu(t.host),c.xp6(1),c.Q6J("ngIf",n.showUserColumn()),c.xp6(2),c.Oqu(t.global?"Yes":"No"),c.xp6(2),c.Oqu(c.lcZ(12,9,t.updated_at)),c.xp6(3),c.Q6J("matTooltip",c.lcZ(15,11,"Edit domain"))}}function ot(t,e){1&t&&(c.TgZ(0,"no-results-message",36),c.TgZ(1,"span",37),c._uU(2,"No custom domains have been added yet"),c.qZA(),c.qZA())}let st=(()=>{class t{constructor(t,e,n,i,a){this.datatable=t,this.currentUser=e,this.customDomains=n,this.toast=i,this.router=a,this.filters=F.r,this.domains$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:d.c.BASE_URI})}maybeDeleteSelectedDomains(t){this.datatable.confirmResourceDeletion("domains").subscribe(()=>{this.customDomains.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Domains deleted.")},t=>{this.toast.open(t.message||i.v.Default)})})}showCrupdateDomainModal(t){this.datatable.openCrupdateResourceModal(L,{domain:t}).subscribe()}showUserColumn(){return this.router.url.indexOf("admin")>-1}}return t.\u0275fac=function(e){return new(e||t)(c.Y36(a.x),c.Y36(h.I),c.Y36(d.c),c.Y36(u.F),c.Y36(g.F0))},t.\u0275cmp=c.Xpm({type:t,selectors:[["custom-domain-index"]],features:[c._Bn([a.x])],decls:32,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","domains",3,"filters"],[1,"action-buttons"],["mat-raised-button","","color","accent",1,"button-with-icon",3,"disabled","click"],["svgIcon","add"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","user_id","trans","",4,"ngIf"],["table-sort-header","updated_at","trans",""],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","custom-domain.svg",4,"ngIf"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","user_id","trans",""],["colspan","6"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["type","button","mat-raised-button","","color","warn","trans","",3,"disabled","click"],[3,"table-body-checkbox"],["data-label","Host"],["alt","",1,"favicon-img",3,"src"],["data-label","Owner",4,"ngIf"],["data-label","Global"],["data-label","Updated At"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["type","button","mat-icon-button","","trans","",1,"visible-on-mobile",3,"click"],["svgIcon","delete"],["data-label","Owner"],[3,"user"],["svgImage","custom-domain.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(c.TgZ(0,"div",0),c.TgZ(1,"h1",1),c._uU(2,"Custom Domains"),c.qZA(),c.TgZ(3,"div",2),c._UZ(4,"datatable-filters",3),c.TgZ(5,"div",4),c.TgZ(6,"button",5),c.NdJ("click",function(){return e.showCrupdateDomainModal()}),c._UZ(7,"mat-icon",6),c.TgZ(8,"span",1),c._uU(9,"Connect New Domain"),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.qZA(),c.TgZ(10,"div",7),c.YNc(11,K,1,0,"mat-progress-bar",8),c.ALo(12,"async"),c.TgZ(13,"table",9),c.TgZ(14,"thead"),c.TgZ(15,"tr"),c._UZ(16,"th",10),c.TgZ(17,"th",11),c._uU(18,"Host"),c.qZA(),c.YNc(19,tt,2,0,"th",12),c.TgZ(20,"th",11),c._uU(21,"Global"),c.qZA(),c.TgZ(22,"th",13),c._uU(23,"Last Updated"),c.qZA(),c._UZ(24,"th"),c.qZA(),c.YNc(25,nt,7,4,"tr",14),c.qZA(),c.TgZ(26,"tbody"),c.YNc(27,at,19,13,"tr",15),c.ALo(28,"async"),c.qZA(),c.qZA(),c.YNc(29,ot,3,0,"no-results-message",16),c.ALo(30,"async"),c._UZ(31,"datatable-footer"),c.qZA()),2&t&&(c.xp6(4),c.Q6J("filters",e.filters),c.xp6(2),c.Q6J("disabled",!e.currentUser.hasPermission("custom_domains.create")),c.xp6(5),c.Q6J("ngIf",c.lcZ(12,7,e.datatable.paginator&&e.datatable.paginator.loading$)),c.xp6(8),c.Q6J("ngIf",e.showUserColumn()),c.xp6(6),c.Q6J("ngIf",e.datatable.selectedRows$.value.length),c.xp6(2),c.Q6J("ngForOf",c.lcZ(28,9,e.domains$)),c.xp6(2),c.Q6J("ngIf",c.lcZ(30,11,e.datatable.paginator.noResults$)))},directives:[m.P,E.h,v.lW,f.Hw,b.O5,R.e,$.p,b.sg,V.V,B.pW,H.O,z.gM,G.r,j.U],pipes:[b.Ov,X.K,W.l,x.R],styles:[".favicon-img[_ngcontent-%COMP%]{display:inline-block;margin-right:5px;vertical-align:middle;flex-shrink:0}"],changeDetection:0}),t})()},14732:function(t,e,n){"use strict";n.d(e,{c:function(){return o}});var i=n(35366),a=n(68515);let o=(()=>{class t{constructor(t){this.http=t}index(e={}){return this.http.get(`${t.BASE_URI}`,e)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}validate(e){return this.http.post(`${t.BASE_URI}/validate/2BrM45vvfS/api`,{host:e})}authorizeCrupdate(e){return this.http.post(`${t.BASE_URI}/authorize/store`,e)}}return t.BASE_URI="custom-domain",t.\u0275fac=function(e){return new(e||t)(i.LFG(a.r))},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},71765:function(t,e,n){"use strict";n.d(e,{r:function(){return d}});var i=n(35366),a=n(60994),o=n(61116),s=n(63337);function r(t,e){if(1&t&&(i.TgZ(0,"a",4),i.TgZ(1,"div"),i._uU(2),i.qZA(),i.TgZ(3,"div",5),i._uU(4),i.qZA(),i.qZA()),2&t){const t=i.oxw(2);i.Q6J("routerLink",t.url.generate(t.user)),i.xp6(2),i.Oqu(t.user.display_name),i.xp6(2),i.Oqu(t.user.email)}}function l(t,e){if(1&t&&(i.TgZ(0,"div",6),i.TgZ(1,"div"),i._uU(2),i.qZA(),i.TgZ(3,"div",5),i._uU(4),i.qZA(),i.qZA()),2&t){const t=i.oxw(2);i.xp6(2),i.Oqu(t.user.display_name),i.xp6(2),i.Oqu(t.user.email)}}function c(t,e){if(1&t&&(i.ynx(0),i._UZ(1,"img",1),i.YNc(2,r,5,3,"a",2),i.YNc(3,l,5,2,"div",3),i.BQk()),2&t){const t=i.oxw();i.xp6(1),i.Q6J("src",t.user.avatar,i.LSH),i.xp6(1),i.Q6J("ngIf",t.haveUrl),i.xp6(1),i.Q6J("ngIf",!t.haveUrl)}}let d=(()=>{class t{constructor(t){this.url=t,this.showEmail=!1,this.haveUrl=!!t.user}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(a.o))},t.\u0275cmp=i.Xpm({type:t,selectors:[["user-column"]],hostAttrs:[1,"column-with-image"],inputs:{user:"user",showEmail:"showEmail"},decls:1,vars:1,consts:[[4,"ngIf"],["alt","",3,"src"],["target","_blank","class","link content",3,"routerLink",4,"ngIf"],["class","content",4,"ngIf"],["target","_blank",1,"link","content",3,"routerLink"],[1,"email","secondary"],[1,"content"]],template:function(t,e){1&t&&i.YNc(0,c,4,3,"ng-container",0),2&t&&i.Q6J("ngIf",e.user)},directives:[o.O5,s.yS],styles:[""],changeDetection:0}),t})()},34955:function(t,e,n){"use strict";n.d(e,{h:function(){return at}});var i=n(35366),a=n(56515),o=n(56238),s=n(79996),r=n(98720),l=n(43835),c=n(78512),d=n(3080),u=n(31906),p=n(87254),g=n(38116),h=n(61116),m=n(77307);const f=["filterSuggestion"];function b(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"div",8,9),i.NdJ("click",function(){const e=i.CHM(t).$implicit;return i.oxw().filterSelected.emit(e.value)}),i.TgZ(2,"div",10),i._uU(3),i.qZA(),i.TgZ(4,"div",2),i._uU(5),i.qZA(),i.qZA()}if(2&t){const t=e.$implicit,n=e.index;i.uIk("data-filter-key",t.key)("data-index",n),i.xp6(3),i.Oqu(t.value.label),i.xp6(2),i.Oqu(t.value.description)}}let v=(()=>{class t{constructor(){this.filterSelected=new i.vpe,this.originalOrder=()=>0}anyFocused(){return document.activeElement.classList.contains("filter-suggestion-item")}focusItemAt(t){this.items.get(t).nativeElement.focus()}getFocusedFilter(){if(this.anyFocused()){const t=document.activeElement.dataset.filterKey;return this.filters[t]}}getFocusedIndex(){if(this.anyFocused()){const t=document.activeElement;return parseInt(t.dataset.index)}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=i.Xpm({type:t,selectors:[["filter-suggestions"]],viewQuery:function(t,e){if(1&t&&i.Gf(f,5),2&t){let t;i.iGM(t=i.CRH())&&(e.items=t)}},inputs:{filters:"filters"},outputs:{filterSelected:"filterSelected"},decls:13,vars:4,consts:[[1,"table"],[1,"filter-suggestion-header","row"],["trans","",1,"column"],["role","list",1,"body"],["role","listitem","class","row filter-suggestion-item","tabindex","0",3,"click",4,"ngFor","ngForOf"],[1,"help-container"],["svgIcon","info"],["trans",""],["role","listitem","tabindex","0",1,"row","filter-suggestion-item",3,"click"],["filterSuggestion",""],["trans","",1,"column","label-column"]],template:function(t,e){1&t&&(i.TgZ(0,"div",0),i.TgZ(1,"div",1),i.TgZ(2,"div",2),i._uU(3,"Field"),i.qZA(),i.TgZ(4,"div",2),i._uU(5,"Description"),i.qZA(),i.qZA(),i.TgZ(6,"div",3),i.YNc(7,b,6,4,"div",4),i.ALo(8,"keyvalue"),i.qZA(),i.qZA(),i.TgZ(9,"div",5),i._UZ(10,"mat-icon",6),i.TgZ(11,"div",7),i._uU(12," Use arrows, tab or mouse to navigate added filters. Backspace or delete key to remove them. "),i.qZA(),i.qZA()),2&t&&(i.xp6(7),i.Q6J("ngForOf",i.xi3(8,1,e.filters,e.originalOrder)))},directives:[g.P,h.sg,m.Hw],pipes:[h.Nd],styles:["[_nghost-%COMP%]{display:none;position:absolute;left:0;z-index:10;background-color:var(--be-background);width:100%;border-radius:4px;overflow:hidden;color:var(--be-text);box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 5px 8px 0 rgba(0,0,0,.14),0 1px 14px 0 rgba(0,0,0,.12)}.visible[_nghost-%COMP%]{display:block}.filter-suggestion-header[_ngcontent-%COMP%]{background-color:var(--be-background-alternative)}.row[_ngcontent-%COMP%]{display:flex;height:55px;padding:15px;border-bottom:1px solid var(--be-divider-lighter)}.row[_ngcontent-%COMP%]:not(.header){cursor:pointer}.row[_ngcontent-%COMP%]:not(.header):focus, .row[_ngcontent-%COMP%]:not(.header):hover{background-color:var(--be-hover)}.row[_ngcontent-%COMP%]:not(.header):focus{outline:none}.column[_ngcontent-%COMP%]{flex:0 0 48%}.label-column[_ngcontent-%COMP%]{text-transform:capitalize}.help-container[_ngcontent-%COMP%]{display:flex;align-items:center;padding:12px;background-color:var(--be-accent-emphasis)}.help-container[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{margin-right:10px;color:var(--be-accent-default)}"],changeDetection:0}),t})();var _=n(24831),Z=n(1486),x=n(31041),y=n(24859);function A(t,e){if(1&t&&(i.ynx(0),i._UZ(1,"img",2),i.TgZ(2,"div",3),i._uU(3),i.qZA(),i.BQk()),2&t){const t=e.ngIf;i.xp6(1),i.Q6J("src",t.image,i.LSH),i.xp6(2),i.Oqu(t.name)}}function w(t,e){1&t&&(i.TgZ(0,"div",4),i._uU(1,"Click to select"),i.qZA())}let k=(()=>{class t{constructor(t){this.dialog=t,this.value$=new c.X(null)}registerOnChange(t){this.propagateChange=t}registerOnTouched(t){}writeValue(t){this.value$.next(t)}onClick(){this.openSelectModelDialog()}openSelectModelDialog(){this.dialog.open(this.filter.component,this.filter.componentData).afterClosed().subscribe(t=>{t&&(this.value$.next(t),this.propagateChange(t))})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(y.u))},t.\u0275cmp=i.Xpm({type:t,selectors:[["select-model-control"]],hostBindings:function(t,e){1&t&&i.NdJ("click",function(){return e.onClick()})},inputs:{filter:"filter"},features:[i._Bn([{provide:x.JU,useExisting:t,multi:!0}])],decls:4,vars:4,consts:[[4,"ngIf","ngIfElse"],["defaultHint",""],[1,"image",3,"src"],[1,"name"],["trans",""]],template:function(t,e){if(1&t&&(i.YNc(0,A,4,2,"ng-container",0),i.ALo(1,"async"),i.YNc(2,w,2,0,"ng-template",null,1,i.W1O)),2&t){const t=i.MAs(3);i.Q6J("ngIf",i.lcZ(1,2,e.value$))("ngIfElse",t)}},directives:[h.O5,g.P],pipes:[h.Ov],styles:["[_nghost-%COMP%]{display:flex;align-items:center;padding:0 8px;cursor:pointer}img[_ngcontent-%COMP%]{height:22px;width:22px;border-radius:4px;margin-right:8px;flex-shrink:0;-o-object-fit:cover;object-fit:cover}"],changeDetection:0}),t})();const T={"=":"is","!=":"is not",">":"is greater than",">=":"is greater than or equal to","<":"is less than","<=":"is less than or equal to",has:"Include",doesntHave:"Do not include"};var C=n(71294);let q=(()=>{class t{constructor(t){this.breakpoints=t}transform(t,e){return e||this.breakpoints.isMobile$.value?t:T[t]}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(C.S,16))},t.\u0275pipe=i.Yjl({name:"operatorDisplayName",type:t,pure:!0}),t})();const U=["select"];function I(t,e){if(1&t&&(i.TgZ(0,"option",4),i._uU(1),i.ALo(2,"operatorDisplayName"),i.qZA()),2&t){const t=e.$implicit,n=i.oxw();i.Q6J("value",t),i.xp6(1),i.hij(" ",i.xi3(2,2,t,n.compact)," ")}}let M=(()=>{class t{ngAfterViewInit(){this.resizeSelect()}resizeSelect(){var t;const e=null===(t=this.select)||void 0===t?void 0:t.nativeElement;e&&e.selectedIndex>-1&&(e.style.width=`${e.options[e.selectedIndex].label.length+5}ch`)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=i.Xpm({type:t,selectors:[["operator-select"]],viewQuery:function(t,e){if(1&t&&i.Gf(U,5),2&t){let t;i.iGM(t=i.CRH())&&(e.select=t.first)}},inputs:{compact:"compact",formGroup:"formGroup",operators:"operators"},decls:4,vars:2,consts:[[3,"formGroup"],["formControlName","operator",1,"operator-select",3,"ngModelChange"],["select",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(t,e){1&t&&(i.ynx(0,0),i.TgZ(1,"select",1,2),i.NdJ("ngModelChange",function(){return e.resizeSelect()}),i.YNc(3,I,3,5,"option",3),i.qZA(),i.BQk()),2&t&&(i.Q6J("formGroup",e.formGroup),i.xp6(3),i.Q6J("ngForOf",e.operators))},directives:[x.JL,x.sg,x.EJ,x.JJ,x.u,h.sg,x.YN,x.Kr],pipes:[q],styles:['[_nghost-%COMP%]{display:flex;align-items:center;position:relative;height:100%}[_nghost-%COMP%]:before{content:"";position:absolute;top:0;bottom:0;width:50%;left:0;background-color:var(--be-chip)}[_nghost-%COMP%]:after{content:"";position:absolute;top:0;bottom:0;width:50%;right:0;background-color:var(--be-accent-default)}.operator-select[_ngcontent-%COMP%]{transition:width .1s ease-in-out 0s;padding:2px 8px;min-width:60px;max-width:200px;height:27px;color:var(--be-accent-default);z-index:10;background-color:var(--be-accent-contrast);text-overflow:ellipsis;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:10px;-moz-text-align-last:center;text-align-last:center;border:1px solid transparent}.operator-select[_ngcontent-%COMP%]:focus-visible{outline:0;border-color:var(--be-accent-default);box-shadow:0 0 0 1px #fff}'],changeDetection:0}),t})();const O=["valueInput"];function J(t,e){if(1&t&&i._UZ(0,"operator-select",8),2&t){const t=i.oxw().ngIf,e=i.oxw();i.Q6J("compact",e.compact)("formGroup",t)("operators",e.filter.operators)}}function P(t,e){if(1&t&&(i.TgZ(0,"option",16),i._uU(1),i.qZA()),2&t){const t=e.$implicit;i.Q6J("ngValue",t.value),i.xp6(1),i.hij(" ",t.key||t.value," ")}}function N(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"div",9),i.TgZ(1,"select",10,11),i.NdJ("ngModelChange",function(){return i.CHM(t),i.oxw(2).resizeInput()}),i.YNc(3,P,2,2,"option",12),i.qZA(),i.O4$(),i.TgZ(4,"svg",13),i._UZ(5,"path",14),i._UZ(6,"path",15),i.qZA(),i.qZA()}if(2&t){const t=i.oxw(2);i.xp6(1),i.Q6J("id",t.key)("compareWith",t.compareFilterValueFn),i.xp6(2),i.Q6J("ngForOf",t.filter.options)}}function S(t,e){if(1&t&&(i.TgZ(0,"div",17),i._UZ(1,"input",18,11),i.qZA()),2&t){const t=i.oxw(2);i.xp6(1),i.Q6J("id",t.key)}}function D(t,e){if(1&t&&i._UZ(0,"select-model-control",19,11),2&t){const t=i.oxw(2);i.Q6J("filter",t.filter)("id",t.key)}}function Q(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"div",9),i.TgZ(1,"input",20,11),i.NdJ("ngModelChange",function(){return i.CHM(t),i.oxw(2).resizeInput()}),i.qZA(),i.qZA()}if(2&t){const t=i.oxw(2);i.xp6(1),i.Q6J("id",t.key)("type",t.filter.inputType||"text")}}function Y(t,e){if(1&t){const t=i.EpF();i.ynx(0,1),i.TgZ(1,"div",2),i.NdJ("click",function(){return i.CHM(t),i.oxw().el.nativeElement.focus()}),i._uU(2),i.qZA(),i.YNc(3,J,1,3,"operator-select",3),i.ynx(4,4),i.YNc(5,N,7,3,"div",5),i.YNc(6,S,3,1,"div",6),i.YNc(7,D,2,2,"select-model-control",7),i.YNc(8,Q,3,2,"div",5),i.BQk(),i.BQk()}if(2&t){const t=e.ngIf,n=i.oxw();i.Q6J("formGroup",t),i.xp6(2),i.Oqu(n.filter.label),i.xp6(1),i.Q6J("ngIf",n.filter.operators),i.xp6(1),i.Q6J("ngSwitch",n.filter.type),i.xp6(1),i.Q6J("ngSwitchCase","select"),i.xp6(1),i.Q6J("ngSwitchCase","datePicker"),i.xp6(1),i.Q6J("ngSwitchCase","selectModel"),i.xp6(1),i.Q6J("ngSwitchCase","input")}}let L=(()=>{class t{constructor(t){this.el=t,this.compareFilterValueFn=(t,e)=>Z(t,e)}ngAfterViewInit(){this.resizeInput()}focus(){this.el.nativeElement.focus()}focusValueInput(){var t;this.valueInput instanceof k?this.valueInput.openSelectModelDialog():(null===(t=this.valueInput)||void 0===t?void 0:t.nativeElement)&&this.valueInput.nativeElement.focus()}resizeInput(){var t;const e=null===(t=this.valueInput)||void 0===t?void 0:t.nativeElement;if("SELECT"===(null==e?void 0:e.nodeName)){const t=e;t.selectedIndex>-1&&(t.style.width=`${t.options[t.selectedIndex].label.length+5}ch`)}else"INPUT"===(null==e?void 0:e.nodeName)&&"date"!==e.type&&(e.style.width=`${e.value.length+7}ch`)}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq))},t.\u0275cmp=i.Xpm({type:t,selectors:[["active-filter"]],viewQuery:function(t,e){if(1&t&&i.Gf(O,5),2&t){let t;i.iGM(t=i.CRH())&&(e.valueInput=t.first)}},hostAttrs:["tabIndex","0","role","button"],hostVars:1,hostBindings:function(t,e){2&t&&i.uIk("data-control-key",e.key)},inputs:{key:"key",compact:"compact",form:"form",filter:"filter"},decls:1,vars:1,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],["trans","",1,"filter-label",3,"click"],[3,"compact","formGroup","operators",4,"ngIf"],[3,"ngSwitch"],["class","filter-input-container",4,"ngSwitchCase"],["class","date-picker-container",4,"ngSwitchCase"],["formControlName","value","class","filter-value select-model-input",3,"filter","id",4,"ngSwitchCase"],[3,"compact","formGroup","operators"],[1,"filter-input-container"],["formControlName","value",1,"filter-input","filter-value",3,"id","compareWith","ngModelChange"],["valueInput",""],["trans","",3,"ngValue",4,"ngFor","ngForOf"],["viewBox","0 0 24 24",1,"caret-svg"],["d","M7 10l5 5 5-5z"],["d","M0 0h24v24H0z","fill","none"],["trans","",3,"ngValue"],[1,"date-picker-container"],["type","date","formControlName","value",1,"date-input","filter-value",3,"id"],["formControlName","value",1,"filter-value","select-model-input",3,"filter","id"],["formControlName","value","min","1","required","",1,"filter-input","filter-value",3,"id","type","ngModelChange"]],template:function(t,e){1&t&&i.YNc(0,Y,9,8,"ng-container",0),2&t&&i.Q6J("ngIf",e.form.controls[e.key])},directives:[h.O5,x.JL,x.sg,g.P,h.RF,h.n9,M,x.EJ,x.JJ,x.u,h.sg,x.YN,x.Kr,x.Fj,k,x.Q7],styles:["[_nghost-%COMP%]{display:inline-flex;align-items:flex-start;border-radius:4px;height:37px;background-color:var(--be-chip);margin:3px 5px 3px 0}[_nghost-%COMP%]:focus{outline:none;box-shadow:var(--be-accent-default) 0 0 0 1px}.filter-label[_ngcontent-%COMP%]{color:var(--be-text);line-height:37px;cursor:pointer;padding:0 12px;text-transform:capitalize;white-space:nowrap;font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.filter-input-container[_ngcontent-%COMP%]{position:relative;height:100%;overflow:hidden;border-radius:0 4px 4px 0}.caret-svg[_ngcontent-%COMP%]{position:absolute;top:9.5px;right:5px;z-index:11;fill:var(--be-accent-contrast);width:18px;height:18px;pointer-events:none}.filter-input[_ngcontent-%COMP%]{border:0;transition:width .1s ease-in-out 0s;padding:0 12px;min-width:60px;max-width:200px;z-index:10;text-overflow:ellipsis;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:100%;font-weight:500}select.filter-select[_ngcontent-%COMP%]{padding:0 25px 0 12px}.date-input[_ngcontent-%COMP%]{position:relative;max-width:30ch;line-height:37px;height:37px;font-size:inherit;border:none;margin:0;padding:0 12px;width:20ch;font-weight:500}.select-model-input[_ngcontent-%COMP%]{min-width:76px;height:100%}.filter-value[_ngcontent-%COMP%]{background-color:var(--be-accent-default);color:var(--be-accent-contrast);border-radius:0 4px 4px 0}"],changeDetection:0}),t})();function F(t,e){if(1&t&&i._UZ(0,"active-filter",2),2&t){const t=e.ngIf,n=i.oxw(),a=n.$implicit,o=n.index,s=i.oxw();i.Q6J("compact",s.compact)("key",a.key)("form",s.form)("filter",t),i.uIk("data-index",o)}}function E(t,e){if(1&t&&(i.ynx(0),i.YNc(1,F,1,5,"active-filter",1),i.BQk()),2&t){const t=e.$implicit,n=i.oxw();i.xp6(1),i.Q6J("ngIf",n.config[t.value.value.key])}}const R=["*"];let $=(()=>{class t{constructor(t,e,n){this.fb=t,this.cd=e,this.el=n}add(t,e={}){const n=void 0!==e.value?e.value:t.defaultValue,i=this.fb.group({key:t.key,value:n,operator:e.operator||t.defaultOperator}),a=Object.keys(this.form.controls).length+(0,_.O)(8);this.form.addControl(a,i,{emitEvent:""!==n}),this.cd.detectChanges(),e.focus&&this.filters.last.focusValueInput()}removeByKey(t){this.form.removeControl(t),this.cd.markForCheck()}removeCurrentlyFocused(){const t=document.activeElement;this.removeByKey(t.dataset.controlKey)}anyFocused(){return"ACTIVE-FILTER"===document.activeElement.nodeName}focusLast(){this.filters.last&&this.filters.last.focus()}focusPrevious(){const t=this.getFocusedIndex(),e=this.filters.get(t-1);e&&e.focus()}getByIndex(t){return this.filters.get(t)}lastIsFocused(){return this.getFocusedIndex()===this.filters.length-1}getFocusedIndex(){const t=document.activeElement.dataset.index;return t?parseInt(t):null}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(x.qu),i.Y36(i.sBO),i.Y36(i.SBq))},t.\u0275cmp=i.Xpm({type:t,selectors:[["active-filters"]],viewQuery:function(t,e){if(1&t&&i.Gf(L,5),2&t){let t;i.iGM(t=i.CRH())&&(e.filters=t)}},inputs:{compact:"compact",form:"form",config:"config"},ngContentSelectors:R,decls:3,vars:3,consts:[[4,"ngFor","ngForOf"],[3,"compact","key","form","filter",4,"ngIf"],[3,"compact","key","form","filter"]],template:function(t,e){1&t&&(i.F$t(),i.YNc(0,E,2,1,"ng-container",0),i.ALo(1,"keyvalue"),i.Hsn(2)),2&t&&i.Q6J("ngForOf",i.lcZ(1,1,e.form.controls))},directives:[h.sg,h.O5,L],pipes:[h.Nd],styles:["[_nghost-%COMP%]{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center}"],changeDetection:0}),t})();var V=n(63337),B=function(t){return t[t.ENTER=13]="ENTER",t[t.SPACE=32]="SPACE",t[t.ESCAPE=27]="ESCAPE",t[t.DELETE=46]="DELETE",t[t.ARROW_UP=38]="ARROW_UP",t[t.ARROW_RIGHT=39]="ARROW_RIGHT",t[t.ARROW_DOWN=40]="ARROW_DOWN",t[t.ARROW_LEFT=37]="ARROW_LEFT",t[t.BACKSPACE=8]="BACKSPACE",t[t.TAB=9]="TAB",t[t.S=83]="S",t[t.N=78]="N",t[t.A=65]="A",t[t.T=84]="T",t[t.B=66]="B",t[t.C=67]="C",t[t.O=79]="O",t[t.P=80]="P",t[t.R=82]="R",t[t.F=70]="F",t[t.Y=89]="Y",t[t.Z=90]="Z",t}({});let H=(()=>{class t{constructor(){this.bindings=[]}add(t,e){Array.isArray(t)||(t=[t]),t.forEach(t=>{this.bindings.push({keybind:this.parseKeybindString(t),keybindString:t,callback:e})})}addWithPreventDefault(t,e){this.bindings.push({keybind:this.parseKeybindString(t),keybindString:t,callback:e,preventDefault:!0})}listenOn(t,e={}){return(0,p.R)(t,"keydown").subscribe(t=>{!e.fireIfInputFocused&&["input","select"].includes(document.activeElement.nodeName.toLowerCase())||this.executeBindings(t)})}executeBindings(t){this.bindings.forEach(e=>{this.bindingMatches(e.keybind,t)&&(e.preventDefault&&t.preventDefault&&t.preventDefault(),e.callback(t))})}bindingMatches(t,e){return B[t.key.toUpperCase()]===e.keyCode&&(e.ctrlKey===t.ctrl||e.metaKey===t.ctrl)&&e.shiftKey===t.shift}parseKeybindString(t){const e=t.trim().split("+"),n={ctrl:!1,shift:!1,key:""};return e.forEach(t=>{"ctrl"===(t=t.trim().toLowerCase())?n.ctrl=!0:"shift"===t?n.shift=!0:n.key=t}),n}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var z=n(84369),G=n(40450);const j=["searchInput"],X=["filterSuggestion"];function W(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",8),i.NdJ("click",function(){return i.CHM(t),i.oxw().clearSearch()}),i._UZ(1,"mat-icon",9),i.qZA()}}function K(t,e){1&t&&(i.TgZ(0,"span",13),i._uU(1,"Filter"),i.qZA())}function tt(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",10),i.NdJ("click",function(){return i.CHM(t),i.oxw().toggleFilterDropdown()}),i._UZ(1,"mat-icon",11),i.YNc(2,K,2,0,"span",12),i.qZA()}if(2&t){const t=i.oxw();i.xp6(2),i.Q6J("ngIf",!t.compact)}}let et=(()=>{class t{constructor(t,e,n,a,o,s){this.fb=t,this.route=e,this.el=n,this.keybinds=a,this.cd=o,this.router=s,this.filterChange=new i.vpe,this.inputFocus=new i.vpe,this.form=this.fb.group({}),this.filterBarHeight=0,this.filterDropdownVisible$=new c.X(!1)}set filters(t){t?(this.keyedFilters={},(t||[]).forEach(t=>{this.keyedFilters[t.key]=t})):this.keyedFilters=null}ngOnInit(){this.haveFiltersOrQuery$=(0,d.aj)([this.searchControl.valueChanges.pipe((0,o.O)(null)),this.form.valueChanges.pipe((0,o.O)(null))]).pipe((0,s.U)(([t,e])=>t||e&&0!==Object.keys(e).length))}ngAfterViewInit(){this.watchForSizeChanges(),this.setFiltersFromQuery(),this.setupKeybinds(),this.subscribeToCloseActions(),this.bindToFormValueChange()}onClick(t){t.target!==this.el.nativeElement&&t.target!==this.activeFilters.el.nativeElement||this.searchInput.nativeElement.focus()}ngOnDestroy(){var t;null===(t=this.closeActionsStream$)||void 0===t||t.unsubscribe()}clearSearch(){Object.keys(this.form.controls).forEach(t=>{this.activeFilters.removeByKey(t)}),this.searchControl.reset(null,{emitEvent:!1}),this.form.reset()}toggleFilterDropdown(){this.filterDropdownVisible$.next(!this.filterDropdownVisible$.value)}addFilterFromDropdownClick(t){this.activeFilters.add(t,{focus:!0}),this.filterDropdownVisible$.next(!1)}searchInputIsFocused(){return document.activeElement===this.searchInput.nativeElement}cursorAtStartOfSearchInput(){return this.searchInputIsFocused()&&0===this.searchInput.nativeElement.selectionStart}cursorAtEndOfSearchInput(){return this.searchInputIsFocused()&&this.searchInput.nativeElement.selectionStart===this.searchInput.nativeElement.value.length}bindToFormValueChange(){this.form.valueChanges.pipe((0,s.U)(t=>Object.keys(t).length?t:null),(0,r.x)()).subscribe(t=>{this.filterChange.emit(t?nt(t):null)})}watchForSizeChanges(){new ResizeObserver(t=>{this.filterBarHeight=t[0].contentRect.height}).observe(this.el.nativeElement,{box:"border-box"})}setFiltersFromQuery(){const t=this.router.routerState.root.snapshot.queryParams;t.filters&&it(t.filters).forEach(t=>{this.activeFilters.add(this.keyedFilters[t.key],t)}),t.query&&this.searchControl.setValue(t.query)}setupKeybinds(){this.keybinds.add(["backspace","delete"],()=>this.cursorAtStartOfSearchInput()?this.activeFilters.focusLast():this.activeFilters.anyFocused()?(this.activeFilters.removeCurrentlyFocused(),this.searchInput.nativeElement.focus()):void 0),this.keybinds.add("arrow_left",t=>{this.cursorAtStartOfSearchInput()?(this.activeFilters.focusLast(),t.preventDefault()):this.activeFilters.anyFocused()&&(this.activeFilters.focusPrevious(),t.preventDefault())}),this.keybinds.add("arrow_right",t=>{if(this.activeFilters.anyFocused()){t.preventDefault();const e=this.activeFilters.getFocusedIndex(),n=this.activeFilters.getByIndex(e+1);n?n.focus():this.activeFilters.lastIsFocused()&&this.searchInput.nativeElement.focus()}}),this.keybinds.add(["arrow_down","tab"],t=>{if(this.cursorAtEndOfSearchInput()||this.suggestions.anyFocused()){t.preventDefault(),this.filterDropdownVisible$.value||this.toggleFilterDropdown();const e=this.suggestions.getFocusedIndex();let n=e>-1?e:0;this.suggestions.anyFocused()&&(n+=1),n>=this.suggestions.items.length&&(n=0),this.suggestions.focusItemAt(n)}}),this.keybinds.add(["arrow_up","shift+tab"],t=>{if(this.suggestions.anyFocused()){t.preventDefault();const e=this.activeFilters.getFocusedIndex();let n=e>-1?e:0;n-=1,-1===n?this.searchInput.nativeElement.focus():this.suggestions.focusItemAt(n)}}),this.keybinds.add("enter",t=>{const e=this.suggestions.getFocusedFilter();e&&(t.preventDefault(),this.activeFilters.add(e,{focus:!0}),this.filterDropdownVisible$.next(!1))}),this.keybinds.add("esc",t=>{this.filterDropdownVisible$.value&&(t.preventDefault(),this.filterDropdownVisible$.next(!1))}),this.keybinds.listenOn(document,{fireIfInputFocused:!0})}subscribeToCloseActions(){this.closeActionsStream$=(0,u.T)((0,p.R)(document,"click"),(0,p.R)(document,"auxclick"),(0,p.R)(document,"touchend")).pipe((0,l.h)(t=>{const e=t.target;return e!==this.el.nativeElement&&!this.el.nativeElement.contains(e)})).subscribe(()=>{this.filterDropdownVisible$.next(!1)})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(x.qu),i.Y36(V.gz),i.Y36(i.SBq),i.Y36(H),i.Y36(i.sBO),i.Y36(V.F0))},t.\u0275cmp=i.Xpm({type:t,selectors:[["search-input-with-filters"]],viewQuery:function(t,e){if(1&t&&(i.Gf(j,5),i.Gf(v,5),i.Gf($,5),i.Gf(X,5)),2&t){let t;i.iGM(t=i.CRH())&&(e.searchInput=t.first),i.iGM(t=i.CRH())&&(e.suggestions=t.first),i.iGM(t=i.CRH())&&(e.activeFilters=t.first),i.iGM(t=i.CRH())&&(e.filterContainers=t)}},hostBindings:function(t,e){1&t&&i.NdJ("click",function(t){return e.onClick(t)})},inputs:{compact:"compact",searchControl:"searchControl",pluralName:"pluralName",filters:"filters"},outputs:{filterChange:"filterChange",inputFocus:"inputFocus"},decls:11,vars:18,consts:[[3,"form","config","compact"],[1,"input-container","search-input-container"],["svgIcon","search",1,"search-icon"],["type","text",1,"search-input",3,"placeholder","formControl","focus"],["searchInput",""],["type","button","class","clear-button","mat-icon-button","",3,"click",4,"ngIf"],["type","button","mat-button","","class","filter-button",3,"click",4,"ngIf"],[3,"filters","filterSelected"],["type","button","mat-icon-button","",1,"clear-button",3,"click"],["svgIcon","close"],["type","button","mat-button","",1,"filter-button",3,"click"],["svgIcon","filter-list",1,"filter-button-icon"],["class","filter-button-text","trans","",4,"ngIf"],["trans","",1,"filter-button-text"]],template:function(t,e){1&t&&(i.TgZ(0,"active-filters",0),i.TgZ(1,"div",1),i._UZ(2,"mat-icon",2),i.TgZ(3,"input",3,4),i.NdJ("focus",function(){return e.inputFocus.emit()}),i.ALo(5,"trans"),i.qZA(),i.qZA(),i.qZA(),i.YNc(6,W,2,0,"button",5),i.ALo(7,"async"),i.YNc(8,tt,3,1,"button",6),i.TgZ(9,"filter-suggestions",7),i.NdJ("filterSelected",function(t){return e.addFilterFromDropdownClick(t)}),i.ALo(10,"async"),i.qZA()),2&t&&(i.Q6J("form",e.form)("config",e.keyedFilters)("compact",e.compact),i.xp6(3),i.Q6J("placeholder",i.lcZ(5,12,"Type to search for "+e.pluralName))("formControl",e.searchControl),i.xp6(3),i.Q6J("ngIf",i.lcZ(7,14,e.haveFiltersOrQuery$)),i.xp6(2),i.Q6J("ngIf",e.keyedFilters),i.xp6(1),i.Udp("top",e.filterBarHeight+5+"px"),i.ekj("visible",i.lcZ(10,16,e.filterDropdownVisible$)),i.Q6J("filters",e.keyedFilters))},directives:[$,m.Hw,x.Fj,x.JJ,x.oH,h.O5,v,z.lW,g.P],pipes:[G.R,h.Ov],styles:["[_nghost-%COMP%]{display:flex;background-color:var(--be-background);border:1px solid var(--be-divider-default);height:45px;border-radius:4px;position:relative;padding-left:3px;overflow:hidden;width:100%}@media only screen and (max-width:768px){[_nghost-%COMP%]{flex-wrap:wrap;justify-content:center}}[_nghost-%COMP%]:focus-within{outline:none;border-color:var(--be-accent-lighter);box-shadow:0 0 0 2px var(--be-accent-lighter);z-index:3;overflow:visible;height:auto!important}.search-input-container[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1 1 auto;width:auto;height:43px;padding-left:8px}.search-icon[_ngcontent-%COMP%]{display:block;color:var(--be-secondary-text);margin-right:5px}.search-input[_ngcontent-%COMP%]{border:none;height:100%;padding:0}.search-input[_ngcontent-%COMP%]:focus{box-shadow:none;z-index:1}.filter-button[_ngcontent-%COMP%]{min-width:auto;padding:0 14px}.clear-button[_ngcontent-%COMP%], .filter-button[_ngcontent-%COMP%]{color:var(--be-accent-default);height:43px}.clear-button[_ngcontent-%COMP%]{width:43px;line-height:43px}.filter-button-text[_ngcontent-%COMP%]{margin-left:10px}"],changeDetection:0}),t})();const nt=t=>{const e=[];return Object.values(t).forEach(t=>{""!==t.value&&e.push(t)}),e.length?encodeURIComponent(btoa(JSON.stringify(e))):""},it=t=>{let e=[];try{e=JSON.parse(atob(decodeURIComponent(t)))}catch(n){}return e};let at=(()=>{class t{constructor(t){this.datable=t}onFilterChange(t){this.datable.filters$.next({filters:t})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(a.x))},t.\u0275cmp=i.Xpm({type:t,selectors:[["datatable-filters"]],inputs:{pluralName:"pluralName",filters:"filters"},decls:1,vars:3,consts:[[3,"searchControl","pluralName","filters","filterChange"]],template:function(t,e){1&t&&(i.TgZ(0,"search-input-with-filters",0),i.NdJ("filterChange",function(t){return e.onFilterChange(t)}),i.qZA()),2&t&&i.Q6J("searchControl",e.datable.searchControl)("pluralName",e.pluralName)("filters",e.filters)},directives:[et],styles:[""],changeDetection:0}),t})()},59075:function(t,e,n){"use strict";n.d(e,{XQ:function(){return i},Bq:function(){return a},pg:function(){return o},Hi:function(){return s}});class i{constructor(t){this.defaultValue=void 0!==t.defaultValue?t.defaultValue:"",this.key=t.key||"",this.label=t.label||t.key||"",this.description=t.description||"",this.defaultOperator=t.defaultOperator||o.eq,this.required=!!t.required,this.order=void 0===t.order?1:t.order,this.type=t.type||a.Select,this.inputType=t.inputType,this.options=t.options||[],this.operators=t.operators,this.component=t.component,this.componentData=t.componentData}}var a=function(t){return t.Select="select",t.DatePicker="datePicker",t.SelectModel="selectModel",t.Input="input",t.StaticValue="staticValue",t}({}),o=function(t){return t.eq="=",t.ne="!=",t.gt=">",t.gte=">=",t.lt="<",t.lte="<=",t.has="has",t.doesntHave="doesntHave",t}({});const s=[o.eq,o.ne,o.gt,o.gte,o.lt,o.lte]},45523:function(t,e,n){"use strict";n.d(e,{k4:function(){return a},T7:function(){return o},yH:function(){return s}});var i=n(59075);class a extends i.XQ{constructor(){super(...arguments),this.type=i.Bq.DatePicker,this.operators=i.Hi,this.defaultOperator=i.pg.lte,this.defaultValue=(new Date).toISOString().split("T")[0]}}class o extends a{constructor(){super(...arguments),this.key="created_at",this.label="Created At"}}class s extends a{constructor(){super(...arguments),this.key="updated_at",this.label="Updated At"}}},86668:function(t,e,n){"use strict";n.d(e,{V:function(){return m}});var i=n(31041),a=n(43835),o=n(79996),s=n(35366),r=n(56515),l=n(61116),c=n(84369),d=n(77307),u=n(38116),p=n(40450);function g(t,e){if(1&t&&(s.TgZ(0,"div",6),s.TgZ(1,"div",7),s._uU(2,"Items per page"),s.qZA(),s.TgZ(3,"div",8),s.TgZ(4,"select",9),s.TgZ(5,"option",10),s._uU(6,"10"),s.qZA(),s.TgZ(7,"option",10),s._uU(8,"15"),s.qZA(),s.TgZ(9,"option",10),s._uU(10,"20"),s.qZA(),s.TgZ(11,"option",10),s._uU(12,"50"),s.qZA(),s.TgZ(13,"option",10),s._uU(14,"100"),s.qZA(),s.qZA(),s.qZA(),s.qZA()),2&t){const t=s.oxw();s.xp6(4),s.Q6J("formControl",t.perPageControl),s.xp6(1),s.Q6J("ngValue",10),s.xp6(2),s.Q6J("ngValue",15),s.xp6(2),s.Q6J("ngValue",20),s.xp6(2),s.Q6J("ngValue",50),s.xp6(2),s.Q6J("ngValue",100)}}function h(t,e){if(1&t&&(s.TgZ(0,"div",11),s._uU(1),s.ALo(2,"trans"),s.ALo(3,"number"),s.qZA()),2&t){const t=s.oxw();s.xp6(1),s.HOy(" ",t.from," - ",t.to," ",s.lcZ(2,4,"of")," ",s.lcZ(3,6,t.totalRecords)," ")}}let m=(()=>{class t{constructor(t,e){this.datable=t,this.cd=e,this.hidePerPage=!1,this.perPageControl=new i.NI(15)}ngOnInit(){this.changeRef=this.datable.paginator.response$.pipe((0,a.h)(t=>!!(null==t?void 0:t.pagination)),(0,o.U)(t=>t.pagination)).subscribe(t=>{this.totalRecords=t.total,this.to=Math.min(t.per_page*t.current_page,this.totalRecords),this.from=Math.max(this.to-t.per_page,1),this.havePrevious=this.datable.paginator.canLoadPrevPage(),this.haveNext=this.datable.paginator.canLoadNextPage(),this.perPageControl.setValue(parseInt(""+t.per_page),{emitEvent:!1}),this.cd.markForCheck()}),this.perPageControl.valueChanges.subscribe(t=>{this.datable.paginator.changePerPage(t)})}ngOnDestroy(){this.changeRef.unsubscribe(),this.datable.destroy()}previousPage(){this.datable.paginator.previousPage()}nextPage(){this.datable.paginator.nextPage()}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(r.x),s.Y36(s.sBO))},t.\u0275cmp=s.Xpm({type:t,selectors:[["datatable-footer"]],inputs:{hidePerPage:"hidePerPage"},decls:9,vars:8,consts:[["class","page-size",4,"ngIf"],[1,"range-actions"],["class","range-label",4,"ngIf"],["type","button","mat-icon-button","",1,"range-button",3,"disabled","click"],["svgIcon","chevron-left"],["svgIcon","chevron-right"],[1,"page-size"],["trans","",1,"page-size-label"],[1,"input-container"],[1,"page-size-input",3,"formControl"],[3,"ngValue"],[1,"range-label"]],template:function(t,e){1&t&&(s.YNc(0,g,15,6,"div",0),s.TgZ(1,"div",1),s.YNc(2,h,4,8,"div",2),s.TgZ(3,"button",3),s.NdJ("click",function(){return e.previousPage()}),s.ALo(4,"async"),s._UZ(5,"mat-icon",4),s.qZA(),s.TgZ(6,"button",3),s.NdJ("click",function(){return e.nextPage()}),s.ALo(7,"async"),s._UZ(8,"mat-icon",5),s.qZA(),s.qZA()),2&t&&(s.Q6J("ngIf",!e.hidePerPage),s.xp6(2),s.Q6J("ngIf",e.from&&e.to&&e.totalRecords),s.xp6(1),s.Q6J("disabled",!e.havePrevious||s.lcZ(4,4,e.datable.paginator.loading$)),s.xp6(3),s.Q6J("disabled",!e.haveNext||s.lcZ(7,6,e.datable.paginator.loading$)))},directives:[l.O5,c.lW,d.Hw,u.P,i.EJ,i.JJ,i.oH,i.YN,i.Kr],pipes:[l.Ov,p.R,l.JJ],styles:["[_nghost-%COMP%]{display:flex;padding:0 8px;align-items:center;justify-content:flex-end;flex-wrap:wrap-reverse;width:100%;height:56px}.page-size[_ngcontent-%COMP%]{display:flex;align-items:center;margin-right:8px}.page-size-label[_ngcontent-%COMP%]{font-size:1.2rem;color:var(--be-secondary-text);margin:0 4px}.input-container[_ngcontent-%COMP%]{width:auto}.page-size-input[_ngcontent-%COMP%]{width:60px;height:33px;padding:4px;margin:0 4px}.range-actions[_ngcontent-%COMP%]{display:flex;align-items:center}.range-label[_ngcontent-%COMP%]{margin:0 32px 0 24px;font-size:1.2rem}.range-button[_ngcontent-%COMP%], .range-label[_ngcontent-%COMP%]{color:var(--be-secondary-text)}.range-button[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{width:28px;height:28px;line-height:28px}"],changeDetection:0}),t})()},51685:function(t,e,n){"use strict";n.d(e,{x:function(){return _}});var i=n(61116),a=n(77307),o=n(68400),s=n(40994),r=n(31041),l=n(84369),c=n(95522),d=n(27701),u=n(56160),p=n(58666),g=n(50615),h=n(92935),m=n(99808),f=n(35366);let b=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=f.oAB({type:t}),t.\u0275inj=f.cJS({imports:[[i.ez,o.N,r.UX,a.Ps,l.ot,h.Is,m.p]]}),t})();var v=n(63337);let _=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=f.oAB({type:t}),t.\u0275inj=f.cJS({imports:[[i.ez,o.N,r.UX,r.u5,u.G,p.u,g.X,b,v.Bz,l.ot,a.Ps,s.p9,c.Hi,d.Cv],s.p9]}),t})()},56515:function(t,e,n){"use strict";n.d(e,{x:function(){return C}});var i=n(78512),a=n(3080),o=n(91741),s=n(40878),r=n(79996),l=n(44689),c=n(66599),d=n(35366),u=n(63337),p=n(68515),g=n(36402);let h=(()=>{class t{constructor(t,e,n){this.router=t,this.http=e,this.localStorage=n,this.params$=new i.X({}),this.paginatedOnce$=new i.X(!1),this.loading$=new i.X(!1),this.response$=new i.X(null),this.dontUpdateQueryParams=!1,this.perPageCacheKey=null,this.noResults$=this.response$.pipe((0,r.U)(t=>this.paginatedOnce$.value&&0===t.pagination.data.length))}get params(){return this.params$.value}get currentPage(){var t,e;return null===(e=null===(t=this.response$.value)||void 0===t?void 0:t.pagination)||void 0===e?void 0:e.current_page}paginate(t={},e,n){const i=this.subscription?{}:this.currentQueryParams();this.params$.next(Object.assign(Object.assign(Object.assign({},this.response$.value?{perPage:this.response$.value.pagination.per_page,page:this.response$.value.pagination.current_page}:{}),i),t)),this.subscription||this.init(e,n)}nextPage(){const t=this.response$.value.pagination.current_page||0;this.paginate(Object.assign(Object.assign({},this.params$.value),{page:t+1,cursor:this.response$.value.pagination.next_cursor}))}previousPage(){const t=this.response$.value.pagination.current_page;this.paginate(Object.assign(Object.assign({},this.params$.value),{page:t-1||1,cursor:this.response$.value.pagination.prev_cursor}))}changePerPage(t){var e;t!==(null===(e=this.params$.value)||void 0===e?void 0:e.perPage)&&(this.perPageCacheKey&&this.localStorage.set(this.perPageCacheKey,t),this.paginate(Object.assign(Object.assign({},this.params$.value),{perPage:t})))}currentQueryParams(){return this.router.routerState.root.snapshot.queryParams}init(t,e){this.subscription=this.params$.pipe((0,l.w)(n=>{this.loading$.next(!0);const i=!this.paginatedOnce$.value;return i&&this.perPageCacheKey&&this.localStorage.get(this.perPageCacheKey)&&(n=Object.assign({perPage:this.localStorage.get(this.perPageCacheKey)},n)),(i&&e?(0,s.of)({pagination:e}):this.http.get(t,n)).pipe((0,c.b)(()=>{this.updateQueryParams(n),this.loading$.next(!1),this.paginatedOnce$.next(!0)},()=>{this.loading$.next(!1),this.paginatedOnce$.next(!0)}))})).subscribe(t=>{this.response$.next(t)})}updateQueryParams(t={}){if(!this.dontUpdateQueryParams){for(const e in t)Array.isArray(t[e])&&(t[e]=t[e].join(","));this.router.navigate([],{queryParams:t,replaceUrl:!0})}}canLoadNextPage(){var t;const e=null===(t=this.response$.value)||void 0===t?void 0:t.pagination;return!!e&&(!!e.next_cursor||this.currentPage<e.last_page)}canLoadPrevPage(){var t;const e=null===(t=this.response$.value)||void 0===t?void 0:t.pagination;return!!e&&(!!e.prev_cursor||this.currentPage>1)}}return t.\u0275fac=function(e){return new(e||t)(d.LFG(u.F0),d.LFG(p.r),d.LFG(g.m))},t.\u0275prov=d.Yz7({token:t,factory:t.\u0275fac}),t})();var m=n(47701),f=n(62855),b=n(43835),v=n(73709),_=n(4694),Z=n(72798),x=n(52907),y=n(19861);function A(t,e){const n=x.pick(e,t);if((0,y.t6)(n)){const t=Number(n);return t<9007199254740991?t:n}return n}var w=n(9636),k=n(31041),T=n(24859);let C=(()=>{class t{constructor(t,e,n,a){this.modal=t,this.router=e,this.http=n,this.localStorage=a,this.sort$=new i.X({}),this.filters$=new i.X({}),this.searchControl=new k.NI,this.searchTerm$=new i.X(null),this.staticParams$=new i.X({}),this.paginator=new h(this.router,this.http,this.localStorage),this.ignoreNextParamChange=!1,this.originalData$=new i.X([]),this.data$=new i.X([]),this.selectedRows$=new i.X([])}get data(){return this.data$.value}set data(t){const e=[...t];this.originalData$.next(e),this.data$.next(e),this.ignoreNextParamChange=!0,this.reset()}init(t={}){if(this.config=t,this.staticParams$.next(Object.assign(Object.assign({},this.staticParams$.value),t.staticParams)),t.uri?this.connectToPaginator():t.initialData&&(this.data=t.initialData),t.uri){const t=this.router.routerState.root.snapshot.queryParams,e=t.query;this.searchControl.setValue(e),this.searchTerm$.next(e),this.sort$.next({orderBy:t.orderBy,orderDir:t.orderDir})}return this.searchControlSub=this.searchControl.valueChanges.pipe((0,m.b)(300)).subscribe(t=>{this.searchTerm$.next(t)}),this.mainSub=(0,a.aj)([this.sort$,this.filters$,this.searchTerm$.pipe((0,r.U)(t=>({query:t}))),this.staticParams$]).pipe((0,m.b)(0,o.Z),(0,r.U)(t=>Object.assign({},...t))).subscribe(t=>{if(this.ignoreNextParamChange)return this.ignoreNextParamChange=!1;t=(0,v.N)(t),Object.entries(t).forEach(([e,n])=>{"object"==typeof n&&n.id&&(t[`${e}Id`]=n.id,delete t[e])}),this.config.uri?this.paginator.paginate(t,this.config.uri,this.config.initialData):Object.keys(t).length&&this.data.length&&this.applyLocalTransforms(t)}),this}connectToPaginator(){this.paginatorSub=this.paginator.response$.pipe((0,f.G)()).subscribe(([t,e])=>{var n;const i=this.config.infiniteScroll&&(null===(n=null==t?void 0:t.pagination)||void 0===n?void 0:n.current_page)!==e.pagination.current_page?[...this.data$.value,...e.pagination.data]:e.pagination.data;this.data$.next(i)})}applyLocalTransforms(t){let e=[...this.originalData$.value];t.query&&(e=(0,w.D)(e,t.query)),t.orderBy&&t.orderDir&&(e=function(t,e,n){return t.sort((t,i)=>{let a=A(t,e),o=A(i,e);const s=typeof a,r=typeof o;s!==r&&("number"===s&&(a+=""),"number"===r&&(o+=""));let l=0;return null!=a&&null!=o?a>o?l=1:a<o&&(l=-1):null!=a?l=1:null!=o&&(l=-1),l*("asc"===n?1:-1)})}(e,t.orderBy,t.orderDir)),this.data$.next(e)}addFilter(t,e){this.filters$.next(Object.assign(Object.assign({},this.filters$.value),{[t]:e}))}removeFilter(t){const e=Object.assign({},this.filters$.value);delete e[t],this.filters$.next(e)}reset(t=null){this.filters$.next({}),this.sort$.next({}),this.selectedRows$.next([]),t&&this.staticParams$.next(t)}openCrupdateResourceModal(t,e,n){return this.modal.open(t,e,n).beforeClosed().pipe((0,b.h)(t=>!!t),(0,c.b)(()=>this.reset()))}confirmResourceDeletion(t){const e=Object.assign(Object.assign({},Z.M),{replacements:{resource:t}});return this.modal.open(_.z,e).afterClosed().pipe((0,b.h)(t=>t))}getCurrentParams(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.sort$.value),this.filters$.value),this.staticParams$.value),this.paginator.params)}destroy(){var t,e,n;null===(t=this.paginatorSub)||void 0===t||t.unsubscribe(),null===(e=this.mainSub)||void 0===e||e.unsubscribe(),null===(n=this.searchControlSub)||void 0===n||n.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(d.LFG(T.u),d.LFG(u.F0),d.LFG(p.r),d.LFG(g.m))},t.\u0275prov=d.Yz7({token:t,factory:t.\u0275fac}),t})()},72798:function(t,e,n){"use strict";n.d(e,{M:function(){return i}});const i={title:"Delete :resource",body:"Are you sure you want to delete selected :resource?",ok:"Delete"}},54275:function(t,e,n){"use strict";n.d(e,{O:function(){return r}});var i=n(35366),a=n(56515),o=n(40994);const s=["table-body-checkbox",""];let r=(()=>{class t{constructor(t,e){this.datatable=t,this.cd=e}ngOnInit(){this.changeRef=this.datatable.selectedRows$.subscribe(t=>{this.cd.markForCheck()})}ngOnDestroy(){this.changeRef.unsubscribe()}isRowSelected(t){return this.datatable.selectedRows$.value.indexOf(t)>-1}toggleRow(t){if(this.isRowSelected(t)){const e=this.datatable.selectedRows$.value.slice(),n=this.datatable.selectedRows$.value.indexOf(t);e.splice(n,1),this.datatable.selectedRows$.next(e)}else this.datatable.selectedRows$.next([...this.datatable.selectedRows$.value,t])}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(a.x),i.Y36(i.sBO))},t.\u0275cmp=i.Xpm({type:t,selectors:[["","table-body-checkbox",""]],hostAttrs:[1,"table-checkbox"],inputs:{rowId:["table-body-checkbox","rowId"]},attrs:s,decls:1,vars:1,consts:[[3,"checked","click","change"]],template:function(t,e){1&t&&(i.TgZ(0,"mat-checkbox",0),i.NdJ("click",function(t){return t.stopPropagation()})("change",function(t){return t?e.toggleRow(e.rowId):null}),i.qZA()),2&t&&i.Q6J("checked",e.isRowSelected(e.rowId))},directives:[o.oG],encapsulation:2,changeDetection:0}),t})()},13536:function(t,e,n){"use strict";n.d(e,{e:function(){return r}});var i=n(35366),a=n(56515),o=n(40994);const s=["table-header-checkbox",""];let r=(()=>{class t{constructor(t,e){this.datatable=t,this.cd=e}ngOnInit(){this.changeRef=this.datatable.selectedRows$.subscribe(()=>{this.cd.markForCheck()})}ngOnDestroy(){this.changeRef.unsubscribe()}anyRowsSelected(){return!!this.datatable.selectedRows$.value.length}allRowsSelected(){var t;return this.datatable.selectedRows$.value.length&&this.datatable.selectedRows$.value.length===(null===(t=this.datatable.data$.value)||void 0===t?void 0:t.length)}toggleAllRows(){this.allRowsSelected()?this.datatable.selectedRows$.next([]):this.datatable.selectedRows$.next(this.datatable.data$.value.map(t=>t.id))}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(a.x),i.Y36(i.sBO))},t.\u0275cmp=i.Xpm({type:t,selectors:[["","table-header-checkbox",""]],hostAttrs:[1,"table-checkbox"],attrs:s,decls:1,vars:2,consts:[[3,"checked","indeterminate","change"]],template:function(t,e){1&t&&(i.TgZ(0,"mat-checkbox",0),i.NdJ("change",function(t){return t?e.toggleAllRows():null}),i.qZA()),2&t&&i.Q6J("checked",e.allRowsSelected())("indeterminate",e.anyRowsSelected()&&!e.allRowsSelected())},directives:[o.oG],encapsulation:2,changeDetection:0}),t})()},80922:function(t,e,n){"use strict";n.d(e,{p:function(){return h}});var i=n(43835),a=n(99235),o=n(40694),s=n(35366),r=n(56515),l=n(97388),c=n(61116),d=n(77307);const u=["columnName"],p=["table-sort-header",""],g=["*"];let h=(()=>{class t{constructor(t,e,n,i){this.datable=t,this.cd=e,this.focusMonitor=n,this.el=i,this.orderDir=null,this.arrowVisible=!1,this.arrowDirection="down"}get sortDisabled(){var t;return null===(t=this.datable.config)||void 0===t?void 0:t.disableSort}ngOnInit(){this.orderBy||(this.orderBy=(0,o.V)(this.columnName.nativeElement.textContent,"_")),this.sortSub=this.datable.sort$.pipe((0,i.h)(t=>t.orderBy!==this.orderBy)).subscribe(()=>{this.orderDir=null,this.onMouseLeave(),this.cd.markForCheck()})}ngAfterViewInit(){this.focusMonitor.monitor(this.el).subscribe()}ngOnDestroy(){this.sortSub.unsubscribe(),this.focusMonitor.stopMonitoring(this.el)}changeSort(){this.datable.sort$.next({orderBy:this.orderBy,orderDir:this.getDirection(this.orderDir)})}getDirection(t){switch(t){case"asc":return this.arrowVisible=!1,this.orderDir=null;case"desc":return this.arrowVisible=!0,this.arrowDirection="up",this.orderDir="asc";default:return this.arrowVisible=!0,this.arrowDirection="down",this.orderDir="desc"}}onMouseEnter(){var t;(null===(t=this.datable.config)||void 0===t?void 0:t.disableSort)||(this.arrowVisible=!0)}onMouseLeave(){this.arrowVisible=!1,this.orderDir||(this.arrowDirection="down")}handleClick(){var t;(null===(t=this.datable.config)||void 0===t?void 0:t.disableSort)||this.changeSort()}handleKeydown(t){var e;(null===(e=this.datable.config)||void 0===e?void 0:e.disableSort)||t.keyCode!==a.L_&&t.keyCode!==a.K5||(t.preventDefault(),this.changeSort())}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(r.x),s.Y36(s.sBO),s.Y36(l.tE),s.Y36(s.SBq))},t.\u0275cmp=s.Xpm({type:t,selectors:[["","table-sort-header",""]],viewQuery:function(t,e){if(1&t&&s.Gf(u,7),2&t){let t;s.iGM(t=s.CRH())&&(e.columnName=t.first)}},hostAttrs:["tabindex","0"],hostVars:4,hostBindings:function(t,e){1&t&&s.NdJ("click",function(){return e.handleClick()})("keydown",function(t){return e.handleKeydown(t)})("mouseenter",function(){return e.onMouseEnter()})("mouseleave",function(){return e.onMouseLeave()}),2&t&&s.ekj("active",e.orderDir)("sort-disabled",e.sortDisabled)},inputs:{orderBy:["table-sort-header","orderBy"]},attrs:p,ngContentSelectors:g,decls:5,vars:3,consts:[[1,"text"],["columnName",""],[1,"icon-wrapper",3,"ngClass"],["svgIcon","arrow-downward",1,"sort-icon"]],template:function(t,e){1&t&&(s.F$t(),s.TgZ(0,"span",0,1),s.Hsn(2),s.qZA(),s.TgZ(3,"span",2),s._UZ(4,"mat-icon",3),s.qZA()),2&t&&(s.xp6(3),s.Q6J("ngClass",e.arrowDirection),s.xp6(1),s.ekj("hint-visible",e.arrowVisible))},directives:[c.mk,d.Hw],styles:["[_nghost-%COMP%]{outline:none}[_nghost-%COMP%]:not(.sort-disabled){cursor:pointer}.active[_nghost-%COMP%]   .sort-icon[_ngcontent-%COMP%]{color:var(--be-text);opacity:1;transform:translate(0)}.cdk-keyboard-focused[_nghost-%COMP%]   .text[_ngcontent-%COMP%]{border-bottom:1px solid}.text[_ngcontent-%COMP%]{display:inline-block;text-transform:capitalize}.sort-icon[_ngcontent-%COMP%], .text[_ngcontent-%COMP%]{vertical-align:middle}.sort-icon[_ngcontent-%COMP%]{width:15px;height:15px;transition:all 225ms cubic-bezier(.4,0,.2,1);transform:translateY(25%);opacity:0}.icon-wrapper[_ngcontent-%COMP%]{display:inline-block;margin-left:4px;transition:transform 225ms cubic-bezier(.4,0,.2,1)}.icon-wrapper[_ngcontent-%COMP%]:not(.down){transform:rotate(180deg)}.hint-visible[_ngcontent-%COMP%]{opacity:1;transform:translate(0)}"],changeDetection:0}),t})()},9636:function(t,e,n){"use strict";function i(t,e){return t.filter(t=>function(t,e){const n="string"==typeof t?t:a(t),i=e.trim().toLowerCase();return-1!==n.indexOf(i)}(t,e))}function a(t){return Object.keys(t).reduce((e,n)=>e+(t[n]&&"object"==typeof t[n]?a(t[n]):t[n])+"\u25ec","").toLowerCase()}n.d(e,{D:function(){return i}})},20237:function(t,e,n){"use strict";n.d(e,{w:function(){return s}});var i=n(4694),a=n(35366),o=n(24859);let s=(()=>{class t{constructor(t){this.modal=t}canDeactivate(t){return!!t.canDeactivate()||this.modal.show(i.z,{title:"Unsaved Changes",body:"You have unsaved changes. Do you want to discard them?",ok:"Discard"}).beforeClosed()}}return t.\u0275fac=function(e){return new(e||t)(a.LFG(o.u))},t.\u0275prov=a.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},99208:function(t,e,n){"use strict";n.d(e,{e:function(){return rt}});var i=n(11520),a=n(82628),o=n(64762),s=n(35366),r=n(88195),l=n(78733),c=n(71294),d=n(3950);let u=(()=>{class t{constructor(t,e,n,i,a){this.settings=t,this.zone=e,this.lazyLoader=n,this.breakpoints=i,this.i18n=a,this.makeBootstrapPromise()}reset(){this.editorIsReady()&&(this.tinymceInstance.setContent(""),this.tinymceInstance.undoManager.clear())}focus(){this.waitForEditor().then(()=>{this.tinymceInstance.focus(!1)})}hasUndo(){return this.editorIsReady()&&this.tinymceInstance.undoManager.hasUndo()}hasRedo(){return this.editorIsReady()&&this.tinymceInstance.undoManager.hasRedo()}queryCommandState(t){return this.editorIsReady()&&this.tinymceInstance.queryCommandState(t)}execCommand(t,e=null){this.waitForEditor().then(()=>{this.zone.run(()=>{this.tinymceInstance.execCommand(t,!1,e)})})}getContents(t){return this.editorIsReady()?this.tinymceInstance.getContent(t):""}setContents(t){this.waitForEditor().then(()=>{this.tinymceInstance.undoManager&&(this.tinymceInstance.undoManager.transact(()=>{this.tinymceInstance.setContent(t)}),this.tinymceInstance.selection.setCursorLocation(),this.tinymceInstance.nodeChanged(),this.tinymceInstance.execCommand("mceResize"))})}insertContents(t){this.waitForEditor().then(()=>{this.tinymceInstance.execCommand("mceInsertContent",!1,t),setTimeout(()=>this.tinymceInstance.selection.collapse())})}insertImage(t){this.waitForEditor().then(()=>{this.insertContents('<img src="'+t+'"/>'),setTimeout(()=>this.execCommand("mceAutoResize"),500)})}waitForEditor(){return this.tinymceInstance?new Promise(t=>t(this.tinymceInstance)):this.bootstrapPromise?this.bootstrapPromise:void 0}setConfig(t){this.config=t,this.loadTinymce().then(()=>{this.initTinymce()})}editorIsReady(){return!this.bootstrapPromise&&!!this.tinymceInstance&&!!this.tinymceInstance.undoManager}loadTinymce(){return this.lazyLoader.loadAsset("js/tinymce/tinymce.min.js",{type:"js"})}initTinymce(){const t={target:this.config.textAreaEl.nativeElement,plugins:["link","codesample","paste","autoresize"],branding:!1,browser_spellcheck:!0,max_height:this.config.maxHeight,min_height:this.config.minHeight,autoresize_on_init:!1,paste_as_text:!0,elementpath:!1,statusbar:!1,entity_encoding:"raw",menubar:!1,toolbar:!1,convert_urls:!1,forced_root_block:!1,document_base_url:document.baseURI,element_format:"html",body_class:"editor-body",content_style:'html {font-size: 62.5%;}\n.editor-body {font-size: 1.4rem;font-family: "Roboto", "Helvetica Neue", sans-serif;color: rgba(0, 0, 0, .87);}\nimg {max-width: 100%}\ncode[class*=language-], pre[class*=language-] {font-size: inherit;} .mce-preview-object {border: none;}',content_css:["https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"],default_link_target:"_blank",link_assume_external_targets:!0,target_list:!1,link_title:!1,image_dimensions:!1,image_description:!1,setup:t=>{this.tinymceInstance=t,t.on("change",()=>this.config.onChange.emit(t.getContent())),t.on("click",()=>{this.zone.run(()=>{})})},init_instance_callback:t=>{this.bootstrapPromise=!1,this.bootstrapPromiseResolve(this.tinymceInstance);const e=()=>{this.zone.run(()=>{this.config.onChange.emit(t.getContent()),this.config.onCtrlEnter.emit()})};t.shortcuts.add("ctrl+13","desc",e),window.navigator.platform.toLowerCase().includes("mac")&&t.shortcuts.add("meta+13","desc",e)}};if(this.config.showAdvancedControls&&(t.plugins=t.plugins.concat(["media","hr","visualblocks","visualchars","wordcount"]),t.forced_root_block="p",t.statusbar=!0,t.autoresize_on_init=!0,t.extended_valid_elements="svg[*],use[*],iframe[src|frameborder|width|height|allow=*|allowfullscreen],script[src]",t.elementpath=!0,t.content_css.push(this.settings.getAssetUrl()+"css/advanced-editor-styles.css"),t.target_list=[{title:this.i18n.t("Current window"),value:""},{title:this.i18n.t("New Window"),value:"_blank"}],t.codesample_languages=[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"Shell",value:"shell-session"},{text:"Bash",value:"bash"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}]),"auto"===this.config.minHeight){const e=this.config.editorEl.nativeElement.parentElement.offsetHeight-74-4;t.min_height=e,t.max_height=e}tinymce.init(t)}destroyEditor(){try{this.tinymceInstance&&this.tinymceInstance.remove(),this.tinymceInstance=null,this.makeBootstrapPromise()}catch(t){}}makeBootstrapPromise(){this.bootstrapPromise=new Promise(t=>this.bootstrapPromiseResolve=t)}}return t.\u0275fac=function(e){return new(e||t)(s.LFG(r.Z),s.LFG(s.R0b),s.LFG(l.j),s.LFG(c.S),s.LFG(d.Z))},t.\u0275prov=s.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var p=n(62147),g=n(66457),h=n(67139),m=n(40149),f=n(74899),b=n(31041),v=n(47701),_=n(35331),Z=n(28505),x=n(98979),y=n(16930),A=n(20274),w=n(94380),k=n(73033);let T=(()=>{class t extends y.c{constructor(){super(...arguments),this.DEFAULT_MAX_SIZE_MB=3}initValidations(){const t=[new A.p({maxSize:(0,w.F)(this.DEFAULT_MAX_SIZE_MB,"MB")},this.i18n),new k.p({types:["image"]},this.i18n)];this.validations.push(...t)}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=s.n5z(t)))(n||t)}}(),t.\u0275prov=s.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var C=n(61116),q=n(24311),U=n(77307),I=n(97070),M=n(38116),O=n(40450);const J=["visualArea"],P=["sourceArea"];function N(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"div",3),s.TgZ(1,"button",4),s.NdJ("click",function(){return s.CHM(t),s.oxw().openFileUploadDialog()}),s.ALo(2,"trans"),s._UZ(3,"mat-icon",19),s.qZA(),s.qZA()}2&t&&(s.xp6(1),s.Q6J("matTooltip",s.lcZ(2,1,"Add Attachment")))}function S(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"div",3),s.TgZ(1,"button",4),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("codesample")}),s.ALo(2,"trans"),s._UZ(3,"mat-icon",20),s.qZA(),s.qZA()}2&t&&(s.xp6(1),s.Q6J("matTooltip",s.lcZ(2,1,"Insert Code Sample")))}function D(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"button",23),s.NdJ("click",function(){return s.CHM(t),s.oxw(2).openInsertImageModal()}),s.ALo(1,"trans"),s._UZ(2,"mat-icon",24),s.qZA()}2&t&&s.Q6J("matTooltip",s.lcZ(1,1,"Insert Image"))}function Q(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"div",3),s.TgZ(1,"button",4),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("mceLink")}),s.ALo(2,"trans"),s._UZ(3,"mat-icon",21),s.qZA(),s.YNc(4,D,3,3,"button",22),s.qZA()}if(2&t){const t=s.oxw();s.xp6(1),s.ekj("active",t.queryCommandState("link")),s.Q6J("matTooltip",s.lcZ(2,4,"Insert Link")),s.xp6(3),s.Q6J("ngIf",t.currentUser.hasPermission("files.create"))}}function Y(t,e){if(1&t){const t=s.EpF();s.TgZ(0,"div",1),s.TgZ(1,"div",3),s.TgZ(2,"button",25),s.TgZ(3,"span",26),s._uU(4,"Insert"),s.qZA(),s._UZ(5,"mat-icon",27),s.qZA(),s.TgZ(6,"mat-menu",null,28),s.TgZ(8,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("InsertHorizontalRule")}),s._UZ(9,"mat-icon",30),s.TgZ(10,"span",26),s._uU(11,"Horizontal Line"),s.qZA(),s.qZA(),s.TgZ(12,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("mceLink")}),s._UZ(13,"mat-icon",21),s.TgZ(14,"span",26),s._uU(15,"Link"),s.qZA(),s.qZA(),s.TgZ(16,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("mceMedia")}),s._UZ(17,"mat-icon",31),s.TgZ(18,"span",26),s._uU(19,"Media"),s.qZA(),s.qZA(),s.TgZ(20,"div",32),s.NdJ("click",function(){return s.CHM(t),s.oxw().insertInfoContainer("important")}),s._UZ(21,"mat-icon",33),s.TgZ(22,"span",26),s._uU(23,"Important"),s.qZA(),s.qZA(),s.TgZ(24,"div",32),s.NdJ("click",function(){return s.CHM(t),s.oxw().insertInfoContainer("warning")}),s._UZ(25,"mat-icon",34),s.TgZ(26,"span",26),s._uU(27,"Warning"),s.qZA(),s.qZA(),s.TgZ(28,"div",32),s.NdJ("click",function(){return s.CHM(t),s.oxw().insertInfoContainer("note")}),s._UZ(29,"mat-icon",35),s.TgZ(30,"span",26),s._uU(31,"Note"),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.TgZ(32,"div",3),s.TgZ(33,"button",36),s.TgZ(34,"span",26),s._uU(35,"Format"),s.qZA(),s._UZ(36,"mat-icon",27),s.qZA(),s.TgZ(37,"mat-menu",37,38),s.TgZ(39,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("FormatBlock","h1")}),s.TgZ(40,"div",39),s._uU(41,"Heading 1"),s.qZA(),s.TgZ(42,"div",40),s._uU(43,"Alt+Shift+1"),s.qZA(),s.qZA(),s.TgZ(44,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("FormatBlock","h2")}),s.TgZ(45,"div",39),s._uU(46,"Heading 2"),s.qZA(),s.TgZ(47,"div",40),s._uU(48,"Alt+Shift+2"),s.qZA(),s.qZA(),s.TgZ(49,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("FormatBlock","h3")}),s.TgZ(50,"div",39),s._uU(51,"Heading 3"),s.qZA(),s.TgZ(52,"div",40),s._uU(53,"Alt+Shift+3"),s.qZA(),s.qZA(),s.TgZ(54,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("FormatBlock","h4")}),s.TgZ(55,"div",39),s._uU(56,"Heading 4"),s.qZA(),s.TgZ(57,"div",40),s._uU(58,"Alt+Shift+4"),s.qZA(),s.qZA(),s.TgZ(59,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("FormatBlock","code")}),s.TgZ(60,"div",39),s._uU(61,"Code"),s.qZA(),s.qZA(),s.TgZ(62,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("strikethrough")}),s.TgZ(63,"div",39),s._uU(64,"Strikethrough"),s.qZA(),s.qZA(),s.TgZ(65,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("superscript")}),s.TgZ(66,"div",39),s._uU(67,"Superscript"),s.qZA(),s.qZA(),s.TgZ(68,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("subscript")}),s.TgZ(69,"div",39),s._uU(70,"Subscript"),s.qZA(),s.qZA(),s.TgZ(71,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("mceBlockQuote")}),s.TgZ(72,"div",39),s._uU(73,"Blockquote"),s.qZA(),s.qZA(),s.TgZ(74,"div",29),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("FormatBlock","p")}),s.TgZ(75,"div",39),s._uU(76,"Paragraph"),s.qZA(),s.TgZ(77,"div",40),s._uU(78,"Ctrl+Shift+7"),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.TgZ(79,"div",3),s.TgZ(80,"button",41,42),s.TgZ(82,"span",26),s._uU(83,"Color"),s.qZA(),s._UZ(84,"mat-icon",27),s.qZA(),s.TgZ(85,"mat-menu",43,44),s.TgZ(87,"div",45),s.NdJ("click",function(){s.CHM(t);const e=s.MAs(81);return s.oxw().showColorPicker("ForeColor",e)}),s._UZ(88,"mat-icon",46),s.TgZ(89,"span",26),s._uU(90,"Text Color"),s.qZA(),s.qZA(),s.TgZ(91,"div",47),s.NdJ("click",function(){s.CHM(t);const e=s.MAs(81);return s.oxw().showColorPicker("HiliteColor",e)}),s._UZ(92,"mat-icon",48),s.TgZ(93,"span",26),s._uU(94,"Background Color"),s.qZA(),s.qZA(),s.qZA(),s.qZA(),s.TgZ(95,"div",3),s.TgZ(96,"button",4),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("justifyLeft")}),s.ALo(97,"trans"),s._UZ(98,"mat-icon",49),s.qZA(),s.TgZ(99,"button",4),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("justifyCenter")}),s.ALo(100,"trans"),s._UZ(101,"mat-icon",50),s.qZA(),s.TgZ(102,"button",4),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("justifyRight")}),s.ALo(103,"trans"),s._UZ(104,"mat-icon",51),s.qZA(),s.qZA(),s.TgZ(105,"div",3),s.TgZ(106,"button",4),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("Outdent")}),s.ALo(107,"trans"),s._UZ(108,"mat-icon",52),s.qZA(),s.TgZ(109,"button",4),s.NdJ("click",function(){return s.CHM(t),s.oxw().execCommand("Indent")}),s.ALo(110,"trans"),s._UZ(111,"mat-icon",53),s.qZA(),s.qZA(),s.TgZ(112,"div",54),s.TgZ(113,"button",55),s.NdJ("click",function(){return s.CHM(t),s.oxw().showVisualEditor()}),s._uU(114,"Visual "),s.qZA(),s.TgZ(115,"button",56),s.NdJ("click",function(){return s.CHM(t),s.oxw().showSourceEditor()}),s._uU(116,"Source "),s.qZA(),s.qZA(),s.qZA()}if(2&t){const t=s.MAs(7),e=s.MAs(38),n=s.MAs(86),i=s.oxw();s.xp6(2),s.Q6J("matMenuTriggerFor",t),s.xp6(31),s.Q6J("matMenuTriggerFor",e),s.xp6(47),s.Q6J("matMenuTriggerFor",n),s.xp6(16),s.ekj("active",i.queryCommandState("justifyLeft")),s.Q6J("matTooltip",s.lcZ(97,18,"Align Left")),s.xp6(3),s.ekj("active",i.queryCommandState("justifyCenter")),s.Q6J("matTooltip",s.lcZ(100,20,"Center")),s.xp6(3),s.ekj("active",i.queryCommandState("justifyRight")),s.Q6J("matTooltip",s.lcZ(103,22,"Align Right")),s.xp6(4),s.Q6J("matTooltip",s.lcZ(107,24,"Decrease Indent")),s.xp6(3),s.Q6J("matTooltip",s.lcZ(110,26,"Increase Indent")),s.xp6(4),s.ekj("active","visual"===i.activeEditor),s.xp6(2),s.ekj("active","source"===i.activeEditor)}}const L=[[["","customButtons",""]],[["","header",""]],[["","footer",""]]],F=["[customButtons]","[header]","[footer]"];let E=(()=>{class t{constructor(t,e,n,i,a,o,r,l){this.editor=t,this.currentUser=e,this.uploadQueue=n,this.settings=i,this.renderer=a,this.el=o,this.overlayPanel=r,this.imageValidator=l,this.sourceAreaControl=new b.NI,this.activeEditor="visual",this.showAdvancedControls=!1,this.basic=!1,this.minHeight=183,this.maxHeight=530,this.onChange=new s.vpe,this.onCtrlEnter=new s.vpe,this.onFileUpload=new s.vpe}ngAfterViewInit(){this.bootTextEditor()}ngOnDestroy(){this.destroyEditor()}reset(){this.editor.reset()}focus(){this.editor.focus()}hasUndo(){return this.editor.hasUndo()}hasRedo(){return this.editor.hasRedo()}queryCommandState(t){return this.editor.queryCommandState(t)}execCommand(t,e=null){this.editor.execCommand(t,e)}insertInfoContainer(t){this.insertContents(`<div class="widget widget-${t}"><div class="title">${(0,f.z)(t)}:</div><br></div><br>`)}showColorPicker(t,e){return(0,o.mG)(this,void 0,void 0,function*(){const{BeColorPickerModule:i}=yield n.e(378).then(n.bind(n,49378));this.overlayPanel.open(i.components.panel,{origin:new s.SBq(e),position:m.x}).valueChanged().pipe((0,v.b)(50)).subscribe(e=>{this.execCommand(t,e)})})}showVisualEditor(){this.editor.tinymceInstance.contentAreaContainer&&"visual"!==this.activeEditor&&(this.activeEditor="visual",this.renderer.setStyle(this.editor.tinymceInstance.contentAreaContainer,"display","block"),this.renderer.setStyle(this.sourceTextArea.nativeElement,"display","none"),this.editor.focus())}showSourceEditor(){this.editor.tinymceInstance.contentAreaContainer&&"source"!==this.activeEditor&&(this.activeEditor="source",this.renderer.setStyle(this.sourceTextArea.nativeElement,"height",this.editor.tinymceInstance.contentAreaContainer.offsetHeight+"px"),this.renderer.setStyle(this.sourceTextArea.nativeElement,"display","block"),this.renderer.setStyle(this.editor.tinymceInstance.contentAreaContainer,"display","none"),this.sourceAreaControl.setValue(this.editor.getContents({source_view:!0})))}openFileUploadDialog(){(0,p.r)({multiple:!0}).then(t=>{this.onFileUpload.emit(t)})}openInsertImageModal(){const t={uri:_.C.Image,validator:this.imageValidator,httpParams:{diskPrefix:this.inlineUploadPrefix}};(0,p.r)({types:[h.j.image]}).then(e=>{this.uploadQueue.start(e,t).subscribe(t=>{this.insertImage(t.fileEntry.url)})})}getContents(){return this.editor.getContents()}setContents(t){this.editor.setContents(t)}insertContents(t){this.editor.insertContents(t)}insertImage(t){this.editor.insertImage(t)}insertLink(t){this.insertContents(`<a href="${t.href}" target="${t.target||"self"}">${t.text}</a>`)}destroyEditor(){this.editor.destroyEditor()}bootTextEditor(){this.editor.setConfig({textAreaEl:this.visualTextArea,editorEl:this.el,minHeight:this.minHeight,maxHeight:this.maxHeight,onChange:this.onChange,onCtrlEnter:this.onCtrlEnter,showAdvancedControls:this.showAdvancedControls})}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(u),s.Y36(Z.I),s.Y36(g.A),s.Y36(r.Z),s.Y36(s.Qsj),s.Y36(s.SBq),s.Y36(x.T),s.Y36(T))},t.\u0275cmp=s.Xpm({type:t,selectors:[["text-editor"]],viewQuery:function(t,e){if(1&t&&(s.Gf(J,7),s.Gf(P,7)),2&t){let t;s.iGM(t=s.CRH())&&(e.visualTextArea=t.first),s.iGM(t=s.CRH())&&(e.sourceTextArea=t.first)}},inputs:{showAdvancedControls:"showAdvancedControls",basic:"basic",minHeight:"minHeight",maxHeight:"maxHeight",inlineUploadPrefix:"inlineUploadPrefix"},outputs:{onChange:"onChange",onCtrlEnter:"onCtrlEnter",onFileUpload:"onFileUpload"},features:[s._Bn([g.A,u])],ngContentSelectors:F,decls:41,vars:47,consts:[[1,"editor-header"],[1,"toolbar-row"],["class","header-actions",4,"ngIf"],[1,"header-actions"],["type","button",1,"no-style","editor-button",3,"matTooltip","click"],["svgIcon","undo"],["svgIcon","redo"],["svgIcon","format-bold"],["svgIcon","format-italic"],["svgIcon","format-underlined"],["svgIcon","format-list-bulleted"],["svgIcon","format-list-numbered"],[1,"header-actions","last"],["svgIcon","format-clear"],["class","toolbar-row",4,"ngIf"],["rows","8",1,"source-textarea",2,"display","none",3,"formControl","blur"],["sourceArea",""],["rows","8",1,"visual-textarea"],["visualArea",""],["svgIcon","attachment"],["svgIcon","code"],["svgIcon","link"],["type","button","class","no-style editor-button image-modal-button",3,"matTooltip","click",4,"ngIf"],["type","button",1,"no-style","editor-button","image-modal-button",3,"matTooltip","click"],["svgIcon","image"],["type","button",1,"no-style","editor-button","text-button","insert-button",3,"matMenuTriggerFor"],["trans",""],["svgIcon","arrow-drop-down",1,"caret"],["insertMenu",""],["mat-menu-item","",3,"click"],["svgIcon","remove"],["svgIcon","videocam"],["mat-menu-item","","trans","",3,"click"],["svgIcon","star"],["svgIcon","warning"],["svgIcon","note"],["type","button",1,"no-style","editor-button","text-button","format-button",3,"matMenuTriggerFor"],[1,"format-menu","menu-with-alt-text"],["formatMenu",""],["trans","",1,"text"],[1,"alt-text"],["type","button",1,"no-style","editor-button","text-button","color-button",3,"matMenuTriggerFor"],["colorPickerOrigin",""],[1,"color-dropdown"],["colorMenu",""],["mat-menu-item","",1,"text-color-item",3,"click"],["svgIcon","format-color-text"],["mat-menu-item","",1,"bg-color-item",3,"click"],["svgIcon","format-color-fill"],["svgIcon","format-align-left"],["svgIcon","format-align-center"],["svgIcon","format-align-right"],["svgIcon","format-indent-decrease"],["svgIcon","format-indent-increase"],[1,"header-actions","editor-toggle-buttons"],["type","button","trans","",1,"no-style","editor-button","visual-mode-button",3,"click"],["type","button","trans","",1,"no-style","editor-button","source-mode-button",3,"click"]],template:function(t,e){1&t&&(s.F$t(L),s.TgZ(0,"div",0),s.TgZ(1,"div",1),s.YNc(2,N,4,3,"div",2),s.YNc(3,S,4,3,"div",2),s.TgZ(4,"div",3),s.TgZ(5,"button",4),s.NdJ("click",function(){return e.execCommand("undo")}),s.ALo(6,"trans"),s._UZ(7,"mat-icon",5),s.qZA(),s.TgZ(8,"button",4),s.NdJ("click",function(){return e.execCommand("redo")}),s.ALo(9,"trans"),s._UZ(10,"mat-icon",6),s.qZA(),s.qZA(),s.TgZ(11,"div",3),s.TgZ(12,"button",4),s.NdJ("click",function(){return e.execCommand("bold")}),s.ALo(13,"trans"),s._UZ(14,"mat-icon",7),s.qZA(),s.TgZ(15,"button",4),s.NdJ("click",function(){return e.execCommand("italic")}),s.ALo(16,"trans"),s._UZ(17,"mat-icon",8),s.qZA(),s.TgZ(18,"button",4),s.NdJ("click",function(){return e.execCommand("underline")}),s.ALo(19,"trans"),s._UZ(20,"mat-icon",9),s.qZA(),s.qZA(),s.TgZ(21,"div",3),s.TgZ(22,"button",4),s.NdJ("click",function(){return e.execCommand("insertunorderedlist")}),s.ALo(23,"trans"),s._UZ(24,"mat-icon",10),s.qZA(),s.TgZ(25,"button",4),s.NdJ("click",function(){return e.execCommand("insertorderedlist")}),s.ALo(26,"trans"),s._UZ(27,"mat-icon",11),s.qZA(),s.qZA(),s.YNc(28,Q,5,6,"div",2),s.Hsn(29),s.TgZ(30,"div",12),s.TgZ(31,"button",4),s.NdJ("click",function(){return e.execCommand("removeformat")}),s.ALo(32,"trans"),s._UZ(33,"mat-icon",13),s.qZA(),s.qZA(),s.Hsn(34,1),s.qZA(),s.YNc(35,Y,117,28,"div",14),s.qZA(),s.TgZ(36,"textarea",15,16),s.NdJ("blur",function(){return e.setContents(e.sourceAreaControl.value)}),s.qZA(),s._UZ(38,"textarea",17,18),s.Hsn(40,2)),2&t&&(s.xp6(2),s.Q6J("ngIf",e.inlineUploadPrefix&&e.currentUser.hasPermission("files.create")&&e.onFileUpload.observers.length),s.xp6(1),s.Q6J("ngIf",!e.basic),s.xp6(2),s.ekj("disabled",!e.hasUndo()),s.Q6J("matTooltip",s.lcZ(6,31,"Undo")),s.xp6(3),s.ekj("disabled",!e.hasRedo()),s.Q6J("matTooltip",s.lcZ(9,33,"Redo")),s.xp6(4),s.ekj("active",e.queryCommandState("bold")),s.Q6J("matTooltip",s.lcZ(13,35,"Bold")),s.xp6(3),s.ekj("active",e.queryCommandState("italic")),s.Q6J("matTooltip",s.lcZ(16,37,"Italic")),s.xp6(3),s.ekj("active",e.queryCommandState("underline")),s.Q6J("matTooltip",s.lcZ(19,39,"Underline")),s.xp6(4),s.ekj("active",e.queryCommandState("unorderedlist")),s.Q6J("matTooltip",s.lcZ(23,41,"Unordered List")),s.xp6(3),s.ekj("active",e.queryCommandState("orderedlist")),s.Q6J("matTooltip",s.lcZ(26,43,"Ordered List")),s.xp6(3),s.Q6J("ngIf",!e.basic),s.xp6(3),s.Q6J("matTooltip",s.lcZ(32,45,"Remove Formatting")),s.xp6(4),s.Q6J("ngIf",e.showAdvancedControls),s.xp6(1),s.Udp("min-height",e.minHeight),s.Q6J("formControl",e.sourceAreaControl),s.xp6(2),s.Udp("min-height",e.minHeight))},directives:[C.O5,q.gM,U.Hw,b.Fj,b.JJ,b.oH,I.p6,M.P,I.VK,I.OP],pipes:[O.R],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:218px;max-height:600px;position:relative;border:1px solid var(--be-divider-default);border-radius:4px;overflow:hidden}[_nghost-%COMP%]     .editor-button{color:#788593;padding:7px;width:36px;height:36px}[_nghost-%COMP%]     .editor-button .mat-icon{height:22px;width:22px}[_nghost-%COMP%]     .editor-button .caret{display:inline-block;width:20px;height:20px;vertical-align:middle}[_nghost-%COMP%]     .editor-button.text-button{display:block;font-weight:300;font-size:1.5rem;width:auto}[_nghost-%COMP%]     .editor-button.disabled{opacity:.4}[_nghost-%COMP%]     .editor-button.active{background-color:rgba(0,0,0,.04)}[_nghost-%COMP%]     .editor-button.success{color:var(--be-accent-default)}[_nghost-%COMP%]     .editor-button:hover{background-color:rgba(0,0,0,.04)}[_nghost-%COMP%]     .editor-footer{position:relative;height:37px;flex-shrink:0;background-color:var(--be-background-alternative);border-top:1px solid var(--be-divider-default)}textarea[_ngcontent-%COMP%]{border:none;outline:none;resize:none;padding:15px}.editor-header[_ngcontent-%COMP%]{clear:both;flex:0 0 37px;background-color:var(--be-background-alternative)}.toolbar-row[_ngcontent-%COMP%]{display:flex;height:37px;border-bottom:1px solid var(--be-divider-default);overflow:hidden}  .header-actions{display:inline-block;border-right:1px solid var(--be-divider-default);height:100%;padding:0 4px}  .header-actions.right{margin-left:auto;margin-right:7px}  .header-actions.last{border-right:none}.editor-toggle-buttons[_ngcontent-%COMP%]{border-right:none;margin-left:auto;padding:0;display:flex}.editor-toggle-buttons[_ngcontent-%COMP%]   .editor-button[_ngcontent-%COMP%]{width:auto}@media only screen and (max-width:768px){.toolbar-row[_ngcontent-%COMP%]{overflow-x:auto}}"],changeDetection:0}),t})();var R=n(78512),$=n(43835),V=n(98720),B=n(40694),H=n(38053),z=n(63337),G=n(73234),j=n(79572),X=n(84369),W=n(42300),K=n(29738);function tt(t,e){if(1&t&&(s.TgZ(0,"div",19),s._uU(1),s.qZA()),2&t){const t=s.oxw().ngIf;s.xp6(1),s.Oqu(t.title)}}function et(t,e){if(1&t&&(s.TgZ(0,"div",19),s._uU(1),s.qZA()),2&t){const t=s.oxw(2).ngIf;s.xp6(1),s.Oqu(t.slug)}}function nt(t,e){if(1&t&&(s.TgZ(0,"div",20),s._UZ(1,"slug-control",21),s.YNc(2,et,2,1,"div",6),s.qZA()),2&t){const t=s.oxw().ngIf,e=s.oxw();s.xp6(1),s.Q6J("prefix",e.slugPrefix()),s.xp6(1),s.Q6J("ngIf",t.slug)}}function it(t,e){1&t&&(s.TgZ(0,"span",10),s._uU(1,"Update"),s.qZA())}function at(t,e){1&t&&(s.TgZ(0,"span",10),s._uU(1,"Create"),s.qZA())}function ot(t,e){if(1&t&&(s.TgZ(0,"div",19),s._uU(1),s.qZA()),2&t){const t=s.oxw().ngIf;s.xp6(1),s.Oqu(t.body)}}function st(t,e){if(1&t){const t=s.EpF();s.ynx(0,1),s.TgZ(1,"div",2),s.TgZ(2,"div",3),s.TgZ(3,"label",4),s._uU(4,"Page Title"),s.qZA(),s._UZ(5,"input",5),s.YNc(6,tt,2,1,"div",6),s.qZA(),s.YNc(7,nt,3,2,"div",7),s.TgZ(8,"div",8),s.TgZ(9,"mat-slide-toggle",9),s._uU(10,"Hide Navbar"),s.qZA(),s.TgZ(11,"p",10),s._uU(12,"Whether default site navbar should be hidden for this page."),s.qZA(),s.qZA(),s.qZA(),s.TgZ(13,"div",11),s.TgZ(14,"button",12),s.NdJ("click",function(){return s.CHM(t),s.oxw().crupdatePage()}),s.YNc(15,it,2,0,"span",13),s.YNc(16,at,2,0,"span",13),s.qZA(),s.TgZ(17,"a",14),s._uU(18,"Cancel"),s.qZA(),s.qZA(),s.TgZ(19,"div",15),s.YNc(20,ot,2,1,"div",6),s.qZA(),s.TgZ(21,"div",16),s.TgZ(22,"text-editor",17),s.NdJ("onChange",function(e){return s.CHM(t),s.oxw().setBody(e)}),s.qZA(),s.qZA(),s._UZ(23,"loading-indicator",18),s.ALo(24,"async"),s.BQk()}if(2&t){const t=e.ngIf,n=s.oxw();s.Q6J("formGroup",n.form),s.xp6(6),s.Q6J("ngIf",t.title),s.xp6(1),s.Q6J("ngIf",!n.hideSlug),s.xp6(8),s.Q6J("ngIf",n.page),s.xp6(1),s.Q6J("ngIf",!n.page),s.xp6(1),s.Q6J("routerLink",n.backRoute()),s.xp6(3),s.Q6J("ngIf",t.body),s.xp6(2),s.Q6J("showAdvancedControls",!0),s.xp6(1),s.Q6J("isVisible",s.lcZ(24,9,n.loading$))}}let rt=(()=>{class t{constructor(t,e,n,i,a){this.pages=t,this.route=e,this.toast=n,this.router=i,this.fb=a,this.hideSlug=this.route.snapshot.data.hideSlug,this.endpoint=this.route.snapshot.data.endpoint,this.loading$=new R.X(!1),this.updating$=new R.X(!1),this.form=this.fb.group({title:[""],slug:[""],body:[""],type:[""],hide_nav:[!1]}),this.errors$=new R.X({})}ngOnInit(){var t;this.route.params.subscribe(t=>{this.getPage(t.id)}),this.route.snapshot.data.hideSlug||(t=this.form.get("title")).valueChanges.pipe((0,$.h)(t=>!!t),(0,V.x)()).subscribe(e=>{t.parent.get("slug").dirty||t.parent.get("slug").setValue((0,B.V)(e))})}crupdatePage(){this.loading$.next(!0),(this.updating$.value?this.pages.update(this.page.id,this.getPayload(),this.endpoint):this.pages.create(this.getPayload(),this.endpoint)).pipe((0,i.x)(()=>this.loading$.next(!1))).subscribe(()=>{this.router.navigate(this.backRoute(),{relativeTo:this.route}),this.toast.open(this.updating$.value?"Page updated":"Page created")},t=>this.errors$.next(t.errors))}getPage(t){t&&(this.loading$.next(!0),this.pages.get(t).pipe((0,a.g)(0)).subscribe(t=>{this.updating$.next(!0),this.page=t.page,this.form.patchValue(t.page),this.textEditor.setContents(t.page.body||""),this.loading$.next(!1)}))}getPayload(){return Object.assign({},this.form.value)}setBody(t){this.form.patchValue({body:t})}backRoute(){return this.page?["../../"]:["../"]}slugPrefix(){return"pages/"+(this.page?this.page.id:"*")}}return t.\u0275fac=function(e){return new(e||t)(s.Y36(H.i),s.Y36(z.gz),s.Y36(G.F),s.Y36(z.F0),s.Y36(b.qu))},t.\u0275cmp=s.Xpm({type:t,selectors:[["crupdate-page"]],viewQuery:function(t,e){if(1&t&&s.Gf(E,5),2&t){let t;s.iGM(t=s.CRH())&&(e.textEditor=t.first)}},decls:2,vars:3,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],[1,"many-inputs","input-header"],[1,"input-container"],["for","page-title","trans",""],["type","text","id","page-title","formControlName","title"],["class","error",4,"ngIf"],["class","input-container slug-input-container",4,"ngIf"],[1,"setting-toggle-container"],["id","crupdate_custom_page.hideNav","formControlName","hide_nav","trans",""],["trans",""],[1,"actions"],["mat-raised-button","","color","accent",3,"click"],["trans","",4,"ngIf"],["mat-button","","trans","",3,"routerLink"],[1,"errors"],[1,"editor-container"],["inlineUploadPrefix","page_media","minHeight","auto",1,"text-editor",3,"showAdvancedControls","onChange"],[1,"overlay",3,"isVisible"],[1,"error"],[1,"input-container","slug-input-container"],["formControlName","slug",3,"prefix"]],template:function(t,e){1&t&&(s.YNc(0,st,25,11,"ng-container",0),s.ALo(1,"async")),2&t&&s.Q6J("ngIf",s.lcZ(1,1,e.errors$))},directives:[C.O5,b.JL,b.sg,M.P,b.Fj,b.JJ,b.u,j.Rr,X.lW,X.zs,z.yS,E,W.Q,K.b],pipes:[C.Ov],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:calc(100vh - 120px);overflow:hidden}.input-container[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{background-color:var(--be-background)}.actions[_ngcontent-%COMP%]{margin-bottom:25px;flex-shrink:0}.errors[_ngcontent-%COMP%]{color:#f44336;flex-shrink:0}.errors[_ngcontent-%COMP%]   .error[_ngcontent-%COMP%]{padding:5px 0}.editor-container[_ngcontent-%COMP%]{flex:1 1 auto}text-editor[_ngcontent-%COMP%]{max-height:none}"],changeDetection:0}),t})()},4954:function(t,e,n){"use strict";n.d(e,{I:function(){return s}});var i=n(59075),a=n(44415),o=n(45523);const s=[new o.yH({description:"Date the page was last updated"}),new o.T7({description:"Date the page was created"}),new i.XQ({type:i.Bq.SelectModel,key:"user_id",label:"User",description:"User page was created by",component:a.y})]},47878:function(t,e,n){"use strict";n.d(e,{k:function(){return _}});var i=n(61116),a=n(51685),o=n(77307),s=n(84369),r=n(24311),l=n(68400),c=n(63337),d=n(50615),u=n(58666),p=n(31041),g=n(29828),h=n(90164),m=n(99808),f=n(79572),b=n(27701),v=n(35366);let _=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=v.oAB({type:t}),t.\u0275inj=v.cJS({imports:[[i.ez,c.Bz,a.x,l.N,d.X,u.u,h.y,m.p,p.u5,p.UX,g.I,o.Ps,s.ot,r.AV,f.rP,b.Cv]]}),t})()},98034:function(t,e,n){"use strict";n.d(e,{c:function(){return D}});var i=n(38053),a=n(36024),o=n(56515),s=n(4954),r=n(35366),l=n(88195),c=n(28505),d=n(73234),u=n(63337),p=n(38116),g=n(34955),h=n(61116),m=n(13536),f=n(80922),b=n(86668),v=n(84369),_=n(77307),Z=n(27701),x=n(54275),y=n(71765),A=n(24311),w=n(47210),k=n(2406),T=n(40450);function C(t,e){1&t&&(r.TgZ(0,"a",17),r._UZ(1,"mat-icon",18),r.TgZ(2,"span",1),r._uU(3,"Add New Page"),r.qZA(),r.qZA())}function q(t,e){1&t&&r._UZ(0,"mat-progress-bar",19)}function U(t,e){1&t&&(r.TgZ(0,"th",20),r._uU(1,"Type"),r.qZA())}const I=function(t){return{count:t,resource:"page(s)"}};function M(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"tr"),r.TgZ(1,"th",21),r.TgZ(2,"div",22),r._uU(3," :count :resource selected: "),r.qZA(),r.TgZ(4,"div",23),r.TgZ(5,"button",24),r.NdJ("click",function(){return r.CHM(t),r.oxw().maybeDeleteSelectedPages()}),r._uU(6," Delete "),r.qZA(),r.qZA(),r.qZA(),r.qZA()}if(2&t){const t=e.ngIf;r.xp6(2),r.Q6J("transValues",r.VKq(1,I,t))}}function O(t,e){if(1&t&&(r.TgZ(0,"td",37),r._uU(1),r.qZA()),2&t){const t=r.oxw().$implicit,e=r.oxw();r.xp6(1),r.hij(" ",t.type?e.viewName(t.type):"default"," ")}}const J=function(t){return[t,"edit"]};function P(t,e){if(1&t&&(r.TgZ(0,"a",38),r.ALo(1,"trans"),r._UZ(2,"mat-icon",39),r.qZA()),2&t){const t=r.oxw().$implicit;r.Q6J("routerLink",r.VKq(4,J,t.id))("matTooltip",r.lcZ(1,2,"Edit page"))}}function N(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"tr"),r._UZ(1,"td",25),r.TgZ(2,"td",26),r.TgZ(3,"a",27),r._uU(4),r.qZA(),r.qZA(),r.TgZ(5,"td",28),r._UZ(6,"user-column",29),r.qZA(),r.TgZ(7,"td",30),r._uU(8),r.qZA(),r.YNc(9,O,2,1,"td",31),r.TgZ(10,"td",32),r._uU(11),r.ALo(12,"formattedDate"),r.qZA(),r.TgZ(13,"td",33),r.YNc(14,P,3,6,"a",34),r.TgZ(15,"button",35),r.NdJ("click",function(){const e=r.CHM(t).$implicit;return r.oxw().maybeDeleteSelectedPages([e.id])}),r._UZ(16,"mat-icon",36),r.qZA(),r.qZA(),r.qZA()}if(2&t){const t=e.$implicit,n=r.oxw();r.xp6(1),r.Q6J("table-body-checkbox",t.id),r.xp6(2),r.Q6J("href",n.getPageUrl(t),r.LSH),r.xp6(1),r.Oqu(t.slug),r.xp6(2),r.Q6J("user",t.user),r.xp6(2),r.Oqu(t.body),r.xp6(1),r.Q6J("ngIf",!n.endpoint),r.xp6(2),r.Oqu(r.lcZ(12,8,t.updated_at)),r.xp6(3),r.Q6J("ngIf",n.currentUser.hasPermission("custom_pages.update"))}}function S(t,e){1&t&&(r.TgZ(0,"no-results-message",40),r.TgZ(1,"span",41),r._uU(2,"No pages have been created yet"),r.qZA(),r.qZA())}let D=(()=>{class t{constructor(t,e,n,i,a,o,r){this.settings=t,this.datatable=e,this.currentUser=n,this.customPages=i,this.toast=a,this.router=o,this.route=r,this.endpoint=this.route.snapshot.data.endpoint,this.filters=s.I,this.pages$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:this.endpoint||i.i.BASE_URI,staticParams:{with:["user"]}})}maybeDeleteSelectedPages(t){this.datatable.confirmResourceDeletion("tracking pixels").subscribe(()=>{this.customPages.delete(t||this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Pages deleted")},t=>{this.toast.open(t.message||a.v.Default)})})}showUserColumn(){return this.router.url.indexOf("admin")>-1}getPageUrl(t){return this.settings.getBaseUrl()+"/pages/"+t.id+"/"+t.slug}viewName(t){return t.replace(/_/g," ")}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(l.Z),r.Y36(o.x),r.Y36(c.I),r.Y36(i.i),r.Y36(d.F),r.Y36(u.F0),r.Y36(u.gz))},t.\u0275cmp=r.Xpm({type:t,selectors:[["custom-pages-index"]],features:[r._Bn([o.x])],decls:32,vars:13,consts:[[1,"datatable-page-header"],["trans",""],[1,"header"],["pluralName","pages",3,"filters"],[1,"action-buttons"],["mat-raised-button","","color","accent","routerLink","new","class","button-with-icon",4,"ngIf"],[1,"datatable","responsive-table"],["class","loading-bar","mode","indeterminate","color","accent",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","user_id","trans",""],["trans","",1,"body-column"],["class","type-column","table-sort-header","","trans","",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],["svgImage","custom-page.svg",4,"ngIf"],["mat-raised-button","","color","accent","routerLink","new",1,"button-with-icon"],["svgIcon","add"],["mode","indeterminate","color","accent",1,"loading-bar"],["table-sort-header","","trans","",1,"type-column"],["colspan","7"],["trans","",1,"bulk-actions-title",3,"transValues"],[1,"bulk-actions"],["type","button","mat-raised-button","","color","warn","trans","",3,"click"],[3,"table-body-checkbox"],["data-label","Slug"],["target","_blank",3,"href"],["data-label","Owner"],[3,"user"],["data-label","Body",1,"body-column"],["data-label","Type","class","type-column",4,"ngIf"],["data-label","Last Updated"],[1,"edit-column"],["mat-icon-button","",3,"routerLink","matTooltip",4,"ngIf"],["type","button","mat-icon-button","","trans","",3,"click"],["svgIcon","delete"],["data-label","Type",1,"type-column"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","edit"],["svgImage","custom-page.svg"],["primary-text","","trans",""]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r.TgZ(1,"h1",1),r.TgZ(2,"span",1),r._uU(3,"Custom Pages"),r.qZA(),r.qZA(),r.TgZ(4,"div",2),r._UZ(5,"datatable-filters",3),r.TgZ(6,"div",4),r.YNc(7,C,4,0,"a",5),r.qZA(),r.qZA(),r.qZA(),r.TgZ(8,"div",6),r.YNc(9,q,1,0,"mat-progress-bar",7),r.ALo(10,"async"),r.TgZ(11,"table",8),r.TgZ(12,"thead"),r.TgZ(13,"tr"),r._UZ(14,"th",9),r.TgZ(15,"th",10),r._uU(16,"Slug"),r.qZA(),r.TgZ(17,"th",11),r._uU(18,"Owner"),r.qZA(),r.TgZ(19,"th",12),r._uU(20,"Body"),r.qZA(),r.YNc(21,U,2,0,"th",13),r.TgZ(22,"th",1),r._uU(23,"Last Updated"),r.qZA(),r._UZ(24,"th"),r.qZA(),r.YNc(25,M,7,3,"tr",14),r.qZA(),r.TgZ(26,"tbody"),r.YNc(27,N,17,10,"tr",15),r.ALo(28,"async"),r.qZA(),r.qZA(),r.YNc(29,S,3,0,"no-results-message",16),r.ALo(30,"async"),r._UZ(31,"datatable-footer"),r.qZA()),2&t&&(r.xp6(5),r.Q6J("filters",e.filters),r.xp6(2),r.Q6J("ngIf",e.currentUser.hasPermission("custom_pages.create")),r.xp6(2),r.Q6J("ngIf",r.lcZ(10,7,e.datatable.paginator&&e.datatable.paginator.loading$)),r.xp6(12),r.Q6J("ngIf",!e.endpoint),r.xp6(4),r.Q6J("ngIf",e.datatable.selectedRows$.value.length),r.xp6(2),r.Q6J("ngForOf",r.lcZ(28,9,e.pages$)),r.xp6(2),r.Q6J("ngIf",r.lcZ(30,11,e.datatable.paginator.noResults$)))},directives:[p.P,g.h,h.O5,m.e,f.p,h.sg,b.V,v.zs,u.yS,_.Hw,Z.pW,v.lW,x.O,y.r,A.gM,w.U],pipes:[h.Ov,k.l,T.R],styles:[".body-column[_ngcontent-%COMP%]{margin-right:25px;overflow:hidden}.type-column[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),t})()},83927:function(t,e,n){"use strict";n.d(e,{T:function(){return s}});var i=n(74899),a=n(35366),o=n(3950);let s=(()=>{class t{constructor(t){this.i18n=t}getFullPlanName(){if(!this.plan)return;let t=this.plan.parent?this.plan.parent.name:this.plan.name;return t=(0,i.z)(this.i18n.t(t)),t+=" "+this.i18n.t("Plan"),this.plan.parent&&(t+=": "+this.plan.name),t}}return t.\u0275fac=function(e){return new(e||t)(a.Y36(o.Z))},t.\u0275cmp=a.Xpm({type:t,selectors:[["full-plan-name"]],inputs:{plan:"plan"},decls:1,vars:1,template:function(t,e){1&t&&a._uU(0),2&t&&a.Oqu(e.getFullPlanName())},encapsulation:2,changeDetection:0}),t})()},60214:function(t,e,n){"use strict";n.d(e,{J:function(){return a}});var i=n(35366);let a=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i.oAB({type:t}),t.\u0275inj=i.cJS({}),t})()},6153:function(t,e,n){"use strict";n.d(e,{Y:function(){return s}});var i=n(35366),a=n(88195),o=n(63337);let s=(()=>{class t{constructor(t,e){this.settings=t,this.router=e}canActivate(t,e){return this.handle()}canActivateChild(t,e){return this.handle()}handle(){return!(!this.settings.get("billing.integrated")||!this.settings.get("billing.enable"))||(this.router.navigate(["/"]),!1)}}return t.\u0275fac=function(e){return new(e||t)(i.LFG(a.Z),i.LFG(o.F0))},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},33427:function(t,e,n){"use strict";n.d(e,{o:function(){return o}});var i=n(35366),a=n(68515);let o=(()=>{class t{constructor(t){this.http=t}all(e){return this.http.get(t.BASE_URI,e)}get(e){return this.http.get(`${t.BASE_URI}/${e}`)}create(e){return this.http.post(t.BASE_URI,e)}update(e,n){return this.http.put(`${t.BASE_URI}/${e}`,n)}delete(e){return this.http.delete(`${t.BASE_URI}/${e}`)}sync(){return this.http.post(`${t.BASE_URI}/sync`)}}return t.BASE_URI="billing-plan",t.\u0275fac=function(e){return new(e||t)(i.LFG(a.r))},t.\u0275prov=i.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},83693:function(t,e,n){"use strict";n.d(e,{o:function(){return i},P:function(){return a}});var i=function(t){return t.LINE="line",t.PIE="pie",t.BAR="bar",t}({});class a{constructor(t){this.config=t,setTimeout(()=>this.generate())}getMaxValue(){return this.config.data?Array.isArray(this.config.data[0])?Math.max(...this.config.data[0],...this.config.data[1]||[]):Math.max(...this.config.data):0}generateDataWithTooltip(t){return this.config.tooltip?t.map(t=>({value:t,meta:this.config.tooltip})):t}isEmpty(){return this.getMaxValue()<=0}}},92007:function(t,e,n){"use strict";n.d(e,{x:function(){return A}});var i=n(83693),a=n(45059),o=n.n(a),s=n(88636),r=n.n(s);class l extends i.P{constructor(){super(...arguments),this.lineConfig={showArea:!0,lineSmooth:!0,low:0,fullWidth:!0,chartPadding:{left:15,right:30},axisY:{labelInterpolationFnc:t=>Math.floor(t)},plugins:[r()()]}}generate(){const t=Object.assign(Object.assign(Object.assign({},this.lineConfig),{high:this.getHigh()}),this.config.options||{});this.chart=new(o().Line)(this.config.selector,this.transformChartData(),t),this.chart.on("draw",t=>{"line"!==t.type&&"area"!==t.type||t.element.animate({d:{begin:t.index,dur:250,from:t.path.clone().scale(1,0).translate(0,t.chartRect.height()).stringify(),to:t.path.clone().stringify(),easing:o().Svg.Easing.easeOutQuint}})})}transformChartData(){return{labels:this.config.labels,series:this.config.data.map(t=>this.generateDataWithTooltip(t||[]))}}getHigh(){return this.getMaxValue()?void 0:100}destroy(){this.chart&&(this.chart.off("draw"),this.chart.detach())}}class c extends i.P{constructor(){super(...arguments),this.pieConfig={showLabel:!1,chartPadding:0,plugins:[r()()]}}generate(){const t=Object.assign(Object.assign({},this.pieConfig),this.config.options||{});this.chart=new(o().Pie)(this.config.selector,this.transformChartData(),t),this.animate()}transformChartData(){return{labels:this.config.labels,series:this.generateDataWithTooltip(this.config.data)}}destroy(){this.chart&&(this.chart.off("draw"),this.chart.detach())}animate(){this.chart.on("draw",t=>{if("slice"===t.type){const e=t.element._node.getTotalLength();t.element.attr({"stroke-dasharray":e+"px "+e+"px"});const n={"stroke-dashoffset":{id:"anim"+t.index,dur:300*t.value/t.totalDataSum,from:-e+"px",to:"0px",fill:"freeze"}};if(0!==t.index&&(n["stroke-dashoffset"].begin="anim"+(t.index-1)+".end"),t.element.attr({"stroke-dashoffset":-e+"px"}),t.element.animate(n,!1),360===t.endAngle){let n=t.index,i=1e3*t.value/t.totalDataSum/2,a=0,o=-e/3;for(let e=0;e<4;e++){t.element.animate({"stroke-dashoffset":{id:"anim"+(n+1),dur:i,from:a+"px",to:o+"px",fill:"freeze",begin:"anim"+n+".end"}},!1),n++,i/=1.75;const e=a;a=o,o=e/2.5}}}})}}class d extends i.P{constructor(){super(...arguments),this.barConfig={chartPadding:{left:15,right:30},plugins:[r()()]}}generate(){const t=Object.assign(Object.assign(Object.assign({},this.barConfig),this.config.options||{}),{high:this.getHigh()});this.chart=new(o().Bar)(this.config.selector,this.transformChartData(),t),this.chart.on("draw",function(t){"bar"===t.type&&t.element.animate({y2:{dur:"0.2s",from:t.y1,to:t.y2}})})}transformChartData(){return{labels:this.config.labels,series:this.config.data.map(t=>this.generateDataWithTooltip(t||[]))}}getHigh(){return this.getMaxValue()?void 0:100}destroy(){this.chart&&(this.chart.off("draw"),this.chart.detach())}}var u=n(35366),p=n(61116),g=n(77307),h=n(38116);const m=["headerWrapper"],f=["legendWrapper"],b=["chartPlaceholder"];function v(t,e){1&t&&(u.TgZ(0,"div",7),u._UZ(1,"mat-icon",8),u.TgZ(2,"span",9),u._uU(3,"No data available for this time period."),u.qZA(),u.qZA())}function _(t,e){if(1&t&&(u.TgZ(0,"div",12),u._uU(1),u.qZA()),2&t){const t=e.$implicit;u.xp6(1),u.Oqu(t)}}function Z(t,e){if(1&t&&(u.TgZ(0,"div",10),u.YNc(1,_,2,1,"div",11),u.qZA()),2&t){const t=u.oxw();u.xp6(1),u.Q6J("ngForOf",t.chartConfig.labels)}}const x=[[["",8,"chart-header"]],[["",8,"chart-legend"]]],y=[".chart-header",".chart-legend"];let A=(()=>{class t{constructor(t){this.el=t}ngOnInit(){this.calcAndSetChartHeight()}ngOnChanges(){this.chartConfig&&(this.chart=this.chartConfig.type===i.o.LINE?new l(this.transformConfig()):this.chartConfig.type===i.o.BAR?new d(this.transformConfig()):new c(this.transformConfig()))}ngOnDestroy(){this.chart&&this.chart.destroy()}transformConfig(){return Object.assign(Object.assign({},this.chartConfig),{selector:this.chartPlaceholder.nativeElement})}calcAndSetChartHeight(){let t=this.height;this.headerWrapper.nativeElement.children.length&&(t-=66),(this.chartConfig&&this.chartConfig.legend||this.legendWrapper.nativeElement.children.length)&&(t-=40),this.el.nativeElement.style.height=this.height+"px",this.chartPlaceholder.nativeElement.style.height=t-15+"px"}}return t.\u0275fac=function(e){return new(e||t)(u.Y36(u.SBq))},t.\u0275cmp=u.Xpm({type:t,selectors:[["chart"]],viewQuery:function(t,e){if(1&t&&(u.Gf(m,7),u.Gf(f,7),u.Gf(b,7)),2&t){let t;u.iGM(t=u.CRH())&&(e.headerWrapper=t.first),u.iGM(t=u.CRH())&&(e.legendWrapper=t.first),u.iGM(t=u.CRH())&&(e.chartPlaceholder=t.first)}},hostAttrs:[1,"chart"],inputs:{chartConfig:"chartConfig",height:"height"},features:[u.TTD],ngContentSelectors:y,decls:10,vars:5,consts:[[1,"header-wrapper"],["headerWrapper",""],["chartPlaceholder",""],["class","empty-msg",4,"ngIf"],[1,"legend-wrapper"],["legendWrapper",""],["class","chart-legend",4,"ngIf"],[1,"empty-msg"],["svgIcon","warning"],["trans",""],[1,"chart-legend"],["class","legend-item",4,"ngFor","ngForOf"],[1,"legend-item"]],template:function(t,e){1&t&&(u.F$t(x),u.TgZ(0,"div",0,1),u.Hsn(2),u.qZA(),u.TgZ(3,"div",null,2),u.YNc(5,v,4,0,"div",3),u.qZA(),u.TgZ(6,"div",4,5),u.Hsn(8,1),u.YNc(9,Z,2,1,"div",6),u.qZA()),2&t&&(u.xp6(3),u.Gre("ct-chart ct-perfect-fourth ",null==e.chartConfig?null:e.chartConfig.type,"-chart chart-body"),u.xp6(2),u.Q6J("ngIf",e.chart&&e.chart.isEmpty()),u.xp6(4),u.Q6J("ngIf",null==e.chartConfig?null:e.chartConfig.legend))},directives:[p.O5,g.Hw,h.P,p.sg],styles:['.chart{display:block;max-width:100%;overflow:hidden}@media only screen and (max-width:768px){.chart{width:100%;flex:0 0 100%}}.chart .chart-body{margin-top:15px;position:relative}.chart .chart-header{padding:15px;border-bottom:1px solid var(--be-divider-default);height:66px}.chart .chart-header .title{font-size:1.3rem;font-weight:500;color:var(--be-text)}.chart .chart-header .subtitle{font-size:1.2rem;color:var(--be-secondary-text)}.chart .chart-legend{display:flex;width:100%;height:40px;align-items:center;justify-content:center;flex-wrap:wrap;padding:0 15px;font-size:1.3rem}.chart .chart-legend .legend-item{margin-right:14px;position:relative;padding-left:15px;white-space:nowrap;text-transform:capitalize}.chart .chart-legend .legend-item:before{display:block;content:" ";width:12px;height:12px;position:absolute;top:0;left:0;bottom:0;right:0;margin:auto 0}.chart .empty-msg{padding:15px;border-radius:4px;background-color:var(--be-background-alternative);border:1px solid var(--be-divider-default);text-align:center;width:80%;height:50px;max-width:340px;position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;z-index:1}.chart .empty-msg .mat-icon{vertical-align:middle;margin-right:8px;color:var(--be-secondary-text);margin-top:-2px}.chart .ct-bar{stroke-width:30px}'],encapsulation:2,changeDetection:0}),t})()},20653:function(t,e,n){"use strict";n.d(e,{m:function(){return r}});var i=n(61116),a=n(68400),o=n(77307),s=n(35366);let r=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=s.oAB({type:t}),t.\u0275inj=s.cJS({imports:[[i.ez,a.N,o.Ps]]}),t})()},29738:function(t,e,n){"use strict";n.d(e,{b:function(){return h}});var i=n(31041),a=n(78512),o=n(35366),s=n(88195),r=n(77307),l=n(61116),c=n(84369),d=n(38116);function u(t,e){if(1&t){const t=o.EpF();o.ynx(0),o.TgZ(1,"div",3),o._uU(2),o.qZA(),o.TgZ(3,"div",4),o._UZ(4,"input",5),o.qZA(),o.TgZ(5,"button",6),o.NdJ("click",function(){return o.CHM(t),o.oxw().save()}),o._uU(6," Save "),o.qZA(),o.BQk()}if(2&t){const t=o.oxw();o.xp6(2),o.Oqu(t.fullBaseUri+t.getPrefix()),o.xp6(2),o.Q6J("formControl",t.slugControl)}}function p(t,e){if(1&t&&(o.ynx(0),o.TgZ(1,"a",8),o._uU(2),o.qZA(),o.BQk()),2&t){const t=e.ngIf;o.xp6(1),o.Q6J("href",t,o.LSH)("title",t),o.xp6(1),o.Oqu(t)}}function g(t,e){if(1&t){const t=o.EpF();o.YNc(0,p,3,3,"ng-container",7),o.ALo(1,"async"),o.TgZ(2,"button",6),o.NdJ("click",function(){return o.CHM(t),o.oxw().startEditing()}),o._uU(3," Edit "),o.qZA()}if(2&t){const t=o.oxw();o.Q6J("ngIf",t.fullBaseUri+t.getPrefix()+o.lcZ(1,1,t.slug$))}}let h=(()=>{class t{constructor(t){this.settings=t,this.slug$=new a.X(""),this.editing$=new a.X(!1),this.slugControl=new i.NI,this.defaultBaseUri=this.settings.getBaseUrl()+"/",this.fullBaseUri=this.defaultBaseUri}set baseUri(t){this.fullBaseUri=(t=t||this.defaultBaseUri).endsWith("/")?t:t+"/"}writeValue(t){this.slug$.next(t),this.slugControl.setValue(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}save(){this.slug$.next(this.slugControl.value),this.propagateChange(this.slug$.value),this.editing$.next(!1)}startEditing(){this.editing$.next(!0)}getPrefix(){return this.prefix?this.prefix+"/":""}}return t.\u0275fac=function(e){return new(e||t)(o.Y36(s.Z))},t.\u0275cmp=o.Xpm({type:t,selectors:[["slug-control"]],inputs:{prefix:"prefix",baseUri:"baseUri"},features:[o._Bn([{provide:i.JU,useExisting:t,multi:!0}])],decls:5,vars:4,consts:[["svgIcon","link",1,"link-icon"],[4,"ngIf","ngIfElse"],["editButton",""],[1,"nowrap"],[1,"input-container"],["type","text",3,"formControl"],["type","button","mat-flat-button","","color","gray","trans","",1,"action-button",3,"click"],[4,"ngIf"],["target","_blank",1,"nowrap",3,"href","title"]],template:function(t,e){if(1&t&&(o._UZ(0,"mat-icon",0),o.YNc(1,u,7,2,"ng-container",1),o.ALo(2,"async"),o.YNc(3,g,4,3,"ng-template",null,2,o.W1O)),2&t){const t=o.MAs(4);o.xp6(1),o.Q6J("ngIf",o.lcZ(2,2,e.editing$))("ngIfElse",t)}},directives:[r.Hw,l.O5,i.Fj,i.JJ,i.oH,c.lW,d.P],pipes:[l.Ov],styles:["[_nghost-%COMP%]{display:flex;align-items:center}.input-container[_ngcontent-%COMP%]{margin-left:3px;width:auto;max-width:160px}.input-container[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{height:25px;padding:6px}.link-icon[_ngcontent-%COMP%]{margin-right:5px;flex-shrink:0}.action-button[_ngcontent-%COMP%]{margin-left:20px;line-height:25px}.nowrap[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"],changeDetection:0}),t})()},29828:function(t,e,n){"use strict";n.d(e,{I:function(){return c}});var i=n(61116),a=n(31041),o=n(84369),s=n(77307),r=n(68400),l=n(35366);let c=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=l.oAB({type:t}),t.\u0275inj=l.cJS({imports:[[i.ez,a.UX,o.ot,r.N,s.Ps]]}),t})()},6006:function(t,e,n){"use strict";n.d(e,{V:function(){return S}});var i=n(35366),a=n(31041),o=n(78512),s=n(66457),r=n(67139),l=n(35331),c=n(62147),d=n(97070),u=n(57125),p=n(340),g=n(68515),h=n(61116),m=n(91741),f=n(96673),b=n(48569);const v={leading:!0,trailing:!1};class _{constructor(t,e,n,i){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=i}call(t,e){return e.subscribe(new Z(t,this.duration,this.scheduler,this.leading,this.trailing))}}class Z extends f.L{constructor(t,e,n,i,a){super(t),this.duration=e,this.scheduler=n,this.leading=i,this.trailing=a,this._hasTrailingValue=!1,this._trailingValue=null}_next(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(x,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)}}function x(t){const{subscriber:e}=t;e.clearThrottle()}var y=n(27701);let A=(()=>{class t{constructor(t,e,n){this.el=t,this.uploadQueue=e,this.cd=n,this.hidden=!0,this.subscription=this.uploadQueue.totalProgress().pipe(function(t,e=b.P,n=v){return i=>i.lift(new _(t,e,n.leading,n.trailing))}(260,m.Z,{leading:!0,trailing:!0})).subscribe(t=>{this.progress=t,this.hidden=100===t||0===this.uploadQueue.count$.value.pending,this.cd.markForCheck()})}ngOnDestroy(){this.subscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq),i.Y36(s.A),i.Y36(i.sBO))},t.\u0275cmp=i.Xpm({type:t,selectors:[["upload-progress-bar"]],hostVars:2,hostBindings:function(t,e){2&t&&i.ekj("hidden",e.hidden)},decls:1,vars:1,consts:[["mode","determinate","color","accent",3,"value"]],template:function(t,e){1&t&&i._UZ(0,"mat-progress-bar",0),2&t&&i.Q6J("value",e.progress)},directives:[y.pW],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),t})();var w=n(62181),k=n(84369),T=n(77307);let C=(()=>{class t{constructor(t){this.el=t,this.config={},this.filesSelected=new i.vpe}ngOnInit(){this.el.nativeElement.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),(0,c.r)(this.config).then(t=>{t&&t.length&&this.filesSelected.emit(t)})})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(i.SBq))},t.\u0275dir=i.lG2({type:t,selectors:[["","uploadButton",""]],inputs:{config:["uploadButton","config"]},outputs:{filesSelected:"filesSelected"}}),t})();var q=n(38116),U=n(40450);function I(t,e){1&t&&i._UZ(0,"image-or-icon",4),2&t&&i.Q6J("src",e.ngIf)}function M(t,e){if(1&t&&i._UZ(0,"image-or-icon",4),2&t){const t=i.oxw(2);i.Q6J("src",t.defaultBackground)}}function O(t,e){if(1&t&&i.YNc(0,M,1,1,"image-or-icon",5),2&t){const t=i.oxw();i.Q6J("ngIf",t.defaultBackground)}}function J(t,e){if(1&t){const t=i.EpF();i.ynx(0),i._UZ(1,"span",6),i.TgZ(2,"button",7),i.NdJ("click",function(){return i.CHM(t),i.oxw().openUploadDialog()}),i._UZ(3,"mat-icon",8),i.qZA(),i.TgZ(4,"mat-menu",null,9),i.TgZ(6,"button",10),i.NdJ("filesSelected",function(e){return i.CHM(t),i.oxw().uploadImage(e)}),i._uU(7),i.ALo(8,"trans"),i.qZA(),i.TgZ(9,"button",11),i.NdJ("click",function(){return i.CHM(t),i.oxw().deleteUpload()}),i._uU(10,"Remove"),i.qZA(),i.qZA(),i.BQk()}if(2&t){const t=i.MAs(5),e=i.oxw();i.xp6(1),i.Q6J("matMenuTriggerFor",t),i.xp6(5),i.Q6J("uploadButton",e.uploadInputConfig),i.xp6(1),i.Oqu(i.lcZ(8,3,e.buttonText))}}function P(t,e){if(1&t){const t=i.EpF();i.TgZ(0,"button",14),i.NdJ("click",function(){return i.CHM(t),i.oxw(2).deleteUpload()}),i._UZ(1,"mat-icon",15),i.qZA()}}function N(t,e){if(1&t){const t=i.EpF();i.ynx(0),i.TgZ(1,"button",12),i.NdJ("filesSelected",function(e){return i.CHM(t),i.oxw().uploadImage(e)}),i._uU(2),i.ALo(3,"trans"),i.qZA(),i.YNc(4,P,2,0,"button",13),i.ALo(5,"async"),i.BQk()}if(2&t){const t=i.oxw();i.xp6(1),i.Q6J("uploadButton",t.uploadInputConfig),i.xp6(1),i.Oqu(i.lcZ(3,3,t.buttonText)),i.xp6(2),i.Q6J("ngIf",i.lcZ(5,5,t.src$))}}let S=(()=>{class t{constructor(t,e,n,a){this.uploadQueue=t,this.imageValidator=e,this.uploadsApi=n,this.http=a,this.fileDeleted=new i.vpe,this.buttonText="Upload image",this.uploadConfig={},this.compact=!1,this.uploadInputConfig={multiple:!1,types:[r.j.image]},this.isDisabled$=new o.X(!1),this.src$=new o.X(null)}writeValue(t){this.src$.next(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}setDisabledState(t){this.isDisabled$.next(t)}uploadImage(t){const e=Object.assign(Object.assign({},this.defaultUploadConfig()),this.uploadConfig);this.uploadQueue.start(t,e).subscribe(t=>{this.src$.next(t.fileEntry.url),this.propagateChange(t.fileEntry.url)})}deleteUpload(){const t={paths:[this.src$.value],deleteForever:!0};(this.uploadConfig&&this.uploadConfig.uri?this.http.delete(this.uploadConfig.uri,t):this.uploadsApi.delete(t)).subscribe(()=>{this.src$.next(null),this.propagateChange(null),this.fileDeleted.emit()})}defaultUploadConfig(){return{httpParams:{diskPrefix:this.diskPrefix||"common_media"},uri:l.C.Image,validator:this.imageValidator}}openUploadDialog(){this.src$.value?this.menuTrigger.toggleMenu():(0,c.r)(this.uploadInputConfig).then(t=>{this.uploadImage(t)})}}return t.\u0275fac=function(e){return new(e||t)(i.Y36(s.A),i.Y36(u.G),i.Y36(p.f),i.Y36(g.r))},t.\u0275cmp=i.Xpm({type:t,selectors:[["upload-image-control"]],viewQuery:function(t,e){if(1&t&&i.Gf(d.p6,5),2&t){let t;i.iGM(t=i.CRH())&&(e.menuTrigger=t.first)}},hostVars:2,hostBindings:function(t,e){2&t&&i.ekj("compact",e.compact)},inputs:{defaultBackground:"defaultBackground",buttonText:"buttonText",uploadConfig:"uploadConfig",diskPrefix:"diskPrefix",compact:"compact"},outputs:{fileDeleted:"fileDeleted"},features:[i._Bn([s.A,{provide:a.JU,useExisting:t,multi:!0}])],decls:10,vars:10,consts:[["class","inherit-size",3,"src",4,"ngIf","ngIfElse"],["defaultBg",""],[1,"action-buttons"],[4,"ngIf"],[1,"inherit-size",3,"src"],["class","inherit-size",3,"src",4,"ngIf"],[3,"matMenuTriggerFor"],["type","button","mat-icon-button","",1,"action-button",3,"click"],["svgIcon","add-photo-alternate"],["menu","matMenu"],["type","button","mat-menu-item","",3,"uploadButton","filesSelected"],["type","button","mat-menu-item","","trans","",3,"click"],["type","button","mat-stroked-button","","color","accent",1,"action-button",3,"uploadButton","filesSelected"],["type","button","class","action-button delete-button","mat-icon-button","",3,"click",4,"ngIf"],["type","button","mat-icon-button","",1,"action-button","delete-button",3,"click"],["svgIcon","delete"]],template:function(t,e){if(1&t&&(i.YNc(0,I,1,1,"image-or-icon",0),i.ALo(1,"async"),i.YNc(2,O,1,1,"ng-template",null,1,i.W1O),i.TgZ(4,"div",2),i.YNc(5,J,11,5,"ng-container",3),i.ALo(6,"async"),i.YNc(7,N,6,7,"ng-container",3),i.ALo(8,"async"),i.qZA(),i._UZ(9,"upload-progress-bar")),2&t){const t=i.MAs(3);i.Q6J("ngIf",i.lcZ(1,4,e.src$))("ngIfElse",t),i.xp6(5),i.Q6J("ngIf",e.compact&&!i.lcZ(6,6,e.isDisabled$)),i.xp6(2),i.Q6J("ngIf",!e.compact&&!i.lcZ(8,8,e.isDisabled$))}},directives:[h.O5,A,w.A,d.p6,k.lW,T.Hw,d.VK,d.OP,C,q.P],pipes:[h.Ov,U.R],styles:["[_nghost-%COMP%]{display:block;width:220px;height:220px;flex-shrink:0;border-radius:4px;overflow:hidden;background:linear-gradient(135deg,#70929c,#846170);position:relative}.inherit-size[_nghost-%COMP%], .inherit-size   [_nghost-%COMP%]{width:100%;height:100%}.compact[_nghost-%COMP%]   .action-buttons[_ngcontent-%COMP%], .compact   [_nghost-%COMP%]   .action-buttons[_ngcontent-%COMP%]{bottom:0;top:0}.action-buttons[_ngcontent-%COMP%]{position:absolute;bottom:25px;left:0;right:0;margin:auto;text-align:center;height:34px}.action-button[_ngcontent-%COMP%]{color:rgba(0,0,0,.87);border-color:rgba(0,0,0,.1);background:hsla(0,0%,100%,.8)}.mat-icon-button[_ngcontent-%COMP%]{border-radius:4px;line-height:34px;height:34px;width:34px}.delete-button[_ngcontent-%COMP%]{margin-left:5px}upload-progress-bar[_ngcontent-%COMP%]{width:100%;position:absolute;left:0;bottom:0}"]}),t})()},90723:function(t,e,n){"use strict";n.d(e,{a:function(){return p}});var i=n(61116),a=n(84369),o=n(77307),s=n(27701),r=n(35366);let l=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=r.oAB({type:t}),t.\u0275inj=r.cJS({imports:[[i.ez,a.ot,s.Cv,o.Ps]]}),t})();var c=n(45052),d=n(68400),u=n(97070);let p=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=r.oAB({type:t}),t.\u0275inj=r.cJS({imports:[[i.ez,l,c.T,d.N,s.Cv,o.Ps,a.ot,u.Tx]]}),t})()},14926:function(t,e,n){"use strict";n.d(e,{_:function(){return f}});var i=n(78512),a=n(55959),o=n(25416),s=n(84698),r=n(90611),l=n(43835),c=n(63337),d=n(35366),u=n(71294),p=n(36402),g=n(88195),h=n(61116);const m=["*"];let f=(()=>{class t{constructor(t,e,n,o,s){this.breakpoints=t,this.localStorage=e,this.settings=n,this.el=o,this.router=s,this.navIsOpen$=new i.X(!1),this.isCompact$=new i.X(!1),this.onDestroy$=new a.xQ}ngOnInit(){this.navIsOpen$.next(!this.breakpoints.isMobile$.value),this.isCompact$.pipe((0,o.R)(this.onDestroy$)).subscribe(t=>{t?this.el.nativeElement.style.setProperty("--nav-width","80px"):this.el.nativeElement.style.removeProperty("--nav-width")}),this.navIsOpen$.pipe((0,s.T)(1),(0,r.q)(1)).subscribe(()=>{this.el.nativeElement.classList.add("enable-transitions")}),this.navIsOpen$.pipe((0,o.R)(this.onDestroy$)).subscribe(t=>{t?this.el.nativeElement.classList.remove("nav-closed"):this.el.nativeElement.classList.add("nav-closed")}),this.router.events.pipe((0,l.h)(t=>t instanceof c.m2),(0,o.R)(this.onDestroy$)).subscribe(()=>{this.navIsOpen$.next(!this.breakpoints.isMobile$.value)})}ngOnDestroy(){this.onDestroy$.next()}toggleSidebarMode(){this.breakpoints.isMobile$.value?this.navIsOpen$.next(!this.navIsOpen$.value):(this.isCompact$.next(!this.isCompact$.value),this.localStorage.set(this.storageSelector(),this.isCompact$.value))}storageSelector(){return`${this.settings.get("branding.site_name")}.sidebarCompact`}}return t.\u0275fac=function(e){return new(e||t)(d.Y36(u.S),d.Y36(p.m),d.Y36(g.Z),d.Y36(d.SBq),d.Y36(c.F0))},t.\u0275cmp=d.Xpm({type:t,selectors:[["sidenav"]],ngContentSelectors:m,decls:3,vars:4,consts:[[1,"backdrop",3,"click"]],template:function(t,e){1&t&&(d.F$t(),d.Hsn(0),d.TgZ(1,"div",0),d.NdJ("click",function(){return e.navIsOpen$.next(!1)}),d.ALo(2,"async"),d.qZA()),2&t&&(d.xp6(1),d.ekj("visible",d.lcZ(2,2,e.navIsOpen$)))},pipes:[h.Ov],styles:["[_nghost-%COMP%]{display:flex;padding-top:var(--top-offset);--nav-width:225px;--top-offset:70px}.no-navbar[_nghost-%COMP%]{--top-offset:0px}.nav-closed[_nghost-%COMP%]     nav{transform:translate3d(-100%,0,0);box-shadow:none}.enable-transitions[_nghost-%COMP%]     nav{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:transform}[_nghost-%COMP%]     nav{width:var(--nav-width);overflow:auto;padding:26px 8px 16px;border-right:1px solid var(--be-divider-default);display:flex;flex-direction:column;position:fixed;top:var(--top-offset);bottom:0;z-index:4;background-color:var(--be-background)}@media only screen and (max-width:768px){[_nghost-%COMP%]     nav{box-shadow:0 3px 5px -1px rgba(0,0,0,.2),0 5px 8px 0 rgba(0,0,0,.14),0 1px 14px 0 rgba(0,0,0,.12)}}[_nghost-%COMP%]   .backdrop[_ngcontent-%COMP%]{display:block;top:0;left:0;right:0;bottom:0;position:absolute;z-index:1;transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:background-color,visibility;visibility:hidden}[_nghost-%COMP%]   .backdrop.visible[_ngcontent-%COMP%]{visibility:visible;background-color:var(--be-backdrop);opacity:.6}@media only screen and (min-width:768px){[_nghost-%COMP%]   .backdrop[_ngcontent-%COMP%]{display:none}}[_nghost-%COMP%]     main{min-width:0;flex:1 1 auto;background-color:var(--be-background-alternative);min-height:calc(100vh - 0px);min-height:calc(100vh - var(--top-offset, 0px));display:flex;flex-direction:column}@media only screen and (min-width:768px){[_nghost-%COMP%]     main{margin-left:var(--nav-width)}}"],changeDetection:0}),t})()},85786:function(t,e,n){"use strict";n.d(e,{c:function(){return o}});var i=n(61116),a=n(35366);let o=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=a.oAB({type:t}),t.\u0275inj=a.cJS({imports:[[i.ez]]}),t})()},90164:function(t,e,n){"use strict";n.d(e,{y:function(){return h}});var i=n(61116),a=n(31041),o=n(84369),s=n(40994),r=n(92935),l=n(97070),c=n(63589),d=n(24311),u=n(77307),p=n(68400),g=n(35366);let h=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=g.oAB({type:t}),t.\u0275inj=g.cJS({imports:[[i.ez,a.u5,a.UX,p.N,o.ot,c.ZX,s.p9,d.AV,r.Is,l.Tx,u.Ps]]}),t})()},25079:function(t,e,n){"use strict";n.d(e,{y:function(){return o}});var i=n(98977),a=n(35366);let o=(()=>{class t{transform(t=0,e){return isNaN(parseFloat(String(t)))||!isFinite(t)?"-":(0,i.H)(t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=a.Yjl({name:"formattedFileSize",type:t,pure:!0}),t})()},35331:function(t,e,n){"use strict";n.d(e,{C:function(){return i}});var i=function(t){return t.Image="uploads/images",t}({})},66457:function(t,e,n){"use strict";n.d(e,{A:function(){return I}});var i=n(55959),a=n(78512),o=n(66994),s=n(24831);class r{constructor(t,e){this.canceled$=new i.xQ,this.processing$=new a.X(!1),this.uploadedResponse$=new o.t(1),this.progress$=new a.X({percentage:0}),this.error$=new a.X(null),this.customData={},this.uploadedFile=t,this.id=e||(0,s.O)()}get completed(){return!this.processing$.value&&100===this.progress$.value.percentage}get inProgress(){return!this.error$.value&&!this.completed}cancel(){this.canceled$.next(!0),this.finalize()}complete(){this.setProgress({percentage:100,eta:null}),this.finalize()}finalize(){this.uploadedResponse$.complete(),this.canceled$.complete(),this.progress$.complete()}finishProcessing(){this.processing$.next(!1),this.processing$.complete()}addError(t){this.error$.next(t)}setProgress(t){this.progress$.next(Object.assign(Object.assign({},this.progress$.value),t))}}var l=n(19764),c=n(31225),d=n(34056),u=n(73982),p=n(47727),g=n(25416),h=n(79996),m=n(43835),f=n(91772),b=n(36024),v=n(35366),_=n(340),Z=n(16930),x=n(20274),y=n(16890);class A extends y.y{constructor(t,e){super(),this.params=t,this.i18n=e,this.errorMessage=this.i18n.t("Only these file types are allowed: :extensions",{extensions:this.params.extensions.join(", ")})}fails(t){return!this.params.extensions.some(e=>e.toLowerCase()===t.extension.toLowerCase())}}class w extends y.y{constructor(t,e){super(),this.params=t,this.i18n=e,this.errorMessage=this.i18n.t("These file types are not allowed: :extensions",{extensions:this.params.extensions.join(", ")})}fails(t){return this.params.extensions.some(e=>e===t.extension)}}var k=n(94380);let T=(()=>{class t extends Z.c{constructor(){super(...arguments),this.DEFAULT_MAX_FILE_SIZE_MB=8,this.showToast=!0}initValidations(){this.validations.push(new x.p({maxSize:this.getMaxFileSize()},this.i18n));const t=this.getAllowedExtensions(),e=this.getBlockedExtensions();t&&t.length&&this.validations.push(new A({extensions:t},this.i18n)),e&&e.length&&this.validations.push(new w({extensions:e},this.i18n))}getMaxFileSize(){return this.settings.get("uploads.max_size",(0,k.F)(this.DEFAULT_MAX_FILE_SIZE_MB,"MB"))}getAllowedExtensions(){return this.settings.getJson("uploads.allowed_extensions")}getBlockedExtensions(){return this.settings.getJson("uploads.blocked_extensions")}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=v.n5z(t)))(n||t)}}(),t.\u0275prov=v.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var C=n(73234),q=n(28505),U=n(88195);let I=(()=>{class t{constructor(t,e,n,s,r){this.api=t,this.defaultValidator=e,this.toast=n,this.currentUser=s,this.settings=r,this.uploads$=new a.X([]),this.totalProgress$=new o.t(1),this.uploadsAdded$=new i.xQ,this.count$=new a.X({pending:0,completed:0})}isEmpty(){return!this.uploads$.value.length}getAllCompleted(){return this.uploads$.value.filter(t=>t.completed).map(t=>t.fileEntry)}updateTotalProgress(){const t=this.uploads$.value.map(t=>t.progress$.value.percentage||0);this.totalProgress$.next(t.reduce((t,e)=>t+e,0)/t.length)}totalProgress(){return this.totalProgress$.asObservable()}start(t,e={}){const n=e.validator||this.defaultValidator;let i=[];if(Array.isArray(t))i=this.transformUploads(t,n),this.uploads$.next(this.uploads$.value.concat(i)),this.uploadsAdded$.next(i);else{const e=this.uploads$.value.map(e=>{if(t[e.id]){const a=this.transformUploads([t[e.id]],n,e.id)[0];return i.push(a),a}return e});this.uploads$.next(e)}return this.updateCount(),(0,l.D)(i.filter(t=>!t.error$.value)).pipe((0,u.zg)(t=>this.api.upload(t.uploadedFile,e).pipe((0,p.K)(i=>(this.handleUploadFailure(i,t,n),e.bubbleError?(0,c._)(i):d.E)),(0,g.R)(t.canceled$),(0,h.U)(n=>(this.handleUploadEvent(n,t,e.willProcessFiles),n.name===f.b.COMPLETED&&(n.body.queueItemId=t.id),n))),1),(0,m.h)(t=>t.name===f.b.COMPLETED),(0,h.U)(t=>t.body))}updateProgress(t,e){const n=this.find(t);n&&(n.setProgress({eta:e.eta,speed:e.speed,percentage:e.progress,totalBytes:e.totalBytes,completedBytes:e.completedBytes}),this.updateTotalProgress())}completeUpload(t,e){const n=this.find(t);n&&(n.uploadedResponse$.next(e),n.fileEntry=e.fileEntry,n.complete(),this.updateTotalProgress())}errorUpload(t,e){this.find(t).addError(e)}reset(){this.uploads$.value.forEach(t=>t.cancel()),this.uploads$.next([])}remove(t){const e=this.uploads$.value.findIndex(e=>e.id===t),n=this.uploads$.value[e];n.completed?n.finalize():n.cancel(),this.uploads$.value.splice(e,1),this.uploads$.next(this.uploads$.value)}find(t){return this.uploads$.value.find(e=>e.id===t)}transformUploads(t,e,n){return t.map(t=>{const i=new r(t,n);if(e){const n=e.validate(t);n.failed&&i.addError(n.errorMessage)}return i})}handleUploadEvent(t,e,n=!1){t.name===f.b.PROGRESS?(100===t.progress&&(t=Object.assign(Object.assign({},t),{progress:99}),n&&e.processing$.next(!0)),this.updateProgress(e.id,t)):t.name===f.b.COMPLETED&&(this.completeUpload(e.id,t.body),this.updateCount())}handleUploadFailure(t,e,n){var i;let a=null===(i=null==t?void 0:t.errors)||void 0===i?void 0:i.file,o=null;a||(a=b.v.DefaultUpload,o=this.currentUser.isAdmin()&&!this.settings.get("site.hide_docs_buttons")),this.errorUpload(e.id,a),this.updateCount(),this.updateTotalProgress(),n.showToast&&this.toast.open(a,{action:o?"Learn More":null}).onAction().subscribe(()=>{window.open(b.h)})}updateCount(){const t=this.uploads$.value.filter(t=>t.inProgress).length;this.count$.next({pending:t,completed:this.uploads$.value.length-t})}}return t.\u0275fac=function(e){return new(e||t)(v.LFG(_.f),v.LFG(T),v.LFG(C.F),v.LFG(q.I),v.LFG(U.Z))},t.\u0275prov=v.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},12440:function(t,e,n){"use strict";n.d(e,{Z:function(){return v}});var i=n(78512),a=n(31041),o=n(92935),s=n(11520),r=n(35366),l=n(95157),c=n(73234),d=n(61116),u=n(77307),p=n(38116),g=n(84369);function h(t,e){1&t&&(r.TgZ(0,"span",6),r._uU(1,"Create Workspace"),r.qZA())}function m(t,e){1&t&&(r.TgZ(0,"span",6),r._uU(1,"Update Workspace"),r.qZA())}function f(t,e){if(1&t&&(r.TgZ(0,"div",15),r._uU(1),r.qZA()),2&t){const t=r.oxw().ngIf;r.xp6(1),r.Oqu(t.name)}}function b(t,e){if(1&t){const t=r.EpF();r.TgZ(0,"form",7),r.NdJ("ngSubmit",function(){return r.CHM(t),r.oxw().confirm()}),r.TgZ(1,"mat-dialog-content",8),r.TgZ(2,"div",9),r.TgZ(3,"label",10),r._uU(4,"Name"),r.qZA(),r._UZ(5,"input",11),r.YNc(6,f,2,1,"div",12),r.qZA(),r.qZA(),r.TgZ(7,"mat-dialog-actions"),r.TgZ(8,"button",13),r.NdJ("click",function(){return r.CHM(t),r.oxw().close()}),r._uU(9,"Cancel"),r.qZA(),r.TgZ(10,"button",14),r.ALo(11,"async"),r._uU(12),r.qZA(),r.qZA(),r.qZA()}if(2&t){const t=e.ngIf,n=r.oxw();r.Q6J("formGroup",n.form),r.xp6(6),r.Q6J("ngIf",t.name),r.xp6(4),r.Q6J("disabled",r.lcZ(11,4,n.loading$)),r.xp6(2),r.Oqu(n.data.workspace?"Update":"Create")}}let v=(()=>{class t{constructor(t,e,n,o){this.dialogRef=t,this.data=e,this.workspaces=n,this.toast=o,this.loading$=new i.X(!1),this.errors$=new i.X({}),this.form=new a.cw({name:new a.NI}),e.workspace&&this.form.patchValue(e.workspace)}confirm(){this.loading$.next(!0),(this.data.workspace?this.workspaces.update(this.data.workspace.id,this.form.value):this.workspaces.create(this.form.value)).pipe((0,s.x)(()=>this.loading$.next(!1))).subscribe(t=>{this.toast.open(this.data.workspace?"Workspace updated.":"Workspace created."),this.close(t.workspace)},t=>this.errors$.next(t.errors))}close(t){this.dialogRef.close(t)}}return t.\u0275fac=function(e){return new(e||t)(r.Y36(o.so),r.Y36(o.WI),r.Y36(l.b),r.Y36(c.F))},t.\u0275cmp=r.Xpm({type:t,selectors:[["crupdate-workspace-modal"]],decls:8,vars:5,consts:[[1,"modal-header"],["mat-dialog-title",""],["trans","",4,"ngIf"],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],["ngNativeValidate","",3,"formGroup","ngSubmit",4,"ngIf"],["trans",""],["ngNativeValidate","",3,"formGroup","ngSubmit"],[1,"many-inputs"],[1,"input-container","name-container"],["for","crupdate-workspace-name","trans",""],["type","text","id","crupdate-workspace-name","formControlName","name","required","","minlength","3"],["class","error",4,"ngIf"],["type","button","mat-button","","trans","",3,"click"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],[1,"error"]],template:function(t,e){1&t&&(r.TgZ(0,"div",0),r.TgZ(1,"h2",1),r.YNc(2,h,2,0,"span",2),r.YNc(3,m,2,0,"span",2),r.qZA(),r.TgZ(4,"button",3),r.NdJ("click",function(){return e.close()}),r._UZ(5,"mat-icon",4),r.qZA(),r.qZA(),r.YNc(6,b,13,6,"form",5),r.ALo(7,"async")),2&t&&(r.xp6(2),r.Q6J("ngIf",!e.data.workspace),r.xp6(1),r.Q6J("ngIf",e.data.workspace),r.xp6(3),r.Q6J("ngIf",r.lcZ(7,3,e.errors$)))},directives:[o.uh,d.O5,u.Hw,p.P,a.JL,a.sg,o.xY,a.Fj,a.JJ,a.u,a.Q7,a.wO,o.H8,g.lW],pipes:[d.Ov],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}"],changeDetection:0}),t})()},75183:function(t,e,n){"use strict";n.d(e,{W:function(){return i}});const i={title:"Leave Workspace",body:"Are you sure you want to leave this workspace?",bodyBold:"All resources you've created in the workspace will be transferred to workspace owner.",ok:"Leave"}},77044:function(t,e,n){"use strict";n.d(e,{t:function(){return E}});var i=n(78512),a=n(31041),o=n(92935),s=n(11520),r=function(t){return t.LEFT_WORKSPACE="You have left the workspace.",t.MEMBER_DELETED="Member Deleted.",t.INVITES_SENT="Invites Sent.",t.INVITE_RESENT="Resent invite.",t.ROLE_ASSIGNED="Role Assigned.",t}({}),l=n(4694),c=n(75183),d=n(26437),u=n(35366),p=n(95157),g=n(73234),h=n(25051),m=n(28505),f=n(24859),b=n(38116),v=n(77307),_=n(61116),Z=n(97070),x=n(77910),y=n(84369),A=n(27701),w=n(88798),k=n(24311),T=n(40450);function C(t,e){1&t&&u._UZ(0,"mat-progress-bar",23)}function q(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"div",16),u.TgZ(1,"div",17),u.TgZ(2,"label",18),u._uU(3,"Invite by email"),u.qZA(),u.TgZ(4,"div",19),u._UZ(5,"chip-input",20),u.TgZ(6,"button",21),u.NdJ("click",function(){return u.CHM(t),u.oxw().invitePeople()}),u.ALo(7,"async"),u.ALo(8,"async"),u._uU(9,"Invite "),u.qZA(),u.qZA(),u.qZA(),u.YNc(10,C,1,0,"mat-progress-bar",22),u.ALo(11,"async"),u.qZA()}if(2&t){const t=u.oxw();let e;u.Q6J("@fadeIn",void 0),u.xp6(5),u.Q6J("emailsInput",!0)("formControl",t.peopleToInvite),u.xp6(1),u.Q6J("disabled",u.lcZ(7,5,t.inviting$)||!(null!=(e=u.lcZ(8,7,t.peopleToInvite.valueChanges))&&e.length)),u.xp6(4),u.Q6J("ngIf",u.lcZ(11,9,t.inviting$))}}function U(t,e){1&t&&(u.TgZ(0,"li",24),u._UZ(1,"skeleton",25),u.TgZ(2,"div",26),u._UZ(3,"skeleton"),u._UZ(4,"skeleton"),u.qZA(),u.qZA())}const I=function(){return[1,2,3]};function M(t,e){1&t&&(u.TgZ(0,"ul",12),u.YNc(1,U,5,0,"li",13),u.qZA()),2&t&&(u.Q6J("@fadeOut",void 0),u.xp6(1),u.Q6J("ngForOf",u.DdM(2,I)))}function O(t,e){1&t&&(u.TgZ(0,"span",38),u._uU(1,"(You)"),u.qZA())}function J(t,e){if(1&t){const t=u.EpF();u.ynx(0),u._uU(1," \xb7 "),u.TgZ(2,"button",39),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(2).$implicit;return u.oxw().maybeResendInvite(e)}),u.ALo(3,"async"),u._uU(4,"Resend Invite"),u.qZA(),u.BQk()}if(2&t){const t=u.oxw(3);u.xp6(2),u.Q6J("disabled",u.lcZ(3,1,t.inviting$))}}function P(t,e){if(1&t&&(u.TgZ(0,"span"),u._uU(1," \xb7 "),u.TgZ(2,"span",34),u._uU(3,"Invited"),u.qZA(),u.YNc(4,J,5,3,"ng-container",30),u.qZA()),2&t){const t=u.oxw(2);u.xp6(4),u.Q6J("ngIf",t.canInvite)}}function N(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"button",40),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().$implicit;return u.oxw().maybeDeleteMember(e)}),u.ALo(1,"async"),u._UZ(2,"mat-icon",3),u.qZA()}if(2&t){const t=u.oxw().$implicit,e=u.oxw();u.ekj("visually-hidden",t.is_owner||!e.canDelete),u.Q6J("disabled",u.lcZ(1,3,e.deleting$))}}function S(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"button",41),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().$implicit;return u.oxw().maybeLeaveWorkspace(e)}),u.ALo(1,"trans"),u.ALo(2,"async"),u._UZ(3,"mat-icon",42),u.qZA()}if(2&t){const t=u.oxw(2);u.Q6J("matTooltip",u.lcZ(1,2,"Leave workspace"))("disabled",u.lcZ(2,4,t.deleting$))}}const D=function(t){return{member:t}};function Q(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"li",24),u.NdJ("@fadeIn.done",function(){return u.CHM(t),u.oxw(),u.MAs(6).style.overflow="auto"}),u._UZ(1,"img",27),u.TgZ(2,"div",26),u.TgZ(3,"div",28),u.TgZ(4,"span"),u._uU(5),u.qZA(),u._uU(6," "),u.YNc(7,O,2,0,"span",29),u.YNc(8,P,5,1,"span",30),u.qZA(),u.TgZ(9,"div",31),u._uU(10),u.qZA(),u.qZA(),u.TgZ(11,"div",32),u.TgZ(12,"button",33),u.TgZ(13,"span",34),u._uU(14),u.qZA(),u._UZ(15,"mat-icon",35),u.qZA(),u.YNc(16,N,3,5,"button",36),u.YNc(17,S,4,6,"button",37),u.qZA(),u.qZA()}if(2&t){const t=e.$implicit,n=u.oxw(),i=u.MAs(19);u.Q6J("@fadeIn",void 0),u.xp6(1),u.Q6J("src",t.avatar,u.LSH),u.xp6(4),u.Oqu(t.display_name),u.xp6(2),u.Q6J("ngIf",n.currentUser.get("id")===t.id),u.xp6(1),u.Q6J("ngIf","invite"===t.model_type),u.xp6(2),u.Oqu(t.email),u.xp6(2),u.ekj("not-clickable",t.is_owner||!n.canEdit),u.Q6J("matMenuTriggerFor",i)("matMenuTriggerData",u.VKq(13,D,t)),u.xp6(2),u.Oqu(t.role_name),u.xp6(2),u.Q6J("ngIf",t.is_owner||n.currentUser.get("id")!==t.id),u.xp6(1),u.Q6J("ngIf",!t.is_owner&&n.currentUser.get("id")===t.id)}}function Y(t,e){if(1&t){const t=u.EpF();u.TgZ(0,"div",44),u.NdJ("click",function(){const e=u.CHM(t).$implicit,n=u.oxw().member;return u.oxw().changeRole(n,e)}),u._UZ(1,"mat-icon",45),u.TgZ(2,"div",46),u.TgZ(3,"div",47),u._uU(4),u.qZA(),u.TgZ(5,"div",48),u._uU(6),u.qZA(),u.qZA(),u.qZA()}if(2&t){const t=e.$implicit,n=u.oxw().member;u.ekj("active",n.role_id===t.id),u.xp6(1),u.ekj("visually-hidden",n.role_id!==t.id),u.xp6(3),u.Oqu(t.name),u.xp6(2),u.Oqu(t.description)}}function L(t,e){if(1&t&&(u.YNc(0,Y,7,6,"div",43),u.ALo(1,"async")),2&t){const t=u.oxw();u.Q6J("ngForOf",u.lcZ(1,1,t.workspaceRoles$))}}const F=function(t){return{workspace:t}};let E=(()=>{class t{constructor(t,e,n,o,s,r,l){this.dialogRef=t,this.data=e,this.workspaces=n,this.toast=o,this.valueLists=s,this.currentUser=r,this.modal=l,this.inviting$=new i.X(!1),this.deleting$=new i.X(!1),this.loadingMembers$=new i.X(!1),this.workspaceRoles$=new i.X([]),this.members$=new i.X([]),this.peopleToInvite=new a.NI([]),this.canInvite=!1,this.canEdit=!1,this.canDelete=!1}ngOnInit(){this.loadingMembers$.next(!0),this.valueLists.get(["workspaceRoles"]).subscribe(t=>{this.workspaceRoles$.next(t.workspaceRoles)}),this.workspaces.get(this.data.workspace.id).pipe((0,s.x)(()=>this.loadingMembers$.next(!1))).subscribe(t=>{this.members$.next([...t.workspace.invites,...t.workspace.members]),this.setCurrentUserPermissions()})}close(t){this.dialogRef.close(t)}invitePeople(){const t=this.peopleToInvite.value.filter(t=>!this.members$.value.find(e=>e.email===t));if(!t.length)return this.peopleToInvite.reset(),void this.toast.open("All invited people are already members.");const e={emails:t,roleId:(this.workspaceRoles$.value.find(t=>t.default)||this.workspaceRoles$.value[0]).id};this.inviting$.next(!0),this.workspaces.invitePeople(this.data.workspace.id,e).pipe((0,s.x)(()=>this.inviting$.next(!1))).subscribe(t=>{this.members$.next([...this.members$.value,...t.invites]),this.peopleToInvite.reset(),this.toast.open(r.INVITES_SENT)})}resendInvite(t){this.inviting$.next(!0),this.workspaces.resendInvite(this.data.workspace.id,t.id).pipe((0,s.x)(()=>this.inviting$.next(!1))).subscribe(()=>{this.toast.open(r.INVITE_RESENT)})}changeRole(t,e){this.workspaces.changeRole(this.data.workspace.id,t,e.id).subscribe(()=>{this.toast.open(r.ROLE_ASSIGNED);const n=[...this.members$.value],i=n.findIndex(e=>e.id===t.id);n[i].role_name=e.name,n[i].role_id=e.id,this.members$.next(n)})}deleteMember(t){this.deleting$.next(!0),("member"===t.model_type?this.workspaces.deleteMember(this.data.workspace.id,t.id):this.workspaces.deleteInvite(t.id)).pipe((0,s.x)(()=>this.deleting$.next(!1))).subscribe(()=>{const e=[...this.members$.value],n=e.findIndex(e=>t.id&&e.model_type===t.model_type);e.splice(n,1),this.members$.next(e),t.id===this.currentUser.get("id")?(this.close(),this.toast.open(r.LEFT_WORKSPACE)):this.toast.open(r.MEMBER_DELETED)})}maybeDeleteMember(t){this.modal.show(l.z,{title:"Delete Member",body:"Are you sure you want to delete this member?",bodyBold:"All workspace resources created by this member will be transferred to workspace owner.",ok:"Delete"}).afterClosed().subscribe(e=>{e&&this.deleteMember(t)})}maybeResendInvite(t){this.modal.show(l.z,{title:"Resend Invite",body:"Are you sure you want to send this invite again?",ok:"Resend"}).afterClosed().subscribe(e=>{e&&this.resendInvite(t)})}maybeLeaveWorkspace(t){this.modal.show(l.z,c.W).afterClosed().subscribe(e=>{e&&this.deleteMember(t)})}setCurrentUserPermissions(){const t=this.members$.value.find(t=>t.id===this.currentUser.get("id"));this.canInvite=t.is_owner||!!t.permissions.find(t=>"workspace_members.invite"===t.name),this.canEdit=t.is_owner||!!t.permissions.find(t=>"workspace_members.update"===t.name),this.canDelete=t.is_owner||!!t.permissions.find(t=>"workspace_members.delete"===t.name)}}return t.\u0275fac=function(e){return new(e||t)(u.Y36(o.so),u.Y36(o.WI),u.Y36(p.b),u.Y36(g.F),u.Y36(h.l),u.Y36(m.I),u.Y36(f.u))},t.\u0275cmp=u.Xpm({type:t,selectors:[["manage-workspace-members-modal"]],decls:21,vars:10,consts:[[1,"modal-header"],["mat-dialog-title","","trans",""],["type","button","tabindex","-1",1,"close-button","no-style",3,"click"],["svgIcon","close"],[2,"overflow","hidden"],["container",""],["class","invite-container",4,"ngIf"],[1,"header"],["svgIcon","people"],["trans","",1,"text",3,"transValues"],[1,"animation-container"],["class","member-list unstyled-list",4,"ngIf"],[1,"member-list","unstyled-list"],["class","member-list-item",4,"ngFor","ngForOf"],["selectRoleMenu","matMenu"],["matMenuContent",""],[1,"invite-container"],[1,"input-container"],["for","workspace-emails-input","trans",""],[1,"input-with-action"],["id","workspace-emails-input","placeholder","Email addresses",3,"emailsInput","formControl"],["type","button","mat-flat-button","","color","accent","trans","",1,"add-tags-button",3,"disabled","click"],["mode","indeterminate","color","accent",4,"ngIf"],["mode","indeterminate","color","accent"],[1,"member-list-item"],["variant","avatar"],[1,"details"],["alt","",3,"src"],[1,"email"],["class","strong","trans","",4,"ngIf"],[4,"ngIf"],[1,"invited_at"],[1,"actions"],["type","button","mat-stroked-button","",1,"role-trigger-button",3,"matMenuTriggerFor","matMenuTriggerData"],["trans",""],["svgIcon","keyboard-arrow-down",1,"dropdown-icon"],["type","button","class","delete-member-button","mat-icon-button","",3,"visually-hidden","disabled","click",4,"ngIf"],["type","button","class","delete-member-button","mat-icon-button","",3,"matTooltip","disabled","click",4,"ngIf"],["trans","",1,"strong"],["type","button","trans","",1,"no-style","resend-invite-button",3,"disabled","click"],["type","button","mat-icon-button","",1,"delete-member-button",3,"disabled","click"],["type","button","mat-icon-button","",1,"delete-member-button",3,"matTooltip","disabled","click"],["svgIcon","exit-to-app"],["class","multiline-mat-menu-item with-icon","mat-menu-item","","trans","",3,"active","click",4,"ngFor","ngForOf"],["mat-menu-item","","trans","",1,"multiline-mat-menu-item","with-icon",3,"click"],["svgIcon","check"],[1,"menu-item-content"],["trans","",1,"title"],["trans","",1,"description"]],template:function(t,e){1&t&&(u.TgZ(0,"div",0),u.TgZ(1,"h2",1),u._uU(2,"Manage workspace members"),u.qZA(),u.TgZ(3,"button",2),u.NdJ("click",function(){return e.close()}),u._UZ(4,"mat-icon",3),u.qZA(),u.qZA(),u.TgZ(5,"mat-dialog-content",4,5),u.YNc(7,q,12,11,"div",6),u.TgZ(8,"div",7),u._UZ(9,"mat-icon",8),u.TgZ(10,"span",9),u._uU(11,"Members of :workspace"),u.qZA(),u.qZA(),u.TgZ(12,"div",10),u.YNc(13,M,2,3,"ul",11),u.ALo(14,"async"),u.TgZ(15,"ul",12),u.YNc(16,Q,18,15,"li",13),u.ALo(17,"async"),u.qZA(),u.qZA(),u.qZA(),u.TgZ(18,"mat-menu",null,14),u.YNc(20,L,2,3,"ng-template",15),u.qZA()),2&t&&(u.xp6(7),u.Q6J("ngIf",e.canInvite),u.xp6(3),u.Q6J("transValues",u.VKq(8,F,e.data.workspace.name)),u.xp6(3),u.Q6J("ngIf",u.lcZ(14,4,e.loadingMembers$)),u.xp6(3),u.Q6J("ngForOf",u.lcZ(17,6,e.members$)))},directives:[o.uh,b.P,v.Hw,o.xY,_.O5,_.sg,Z.VK,Z.KA,x.S,a.JJ,a.oH,y.lW,A.pW,w._,Z.p6,k.gM,Z.OP],pipes:[_.Ov,T.R],styles:["[_nghost-%COMP%]{display:block;width:600px;max-width:100%}chip-input[_ngcontent-%COMP%]{flex:1}.invite-container[_ngcontent-%COMP%]{margin-bottom:30px;position:relative}.mat-progress-bar[_ngcontent-%COMP%]{position:absolute;bottom:0;left:0;right:0}.header[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:15px}.header[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{margin-right:5px}.header[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%], .header[_ngcontent-%COMP%]   .text[_ngcontent-%COMP%]{vertical-align:middle}.animation-container[_ngcontent-%COMP%]{position:relative}.member-list-item[_ngcontent-%COMP%]{display:flex;margin-bottom:20px}.member-list-item[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{flex-shrink:0;width:40px;height:40px;-o-object-fit:cover;object-fit:cover;margin-right:10px;border-radius:4px}.member-list-item[_ngcontent-%COMP%]   .details[_ngcontent-%COMP%]{flex:1 1 auto}.member-list-item[_ngcontent-%COMP%]   .delete-member-button[_ngcontent-%COMP%], .member-list-item[_ngcontent-%COMP%]   .invited_at[_ngcontent-%COMP%]{color:var(--be-secondary-text)}.not-clickable[_ngcontent-%COMP%]{pointer-events:none}.not-clickable[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{display:none}.dropdown-icon[_ngcontent-%COMP%]{width:18px;height:18px;line-height:18px}.resend-invite-button[_ngcontent-%COMP%]{color:var(--be-link)}.role-trigger-button[_ngcontent-%COMP%]{margin-right:8px;font-size:1.3rem;font-weight:400}"],data:{animation:d.B},changeDetection:0}),t})()},75428:function(t,e,n){"use strict";n.r(e),n.d(e,{WorkspaceModule:function(){return x}});var i=n(61116),a=n(12440),o=n(77044),s=n(77307),r=n(84369),l=n(92935),c=n(68400),d=n(31041),u=n(7436),p=n(51685),g=n(86013),h=n(24311),m=n(50615),f=n(27701),b=n(15595),v=n(56160),_=n(97070),Z=n(35366);let x=(()=>{class t{}return t.components={crupdateModal:a.Z,manageMembers:o.t},t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Z.oAB({type:t}),t.\u0275inj=Z.cJS({imports:[[i.ez,d.u5,d.UX,c.N,p.x,g.b,m.X,b.m,v.G,s.Ps,r.ot,l.Is,u.Fk,h.AV,f.Cv,_.Tx]]}),t})()}}]);
//# sourceMappingURL=275-es2015.469744cfb9d499ff23f5.js.map
Back to Directory File Manager