����JFIF��x�x����'
Server IP : 78.140.185.180 / Your IP : 3.141.107.132 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/builderbox/public_html/public/client/ |
Upload File : |
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{"5+WD":function(e,t,n){"use strict";n.d(t,"a",(function(){return pe})),n.d(t,"b",(function(){return de})),n.d(t,"c",(function(){return he})),n.d(t,"d",(function(){return re})),n.d(t,"e",(function(){return me})),n.d(t,"f",(function(){return q}));var i=n("fXoL"),a=n("ofXK"),s=n("vxfF"),o=n("nLfN"),r=n("8LU1"),c=n("XNiG"),l=n("quSY"),d=n("HDdC"),b=n("D0XW"),u=n("Y7HM");function h(e){const{subscriber:t,counter:n,period:i}=e;t.next(n),this.schedule({subscriber:t,counter:n+1,period:i},i)}var p=n("eNwd"),g=n("VRyK"),m=n("1G5W"),f=n("JX91"),v=n("lJxs"),_=n("IzEk"),S=n("vkgz"),y=n("eIep"),k=n("cH1L");function T(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function C(e,t){const n=t?"":"none";T(e.style,{touchAction:t?"":"none",webkitUserDrag:t?"":"none",webkitTapHighlightColor:t?"":"transparent",userSelect:n,msUserSelect:n,webkitUserSelect:n,MozUserSelect:n})}function w(e){const t=e.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(e)*t}function x(e,t){return e.getPropertyValue(t).split(",").map(e=>e.trim())}function I(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}function O(e,t,n){const{top:i,bottom:a,left:s,right:o}=e;return n>=i&&n<=a&&t>=s&&t<=o}function M(e,t,n){e.top+=t,e.bottom=e.top+e.height,e.left+=n,e.right=e.left+e.width}function D(e,t,n,i){const{top:a,right:s,bottom:o,left:r,width:c,height:l}=e,d=c*t,b=l*t;return i>a-b&&i<o+b&&n>r-d&&n<s+d}class B{constructor(e,t){this._document=e,this._viewportRuler=t,this.positions=new Map}clear(){this.positions.clear()}cache(e){this.clear(),this.positions.set(this._document,{scrollPosition:this._viewportRuler.getViewportScrollPosition()}),e.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:I(e)})})}handleScroll(e){const t=e.target,n=this.positions.get(t);if(!n)return null;const i=t===this._document?t.documentElement:t,a=n.scrollPosition;let s,o;if(t===this._document){const e=this._viewportRuler.getViewportScrollPosition();s=e.top,o=e.left}else s=t.scrollTop,o=t.scrollLeft;const r=a.top-s,c=a.left-o;return this.positions.forEach((e,n)=>{e.clientRect&&t!==n&&i.contains(n)&&M(e.clientRect,r,c)}),a.top=s,a.left=o,{top:r,left:c}}}function H(e){const t=e.cloneNode(!0),n=t.querySelectorAll("[id]"),i=e.nodeName.toLowerCase();t.removeAttribute("id");for(let a=0;a<n.length;a++)n[a].removeAttribute("id");return"canvas"===i?A(e,t):"input"!==i&&"select"!==i&&"textarea"!==i||F(e,t),P("canvas",e,t,A),P("input, textarea, select",e,t,F),t}function P(e,t,n,i){const a=t.querySelectorAll(e);if(a.length){const t=n.querySelectorAll(e);for(let e=0;e<a.length;e++)i(a[e],t[e])}}function F(e,t){t.value=e.value}function A(e,t){const n=t.getContext("2d");if(n)try{n.drawImage(e,0,0)}catch(i){}}const R=Object(o.f)({passive:!0}),N=Object(o.f)({passive:!1});class E{constructor(e,t,n,i,a,s){this._config=t,this._document=n,this._ngZone=i,this._viewportRuler=a,this._dragDropRegistry=s,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._moveEvents=new c.a,this._pointerMoveSubscription=l.a.EMPTY,this._pointerUpSubscription=l.a.EMPTY,this._scrollSubscription=l.a.EMPTY,this._resizeSubscription=l.a.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 c.a,this.started=new c.a,this.released=new c.a,this.ended=new c.a,this.entered=new c.a,this.exited=new c.a,this.dropped=new c.a,this.moved=this._moveEvents.asObservable(),this._pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){const t=this._handles.find(t=>{const n=e.target;return!!n&&(n===t||t.contains(n))});!t||this._disabledHandles.has(t)||this.disabled||this._initializeDragSequence(t,e)}else this.disabled||this._initializeDragSequence(this._rootElement,e)},this._pointerMove=e=>{e.preventDefault();const t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging){if(Math.abs(t.x-this._pickupPositionOnPage.x)+Math.abs(t.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){if(!(Date.now()>=this._dragStartTime+this._getDragStartDelay(e)))return void this._endDragSequence(e);this._dropContainer&&this._dropContainer.isDragging()||(this._hasStartedDragging=!0,this._ngZone.run(()=>this._startDragSequence(e)))}return}this._boundaryElement&&(this._previewRect&&(this._previewRect.width||this._previewRect.height)||(this._previewRect=(this._preview||this._rootElement).getBoundingClientRect()));const n=this._getConstrainedPointerPosition(t);if(this._hasMoved=!0,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(n),this._dropContainer)this._updateActiveDropContainer(n,t);else{const e=this._activeTransform;e.x=n.x-this._pickupPositionOnPage.x+this._passiveTransform.x,e.y=n.y-this._pickupPositionOnPage.y+this._passiveTransform.y,this._applyRootElementTransform(e.x,e.y),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&this._rootElement.setAttribute("transform",`translate(${e.x} ${e.y})`)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:n,event:e,distance:this._getDragDistance(n),delta:this._pointerDirectionDelta})})},this._pointerUp=e=>{this._endDragSequence(e)},this.withRootElement(e),this._parentPositions=new B(n,a),s.registerDragItem(this)}get disabled(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)}set disabled(e){const t=Object(r.c)(e);t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions())}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){return this._handles=e.map(e=>Object(r.e)(e)),this._handles.forEach(e=>C(e,!1)),this._toggleNativeDragInteractions(),this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){const t=Object(r.e)(e);return t!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),this._ngZone.runOutsideAngular(()=>{t.addEventListener("mousedown",this._pointerDown,N),t.addEventListener("touchstart",this._pointerDown,R)}),this._initialTransform=void 0,this._rootElement=t),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?Object(r.e)(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&L(this._rootElement),L(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=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(e){this._handles.indexOf(e)>-1&&this._disabledHandles.add(e)}enableHandle(e){this._disabledHandles.delete(e)}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){const e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}_sortFromLastPointerPosition(){const e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){this._preview&&L(this._preview),this._previewRef&&this._previewRef.destroy(),this._preview=this._previewRef=null}_destroyPlaceholder(){this._placeholder&&L(this._placeholder),this._placeholderRef&&this._placeholderRef.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(e){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(e),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(e))})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this))))}_startDragSequence(e){z(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();const t=this._dropContainer;if(t){const e=this._rootElement,i=e.parentNode,a=this._preview=this._createPreviewElement(),s=this._placeholder=this._createPlaceholderElement(),o=this._anchor=this._anchor||this._document.createComment("");i.insertBefore(o,e),e.style.display="none",this._document.body.appendChild(i.replaceChild(s,e)),(n=this._document,n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement||n.body).appendChild(a),this.started.next({source:this}),t.start(),this._initialContainer=t,this._initialIndex=t.getItemIndex(this)}else this.started.next({source:this}),this._initialContainer=this._initialIndex=void 0;var n;this._parentPositions.cache(t?t.getScrollableParents():[])}_initializeDragSequence(e,t){t.stopPropagation();const n=this.isDragging(),i=z(t),a=!i&&0!==t.button,s=this._rootElement,o=!i&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now();if(t.target&&t.target.draggable&&"mousedown"===t.type&&t.preventDefault(),n||a||o)return;this._handles.length&&(this._rootElementTapHighlight=s.style.webkitTapHighlightColor||"",s.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(e=>{this._updateOnScroll(e)}),this._boundaryElement&&(this._boundaryRect=I(this._boundaryElement));const r=this._previewTemplate;this._pickupPositionInElement=r&&r.template&&!r.matchSize?{x:0,y:0}:this._getPointerPositionInElement(e,t);const c=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:c.x,y:c.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){this._rootElement.style.display="",this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._boundaryRect=this._previewRect=void 0,this._ngZone.run(()=>{const t=this._dropContainer,n=t.getItemIndex(this),i=this._getPointerPositionOnPage(e),a=this._getDragDistance(this._getPointerPositionOnPage(e)),s=t._isOverContainer(i.x,i.y);this.ended.next({source:this,distance:a}),this.dropped.next({item:this,currentIndex:n,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:s,distance:a}),t.drop(this,n,this._initialContainer,s,a,this._initialIndex),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:t},{x:n,y:i}){let a=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!a&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(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,e,t,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,e,t,this._pointerDirectionDelta),this._preview.style.transform=V(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y)}_createPreviewElement(){const e=this._previewTemplate,t=this.previewClass,n=e?e.template:null;let i;if(n&&e){const t=e.matchSize?this._rootElement.getBoundingClientRect():null,a=e.viewContainer.createEmbeddedView(n,e.context);a.detectChanges(),i=j(a,this._document),this._previewRef=a,e.matchSize?U(i,t):i.style.transform=V(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else{const e=this._rootElement;i=H(e),U(i,e.getBoundingClientRect())}return T(i.style,{pointerEvents:"none",margin:"0",position:"fixed",top:"0",left:"0",zIndex:""+(this._config.zIndex||1e3)}),C(i,!1),i.classList.add("cdk-drag-preview"),i.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(e=>i.classList.add(e)):i.classList.add(t)),i}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const e=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._preview.style.transform=V(e.left,e.top);const t=function(e){const t=getComputedStyle(e),n=x(t,"transition-property"),i=n.find(e=>"transform"===e||"all"===e);if(!i)return 0;const a=n.indexOf(i),s=x(t,"transition-duration"),o=x(t,"transition-delay");return w(s[a])+w(o[a])}(this._preview);return 0===t?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(e=>{const n=t=>{(!t||t.target===this._preview&&"transform"===t.propertyName)&&(this._preview.removeEventListener("transitionend",n),e(),clearTimeout(i))},i=setTimeout(n,1.5*t);this._preview.addEventListener("transitionend",n)}))}_createPlaceholderElement(){const e=this._placeholderTemplate,t=e?e.template:null;let n;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),n=j(this._placeholderRef,this._document)):n=H(this._rootElement),n.classList.add("cdk-drag-placeholder"),n}_getPointerPositionInElement(e,t){const n=this._rootElement.getBoundingClientRect(),i=e===this._rootElement?null:e,a=i?i.getBoundingClientRect():n,s=z(t)?t.targetTouches[0]:t,o=this._getViewportScrollPosition();return{x:a.left-n.left+(s.pageX-a.left-o.left),y:a.top-n.top+(s.pageY-a.top-o.top)}}_getPointerPositionOnPage(e){const t=this._getViewportScrollPosition(),n=z(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,i=n.pageX-t.left,a=n.pageY-t.top;if(this._ownerSVGElement){const e=this._ownerSVGElement.getScreenCTM();if(e){const t=this._ownerSVGElement.createSVGPoint();return t.x=i,t.y=a,t.matrixTransform(e.inverse())}}return{x:i,y:a}}_getConstrainedPointerPosition(e){const t=this._dropContainer?this._dropContainer.lockAxis:null;let{x:n,y:i}=this.constrainPosition?this.constrainPosition(e,this):e;if("x"===this.lockAxis||"x"===t?i=this._pickupPositionOnPage.y:"y"!==this.lockAxis&&"y"!==t||(n=this._pickupPositionOnPage.x),this._boundaryRect){const{x:e,y:t}=this._pickupPositionInElement,a=this._boundaryRect,s=this._previewRect,o=a.top+t,r=a.bottom-(s.height-t);n=$(n,a.left+e,a.right-(s.width-e)),i=$(i,o,r)}return{x:n,y:i}}_updatePointerDirectionDelta(e){const{x:t,y:n}=e,i=this._pointerDirectionDelta,a=this._pointerPositionAtLastDirectionChange,s=Math.abs(t-a.x),o=Math.abs(n-a.y);return s>this._config.pointerDirectionChangeThreshold&&(i.x=t>a.x?1:-1,a.x=t),o>this._config.pointerDirectionChangeThreshold&&(i.y=n>a.y?1:-1,a.y=n),i}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,C(this._rootElement,e))}_removeRootElementListeners(e){e.removeEventListener("mousedown",this._pointerDown,N),e.removeEventListener("touchstart",this._pointerDown,R)}_applyRootElementTransform(e,t){const n=V(e,t);null==this._initialTransform&&(this._initialTransform=this._rootElement.style.transform||""),this._rootElement.style.transform=this._initialTransform?n+" "+this._initialTransform:n}_getDragDistance(e){const t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(0===e&&0===t||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,s=i.right-n.right,o=n.top-i.top,r=i.bottom-n.bottom;n.width>i.width?(a>0&&(e+=a),s>0&&(e-=s)):e=0,n.height>i.height?(o>0&&(t+=o),r>0&&(t-=r)):t=0,e===this._passiveTransform.x&&t===this._passiveTransform.y||this.setFreeDragPosition({y:t,x:e})}_getDragStartDelay(e){const t=this.dragStartDelay;return"number"==typeof t?t:z(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){const t=this._parentPositions.handleScroll(e);if(t){const n=e.target;this._boundaryRect&&(n===this._document||n!==this._boundaryElement&&n.contains(this._boundaryElement))&&M(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){const e=this._parentPositions.positions.get(this._document);return e?e.scrollPosition:this._viewportRuler.getViewportScrollPosition()}}function V(e,t){return`translate3d(${Math.round(e)}px, ${Math.round(t)}px, 0)`}function $(e,t,n){return Math.max(t,Math.min(n,e))}function L(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function z(e){return"t"===e.type[0]}function j(e,t){const n=e.rootNodes;if(1===n.length&&n[0].nodeType===t.ELEMENT_NODE)return n[0];const i=t.createElement("div");return n.forEach(e=>i.appendChild(e)),i}function U(e,t){e.style.width=t.width+"px",e.style.height=t.height+"px",e.style.transform=V(t.left,t.top)}function q(e,t,n){const i=G(t,e.length-1),a=G(n,e.length-1);if(i===a)return;const s=e[i],o=a<i?-1:1;for(let r=i;r!==a;r+=o)e[r]=e[r+o];e[a]=s}function G(e,t){return Math.max(0,Math.min(t,e))}class Y{constructor(e,t,n,i,a){this._dragDropRegistry=t,this._ngZone=i,this._viewportRuler=a,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.enterPredicate=()=>!0,this.beforeStarted=new c.a,this.entered=new c.a,this.exited=new c.a,this.dropped=new c.a,this.sorted=new c.a,this._isDragging=!1,this._itemPositions=[],this._previousSwap={drag:null,delta:0,overlaps:!1},this._siblings=[],this._orientation="vertical",this._activeSiblings=new Set,this._direction="ltr",this._viewportScrollSubscription=l.a.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new c.a,this._cachedShadowRoot=null,this._startScrollInterval=()=>{this._stopScrolling(),function(e=0,t=b.a){return(!Object(u.a)(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=b.a),new d.a(n=>(n.add(t.schedule(h,e,{subscriber:n,counter:0,period:e})),n))}(0,p.a).pipe(Object(m.a)(this._stopScrollTimers)).subscribe(()=>{const e=this._scrollNode;1===this._verticalScrollDirection?Q(e,-2):2===this._verticalScrollDirection&&Q(e,2),1===this._horizontalScrollDirection?J(e,-2):2===this._horizontalScrollDirection&&J(e,2)})},this.element=Object(r.e)(e),this._document=n,this.withScrollableParents([this.element]),t.registerDropContainer(this),this._parentPositions=new B(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(){const e=Object(r.e)(this.element).style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._cacheItems(),this._siblings.forEach(e=>e._startReceiving(this)),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}enter(e,t,n,i){let a;this.start(),null==i?(a=this.sortingDisabled?this._draggables.indexOf(e):-1,-1===a&&(a=this._getItemIndexFromPointerPosition(e,t,n))):a=i;const s=this._activeDraggables,o=s.indexOf(e),c=e.getPlaceholderElement();let l=s[a];if(l===e&&(l=s[a+1]),o>-1&&s.splice(o,1),l&&!this._dragDropRegistry.isDragging(l)){const t=l.getRootElement();t.parentElement.insertBefore(c,t),s.splice(a,0,e)}else if(this._shouldEnterAsFirstChild(t,n)){const t=s[0].getRootElement();t.parentNode.insertBefore(c,t),s.unshift(e)}else Object(r.e)(this.element).appendChild(c),s.push(e);c.style.transform="",this._cacheItemPositions(),this._cacheParentPositions(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,t,n,i,a,s){this._reset(),null==s&&(s=n.getItemIndex(e)),this.dropped.next({item:e,currentIndex:t,previousIndex:s,container:this,previousContainer:n,isPointerOverContainer:i,distance:a})}withItems(e){const t=this._draggables;return this._draggables=e,e.forEach(e=>e._withDropContainer(this)),this.isDragging()&&(t.filter(e=>e.isDragging()).every(t=>-1===e.indexOf(t))?this._reset():this._cacheItems()),this}withDirection(e){return this._direction=e,this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){return this._orientation=e,this}withScrollableParents(e){const t=Object(r.e)(this.element);return this._scrollableElements=-1===e.indexOf(t)?[t,...e]:e.slice(),this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?X("horizontal"===this._orientation&&"rtl"===this._direction?this._itemPositions.slice().reverse():this._itemPositions,t=>t.drag===e):this._draggables.indexOf(e)}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,n,i){if(this.sortingDisabled||!D(this._clientRect,.05,t,n))return;const a=this._itemPositions,s=this._getItemIndexFromPointerPosition(e,t,n,i);if(-1===s&&a.length>0)return;const o="horizontal"===this._orientation,r=X(a,t=>t.drag===e),c=a[s],l=c.clientRect,d=r>s?1:-1,b=this._getItemOffsetPx(a[r].clientRect,l,d),u=this._getSiblingOffsetPx(r,a,d),h=a.slice();q(a,r,s),this.sorted.next({previousIndex:r,currentIndex:s,container:this,item:e}),a.forEach((t,n)=>{if(h[n]===t)return;const i=t.drag===e,a=i?b:u,s=i?e.getPlaceholderElement():t.drag.getRootElement();t.offset+=a,o?(s.style.transform=`translate3d(${Math.round(t.offset)}px, 0, 0)`,M(t.clientRect,0,a)):(s.style.transform=`translate3d(0, ${Math.round(t.offset)}px, 0)`,M(t.clientRect,a,0))}),this._previousSwap.overlaps=O(l,t,n),this._previousSwap.drag=c.drag,this._previousSwap.delta=o?i.x:i.y}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let n,i=0,a=0;if(this._parentPositions.positions.forEach((s,o)=>{o!==this._document&&s.clientRect&&!n&&D(s.clientRect,.05,e,t)&&([i,a]=function(e,t,n,i){const a=K(t,i),s=W(t,n);let o=0,r=0;if(a){const t=e.scrollTop;1===a?t>0&&(o=1):e.scrollHeight-t>e.clientHeight&&(o=2)}if(s){const t=e.scrollLeft;1===s?t>0&&(r=1):e.scrollWidth-t>e.clientWidth&&(r=2)}return[o,r]}(o,s.clientRect,e,t),(i||a)&&(n=o))}),!i&&!a){const{width:s,height:o}=this._viewportRuler.getViewportSize(),r={width:s,height:o,top:0,right:s,bottom:o,left:0};i=K(r,t),a=W(r,e),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()}_cacheParentPositions(){const e=Object(r.e)(this.element);this._parentPositions.cache(this._scrollableElements),this._clientRect=this._parentPositions.positions.get(e).clientRect}_cacheItemPositions(){const e="horizontal"===this._orientation;this._itemPositions=this._activeDraggables.map(e=>{const t=e.getVisibleElement();return{drag:e,offset:0,clientRect:I(t)}}).sort((t,n)=>e?t.clientRect.left-n.clientRect.left:t.clientRect.top-n.clientRect.top)}_reset(){this._isDragging=!1;const e=Object(r.e)(this.element).style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._activeDraggables.forEach(e=>{const t=e.getRootElement();t&&(t.style.transform="")}),this._siblings.forEach(e=>e._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(e,t,n){const i="horizontal"===this._orientation,a=t[e].clientRect,s=t[e+-1*n];let o=a[i?"width":"height"]*n;if(s){const e=i?"left":"top",t=i?"right":"bottom";-1===n?o-=s.clientRect[e]-a[t]:o+=a[e]-s.clientRect[t]}return o}_getItemOffsetPx(e,t,n){const i="horizontal"===this._orientation;let a=i?t.left-e.left:t.top-e.top;return-1===n&&(a+=i?t.width-e.width:t.height-e.height),a}_shouldEnterAsFirstChild(e,t){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?e>=a.right:t>=a.bottom}{const a=n[0].clientRect;return i?e<=a.left:t<=a.top}}_getItemIndexFromPointerPosition(e,t,n,i){const a="horizontal"===this._orientation;return X(this._itemPositions,({drag:s,clientRect:o},r,c)=>{if(s===e)return c.length<2;if(i){const e=a?i.x:i.y;if(s===this._previousSwap.drag&&this._previousSwap.overlaps&&e===this._previousSwap.delta)return!1}return a?t>=Math.floor(o.left)&&t<Math.floor(o.right):n>=Math.floor(o.top)&&n<Math.floor(o.bottom)})}_cacheItems(){this._activeDraggables=this._draggables.slice(),this._cacheItemPositions(),this._cacheParentPositions()}_isOverContainer(e,t){return O(this._clientRect,e,t)}_getSiblingContainerFromPosition(e,t,n){return this._siblings.find(i=>i._canReceive(e,t,n))}_canReceive(e,t,n){if(!O(this._clientRect,t,n)||!this.enterPredicate(e,this))return!1;const i=this._getShadowRoot().elementFromPoint(t,n);if(!i)return!1;const a=Object(r.e)(this.element);return i===a||a.contains(i)}_startReceiving(e){const t=this._activeSiblings;t.has(e)||(t.add(e),this._cacheParentPositions(),this._listenToScrollEvents())}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe()}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scroll.subscribe(e=>{if(this.isDragging()){const t=this._parentPositions.handleScroll(e);t&&(this._itemPositions.forEach(({clientRect:e})=>{M(e,t.top,t.left)}),this._itemPositions.forEach(({drag:e})=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition()}))}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){const e=Object(o.c)(Object(r.e)(this.element));this._cachedShadowRoot=e||this._document}return this._cachedShadowRoot}}function X(e,t){for(let n=0;n<e.length;n++)if(t(e[n],n,e))return n;return-1}function Q(e,t){e===window?e.scrollBy(0,t):e.scrollTop+=t}function J(e,t){e===window?e.scrollBy(t,0):e.scrollLeft+=t}function K(e,t){const{top:n,bottom:i,height:a}=e,s=.05*a;return t>=n-s&&t<=n+s?1:t>=i-s&&t<=i+s?2:0}function W(e,t){const{left:n,right:i,width:a}=e,s=.05*a;return t>=n-s&&t<=n+s?1:t>=i-s&&t<=i+s?2:0}const Z=Object(o.f)({passive:!1,capture:!0});let ee=(()=>{class e{constructor(e,t){this._ngZone=e,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=new Set,this._globalListeners=new Map,this.pointerMove=new c.a,this.pointerUp=new c.a,this.scroll=new c.a,this._preventDefaultWhileDragging=e=>{this._activeDragInstances.size&&e.preventDefault()},this._document=t}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),1===this._dragInstances.size&&this._ngZone.runOutsideAngular(()=>{this._document.addEventListener("touchmove",this._preventDefaultWhileDragging,Z)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),0===this._dragInstances.size&&this._document.removeEventListener("touchmove",this._preventDefaultWhileDragging,Z)}startDragging(e,t){if(!this._activeDragInstances.has(e)&&(this._activeDragInstances.add(e),1===this._activeDragInstances.size)){const e=t.type.startsWith("touch"),n=e?"touchend":"mouseup";this._globalListeners.set(e?"touchmove":"mousemove",{handler:e=>this.pointerMove.next(e),options:Z}).set(n,{handler:e=>this.pointerUp.next(e),options:!0}).set("scroll",{handler:e=>this.scroll.next(e),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:Z}),this._ngZone.runOutsideAngular(()=>{this._globalListeners.forEach((e,t)=>{this._document.addEventListener(t,e.handler,e.options)})})}}stopDragging(e){this._activeDragInstances.delete(e),0===this._activeDragInstances.size&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances.has(e)}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach((e,t)=>{this._document.removeEventListener(t,e.handler,e.options)}),this._globalListeners.clear()}}return e.\u0275fac=function(t){return new(t||e)(i.Xb(i.A),i.Xb(a.e))},e.\u0275prov=Object(i.Jb)({factory:function(){return new e(Object(i.Xb)(i.A),Object(i.Xb)(a.e))},token:e,providedIn:"root"}),e})();const te={dragStartThreshold:5,pointerDirectionChangeThreshold:5};let ne=(()=>{class e{constructor(e,t,n,i){this._document=e,this._ngZone=t,this._viewportRuler=n,this._dragDropRegistry=i}createDrag(e,t=te){return new E(e,t,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(e){return new Y(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}return e.\u0275fac=function(t){return new(t||e)(i.Xb(a.e),i.Xb(i.A),i.Xb(s.e),i.Xb(ee))},e.\u0275prov=Object(i.Jb)({factory:function(){return new e(Object(i.Xb)(a.e),Object(i.Xb)(i.A),Object(i.Xb)(s.e),Object(i.Xb)(ee))},token:e,providedIn:"root"}),e})();const ie=new i.r("CdkDropListGroup"),ae=new i.r("CDK_DRAG_CONFIG");let se=0;const oe=new i.r("CdkDropList");let re=(()=>{class e{constructor(t,n,a,s,o,r,l){this.element=t,this._changeDetectorRef=a,this._dir=s,this._group=o,this._scrollDispatcher=r,this._destroyed=new c.a,this.connectedTo=[],this.id="cdk-drop-list-"+se++,this.enterPredicate=()=>!0,this.dropped=new i.n,this.entered=new i.n,this.exited=new i.n,this.sorted=new i.n,this._unsortedItems=new Set,this._dropListRef=n.createDropList(t),this._dropListRef.data=this,l&&this._assignDefaults(l),this._dropListRef.enterPredicate=(e,t)=>this.enterPredicate(e.data,t.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),e._dropLists.push(this),o&&o._items.add(this)}get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=Object(r.c)(e)}addItem(e){this._unsortedItems.add(e),this._dropListRef.isDragging()&&this._syncItemsWithRef()}removeItem(e){this._unsortedItems.delete(e),this._dropListRef.isDragging()&&this._syncItemsWithRef()}getSortedItems(){return Array.from(this._unsortedItems).sort((e,t)=>e._dragRef.getVisibleElement().compareDocumentPosition(t._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){const t=e._dropLists.indexOf(this);t>-1&&e._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(t){this._dir&&this._dir.change.pipe(Object(f.a)(this._dir.value),Object(m.a)(this._destroyed)).subscribe(e=>t.withDirection(e)),t.beforeStarted.subscribe(()=>{const n=Object(r.b)(this.connectedTo).map(t=>{if("string"==typeof t){const n=e._dropLists.find(e=>e.id===t);return!n&&Object(i.X)()&&console.warn(`CdkDropList could not find connected drop list with id "${t}"`),n}return t});if(this._group&&this._group._items.forEach(e=>{-1===n.indexOf(e)&&n.push(e)}),!this._scrollableParentsResolved&&this._scrollDispatcher){const e=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(e=>e.getElementRef().nativeElement);this._dropListRef.withScrollableParents(e),this._scrollableParentsResolved=!0}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=Object(r.c)(this.sortingDisabled),t.autoScrollDisabled=Object(r.c)(this.autoScrollDisabled),t.connectedTo(n.filter(e=>e&&e!==this).map(e=>e._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(e=>{this.entered.emit({container:this,item:e.item.data,currentIndex:e.currentIndex})}),e.exited.subscribe(e=>{this.exited.emit({container:this,item:e.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(e=>{this.sorted.emit({previousIndex:e.previousIndex,currentIndex:e.currentIndex,container:this,item:e.item.data})}),e.dropped.subscribe(e=>{this.dropped.emit({previousIndex:e.previousIndex,currentIndex:e.currentIndex,previousContainer:e.previousContainer.data,container:e.container.data,item:e.item.data,isPointerOverContainer:e.isPointerOverContainer,distance:e.distance}),this._changeDetectorRef.markForCheck()})}_assignDefaults(e){const{lockAxis:t,draggingDisabled:n,sortingDisabled:i,listAutoScrollDisabled:a,listOrientation:s}=e;this.disabled=null!=n&&n,this.sortingDisabled=null!=i&&i,this.autoScrollDisabled=null!=a&&a,this.orientation=s||"vertical",t&&(this.lockAxis=t)}_syncItemsWithRef(){this._dropListRef.withItems(this.getSortedItems().map(e=>e._dragRef))}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(i.l),i.Nb(ne),i.Nb(i.h),i.Nb(k.c,8),i.Nb(ie,12),i.Nb(s.c),i.Nb(ae,8))},e.\u0275dir=i.Ib({type:e,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(e,t){2&e&&(i.Wb("id",t.id),i.Fb("cdk-drop-list-disabled",t.disabled)("cdk-drop-list-dragging",t._dropListRef.isDragging())("cdk-drop-list-receiving",t._dropListRef.isReceiving()))},inputs:{connectedTo:["cdkDropListConnectedTo","connectedTo"],id:"id",enterPredicate:["cdkDropListEnterPredicate","enterPredicate"],disabled:["cdkDropListDisabled","disabled"],sortingDisabled:["cdkDropListSortingDisabled","sortingDisabled"],autoScrollDisabled:["cdkDropListAutoScrollDisabled","autoScrollDisabled"],orientation:["cdkDropListOrientation","orientation"],lockAxis:["cdkDropListLockAxis","lockAxis"],data:["cdkDropListData","data"]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[i.Ab([{provide:ie,useValue:void 0},{provide:oe,useExisting:e}])]}),e._dropLists=[],e})();const ce=new i.r("CDK_DRAG_PARENT"),le=new i.r("CdkDragHandle");let de=(()=>{class e{constructor(e,t){this.element=e,this._stateChanges=new c.a,this._disabled=!1,this._parentDrag=t,C(e.nativeElement,!1)}get disabled(){return this._disabled}set disabled(e){this._disabled=Object(r.c)(e),this._stateChanges.next(this)}ngOnDestroy(){this._stateChanges.complete()}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(i.l),i.Nb(ce,12))},e.\u0275dir=i.Ib({type:e,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:["cdkDragHandleDisabled","disabled"]},features:[i.Ab([{provide:le,useExisting:e}])]}),e})();const be=new i.r("CdkDragPlaceholder"),ue=new i.r("CdkDragPreview");let he=(()=>{class e{constructor(e){this.templateRef=e,this._matchSize=!1}get matchSize(){return this._matchSize}set matchSize(e){this._matchSize=Object(r.c)(e)}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(i.N))},e.\u0275dir=i.Ib({type:e,selectors:[["ng-template","cdkDragPreview",""]],inputs:{matchSize:"matchSize",data:"data"},features:[i.Ab([{provide:ue,useExisting:e}])]}),e})(),pe=(()=>{class e{constructor(e,t,n,a,s,o,r,l,b,u){this.element=e,this.dropContainer=t,this._document=n,this._ngZone=a,this._viewContainerRef=s,this._dir=r,this._changeDetectorRef=b,this._selfHandle=u,this._destroyed=new c.a,this.started=new i.n,this.released=new i.n,this.ended=new i.n,this.entered=new i.n,this.exited=new i.n,this.dropped=new i.n,this.moved=new d.a(e=>{const t=this._dragRef.moved.pipe(Object(v.a)(e=>({source:this,pointerPosition:e.pointerPosition,event:e.event,delta:e.delta,distance:e.distance}))).subscribe(e);return()=>{t.unsubscribe()}}),this._dragRef=l.createDrag(e,{dragStartThreshold:o&&null!=o.dragStartThreshold?o.dragStartThreshold:5,pointerDirectionChangeThreshold:o&&null!=o.pointerDirectionChangeThreshold?o.pointerDirectionChangeThreshold:5,zIndex:null==o?void 0:o.zIndex}),this._dragRef.data=this,o&&this._assignDefaults(o),t&&(this._dragRef._withDropContainer(t._dropListRef),t.addItem(this)),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}get disabled(){return this._disabled||this.dropContainer&&this.dropContainer.disabled}set disabled(e){this._disabled=Object(r.c)(e),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.asObservable().pipe(Object(_.a)(1),Object(m.a)(this._destroyed)).subscribe(()=>{this._updateRootElement(),this._handles.changes.pipe(Object(f.a)(this._handles),Object(S.a)(e=>{const t=e.filter(e=>e._parentDrag===this).map(e=>e.element);this._selfHandle&&this.rootElementSelector&&t.push(this.element),this._dragRef.withHandles(t)}),Object(y.a)(e=>Object(g.a)(...e.map(e=>e._stateChanges.pipe(Object(f.a)(e))))),Object(m.a)(this._destroyed)).subscribe(e=>{const t=this._dragRef,n=e.element.nativeElement;e.disabled?t.disableHandle(n):t.enableHandle(n)}),this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)})}ngOnChanges(e){const t=e.rootElementSelector,n=e.freeDragPosition;t&&!t.firstChange&&this._updateRootElement(),n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()}_updateRootElement(){const e=this.element.nativeElement,t=this.rootElementSelector?ge(e,this.rootElementSelector):e;if(t&&t.nodeType!==this._document.ELEMENT_NODE)throw Error(`cdkDrag must be attached to an element node. Currently attached to "${t.nodeName}".`);this._dragRef.withRootElement(t||e)}_getBoundaryElement(){const e=this.boundaryElement;if(!e)return null;if("string"==typeof e)return ge(this.element.nativeElement,e);const t=Object(r.e)(e);if(Object(i.X)()&&!t.contains(this.element.nativeElement))throw Error("Draggable element is not inside of the node passed into cdkDragBoundary.");return t}_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:Object(r.f)(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(i).withPreviewTemplate(a),t&&e.withDirection(t.value)}})}_handleEvents(e){e.started.subscribe(()=>{this.started.emit({source:this}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(()=>{this.released.emit({source:this})}),e.ended.subscribe(e=>{this.ended.emit({source:this,distance:e.distance}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(e=>{this.entered.emit({container:e.container.data,item:this,currentIndex:e.currentIndex})}),e.exited.subscribe(e=>{this.exited.emit({container:e.container.data,item:this})}),e.dropped.subscribe(e=>{this.dropped.emit({previousIndex:e.previousIndex,currentIndex:e.currentIndex,previousContainer:e.previousContainer.data,container:e.container.data,isPointerOverContainer:e.isPointerOverContainer,item:this,distance:e.distance})})}_assignDefaults(e){const{lockAxis:t,dragStartDelay:n,constrainPosition:i,previewClass:a,boundaryElement:s,draggingDisabled:o,rootElementSelector:r}=e;this.disabled=null!=o&&o,this.dragStartDelay=n||0,t&&(this.lockAxis=t),i&&(this.constrainPosition=i),a&&(this.previewClass=a),s&&(this.boundaryElement=s),r&&(this.rootElementSelector=r)}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(i.l),i.Nb(oe,12),i.Nb(a.e),i.Nb(i.A),i.Nb(i.R),i.Nb(ae,8),i.Nb(k.c,8),i.Nb(ne),i.Nb(i.h),i.Nb(le,10))},e.\u0275dir=i.Ib({type:e,selectors:[["","cdkDrag",""]],contentQueries:function(e,t,n){var a;1&e&&(i.Gb(n,ue,!0),i.Gb(n,be,!0),i.Gb(n,le,!0)),2&e&&(i.rc(a=i.bc())&&(t._previewTemplate=a.first),i.rc(a=i.bc())&&(t._placeholderTemplate=a.first),i.rc(a=i.bc())&&(t._handles=a))},hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(e,t){2&e&&i.Fb("cdk-drag-disabled",t.disabled)("cdk-drag-dragging",t._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.Ab([{provide:ce,useExisting:e}]),i.zb]}),e})();function ge(e,t){let n=e.parentElement;for(;n;){if(n.matches?n.matches(t):n.msMatchesSelector(t))return n;n=n.parentElement}return null}let me=(()=>{class e{}return e.\u0275mod=i.Lb({type:e}),e.\u0275inj=i.Kb({factory:function(t){return new(t||e)},providers:[ne],imports:[s.b]}),e})()},"6SKC":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("4Ait"),a=n("fXoL");let s=(()=>{class e{transform(e=0,t){return isNaN(parseFloat(String(e)))||!isFinite(e)?"-":Object(i.a)(e,t)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275pipe=a.Mb({name:"formattedFileSize",type:e,pure:!0}),e})()},"7EHt":function(e,t,n){"use strict";n.d(t,"a",(function(){return z})),n.d(t,"b",(function(){return U})),n.d(t,"c",(function(){return E})),n.d(t,"d",(function(){return V})),n.d(t,"e",(function(){return $})),n.d(t,"f",(function(){return L}));var i=n("fXoL"),a=n("8LU1"),s=n("XNiG"),o=n("quSY"),r=n("0EQZ");let c=0;const l=new i.r("CdkAccordion");let d=(()=>{class e{constructor(){this._stateChanges=new s.a,this._openCloseAllActions=new s.a,this.id="cdk-accordion-"+c++,this._multi=!1}get multi(){return this._multi}set multi(e){this._multi=Object(a.c)(e)}openAll(){this._openCloseAll(!0)}closeAll(){this._openCloseAll(!1)}ngOnChanges(e){this._stateChanges.next(e)}ngOnDestroy(){this._stateChanges.complete()}_openCloseAll(e){this.multi&&this._openCloseAllActions.next(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Ib({type:e,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:"multi"},exportAs:["cdkAccordion"],features:[i.Ab([{provide:l,useExisting:e}]),i.zb]}),e})(),b=0,u=(()=>{class e{constructor(e,t,n){this.accordion=e,this._changeDetectorRef=t,this._expansionDispatcher=n,this._openCloseAllSubscription=o.a.EMPTY,this.closed=new i.n,this.opened=new i.n,this.destroyed=new i.n,this.expandedChange=new i.n,this.id="cdk-accordion-child-"+b++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=n.listen((e,t)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===t&&this.id!==e&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(e){e=Object(a.c)(e),this._expanded!==e&&(this._expanded=e,this.expandedChange.emit(e),e?(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(e){this._disabled=Object(a.c)(e)}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(e=>{this.disabled||(this.expanded=e)})}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(l,12),i.Nb(i.h),i.Nb(r.c))},e.\u0275dir=i.Ib({type:e,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[i.Ab([{provide:l,useValue:void 0}])]}),e})(),h=(()=>{class e{}return e.\u0275mod=i.Lb({type:e}),e.\u0275inj=i.Kb({factory:function(t){return new(t||e)}}),e})();var p=n("+rOU"),g=n("ofXK"),m=n("u47x"),f=n("FtGj"),v=n("/uUt"),_=n("JX91"),S=n("pLZG"),y=n("IzEk"),k=n("R1ws"),T=n("EY2u"),C=n("VRyK"),w=n("R0Ic");const x=["body"];function I(e,t){}const O=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],M=["mat-expansion-panel-header","*","mat-action-row"];function D(e,t){if(1&e&&i.Ob(0,"span",2),2&e){const e=i.ec();i.kc("@indicatorRotate",e._getExpandedState())}}const B=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],H=["mat-panel-title","mat-panel-description","*"],P=new i.r("MAT_ACCORDION"),F={indicatorRotate:Object(w.m)("indicatorRotate",[Object(w.j)("collapsed, void",Object(w.k)({transform:"rotate(0deg)"})),Object(w.j)("expanded",Object(w.k)({transform:"rotate(180deg)"})),Object(w.l)("expanded <=> collapsed, void => collapsed",Object(w.e)("225ms cubic-bezier(0.4,0.0,0.2,1)"))]),bodyExpansion:Object(w.m)("bodyExpansion",[Object(w.j)("collapsed, void",Object(w.k)({height:"0px",visibility:"hidden"})),Object(w.j)("expanded",Object(w.k)({height:"*",visibility:"visible"})),Object(w.l)("expanded <=> collapsed, void => collapsed",Object(w.e)("225ms cubic-bezier(0.4,0.0,0.2,1)"))])};let A=(()=>{class e{constructor(e){this._template=e}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(i.N))},e.\u0275dir=i.Ib({type:e,selectors:[["ng-template","matExpansionPanelContent",""]]}),e})(),R=0;const N=new i.r("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let E=(()=>{class e extends u{constructor(e,t,n,a,o,r,c){super(e,t,n),this._viewContainerRef=a,this._animationMode=r,this._hideToggle=!1,this.afterExpand=new i.n,this.afterCollapse=new i.n,this._inputChanges=new s.a,this._headerId="mat-expansion-panel-header-"+R++,this._bodyAnimationDone=new s.a,this.accordion=e,this._document=o,this._bodyAnimationDone.pipe(Object(v.a)((e,t)=>e.fromState===t.fromState&&e.toState===t.toState)).subscribe(e=>{"void"!==e.fromState&&("expanded"===e.toState?this.afterExpand.emit():"collapsed"===e.toState&&this.afterCollapse.emit())}),c&&(this.hideToggle=c.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=Object(a.c)(e)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e}_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(Object(_.a)(null),Object(S.a)(()=>this.expanded&&!this._portal),Object(y.a)(1)).subscribe(()=>{this._portal=new p.i(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(e){this._inputChanges.next(e)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const e=this._document.activeElement,t=this._body.nativeElement;return e===t||t.contains(e)}return!1}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(P,12),i.Nb(i.h),i.Nb(r.c),i.Nb(i.R),i.Nb(g.e),i.Nb(k.a,8),i.Nb(N,8))},e.\u0275cmp=i.Hb({type:e,selectors:[["mat-expansion-panel"]],contentQueries:function(e,t,n){var a;1&e&&i.Gb(n,A,!0),2&e&&i.rc(a=i.bc())&&(t._lazyContent=a.first)},viewQuery:function(e,t){var n;1&e&&i.Nc(x,!0),2&e&&i.rc(n=i.bc())&&(t._body=n.first)},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(e,t){2&e&&i.Fb("mat-expanded",t.expanded)("_mat-animation-noopable","NoopAnimations"===t._animationMode)("mat-expansion-panel-spacing",t._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.Ab([{provide:P,useValue:void 0}]),i.yb,i.zb],ngContentSelectors:M,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(e,t){1&e&&(i.jc(O),i.ic(0),i.Tb(1,"div",0,1),i.ac("@bodyExpansion.done",(function(e){return t._bodyAnimationDone.next(e)})),i.Tb(3,"div",2),i.ic(4,1),i.Fc(5,I,0,0,"ng-template",3),i.Sb(),i.ic(6,2),i.Sb()),2&e&&(i.Bb(1),i.kc("@bodyExpansion",t._getExpandedState())("id",t.id),i.Cb("aria-labelledby",t._headerId),i.Bb(4),i.kc("cdkPortalOutlet",t._portal))},directives:[p.c],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:[F.bodyExpansion]},changeDetection:0}),e})(),V=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Ib({type:e,selectors:[["mat-action-row"]],hostAttrs:[1,"mat-action-row"]}),e})(),$=(()=>{class e{constructor(e,t,n,i,a,s){this.panel=e,this._element=t,this._focusMonitor=n,this._changeDetectorRef=i,this._animationMode=s,this._parentChangeSubscription=o.a.EMPTY;const r=e.accordion?e.accordion._stateChanges.pipe(Object(S.a)(e=>!(!e.hideToggle&&!e.togglePosition))):T.a;this._parentChangeSubscription=Object(C.a)(e.opened,e.closed,r,e._inputChanges.pipe(Object(S.a)(e=>!!(e.hideToggle||e.disabled||e.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),e.closed.pipe(Object(S.a)(()=>e._containsFocus())).subscribe(()=>n.focusVia(t,"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 e=this._isExpanded();return e&&this.expandedHeight?this.expandedHeight:!e&&this.collapsedHeight?this.collapsedHeight:null}_keydown(e){switch(e.keyCode){case f.n:case f.f:Object(f.s)(e)||(e.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(e))}}focus(e="program",t){this._focusMonitor.focusVia(this._element,e,t)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(e=>{e&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(E,1),i.Nb(i.l),i.Nb(m.h),i.Nb(i.h),i.Nb(N,8),i.Nb(k.a,8))},e.\u0275cmp=i.Hb({type:e,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(e,t){1&e&&i.ac("click",(function(){return t._toggle()}))("keydown",(function(e){return t._keydown(e)})),2&e&&(i.Cb("id",t.panel._headerId)("tabindex",t.disabled?-1:0)("aria-controls",t._getPanelId())("aria-expanded",t._isExpanded())("aria-disabled",t.panel.disabled),i.Cc("height",t._getHeaderHeight()),i.Fb("mat-expanded",t._isExpanded())("mat-expansion-toggle-indicator-after","after"===t._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===t._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===t._animationMode))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},ngContentSelectors:H,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(e,t){1&e&&(i.jc(B),i.Tb(0,"span",0),i.ic(1),i.ic(2,1),i.ic(3,2),i.Sb(),i.Fc(4,D,1,1,"span",1)),2&e&&(i.Bb(4),i.kc("ngIf",t._showToggle()))},directives:[g.t],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}\n'],encapsulation:2,data:{animation:[F.indicatorRotate]},changeDetection:0}),e})(),L=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=i.Ib({type:e,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),e})(),z=(()=>{class e extends d{constructor(){super(...arguments),this._ownHeaders=new i.E,this._hideToggle=!1,this.displayMode="default",this.togglePosition="after"}get hideToggle(){return this._hideToggle}set hideToggle(e){this._hideToggle=Object(a.c)(e)}ngAfterContentInit(){this._headers.changes.pipe(Object(_.a)(this._headers)).subscribe(e=>{this._ownHeaders.reset(e.filter(e=>e.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new m.g(this._ownHeaders).withWrap()}_handleHeaderKeydown(e){const{keyCode:t}=e,n=this._keyManager;t===f.h?Object(f.s)(e)||(n.setFirstItemActive(),e.preventDefault()):t===f.e?Object(f.s)(e)||(n.setLastItemActive(),e.preventDefault()):this._keyManager.onKeydown(e)}_handleHeaderFocus(e){this._keyManager.updateActiveItem(e)}}return e.\u0275fac=function(t){return j(t||e)},e.\u0275dir=i.Ib({type:e,selectors:[["mat-accordion"]],contentQueries:function(e,t,n){var a;1&e&&i.Gb(n,$,!0),2&e&&i.rc(a=i.bc())&&(t._headers=a)},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(e,t){2&e&&i.Fb("mat-accordion-multi",t.multi)},inputs:{multi:"multi",displayMode:"displayMode",togglePosition:"togglePosition",hideToggle:"hideToggle"},exportAs:["matAccordion"],features:[i.Ab([{provide:P,useExisting:e}]),i.yb]}),e})();const j=i.Vb(z);let U=(()=>{class e{}return e.\u0275mod=i.Lb({type:e}),e.\u0275inj=i.Kb({factory:function(t){return new(t||e)},imports:[[g.c,h,p.h]]}),e})()},"8cGs":function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=n("sJvS"),a=n("tU2R"),s=n("PCqb"),o=n("JWVf"),r=n("fXoL");let c=(()=>{class e extends i.a{constructor(){super(...arguments),this.DEFAULT_MAX_SIZE_MB=5}initValidations(){const e=[new a.a({maxSize:Object(s.a)(this.DEFAULT_MAX_SIZE_MB,"MB")},this.i18n),new o.a({types:["image"]},this.i18n)];this.validations.push(...e)}}return e.\u0275fac=function(t){return l(t||e)},e.\u0275prov=r.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const l=r.Vb(c)},"8k5P":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("WmcL"),a=n("fXoL"),s=n("VaLf");let o=(()=>{class e{constructor(e){this.i18n=e}getFullPlanName(){if(!this.plan)return;let e=this.plan.parent?this.plan.parent.name:this.plan.name;return e=Object(i.a)(this.i18n.t(e)),e+=" "+this.i18n.t("Plan"),this.plan.parent&&(e+=": "+this.plan.name),e}}return e.\u0275fac=function(t){return new(t||e)(a.Nb(s.a))},e.\u0275cmp=a.Hb({type:e,selectors:[["full-plan-name"]],inputs:{plan:"plan"},decls:1,vars:1,template:function(e,t){1&e&&a.Hc(0),2&e&&a.Ic(t.getFullPlanName())},encapsulation:2,changeDetection:0}),e})()},Jidy:function(e,t,n){"use strict";n.r(t),n.d(t,"AppAdminModule",(function(){return yb}));var i=n("ofXK"),a=n("3Pt+"),s=n("bv9b"),o=n("fXoL"),r=n("LRXf"),c=n("tyNb");let l=(()=>{class e{constructor(e,t){this.http=e,this.router=t}resolve(e){return this.http.get("settings").toPromise().then(e=>e,()=>(this.router.navigate(["/admin"]),!1))}}return e.\u0275fac=function(t){return new(t||e)(o.Xb(r.a),o.Xb(c.d))},e.\u0275prov=o.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),d=(()=>{class e{constructor(){this.initial={server:{},client:{}},this.server={},this.client={}}getModified(){return{server:this.diffSettingObjects("server"),client:this.diffSettingObjects("client")}}diffSettingObjects(e){const t={};for(const n in this[e])this[e][n]!==this.initial[e][n]&&(t[n]=this[e][n]);return t}setAll(e){this.initial=e,this.client=Object.assign({},e.client),this.server=Object.assign({},e.server)}reset(){this.server=Object.assign({},this.initial.server),this.client=Object.assign({},this.initial.client)}updateInitial(e){this.initial={client:Object.assign(Object.assign({},this.initial.client),e.client),server:Object.assign(Object.assign({},this.initial.server),e.server)}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=o.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var b=n("/1cH"),u=n("bTqV"),h=n("bSwM"),p=n("A5z7"),g=n("0IaG"),m=n("nLfN"),f=n("8LU1"),v=(n("EY2u"),n("XNiG"));n("xgIS"),n("3UWI"),n("1G5W");let _=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[m.b]]}),e})();var S=n("FKr1"),y=n("kmnG");const k=new o.r("MAT_INPUT_VALUE_ACCESSOR");let T=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},providers:[S.b],imports:[[_,y.d],_,y.d]}),e})();var C=n("STbY"),w=n("1jcm"),x=n("dNgK"),I=n("Qu3c"),O=n("6rvT");let M=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,a.E,O.a]]}),e})();var D=n("0Gur"),B=n("wZkO"),H=n("QibW"),P=n("NFeN"),F=n("k3xQ");const A=new o.r("RECAPTCHA_ACTIONS");let R=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},providers:[l,d,{provide:A,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:[[c.h,i.c,a.o,a.E,M,D.a,O.a,F.a,u.c,P.b,x.c,h.b,I.b,g.g,C.b,w.b,b.b,T,p.e,s.b,B.g,H.c],D.a]}),e})(),N=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,a.o,a.E,O.a,u.c,x.c,h.b,I.b,g.g,C.b,P.b]]}),e})();var E=n("u47x"),V=n("rDax"),$=n("+rOU"),L=n("vxfF"),z=n("quSY"),j=n("VRyK"),U=n("LRne"),q=n("FtGj"),G=n("IzEk"),Y=n("JX91"),X=n("pLZG"),Q=n("R0Ic"),J=n("cH1L");const K=["mat-calendar-body",""];function W(e,t){if(1&e&&(o.Tb(0,"tr",2),o.Tb(1,"td",3),o.Hc(2),o.Sb(),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Cc("padding-top",e._cellPadding)("padding-bottom",e._cellPadding),o.Cb("colspan",e.numCols),o.Bb(1),o.Jc(" ",e.label," ")}}function Z(e,t){if(1&e&&(o.Tb(0,"td",7),o.Hc(1),o.Sb()),2&e){const e=o.ec(2);o.Cc("padding-top",e._cellPadding)("padding-bottom",e._cellPadding),o.Cb("colspan",e._firstRowOffset),o.Bb(1),o.Jc(" ",e._firstRowOffset>=e.labelMinRequiredCells?e.label:""," ")}}function ee(e,t){if(1&e){const e=o.Ub();o.Tb(0,"td",8),o.ac("click",(function(n){o.vc(e);const i=t.$implicit;return o.ec(2)._cellClicked(i,n)})),o.Tb(1,"div",9),o.Hc(2),o.Sb(),o.Ob(3,"div",10),o.Sb()}if(2&e){const e=t.$implicit,n=t.index,i=o.ec().index,a=o.ec();o.Cc("width",a._cellWidth)("padding-top",a._cellPadding)("padding-bottom",a._cellPadding),o.Fb("mat-calendar-body-disabled",!e.enabled)("mat-calendar-body-active",a._isActiveCell(i,n))("mat-calendar-body-range-start",a._isRangeStart(e.compareValue))("mat-calendar-body-range-end",a._isRangeEnd(e.compareValue))("mat-calendar-body-in-range",a._isInRange(e.compareValue))("mat-calendar-body-comparison-bridge-start",a._isComparisonBridgeStart(e.compareValue,i,n))("mat-calendar-body-comparison-bridge-end",a._isComparisonBridgeEnd(e.compareValue,i,n))("mat-calendar-body-comparison-start",a._isComparisonStart(e.compareValue))("mat-calendar-body-comparison-end",a._isComparisonEnd(e.compareValue))("mat-calendar-body-in-comparison-range",a._isInComparisonRange(e.compareValue))("mat-calendar-body-preview-start",a._isPreviewStart(e.compareValue))("mat-calendar-body-preview-end",a._isPreviewEnd(e.compareValue))("mat-calendar-body-in-preview",a._isInPreview(e.compareValue)),o.kc("ngClass",e.cssClasses)("tabindex",a._isActiveCell(i,n)?0:-1),o.Cb("data-mat-row",i)("data-mat-col",n)("aria-label",e.ariaLabel)("aria-disabled",!e.enabled||null)("aria-selected",a._isSelected(e)),o.Bb(1),o.Fb("mat-calendar-body-selected",a._isSelected(e))("mat-calendar-body-today",a.todayValue===e.compareValue),o.Bb(1),o.Jc(" ",e.displayValue," ")}}function te(e,t){if(1&e&&(o.Tb(0,"tr",4),o.Fc(1,Z,2,6,"td",5),o.Fc(2,ee,4,44,"td",6),o.Sb()),2&e){const e=t.$implicit,n=t.index,i=o.ec();o.Bb(1),o.kc("ngIf",0===n&&i._firstRowOffset),o.Bb(1),o.kc("ngForOf",e)}}function ne(e,t){if(1&e&&(o.Tb(0,"th",5),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.Cb("aria-label",e.long),o.Bb(1),o.Ic(e.narrow)}}const ie=["*"];function ae(e,t){}function se(e,t){if(1&e){const e=o.Ub();o.Tb(0,"mat-month-view",5),o.ac("activeDateChange",(function(t){return o.vc(e),o.ec().activeDate=t}))("_userSelection",(function(t){return o.vc(e),o.ec()._dateSelected(t)})),o.Sb()}if(2&e){const e=o.ec();o.kc("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)("comparisonStart",e.comparisonStart)("comparisonEnd",e.comparisonEnd)}}function oe(e,t){if(1&e){const e=o.Ub();o.Tb(0,"mat-year-view",6),o.ac("activeDateChange",(function(t){return o.vc(e),o.ec().activeDate=t}))("monthSelected",(function(t){return o.vc(e),o.ec()._monthSelectedInYearView(t)}))("selectedChange",(function(t){return o.vc(e),o.ec()._goToDateInView(t,"month")})),o.Sb()}if(2&e){const e=o.ec();o.kc("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)}}function re(e,t){if(1&e){const e=o.Ub();o.Tb(0,"mat-multi-year-view",7),o.ac("activeDateChange",(function(t){return o.vc(e),o.ec().activeDate=t}))("yearSelected",(function(t){return o.vc(e),o.ec()._yearSelectedInMultiYearView(t)}))("selectedChange",(function(t){return o.vc(e),o.ec()._goToDateInView(t,"year")})),o.Sb()}if(2&e){const e=o.ec();o.kc("activeDate",e.activeDate)("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)}}const ce=["button"];function le(e,t){1&e&&(o.dc(),o.Tb(0,"svg",3),o.Ob(1,"path",4),o.Sb())}const de=[[["","matDatepickerToggleIcon",""]]],be=["[matDatepickerToggleIcon]"];function ue(e){return Error(`MatDatepicker: No provider found for ${e}. You must import one of the following modules at your application root: MatNativeDateModule, MatMomentDateModule, or provide a custom implementation.`)}let he=(()=>{class e{constructor(){this.changes=new v.a,this.calendarLabel="Calendar",this.openCalendarLabel="Open 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(e,t){return`${e} \u2013 ${t}`}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=Object(o.Jb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();class pe{constructor(e,t,n,i,a={},s=e,o){this.value=e,this.displayValue=t,this.ariaLabel=n,this.enabled=i,this.cssClasses=a,this.compareValue=s,this.rawValue=o}}let ge=(()=>{class e{constructor(e,t){this._elementRef=e,this._ngZone=t,this.numCols=7,this.activeCell=0,this.isRange=!1,this.cellAspectRatio=1,this.previewStart=null,this.previewEnd=null,this.selectedValueChange=new o.n,this.previewChange=new o.n,this._enterHandler=e=>{if(this._skipNextFocus&&"focus"===e.type)this._skipNextFocus=!1;else if(e.target&&this.isRange){const t=this._getCellFromElement(e.target);t&&this._ngZone.run(()=>this.previewChange.emit({value:t.enabled?t:null,event:e}))}},this._leaveHandler=e=>{null!==this.previewEnd&&this.isRange&&e.target&&me(e.target)&&this._ngZone.run(()=>this.previewChange.emit({value:null,event:e}))},t.runOutsideAngular(()=>{const t=e.nativeElement;t.addEventListener("mouseenter",this._enterHandler,!0),t.addEventListener("focus",this._enterHandler,!0),t.addEventListener("mouseleave",this._leaveHandler,!0),t.addEventListener("blur",this._leaveHandler,!0)})}_cellClicked(e,t){e.enabled&&this.selectedValueChange.emit({value:e.value,event:t})}_isSelected(e){return this.startValue===e.compareValue||this.endValue===e.compareValue}ngOnChanges(e){const t=e.numCols,{rows:n,numCols:i}=this;(e.rows||t)&&(this._firstRowOffset=n&&n.length&&n[0].length?i-n[0].length:0),(e.cellAspectRatio||t||!this._cellPadding)&&(this._cellPadding=50*this.cellAspectRatio/i+"%"),!t&&this._cellWidth||(this._cellWidth=100/i+"%")}ngOnDestroy(){const e=this._elementRef.nativeElement;e.removeEventListener("mouseenter",this._enterHandler,!0),e.removeEventListener("focus",this._enterHandler,!0),e.removeEventListener("mouseleave",this._leaveHandler,!0),e.removeEventListener("blur",this._leaveHandler,!0)}_isActiveCell(e,t){let n=e*this.numCols+t;return e&&(n-=this._firstRowOffset),n==this.activeCell}_focusActiveCell(e=!0){this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.asObservable().pipe(Object(G.a)(1)).subscribe(()=>{const t=this._elementRef.nativeElement.querySelector(".mat-calendar-body-active");t&&(e||(this._skipNextFocus=!0),t.focus())})})}_isRangeStart(e){return fe(e,this.startValue,this.endValue)}_isRangeEnd(e){return ve(e,this.startValue,this.endValue)}_isInRange(e){return _e(e,this.startValue,this.endValue,this.isRange)}_isComparisonStart(e){return fe(e,this.comparisonStart,this.comparisonEnd)}_isComparisonBridgeStart(e,t,n){if(!this._isComparisonStart(e)||this._isRangeStart(e)||!this._isInRange(e))return!1;let i=this.rows[t][n-1];if(!i){const e=this.rows[t-1];i=e&&e[e.length-1]}return i&&!this._isRangeEnd(i.compareValue)}_isComparisonBridgeEnd(e,t,n){if(!this._isComparisonEnd(e)||this._isRangeEnd(e)||!this._isInRange(e))return!1;let i=this.rows[t][n+1];if(!i){const e=this.rows[t+1];i=e&&e[0]}return i&&!this._isRangeStart(i.compareValue)}_isComparisonEnd(e){return ve(e,this.comparisonStart,this.comparisonEnd)}_isInComparisonRange(e){return _e(e,this.comparisonStart,this.comparisonEnd,this.isRange)}_isPreviewStart(e){return fe(e,this.previewStart,this.previewEnd)}_isPreviewEnd(e){return ve(e,this.previewStart,this.previewEnd)}_isInPreview(e){return _e(e,this.previewStart,this.previewEnd,this.isRange)}_getCellFromElement(e){let t;if(me(e)?t=e:me(e.parentNode)&&(t=e.parentNode),t){const e=t.getAttribute("data-mat-row"),n=t.getAttribute("data-mat-col");if(e&&n)return this.rows[parseInt(e)][parseInt(n)]}return null}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.l),o.Nb(o.A))},e.\u0275cmp=o.Hb({type:e,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.zb],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(e,t){1&e&&(o.Fc(0,W,3,6,"tr",0),o.Fc(1,te,3,2,"tr",1)),2&e&&(o.kc("ngIf",t._firstRowOffset<t.labelMinRequiredCells),o.Bb(1),o.kc("ngForOf",t.rows))},directives:[i.t,i.s,i.q],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}.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}.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}),e})();function me(e){return"TD"===e.nodeName}function fe(e,t,n){return null!==n&&t!==n&&e<n&&e===t}function ve(e,t,n){return null!==t&&t!==n&&e>=t&&e===n}function _e(e,t,n,i){return i&&null!==t&&null!==n&&t!==n&&e>=t&&e<=n}class Se{constructor(e,t){this.start=e,this.end=t}}let ye=(()=>{class e{constructor(e,t){this.selection=e,this._adapter=t,this._selectionChanged=new v.a,this.selectionChanged=this._selectionChanged.asObservable(),this.selection=e}updateSelection(e,t){this.selection=e,this._selectionChanged.next({selection:e,source:t})}ngOnDestroy(){this._selectionChanged.complete()}_isValidDateInstance(e){return this._adapter.isDateInstance(e)&&this._adapter.isValid(e)}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(void 0),o.Nb(S.a))},e.\u0275dir=o.Ib({type:e}),e})(),ke=(()=>{class e extends ye{constructor(e){super(null,e)}add(e){super.updateSelection(e,this)}isValid(){return null!=this.selection&&this._isValidDateInstance(this.selection)}isComplete(){return null!=this.selection}}return e.\u0275fac=function(t){return new(t||e)(o.Xb(S.a))},e.\u0275prov=o.Jb({token:e,factory:e.\u0275fac}),e})();const Te={provide:ye,deps:[[new o.B,new o.L,ye],S.a],useFactory:function(e,t){return e||new ke(t)}},Ce=new o.r("MAT_DATE_RANGE_SELECTION_STRATEGY");let we=(()=>{class e{constructor(e){this._dateAdapter=e}selectionFinished(e,t){let{start:n,end:i}=t;return null==n?n=e:null==i&&e&&this._dateAdapter.compareDate(e,n)>=0?i=e:(n=e,i=null),new Se(n,i)}createPreview(e,t){let n=null,i=null;return t.start&&!t.end&&e&&(n=t.start,i=e),new Se(n,i)}}return e.\u0275fac=function(t){return new(t||e)(o.Xb(S.a))},e.\u0275prov=o.Jb({token:e,factory:e.\u0275fac}),e})(),xe=(()=>{class e{constructor(e,t,n,i,a){if(this._changeDetectorRef=e,this._dateFormats=t,this._dateAdapter=n,this._dir=i,this._rangeStrategy=a,this._rerenderSubscription=z.a.EMPTY,this.selectedChange=new o.n,this._userSelection=new o.n,this.activeDateChange=new o.n,!this._dateAdapter)throw ue("DateAdapter");if(!this._dateFormats)throw ue("MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){const t=this._activeDate,n=this._getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(n,this.minDate,this.maxDate),this._hasSameMonthAndYear(t,this._activeDate)||this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof Se?e:this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setRanges(this._selected)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(Object(Y.a)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_dateSelected(e){const t=e.value,n=this._dateAdapter.getYear(this.activeDate),i=this._dateAdapter.getMonth(this.activeDate),a=this._dateAdapter.createDate(n,i,t);let s,o;this._selected instanceof Se?(s=this._getDateInCurrentMonth(this._selected.start),o=this._getDateInCurrentMonth(this._selected.end)):s=o=this._getDateInCurrentMonth(this._selected),s===t&&o===t||this.selectedChange.emit(a),this._userSelection.emit({value:a,event:e.event})}_handleCalendarBodyKeydown(e){const t=this._activeDate,n=this._isRtl();switch(e.keyCode){case q.i:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,n?1:-1);break;case q.m:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,n?-1:1);break;case q.p:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case q.d:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case q.h:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case q.e:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case q.l:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case q.k:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case q.f:case q.n:return void(this.dateFilter&&!this.dateFilter(this._activeDate)||(this._dateSelected({value:this._dateAdapter.getDate(this._activeDate),event:e}),e.preventDefault()));case q.g:return void(null!=this._previewEnd&&(this._previewStart=this._previewEnd=null,this.selectedChange.emit(null),this._userSelection.emit({value:null,event:e}),e.preventDefault(),e.stopPropagation()));default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()}_init(){this._setRanges(this.selected),this._todayDate=this._getCellCompareValue(this._dateAdapter.today()),this._monthLabel=this._dateAdapter.getMonthNames("short")[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();let e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(7+this._dateAdapter.getDayOfWeek(e)-this._dateAdapter.getFirstDayOfWeek())%7,this._initWeekdays(),this._createWeekCells(),this._changeDetectorRef.markForCheck()}_focusActiveCell(e){this._matCalendarBody._focusActiveCell(e)}_previewChanged({event:e,value:t}){if(this._rangeStrategy){const n=this._rangeStrategy.createPreview(t?t.rawValue:null,this.selected,e);this._previewStart=this._getCellCompareValue(n.start),this._previewEnd=this._getCellCompareValue(n.end),this._changeDetectorRef.detectChanges()}}_initWeekdays(){const e=this._dateAdapter.getFirstDayOfWeek(),t=this._dateAdapter.getDayOfWeekNames("narrow");let n=this._dateAdapter.getDayOfWeekNames("long").map((e,n)=>({long:e,narrow:t[n]}));this._weekdays=n.slice(e).concat(n.slice(0,e))}_createWeekCells(){const e=this._dateAdapter.getNumDaysInMonth(this.activeDate),t=this._dateAdapter.getDateNames();this._weeks=[[]];for(let n=0,i=this._firstWeekOffset;n<e;n++,i++){7==i&&(this._weeks.push([]),i=0);const e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),n+1),a=this._shouldEnableDate(e),s=this._dateAdapter.format(e,this._dateFormats.display.dateA11yLabel),o=this.dateClass?this.dateClass(e):void 0;this._weeks[this._weeks.length-1].push(new pe(n+1,t[n],s,a,o,this._getCellCompareValue(e),e))}}_shouldEnableDate(e){return!!e&&(!this.minDate||this._dateAdapter.compareDate(e,this.minDate)>=0)&&(!this.maxDate||this._dateAdapter.compareDate(e,this.maxDate)<=0)&&(!this.dateFilter||this.dateFilter(e))}_getDateInCurrentMonth(e){return e&&this._hasSameMonthAndYear(e,this.activeDate)?this._dateAdapter.getDate(e):null}_hasSameMonthAndYear(e,t){return!(!e||!t||this._dateAdapter.getMonth(e)!=this._dateAdapter.getMonth(t)||this._dateAdapter.getYear(e)!=this._dateAdapter.getYear(t))}_getCellCompareValue(e){if(e){const t=this._dateAdapter.getYear(e),n=this._dateAdapter.getMonth(e),i=this._dateAdapter.getDate(e);return new Date(t,n,i).getTime()}return null}_getValidDateOrNull(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setRanges(e){e instanceof Se?(this._rangeStart=this._getCellCompareValue(e.start),this._rangeEnd=this._getCellCompareValue(e.end),this._isRange=!0):(this._rangeStart=this._rangeEnd=this._getCellCompareValue(e),this._isRange=!1),this._comparisonRangeStart=this._getCellCompareValue(this.comparisonStart),this._comparisonRangeEnd=this._getCellCompareValue(this.comparisonEnd)}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.h),o.Nb(S.c,8),o.Nb(S.a,8),o.Nb(J.c,8),o.Nb(Ce,8))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-month-view"]],viewQuery:function(e,t){var n;1&e&&o.Nc(ge,!0),2&e&&o.rc(n=o.bc())&&(t._matCalendarBody=n.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"],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(e,t){1&e&&(o.Tb(0,"table",0),o.Tb(1,"thead",1),o.Tb(2,"tr"),o.Fc(3,ne,2,2,"th",2),o.Sb(),o.Tb(4,"tr"),o.Ob(5,"th",3),o.Sb(),o.Sb(),o.Tb(6,"tbody",4),o.ac("selectedValueChange",(function(e){return t._dateSelected(e)}))("previewChange",(function(e){return t._previewChanged(e)}))("keydown",(function(e){return t._handleCalendarBodyKeydown(e)})),o.Sb(),o.Sb()),2&e&&(o.Bb(3),o.kc("ngForOf",t._weekdays),o.Bb(3),o.kc("label",t._monthLabel)("rows",t._weeks)("todayValue",t._todayDate)("startValue",t._rangeStart)("endValue",t._rangeEnd)("comparisonStart",t._comparisonRangeStart)("comparisonEnd",t._comparisonRangeEnd)("previewStart",t._previewStart)("previewEnd",t._previewEnd)("isRange",t._isRange)("labelMinRequiredCells",3)("activeCell",t._dateAdapter.getDate(t.activeDate)-1))},directives:[i.s,ge],encapsulation:2,changeDetection:0}),e})(),Ie=(()=>{class e{constructor(e,t,n){if(this._changeDetectorRef=e,this._dateAdapter=t,this._dir=n,this._rerenderSubscription=z.a.EMPTY,this.selectedChange=new o.n,this.yearSelected=new o.n,this.activeDateChange=new o.n,!this._dateAdapter)throw ue("DateAdapter");this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){let t=this._activeDate;const n=this._getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(n,this.minDate,this.maxDate),Oe(this._dateAdapter,t,this._activeDate,this.minDate,this.maxDate)||this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof Se?e:this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedYear(e)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(Object(Y.a)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_init(){this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());const e=this._dateAdapter.getYear(this._activeDate)-Me(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(let t=0,n=[];t<24;t++)n.push(e+t),4==n.length&&(this._years.push(n.map(e=>this._createCellForYear(e))),n=[]);this._changeDetectorRef.markForCheck()}_yearSelected(e){const t=e.value;this.yearSelected.emit(this._dateAdapter.createDate(t,0,1));let n=this._dateAdapter.getMonth(this.activeDate),i=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(t,n,1));this.selectedChange.emit(this._dateAdapter.createDate(t,n,Math.min(this._dateAdapter.getDate(this.activeDate),i)))}_handleCalendarBodyKeydown(e){const t=this._activeDate,n=this._isRtl();switch(e.keyCode){case q.i:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,n?1:-1);break;case q.m:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,n?-1:1);break;case q.p:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-4);break;case q.d:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,4);break;case q.h:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-Me(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case q.e:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,24-Me(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case q.l:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-240:-24);break;case q.k:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?240:24);break;case q.f:case q.n:this._yearSelected({value:this._dateAdapter.getYear(this._activeDate),event:e});break;default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()}_getActiveCell(){return Me(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_createCellForYear(e){let t=this._dateAdapter.getYearName(this._dateAdapter.createDate(e,0,1));return new pe(e,t,t,this._shouldEnableYear(e))}_shouldEnableYear(e){if(null==e||this.maxDate&&e>this._dateAdapter.getYear(this.maxDate)||this.minDate&&e<this._dateAdapter.getYear(this.minDate))return!1;if(!this.dateFilter)return!0;for(let t=this._dateAdapter.createDate(e,0,1);this._dateAdapter.getYear(t)==e;t=this._dateAdapter.addCalendarDays(t,1))if(this.dateFilter(t))return!0;return!1}_getValidDateOrNull(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setSelectedYear(e){if(this._selectedYear=null,e instanceof Se){const t=e.start||e.end;t&&(this._selectedYear=this._dateAdapter.getYear(t))}else e&&(this._selectedYear=this._dateAdapter.getYear(e))}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.h),o.Nb(S.a,8),o.Nb(J.c,8))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-multi-year-view"]],viewQuery:function(e,t){var n;1&e&&o.Nc(ge,!0),2&e&&o.rc(n=o.bc())&&(t._matCalendarBody=n.first)},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter"},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(e,t){1&e&&(o.Tb(0,"table",0),o.Tb(1,"thead",1),o.Tb(2,"tr"),o.Ob(3,"th",2),o.Sb(),o.Sb(),o.Tb(4,"tbody",3),o.ac("selectedValueChange",(function(e){return t._yearSelected(e)}))("keydown",(function(e){return t._handleCalendarBodyKeydown(e)})),o.Sb(),o.Sb()),2&e&&(o.Bb(4),o.kc("rows",t._years)("todayValue",t._todayYear)("startValue",t._selectedYear)("endValue",t._selectedYear)("numCols",4)("cellAspectRatio",4/7)("activeCell",t._getActiveCell()))},directives:[ge],encapsulation:2,changeDetection:0}),e})();function Oe(e,t,n,i,a){const s=e.getYear(t),o=e.getYear(n),r=De(e,i,a);return Math.floor((s-r)/24)===Math.floor((o-r)/24)}function Me(e,t,n,i){return((e.getYear(t)-De(e,n,i))%24+24)%24}function De(e,t,n){let i=0;return n?i=e.getYear(n)-24+1:t&&(i=e.getYear(t)),i}let Be=(()=>{class e{constructor(e,t,n,i){if(this._changeDetectorRef=e,this._dateFormats=t,this._dateAdapter=n,this._dir=i,this._rerenderSubscription=z.a.EMPTY,this.selectedChange=new o.n,this.monthSelected=new o.n,this.activeDateChange=new o.n,!this._dateAdapter)throw ue("DateAdapter");if(!this._dateFormats)throw ue("MAT_DATE_FORMATS");this._activeDate=this._dateAdapter.today()}get activeDate(){return this._activeDate}set activeDate(e){let t=this._activeDate;const n=this._getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(n,this.minDate,this.maxDate),this._dateAdapter.getYear(t)!==this._dateAdapter.getYear(this._activeDate)&&this._init()}get selected(){return this._selected}set selected(e){this._selected=e instanceof Se?e:this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedMonth(e)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(Object(Y.a)(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_monthSelected(e){const t=e.value,n=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),t,1);this.monthSelected.emit(n);const i=this._dateAdapter.getNumDaysInMonth(n);this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),t,Math.min(this._dateAdapter.getDate(this.activeDate),i)))}_handleCalendarBodyKeydown(e){const t=this._activeDate,n=this._isRtl();switch(e.keyCode){case q.i:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,n?1:-1);break;case q.m:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,n?-1:1);break;case q.p:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case q.d:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case q.h:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case q.e:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case q.l:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-10:-1);break;case q.k:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10:1);break;case q.f:case q.n:this._monthSelected({value:this._dateAdapter.getMonth(this._activeDate),event:e});break;default:return}this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCell(),e.preventDefault()}_init(){this._setSelectedMonth(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);let e=this._dateAdapter.getMonthNames("short");this._months=[[0,1,2,3],[4,5,6,7],[8,9,10,11]].map(t=>t.map(t=>this._createCellForMonth(t,e[t]))),this._changeDetectorRef.markForCheck()}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_getMonthInCurrentYear(e){return e&&this._dateAdapter.getYear(e)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(e):null}_createCellForMonth(e,t){let n=this._dateAdapter.format(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),this._dateFormats.display.monthYearA11yLabel);return new pe(e,t.toLocaleUpperCase(),n,this._shouldEnableMonth(e))}_shouldEnableMonth(e){const t=this._dateAdapter.getYear(this.activeDate);if(null==e||this._isYearAndMonthAfterMaxDate(t,e)||this._isYearAndMonthBeforeMinDate(t,e))return!1;if(!this.dateFilter)return!0;for(let n=this._dateAdapter.createDate(t,e,1);this._dateAdapter.getMonth(n)==e;n=this._dateAdapter.addCalendarDays(n,1))if(this.dateFilter(n))return!0;return!1}_isYearAndMonthAfterMaxDate(e,t){if(this.maxDate){const n=this._dateAdapter.getYear(this.maxDate),i=this._dateAdapter.getMonth(this.maxDate);return e>n||e===n&&t>i}return!1}_isYearAndMonthBeforeMinDate(e,t){if(this.minDate){const n=this._dateAdapter.getYear(this.minDate),i=this._dateAdapter.getMonth(this.minDate);return e<n||e===n&&t<i}return!1}_getValidDateOrNull(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setSelectedMonth(e){this._selectedMonth=e instanceof Se?this._getMonthInCurrentYear(e.start)||this._getMonthInCurrentYear(e.end):this._getMonthInCurrentYear(e)}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.h),o.Nb(S.c,8),o.Nb(S.a,8),o.Nb(J.c,8))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-year-view"]],viewQuery:function(e,t){var n;1&e&&o.Nc(ge,!0),2&e&&o.rc(n=o.bc())&&(t._matCalendarBody=n.first)},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter"},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(e,t){1&e&&(o.Tb(0,"table",0),o.Tb(1,"thead",1),o.Tb(2,"tr"),o.Ob(3,"th",2),o.Sb(),o.Sb(),o.Tb(4,"tbody",3),o.ac("selectedValueChange",(function(e){return t._monthSelected(e)}))("keydown",(function(e){return t._handleCalendarBodyKeydown(e)})),o.Sb(),o.Sb()),2&e&&(o.Bb(4),o.kc("label",t._yearLabel)("rows",t._months)("todayValue",t._todayMonth)("startValue",t._selectedMonth)("endValue",t._selectedMonth)("labelMinRequiredCells",2)("numCols",4)("cellAspectRatio",4/7)("activeCell",t._dateAdapter.getMonth(t.activeDate)))},directives:[ge],encapsulation:2,changeDetection:0}),e})(),He=(()=>{class e{constructor(e,t,n,i,a){this._intl=e,this.calendar=t,this._dateAdapter=n,this._dateFormats=i,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 e=this._dateAdapter.getYear(this.calendar.activeDate)-Me(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate),t=e+24-1,n=this._dateAdapter.getYearName(this._dateAdapter.createDate(e,0,1)),i=this._dateAdapter.getYearName(this._dateAdapter.createDate(t,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(e,t){return"month"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(t)&&this._dateAdapter.getMonth(e)==this._dateAdapter.getMonth(t):"year"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(t):Oe(this._dateAdapter,e,t,this.calendar.minDate,this.calendar.maxDate)}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(he),o.Nb(Object(o.V)(()=>Pe)),o.Nb(S.a,8),o.Nb(S.c,8),o.Nb(o.h))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-calendar-header"]],exportAs:["matCalendarHeader"],ngContentSelectors:ie,decls:9,vars:8,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(e,t){1&e&&(o.jc(),o.Tb(0,"div",0),o.Tb(1,"div",1),o.Tb(2,"button",2),o.ac("click",(function(){return t.currentPeriodClicked()})),o.Hc(3),o.Ob(4,"div",3),o.Sb(),o.Ob(5,"div",4),o.ic(6),o.Tb(7,"button",5),o.ac("click",(function(){return t.previousClicked()})),o.Sb(),o.Tb(8,"button",6),o.ac("click",(function(){return t.nextClicked()})),o.Sb(),o.Sb(),o.Sb()),2&e&&(o.Bb(2),o.Cb("aria-label",t.periodButtonLabel),o.Bb(1),o.Jc(" ",t.periodButtonText," "),o.Bb(1),o.Fb("mat-calendar-invert","month"!=t.calendar.currentView),o.Bb(3),o.kc("disabled",!t.previousEnabled()),o.Cb("aria-label",t.prevButtonLabel),o.Bb(1),o.kc("disabled",!t.nextEnabled()),o.Cb("aria-label",t.nextButtonLabel))},directives:[u.b,E.d],encapsulation:2,changeDetection:0}),e})(),Pe=(()=>{class e{constructor(e,t,n,i){if(this._dateAdapter=t,this._dateFormats=n,this._changeDetectorRef=i,this._moveFocusOnNextTick=!1,this.startView="month",this.selectedChange=new o.n,this.yearSelected=new o.n,this.monthSelected=new o.n,this._userSelection=new o.n,this.stateChanges=new v.a,!this._dateAdapter)throw ue("DateAdapter");if(!this._dateFormats)throw ue("MAT_DATE_FORMATS");this._intlChanges=e.changes.subscribe(()=>{i.markForCheck(),this.stateChanges.next()})}get startAt(){return this._startAt}set startAt(e){this._startAt=this._getValidDateOrNull(this._dateAdapter.deserialize(e))}get selected(){return this._selected}set selected(e){this._selected=e instanceof Se?e:this._getValidDateOrNull(this._dateAdapter.deserialize(e))}get minDate(){return this._minDate}set minDate(e){this._minDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._getValidDateOrNull(this._dateAdapter.deserialize(e))}get activeDate(){return this._clampedActiveDate}set activeDate(e){this._clampedActiveDate=this._dateAdapter.clampDate(e,this.minDate,this.maxDate),this.stateChanges.next(),this._changeDetectorRef.markForCheck()}get currentView(){return this._currentView}set currentView(e){this._currentView=e,this._moveFocusOnNextTick=!0,this._changeDetectorRef.markForCheck()}ngAfterContentInit(){this._calendarHeaderPortal=new $.d(this.headerComponent||He),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(e){const t=e.minDate||e.maxDate||e.dateFilter;if(t&&!t.firstChange){const e=this._getCurrentViewComponent();e&&(this._changeDetectorRef.detectChanges(),e._init())}this.stateChanges.next()}focusActiveCell(){this._getCurrentViewComponent()._focusActiveCell(!1)}updateTodaysDate(){const e=this.currentView;let t;t="month"===e?this.monthView:"year"===e?this.yearView:this.multiYearView,t._init()}_dateSelected(e){const t=e.value;(this.selected instanceof Se||t&&!this._dateAdapter.sameDate(t,this.selected))&&this.selectedChange.emit(t),this._userSelection.emit(e)}_yearSelectedInMultiYearView(e){this.yearSelected.emit(e)}_monthSelectedInYearView(e){this.monthSelected.emit(e)}_goToDateInView(e,t){this.activeDate=e,this.currentView=t}_getValidDateOrNull(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null}_getCurrentViewComponent(){return this.monthView||this.yearView||this.multiYearView}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(he),o.Nb(S.a,8),o.Nb(S.c,8),o.Nb(o.h))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-calendar"]],viewQuery:function(e,t){var n;1&e&&(o.Nc(xe,!0),o.Nc(Be,!0),o.Nc(Ie,!0)),2&e&&(o.rc(n=o.bc())&&(t.monthView=n.first),o.rc(n=o.bc())&&(t.yearView=n.first),o.rc(n=o.bc())&&(t.multiYearView=n.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",_userSelection:"_userSelection"},exportAs:["matCalendar"],features:[o.Ab([Te]),o.zb],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","activeDateChange","monthSelected","selectedChange",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","activeDateChange","yearSelected","selectedChange",4,"ngSwitchCase"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","activeDateChange","_userSelection"],[3,"activeDate","selected","dateFilter","maxDate","minDate","activeDateChange","monthSelected","selectedChange"],[3,"activeDate","selected","dateFilter","maxDate","minDate","activeDateChange","yearSelected","selectedChange"]],template:function(e,t){1&e&&(o.Fc(0,ae,0,0,"ng-template",0),o.Tb(1,"div",1),o.Fc(2,se,1,8,"mat-month-view",2),o.Fc(3,oe,1,5,"mat-year-view",3),o.Fc(4,re,1,5,"mat-multi-year-view",4),o.Sb()),2&e&&(o.kc("cdkPortalOutlet",t._calendarHeaderPortal),o.Bb(1),o.kc("ngSwitch",t.currentView),o.Bb(1),o.kc("ngSwitchCase","month"),o.Bb(1),o.kc("ngSwitchCase","year"),o.Bb(1),o.kc("ngSwitchCase","multi-year"))},directives:[$.c,E.e,i.x,i.y,xe,Be,Ie],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}),e})();const Fe={transformPanel:Object(Q.m)("transformPanel",[Object(Q.j)("void",Object(Q.k)({opacity:0,transform:"scale(1, 0.8)"})),Object(Q.l)("void => enter",Object(Q.e)("120ms cubic-bezier(0, 0, 0.2, 1)",Object(Q.k)({opacity:1,transform:"scale(1, 1)"}))),Object(Q.l)("* => void",Object(Q.e)("100ms linear",Object(Q.k)({opacity:0})))]),fadeInCalendar:Object(Q.m)("fadeInCalendar",[Object(Q.j)("void",Object(Q.k)({opacity:0})),Object(Q.j)("enter",Object(Q.k)({opacity:1})),Object(Q.l)("void => *",Object(Q.e)("120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])};let Ae=0;const Re=new o.r("mat-datepicker-scroll-strategy"),Ne={provide:Re,deps:[V.a],useFactory:function(e){return()=>e.scrollStrategies.reposition()}};class Ee{constructor(e){this._elementRef=e}}const Ve=Object(S.v)(Ee);let $e=(()=>{class e extends Ve{constructor(e,t,n,i,a){super(e),this._changeDetectorRef=t,this._model=n,this._dateAdapter=i,this._rangeSelectionStrategy=a,this._subscriptions=new z.a,this._animationState="enter",this._animationDone=new v.a}ngAfterViewInit(){this._changeDetectorRef&&this._subscriptions.add(this.datepicker._stateChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})),this._calendar.focusActiveCell()}ngOnDestroy(){this._subscriptions.unsubscribe(),this._animationDone.complete()}_handleUserSelection(e){if(this._model&&this._dateAdapter){const t=this._model.selection,n=e.value,i=t instanceof Se;if(i&&this._rangeSelectionStrategy){const i=this._rangeSelectionStrategy.selectionFinished(n,t,e.event);this._model.updateSelection(i,this)}else!n||!i&&this._dateAdapter.sameDate(n,t)||this._model.add(n)}this._model&&!this._model.isComplete()||this.datepicker.close()}_startExitAnimation(){this._animationState="void",this._changeDetectorRef&&this._changeDetectorRef.markForCheck()}_getSelected(){return this._model?this._model.selection:null}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.l),o.Nb(o.h),o.Nb(ye),o.Nb(S.a),o.Nb(Ce,8))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-datepicker-content"]],viewQuery:function(e,t){var n;1&e&&o.Nc(Pe,!0),2&e&&o.rc(n=o.bc())&&(t._calendar=n.first)},hostAttrs:[1,"mat-datepicker-content"],hostVars:3,hostBindings:function(e,t){1&e&&o.Dc("@transformPanel.done",(function(){return t._animationDone.next()})),2&e&&(o.Ec("@transformPanel",t._animationState),o.Fb("mat-datepicker-content-touch",t.datepicker.touchUi))},inputs:{color:"color"},exportAs:["matDatepickerContent"],features:[o.yb],decls:1,vars:13,consts:[["cdkTrapFocus","",3,"id","ngClass","startAt","startView","minDate","maxDate","dateFilter","headerComponent","selected","dateClass","comparisonStart","comparisonEnd","yearSelected","monthSelected","_userSelection"]],template:function(e,t){1&e&&(o.Tb(0,"mat-calendar",0),o.ac("yearSelected",(function(e){return t.datepicker._selectYear(e)}))("monthSelected",(function(e){return t.datepicker._selectMonth(e)}))("_userSelection",(function(e){return t._handleUserSelection(e)})),o.Sb()),2&e&&o.kc("id",t.datepicker.id)("ngClass",t.datepicker.panelClass)("startAt",t.datepicker.startAt)("startView",t.datepicker.startView)("minDate",t.datepicker._getMinDate())("maxDate",t.datepicker._getMaxDate())("dateFilter",t.datepicker._getDateFilter())("headerComponent",t.datepicker.calendarHeaderComponent)("selected",t._getSelected())("dateClass",t.datepicker.dateClass)("comparisonStart",t.comparisonStart)("comparisonEnd",t.comparisonEnd)("@fadeInCalendar","enter")},directives:[Pe,E.f,i.q],styles:[".mat-datepicker-content{display:block;border-radius:4px}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content-touch{display:block;max-height:80vh;overflow:auto;margin:-24px}.mat-datepicker-content-touch .mat-calendar{min-width:250px;min-height:312px;max-width:750px;max-height:788px}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-calendar{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-calendar{width:80vw;height:100vw}}\n"],encapsulation:2,data:{animation:[Fe.transformPanel,Fe.fadeInCalendar]},changeDetection:0}),e})(),Le=(()=>{class e{constructor(e,t,n,i,a,s,r,c,l){if(this._dialog=e,this._overlay=t,this._ngZone=n,this._viewContainerRef=i,this._dateAdapter=s,this._dir=r,this._document=c,this._model=l,this._inputStateChanges=z.a.EMPTY,this.startView="month",this._touchUi=!1,this.xPosition="start",this.yPosition="below",this.yearSelected=new o.n,this.monthSelected=new o.n,this.openedStream=new o.n,this.closedStream=new o.n,this._opened=!1,this.id="mat-datepicker-"+Ae++,this._focusedElementBeforeOpen=null,this._stateChanges=new v.a,!this._dateAdapter)throw ue("DateAdapter");this._scrollStrategy=a}get startAt(){return this._startAt||(this._datepickerInput?this._datepickerInput.getStartValue():null)}set startAt(e){this._startAt=this._getValidDateOrNull(this._dateAdapter.deserialize(e))}get color(){return this._color||(this._datepickerInput?this._datepickerInput.getThemePalette():void 0)}set color(e){this._color=e}get touchUi(){return this._touchUi}set touchUi(e){this._touchUi=Object(f.c)(e)}get disabled(){return void 0===this._disabled&&this._datepickerInput?this._datepickerInput.disabled:!!this._disabled}set disabled(e){const t=Object(f.c)(e);t!==this._disabled&&(this._disabled=t,this._stateChanges.next(void 0))}get opened(){return this._opened}set opened(e){e?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(e){const t=e.xPosition||e.yPosition;t&&!t.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(e){this._model.add(e)}_selectYear(e){this.yearSelected.emit(e)}_selectMonth(e){this.monthSelected.emit(e)}_registerInput(e){if(this._datepickerInput)throw Error("A MatDatepicker can only be associated with a single input.");return this._inputStateChanges.unsubscribe(),this._datepickerInput=e,this._inputStateChanges=e._stateChanges.subscribe(()=>this._stateChanges.next(void 0)),this._model}open(){if(!this._opened&&!this.disabled){if(!this._datepickerInput)throw Error("Attempted to open an MatDatepicker with no associated input.");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 e=this._popupComponentRef.instance;e._startExitAnimation(),e._animationDone.pipe(Object(G.a)(1)).subscribe(()=>this._destroyPopup())}this._dialogRef&&(this._dialogRef.close(),this._dialogRef=null);const e=()=>{this._opened&&(this._opened=!1,this.closedStream.emit(),this._focusedElementBeforeOpen=null)};this._focusedElementBeforeOpen&&"function"==typeof this._focusedElementBeforeOpen.focus?(this._focusedElementBeforeOpen.focus(),setTimeout(e)):e()}_openAsDialog(){this._dialogRef&&this._dialogRef.close(),this._dialogRef=this._dialog.open($e,{direction:this._dir?this._dir.value:"ltr",viewContainerRef:this._viewContainerRef,panelClass:"mat-datepicker-dialog",hasBackdrop:!0,disableClose:!1,width:"",height:"",minWidth:"",minHeight:"",maxWidth:"80vw",maxHeight:"",position:{},autoFocus:!0,restoreFocus:!1}),this._dialogRef.afterClosed().subscribe(()=>this.close()),this._forwardContentValues(this._dialogRef.componentInstance)}_openAsPopup(){const e=new $.d($e,this._viewContainerRef);this._destroyPopup(),this._createPopup(),this._popupComponentRef=this._popupRef.attach(e),this._forwardContentValues(this._popupComponentRef.instance),this._ngZone.onStable.asObservable().pipe(Object(G.a)(1)).subscribe(()=>{this._popupRef.updatePosition()})}_forwardContentValues(e){e.datepicker=this,e.color=this.color}_createPopup(){const e=this._overlay.position().flexibleConnectedTo(this._datepickerInput.getConnectedOverlayOrigin()).withTransformOriginOn(".mat-datepicker-content").withFlexibleDimensions(!1).withViewportMargin(8).withLockedPosition(),t=new V.b({positionStrategy:this._setConnectedPositions(e),hasBackdrop:!0,backdropClass:"mat-overlay-transparent-backdrop",direction:this._dir,scrollStrategy:this._scrollStrategy(),panelClass:"mat-datepicker-popup"});this._popupRef=this._overlay.create(t),this._popupRef.overlayElement.setAttribute("role","dialog"),Object(j.a)(this._popupRef.backdropClick(),this._popupRef.detachments(),this._popupRef.keydownEvents().pipe(Object(X.a)(e=>e.keyCode===q.g||this._datepickerInput&&e.altKey&&e.keyCode===q.p))).subscribe(e=>{e&&e.preventDefault(),this.close()})}_destroyPopup(){this._popupRef&&(this._popupRef.dispose(),this._popupRef=this._popupComponentRef=null)}_setConnectedPositions(e){const t="end"===this.xPosition?"end":"start",n="start"===t?"end":"start",i="above"===this.yPosition?"bottom":"top",a="top"===i?"bottom":"top";return e.withPositions([{originX:t,originY:a,overlayX:t,overlayY:i},{originX:t,originY:i,overlayX:t,overlayY:a},{originX:n,originY:a,overlayX:n,overlayY:i},{originX:n,originY:i,overlayX:n,overlayY:a}])}_getValidDateOrNull(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(g.b),o.Nb(V.a),o.Nb(o.A),o.Nb(o.R),o.Nb(Re),o.Nb(S.a,8),o.Nb(J.c,8),o.Nb(i.e,8),o.Nb(ye))},e.\u0275dir=o.Ib({type:e,inputs:{startView:"startView",xPosition:"xPosition",yPosition:"yPosition",startAt:"startAt",color:"color",touchUi:"touchUi",disabled:"disabled",opened:"opened",calendarHeaderComponent:"calendarHeaderComponent",panelClass:"panelClass",dateClass:"dateClass"},outputs:{yearSelected:"yearSelected",monthSelected:"monthSelected",openedStream:"opened",closedStream:"closed"},features:[o.zb]}),e})(),ze=(()=>{class e extends Le{}return e.\u0275fac=function(t){return je(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-datepicker"]],exportAs:["matDatepicker"],features:[o.Ab([Te]),o.yb],decls:0,vars:0,template:function(e,t){},encapsulation:2,changeDetection:0}),e})();const je=o.Vb(ze);class Ue{constructor(e,t){this.target=e,this.targetElement=t,this.value=this.target.value}}let qe=(()=>{class e{constructor(e,t,n){if(this._elementRef=e,this._dateAdapter=t,this._dateFormats=n,this.dateChange=new o.n,this.dateInput=new o.n,this._valueChange=new o.n,this._stateChanges=new v.a,this._onTouched=()=>{},this._validatorOnChange=()=>{},this._cvaOnChange=()=>{},this._valueChangesSubscription=z.a.EMPTY,this._localeSubscription=z.a.EMPTY,this._parseValidator=()=>this._lastValueValid?null:{matDatepickerParse:{text:this._elementRef.nativeElement.value}},this._filterValidator=e=>{const t=this._getValidDateOrNull(this._dateAdapter.deserialize(e.value)),n=this._getDateFilter();return n&&t&&!n(t)?{matDatepickerFilter:!0}:null},this._minValidator=e=>{const t=this._getValidDateOrNull(this._dateAdapter.deserialize(e.value)),n=this._getMinDate();return!n||!t||this._dateAdapter.compareDate(n,t)<=0?null:{matDatepickerMin:{min:n,actual:t}}},this._maxValidator=e=>{const t=this._getValidDateOrNull(this._dateAdapter.deserialize(e.value)),n=this._getMaxDate();return!n||!t||this._dateAdapter.compareDate(n,t)>=0?null:{matDatepickerMax:{max:n,actual:t}}},this._lastValueValid=!1,!this._dateAdapter)throw ue("DateAdapter");if(!this._dateFormats)throw ue("MAT_DATE_FORMATS");this._localeSubscription=t.localeChanges.subscribe(()=>{this.value=this.value})}get value(){return this._model?this._getValueFromModel(this._model.selection):this._pendingValue}set value(e){e=this._dateAdapter.deserialize(e),this._lastValueValid=this._isValidValue(e),e=this._getValidDateOrNull(e);const t=this.value;this._assignValue(e),this._formatValue(e),this._dateAdapter.sameDate(t,e)||this._valueChange.emit(e)}get disabled(){return!!this._disabled||this._parentDisabled()}set disabled(e){const t=Object(f.c)(e),n=this._elementRef.nativeElement;this._disabled!==t&&(this._disabled=t,this._stateChanges.next(void 0)),t&&this._isInitialized&&n.blur&&n.blur()}_getValidators(){return[this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator]}_registerModel(e){this._model=e,this._valueChangesSubscription.unsubscribe(),this._pendingValue&&this._assignValue(this._pendingValue),this._valueChangesSubscription=this._model.selectionChanged.subscribe(e=>{if(e.source!==this){const t=this._getValueFromModel(e.selection);this._lastValueValid=this._isValidValue(t),this._cvaOnChange(t),this._onTouched(),this._formatValue(t),this._canEmitChangeEvent(e)&&(this.dateInput.emit(new Ue(this,this._elementRef.nativeElement)),this.dateChange.emit(new Ue(this,this._elementRef.nativeElement))),this._outsideValueChanged&&this._outsideValueChanged()}})}ngAfterViewInit(){this._isInitialized=!0}ngOnChanges(){this._stateChanges.next(void 0)}ngOnDestroy(){this._valueChangesSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this._valueChange.complete(),this._stateChanges.complete()}registerOnValidatorChange(e){this._validatorOnChange=e}validate(e){return this._validator?this._validator(e):null}writeValue(e){this.value=e}registerOnChange(e){this._cvaOnChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_onKeydown(e){e.altKey&&e.keyCode===q.d&&!this._elementRef.nativeElement.readOnly&&(this._openPopup(),e.preventDefault())}_onInput(e){const t=this._lastValueValid;let n=this._dateAdapter.parse(e,this._dateFormats.parse.dateInput);this._lastValueValid=this._isValidValue(n),n=this._getValidDateOrNull(n),this._dateAdapter.sameDate(n,this.value)?(e&&!this.value&&this._cvaOnChange(n),t!==this._lastValueValid&&this._validatorOnChange()):(this._assignValue(n),this._cvaOnChange(n),this._valueChange.emit(n),this.dateInput.emit(new Ue(this,this._elementRef.nativeElement)))}_onChange(){this.dateChange.emit(new Ue(this,this._elementRef.nativeElement))}_onBlur(){this.value&&this._formatValue(this.value),this._onTouched()}_formatValue(e){this._elementRef.nativeElement.value=e?this._dateAdapter.format(e,this._dateFormats.display.dateInput):""}_getValidDateOrNull(e){return this._dateAdapter.isDateInstance(e)&&this._dateAdapter.isValid(e)?e:null}_assignValue(e){this._model?(this._assignValueToModel(e),this._pendingValue=null):this._pendingValue=e}_isValidValue(e){return!e||this._dateAdapter.isValid(e)}_parentDisabled(){return!1}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.l),o.Nb(S.a,8),o.Nb(S.c,8))},e.\u0275dir=o.Ib({type:e,inputs:{value:"value",disabled:"disabled"},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[o.zb]}),e})();const Ge={provide:a.s,useExisting:Object(o.V)(()=>Xe),multi:!0},Ye={provide:a.r,useExisting:Object(o.V)(()=>Xe),multi:!0};let Xe=(()=>{class e extends qe{constructor(e,t,n,i){super(e,t,n),this._formField=i,this._validator=a.I.compose(super._getValidators())}set matDatepicker(e){e&&(this._datepicker=e,this._registerModel(e._registerInput(this)))}get min(){return this._min}set min(e){this._min=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._validatorOnChange()}get max(){return this._max}set max(e){this._max=this._getValidDateOrNull(this._dateAdapter.deserialize(e)),this._validatorOnChange()}get dateFilter(){return this._dateFilter}set dateFilter(e){this._dateFilter=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}getPopupConnectionElementRef(){return this.getConnectedOverlayOrigin()}_openPopup(){this._datepicker&&this._datepicker.open()}_getValueFromModel(e){return e}_assignValueToModel(e){this._model&&this._model.updateSelection(e,this)}_getMinDate(){return this._min}_getMaxDate(){return this._max}_getDateFilter(){return this._dateFilter}_canEmitChangeEvent(){return!0}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.l),o.Nb(S.a,8),o.Nb(S.c,8),o.Nb(y.a,8))},e.\u0275dir=o.Ib({type:e,selectors:[["input","matDatepicker",""]],hostVars:5,hostBindings:function(e,t){1&e&&o.ac("input",(function(e){return t._onInput(e.target.value)}))("change",(function(){return t._onChange()}))("blur",(function(){return t._onBlur()}))("keydown",(function(e){return t._onKeydown(e)})),2&e&&(o.Wb("disabled",t.disabled),o.Cb("aria-haspopup",t._datepicker?"dialog":null)("aria-owns",(null==t._datepicker?null:t._datepicker.opened)&&t._datepicker.id||null)("min",t.min?t._dateAdapter.toIso8601(t.min):null)("max",t.max?t._dateAdapter.toIso8601(t.max):null))},inputs:{matDatepicker:"matDatepicker",min:"min",max:"max",dateFilter:["matDatepickerFilter","dateFilter"]},exportAs:["matDatepickerInput"],features:[o.Ab([Ge,Ye,{provide:k,useExisting:e}]),o.yb]}),e})(),Qe=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=o.Ib({type:e,selectors:[["","matDatepickerToggleIcon",""]]}),e})(),Je=(()=>{class e{constructor(e,t,n){this._intl=e,this._changeDetectorRef=t,this._stateChanges=z.a.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(e){this._disabled=Object(f.c)(e)}ngOnChanges(e){e.datepicker&&this._watchStateChanges()}ngOnDestroy(){this._stateChanges.unsubscribe()}ngAfterContentInit(){this._watchStateChanges()}_open(e){this.datepicker&&!this.disabled&&(this.datepicker.open(),e.stopPropagation())}_watchStateChanges(){const e=this.datepicker?this.datepicker._stateChanges:Object(U.a)(),t=this.datepicker&&this.datepicker._datepickerInput?this.datepicker._datepickerInput._stateChanges:Object(U.a)(),n=this.datepicker?Object(j.a)(this.datepicker.openedStream,this.datepicker.closedStream):Object(U.a)();this._stateChanges.unsubscribe(),this._stateChanges=Object(j.a)(this._intl.changes,e,t,n).subscribe(()=>this._changeDetectorRef.markForCheck())}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(he),o.Nb(o.h),o.Yb("tabindex"))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-datepicker-toggle"]],contentQueries:function(e,t,n){var i;1&e&&o.Gb(n,Qe,!0),2&e&&o.rc(i=o.bc())&&(t._customIcon=i.first)},viewQuery:function(e,t){var n;1&e&&o.Nc(ce,!0),2&e&&o.rc(n=o.bc())&&(t._button=n.first)},hostAttrs:[1,"mat-datepicker-toggle"],hostVars:7,hostBindings:function(e,t){1&e&&o.ac("focus",(function(){return t._button.focus()})),2&e&&(o.Cb("tabindex",t.disabled?null:-1),o.Fb("mat-datepicker-toggle-active",t.datepicker&&t.datepicker.opened)("mat-accent",t.datepicker&&"accent"===t.datepicker.color)("mat-warn",t.datepicker&&"warn"===t.datepicker.color))},inputs:{tabIndex:"tabIndex",disabled:"disabled",datepicker:["for","datepicker"],disableRipple:"disableRipple"},exportAs:["matDatepickerToggle"],features:[o.zb],ngContentSelectors:be,decls:4,vars:6,consts:[["mat-icon-button","","type","button",3,"disabled","disableRipple","click"],["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(e,t){1&e&&(o.jc(de),o.Tb(0,"button",0,1),o.ac("click",(function(e){return t._open(e)})),o.Fc(2,le,2,0,"svg",2),o.ic(3),o.Sb()),2&e&&(o.kc("disabled",t.disabled)("disableRipple",t.disableRipple),o.Cb("aria-haspopup",t.datepicker?"dialog":null)("aria-label",t._intl.openCalendarLabel)("tabindex",t.disabled?-1:t.tabIndex),o.Bb(2),o.kc("ngIf",!t._customIcon))},directives:[u.b,i.t],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}\n"],encapsulation:2,changeDetection:0}),e})(),Ke=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},providers:[he,Ne,{provide:Ce,useClass:we}],imports:[[i.c,u.c,g.g,V.d,E.a,$.h],L.b]}),e})();var We=n("7EHt"),Ze=n("XhcP");const et={admin:{tagTypes:[{name:"custom"}],pages:[]}};var tt=n("h4Ec");let nt=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,u.c,P.b]]}),e})();var it=n("5+WD"),at=n("kmQS"),st=n("twBr"),ot=n("OnlV"),rt=n("N2vX"),ct=n("nQeM"),lt=n("zW5C");let dt=(()=>{class e{constructor(e,t,n,i){this.settings=e,this.currentUser=t,this.breakpoints=n,this.router=i,this.leftColumnIsHidden=!1,this.menu=this.generateMenu()}ngOnInit(){this.leftColumnIsHidden=this.breakpoints.isMobile$.value,this.menu=this.generateMenu(),this.router.events.pipe(Object(X.a)(e=>e instanceof c.b)).subscribe(()=>{this.leftColumnIsHidden=this.breakpoints.isMobile$.value})}toggleLeftSidebar(){this.leftColumnIsHidden=!this.leftColumnIsHidden}getCustomSidebarItems(){return this.settings.get("vebto.admin.pages")}generateMenu(){const e=[{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")&&e.push({name:"ads",icon:"ads",permission:"settings.view",route:"ads"}),e.map(e=>(e.type="route",e.label=e.name,e.action="admin/"+e.route,e.activeExact=!1,e.condition=function(t,n){let i=!0;return"plans"!==e.name&&"subscriptions"!==e.name||(i=n.get("billing.enable")),i&&t.hasPermission(e.permission)},e))}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(at.a),o.Nb(st.a),o.Nb(ot.a),o.Nb(c.d))},e.\u0275cmp=o.Hb({type:e,selectors:[["admin"]],decls:11,vars:13,consts:[["menuPosition","admin-navbar","color","primary",3,"showToggleButton","toggleButtonClick"],[1,"admin-page-content"],[1,"left-column",3,"opened","mode","fixedInViewport","fixedTopGap"],[1,"left-column-inner"],[3,"position","vertical"],[1,"version"],[1,"content-inner"]],template:function(e,t){1&e&&(o.Tb(0,"material-navbar",0),o.ac("toggleButtonClick",(function(){return t.toggleLeftSidebar()})),o.Sb(),o.Tb(1,"mat-sidenav-container",1),o.Tb(2,"mat-sidenav",2),o.fc(3,"async"),o.Tb(4,"div",3),o.Ob(5,"custom-menu",4),o.Tb(6,"div",5),o.Hc(7),o.fc(8,"trans"),o.Sb(),o.Sb(),o.Sb(),o.Tb(9,"mat-sidenav-content",6),o.Ob(10,"router-outlet"),o.Sb(),o.Sb()),2&e&&(o.kc("showToggleButton",!0),o.Bb(2),o.kc("opened",!t.leftColumnIsHidden)("mode",o.gc(3,9,t.breakpoints.isMobile$)?"over":"side")("fixedInViewport",!0)("fixedTopGap",70),o.Bb(3),o.kc("position",t.menu)("vertical",!0),o.Bb(2),o.Kc(" ",o.gc(8,11,"Version:")," ",t.settings.get("version")," "))},directives:[rt.a,Ze.e,Ze.d,ct.a,Ze.f,c.i],pipes:[i.b,lt.a],styles:["[_nghost-%COMP%]{display:block}material-navbar[_ngcontent-%COMP%]{position:fixed;top:0;left:0}.admin-page-content[_ngcontent-%COMP%]{position:relative;top:70px;min-height:calc(100vh - 70px)}.left-column[_ngcontent-%COMP%]{width:225px;flex-shrink:0;border-right:1px solid var(--be-divider-default);box-shadow:none}.left-column-inner[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;padding:20px 8px 0}.version[_ngcontent-%COMP%]{padding:5px 8px;font-size:1.3rem;margin-top:auto}.content-inner[_ngcontent-%COMP%]{flex:1 1 auto;padding:25px;overflow:initial}@media only screen and (max-width:768px){.content-inner[_ngcontent-%COMP%]{padding:10px}}"],changeDetection:0}),e})();var bt=n("0QyJ"),ut=n("vhtE"),ht=n("2Vo4"),pt=n("nYR2"),gt=n("SW18"),mt=n("i2dy"),ft=n("+JQf"),vt=n("Rd8u");function _t(e,t){1&e&&(o.Tb(0,"h2",26),o.Hc(1,"Update Template Details"),o.Sb())}function St(e,t){1&e&&(o.Tb(0,"h2",26),o.Hc(1,"Create a New Template"),o.Sb())}function yt(e,t){if(1&e&&(o.Tb(0,"div",27),o.Hc(1),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Ic(e.errors.name)}}function kt(e,t){if(1&e&&(o.Tb(0,"option",28),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("ngValue",e),o.Bb(1),o.Ic(e)}}function Tt(e,t){if(1&e&&(o.Tb(0,"div",27),o.Hc(1),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Ic(e.errors.category)}}function Ct(e,t){if(1&e&&(o.Tb(0,"div",27),o.Hc(1),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Ic(e.errors.template)}}function wt(e,t){if(1&e&&(o.Tb(0,"div",27),o.Hc(1),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Ic(e.errors.thumbnail)}}function xt(e,t){if(1&e&&(o.Tb(0,"div",27),o.Hc(1),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Ic(e.errors.includeBootstrap)}}function It(e,t){1&e&&(o.Tb(0,"span",16),o.Hc(1,"Update Template"),o.Sb())}function Ot(e,t){1&e&&(o.Tb(0,"span",16),o.Hc(1,"Create Template"),o.Sb())}let Mt=(()=>{class e{constructor(e,t,n,i,a,s,o,r){this.dialogRef=e,this.data=t,this.templates=n,this.toast=i,this.themesApi=a,this.settings=s,this.fb=o,this.cd=r,this.allCategories=[],this.themes=[],this.loading$=new ht.a(!1),this.form=this.fb.group({name:[""],category:[""],includeBootstrap:[!1]}),this.files={},this.errors={},this.allCategories=this.settings.getJson("builder.template_categories",[]),this.form.get("category").setValue(this.allCategories[0])}ngOnInit(){this.getThemes(),this.data.template&&this.hydrateModel(this.data.template)}confirm(){let e;this.loading$.next(!0);const t=this.getPayload();e=this.data.template?this.templates.update(this.data.template.name,t):this.templates.create(t),e.pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(e=>{this.close(e.template),this.toast.open("Template has been "+(this.data.template?"updated":"created"))},e=>{this.errors=e.errors,this.cd.markForCheck()})}getPayload(){const e=new FormData;this.files.template&&e.append("template",this.files.template),this.files.thumbnail&&e.append("thumbnail",this.files.thumbnail);for(const t in this.form.value)e.append(t,this.form.value[t]);return e}close(e){this.dialogRef.close(e)}hydrateModel(e){this.form.patchValue(e.config)}setFile(e,t){this.files[e]=t.item(0),this.errors={}}getThemes(){this.themesApi.all().subscribe(e=>{this.themes=e.themes})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(g.h),o.Nb(g.a),o.Nb(gt.a),o.Nb(mt.b),o.Nb(ft.a),o.Nb(at.a),o.Nb(a.h),o.Nb(o.h))},e.\u0275cmp=o.Hb({type:e,selectors:[["crupdate-template-modal"]],decls:47,vars:15,consts:[[1,"modal-header"],["class","modal-title","mat-dialog-title","","trans","",4,"ngIf"],["type","button",1,"close-button","no-style","icon-button",3,"click"],["svgIcon","close"],["autocomplete","off","ngNativeValidate","",3,"formGroup","ngSubmit"],["mat-dialog-content","",1,"many-inputs","mat-dialog-content"],[1,"input-container"],["for","name","trans",""],["type","text","id","name","name","name","formControlName","name","required",""],["class","error",4,"ngIf"],["for","category","trans",""],["id","category","name","category","formControlName","category","required",""],[3,"ngValue",4,"ngFor","ngForOf"],["for","template-file","trans",""],["type","file","name","template-file","id","template-file","accept","application/zip",3,"required","change"],["templateInput",""],["trans",""],["for","thumbnail","trans",""],["type","file","name","thumbnail","id","thumbnail","accept","image/*",3,"change"],["thumbInput",""],[1,"setting-toggle-container"],["formControlName","includeBootstrap","trans",""],["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"],["mat-dialog-title","","trans","",1,"modal-title"],[1,"error"],[3,"ngValue"]],template:function(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",0),o.Fc(1,_t,2,0,"h2",1),o.Fc(2,St,2,0,"h2",1),o.Tb(3,"button",2),o.ac("click",(function(){return t.close()})),o.Ob(4,"mat-icon",3),o.Sb(),o.Sb(),o.Tb(5,"form",4),o.ac("ngSubmit",(function(){return t.confirm()})),o.Tb(6,"div",5),o.Tb(7,"div",6),o.Tb(8,"label",7),o.Hc(9,"Name"),o.Sb(),o.Ob(10,"input",8),o.Fc(11,yt,2,1,"div",9),o.Sb(),o.Tb(12,"div",6),o.Tb(13,"label",10),o.Hc(14,"Category"),o.Sb(),o.Tb(15,"select",11),o.Fc(16,kt,2,2,"option",12),o.Sb(),o.Fc(17,Tt,2,1,"div",9),o.Sb(),o.Tb(18,"div",6),o.Tb(19,"label",13),o.Hc(20,"Template Zip"),o.Sb(),o.Tb(21,"input",14,15),o.ac("change",(function(){o.vc(e);const n=o.sc(22);return t.setFile("template",n.files)})),o.Sb(),o.Tb(23,"p",16),o.Hc(24,"Zip of template files. Must contain index.html file which will be used as default page."),o.Sb(),o.Tb(25,"p",16),o.Hc(26,'(Optional) CSS and JS that should appear in builder code editors should be in "css/code_editor_styles.css" and "js/code_editor_scripts.js" files.'),o.Sb(),o.Fc(27,Ct,2,1,"div",9),o.Sb(),o.Tb(28,"div",6),o.Tb(29,"label",17),o.Hc(30,"Thumbnail"),o.Sb(),o.Tb(31,"input",18,19),o.ac("change",(function(){o.vc(e);const n=o.sc(32);return t.setFile("thumbnail",n.files)})),o.Sb(),o.Fc(33,wt,2,1,"div",9),o.Sb(),o.Tb(34,"div",20),o.Tb(35,"mat-slide-toggle",21),o.Hc(36,"Include Bootstrap"),o.Sb(),o.Tb(37,"p",16),o.Hc(38,"Deselect if template already include bootstrap, otherwise styles will be duplicated which might cause issues."),o.Sb(),o.Fc(39,xt,2,1,"div",9),o.Sb(),o.Sb(),o.Tb(40,"div",22),o.Tb(41,"button",23),o.ac("click",(function(){return t.close()})),o.Hc(42,"Cancel"),o.Sb(),o.Tb(43,"button",24),o.fc(44,"async"),o.Fc(45,It,2,0,"span",25),o.Fc(46,Ot,2,0,"span",25),o.Sb(),o.Sb(),o.Sb()}2&e&&(o.Bb(1),o.kc("ngIf",t.data.template),o.Bb(1),o.kc("ngIf",!t.data.template),o.Bb(3),o.kc("formGroup",t.form),o.Bb(6),o.kc("ngIf",t.errors.name),o.Bb(5),o.kc("ngForOf",t.allCategories),o.Bb(1),o.kc("ngIf",t.errors.category),o.Bb(4),o.kc("required",!t.data.template),o.Bb(6),o.kc("ngIf",t.errors.template),o.Bb(6),o.kc("ngIf",t.errors.thumbnail),o.Bb(6),o.kc("ngIf",t.errors.includeBootstrap),o.Bb(4),o.kc("disabled",o.gc(44,13,t.loading$)),o.Bb(2),o.kc("ngIf",t.data.template),o.Bb(1),o.kc("ngIf",!t.data.template))},directives:[i.t,P.a,a.v,a.m,g.f,vt.a,a.d,a.u,a.k,a.F,a.G,i.s,w.a,g.c,u.b,g.i,a.z,a.J],pipes:[i.b],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}"],changeDetection:0}),e})();var Dt=n("itXk"),Bt=n("re4b"),Ht=n("Kj3r"),Pt=n("lJxs"),Ft=n("Zy1z"),At=n("vkgz");function Rt(e){const t=Object.assign({},e);return Object.keys(t).forEach(e=>(null==t[e]||""===t[e])&&delete t[e]),t}var Nt=n("/RwR");const Et={title:"Delete :resource",body:"Are you sure you want to delete selected :resource?",ok:"Delete"};var Vt=n("hLX6");function $t(e,t){const n=Vt.pick(t,e);if(Object(f.a)(n)){const e=Number(n);return e<9007199254740991?e:n}return n}var Lt=n("QGXG"),zt=n("ahrr");let jt=(()=>{class e{constructor(e,t,n,i){this.modal=e,this.router=t,this.http=n,this.localStorage=i,this.sort$=new ht.a({}),this.filters$=new ht.a({}),this.staticParams$=new ht.a({}),this.paginator=new Bt.a(this.router,this.http,this.localStorage),this.ignoreNextParamChange=!1,this.originalData$=new ht.a([]),this.data$=new ht.a([]),this.selectedRows$=new ht.a([])}get data(){return this.data$.value}set data(e){const t=[...e];this.originalData$.next(t),this.data$.next(t),this.ignoreNextParamChange=!0,this.reset()}init(e={}){return this.config=e,this.staticParams$.next(Object.assign(Object.assign({},this.staticParams$.value),e.staticParams)),e.uri?this.connectToPaginator():e.initialData&&(this.data=e.initialData),this.mainSub=Object(Dt.a)([this.sort$,this.filters$,this.staticParams$]).pipe(Object(Ht.a)(0),Object(Pt.a)(e=>Object.assign({},...e))).subscribe(e=>{if(this.ignoreNextParamChange)return this.ignoreNextParamChange=!1;e=Rt(e),Object.entries(e).forEach(([t,n])=>{"object"==typeof n&&n.id&&(e[t+"Id"]=n.id,delete e[t])}),this.config.uri?this.paginator.paginate(e,this.config.uri,this.config.initialData):Object.keys(e).length&&this.data.length&&this.applyLocalTransforms(e)}),this}connectToPaginator(){this.paginatorSub=this.paginator.response$.pipe(Object(Ft.a)()).subscribe(([e,t])=>{var n;const i=this.config.infiniteScroll&&(null===(n=null==e?void 0:e.pagination)||void 0===n?void 0:n.current_page)!==t.pagination.current_page?[...this.data$.value,...t.pagination.data]:t.pagination.data;this.data$.next(i)})}applyLocalTransforms(e){let t=[...this.originalData$.value];e.query&&(t=function(e,t){return e.filter(e=>function(e,t){const n=function e(t){return Object.keys(t).reduce((n,i)=>n+(t[i]&&"object"==typeof t[i]?e(t[i]):t[i])+"\u25ec","").toLowerCase()}(e),i=t.trim().toLowerCase();return-1!==n.indexOf(i)}(e,t))}(t,e.query)),e.orderBy&&e.orderDir&&(t=function(e,t,n){return e.sort((e,i)=>{let a=$t(e,t),s=$t(i,t);const o=typeof a,r=typeof s;o!==r&&("number"===o&&(a+=""),"number"===r&&(s+=""));let c=0;return null!=a&&null!=s?a>s?c=1:a<s&&(c=-1):null!=a?c=1:null!=s&&(c=-1),c*("asc"===n?1:-1)})}(t,e.orderBy,e.orderDir)),this.data$.next(t)}addFilter(e,t){this.filters$.next(Object.assign(Object.assign({},this.filters$.value),{[e]:t}))}removeFilter(e){const t=Object.assign({},this.filters$.value);delete t[e],this.filters$.next(t)}reset(e=null){this.filters$.next({}),this.sort$.next({}),this.selectedRows$.next([]),e&&this.staticParams$.next(e)}openCrupdateResourceModal(e,t,n){return this.modal.open(e,t,n).beforeClosed().pipe(Object(X.a)(e=>!!e),Object(At.a)(()=>this.reset()))}confirmResourceDeletion(e){const t=Object.assign(Object.assign({},Et),{replacements:{resource:e}});return this.modal.open(Nt.a,t).afterClosed().pipe(Object(X.a)(e=>e))}getCurrentParams(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.sort$.value),this.filters$.value),this.staticParams$.value),this.paginator.params)}destroy(){var e,t;null===(e=this.paginatorSub)||void 0===e||e.unsubscribe(),null===(t=this.mainSub)||void 0===t||t.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(o.Xb(Lt.a),o.Xb(c.d),o.Xb(r.a),o.Xb(zt.a))},e.\u0275prov=o.Jb({token:e,factory:e.\u0275fac}),e})();const Ut=[{originX:"start",originY:"center",overlayX:"end",overlayY:"center",offsetX:5},{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:5}];var qt=n("nPOm"),Gt=n("ZfYz");function Yt(e,t){1&e&&o.Pb(0)}let Xt=(()=>{class e{constructor(e,t){this.data=e,this.overlayPanelRef=t}close(){this.overlayPanelRef.close()}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(qt.a),o.Nb(Gt.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["datatable-filters-panel"]],hostVars:1,hostBindings:function(e,t){2&e&&o.Ec("@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(e,t){1&e&&(o.Tb(0,"header"),o.Ob(1,"mat-icon",0),o.Tb(2,"span",1),o.Hc(3,"Filters"),o.Sb(),o.Sb(),o.Tb(4,"form",2),o.ac("ngSubmit",(function(){return t.close()})),o.Fc(5,Yt,1,0,"ng-container",3),o.Sb(),o.Tb(6,"footer"),o.Tb(7,"button",4),o.ac("click",(function(){return t.close()})),o.Hc(8,"Close"),o.Sb(),o.Sb()),2&e&&(o.Bb(5),o.kc("ngTemplateOutlet",t.data.filters))},directives:[P.a,vt.a,a.K,a.v,a.w,i.A,u.b],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:[g.j.dialogContainer]},changeDetection:0}),e})();var Qt=n("dz5c"),Jt=n("/uUt");function Kt(e,t){1&e&&o.Ob(0,"mat-icon",3)}let Wt=(()=>{class e{constructor(e,t){this.datatable=e,this.route=t,this.searchControl=new a.i(this.route.snapshot.queryParams.query),this.hideIcon=!1}ngOnInit(){this.searchControl.valueChanges.pipe(Object(Ht.a)(400),Object(Jt.a)()).subscribe(e=>{this.datatable.addFilter("query",e)})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(jt),o.Nb(c.a))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Ob(1,"input",1),o.fc(2,"trans"),o.Fc(3,Kt,1,0,"mat-icon",2),o.Sb()),2&e&&(o.Bb(1),o.kc("placeholder",o.gc(2,3,t.placeholder))("formControl",t.searchControl),o.Bb(2),o.kc("ngIf",!t.hideIcon))},directives:[a.d,a.u,a.j,i.t,P.a],pipes:[lt.a],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}),e})();const Zt=["tableFilters"],en=["filterButton"];function tn(e,t){1&e&&o.Ob(0,"mat-progress-bar",7)}function nn(e,t){1&e&&(o.Tb(0,"div",8),o.ic(1),o.Sb())}function an(e,t){if(1&e&&(o.Tb(0,"div",9),o.Hc(1),o.fc(2,"trans"),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Lc(" ",e.numberOfRowsSelected," ",e.pluralResourceName," ",o.gc(2,3,"Selected")," ")}}function sn(e,t){if(1&e){const e=o.Ub();o.Tb(0,"mat-chip",18),o.ac("removed",(function(){o.vc(e);const n=t.$implicit;return o.ec(3).datatable.removeFilter(n.key)})),o.Hc(1),o.Ob(2,"mat-icon",19),o.Sb()}if(2&e){const e=t.$implicit,n=o.ec(3);o.kc("removable",!0)("selectable",!1),o.Bb(1),o.Kc(" ",e.key,": ",n.isModel(e.value)?e.value.name||e.value.display_name:e.value," ")}}function on(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"mat-chip-list",13),o.Fc(2,sn,3,4,"mat-chip",14),o.fc(3,"keyvalue"),o.fc(4,"async"),o.Sb(),o.Tb(5,"button",15,16),o.ac("click",(function(){return o.vc(e),o.ec(2).openFiltersPanel()})),o.Ob(7,"mat-icon",17),o.Sb(),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(2),o.kc("ngForOf",o.gc(3,3,o.gc(4,5,e.filters$))),o.Bb(3),o.Fb("active",e.filterPanelRef)}}function rn(e,t){if(1&e&&(o.Tb(0,"div",10),o.Fc(1,on,8,7,"ng-container",11),o.Ob(2,"datatable-header-search-input",12),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.kc("ngIf",e.filterPanelTemplate),o.Bb(1),o.mc("placeholder","Search ",e.pluralResourceName,"")}}function cn(e,t){1&e&&(o.Tb(0,"div",20),o.ic(1,1),o.Sb())}const ln=[[["","leftContent",""]],[["","rightContent",""]]],dn=["[leftContent]","[rightContent]"];let bn=(()=>{class e{constructor(e,t,n){this.datatable=e,this.cd=t,this.overlayPanel=n,this.showSelectedActions=!0,this.subscriptions=[],this.filters$=this.datatable.filters$.pipe(Object(Pt.a)(e=>{const t=Rt(e);return delete t.query,t}))}ngOnInit(){const e=this.datatable.filters$.subscribe(()=>{this.filterPanelRef&&this.filterPanelRef.close()}),t=this.datatable.selectedRows$.subscribe(e=>{this.numberOfRowsSelected=e.length,this.cd.markForCheck()});this.subscriptions=[e,t]}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}openFiltersPanel(){if(this.filterPanelRef)this.filterPanelRef.close();else{const e=Ut.slice();e[0].offsetY=40,e[1].offsetY=40,this.filterPanelRef=this.overlayPanel.open(Xt,{origin:this.filterButton,position:e,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(e){return"object"==typeof e&&e.id}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(jt),o.Nb(o.h),o.Nb(Qt.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["datatable-header"]],contentQueries:function(e,t,n){var i;1&e&&o.Gb(n,Zt,!0),2&e&&o.rc(i=o.bc())&&(t.filterPanelTemplate=i.first)},viewQuery:function(e,t){var n;1&e&&o.Nc(en,!0,o.l),2&e&&o.rc(n=o.bc())&&(t.filterButton=n.first)},hostVars:2,hostBindings:function(e,t){2&e&&o.Fb("rows-selected",t.numberOfRowsSelected)},inputs:{pluralResourceName:"pluralResourceName",showSelectedActions:"showSelectedActions"},ngContentSelectors:dn,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(e,t){1&e&&(o.jc(ln),o.Fc(0,tn,1,0,"mat-progress-bar",0),o.fc(1,"async"),o.Tb(2,"div",1),o.Fc(3,nn,2,0,"div",2),o.Fc(4,an,3,5,"div",3),o.Sb(),o.Tb(5,"div",4),o.Fc(6,rn,3,2,"div",5),o.Fc(7,cn,2,0,"div",6),o.Sb()),2&e&&(o.kc("ngIf",o.gc(1,5,t.datatable.paginator&&t.datatable.paginator.loading$)),o.Bb(3),o.kc("ngIf",!t.showSelectedActions||!t.numberOfRowsSelected),o.Bb(1),o.kc("ngIf",t.showSelectedActions&&t.numberOfRowsSelected),o.Bb(2),o.kc("ngIf",!t.showSelectedActions||!t.numberOfRowsSelected),o.Bb(1),o.kc("ngIf",t.showSelectedActions&&t.numberOfRowsSelected))},directives:[i.t,s.a,Wt,p.c,i.s,u.b,P.a,p.a,p.d],pipes:[i.b,lt.a,i.l],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}),e})();const un=["table-header-checkbox",""];let hn=(()=>{class e{constructor(e,t){this.datatable=e,this.cd=t}ngOnInit(){this.changeRef=this.datatable.selectedRows$.subscribe(()=>{this.cd.markForCheck()})}ngOnDestroy(){this.changeRef.unsubscribe()}anyRowsSelected(){return!!this.datatable.selectedRows$.value.length}allRowsSelected(){var e;return this.datatable.selectedRows$.value.length&&this.datatable.selectedRows$.value.length===(null===(e=this.datatable.data$.value)||void 0===e?void 0:e.length)}toggleAllRows(){this.allRowsSelected()?this.datatable.selectedRows$.next([]):this.datatable.selectedRows$.next(this.datatable.data$.value.map(e=>e.id))}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(jt),o.Nb(o.h))},e.\u0275cmp=o.Hb({type:e,selectors:[["","table-header-checkbox",""]],hostAttrs:[1,"table-checkbox"],attrs:un,decls:1,vars:2,consts:[[3,"checked","indeterminate","change"]],template:function(e,t){1&e&&(o.Tb(0,"mat-checkbox",0),o.ac("change",(function(e){return e?t.toggleAllRows():null})),o.Sb()),2&e&&o.kc("checked",t.allRowsSelected())("indeterminate",t.anyRowsSelected()&&!t.allRowsSelected())},directives:[h.a],encapsulation:2,changeDetection:0}),e})();var pn=n("WAq7");const gn=["columnName"],mn=["table-sort-header",""],fn=["*"];let vn=(()=>{class e{constructor(e,t,n,i){this.datable=e,this.cd=t,this.focusMonitor=n,this.el=i,this.orderDir=null,this.arrowVisible=!1,this.arrowDirection="down"}get sortDisabled(){var e;return null===(e=this.datable.config)||void 0===e?void 0:e.disableSort}ngOnInit(){this.orderBy||(this.orderBy=Object(pn.a)(this.columnName.nativeElement.textContent,"_")),this.sortSub=this.datable.sort$.pipe(Object(X.a)(e=>e.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(e){switch(e){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 e;(null===(e=this.datable.config)||void 0===e?void 0:e.disableSort)||(this.arrowVisible=!0)}onMouseLeave(){this.arrowVisible=!1,this.orderDir||(this.arrowDirection="down")}handleClick(){var e;(null===(e=this.datable.config)||void 0===e?void 0:e.disableSort)||this.changeSort()}handleKeydown(e){var t;(null===(t=this.datable.config)||void 0===t?void 0:t.disableSort)||e.keyCode!==q.n&&e.keyCode!==q.f||(e.preventDefault(),this.changeSort())}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(jt),o.Nb(o.h),o.Nb(E.h),o.Nb(o.l))},e.\u0275cmp=o.Hb({type:e,selectors:[["","table-sort-header",""]],viewQuery:function(e,t){var n;1&e&&o.Bc(gn,!0),2&e&&o.rc(n=o.bc())&&(t.columnName=n.first)},hostAttrs:["tabindex","0"],hostVars:4,hostBindings:function(e,t){1&e&&o.ac("click",(function(){return t.handleClick()}))("keydown",(function(e){return t.handleKeydown(e)}))("mouseenter",(function(){return t.onMouseEnter()}))("mouseleave",(function(){return t.onMouseLeave()})),2&e&&o.Fb("active",t.orderDir)("sort-disabled",t.sortDisabled)},inputs:{orderBy:["table-sort-header","orderBy"]},attrs:mn,ngContentSelectors:fn,decls:5,vars:3,consts:[[1,"text"],["columnName",""],[1,"icon-wrapper",3,"ngClass"],["svgIcon","arrow-downward",1,"sort-icon"]],template:function(e,t){1&e&&(o.jc(),o.Tb(0,"span",0,1),o.ic(2),o.Sb(),o.Tb(3,"span",2),o.Ob(4,"mat-icon",3),o.Sb()),2&e&&(o.Bb(3),o.kc("ngClass",t.arrowDirection),o.Bb(1),o.Fb("hint-visible",t.arrowVisible))},directives:[i.q,P.a],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}.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}),e})();function _n(e,t){if(1&e&&(o.Tb(0,"div",6),o.Tb(1,"div",7),o.Hc(2,"Items per page"),o.Sb(),o.Tb(3,"div",8),o.Tb(4,"select",9),o.Tb(5,"option",10),o.Hc(6,"10"),o.Sb(),o.Tb(7,"option",10),o.Hc(8,"15"),o.Sb(),o.Tb(9,"option",10),o.Hc(10,"20"),o.Sb(),o.Tb(11,"option",10),o.Hc(12,"50"),o.Sb(),o.Tb(13,"option",10),o.Hc(14,"100"),o.Sb(),o.Sb(),o.Sb(),o.Sb()),2&e){const e=o.ec();o.Bb(4),o.kc("formControl",e.perPageControl),o.Bb(1),o.kc("ngValue",10),o.Bb(2),o.kc("ngValue",15),o.Bb(2),o.kc("ngValue",20),o.Bb(2),o.kc("ngValue",50),o.Bb(2),o.kc("ngValue",100)}}function Sn(e,t){if(1&e&&(o.Tb(0,"div",11),o.Hc(1),o.fc(2,"trans"),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Mc(" ",e.from," - ",e.to," ",o.gc(2,4,"of")," ",e.totalRecords," ")}}let yn=(()=>{class e{constructor(e,t){this.datable=e,this.cd=t,this.hidePerPage=!1,this.perPageControl=new a.i(15)}ngOnInit(){this.changeRef=this.datable.paginator.response$.pipe(Object(X.a)(e=>!!(null==e?void 0:e.pagination)),Object(Pt.a)(e=>e.pagination)).subscribe(e=>{this.to=e.per_page*e.current_page,this.from=this.to-e.per_page||1,this.totalRecords=e.total,this.havePrevious=e.current_page>1,this.haveNext=e.current_page<e.last_page,this.perPageControl.setValue(parseInt(""+e.per_page),{emitEvent:!1}),this.cd.markForCheck()}),this.perPageControl.valueChanges.subscribe(e=>{this.datable.paginator.changePerPage(e)})}ngOnDestroy(){this.changeRef.unsubscribe(),this.datable.destroy()}previousPage(){this.datable.paginator.previousPage()}nextPage(){this.datable.paginator.nextPage()}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(jt),o.Nb(o.h))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Fc(0,_n,15,6,"div",0),o.Tb(1,"div",1),o.Fc(2,Sn,3,6,"div",2),o.Tb(3,"button",3),o.ac("click",(function(){return t.previousPage()})),o.fc(4,"async"),o.Ob(5,"mat-icon",4),o.Sb(),o.Tb(6,"button",3),o.ac("click",(function(){return t.nextPage()})),o.fc(7,"async"),o.Ob(8,"mat-icon",5),o.Sb(),o.Sb()),2&e&&(o.kc("ngIf",!t.hidePerPage),o.Bb(2),o.kc("ngIf",t.from&&t.to&&t.totalRecords),o.Bb(1),o.kc("disabled",!t.havePrevious||o.gc(4,4,t.datable.paginator.loading$)),o.Bb(3),o.kc("disabled",!t.haveNext||o.gc(7,6,t.datable.paginator.loading$)))},directives:[i.t,u.b,P.a,vt.a,a.G,a.u,a.j,a.z,a.J],pipes:[i.b,lt.a],styles:["[_nghost-%COMP%]{padding:0 8px;justify-content:flex-end;flex-wrap:wrap-reverse;width:100%;height:56px}.page-size[_ngcontent-%COMP%], [_nghost-%COMP%]{display:flex;align-items:center}.page-size[_ngcontent-%COMP%]{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}),e})();const kn=["table-body-checkbox",""];let Tn=(()=>{class e{constructor(e,t){this.datatable=e,this.cd=t}ngOnInit(){this.changeRef=this.datatable.selectedRows$.subscribe(e=>{this.cd.markForCheck()})}ngOnDestroy(){this.changeRef.unsubscribe()}isRowSelected(e){return this.datatable.selectedRows$.value.indexOf(e)>-1}toggleRow(e){if(this.isRowSelected(e)){const t=this.datatable.selectedRows$.value.slice(),n=this.datatable.selectedRows$.value.indexOf(e);t.splice(n,1),this.datatable.selectedRows$.next(t)}else this.datatable.selectedRows$.next([...this.datatable.selectedRows$.value,e])}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(jt),o.Nb(o.h))},e.\u0275cmp=o.Hb({type:e,selectors:[["","table-body-checkbox",""]],hostAttrs:[1,"table-checkbox"],inputs:{rowId:["table-body-checkbox","rowId"]},attrs:kn,decls:1,vars:1,consts:[[3,"checked","click","change"]],template:function(e,t){1&e&&(o.Tb(0,"mat-checkbox",0),o.ac("click",(function(e){return e.stopPropagation()}))("change",(function(e){return e?t.toggleRow(t.rowId):null})),o.Sb()),2&e&&o.kc("checked",t.isRowSelected(t.rowId))},directives:[h.a],encapsulation:2,changeDetection:0}),e})();var Cn=n("CH4Q"),wn=n("iB19");function xn(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",12),o.ac("click",(function(){return o.vc(e),o.ec().showCrupdateTemplateModal()})),o.Hc(1,"Add"),o.Sb()}}function In(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",13),o.ac("click",(function(){return o.vc(e),o.ec().maybeDeleteSelectedTemplates()})),o.fc(1,"trans"),o.Hc(2,"Delete Selected"),o.Sb()}2&e&&o.kc("matTooltip",o.gc(1,1,"Delete selected"))}function On(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",21),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec().showCrupdateTemplateModal(t)})),o.fc(1,"trans"),o.Ob(2,"mat-icon",22),o.Sb()}2&e&&o.kc("matTooltip",o.gc(1,1,"Edit template"))}function Mn(e,t){if(1&e&&(o.Tb(0,"tr"),o.Ob(1,"td",14),o.Tb(2,"td"),o.Tb(3,"div",15),o.Ob(4,"img",16),o.Tb(5,"span"),o.Hc(6),o.Sb(),o.Sb(),o.Sb(),o.Tb(7,"td",17),o.Hc(8),o.Sb(),o.Tb(9,"td",18),o.Hc(10),o.fc(11,"formattedDate"),o.Sb(),o.Tb(12,"td",19),o.Fc(13,On,3,3,"button",20),o.Sb(),o.Sb()),2&e){const e=t.$implicit,n=o.ec();o.Bb(1),o.kc("table-body-checkbox",e.name),o.Bb(3),o.kc("src",n.getTemplateThumbnail(e),o.xc),o.Bb(2),o.Ic(e.config.name),o.Bb(2),o.Ic(e.config.category),o.Bb(2),o.Ic(o.gc(11,6,e.updated_at)),o.Bb(3),o.kc("ngIf",n.currentUser.hasPermission("templates.update"))}}function Dn(e,t){1&e&&(o.Tb(0,"no-results-message",23),o.Tb(1,"span",24),o.Hc(2,"No templates have been created yet"),o.Sb(),o.Sb())}let Bn=(()=>{class e{constructor(e,t,n,i){this.templates=e,this.currentUser=t,this.settings=n,this.datatable=i,this.templates$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:"templates"})}maybeDeleteSelectedTemplates(){this.datatable.confirmResourceDeletion("templates").subscribe(()=>{this.templates.delete(this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset()})})}showCrupdateTemplateModal(e){this.datatable.openCrupdateResourceModal(Mt,{template:e}).subscribe()}getTemplateThumbnail(e){return this.settings.getBaseUrl(!0)+e.thumbnail}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(gt.a),o.Nb(st.a),o.Nb(at.a),o.Nb(jt))},e.\u0275cmp=o.Hb({type:e,selectors:[["templates"]],features:[o.Ab([jt])],decls:22,vars:8,consts:[[1,"datatable","responsive-table"],["pluralResourceName","templates"],["leftContent",""],["mat-raised-button","","color","accent","headerActions","","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","accent","rightContent","",3,"matTooltip","click",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","name","trans",""],["table-sort-header","","trans",""],["trans",""],[4,"ngFor","ngForOf"],["svgImage","insert-block.svg",4,"ngIf"],["mat-raised-button","","color","accent","headerActions","","trans","",3,"click"],["mat-raised-button","","color","accent","rightContent","",3,"matTooltip","click"],[3,"table-body-checkbox"],[1,"column-with-image"],[3,"src"],["data-label","Category"],["data-label","Last Updated"],[1,"edit-column"],["mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","edit"],["svgImage","insert-block.svg"],["primary-text",""]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"datatable-header",1),o.Rb(2,2),o.Fc(3,xn,2,0,"button",3),o.Qb(),o.Fc(4,In,3,3,"button",4),o.Sb(),o.Tb(5,"table",5),o.Tb(6,"thead"),o.Tb(7,"tr"),o.Ob(8,"th",6),o.Tb(9,"th",7),o.Hc(10,"Template"),o.Sb(),o.Tb(11,"th",8),o.Hc(12,"Category"),o.Sb(),o.Tb(13,"th",9),o.Hc(14,"Last Updated"),o.Sb(),o.Ob(15,"th"),o.Sb(),o.Sb(),o.Tb(16,"tbody"),o.Fc(17,Mn,14,8,"tr",10),o.fc(18,"async"),o.Sb(),o.Sb(),o.Fc(19,Dn,3,0,"no-results-message",11),o.fc(20,"async"),o.Ob(21,"datatable-footer"),o.Sb()),2&e&&(o.Bb(3),o.kc("ngIf",t.currentUser.hasPermission("templates.create")),o.Bb(1),o.kc("ngIf",t.currentUser.hasPermission("templates.delete")),o.Bb(13),o.kc("ngForOf",o.gc(18,4,t.templates$)),o.Bb(2),o.kc("ngIf",o.gc(20,6,t.datatable.paginator.noResults$)))},directives:[bn,i.t,hn,vn,vt.a,i.s,yn,u.b,I.a,Tn,P.a,Cn.a],pipes:[i.b,lt.a,wn.a],styles:[""],changeDetection:0}),e})();var Hn=n("agwZ"),Pn=n("qnHw"),Fn=n("AUIZ");function An(e,t){if(1&e&&(o.Rb(0),o.Ob(1,"img",1),o.Tb(2,"div",2),o.Tb(3,"div"),o.Hc(4),o.Sb(),o.Tb(5,"div",3),o.Hc(6),o.Sb(),o.Sb(),o.Qb()),2&e){const e=o.ec();o.Bb(1),o.kc("src",e.user.avatar,o.xc),o.Bb(3),o.Ic(e.user.display_name),o.Bb(2),o.Ic(e.user.email)}}let Rn=(()=>{class e{constructor(){this.showEmail=!1}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["user-column"]],hostAttrs:[1,"column-with-image"],inputs:{user:"user",showEmail:"showEmail"},decls:1,vars:1,consts:[[4,"ngIf"],["alt","",3,"src"],[1,"content"],[1,"email","secondary"]],template:function(e,t){1&e&&o.Fc(0,An,7,3,"ng-container",0),2&e&&o.kc("ngIf",t.user)},directives:[i.t],styles:[""],changeDetection:0}),e})();function Nn(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",13),o.ac("click",(function(){return o.vc(e),o.ec().showCrupdateProjectModal()})),o.Hc(1,"Add"),o.Sb()}}function En(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",14),o.ac("click",(function(){return o.vc(e),o.ec().maybeDeleteSelectedProjects()})),o.fc(1,"trans"),o.Hc(2,"Delete Selected"),o.Sb()}2&e&&o.kc("matTooltip",o.gc(1,1,"Delete selected"))}function Vn(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",26),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec().showCrupdateProjectModal(t)})),o.fc(1,"trans"),o.Ob(2,"mat-icon",27),o.Sb()}2&e&&o.kc("matTooltip",o.gc(1,1,"Update details"))}const $n=function(e){return["/builder",e]};function Ln(e,t){if(1&e&&(o.Tb(0,"tr"),o.Ob(1,"td",15),o.Tb(2,"td"),o.Tb(3,"div",16),o.Ob(4,"img",17),o.Tb(5,"span"),o.Hc(6),o.Sb(),o.Sb(),o.Sb(),o.Tb(7,"td",18),o.Ob(8,"user-column",19),o.Sb(),o.Tb(9,"td",20),o.Hc(10),o.Sb(),o.Tb(11,"td",21),o.Hc(12),o.Sb(),o.Tb(13,"td"),o.Hc(14),o.fc(15,"formattedDate"),o.Sb(),o.Tb(16,"td",22),o.Tb(17,"a",23),o.fc(18,"trans"),o.Ob(19,"mat-icon",24),o.Sb(),o.Fc(20,Vn,3,3,"button",25),o.Sb(),o.Sb()),2&e){const e=t.$implicit,n=o.ec();o.Bb(1),o.kc("table-body-checkbox",e.id),o.Bb(3),o.kc("src",n.getProjectThumbnail(e),o.xc),o.Bb(2),o.Jc(" ",e.name," "),o.Bb(2),o.kc("user",e.users[0]),o.Bb(2),o.Jc("",e.published?"Yes":"No"," "),o.Bb(2),o.Jc("",e.template," "),o.Bb(2),o.Ic(o.gc(15,10,e.updated_at)),o.Bb(3),o.kc("routerLink",o.oc(14,$n,e.id))("matTooltip",o.gc(18,12,"Edit project")),o.Bb(3),o.kc("ngIf",n.currentUser.hasPermission("projects.update"))}}function zn(e,t){1&e&&(o.Tb(0,"no-results-message",28),o.Tb(1,"span",29),o.Hc(2,"No projects have been created yet"),o.Sb(),o.Sb())}let jn=(()=>{class e{constructor(e,t,n,i,a){this.datatable=e,this.projects=t,this.modal=n,this.projectUrl=i,this.currentUser=a,this.projects$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:Hn.a.BASE_URI})}maybeDeleteSelectedProjects(){this.datatable.confirmResourceDeletion("projects").subscribe(()=>{this.projects.delete({ids:this.datatable.selectedRows$.value}).subscribe(()=>{this.datatable.reset()})})}showCrupdateProjectModal(e){this.datatable.openCrupdateResourceModal(Pn.a,{project:e,showExtraConfig:!0}).subscribe()}getProjectThumbnail(e){return this.projectUrl.getBaseUrl(e)+"thumbnail.png"}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(jt),o.Nb(Hn.a),o.Nb(Lt.a),o.Nb(Fn.a),o.Nb(st.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["projects"]],features:[o.Ab([jt])],decls:26,vars:8,consts:[[1,"datatable","responsive-table"],["pluralResourceName","projects"],["leftContent",""],["mat-raised-button","","color","accent","headerActions","","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","accent","rightContent","","trans","",3,"matTooltip","click",4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","name","trans",""],["trans",""],["table-sort-header","","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngFor","ngForOf"],["svgImage","website-builder.svg",4,"ngIf"],["mat-raised-button","","color","accent","headerActions","","trans","",3,"click"],["mat-raised-button","","color","accent","rightContent","","trans","",3,"matTooltip","click"],[3,"table-body-checkbox"],[1,"column-with-image"],["alt","",3,"src"],["data-label","Owner"],[3,"user"],["data-label","Published"],["data-label","Template"],[1,"edit-column"],["mat-icon-button","","target","_blank",3,"routerLink","matTooltip"],["svgIcon","edit"],["mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["mat-icon-button","",3,"matTooltip","click"],["svgIcon","settings"],["svgImage","website-builder.svg"],["primary-text",""]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"datatable-header",1),o.Rb(2,2),o.Fc(3,Nn,2,0,"button",3),o.Qb(),o.Fc(4,En,3,3,"button",4),o.Sb(),o.Tb(5,"table",5),o.Tb(6,"thead"),o.Tb(7,"tr"),o.Ob(8,"th",6),o.Tb(9,"th",7),o.Hc(10,"Project"),o.Sb(),o.Tb(11,"th",8),o.Hc(12,"Owner"),o.Sb(),o.Tb(13,"th",9),o.Hc(14,"Published"),o.Sb(),o.Tb(15,"th",9),o.Hc(16,"Template"),o.Sb(),o.Tb(17,"th",10),o.Hc(18,"Last Updated"),o.Sb(),o.Ob(19,"th"),o.Sb(),o.Sb(),o.Tb(20,"tbody"),o.Fc(21,Ln,21,16,"tr",11),o.fc(22,"async"),o.Sb(),o.Sb(),o.Fc(23,zn,3,0,"no-results-message",12),o.fc(24,"async"),o.Ob(25,"datatable-footer"),o.Sb()),2&e&&(o.Bb(3),o.kc("ngIf",t.currentUser.hasPermission("projects.create")),o.Bb(1),o.kc("ngIf",t.currentUser.hasPermission("projects.delete")),o.Bb(17),o.kc("ngForOf",o.gc(22,4,t.projects$)),o.Bb(2),o.kc("ngIf",o.gc(24,6,t.datatable.paginator.noResults$)))},directives:[bn,i.t,hn,vn,vt.a,i.s,yn,u.b,I.a,Tn,Rn,u.a,c.g,P.a,Cn.a],pipes:[i.b,lt.a,wn.a],styles:[""],encapsulation:2}),e})();var Un=n("bTMO"),qn=n("0Ej5");let Gn=(()=>{class e{constructor(e,t,n,i,a,s,o,r,c){this.settings=e,this.toast=t,this.http=n,this.modal=i,this.route=a,this.customHomepage=s,this.valueLists=o,this.cd=r,this.state=c,this.loading$=new ht.a(!1),this.errors$=new ht.a({})}ngOnDestroy(){this.state.reset()}setJson(e,t){this.state.client[e]=JSON.stringify(t)}getJson(e){const t=this.state.client[e];return t?JSON.parse(t):[]}saveSettings(e){this.loading$.next(!0);const t=e||this.state.getModified();this.settings.save(t).pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Settings saved."),this.clearErrors(),this.state.updateInitial(t)},e=>{this.errors$.next(e.errors),function(e,t=""){let n=Object.keys(e)[0];if(n){t&&(n=`${t}-${n}`);const e=document.getElementById(n);e&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}}(this.errors$.value)})}clearErrors(){this.errors$.next({})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(at.a),o.Nb(mt.b),o.Nb(r.a),o.Nb(Lt.a),o.Nb(c.a),o.Nb(Un.a),o.Nb(qn.a),o.Nb(o.h),o.Nb(d))},e.\u0275dir=o.Ib({type:e}),e})();var Yn=n("eIep"),Xn=n("JIr8");const Qn=["auto"],Jn=["inputEl"],Kn=["selectModeTemplate"];function Wn(e,t){if(1&e){const e=o.Ub();o.Tb(0,"mat-chip",8),o.ac("removed",(function(){o.vc(e);const n=t.index;return o.ec().remove(n)})),o.Hc(1),o.Ob(2,"mat-icon",9),o.Sb()}if(2&e){const e=t.$implicit,n=o.ec();o.kc("selectable",!1)("removable",!n.selectMode),o.Bb(1),o.Jc(" ",n.displayChipValue(e)," ")}}const Zn=function(e){return{elementRef:e}};function ei(e,t){if(1&e){const e=o.Ub();o.Tb(0,"input",10,11),o.ac("matChipInputTokenEnd",(function(t){return o.vc(e),o.ec().addFromChipInput(t.value)})),o.fc(2,"trans"),o.Sb()}if(2&e){const e=o.ec(),t=o.sc(1),n=o.sc(6);o.kc("placeholder",o.gc(2,7,e.placeholder))("type",e.type)("matChipInputFor",t)("matChipInputAddOnBlur",!0)("matAutocomplete",n)("matAutocompleteConnectedTo",o.oc(9,Zn,e.el))("formControl",e.formControl)}}function ti(e,t){if(1&e&&(o.Tb(0,"mat-option",12),o.Hc(1),o.Sb()),2&e){const e=t.$implicit,n=o.ec();o.kc("value",e),o.Bb(1),o.Ic(n.displayChipValue(e))}}function ni(e,t){if(1&e&&(o.Tb(0,"mat-option",12),o.Hc(1),o.Sb()),2&e){const e=t.$implicit,n=o.ec(2);o.kc("value",e),o.Bb(1),o.Ic(n.displayChipValue(e))}}function ii(e,t){1&e&&o.Fc(0,ni,2,2,"mat-option",6),2&e&&o.kc("ngForOf",t.suggestions)}let ai=(()=>{class e{constructor(e){this.el=e,this.type="text",this.emailsInput=!1,this.selectMode=!1,this.formControl=new a.i,this.items$=new ht.a([]),this.suggestedValues$=new ht.a([])}set suggestedValues(e){this.suggestedValues$.next(e)}ngOnInit(){this.suggestFn&&this.bindToSearchControl()}ngAfterViewInit(){this.emailsInput&&this.parseEmailsOnPaste()}remove(e){const t=[...this.items$.value];t.splice(e,1),this.items$.next(t),this.propagateChange(this.items$.value)}addFromChipInput(e,t=!0){!e||this.matAutocomplete.isOpen||this.selectMode||this.add(e,t)}addFromAutocomplete(e,t=!0){this.add(e,t)}add(e,t=!0){e="string"==typeof e?e.trim():e;const n=this.findValueIndex(e)>-1;e&&!n&&(this.items$.next([...this.items$.value,e]),t&&this.propagateChange(this.items$.value)),this.inputEl&&(this.inputEl.nativeElement.value=""),this.formControl.setValue(null),this.suggestedValues$.next([])}findValueIndex(e){return"string"==typeof e?this.items$.value.indexOf(e):this.items$.value.findIndex(t=>t.id===e.id)}writeValue(e=[]){if(e&&e.length)e.forEach(e=>this.add(e,!1));else if(this.items$.value.length)for(;0!==this.items$.value.length;)this.remove(0)}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}bindToSearchControl(){this.formControl.valueChanges.pipe(Object(Ht.a)(150),Object(Jt.a)(),Object(Yn.a)(e=>e?this.suggestFn(e):Object(U.a)([])),Object(Xn.a)(()=>Object(U.a)([]))).subscribe(e=>{const t=e.filter(e=>-1===this.findValueIndex(e));this.suggestedValues$.next(t)})}displayChipValue(e){return"object"==typeof e?e.name:e}parseEmailsOnPaste(){this.inputEl.nativeElement.addEventListener("paste",e=>{const t=(e.clipboardData||window.clipboardData).getData("text").match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);if(t){e.preventDefault();const n=window.getSelection();n.rangeCount&&(n.deleteFromDocument(),t.forEach(e=>this.add(e)))}})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.l))},e.\u0275cmp=o.Hb({type:e,selectors:[["chip-input"]],viewQuery:function(e,t){var n;1&e&&(o.Nc(Qn,!0),o.Nc(Jn,!0),o.Nc(Kn,!0)),2&e&&(o.rc(n=o.bc())&&(t.matAutocomplete=n.first),o.rc(n=o.bc())&&(t.inputEl=n.first),o.rc(n=o.bc())&&(t.selectModeTemplate=n.first))},hostVars:2,hostBindings:function(e,t){2&e&&o.Fb("select-mode",t.selectMode)},inputs:{placeholder:"placeholder",type:"type",emailsInput:"emailsInput",suggestFn:"suggestFn",selectMode:"selectMode",suggestedValues:"suggestedValues"},features:[o.Ab([{provide:a.s,useExisting:e,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(e,t){1&e&&(o.Tb(0,"mat-chip-list",0,1),o.Fc(2,Wn,3,3,"mat-chip",2),o.fc(3,"async"),o.Fc(4,ei,3,11,"input",3),o.Sb(),o.Tb(5,"mat-autocomplete",4,5),o.ac("optionSelected",(function(e){return t.addFromAutocomplete(e.option.value)})),o.Fc(7,ti,2,2,"mat-option",6),o.fc(8,"async"),o.Sb(),o.Fc(9,ii,1,1,"ng-template",null,7,o.Gc)),2&e&&(o.kc("selectable",!1),o.Bb(2),o.kc("ngForOf",o.gc(3,5,t.items$)),o.Bb(2),o.kc("ngIf",!t.selectMode),o.Bb(1),o.kc("autoActiveFirstOption",!0),o.Bb(2),o.kc("ngForOf",o.gc(8,7,t.suggestedValues$)))},directives:[p.c,i.s,i.t,b.a,p.a,P.a,p.d,p.b,b.c,a.d,a.u,a.j,S.l],pipes:[i.b,lt.a],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}),e})();var si=n("FBzJ");function oi(e,t){1&e&&(o.Tb(0,"a",35),o.Hc(1,"Learn More."),o.Sb())}function ri(e,t){1&e&&(o.Tb(0,"a",36),o.Hc(1,"Learn More."),o.Sb())}function ci(e,t){1&e&&o.Ob(0,"mat-progress-bar",37)}let li=(()=>{class e extends Gn{constructor(){super(...arguments),this.categories=[],this.defaultPublishCredentials={}}ngOnInit(){this.categories=this.settings.getJson("builder.template_categories",[]),this.defaultPublishCredentials=this.settings.getJson("publish.default_credentials",{})}saveSettings(){const e=this.state.getModified();e.client["builder.template_categories"]=JSON.stringify(this.categories),e.client["publish.default_credentials"]=JSON.stringify(this.defaultPublishCredentials),super.saveSettings(e)}}return e.\u0275fac=function(t){return di(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["builder-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],decls:74,vars:28,consts:[[1,"header"],["trans","",1,"title"],["trans","",1,"subtitle"],["ngNativeValidate","",1,"body","many-inputs",3,"submit"],["color","accent","animationDuration","0"],[3,"label"],[1,"tab-content","many-inputs"],[1,"setting-toggle-container"],["name","builder.enable_subdomains","id","builder.enable_subdomains","trans","",3,"ngModel","ngModelChange"],["trans",""],["class","hover-underline","href","https://support.vebto.com/help-center/articles/5/9/156/custom-domains#sub-domain","target","_blank","trans","",4,"ngIf"],["name","builder.enable_custom_domains","id","builder.enable_custom_domains","trans","",3,"ngModel","ngModelChange"],["class","hover-underline","href","https://support.vebto.com/help-center/articles/5/9/156/custom-domains#custom-domains","target","_blank","trans","",4,"ngIf"],[1,"input-container"],["for","builder.google_fonts_api_key","trans",""],["name","builder.google_fonts_api_key","id","builder.google_fonts_api_key","type","text",3,"ngModel","ngModelChange"],["for","template_categories","trans",""],["id","template_categories","name","template_categories","placeholder","+New Category...","trans-placeholder","",3,"ngModel","ngModelChange"],[1,"tab-content"],["name","publish.allow_credential_change","id","publish.allow_credential_change","trans","",3,"ngModel","ngModelChange"],[1,"error-group","many-inputs"],["for","host","trans",""],["type","text","name","host","id","host",3,"ngModel","ngModelChange"],["for","username","trans",""],["type","text","name","username","id","username",3,"ngModel","ngModelChange"],["for","password","trans",""],["type","password","name","password","id","password",3,"ngModel","ngModelChange"],["for","directory","trans",""],["type","text","name","directory","id","directory","placeholder","(Optional)","trans-placeholder","",3,"ngModel","ngModelChange"],["for","port","trans",""],["type","number","name","port","id","port",3,"ngModel","ngModelChange"],["color","accent","name","ssl",1,"custom-control",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,"overlay",3,"isVisible"],["href","https://support.vebto.com/help-center/articles/5/9/156/custom-domains#sub-domain","target","_blank","trans","",1,"hover-underline"],["href","https://support.vebto.com/help-center/articles/5/9/156/custom-domains#custom-domains","target","_blank","trans","",1,"hover-underline"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"Site Builder"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Configure the site builder and user dashboard settings."),o.Sb(),o.Sb(),o.Tb(5,"form",3),o.ac("submit",(function(){return t.saveSettings()})),o.Tb(6,"mat-tab-group",4),o.Tb(7,"mat-tab",5),o.fc(8,"trans"),o.Tb(9,"div",6),o.Tb(10,"div",7),o.Tb(11,"mat-slide-toggle",8),o.ac("ngModelChange",(function(e){return t.state.client["builder.enable_subdomains"]=e})),o.Hc(12,"Subdomains "),o.Sb(),o.Tb(13,"p"),o.Tb(14,"span",9),o.Hc(15,"Should user projects be accessible via subdomain on your site."),o.Sb(),o.Hc(16," "),o.Fc(17,oi,2,0,"a",10),o.Sb(),o.Sb(),o.Tb(18,"div",7),o.Tb(19,"mat-slide-toggle",11),o.ac("ngModelChange",(function(e){return t.state.client["builder.enable_custom_domains"]=e})),o.Hc(20,"Custom Domains "),o.Sb(),o.Tb(21,"p"),o.Tb(22,"span",9),o.Hc(23,"Should users be able to attach their own custom domains to their projects."),o.Sb(),o.Hc(24," "),o.Fc(25,ri,2,0,"a",12),o.Sb(),o.Sb(),o.Tb(26,"div",13),o.Tb(27,"label",14),o.Hc(28,"Google Fonts API Key"),o.Sb(),o.Tb(29,"input",15),o.ac("ngModelChange",(function(e){return t.state.client["builder.google_fonts_api_key"]=e})),o.Sb(),o.Sb(),o.Tb(30,"div",13),o.Tb(31,"label",16),o.Hc(32,"Template Categories"),o.Sb(),o.Tb(33,"chip-input",17),o.ac("ngModelChange",(function(e){return t.categories=e})),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Tb(34,"mat-tab",5),o.fc(35,"trans"),o.Tb(36,"div",18),o.Tb(37,"div",7),o.Tb(38,"mat-slide-toggle",19),o.ac("ngModelChange",(function(e){return t.state.client["publish.allow_credential_change"]=e})),o.Hc(39,"FTP Publish Credentials "),o.Sb(),o.Tb(40,"p",9),o.Hc(41,"Allow users to change FTP publish credentials."),o.Sb(),o.Sb(),o.Tb(42,"div",20),o.Tb(43,"h2",9),o.Hc(44,"Default FTP credentials for publish dialog"),o.Sb(),o.Tb(45,"div",13),o.Tb(46,"label",21),o.Hc(47,"Host"),o.Sb(),o.Tb(48,"input",22),o.ac("ngModelChange",(function(e){return t.defaultPublishCredentials.host=e})),o.Sb(),o.Sb(),o.Tb(49,"div",13),o.Tb(50,"label",23),o.Hc(51,"Username"),o.Sb(),o.Tb(52,"input",24),o.ac("ngModelChange",(function(e){return t.defaultPublishCredentials.username=e})),o.Sb(),o.Sb(),o.Tb(53,"div",13),o.Tb(54,"label",25),o.Hc(55,"Password"),o.Sb(),o.Tb(56,"input",26),o.ac("ngModelChange",(function(e){return t.defaultPublishCredentials.password=e})),o.Sb(),o.Sb(),o.Tb(57,"div",13),o.Tb(58,"label",27),o.Hc(59,"Directory"),o.Sb(),o.Tb(60,"input",28),o.ac("ngModelChange",(function(e){return t.defaultPublishCredentials.directory=e})),o.Sb(),o.Sb(),o.Tb(61,"div",13),o.Tb(62,"label",29),o.Hc(63,"Port"),o.Sb(),o.Tb(64,"input",30),o.ac("ngModelChange",(function(e){return t.defaultPublishCredentials.port=e})),o.Sb(),o.Sb(),o.Tb(65,"mat-slide-toggle",31),o.ac("ngModelChange",(function(e){return t.defaultPublishCredentials.ssl=e})),o.Hc(66,"SSL"),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Tb(67,"button",32),o.fc(68,"async"),o.Hc(69,"Update "),o.Sb(),o.Fc(70,ci,1,0,"mat-progress-bar",33),o.fc(71,"async"),o.Sb(),o.Ob(72,"loading-indicator",34),o.fc(73,"async")),2&e&&(o.Bb(7),o.kc("label",o.gc(8,18,"General")),o.Bb(4),o.kc("ngModel",t.state.client["builder.enable_subdomains"]),o.Bb(6),o.kc("ngIf",!t.settings.get("common.site.hide_docs_button")),o.Bb(2),o.kc("ngModel",t.state.client["builder.enable_custom_domains"]),o.Bb(6),o.kc("ngIf",!t.settings.get("common.site.hide_docs_button")),o.Bb(4),o.kc("ngModel",t.state.client["builder.google_fonts_api_key"]),o.Bb(4),o.kc("ngModel",t.categories),o.Bb(1),o.kc("label",o.gc(35,20,"Publishing")),o.Bb(4),o.kc("ngModel",t.state.client["publish.allow_credential_change"]),o.Bb(10),o.kc("ngModel",t.defaultPublishCredentials.host),o.Bb(4),o.kc("ngModel",t.defaultPublishCredentials.username),o.Bb(4),o.kc("ngModel",t.defaultPublishCredentials.password),o.Bb(4),o.kc("ngModel",t.defaultPublishCredentials.directory),o.Bb(4),o.kc("ngModel",t.defaultPublishCredentials.port),o.Bb(1),o.kc("ngModel",t.defaultPublishCredentials.ssl),o.Bb(2),o.kc("disabled",o.gc(68,22,t.loading$)),o.Bb(3),o.kc("ngIf",o.gc(71,24,t.loading$)),o.Bb(2),o.kc("isVisible",o.gc(73,26,t.loading$)))},directives:[vt.a,a.v,a.w,B.c,B.a,w.a,a.u,a.x,i.t,a.d,ai,a.A,u.b,si.a,s.a],pipes:[lt.a,i.b],styles:["[_nghost-%COMP%]{display:block}.tab-content[_ngcontent-%COMP%]{margin-top:20px}"]}),e})();const di=o.Vb(li),bi=[{path:"templates",component:Bn,data:{permissions:["templates.view"]}},{path:"projects",component:jn,data:{permissions:["projects.view"]}}],ui=[{path:"builder",component:li}];function hi(e,t){if(1&e&&(o.Tb(0,"a",19),o.Tb(1,"div",5),o.Hc(2),o.Sb(),o.Sb()),2&e){const e=t.$implicit;o.kc("routerLink",e.path),o.Bb(2),o.Ic(e.path.replace("-"," "))}}function pi(e,t){1&e&&(o.Tb(0,"a",20),o.Tb(1,"div",5),o.Hc(2,"Billing"),o.Sb(),o.Sb())}const gi=function(){return{panel:"menus"}},mi=function(){return{panel:"seo-settings"}},fi=function(){return{panel:"themes"}};function vi(e,t){if(1&e&&(o.Tb(0,"a",4),o.Tb(1,"div",5),o.Hc(2,"General"),o.Sb(),o.Sb(),o.Fc(3,hi,3,2,"a",6),o.Fc(4,pi,3,0,"a",7),o.Tb(5,"a",8),o.Tb(6,"div",5),o.Hc(7,"Localization"),o.Sb(),o.Sb(),o.Tb(8,"a",9),o.Tb(9,"div",5),o.Hc(10,"Authentication"),o.Sb(),o.Sb(),o.Tb(11,"a",10),o.Tb(12,"div",5),o.Hc(13,"Uploading"),o.Sb(),o.Sb(),o.Tb(14,"a",11),o.Tb(15,"div",5),o.Hc(16,"Mail"),o.Sb(),o.Sb(),o.Tb(17,"a",12),o.Tb(18,"div",5),o.Hc(19,"Cache"),o.Sb(),o.Sb(),o.Tb(20,"a",13),o.Tb(21,"div",5),o.Hc(22,"Analytics"),o.Sb(),o.Sb(),o.Tb(23,"a",14),o.Tb(24,"div",5),o.Hc(25,"Logging"),o.Sb(),o.Sb(),o.Tb(26,"a",15),o.Tb(27,"div",5),o.Hc(28,"Queue"),o.Sb(),o.Sb(),o.Tb(29,"a",16),o.Tb(30,"div",5),o.Hc(31,"Recaptcha"),o.Sb(),o.Sb(),o.Tb(32,"a",17),o.Tb(33,"div",5),o.Hc(34,"GDPR"),o.Sb(),o.Sb(),o.Tb(35,"a",18),o.Tb(36,"div",5),o.Hc(37,"Menus"),o.Sb(),o.Sb(),o.Tb(38,"a",18),o.Tb(39,"div",5),o.Hc(40,"Seo"),o.Sb(),o.Sb(),o.Tb(41,"a",18),o.Tb(42,"div",5),o.Hc(43,"Themes"),o.Sb(),o.Sb()),2&e){const e=o.ec();o.Bb(3),o.kc("ngForOf",e.appRoutes()),o.Bb(1),o.kc("ngIf",e.settings.get("billing.integrated")),o.Bb(31),o.kc("queryParams",o.nc(5,gi)),o.Bb(3),o.kc("queryParams",o.nc(6,mi)),o.Bb(3),o.kc("queryParams",o.nc(7,fi))}}function _i(e,t){1&e&&o.Pb(0)}function Si(e,t){if(1&e&&(o.Rb(0),o.Tb(1,"button",21),o.Tb(2,"span",5),o.Hc(3),o.fc(4,"async"),o.Sb(),o.Ob(5,"mat-icon",22),o.Sb(),o.Tb(6,"mat-menu",23,24),o.Fc(8,_i,1,0,"ng-container",25),o.Sb(),o.Qb()),2&e){const e=o.sc(7),t=o.ec(),n=o.sc(1);o.Bb(1),o.kc("matMenuTriggerFor",e),o.Bb(2),o.Ic(o.gc(4,3,t.activePanel$)),o.Bb(5),o.kc("ngTemplateOutlet",n)}}function yi(e,t){1&e&&o.Pb(0)}function ki(e,t){if(1&e&&(o.Tb(0,"aside",26),o.Fc(1,yi,1,0,"ng-container",25),o.Sb()),2&e){o.ec();const e=o.sc(1);o.Bb(1),o.kc("ngTemplateOutlet",e)}}let Ti=(()=>{class e{constructor(e,t,n,i,a){this.settings=e,this.route=t,this.router=n,this.state=i,this.breakpoints=a,this.activePanel$=new ht.a(this.route.firstChild.routeConfig.path)}ngOnInit(){this.route.data.subscribe(e=>{this.state.setAll(e.settings)}),this.router.events.pipe(Object(X.a)(e=>e instanceof c.b)).subscribe(()=>{this.activePanel$.next(this.route.firstChild.routeConfig.path)})}appRoutes(){return ui}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(at.a),o.Nb(c.a),o.Nb(c.d),o.Nb(d),o.Nb(ot.a))},e.\u0275cmp=o.Hb({type:e,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(e,t){if(1&e&&(o.Fc(0,vi,44,8,"ng-template",null,0,o.Gc),o.Fc(2,Si,9,5,"ng-container",1),o.fc(3,"async"),o.Fc(4,ki,2,1,"ng-template",null,2,o.Gc),o.Tb(6,"div",3),o.Ob(7,"router-outlet"),o.Sb()),2&e){const e=o.sc(5);o.Bb(2),o.kc("ngIf",o.gc(3,2,t.breakpoints.isMobile$))("ngIfElse",e)}},directives:[i.t,c.i,c.g,C.a,c.f,vt.a,i.s,C.c,P.a,C.d,i.A],pipes:[i.b],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}),e})();const Ci=function(e,t){return{baseUrl:e,currentUrl:t}};function wi(e,t){if(1&e&&(o.Tb(0,"p",30),o.Tb(1,"span",31),o.Hc(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.Sb(),o.Hc(3," "),o.Tb(4,"a",32),o.Hc(5,"More Information."),o.Sb(),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.kc("transValues",o.pc(1,Ci,e.state.server.app_url,e.state.server.newAppUrl))}}function xi(e,t){if(1&e&&(o.Tb(0,"option",33),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("value",e.name),o.Bb(1),o.Ic(e.name)}}function Ii(e,t){if(1&e&&(o.Tb(0,"option",33),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("value",e.model_id),o.Bb(1),o.Ic(e.label)}}function Oi(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",4),o.Tb(1,"label",34),o.Hc(2),o.Sb(),o.Tb(3,"select",35),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.client["homepage.value"]=t})),o.Fc(4,Ii,2,2,"option",14),o.Sb(),o.Sb()}if(2&e){const e=o.ec().$implicit,t=o.ec();o.Bb(1),o.kc("for",e.name),o.Bb(1),o.Ic(e.name),o.Bb(1),o.kc("id",e.name)("name",e.name)("ngModel",t.state.client["homepage.value"]),o.Bb(1),o.kc("ngForOf",e.items)}}function Mi(e,t){if(1&e&&(o.Rb(0),o.Fc(1,Oi,5,6,"div",17),o.Qb()),2&e){const e=t.$implicit,n=o.ec();o.Bb(1),o.kc("ngIf",n.state.client["homepage.type"]===e.name)}}function Di(e,t){if(1&e&&(o.Tb(0,"option",39),o.Hc(1),o.Sb()),2&e){const e=t.$implicit,n=o.ec(2);o.kc("ngValue",e.name),o.Bb(1),o.Ic(n.getDisplayName(e))}}function Bi(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",4),o.Tb(1,"label",36),o.Hc(2,"Application Page"),o.Sb(),o.Tb(3,"select",37),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["homepage.value"]=t})),o.Fc(4,Di,2,2,"option",38),o.Sb(),o.Sb()}if(2&e){const e=o.ec();o.Bb(3),o.kc("ngModel",e.state.client["homepage.value"]),o.Bb(1),o.kc("ngForOf",e.getHomepageComponents())}}function Hi(e,t){1&e&&o.Ob(0,"mat-progress-bar",40)}let Pi=(()=>{class e extends Gn{constructor(){super(...arguments),this.menuItemCategories$=new ht.a([]),this.cssThemes=[]}ngOnInit(){this.valueLists.get(["menuItemCategories","themes"]).subscribe(e=>{this.menuItemCategories$.next(e.menuItemCategories),this.cssThemes=e.themes})}getHomepageComponents(){return this.customHomepage.getComponents()}getDisplayName(e){var t;return(null===(t=e.routeConfig)||void 0===t?void 0:t.data)&&e.routeConfig.data.name||e.name.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}urlsDontMatch(){return this.state.server.newAppUrl&&this.state.server.newAppUrl!==this.state.server.app_url}createSitemap(){return this.loading$.next(!0),this.http.post("sitemap/generate").pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Sitemap generated.")})}}return e.\u0275fac=function(t){return Fi(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["homepage-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],decls:57,vars:25,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,"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","trans",""],[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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"General"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Configure general site settings."),o.Sb(),o.Sb(),o.Tb(5,"form",3),o.ac("ngSubmit",(function(){return t.saveSettings()})),o.Tb(6,"div",4),o.Tb(7,"label",5),o.Hc(8,"Site Url"),o.Sb(),o.Tb(9,"input",6),o.ac("ngModelChange",(function(e){return t.state.server.app_url=e})),o.Sb(),o.Fc(10,wi,6,4,"p",7),o.Sb(),o.Tb(11,"div",8),o.Tb(12,"div",9),o.Tb(13,"div",4),o.Tb(14,"label",10),o.Hc(15,"Site Homepage"),o.Sb(),o.Tb(16,"select",11),o.ac("ngModelChange",(function(e){return t.state.client["homepage.type"]=e})),o.Tb(17,"option",12),o.Hc(18,"Default"),o.Sb(),o.Tb(19,"option",13),o.Hc(20,"Application Page"),o.Sb(),o.Fc(21,xi,2,2,"option",14),o.fc(22,"async"),o.Sb(),o.Tb(23,"p",15),o.Hc(24,"Type of the homepage."),o.Sb(),o.Sb(),o.Fc(25,Mi,2,1,"ng-container",16),o.fc(26,"async"),o.Fc(27,Bi,5,2,"div",17),o.Sb(),o.Sb(),o.Tb(28,"div",4),o.Tb(29,"label",18),o.Hc(30,"Default Site Theme"),o.Sb(),o.Tb(31,"select",19),o.ac("ngModelChange",(function(e){return t.state.client["themes.default_mode"]=e})),o.Tb(32,"option",20),o.Hc(33,"Light"),o.Sb(),o.Tb(34,"option",21),o.Hc(35,"Dark"),o.Sb(),o.Sb(),o.Sb(),o.Tb(36,"div",22),o.Tb(37,"mat-slide-toggle",23),o.ac("ngModelChange",(function(e){return t.state.client["themes.user_change"]=e})),o.Hc(38,"Allow Theme Change"),o.Sb(),o.Tb(39,"p",15),o.Hc(40,"Allow user to switch from dark to light mode and vice versa."),o.Sb(),o.Sb(),o.Ob(41,"div",24),o.Tb(42,"button",25),o.ac("click",(function(){return t.createSitemap()})),o.fc(43,"async"),o.Hc(44,"Generate Sitemap"),o.Sb(),o.Tb(45,"p",26),o.Tb(46,"span",15),o.Hc(47,"Once generated, sitemap index url will be"),o.Sb(),o.Hc(48,": "),o.Tb(49,"a",27),o.Hc(50),o.Sb(),o.Sb(),o.Ob(51,"div",24),o.Tb(52,"button",28),o.fc(53,"async"),o.Hc(54,"Update"),o.Sb(),o.Fc(55,Hi,1,0,"mat-progress-bar",29),o.fc(56,"async"),o.Sb()),2&e&&(o.Bb(6),o.Fb("has-error",t.urlsDontMatch()),o.Bb(3),o.kc("ngModel",t.state.server.app_url),o.Bb(1),o.kc("ngIf",t.urlsDontMatch()),o.Bb(6),o.kc("ngModel",t.state.client["homepage.type"]),o.Bb(5),o.kc("ngForOf",o.gc(22,15,t.menuItemCategories$)),o.Bb(4),o.kc("ngForOf",o.gc(26,17,t.menuItemCategories$)),o.Bb(2),o.kc("ngIf","component"===t.state.client["homepage.type"]),o.Bb(4),o.kc("ngModel",t.state.client["themes.default_mode"]),o.Bb(6),o.kc("ngModel",t.state.client["themes.user_change"]),o.Bb(5),o.kc("disabled",o.gc(43,19,t.loading$)),o.Bb(7),o.kc("href",t.settings.getBaseUrl()+"storage/sitemaps/sitemap-index.xml",o.xc),o.Bb(1),o.Jc("",t.settings.getBaseUrl(),"storage/sitemaps/sitemap-index.xml"),o.Bb(2),o.kc("disabled",o.gc(53,21,t.loading$)),o.Bb(3),o.kc("ngIf",o.gc(56,23,t.loading$)))},directives:[vt.a,a.v,a.w,a.d,a.F,a.u,a.x,i.t,a.G,a.z,a.J,i.s,w.a,u.b,s.a],pipes:[i.b],styles:[".sitemap-description[_ngcontent-%COMP%]{color:var(--be-secondary-text)}"],changeDetection:0}),e})();const Fi=o.Vb(Pi);function Ai(e,t){1&e&&(o.Rb(0),o.Tb(1,"span",7),o.Hc(2,"Outgoing mail method needs to be setup before enabling this setting."),o.Sb(),o.Hc(3," "),o.Tb(4,"a",23),o.Hc(5,"Fix now."),o.Sb(),o.Qb())}function Ri(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",26),o.Tb(2,"label",27),o.Hc(3,"Envato ID"),o.Sb(),o.Tb(4,"input",28),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(3).state.server.envato_id=t})),o.Sb(),o.Sb(),o.Tb(5,"div",26),o.Tb(6,"label",29),o.Hc(7,"Envato Secret"),o.Sb(),o.Tb(8,"input",30),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(3).state.server.envato_secret=t})),o.Sb(),o.Sb(),o.Tb(9,"div",26),o.Tb(10,"label",31),o.Hc(11,"Envato Personal Token"),o.Sb(),o.Tb(12,"input",32),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(3).state.server.envato_personal_token=t})),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec(3);o.Bb(4),o.kc("ngModel",e.state.server.envato_id),o.Bb(4),o.kc("ngModel",e.state.server.envato_secret),o.Bb(4),o.kc("ngModel",e.state.server.envato_personal_token)}}function Ni(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",24),o.Tb(2,"mat-slide-toggle",25),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.client["social.envato.enable"]=t})),o.Hc(3,"Envato Login"),o.Sb(),o.Tb(4,"p",7),o.Hc(5,"Enable logging into the site via envato."),o.Sb(),o.Sb(),o.Fc(6,Ri,13,3,"ng-container",8),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(2),o.kc("ngModel",e.state.client["social.envato.enable"]),o.Bb(4),o.kc("ngIf",e.state.client["social.envato.enable"])}}function Ei(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",26),o.Tb(2,"label",33),o.Hc(3,"Google Client ID"),o.Sb(),o.Tb(4,"input",34),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.google_id=t})),o.Sb(),o.Sb(),o.Tb(5,"div",26),o.Tb(6,"label",35),o.Hc(7,"Google Client Secret"),o.Sb(),o.Tb(8,"input",36),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.google_secret=t})),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(4),o.kc("ngModel",e.state.server.google_id),o.Bb(4),o.kc("ngModel",e.state.server.google_secret)}}function Vi(e,t){if(1&e&&o.Ob(0,"p",37),2&e){const e=o.ec().ngIf;o.kc("innerHTML",e.google_group,o.wc)}}function $i(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",26),o.Tb(2,"label",38),o.Hc(3,"Facebook App ID"),o.Sb(),o.Tb(4,"input",39),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.facebook_id=t})),o.Sb(),o.Sb(),o.Tb(5,"div",26),o.Tb(6,"label",40),o.Hc(7,"Facebook App Secret"),o.Sb(),o.Tb(8,"input",41),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.facebook_secret=t})),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(4),o.kc("ngModel",e.state.server.facebook_id),o.Bb(4),o.kc("ngModel",e.state.server.facebook_secret)}}function Li(e,t){if(1&e&&o.Ob(0,"p",37),2&e){const e=o.ec().ngIf;o.kc("innerHTML",e.facebook_group,o.wc)}}function zi(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",26),o.Tb(2,"label",42),o.Hc(3,"Twitter ID"),o.Sb(),o.Tb(4,"input",43),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.twitter_id=t})),o.Sb(),o.Sb(),o.Tb(5,"div",26),o.Tb(6,"label",44),o.Hc(7,"Twitter Secret"),o.Sb(),o.Tb(8,"input",45),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.twitter_secret=t})),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(4),o.kc("ngModel",e.state.server.twitter_id),o.Bb(4),o.kc("ngModel",e.state.server.twitter_secret)}}function ji(e,t){if(1&e&&o.Ob(0,"p",37),2&e){const e=o.ec().ngIf;o.kc("innerHTML",e.twitter_group,o.wc)}}function Ui(e,t){1&e&&o.Ob(0,"mat-progress-bar",46)}function qi(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",4),o.ac("ngSubmit",(function(){return o.vc(e),o.ec().saveSettings()})),o.Tb(1,"div",5),o.Tb(2,"mat-slide-toggle",6),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client.require_email_confirmation=t})),o.Hc(3,"Require Email Confirmation"),o.Sb(),o.Tb(4,"p"),o.Tb(5,"span",7),o.Hc(6,"Require new users to validate their email address before being able to login."),o.Sb(),o.Ob(7,"br"),o.Fc(8,Ai,6,0,"ng-container",8),o.Sb(),o.Sb(),o.Tb(9,"div",5),o.Tb(10,"mat-slide-toggle",9),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["registration.disable"]=t})),o.Hc(11,"Disable Registration"),o.Sb(),o.Tb(12,"p",7),o.Hc(13,"All registration (including social login) will be disabled."),o.Sb(),o.Sb(),o.Tb(14,"div",5),o.Tb(15,"mat-slide-toggle",10),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client.single_device_login=t})),o.Hc(16,"Single Device Login"),o.Sb(),o.Tb(17,"p",7),o.Hc(18,"Only allow one device to be logged into user account at the same time."),o.Sb(),o.Sb(),o.Fc(19,Ni,7,2,"ng-container",8),o.Tb(20,"div",11),o.Tb(21,"div",12),o.Tb(22,"mat-slide-toggle",13),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["social.google.enable"]=t})),o.Hc(23,"Google Login"),o.Sb(),o.Tb(24,"p",7),o.Hc(25,"Enable logging into the site via google."),o.Sb(),o.Sb(),o.Fc(26,Ei,9,2,"ng-container",8),o.Fc(27,Vi,1,1,"p",14),o.Sb(),o.Tb(28,"div",15),o.Tb(29,"div",16),o.Tb(30,"mat-slide-toggle",17),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["social.facebook.enable"]=t})),o.Hc(31,"Facebook Login"),o.Sb(),o.Tb(32,"p",7),o.Hc(33,"Enable logging into the site via facebook."),o.Sb(),o.Sb(),o.Fc(34,$i,9,2,"ng-container",8),o.Fc(35,Li,1,1,"p",14),o.Sb(),o.Tb(36,"div",18),o.Tb(37,"div",19),o.Tb(38,"mat-slide-toggle",20),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["social.twitter.enable"]=t})),o.Hc(39,"Twitter Login"),o.Sb(),o.Tb(40,"p",7),o.Hc(41,"Enable logging into the site via twitter."),o.Sb(),o.Sb(),o.Fc(42,zi,9,2,"ng-container",8),o.Fc(43,ji,1,1,"p",14),o.Sb(),o.Tb(44,"button",21),o.fc(45,"async"),o.Hc(46,"Update"),o.Sb(),o.Fc(47,Ui,1,0,"mat-progress-bar",22),o.fc(48,"async"),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.Bb(2),o.kc("disabled",!n.state.client.require_email_confirmation&&!n.state.server.mail_setup)("ngModel",n.state.client.require_email_confirmation),o.Bb(6),o.kc("ngIf",!n.state.server.mail_setup),o.Bb(2),o.kc("ngModel",n.state.client["registration.disable"]),o.Bb(5),o.kc("ngModel",n.state.client.single_device_login),o.Bb(4),o.kc("ngIf",n.settings.get("envato.enable")),o.Bb(1),o.Fb("has-error",e.google_group),o.Bb(2),o.kc("ngModel",n.state.client["social.google.enable"]),o.Bb(4),o.kc("ngIf",n.state.client["social.google.enable"]),o.Bb(1),o.kc("ngIf",e.google_group),o.Bb(1),o.Fb("has-error",e.facebook_group),o.Bb(2),o.kc("ngModel",n.state.client["social.facebook.enable"]),o.Bb(4),o.kc("ngIf",n.state.client["social.facebook.enable"]),o.Bb(1),o.kc("ngIf",e.facebook_group),o.Bb(1),o.Fb("has-error",e.twitter_group),o.Bb(2),o.kc("ngModel",n.state.client["social.twitter.enable"]),o.Bb(4),o.kc("ngIf",n.state.client["social.twitter.enable"]),o.Bb(1),o.kc("ngIf",e.twitter_group),o.Bb(1),o.kc("disabled",o.gc(45,23,n.loading$)),o.Bb(3),o.kc("ngIf",o.gc(48,25,n.loading$))}}let Gi=(()=>{class e extends Gn{}return e.\u0275fac=function(t){return Yi(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["authentication-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"Authentication"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Configure registration, social login and related 3rd party integrations."),o.Sb(),o.Sb(),o.Fc(5,qi,49,27,"form",3),o.fc(6,"async")),2&e&&(o.Bb(5),o.kc("ngIf",o.gc(6,1,t.errors$)))},directives:[vt.a,i.t,a.v,a.w,w.a,a.u,a.x,u.b,c.g,a.d,s.a],pipes:[i.b],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}),e})();const Yi=o.Vb(Gi);function Xi(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",6),o.Tb(2,"label",21),o.Hc(3,"Memcached Host"),o.Sb(),o.Tb(4,"input",22),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.memcached_host=t})),o.Sb(),o.Sb(),o.Tb(5,"div",6),o.Tb(6,"label",23),o.Hc(7,"Memcached Port"),o.Sb(),o.Tb(8,"input",24),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.memcached_port=t})),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(4),o.kc("ngModel",e.state.server.memcached_host),o.Bb(4),o.kc("ngModel",e.state.server.memcached_port)}}function Qi(e,t){if(1&e&&o.Ob(0,"p",25),2&e){const e=o.ec().ngIf;o.kc("innerHTML",e.cache_group,o.wc)}}function Ji(e,t){1&e&&o.Ob(0,"mat-progress-bar",26)}function Ki(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",4),o.ac("submit",(function(){return o.vc(e),o.ec().saveSettings()})),o.Tb(1,"div",5),o.Tb(2,"div",6),o.Tb(3,"label",7),o.Hc(4,"Cache Method"),o.Sb(),o.Tb(5,"select",8),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.server.cache_driver=t}))("ngModelChange",(function(){return o.vc(e),o.ec().clearErrors()})),o.Tb(6,"option",9),o.Hc(7,"File (Default)"),o.Sb(),o.Tb(8,"option",10),o.Hc(9,"None"),o.Sb(),o.Tb(10,"option",11),o.Hc(11,"APC"),o.Sb(),o.Tb(12,"option",12),o.Hc(13,"Memcached"),o.Sb(),o.Tb(14,"option",13),o.Hc(15,"Redis"),o.Sb(),o.Sb(),o.Tb(16,"p",14),o.Hc(17,"Which method should be used for storing and retrieving cached items."),o.Sb(),o.Sb(),o.Fc(18,Xi,9,2,"ng-container",15),o.Fc(19,Qi,1,1,"p",16),o.Sb(),o.Tb(20,"button",17),o.ac("click",(function(){return o.vc(e),o.ec().clearCache()})),o.Hc(21,"Clear Cache"),o.Sb(),o.Tb(22,"div",18),o.Tb(23,"div",1),o.Hc(24,"Important!"),o.Sb(),o.Tb(25,"p",14),o.Hc(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.Sb(),o.Sb(),o.Tb(27,"button",19),o.fc(28,"async"),o.Hc(29,"Update"),o.Sb(),o.Fc(30,Ji,1,0,"mat-progress-bar",20),o.fc(31,"async"),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.Bb(1),o.Fb("has-error",e.cache_group),o.Bb(4),o.kc("ngModel",n.state.server.cache_driver),o.Bb(13),o.kc("ngIf","memcached"===n.state.server.cache_driver),o.Bb(1),o.kc("ngIf",e.cache_group),o.Bb(8),o.kc("disabled",o.gc(28,7,n.loading$)),o.Bb(3),o.kc("ngIf",o.gc(31,9,n.loading$))}}let Wi=(()=>{class e extends Gn{clearCache(){this.loading$.next(!0),this.http.post("cache/flush").pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Cache cleared.")})}}return e.\u0275fac=function(t){return Zi(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["cache-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"Cache"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Configure cache time, method and related 3rd party integrations."),o.Sb(),o.Sb(),o.Fc(5,Ki,32,11,"form",3),o.fc(6,"async")),2&e&&(o.Bb(5),o.kc("ngIf",o.gc(6,1,t.errors$)))},directives:[vt.a,i.t,a.v,a.w,a.G,a.u,a.x,a.z,a.J,u.b,a.d,a.F,a.A,s.a],pipes:[i.b],encapsulation:2,changeDetection:0}),e})();const Zi=o.Vb(Wi);function ea(e,t){if(1&e&&(o.Tb(0,"p",19),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.certificate)}}function ta(e,t){if(1&e&&o.Ob(0,"p",20),2&e){const e=o.ec().ngIf;o.kc("innerHTML",e.analytics_group,o.wc)}}function na(e,t){1&e&&o.Ob(0,"mat-progress-bar",21)}function ia(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",4),o.ac("submit",(function(){return o.vc(e),o.ec().saveSettings()})),o.Tb(1,"div",5),o.Tb(2,"div",6),o.Tb(3,"label",7),o.Hc(4,"Google Service Account Key File (.json)"),o.Sb(),o.Tb(5,"input",8,9),o.ac("change",(function(){o.vc(e);const t=o.sc(6);return o.ec().setCertificateFile(t.files)})),o.Sb(),o.Fc(7,ea,2,1,"p",10),o.Sb(),o.Tb(8,"div",6),o.Tb(9,"label",11),o.Hc(10,"Google Analytics View ID"),o.Sb(),o.Tb(11,"input",12),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.server.analytics_view_id=t})),o.Sb(),o.Sb(),o.Tb(12,"div",6),o.Tb(13,"label",13),o.Hc(14,"Google Analytics Tracking Code"),o.Sb(),o.Tb(15,"input",14),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["analytics.tracking_code"]=t})),o.Sb(),o.Tb(16,"p",15),o.Hc(17,"Google analytics tracking code only, not the whole javascript code snippet."),o.Sb(),o.Sb(),o.Fc(18,ta,1,1,"p",16),o.Sb(),o.Tb(19,"button",17),o.fc(20,"async"),o.Hc(21,"Update"),o.Sb(),o.Fc(22,na,1,0,"mat-progress-bar",18),o.fc(23,"async"),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.Bb(1),o.Fb("has-error",e.analytics_group),o.Bb(1),o.Fb("has-error",e.certificate),o.Bb(5),o.kc("ngIf",e.certificate),o.Bb(4),o.kc("ngModel",n.state.server.analytics_view_id),o.Bb(4),o.kc("ngModel",n.state.client["analytics.tracking_code"]),o.Bb(3),o.kc("ngIf",e.analytics_group),o.Bb(1),o.kc("disabled",o.gc(20,10,n.loading$)),o.Bb(3),o.kc("ngIf",o.gc(23,12,n.loading$))}}let aa=(()=>{class e extends Gn{saveSettings(e){const t=this.getPayload(e||this.state.getModified());super.saveSettings(t)}getPayload(e){return this.certificateFile&&(e.files={certificate:this.certificateFile}),e}setCertificateFile(e){this.certificateFile=e.item(0)}}return e.\u0275fac=function(t){return sa(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["analytics-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"Analytics"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Configure google analytics integration and credentials."),o.Sb(),o.Sb(),o.Fc(5,ia,24,14,"form",3),o.fc(6,"async")),2&e&&(o.Bb(5),o.kc("ngIf",o.gc(6,1,t.errors$)))},directives:[vt.a,i.t,a.v,a.w,a.A,a.d,a.u,a.x,u.b,s.a],pipes:[i.b],encapsulation:2,changeDetection:0}),e})();const sa=o.Vb(aa);function oa(e,t){if(1&e&&(o.Tb(0,"option",22),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("value",e.value),o.Bb(1),o.Ic(e.text)}}function ra(e,t){if(1&e&&(o.Tb(0,"optgroup",21),o.Fc(1,oa,2,2,"option",11),o.Sb()),2&e){const e=t.$implicit;o.kc("label",e.key),o.Bb(1),o.kc("ngForOf",e.value)}}function ca(e,t){if(1&e&&(o.Tb(0,"option",22),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("value",e.language),o.Bb(1),o.Ic(e.name)}}function la(e,t){if(1&e&&(o.Tb(0,"option",22),o.Hc(1),o.fc(2,"formattedDate"),o.Sb()),2&e){const e=t.$implicit,n=o.ec();o.kc("value",e),o.Bb(1),o.Kc("",o.hc(2,3,n.getCurrentDate(),e)," (",e,")")}}function da(e,t){1&e&&o.Ob(0,"mat-progress-bar",23)}let ba=(()=>{class e extends Gn{constructor(){super(...arguments),this.selects={timezones:{},localizations:[]},this.defaultDateFormats=["MMMM d, y","y-M-d","M/d/y","d/M/y"]}ngOnInit(){const e=this.state.client["dates.format"];this.initialDateFormat=this.defaultDateFormats.includes(e)?e:"custom",this.valueLists.get(["timezones","localizations"]).subscribe(e=>{this.selects=e,this.cd.markForCheck()})}getCurrentDate(){return new Date}updateDateFormat(e){e&&"custom"!==e&&(this.state.client["dates.format"]=e)}selectedDateFormat(){return this.state.client["dates.format"]}}return e.\u0275fac=function(t){return ua(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["localization-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"Localization"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Manage localization settings for the site."),o.Sb(),o.Sb(),o.Tb(5,"form",3),o.ac("submit",(function(){return t.saveSettings()})),o.Tb(6,"div",4),o.Tb(7,"label",5),o.Hc(8,"Timezone"),o.Sb(),o.Tb(9,"select",6),o.ac("ngModelChange",(function(e){return t.state.server.app_timezone=e})),o.Fc(10,ra,2,2,"optgroup",7),o.fc(11,"keyvalue"),o.Sb(),o.Tb(12,"p",8),o.Hc(13,"Choose either a city in the same timezone as you or a UTC timezone offset."),o.Sb(),o.Sb(),o.Tb(14,"div",4),o.Tb(15,"label",9),o.Hc(16,"Site Language"),o.Sb(),o.Tb(17,"select",10),o.ac("ngModelChange",(function(e){return t.state.server.app_locale=e})),o.Fc(18,ca,2,2,"option",11),o.Sb(),o.Tb(19,"p",8),o.Hc(20,"Which translation should be selected by default for new users."),o.Sb(),o.Sb(),o.Tb(21,"div",4),o.Tb(22,"label",12),o.Hc(23,"Date Format"),o.Sb(),o.Tb(24,"select",13),o.ac("ngModelChange",(function(e){return t.initialDateFormat=e}))("ngModelChange",(function(e){return t.updateDateFormat(e)})),o.Fc(25,la,3,6,"option",11),o.Tb(26,"option",14),o.Hc(27,"Custom"),o.Sb(),o.Sb(),o.Tb(28,"p"),o.Hc(29),o.fc(30,"trans"),o.Ob(31,"br"),o.Hc(32),o.fc(33,"trans"),o.Tb(34,"strong"),o.Hc(35),o.fc(36,"formattedDate"),o.Sb(),o.Sb(),o.Sb(),o.Tb(37,"div",4),o.Tb(38,"label",15),o.Hc(39,"Custom Date Format"),o.Sb(),o.Tb(40,"input",16),o.ac("ngModelChange",(function(e){return t.state.client["dates.format"]=e})),o.Sb(),o.Sb(),o.Tb(41,"div",17),o.Tb(42,"mat-slide-toggle",18),o.ac("ngModelChange",(function(e){return t.state.client["i18n.enable"]=e})),o.Hc(43,"Translations"),o.Sb(),o.Tb(44,"p",8),o.Hc(45,"Enable translations functionality for the site."),o.Sb(),o.Sb(),o.Tb(46,"button",19),o.fc(47,"async"),o.Hc(48,"Update"),o.Sb(),o.Fc(49,da,1,0,"mat-progress-bar",20),o.fc(50,"async"),o.Sb()),2&e&&(o.Bb(9),o.kc("ngModel",t.state.server.app_timezone),o.Bb(1),o.kc("ngForOf",o.gc(11,15,t.selects.timezones)),o.Bb(7),o.kc("ngModel",t.state.server.app_locale),o.Bb(1),o.kc("ngForOf",t.selects.localizations),o.Bb(6),o.kc("ngModel",t.initialDateFormat),o.Bb(1),o.kc("ngForOf",t.defaultDateFormats),o.Bb(4),o.Jc(" ",o.gc(30,17,"Default format for dates on the site.")," "),o.Bb(3),o.Jc(" ",o.gc(33,19,"Preview:")," "),o.Bb(3),o.Ic(o.hc(36,21,t.getCurrentDate(),t.selectedDateFormat())),o.Bb(2),o.Fb("hidden","custom"!==t.initialDateFormat),o.Bb(3),o.kc("ngModel",t.state.client["dates.format"]),o.Bb(2),o.kc("ngModel",t.state.client["i18n.enable"]),o.Bb(4),o.kc("disabled",o.gc(47,24,t.loading$)),o.Bb(3),o.kc("ngIf",o.gc(50,26,t.loading$)))},directives:[vt.a,a.K,a.v,a.w,a.G,a.u,a.x,i.s,a.F,a.z,a.J,a.d,w.a,u.b,i.t,s.a],pipes:[i.l,lt.a,wn.a,i.b],encapsulation:2,changeDetection:0}),e})();const ua=o.Vb(ba);function ha(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",5),o.Tb(1,"label",34),o.Hc(2,"API Secret Key"),o.Sb(),o.Tb(3,"input",35),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(3).state.client["mail.webhook_secret_key"]=t})),o.Sb(),o.Sb()}if(2&e){const e=o.ec(3);o.Bb(3),o.kc("ngModel",e.state.client["mail.webhook_secret_key"])}}function pa(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",5),o.Tb(2,"label",29),o.Hc(3,"Incoming Mail Method"),o.Sb(),o.Tb(4,"select",30),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.client["mail.handler"]=t})),o.Tb(5,"option",31),o.Hc(6,"Mailgun"),o.Sb(),o.Tb(7,"option",32),o.Hc(8,"API (Send emails via http API)"),o.Sb(),o.Tb(9,"option",33),o.Hc(10,"Pipe (Pipe emails directly)"),o.Sb(),o.Sb(),o.Tb(11,"p",8),o.Hc(12,"Which method should be used to handle incoming application emails."),o.Sb(),o.Sb(),o.Fc(13,ha,4,1,"div",25),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(4),o.kc("ngModel",e.state.client["mail.handler"]),o.Bb(9),o.kc("ngIf","null"===e.state.client["mail.handler"])}}function ga(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",5),o.Tb(2,"label",36),o.Hc(3,"SMTP Host"),o.Sb(),o.Tb(4,"input",37),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.mail_host=t})),o.Sb(),o.Sb(),o.Tb(5,"div",5),o.Tb(6,"label",38),o.Hc(7,"SMTP Username"),o.Sb(),o.Tb(8,"input",39),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.mail_username=t})),o.Sb(),o.Sb(),o.Tb(9,"div",5),o.Tb(10,"label",40),o.Hc(11,"SMTP Password"),o.Sb(),o.Tb(12,"input",41),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.mail_password=t})),o.Sb(),o.Sb(),o.Tb(13,"div",5),o.Tb(14,"label",42),o.Hc(15,"SMTP Port"),o.Sb(),o.Tb(16,"input",43),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.mail_port=t})),o.Sb(),o.Sb(),o.Tb(17,"div",5),o.Tb(18,"label",44),o.Hc(19,"SMTP Encryption"),o.Sb(),o.Tb(20,"input",45),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.mail_encryption=t})),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(4),o.kc("ngModel",e.state.server.mail_host),o.Bb(4),o.kc("ngModel",e.state.server.mail_username),o.Bb(4),o.kc("ngModel",e.state.server.mail_password),o.Bb(4),o.kc("ngModel",e.state.server.mail_port),o.Bb(4),o.kc("ngModel",e.state.server.mail_encryption)}}function ma(e,t){if(1&e&&(o.Tb(0,"div",51),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(e.mailgun_domain)}}function fa(e,t){if(1&e&&(o.Tb(0,"div",51),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(e.mailgun_secret)}}function va(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",5),o.Tb(2,"label",46),o.Hc(3,"Mailgun Domain"),o.Sb(),o.Tb(4,"input",47),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.mailgun_domain=t})),o.Sb(),o.Fc(5,ma,2,1,"div",48),o.Tb(6,"p",8),o.Hc(7,"Usually the domain of your site (site.com)"),o.Sb(),o.Sb(),o.Tb(8,"div",5),o.Tb(9,"label",49),o.Hc(10,"Mailgun API Key"),o.Sb(),o.Tb(11,"input",50),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.mailgun_secret=t})),o.Sb(),o.Fc(12,fa,2,1,"div",48),o.Tb(13,"p",8),o.Hc(14,'Should start with "key-"'),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec().ngIf,t=o.ec();o.Bb(1),o.Fb("has-error",e.mailgun_domain),o.Bb(3),o.kc("ngModel",t.state.server.mailgun_domain),o.Bb(1),o.kc("ngIf",e.mailgun_domain),o.Bb(3),o.Fb("has-error",e.mailgun_secret),o.Bb(3),o.kc("ngModel",t.state.server.mailgun_secret),o.Bb(1),o.kc("ngIf",e.mailgun_secret)}}function _a(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",5),o.Tb(2,"label",52),o.Hc(3,"SES Key"),o.Sb(),o.Tb(4,"input",53),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.ses_key=t})),o.Sb(),o.Sb(),o.Tb(5,"div",5),o.Tb(6,"label",54),o.Hc(7,"SES Secret"),o.Sb(),o.Tb(8,"input",55),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.ses_secret=t})),o.Sb(),o.Sb(),o.Tb(9,"div",5),o.Tb(10,"label",56),o.Hc(11,"SES Region"),o.Sb(),o.Tb(12,"input",57),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.ses_region=t})),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(4),o.kc("ngModel",e.state.server.ses_key),o.Bb(4),o.kc("ngModel",e.state.server.ses_secret),o.Bb(4),o.kc("ngModel",e.state.server.ses_region)}}function Sa(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",5),o.Tb(1,"label",58),o.Hc(2,"Sparkpost Secret"),o.Sb(),o.Tb(3,"input",59),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.sparkpost_secret=t})),o.Sb(),o.Sb()}if(2&e){const e=o.ec(2);o.Bb(3),o.kc("ngModel",e.state.server.sparkpost_secret)}}function ya(e,t){if(1&e&&o.Ob(0,"p",60),2&e){const e=o.ec().ngIf;o.kc("innerHTML",e.mail_group,o.wc)}}function ka(e,t){1&e&&o.Ob(0,"mat-progress-bar",61)}const Ta=function(e){return{url:e}};function Ca(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",4),o.ac("submit",(function(){return o.vc(e),o.ec().saveSettings()})),o.Tb(1,"div",5),o.Tb(2,"label",6),o.Hc(3,"From Address"),o.Sb(),o.Tb(4,"input",7),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.server.mail_from_address=t})),o.Sb(),o.Tb(5,"p",8),o.Hc(6,"All outgoing application emails will be sent from this email address."),o.Sb(),o.Sb(),o.Tb(7,"div",5),o.Tb(8,"label",9),o.Hc(9,"Contact Page Address"),o.Sb(),o.Tb(10,"input",10),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["mail.contact_page_address"]=t})),o.Sb(),o.Tb(11,"p",11),o.Hc(12,"Where emails from :url page should be sent to."),o.Sb(),o.Sb(),o.Tb(13,"div",5),o.Tb(14,"label",12),o.Hc(15,"From Name"),o.Sb(),o.Tb(16,"input",13),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.server.mail_from_name=t})),o.Sb(),o.Tb(17,"p",8),o.Hc(18,"All outgoing application emails will be sent using this name."),o.Sb(),o.Sb(),o.Tb(19,"div",14),o.Tb(20,"div",1),o.Hc(21,"Important!"),o.Sb(),o.Tb(22,"p",8),o.Hc(23,"Your selected mail method must be authorized to send emails using this address and name."),o.Sb(),o.Sb(),o.Fc(24,pa,14,2,"ng-container",15),o.Tb(25,"div",16),o.Tb(26,"div",5),o.Tb(27,"label",17),o.Hc(28,"Outgoing Mail Method"),o.Sb(),o.Tb(29,"select",18),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.server.mail_driver=t}))("ngModelChange",(function(){return o.vc(e),o.ec().clearErrors()})),o.Tb(30,"option",19),o.Hc(31,"Mailgun"),o.Sb(),o.Tb(32,"option",20),o.Hc(33,"SMTP"),o.Sb(),o.Tb(34,"option",21),o.Hc(35,"SparkPost"),o.Sb(),o.Tb(36,"option",22),o.Hc(37,"Ses (Amazon Simple Email Service)"),o.Sb(),o.Tb(38,"option",23),o.Hc(39,"SendMail"),o.Sb(),o.Tb(40,"option",24),o.Hc(41,"Log (Email will be saved to error log)"),o.Sb(),o.Sb(),o.Tb(42,"p",8),o.Hc(43,"Which method should be used for sending outgoing application emails."),o.Sb(),o.Sb(),o.Fc(44,ga,21,5,"ng-container",15),o.Fc(45,va,15,8,"ng-container",15),o.Fc(46,_a,13,3,"ng-container",15),o.Fc(47,Sa,4,1,"div",25),o.Fc(48,ya,1,1,"p",26),o.Sb(),o.Tb(49,"button",27),o.fc(50,"async"),o.Hc(51,"Update"),o.Sb(),o.Fc(52,ka,1,0,"mat-progress-bar",28),o.fc(53,"async"),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.Bb(4),o.kc("ngModel",n.state.server.mail_from_address),o.Bb(6),o.kc("ngModel",n.state.client["mail.contact_page_address"]),o.Bb(1),o.kc("transValues",o.oc(19,Ta,n.settings.getBaseUrl()+"contact")),o.Bb(5),o.kc("ngModel",n.state.server.mail_from_name),o.Bb(8),o.kc("ngIf",n.settings.get("vebto.admin.showIncomingMailMethod")),o.Bb(1),o.Fb("has-error",e.mail_group),o.Bb(4),o.kc("ngModel",n.state.server.mail_driver),o.Bb(15),o.kc("ngIf","smtp"===n.state.server.mail_driver),o.Bb(1),o.kc("ngIf","mailgun"===n.state.server.mail_driver),o.Bb(1),o.kc("ngIf","ses"===n.state.server.mail_driver),o.Bb(1),o.kc("ngIf","sparkpost"===n.state.server.mail_driver),o.Bb(1),o.kc("ngIf",e.mail_group),o.Bb(1),o.kc("disabled",o.gc(50,15,n.loading$)),o.Bb(3),o.kc("ngIf",o.gc(53,17,n.loading$))}}let wa=(()=>{class e extends Gn{}return e.\u0275fac=function(t){return xa(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["mail-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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","smtp"],["value","sparkpost"],["value","ses"],["value","sendmail"],["value","log"],["class","input-container",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"],["for","mail.handler","trans",""],["name","mail.handler","id","mail.handler",3,"ngModel","ngModelChange"],["value","mailgun","trans",""],["value","null","trans",""],["value","mime","trans",""],["for","webhook_secret_key"],["type","text","id","webhook_secret_key","name","webhook_secret_key","required","","minlength","30","maxlength","30",3,"ngModel","ngModelChange"],["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"],[1,"error","group-error",3,"innerHTML"],["mode","indeterminate","color","accent"]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"Mail"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Change incoming and outgoing email handlers, email credentials and more."),o.Sb(),o.Sb(),o.Fc(5,Ca,54,21,"form",3),o.fc(6,"async")),2&e&&(o.Bb(5),o.kc("ngIf",o.gc(6,1,t.errors$)))},directives:[vt.a,i.t,a.v,a.w,a.d,a.F,a.u,a.x,a.G,a.z,a.J,u.b,a.q,a.p,s.a],pipes:[i.b],encapsulation:2,changeDetection:0}),e})();const xa=o.Vb(wa);function Ia(e,t){if(1&e&&o.Ob(0,"p",14),2&e){const e=o.ec().ngIf;o.kc("innerHTML",e.logging_group,o.wc)}}function Oa(e,t){1&e&&o.Ob(0,"mat-progress-bar",15)}function Ma(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",4),o.ac("submit",(function(){return o.vc(e),o.ec().saveSettings()})),o.Tb(1,"div",5),o.Tb(2,"div",6),o.Tb(3,"label",7),o.Hc(4,"Sentry DSN"),o.Sb(),o.Tb(5,"input",8),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.server.sentry_dsn=t})),o.Sb(),o.Sb(),o.Fc(6,Ia,1,1,"p",9),o.Sb(),o.Tb(7,"div",10),o.Tb(8,"div",1),o.Hc(9,"Information"),o.Sb(),o.Tb(10,"p"),o.Tb(11,"a",11),o.Hc(12,"Sentry"),o.Sb(),o.Tb(13,"span"),o.Hc(14),o.fc(15,"trans"),o.Sb(),o.Sb(),o.Sb(),o.Tb(16,"button",12),o.fc(17,"async"),o.Hc(18,"Update"),o.Sb(),o.Fc(19,Oa,1,0,"mat-progress-bar",13),o.fc(20,"async"),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.Bb(1),o.Fb("has-error",e.logging_group),o.Bb(4),o.kc("ngModel",n.state.server.sentry_dsn),o.Bb(1),o.kc("ngIf",e.logging_group),o.Bb(8),o.Jc(" ",o.gc(15,7,"integration provides real-time error tracking and helps identify and fix issues when site is in production."),""),o.Bb(2),o.kc("disabled",o.gc(17,9,n.loading$)),o.Bb(3),o.kc("ngIf",o.gc(20,11,n.loading$))}}let Da=(()=>{class e extends Gn{}return e.\u0275fac=function(t){return Ba(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["logging-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"Logging"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Configure site error and access logging and related 3rd party integrations."),o.Sb(),o.Sb(),o.Fc(5,Ma,21,13,"form",3),o.fc(6,"async")),2&e&&(o.Bb(5),o.kc("ngIf",o.gc(6,1,t.errors$)))},directives:[vt.a,i.t,a.v,a.w,a.d,a.q,a.u,a.x,u.b,s.a],pipes:[i.b,lt.a],encapsulation:2,changeDetection:0}),e})();const Ba=o.Vb(Da);function Ha(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",9),o.Tb(2,"label",21),o.Hc(3,"SQS Queue Key"),o.Sb(),o.Tb(4,"input",22),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.sqs_queue_key=t})),o.Sb(),o.Sb(),o.Tb(5,"div",9),o.Tb(6,"label",23),o.Hc(7,"SQS Queue Secret"),o.Sb(),o.Tb(8,"input",24),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.sqs_queue_secret=t})),o.Sb(),o.Sb(),o.Tb(9,"div",9),o.Tb(10,"label",25),o.Hc(11,"SQS Queue Prefix"),o.Sb(),o.Tb(12,"input",26),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.sqs_queue_prefix=t})),o.Sb(),o.Sb(),o.Tb(13,"div",9),o.Tb(14,"label",27),o.Hc(15,"SQS Queue Name"),o.Sb(),o.Tb(16,"input",28),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.sqs_queue_name=t})),o.Sb(),o.Sb(),o.Tb(17,"div",9),o.Tb(18,"label",29),o.Hc(19,"SQS Queue Region"),o.Sb(),o.Tb(20,"input",30),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.sqs_queue_region=t})),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(4),o.kc("ngModel",e.state.server.sqs_queue_key),o.Bb(4),o.kc("ngModel",e.state.server.sqs_queue_secret),o.Bb(4),o.kc("ngModel",e.state.server.sqs_queue_prefix),o.Bb(4),o.kc("ngModel",e.state.server.sqs_queue_name),o.Bb(4),o.kc("ngModel",e.state.server.sqs_queue_region)}}function Pa(e,t){if(1&e&&o.Ob(0,"p",31),2&e){const e=o.ec().ngIf;o.kc("innerHTML",e.queue_group,o.wc)}}function Fa(e,t){1&e&&o.Ob(0,"mat-progress-bar",32)}function Aa(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",4),o.ac("submit",(function(){return o.vc(e),o.ec().saveSettings()})),o.Tb(1,"div",5),o.Tb(2,"div",1),o.Hc(3,"Information"),o.Sb(),o.Tb(4,"p",6),o.Hc(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.Sb(),o.Sb(),o.Tb(6,"div",7),o.Tb(7,"div",1),o.Hc(8,"Important"),o.Sb(),o.Tb(9,"p",6),o.Hc(10,"All methods except sync require additional setup, which should be performed before changing the queue method. Consult documentation for more information."),o.Sb(),o.Sb(),o.Tb(11,"div",8),o.Tb(12,"div",9),o.Tb(13,"label",10),o.Hc(14,"Queue Method"),o.Sb(),o.Tb(15,"select",11),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.server.queue_driver=t}))("ngModelChange",(function(){return o.vc(e),o.ec().clearErrors()})),o.Tb(16,"option",12),o.Hc(17,"Sync (Default)"),o.Sb(),o.Tb(18,"option",13),o.Hc(19,"Beanstalkd"),o.Sb(),o.Tb(20,"option",14),o.Hc(21,"Database"),o.Sb(),o.Tb(22,"option",15),o.Hc(23,"SQS (Amazon simple queue service)"),o.Sb(),o.Tb(24,"option",16),o.Hc(25,"Redis"),o.Sb(),o.Sb(),o.Sb(),o.Fc(26,Ha,21,5,"ng-container",17),o.Fc(27,Pa,1,1,"p",18),o.Sb(),o.Tb(28,"button",19),o.fc(29,"async"),o.Hc(30,"Update"),o.Sb(),o.Fc(31,Fa,1,0,"mat-progress-bar",20),o.fc(32,"async"),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.Bb(11),o.Fb("has-error",e.queue_group),o.Bb(4),o.kc("ngModel",n.state.server.queue_driver),o.Bb(11),o.kc("ngIf","sqs"===n.state.server.queue_driver),o.Bb(1),o.kc("ngIf",e.queue_group),o.Bb(1),o.kc("disabled",o.gc(29,7,n.loading$)),o.Bb(3),o.kc("ngIf",o.gc(32,9,n.loading$))}}let Ra=(()=>{class e extends Gn{saveSettings(){const e=this.state.getModified();e.client["realtime.pusher_key"]&&(e.server.pusher_key=e.client["realtime.pusher_key"]),super.saveSettings(e)}}return e.\u0275fac=function(t){return Na(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["queue-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"Queue"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Select active queue method and enter related 3rd party API keys."),o.Sb(),o.Sb(),o.Fc(5,Aa,33,11,"form",3),o.fc(6,"async")),2&e&&(o.Bb(5),o.kc("ngIf",o.gc(6,1,t.errors$)))},directives:[vt.a,i.t,a.v,a.w,a.G,a.u,a.x,a.z,a.J,u.b,a.d,a.F,s.a],pipes:[i.b],encapsulation:2,changeDetection:0}),e})();const Na=o.Vb(Ra);function Ea(e,t){if(1&e&&o.Ob(0,"p",34),2&e){const e=o.ec(3).ngIf;o.kc("innerHTML",e.paypal_group,o.wc)}}function Va(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",25),o.Tb(1,"div",12),o.Tb(2,"label",26),o.Hc(3,"Paypal Client ID"),o.Sb(),o.Tb(4,"input",27),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(3).state.server.paypal_client_id=t})),o.Sb(),o.Sb(),o.Tb(5,"div",12),o.Tb(6,"label",28),o.Hc(7,"Paypal Secret"),o.Sb(),o.Tb(8,"input",29),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(3).state.server.paypal_secret=t})),o.Sb(),o.Sb(),o.Tb(9,"div",12),o.Tb(10,"label",30),o.Hc(11,"Paypal Webhook ID"),o.Sb(),o.Tb(12,"input",31),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(3).state.server.paypal_webhook_id=t})),o.Sb(),o.Sb(),o.Tb(13,"div",8),o.Tb(14,"mat-slide-toggle",32),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(3).state.client["billing.paypal_test_mode"]=t})),o.Hc(15,"Paypal Test Mode"),o.Sb(),o.Tb(16,"p",10),o.Hc(17,"Allows testing PayPal payments with sandbox accounts."),o.Sb(),o.Sb(),o.Fc(18,Ea,1,1,"p",33),o.Sb()}if(2&e){const e=o.ec(2).ngIf,t=o.ec();o.Fb("has-error",e.paypal_group),o.Bb(4),o.kc("ngModel",t.state.server.paypal_client_id),o.Bb(4),o.kc("ngModel",t.state.server.paypal_secret),o.Bb(4),o.kc("ngModel",t.state.server.paypal_webhook_id),o.Bb(2),o.kc("ngModel",t.state.client["billing.paypal_test_mode"]),o.Bb(4),o.kc("ngIf",e.paypal_group)}}function $a(e,t){if(1&e&&(o.Tb(0,"div",41),o.Hc(1),o.Sb()),2&e){const e=o.ec(3).ngIf;o.Bb(1),o.Ic(e.stripe_secret)}}function La(e,t){if(1&e&&o.Ob(0,"p",34),2&e){const e=o.ec(3).ngIf;o.kc("innerHTML",e.stripe_group,o.wc)}}function za(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",35),o.Tb(1,"div",12),o.Tb(2,"label",36),o.Hc(3,"Stripe Client ID"),o.Sb(),o.Tb(4,"input",37),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(3).state.server.stripe_key=t})),o.Sb(),o.Sb(),o.Tb(5,"div",12),o.Tb(6,"label",38),o.Hc(7,"Stripe Secret"),o.Sb(),o.Tb(8,"input",39),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(3).state.server.stripe_secret=t})),o.Sb(),o.Fc(9,$a,2,1,"div",40),o.Sb(),o.Fc(10,La,1,1,"p",33),o.Sb()}if(2&e){const e=o.ec(2).ngIf,t=o.ec();o.Fb("has-error",e.stripe_group),o.Bb(4),o.kc("ngModel",t.state.server.stripe_key),o.Bb(1),o.Fb("has-error",e.stripe_secret),o.Bb(3),o.kc("ngModel",t.state.server.stripe_secret),o.Bb(1),o.kc("ngIf",e.stripe_secret),o.Bb(1),o.kc("ngIf",e.stripe_group)}}function ja(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",8),o.Tb(2,"mat-slide-toggle",19),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.client["billing.paypal.enable"]=t})),o.Hc(3,"Paypal Gateway"),o.Sb(),o.Tb(4,"p",10),o.Hc(5,"Enable PayPal payment gateway."),o.Sb(),o.Sb(),o.Fc(6,Va,19,7,"div",20),o.Tb(7,"div",8),o.Tb(8,"mat-slide-toggle",21),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.client["billing.stripe.enable"]=t})),o.Hc(9,"Stripe Gateway"),o.Sb(),o.Tb(10,"p",10),o.Hc(11,"Enable Stripe payment gateway."),o.Sb(),o.Sb(),o.Fc(12,za,11,8,"div",22),o.Tb(13,"div",12),o.Tb(14,"label",23),o.Hc(15,"Accepted Cards"),o.Sb(),o.Tb(16,"chip-input",24),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).acceptedCards=t})),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec(2);o.Bb(2),o.kc("ngModel",e.state.client["billing.paypal.enable"]),o.Bb(4),o.kc("ngIf",e.state.client["billing.paypal.enable"]),o.Bb(2),o.kc("ngModel",e.state.client["billing.stripe.enable"]),o.Bb(4),o.kc("ngIf",e.state.client["billing.stripe.enable"]),o.Bb(4),o.kc("ngModel",e.acceptedCards)}}function Ua(e,t){1&e&&o.Ob(0,"mat-progress-bar",42)}function qa(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",4),o.ac("submit",(function(){return o.vc(e),o.ec().saveSettings()})),o.Tb(1,"mat-tab-group",5),o.Tb(2,"mat-tab",6),o.fc(3,"trans"),o.Tb(4,"div",7),o.Tb(5,"div",8),o.Tb(6,"mat-slide-toggle",9),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["billing.enable"]=t})),o.Hc(7,"Enable Billing"),o.Sb(),o.Tb(8,"p",10),o.Hc(9,"Enable or disable all billing functionality across the site."),o.Sb(),o.Sb(),o.Fc(10,ja,17,5,"ng-container",11),o.Sb(),o.Sb(),o.Tb(11,"mat-tab",6),o.fc(12,"trans"),o.Tb(13,"div",7),o.Tb(14,"div",12),o.Tb(15,"label",13),o.Hc(16,"Invoice Address"),o.Sb(),o.Tb(17,"textarea",14),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["billing.invoice.address"]=t})),o.Sb(),o.Tb(18,"p",10),o.Hc(19,'Address to show under "from" section of user invoice. Supports HTML. Optional.'),o.Sb(),o.Sb(),o.Tb(20,"div",12),o.Tb(21,"label",15),o.Hc(22,"Invoice Note"),o.Sb(),o.Tb(23,"textarea",16),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["billing.invoice.notes"]=t})),o.Sb(),o.Tb(24,"p",10),o.Hc(25,'Default notes to show under "notes" section of user invoice. Optional.'),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Tb(26,"button",17),o.fc(27,"async"),o.Hc(28,"Update"),o.Sb(),o.Fc(29,Ua,1,0,"mat-progress-bar",18),o.fc(30,"async"),o.Sb()}if(2&e){const e=o.ec();o.Bb(2),o.kc("label",o.gc(3,8,"General")),o.Bb(4),o.kc("ngModel",e.state.client["billing.enable"]),o.Bb(4),o.kc("ngIf",e.state.client["billing.enable"]),o.Bb(1),o.kc("label",o.gc(12,10,"Invoices")),o.Bb(6),o.kc("ngModel",e.state.client["billing.invoice.address"]),o.Bb(6),o.kc("ngModel",e.state.client["billing.invoice.notes"]),o.Bb(3),o.kc("disabled",o.gc(27,12,e.loading$)),o.Bb(3),o.kc("ngIf",o.gc(30,14,e.loading$))}}let Ga=(()=>{class e extends Gn{constructor(){super(...arguments),this.acceptedCards=[]}ngOnInit(){this.acceptedCards=this.settings.getJson("billing.accepted_cards",[])}saveSettings(){const e=this.state.getModified();e.client["billing.accepted_cards"]=JSON.stringify(this.acceptedCards),super.saveSettings(e)}}return e.\u0275fac=function(t){return Ya(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["billing-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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"],["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"],["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"],["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"],["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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"Billing"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Configure billing and subscription settings."),o.Sb(),o.Sb(),o.Fc(5,qa,31,16,"form",3),o.fc(6,"async")),2&e&&(o.Bb(5),o.kc("ngIf",o.gc(6,1,t.errors$)))},directives:[vt.a,i.t,a.v,a.w,B.c,B.a,w.a,a.u,a.x,a.d,u.b,ai,a.F,s.a],pipes:[i.b,lt.a],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}),e})();const Ya=o.Vb(Ga);var Xa=n("oJgS"),Qa=n("6wUX"),Ja=n("PCqb"),Ka=n("4Ait");function Wa(e,t){if(1&e&&(o.Tb(0,"label",5),o.Hc(1),o.Sb()),2&e){const e=o.ec();o.mc("for","space-input-",e.id,""),o.Bb(1),o.Ic(e.label)}}function Za(e,t){if(1&e&&(o.Tb(0,"option",6),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("ngValue",e),o.Bb(1),o.Ic(e)}}const es=[[["",8,"description"]],[["",8,"error"]]],ts=[".description",".error"];let ns=(()=>{class e{constructor(){this.inputContainer=!0,this.id=Object(Xa.a)(),this.spaceUnits=Qa.a,this.form=new a.l({unit:new a.i("MB"),amount:new a.i(null)})}ngOnInit(){this.form.valueChanges.pipe(Object(Pt.a)(e=>Object(Ja.a)(e.amount,e.unit))).subscribe(e=>this.propagateChange(e))}writeValue(e){this.form.setValue(this.fromBytes(e),{emitEvent:!1})}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}fromBytes(e){const t=Object(Ka.a)(e);return t?{amount:t.split(" ")[0],unit:t.split(" ")[1]}:{amount:null,unit:"MB"}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["space-input"]],hostVars:2,hostBindings:function(e,t){2&e&&o.Fb("input-container",t.inputContainer)},inputs:{label:"label",name:"name"},features:[o.Ab([{provide:a.s,useExisting:e,multi:!0}])],ngContentSelectors:ts,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(e,t){1&e&&(o.jc(es),o.Fc(0,Wa,2,2,"label",0),o.Tb(1,"div",1),o.Ob(2,"input",2),o.Tb(3,"select",3),o.Fc(4,Za,2,2,"option",4),o.Sb(),o.Sb(),o.ic(5),o.ic(6,1)),2&e&&(o.kc("ngIf",t.label),o.Bb(2),o.mc("id","space-input-",t.id,""),o.kc("formControl",t.form.get("amount")),o.Bb(1),o.kc("formControl",t.form.get("unit")),o.Bb(1),o.kc("ngForOf",t.spaceUnits))},directives:[i.t,a.A,a.d,vt.a,a.u,a.j,a.G,i.s,a.z,a.J],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}),e})(),is=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(d))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"label",1),o.Hc(2,"FTP Hostname"),o.Sb(),o.Tb(3,"input",2),o.ac("ngModelChange",(function(e){return t.state.server.storage_ftp_host=e})),o.Sb(),o.Sb(),o.Tb(4,"div",0),o.Tb(5,"label",3),o.Hc(6,"FTP Username"),o.Sb(),o.Tb(7,"input",4),o.ac("ngModelChange",(function(e){return t.state.server.storage_ftp_username=e})),o.Sb(),o.Sb(),o.Tb(8,"div",0),o.Tb(9,"label",5),o.Hc(10,"FTP Password"),o.Sb(),o.Tb(11,"input",6),o.ac("ngModelChange",(function(e){return t.state.server.storage_ftp_password=e})),o.Sb(),o.Sb(),o.Tb(12,"div",0),o.Tb(13,"label",7),o.Hc(14,"FTP Directory"),o.Sb(),o.Tb(15,"input",8),o.ac("ngModelChange",(function(e){return t.state.server.storage_ftp_root=e})),o.Sb(),o.Sb(),o.Tb(16,"div",0),o.Tb(17,"label",9),o.Hc(18,"FTP Port"),o.Sb(),o.Tb(19,"input",10),o.ac("ngModelChange",(function(e){return t.state.server.storage_ftp_port=e})),o.Sb(),o.Sb(),o.Tb(20,"div",11),o.Tb(21,"mat-slide-toggle",12),o.ac("ngModelChange",(function(e){return t.state.server.storage_ftp_passive=e})),o.Hc(22,"Passive"),o.Sb(),o.Sb(),o.Tb(23,"div",11),o.Tb(24,"mat-slide-toggle",13),o.ac("ngModelChange",(function(e){return t.state.server.storage_ftp_ssl=e})),o.Hc(25,"SSL"),o.Sb(),o.Sb()),2&e&&(o.Bb(3),o.kc("ngModel",t.state.server.storage_ftp_host),o.Bb(4),o.kc("ngModel",t.state.server.storage_ftp_username),o.Bb(4),o.kc("ngModel",t.state.server.storage_ftp_password),o.Bb(4),o.kc("ngModel",t.state.server.storage_ftp_root),o.Bb(4),o.kc("ngModel",t.state.server.storage_ftp_port),o.Bb(2),o.kc("ngModel",t.state.server.storage_ftp_passive),o.Bb(3),o.kc("ngModel",t.state.server.storage_ftp_ssl))},directives:[vt.a,a.d,a.F,a.u,a.x,a.A,w.a],encapsulation:2,changeDetection:0}),e})(),as=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(d))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"label",1),o.Hc(2,"Access Token"),o.Sb(),o.Tb(3,"input",2),o.ac("ngModelChange",(function(e){return t.state.server.storage_dropbox_access_token=e})),o.Sb(),o.Sb(),o.Tb(4,"div",0),o.Tb(5,"label",3),o.Hc(6,"Root Directory"),o.Sb(),o.Tb(7,"input",4),o.ac("ngModelChange",(function(e){return t.state.server.storage_dropbox_root=e})),o.Sb(),o.Sb()),2&e&&(o.Bb(3),o.kc("ngModel",t.state.server.storage_dropbox_access_token),o.Bb(4),o.kc("ngModel",t.state.server.storage_dropbox_root))},directives:[vt.a,a.d,a.F,a.u,a.x],encapsulation:2,changeDetection:0}),e})(),ss=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(d))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"label",1),o.Hc(2,"Rackspace Username"),o.Sb(),o.Tb(3,"input",2),o.ac("ngModelChange",(function(e){return t.state.server.storage_rackspace_username=e})),o.Sb(),o.Sb(),o.Tb(4,"div",0),o.Tb(5,"label",3),o.Hc(6,"Rackspace Key"),o.Sb(),o.Tb(7,"input",4),o.ac("ngModelChange",(function(e){return t.state.server.storage_rackspace_key=e})),o.Sb(),o.Sb(),o.Tb(8,"div",0),o.Tb(9,"label",5),o.Hc(10,"Rackspace Region"),o.Sb(),o.Tb(11,"input",6),o.ac("ngModelChange",(function(e){return t.state.server.storage_rackspace_region=e})),o.Sb(),o.Sb(),o.Tb(12,"div",0),o.Tb(13,"label",7),o.Hc(14,"Rackspace Container"),o.Sb(),o.Tb(15,"input",8),o.ac("ngModelChange",(function(e){return t.state.server.storage_rackspace_container=e})),o.Sb(),o.Sb()),2&e&&(o.Bb(3),o.kc("ngModel",t.state.server.storage_rackspace_username),o.Bb(4),o.kc("ngModel",t.state.server.storage_rackspace_key),o.Bb(4),o.kc("ngModel",t.state.server.storage_rackspace_region),o.Bb(4),o.kc("ngModel",t.state.server.storage_rackspace_container))},directives:[vt.a,a.d,a.F,a.u,a.x],encapsulation:2,changeDetection:0}),e})(),os=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(d))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"label",1),o.Hc(2,"Amazon S3 Key"),o.Sb(),o.Tb(3,"input",2),o.ac("ngModelChange",(function(e){return t.state.server.storage_s3_key=e})),o.Sb(),o.Sb(),o.Tb(4,"div",0),o.Tb(5,"label",3),o.Hc(6,"Amazon S3 Secret"),o.Sb(),o.Tb(7,"input",4),o.ac("ngModelChange",(function(e){return t.state.server.storage_s3_secret=e})),o.Sb(),o.Sb(),o.Tb(8,"div",0),o.Tb(9,"label",5),o.Hc(10,"Amazon S3 Region"),o.Sb(),o.Tb(11,"input",6),o.ac("ngModelChange",(function(e){return t.state.server.storage_s3_region=e})),o.Sb(),o.Sb(),o.Tb(12,"div",0),o.Tb(13,"label",7),o.Hc(14,"Amazon S3 Bucket"),o.Sb(),o.Tb(15,"input",8),o.ac("ngModelChange",(function(e){return t.state.server.storage_s3_bucket=e})),o.Sb(),o.Sb(),o.Tb(16,"div",0),o.Tb(17,"label",9),o.Hc(18,"Amazon S3 Endpoint"),o.Sb(),o.Tb(19,"input",10),o.ac("ngModelChange",(function(e){return t.state.server.storage_s3_endpoint=e})),o.fc(20,"trans"),o.Sb(),o.Tb(21,"p",11),o.Hc(22,"Only change endpoint if you are using another S3 compatible storage service."),o.Sb(),o.Sb()),2&e&&(o.Bb(3),o.kc("ngModel",t.state.server.storage_s3_key),o.Bb(4),o.kc("ngModel",t.state.server.storage_s3_secret),o.Bb(4),o.kc("ngModel",t.state.server.storage_s3_region),o.Bb(4),o.kc("ngModel",t.state.server.storage_s3_bucket),o.Bb(4),o.kc("placeholder",o.gc(20,6,"Optional"))("ngModel",t.state.server.storage_s3_endpoint))},directives:[vt.a,a.d,a.F,a.u,a.x,a.B],pipes:[lt.a],encapsulation:2,changeDetection:0}),e})(),rs=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(d))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"label",1),o.Hc(2,"DigitalOcean Key"),o.Sb(),o.Tb(3,"input",2),o.ac("ngModelChange",(function(e){return t.state.server.storage_digitalocean_key=e})),o.Sb(),o.Sb(),o.Tb(4,"div",0),o.Tb(5,"label",3),o.Hc(6,"DigitalOcean Secret"),o.Sb(),o.Tb(7,"input",4),o.ac("ngModelChange",(function(e){return t.state.server.storage_digitalocean_secret=e})),o.Sb(),o.Sb(),o.Tb(8,"div",0),o.Tb(9,"label",5),o.Hc(10,"DigitalOcean Region"),o.Sb(),o.Tb(11,"input",6),o.ac("ngModelChange",(function(e){return t.state.server.storage_digitalocean_region=e})),o.Sb(),o.Sb(),o.Tb(12,"div",0),o.Tb(13,"label",7),o.Hc(14,"DigitalOcean Bucket"),o.Sb(),o.Tb(15,"input",8),o.ac("ngModelChange",(function(e){return t.state.server.storage_digitalocean_bucket=e})),o.Sb(),o.Sb()),2&e&&(o.Bb(3),o.kc("ngModel",t.state.server.storage_digitalocean_key),o.Bb(4),o.kc("ngModel",t.state.server.storage_digitalocean_secret),o.Bb(4),o.kc("ngModel",t.state.server.storage_digitalocean_region),o.Bb(4),o.kc("ngModel",t.state.server.storage_digitalocean_bucket))},directives:[vt.a,a.d,a.F,a.u,a.x,a.B,a.p],encapsulation:2,changeDetection:0}),e})(),cs=(()=>{class e{constructor(e){this.state=e}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(d))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"label",1),o.Hc(2,"Backblaze KeyID"),o.Sb(),o.Tb(3,"input",2),o.ac("ngModelChange",(function(e){return t.state.server.storage_backblaze_key_id=e})),o.Sb(),o.Sb(),o.Tb(4,"div",0),o.Tb(5,"label",3),o.Hc(6,"Backblaze applicationKey"),o.Sb(),o.Tb(7,"input",4),o.ac("ngModelChange",(function(e){return t.state.server.storage_backblaze_application_key=e})),o.Sb(),o.Sb(),o.Tb(8,"div",0),o.Tb(9,"label",5),o.Hc(10,"Backblaze Bucket Name"),o.Sb(),o.Tb(11,"input",6),o.ac("ngModelChange",(function(e){return t.state.server.storage_backblaze_bucket=e})),o.Sb(),o.Sb(),o.Tb(12,"div",0),o.Tb(13,"label",7),o.Hc(14,"Backblaze Region"),o.Sb(),o.Tb(15,"input",8),o.ac("ngModelChange",(function(e){return t.state.server.storage_backblaze_region=e})),o.Sb(),o.Sb()),2&e&&(o.Bb(3),o.kc("ngModel",t.state.server.storage_backblaze_key_id),o.Bb(4),o.kc("ngModel",t.state.server.storage_backblaze_application_key),o.Bb(4),o.kc("ngModel",t.state.server.storage_backblaze_bucket),o.Bb(4),o.kc("ngModel",t.state.server.storage_backblaze_region))},directives:[vt.a,a.d,a.F,a.u,a.x,a.B],encapsulation:2,changeDetection:0}),e})();function ls(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",16),o.Tb(1,"label",27),o.Hc(2,"User Uploads Storage Method"),o.Sb(),o.Tb(3,"select",28),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.uploads_disk_driver=t}))("ngModelChange",(function(){return o.vc(e),o.ec(2).clearErrors()})),o.Tb(4,"option",29),o.Hc(5,"Local Disk (Default)"),o.Sb(),o.Tb(6,"option",30),o.Hc(7,"Amazon S3"),o.Sb(),o.Tb(8,"option",31),o.Hc(9,"FTP"),o.Sb(),o.Tb(10,"option",32),o.Hc(11,"DigitalOcean"),o.Sb(),o.Tb(12,"option",33),o.Hc(13,"Backblaze"),o.Sb(),o.Tb(14,"option",34),o.Hc(15,"Dropbox"),o.Sb(),o.Tb(16,"option",35),o.Hc(17,"Rackspace"),o.Sb(),o.Sb(),o.Tb(18,"p",13),o.Hc(19),o.Sb(),o.Sb()}if(2&e){const e=o.ec(2);o.Bb(3),o.kc("ngModel",e.state.server.uploads_disk_driver),o.Bb(16),o.Ic(e.settings.get("vebto.translations.uploads_disk_driver_description"))}}function ds(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",16),o.Tb(1,"label",36),o.Hc(2,"Public Uploads Storage Method"),o.Sb(),o.Tb(3,"select",37),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.public_disk_driver=t}))("ngModelChange",(function(){return o.vc(e),o.ec(2).clearErrors()})),o.Tb(4,"option",29),o.Hc(5,"Local Disk (Default)"),o.Sb(),o.Tb(6,"option",30),o.Hc(7,"Amazon S3"),o.Sb(),o.Tb(8,"option",32),o.Hc(9,"DigitalOcean"),o.Sb(),o.Tb(10,"option",33),o.Hc(11,"Backblaze"),o.Sb(),o.Sb(),o.Tb(12,"p",13),o.Hc(13),o.Sb(),o.Sb()}if(2&e){const e=o.ec(2);o.Bb(3),o.kc("ngModel",e.state.server.public_disk_driver),o.Bb(10),o.Ic(e.settings.get("vebto.translations.public_disk_driver_description"))}}function bs(e,t){1&e&&o.Ob(0,"ftp-form",38)}function us(e,t){1&e&&o.Ob(0,"dropbox-form",38)}function hs(e,t){1&e&&o.Ob(0,"rackspace-form",38)}function ps(e,t){1&e&&o.Ob(0,"s3-form",38)}function gs(e,t){1&e&&o.Ob(0,"digitalocean-form",38)}function ms(e,t){1&e&&o.Ob(0,"backblaze-form",38)}function fs(e,t){if(1&e&&o.Ob(0,"p",39),2&e){const e=o.ec().ngIf;o.kc("innerHTML",e.storage_group,o.wc)}}function vs(e,t){if(1&e&&o.Ob(0,"p",39),2&e){const e=o.ec(2).ngIf;o.kc("innerHTML",e.static_delivery_group,o.wc)}}function _s(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",16),o.Tb(1,"label",40),o.Hc(2,"File Delivery Optimization"),o.Sb(),o.Tb(3,"select",41),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.server.static_file_delivery=t})),o.Tb(4,"option",42),o.Hc(5,"None"),o.Sb(),o.Tb(6,"option",43),o.Hc(7,"X-Sendfile (Apache)"),o.Sb(),o.Tb(8,"option",44),o.Hc(9,"X-Accel (Nginx)"),o.Sb(),o.Sb(),o.Tb(10,"p",13),o.Hc(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.Sb(),o.Fc(12,vs,1,1,"p",8),o.Sb()}if(2&e){const e=o.ec().ngIf,t=o.ec();o.Bb(3),o.kc("ngModel",t.state.server.static_file_delivery),o.Bb(1),o.kc("ngValue",null),o.Bb(8),o.kc("ngIf",e.static_delivery_group)}}function Ss(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",16),o.Tb(1,"label",17),o.Hc(2,"Chunk Size"),o.Sb(),o.Tb(3,"space-input",45),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.client["uploads.chunk_size"]=t})),o.Sb(),o.Tb(4,"p",13),o.Hc(5,"Size for each file chunk. Recommended size is 2MB-5MB. Must be lower then max upload file size on your server."),o.Sb(),o.Sb()}if(2&e){const e=o.ec(2);o.Bb(3),o.kc("ngModel",e.state.client["uploads.chunk_size"])}}function ys(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",11),o.Tb(1,"mat-slide-toggle",46),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.client["uploads.resume"]=t})),o.Hc(2,"Resumable Uploads"),o.Sb(),o.Tb(3,"p",13),o.Hc(4,"Allow users to resume partial or failed uploads."),o.Sb(),o.Sb()}if(2&e){const e=o.ec(2);o.Bb(1),o.kc("ngModel",e.state.client["uploads.resume"])}}function ks(e,t){1&e&&o.Ob(0,"mat-progress-bar",47)}function Ts(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",4),o.ac("ngSubmit",(function(){return o.vc(e),o.ec().saveSettings()})),o.Fc(1,ls,20,2,"div",5),o.Fc(2,ds,14,2,"div",5),o.Tb(3,"div",6),o.Fc(4,bs,1,0,"ftp-form",7),o.Fc(5,us,1,0,"dropbox-form",7),o.Fc(6,hs,1,0,"rackspace-form",7),o.Fc(7,ps,1,0,"s3-form",7),o.Fc(8,gs,1,0,"digitalocean-form",7),o.Fc(9,ms,1,0,"backblaze-form",7),o.Fc(10,fs,1,1,"p",8),o.Sb(),o.Tb(11,"div",9),o.Fc(12,_s,13,3,"div",5),o.Sb(),o.Tb(13,"div",10),o.Tb(14,"div",11),o.Tb(15,"mat-slide-toggle",12),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["uploads.chunk"]=t})),o.Hc(16,"Chunked Uploads"),o.Sb(),o.Tb(17,"p",13),o.Hc(18,"When enabled larger files will be uploaded in smaller chunks to improve upload reliability and avoid server max upload size limits."),o.Sb(),o.Sb(),o.Fc(19,Ss,6,1,"div",5),o.Tb(20,"div",14),o.Tb(21,"div",1),o.Hc(22,"Important"),o.Sb(),o.Tb(23,"p"),o.Hc(24),o.fc(25,"trans"),o.Tb(26,"strong"),o.Hc(27),o.fc(28,"async"),o.Sb(),o.Hc(29,"."),o.Sb(),o.Sb(),o.Fc(30,ys,5,1,"div",15),o.Sb(),o.Tb(31,"div",16),o.Tb(32,"label",17),o.Hc(33,"Maximum file size"),o.Sb(),o.Tb(34,"space-input",18),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["uploads.max_size"]=t})),o.Sb(),o.Tb(35,"p",13),o.Hc(36,"Maximum size for a single file user can upload."),o.Sb(),o.Sb(),o.Tb(37,"div",16),o.Tb(38,"label",19),o.Hc(39,"Available Space"),o.Sb(),o.Tb(40,"space-input",20),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["uploads.available_space"]=t})),o.Sb(),o.Tb(41,"p",13),o.Hc(42,"Disk space each user uploads are allowed to take up. This can be overridden per user."),o.Sb(),o.Sb(),o.Tb(43,"div",16),o.Tb(44,"label",21),o.Hc(45,"Allowed file types"),o.Sb(),o.Tb(46,"chip-input",22),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().allowedExtensions=t})),o.Sb(),o.Tb(47,"p",13),o.Hc(48,"List of allowed file types (jpg, mp3, pdf etc.). Leave empty to allow all file types."),o.Sb(),o.Sb(),o.Tb(49,"div",16),o.Tb(50,"label",23),o.Hc(51,"Blocked file types"),o.Sb(),o.Tb(52,"chip-input",24),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().blockedExtensions=t})),o.Sb(),o.Tb(53,"p",13),o.Hc(54,"Prevent uploading of these file types, even if they are allowed above."),o.Sb(),o.Sb(),o.Tb(55,"button",25),o.fc(56,"async"),o.Hc(57,"Update"),o.Sb(),o.Fc(58,ks,1,0,"mat-progress-bar",26),o.fc(59,"async"),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.Bb(1),o.kc("ngIf",n.state.server.uploads_disk_driver),o.Bb(1),o.kc("ngIf",n.state.server.public_disk_driver),o.Bb(1),o.Fb("hidden",n.allSelectedDriversAreLocal())("has-error",e.storage_group),o.Bb(1),o.kc("ngIf",n.driverSelected("ftp")),o.Bb(1),o.kc("ngIf",n.driverSelected("dropbox")),o.Bb(1),o.kc("ngIf",n.driverSelected("rackspace")),o.Bb(1),o.kc("ngIf",n.driverSelected("s3")),o.Bb(1),o.kc("ngIf",n.driverSelected("digitalocean")),o.Bb(1),o.kc("ngIf",n.driverSelected("backblaze")),o.Bb(1),o.kc("ngIf",e.storage_group),o.Bb(2),o.kc("ngIf",n.driverSelected("local")),o.Bb(3),o.kc("ngModel",n.state.client["uploads.chunk"]),o.Bb(4),o.kc("ngIf",n.state.client["uploads.chunk"]),o.Bb(5),o.Jc("",o.gc(25,25,"Maximum upload size on your server currently is set to")," "),o.Bb(3),o.Ic(o.gc(28,27,n.serverMaxUploadSize$)),o.Bb(3),o.kc("ngIf",n.state.client["uploads.chunk"]),o.Bb(4),o.kc("ngModel",n.state.client["uploads.max_size"]),o.Bb(6),o.kc("ngModel",n.state.client["uploads.available_space"]),o.Bb(6),o.kc("ngModel",n.allowedExtensions),o.Bb(6),o.kc("ngModel",n.blockedExtensions),o.Bb(3),o.kc("disabled",o.gc(56,29,n.loading$)),o.Bb(3),o.kc("ngIf",o.gc(59,31,n.loading$))}}let Cs=(()=>{class e extends Gn{constructor(){super(...arguments),this.allowedExtensions=[],this.blockedExtensions=[],this.serverMaxUploadSize$=new v.a}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",this.allowedExtensions),this.setJson("uploads.blocked_extensions",this.blockedExtensions),super.saveSettings()}driverSelected(e){return[this.state.server.uploads_disk_driver,this.state.server.public_disk_driver].includes(e)}allSelectedDriversAreLocal(){return[this.state.server.uploads_disk_driver,this.state.server.public_disk_driver].every(e=>!e||"local"===e)}getServerMaxUploadSize(){this.http.get("uploads/server-max-file-size").subscribe(e=>{this.serverMaxUploadSize$.next(e.maxSize)})}}return e.\u0275fac=function(t){return ws(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["uploading-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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"],["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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"User Uploads"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Configure size and type of files that users are able to upload. This will affect all uploads across the site."),o.Sb(),o.Sb(),o.Fc(5,Ts,60,33,"form",3),o.fc(6,"async")),2&e&&(o.Bb(5),o.kc("ngIf",o.gc(6,1,t.errors$)))},directives:[vt.a,i.t,a.v,a.w,w.a,a.u,a.x,ns,ai,u.b,a.G,a.z,a.J,is,as,ss,os,rs,cs,s.a],pipes:[i.b,lt.a],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}),e})();const ws=o.Vb(Cs);function xs(e){return[].concat.apply([],e)}function Is(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",16),o.Tb(1,"mat-slide-toggle",17),o.ac("ngModelChange",(function(n){o.vc(e);const i=t.$implicit;return o.ec(2).state.client[i.key]=n})),o.Hc(2),o.fc(3,"trans"),o.Sb(),o.Tb(4,"p"),o.Hc(5),o.fc(6,"trans"),o.Sb(),o.Sb()}if(2&e){const e=t.$implicit,n=o.ec(2);o.Bb(1),o.kc("name",e.key)("id",e.key)("ngModel",n.state.client[e.key]),o.Bb(1),o.Ic(o.gc(3,5,e.name)),o.Bb(3),o.Ic(o.gc(6,7,e.description))}}function Os(e,t){if(1&e&&(o.Tb(0,"p",18),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e["recaptcha.site_key"])}}function Ms(e,t){if(1&e&&(o.Tb(0,"p",18),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e["recaptcha.secret_key"])}}function Ds(e,t){if(1&e&&o.Ob(0,"p",19),2&e){const e=o.ec().ngIf;o.kc("innerHTML",e.recaptcha_group,o.wc)}}function Bs(e,t){1&e&&o.Ob(0,"mat-progress-bar",20)}function Hs(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",4),o.ac("submit",(function(){return o.vc(e),o.ec().saveSettings()})),o.Fc(1,Is,7,9,"div",5),o.Tb(2,"div",6),o.Tb(3,"div",7),o.Tb(4,"label",8),o.Hc(5,"Recaptcha V3 Site Key"),o.Sb(),o.Tb(6,"input",9),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["recaptcha.site_key"]=t})),o.Sb(),o.Fc(7,Os,2,1,"p",10),o.Sb(),o.Tb(8,"div",7),o.Tb(9,"label",11),o.Hc(10,"Recaptcha V3 Secret Key"),o.Sb(),o.Tb(11,"input",12),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["recaptcha.secret_key"]=t})),o.Sb(),o.Fc(12,Ms,2,1,"p",10),o.Sb(),o.Fc(13,Ds,1,1,"p",13),o.Sb(),o.Tb(14,"button",14),o.fc(15,"async"),o.Hc(16,"Update"),o.Sb(),o.Fc(17,Bs,1,0,"mat-progress-bar",15),o.fc(18,"async"),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.Bb(1),o.kc("ngForOf",n.actions),o.Bb(1),o.Fb("has-error",e.recaptcha_group),o.Bb(1),o.Fb("has-error",e["recaptcha.site_key"]),o.Bb(3),o.kc("ngModel",n.state.client["recaptcha.site_key"]),o.Bb(1),o.kc("ngIf",e["recaptcha.site_key"]),o.Bb(1),o.Fb("has-error",e["recaptcha.secret_key"]),o.Bb(3),o.kc("ngModel",n.state.client["recaptcha.secret_key"]),o.Bb(1),o.kc("ngIf",e["recaptcha.secret_key"]),o.Bb(1),o.kc("ngIf",e.recaptcha_group),o.Bb(1),o.kc("disabled",o.gc(15,14,n.loading$)),o.Bb(3),o.kc("ngIf",o.gc(18,16,n.loading$))}}let Ps=(()=>{class e extends Gn{constructor(e,t,n,i,a,s,o,r,c,l){super(e,t,n,i,a,s,o,r,c),this.settings=e,this.toast=t,this.http=n,this.modal=i,this.route=a,this.customHomepage=s,this.valueLists=o,this.cd=r,this.state=c,this.recaptchaActions=l,this.actions=xs(this.recaptchaActions).reverse()}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(at.a),o.Nb(mt.b),o.Nb(r.a),o.Nb(Lt.a),o.Nb(c.a),o.Nb(Un.a),o.Nb(qn.a),o.Nb(o.h),o.Nb(d),o.Nb(A))},e.\u0275cmp=o.Hb({type:e,selectors:[["recaptcha-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"Recaptcha"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Configure google recaptcha integration and credentials."),o.Sb(),o.Sb(),o.Fc(5,Hs,19,18,"form",3),o.fc(6,"async")),2&e&&(o.Bb(5),o.kc("ngIf",o.gc(6,1,t.errors$)))},directives:[vt.a,i.t,a.v,a.w,i.s,a.d,a.u,a.x,u.b,w.a,s.a],pipes:[i.b,lt.a],encapsulation:2,changeDetection:0}),e})();var Fs=n("W5HX"),As=n("VfAk"),Rs=n("mWN8"),Ns=n("4vkA"),Es=n("IuoX"),Vs=n("h586"),$s=n("QeDF"),Ls=n("Lm4C"),zs=n("8cGs"),js=n("oVOl"),Us=n("eNwd"),qs=n("7o/Q"),Gs=n("D0XW");n("zx2A");const Ys={leading:!0,trailing:!1};class Xs{constructor(e,t,n,i){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=i}call(e,t){return t.subscribe(new Qs(e,this.duration,this.scheduler,this.leading,this.trailing))}}class Qs extends qs.a{constructor(e,t,n,i,a){super(e),this.duration=t,this.scheduler=n,this.leading=i,this.trailing=a,this._hasTrailingValue=!1,this._trailingValue=null}_next(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Js,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)}}function Js(e){const{subscriber:t}=e;t.clearThrottle()}let Ks=(()=>{class e{constructor(e,t,n){this.el=e,this.uploadQueue=t,this.cd=n,this.hidden=!0,this.subscription=this.uploadQueue.totalProgress().pipe(function(e,t=Gs.a,n=Ys){return i=>i.lift(new Xs(e,t,n.leading,n.trailing))}(260,Us.a,{leading:!0,trailing:!0})).subscribe(e=>{this.progress=e,this.hidden=100===e||0===this.uploadQueue.count$.value.pending,this.cd.markForCheck()})}ngOnDestroy(){this.subscription.unsubscribe()}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.l),o.Nb(Vs.a),o.Nb(o.h))},e.\u0275cmp=o.Hb({type:e,selectors:[["upload-progress-bar"]],hostVars:2,hostBindings:function(e,t){2&e&&o.Fb("hidden",t.hidden)},decls:1,vars:1,consts:[["mode","determinate","color","accent",3,"value"]],template:function(e,t){1&e&&o.Ob(0,"mat-progress-bar",0),2&e&&o.kc("value",t.progress)},directives:[s.a],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),e})();var Ws=n("gA0O");let Zs=(()=>{class e{constructor(e){this.el=e,this.config={},this.filesSelected=new o.n}ngOnInit(){this.el.nativeElement.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),Object(Ls.a)(this.config).then(e=>{e&&e.length&&this.filesSelected.emit(e)})})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.l))},e.\u0275dir=o.Ib({type:e,selectors:[["","uploadButton",""]],inputs:{config:["uploadButton","config"]},outputs:{filesSelected:"filesSelected"}}),e})();function eo(e,t){1&e&&o.Ob(0,"image-or-icon",4),2&e&&o.kc("src",t.ngIf)}function to(e,t){if(1&e&&o.Ob(0,"image-or-icon",4),2&e){const e=o.ec(2);o.kc("src",e.defaultBackground)}}function no(e,t){if(1&e&&o.Fc(0,to,1,1,"image-or-icon",5),2&e){const e=o.ec();o.kc("ngIf",e.defaultBackground)}}function io(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Ob(1,"span",6),o.Tb(2,"button",7),o.ac("click",(function(){return o.vc(e),o.ec().openUploadDialog()})),o.Ob(3,"mat-icon",8),o.Sb(),o.Tb(4,"mat-menu",null,9),o.Tb(6,"button",10),o.ac("filesSelected",(function(t){return o.vc(e),o.ec().uploadImage(t)})),o.Hc(7),o.Sb(),o.Tb(8,"button",11),o.ac("click",(function(){return o.vc(e),o.ec().deleteUpload()})),o.Hc(9,"Remove"),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.sc(5),t=o.ec();o.Bb(1),o.kc("matMenuTriggerFor",e),o.Bb(5),o.kc("uploadButton",t.uploadInputConfig),o.Bb(1),o.Ic(t.buttonText)}}function ao(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",14),o.ac("click",(function(){return o.vc(e),o.ec(2).deleteUpload()})),o.Ob(1,"mat-icon",15),o.Sb()}}function so(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"button",12),o.ac("filesSelected",(function(t){return o.vc(e),o.ec().uploadImage(t)})),o.Hc(2),o.Sb(),o.Fc(3,ao,2,0,"button",13),o.fc(4,"async"),o.Qb()}if(2&e){const e=o.ec();o.Bb(1),o.kc("uploadButton",e.uploadInputConfig),o.Bb(1),o.Ic(e.buttonText),o.Bb(1),o.kc("ngIf",o.gc(4,3,e.src$))}}let oo=(()=>{class e{constructor(e,t,n,i){this.uploadQueue=e,this.imageValidator=t,this.uploadsApi=n,this.http=i,this.fileDeleted=new o.n,this.buttonText="Upload image",this.compact=!1,this.uploadInputConfig={multiple:!1,types:[$s.a.image]},this.src$=new ht.a(null)}writeValue(e){this.src$.next(e)}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}uploadImage(e){this.uploadQueue.start(e,this.uploadConfig||this.defaultUploadConfig()).subscribe(e=>{this.src$.next(e.fileEntry.url),this.propagateChange(e.fileEntry.url)})}deleteUpload(){const e={paths:[this.src$.value],deleteForever:!0};(this.uploadConfig&&this.uploadConfig.uri?this.http.delete(this.uploadConfig.uri,e):this.uploadsApi.delete(e)).subscribe(()=>{this.src$.next(null),this.propagateChange(null),this.fileDeleted.emit()})}defaultUploadConfig(){return{httpParams:{diskPrefix:this.diskPrefix||"common_media"},uri:Fs.a.Image,validator:this.imageValidator}}openUploadDialog(){this.src$.value?this.menuTrigger.toggleMenu():Object(Ls.a)(this.uploadInputConfig).then(e=>{this.uploadImage(e)})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(Vs.a),o.Nb(zs.a),o.Nb(js.a),o.Nb(r.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["upload-image-control"]],viewQuery:function(e,t){var n;1&e&&o.Nc(C.c,!0),2&e&&o.rc(n=o.bc())&&(t.menuTrigger=n.first)},hostVars:2,hostBindings:function(e,t){2&e&&o.Fb("compact",t.compact)},inputs:{defaultBackground:"defaultBackground",buttonText:"buttonText",uploadConfig:"uploadConfig",diskPrefix:"diskPrefix",compact:"compact"},outputs:{fileDeleted:"fileDeleted"},features:[o.Ab([Vs.a,{provide:a.s,useExisting:e,multi:!0}])],decls:8,vars:6,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","edit"],["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","trans","",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(e,t){if(1&e&&(o.Fc(0,eo,1,1,"image-or-icon",0),o.fc(1,"async"),o.Fc(2,no,1,1,"ng-template",null,1,o.Gc),o.Tb(4,"div",2),o.Fc(5,io,10,3,"ng-container",3),o.Fc(6,so,5,5,"ng-container",3),o.Sb(),o.Ob(7,"upload-progress-bar")),2&e){const e=o.sc(3);o.kc("ngIf",o.gc(1,4,t.src$))("ngIfElse",e),o.Bb(5),o.kc("ngIf",t.compact),o.Bb(1),o.kc("ngIf",!t.compact)}},directives:[i.t,Ks,Ws.a,C.c,u.b,P.a,C.d,C.a,Zs,vt.a],pipes:[i.b],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}"]}),e})();class ro{constructor(e,t){this.key=t,this.selected=[],this.selected=[...e],this.key=t||"id"}isSelected(e){return this.findIndex(e)>-1}toggle(e){const t=this.findIndex(e);t>-1?this.selected.splice(t,1):this.selected.push(Object.assign({},e))}updateValue(e){const t=this.findIndex(e);this.selected[t]=Object.assign({},e)}getValue(e){return this.selected.find(t=>t[this.key]===e)}values(){return[...this.selected]}findIndex(e){return this.selected.findIndex(t=>t[this.key]===e[this.key])}}var co=n("sPnx");let lo=(()=>{class e{constructor(e){this.httpClient=e}getRoles(){return this.httpClient.getWithCache("roles?perPage=15")}createNew(e){return this.httpClient.post("roles",e)}update(e,t){return this.httpClient.put("roles/"+e,t)}delete(e){return this.httpClient.delete("roles/"+e)}addUsers(e,t){return this.httpClient.post("roles/"+e+"/add-users",{emails:t})}removeUsers(e,t){return this.httpClient.post("roles/"+e+"/remove-users",{ids:t})}}return e.\u0275fac=function(t){return new(t||e)(o.Xb(co.a))},e.\u0275prov=o.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function bo(e,t){if(1&e){const e=o.Ub();o.Tb(0,"li",10),o.Tb(1,"div",11),o.ac("click",(function(){o.vc(e);const n=t.$implicit;return o.ec().selectionModel.toggle(n)})),o.Tb(2,"div",12),o.Tb(3,"div",13),o.Hc(4),o.Sb(),o.Sb(),o.Ob(5,"mat-pseudo-checkbox",14),o.Sb(),o.Sb()}if(2&e){const e=t.$implicit,n=o.ec();o.Bb(4),o.Ic(e.name),o.Bb(1),o.kc("state",n.selectionModel.isSelected(e)?"checked":"unchecked")}}let uo=(()=>{class e{constructor(e,t,n){this.rolesService=e,this.dialogRef=t,this.data=n,this.allRoles$=new ht.a([]),this.selectionModel=new ro(this.data.initialRoles||[],"id")}ngOnInit(){this.fetchAllRoles()}confirm(){this.close(this.selectionModel.values())}close(e){this.dialogRef.close(e)}fetchAllRoles(){this.rolesService.getRoles().subscribe(e=>this.allRoles$.next(e.pagination.data))}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(lo),o.Nb(g.h),o.Nb(g.a))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"h2",1),o.Hc(2,"Select Roles"),o.Sb(),o.Tb(3,"button",2),o.ac("click",(function(){return t.close()})),o.Ob(4,"mat-icon",3),o.Sb(),o.Sb(),o.Tb(5,"form",4),o.ac("ngSubmit",(function(){return t.confirm()})),o.Tb(6,"mat-dialog-content"),o.Tb(7,"ul",5),o.Fc(8,bo,6,2,"li",6),o.fc(9,"async"),o.Sb(),o.Sb(),o.Tb(10,"mat-dialog-actions",7),o.Tb(11,"button",8),o.ac("click",(function(){return t.close()})),o.Hc(12,"Cancel"),o.Sb(),o.Tb(13,"button",9),o.Hc(14,"Select"),o.Sb(),o.Sb(),o.Sb()),2&e&&(o.Bb(8),o.kc("ngForOf",o.gc(9,1,t.allRoles$)))},directives:[g.i,vt.a,P.a,a.v,a.w,g.f,i.s,g.c,u.b,S.q,S.o],pipes:[i.b],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.list-item[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),e})();function ho(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",9),o.Tb(1,"button",10),o.ac("click",(function(){return o.vc(e),o.ec(2).openSelectRolesModal()})),o.Hc(2,"Manage"),o.Sb(),o.Sb()}}function po(e,t){1&e&&(o.Tb(0,"div",11),o.Hc(1,"No roles yet."),o.Sb())}function go(e,t){if(1&e){const e=o.Ub();o.Tb(0,"mat-chip",12),o.ac("removed",(function(){o.vc(e);const n=t.$implicit;return o.ec(2).detachRole(n)})),o.Tb(1,"span",13),o.Hc(2),o.Sb(),o.Ob(3,"mat-icon",14),o.Sb()}if(2&e){const e=t.$implicit,n=o.ec(2);o.kc("removable",!0)("disabled",n.readonly),o.Bb(2),o.Ic(e.name)}}function mo(e,t){if(1&e&&(o.Tb(0,"div",1),o.Tb(1,"div",2),o.Tb(2,"div",3),o.Hc(3,"Roles"),o.Sb(),o.Fc(4,ho,3,0,"div",4),o.Sb(),o.Tb(5,"div",5),o.Fc(6,po,2,0,"div",6),o.fc(7,"async"),o.Tb(8,"mat-chip-list",7),o.Fc(9,go,4,3,"mat-chip",8),o.fc(10,"async"),o.Sb(),o.Sb(),o.Sb()),2&e){const e=o.ec();var n;o.Bb(4),o.kc("ngIf",!e.readonly),o.Bb(2),o.kc("ngIf",!(null!=(n=o.gc(7,4,e.roles$))&&n.length)),o.Bb(2),o.kc("selectable",!1),o.Bb(1),o.kc("ngForOf",o.gc(10,6,e.roles$))}}let fo=(()=>{class e{constructor(e,t,n,i){this.users=e,this.roleApi=t,this.modal=n,this.currentUser=i,this.roles$=new ht.a([]),this.readonly=!1}openSelectRolesModal(){this.modal.open(uo,{initialRoles:this.roles$.value}).afterClosed().subscribe(e=>{e&&this.setRoles(e)})}setRoles(e){this.roles$.next(e),this.propagateChange(this.roles$.value)}detachRole(e){const t=this.roles$.value.filter(t=>t.id!==e.id);this.setRoles(t)}writeValue(e){this.roles$.next(e)}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(Rs.a),o.Nb(lo),o.Nb(Lt.a),o.Nb(st.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["role-manager"]],inputs:{readonly:"readonly"},features:[o.Ab([{provide:a.s,useExisting:e,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(e,t){1&e&&o.Fc(0,mo,11,8,"div",0),2&e&&o.kc("ngIf",t.currentUser.hasPermission("roles.update"))},directives:[i.t,vt.a,p.c,i.s,u.b,p.a,P.a,p.d],pipes:[i.b],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}),e})();function vo(e,t){if(1&e&&(o.Tb(0,"p",19),o.Hc(1),o.Sb()),2&e){const e=o.ec().$implicit;o.Bb(1),o.Ic(e.description)}}function _o(e,t){if(1&e){const e=o.Ub();o.Tb(0,"input",26),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().$implicit.value=t})),o.Sb()}if(2&e){const e=o.ec().$implicit,t=o.ec(2).$implicit;o.kc("id",t.name+"-"+e.name)("ngModel",e.value)}}function So(e,t){if(1&e&&(o.Tb(0,"p",27),o.Hc(1),o.Sb()),2&e){const e=o.ec().$implicit;o.Bb(1),o.Ic(e.description)}}function yo(e,t){if(1&e&&(o.Rb(0),o.Tb(1,"div",22),o.Tb(2,"label",23),o.Hc(3),o.Sb(),o.Fc(4,_o,1,2,"input",24),o.Fc(5,So,2,1,"p",25),o.Sb(),o.Qb()),2&e){const e=t.$implicit,n=o.ec(2).$implicit,i=o.ec(2);o.Bb(1),o.kc("ngSwitch",e.type),o.Bb(1),o.kc("for",n.name+"-"+e.name),o.Bb(1),o.Ic(i.viewName(e.name)),o.Bb(1),o.kc("ngSwitchCase","number"),o.Bb(1),o.kc("ngIf",e.description)}}function ko(e,t){if(1&e&&(o.Tb(0,"div",20),o.Fc(1,yo,6,5,"ng-container",21),o.Sb()),2&e){const e=o.ec().$implicit;o.Bb(1),o.kc("ngForOf",e.restrictions)}}function To(e,t){if(1&e){const e=o.Ub();o.Tb(0,"li",12),o.Tb(1,"div",13),o.ac("click",(function(){o.vc(e);const n=t.$implicit;return o.ec(2).selectionModel.toggle(n)})),o.Tb(2,"div",14),o.Tb(3,"div",15),o.Hc(4),o.Sb(),o.Fc(5,vo,2,1,"p",16),o.Sb(),o.Ob(6,"mat-pseudo-checkbox",17),o.Sb(),o.Fc(7,ko,2,1,"div",18),o.Sb()}if(2&e){const e=t.$implicit,n=o.ec(2);o.Bb(4),o.Ic(e.display_name||e.name),o.Bb(1),o.kc("ngIf",e.description),o.Bb(1),o.kc("state",n.selectionModel.isSelected(e)?"checked":"unchecked"),o.Bb(1),o.kc("ngIf",!(null!=n.data&&n.data.hideRestrictions)&&(null==e.restrictions?null:e.restrictions.length)&&n.selectionModel.isSelected(e))}}function Co(e,t){if(1&e&&(o.Tb(0,"mat-expansion-panel",8),o.Tb(1,"mat-expansion-panel-header"),o.Tb(2,"mat-panel-title",9),o.Hc(3),o.Sb(),o.Sb(),o.Tb(4,"ul",10),o.Fc(5,To,8,4,"li",11),o.Sb(),o.Sb()),2&e){const e=t.$implicit;o.kc("expanded",!1),o.Bb(3),o.Ic(e.key.replace("_"," ")),o.Bb(2),o.kc("ngForOf",e.value)}}let wo=(()=>{class e{constructor(e,t,n){this.dialogRef=e,this.data=t,this.values=n,this.allPermissions$=new ht.a({}),this.loading$=new ht.a(!1),this.selectionModel=new ro(this.data.initialPermissions||[],"name")}ngOnInit(){this.fetchAllPermissions()}confirm(){this.close(this.getSelectedPermissions())}close(e){this.dialogRef.close(e)}fetchAllPermissions(){const e=this.data.valueListKey||"permissions";this.loading$.next(!0),this.values.get([e]).pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(t=>{this.allPermissions$.next(this.mergeRestrictions(t[e]).reduce((function(e,t){return(e[t.group]=e[t.group]||[]).push(t),e}),{}))})}getSelectedPermissions(){return xs(Object.values(this.allPermissions$.value)).filter(e=>this.selectionModel.isSelected(e))}mergeRestrictions(e){return e.map(e=>{const t=this.selectionModel.getValue(e.name);return e.restrictions=(e.restrictions||[]).map(e=>{let n={};return t&&t.restrictions&&(n=t.restrictions.find(t=>t.name===e.name)||{}),Object.assign(Object.assign({},e),n)}),e})}viewName(e){return e.replace(/_/g," ")}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(g.h),o.Nb(g.a),o.Nb(qn.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["select-permissions-modal"]],decls:17,vars:8,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"],["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"],[1,"input-container",3,"ngSwitch"],[3,"for"],["type","number","min","0",3,"id","ngModel","ngModelChange",4,"ngSwitchCase"],["class","description","trans","",4,"ngIf"],["type","number","min","0",3,"id","ngModel","ngModelChange"],["trans","",1,"description"]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"h2",1),o.Hc(2,"Select Permissions"),o.Sb(),o.Tb(3,"button",2),o.ac("click",(function(){return t.close()})),o.Ob(4,"mat-icon",3),o.Sb(),o.Sb(),o.Tb(5,"mat-dialog-content"),o.Tb(6,"mat-accordion"),o.Fc(7,Co,6,3,"mat-expansion-panel",4),o.fc(8,"keyvalue"),o.fc(9,"async"),o.Sb(),o.Sb(),o.Tb(10,"mat-dialog-actions"),o.Tb(11,"button",5),o.ac("click",(function(){return t.close()})),o.Hc(12,"Cancel"),o.Sb(),o.Tb(13,"button",6),o.ac("click",(function(){return t.confirm()})),o.Hc(14,"Select"),o.Sb(),o.Sb(),o.Ob(15,"loading-indicator",7),o.fc(16,"async")),2&e&&(o.Bb(7),o.kc("ngForOf",o.gc(8,2,o.gc(9,4,t.allPermissions$))),o.Bb(8),o.kc("isVisible",o.gc(16,6,t.loading$)))},directives:[g.i,vt.a,P.a,g.f,We.a,i.s,g.c,u.b,si.a,We.c,We.e,We.f,S.q,i.t,S.o,i.x,i.y,a.A,a.d,a.u,a.x],pipes:[i.l,i.b],styles:["[_nghost-%COMP%]{display:block;width:400px;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}"],changeDetection:0}),e})();function xo(e,t){1&e&&(o.Tb(0,"div",7),o.Hc(1,"No permissions yet."),o.Sb())}function Io(e,t){if(1&e&&(o.Tb(0,"span"),o.Hc(1),o.fc(2,"trans"),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Jc("(",o.gc(2,1,e.value+" max"),")")}}function Oo(e,t){if(1&e&&(o.Rb(0),o.Fc(1,Io,3,3,"span",10),o.Qb()),2&e){const e=t.ngIf;o.Bb(1),o.kc("ngIf",e.value)}}function Mo(e,t){if(1&e){const e=o.Ub();o.Tb(0,"mat-chip",8),o.ac("removed",(function(){o.vc(e);const n=t.$implicit;return o.ec().removePermission(n.name)})),o.Tb(1,"span"),o.Tb(2,"span",9),o.Hc(3),o.Sb(),o.Fc(4,Oo,2,1,"ng-container",10),o.Sb(),o.Ob(5,"mat-icon",11),o.Sb()}if(2&e){const e=t.$implicit,n=o.ec();o.kc("removable",!0),o.Bb(3),o.Ic(e.name),o.Bb(1),o.kc("ngIf",n.getCountRestriction(e))}}let Do=(()=>{class e{constructor(e){this.modal=e,this.valueListKey="permissions",this.hideRestrictions=!1,this.permissions$=new ht.a([])}showSelectPermissionsModal(){this.modal.open(wo,{initialPermissions:this.permissions$.value,valueListKey:this.valueListKey,hideRestrictions:this.hideRestrictions}).afterClosed().subscribe(e=>{e&&this.setPermissions(e)})}removePermission(e){const t=this.permissions$.value.filter(t=>t.name!==e);this.setPermissions(t)}setPermissions(e){this.permissions$.next(e),this.propagateChange(this.permissions$.value)}getCountRestriction(e){return e.restrictions.find(e=>"count"===e.name)}writeValue(e){this.permissions$.next(e)}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(Lt.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["permission-manager"]],inputs:{valueListKey:"valueListKey",hideRestrictions:"hideRestrictions"},features:[o.Ab([{provide:a.s,useExisting:e,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(e,t){var n;1&e&&(o.Tb(0,"div",0),o.Tb(1,"span",1),o.Hc(2,"Permissions"),o.Sb(),o.Tb(3,"button",2),o.ac("click",(function(){return t.showSelectPermissionsModal()})),o.Hc(4,"Manage"),o.Sb(),o.Sb(),o.Tb(5,"div",3),o.Fc(6,xo,2,0,"div",4),o.fc(7,"async"),o.Tb(8,"mat-chip-list",5),o.Fc(9,Mo,6,3,"mat-chip",6),o.fc(10,"async"),o.Sb(),o.Sb()),2&e&&(o.Bb(6),o.kc("ngIf",!(null!=(n=o.gc(7,3,t.permissions$))&&n.length)),o.Bb(2),o.kc("selectable",!1),o.Bb(1),o.kc("ngForOf",o.gc(10,5,t.permissions$)))},directives:[vt.a,u.b,i.t,p.c,i.s,p.a,P.a,p.d],pipes:[i.b,lt.a],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}),e})();function Bo(e,t){1&e&&(o.Tb(0,"h2",5),o.Hc(1,"Update User Details"),o.Sb())}function Ho(e,t){1&e&&(o.Tb(0,"h2",5),o.Hc(1,"Create a New User"),o.Sb())}function Po(e,t){if(1&e&&(o.Tb(0,"div",37),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(null==e?null:e.email)}}function Fo(e,t){if(1&e&&(o.Tb(0,"div",13),o.Tb(1,"label",35),o.Hc(2,"Email"),o.Sb(),o.Ob(3,"input",36),o.Fc(4,Po,2,1,"div",12),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(4),o.kc("ngIf",null==e?null:e.email)}}function Ao(e,t){if(1&e&&(o.Tb(0,"div",37),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(null==e?null:e.password)}}function Ro(e,t){if(1&e&&(o.Tb(0,"div",13),o.Tb(1,"label",38),o.Hc(2,"Password"),o.Sb(),o.Ob(3,"input",39),o.Fc(4,Ao,2,1,"div",12),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(4),o.kc("ngIf",null==e?null:e.password)}}function No(e,t){if(1&e&&(o.Tb(0,"div",37),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(null==e?null:e.avatar)}}function Eo(e,t){if(1&e&&(o.Tb(0,"div",37),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(null==e?null:e.first_name)}}function Vo(e,t){if(1&e&&(o.Tb(0,"div",37),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(null==e?null:e.last_name)}}function $o(e,t){if(1&e&&(o.Tb(0,"div",37),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(null==e?null:e.email_verified_at)}}function Lo(e,t){if(1&e&&(o.Tb(0,"div",37),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(null==e?null:e.available_space)}}function zo(e,t){if(1&e&&(o.Tb(0,"div",37),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(null==e?null:e.roles)}}function jo(e,t){1&e&&o.Ob(0,"permission-manager",40)}function Uo(e,t){if(1&e&&(o.Tb(0,"div",37),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(null==e?null:e.permissions)}}function qo(e,t){1&e&&(o.Tb(0,"span",41),o.Hc(1,"Update User"),o.Sb())}function Go(e,t){1&e&&(o.Tb(0,"span",41),o.Hc(1,"Create User"),o.Sb())}function Yo(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",6),o.ac("ngSubmit",(function(){return o.vc(e),o.ec().confirm()})),o.Tb(1,"mat-dialog-content",7),o.Fc(2,Fo,5,1,"div",8),o.Fc(3,Ro,5,1,"div",8),o.Tb(4,"div",9),o.Tb(5,"div",10),o.Ob(6,"upload-image-control",11),o.Fc(7,No,2,1,"div",12),o.Sb(),o.Tb(8,"div",7),o.Tb(9,"div",13),o.Tb(10,"label",14),o.Hc(11,"First Name"),o.Sb(),o.Ob(12,"input",15),o.Fc(13,Eo,2,1,"div",12),o.Sb(),o.Tb(14,"div",13),o.Tb(15,"label",16),o.Hc(16,"Last Name"),o.Sb(),o.Ob(17,"input",17),o.Fc(18,Vo,2,1,"div",12),o.Sb(),o.Sb(),o.Sb(),o.Tb(19,"div",13),o.Tb(20,"label",18),o.Hc(21,"Email Confirmed"),o.Sb(),o.Tb(22,"div",19),o.Tb(23,"select",20),o.Tb(24,"option",21),o.Hc(25,"Yes"),o.Sb(),o.Tb(26,"option",21),o.Hc(27,"No"),o.Sb(),o.Sb(),o.Tb(28,"button",22),o.ac("click",(function(){return o.vc(e),o.ec().sendEmailConfirmation()})),o.fc(29,"async"),o.Hc(30,"Resend"),o.Sb(),o.Sb(),o.Fc(31,$o,2,1,"div",12),o.Sb(),o.Tb(32,"div",13),o.Tb(33,"label",23),o.Hc(34,"New Password"),o.Sb(),o.Tb(35,"div",24),o.Ob(36,"input",25),o.Tb(37,"button",26),o.ac("click",(function(){return o.vc(e),o.ec().generateNewPassword()})),o.Hc(38,"Generate"),o.Sb(),o.Sb(),o.Sb(),o.Tb(39,"space-input",27),o.Tb(40,"p",28),o.Hc(41,'Disk space available to user. If left empty, it will be inherited from value set in "admin -> settings -> uploading" page.'),o.Sb(),o.Fc(42,Lo,2,1,"div",12),o.Sb(),o.Ob(43,"role-manager",29),o.Fc(44,zo,2,1,"div",12),o.Fc(45,jo,1,0,"permission-manager",30),o.Fc(46,Uo,2,1,"div",12),o.Sb(),o.Tb(47,"div",31),o.Tb(48,"button",32),o.ac("click",(function(){return o.vc(e),o.ec().close()})),o.Hc(49,"Cancel"),o.Sb(),o.Tb(50,"button",33),o.fc(51,"async"),o.Fc(52,qo,2,0,"span",34),o.Fc(53,Go,2,0,"span",34),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.kc("formGroup",n.form),o.Bb(2),o.kc("ngIf",!n.data.user),o.Bb(1),o.kc("ngIf",!n.data.user),o.Bb(3),o.kc("uploadConfig",n.avatarUploadConfig()),o.Bb(1),o.kc("ngIf",null==e?null:e.avatar),o.Bb(6),o.kc("ngIf",null==e?null:e.first_name),o.Bb(5),o.kc("ngIf",null==e?null:e.last_name),o.Bb(1),o.Fb("resend-button-visible",n.shouldShowResendButton()),o.Bb(5),o.kc("ngValue",!0),o.Bb(2),o.kc("ngValue",!1),o.Bb(2),o.kc("disabled",o.gc(29,20,n.loading$)),o.Bb(3),o.kc("ngIf",null==e?null:e.email_verified_at),o.Bb(11),o.kc("ngIf",null==e?null:e.available_space),o.Bb(2),o.kc("ngIf",null==e?null:e.roles),o.Bb(1),o.kc("ngIf",n.currentUser.hasPermission("permissions.update")),o.Bb(1),o.kc("ngIf",null==e?null:e.permissions),o.Bb(4),o.kc("disabled",o.gc(51,22,n.loading$)),o.Bb(2),o.kc("ngIf",n.data.user),o.Bb(1),o.kc("ngIf",!n.data.user)}}let Xo=(()=>{class e{constructor(e,t,n,i,a,s,o,r,c){this.dialogRef=e,this.data=t,this.users=n,this.toast=i,this.currentUser=a,this.fb=s,this.auth=o,this.settings=r,this.avatarValidator=c,this.loading$=new ht.a(!1),this.form=this.fb.group({email:[""],password:[""],avatar:[""],first_name:[""],last_name:[""],email_verified_at:[!1],available_space:[""],roles:[],permissions:[]}),this.errors$=new ht.a({})}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 e;const t=this.getPayload();this.loading$.next(!0),e=this.data.user?this.users.update(this.data.user.id,t):this.users.create(t),e.pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(e=>{this.close(e.user),this.toast.open("User "+(this.data.user?"updated":"created"))},e=>this.errors$.next(e.errors))}close(e){this.dialogRef.close(e)}getPayload(){const e=Object.assign({},this.form.value);return e.roles=(e.roles||[]).map(e=>e.id),e.permissions=e.permissions||[],e.password||delete e.password,e.email_verified_at=e.email_verified_at?new Date:null,e}sendEmailConfirmation(){this.loading$.next(!0),this.auth.resendEmailConfirmation(this.data.user.email).pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Verification email re-sent.")},e=>{this.toast.open(e.message||As.a.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`:Fs.a.Image,httpParams:{diskPrefix:"avatars"},validator:this.avatarValidator}}generateNewPassword(){this.form.patchValue({password:Object(Xa.a)(15)})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(g.h),o.Nb(g.a),o.Nb(Rs.a),o.Nb(mt.b),o.Nb(st.a),o.Nb(a.h),o.Nb(Ns.a),o.Nb(at.a),o.Nb(Es.a))},e.\u0275cmp=o.Hb({type:e,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","first_name","trans",""],["type","text","id","first_name","formControlName","first_name"],["for","last_name","trans",""],["type","text","id","last_name","formControlName","last_name"],["for","confirmed","trans",""],[1,"confirmed-select-wrapper"],["id","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","email","trans",""],["type","email","id","email","formControlName","email","required",""],[1,"error"],["for","password","trans",""],["type","password","id","password","formControlName","password","required",""],["formControlName","permissions"],["trans",""]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Fc(1,Bo,2,0,"h2",1),o.Fc(2,Ho,2,0,"h2",1),o.Tb(3,"button",2),o.ac("click",(function(){return t.close()})),o.Ob(4,"mat-icon",3),o.Sb(),o.Sb(),o.Fc(5,Yo,54,24,"form",4),o.fc(6,"async")),2&e&&(o.Bb(1),o.kc("ngIf",t.data.user),o.Bb(1),o.kc("ngIf",!t.data.user),o.Bb(3),o.kc("ngIf",o.gc(6,3,t.errors$)))},directives:[i.t,P.a,g.i,vt.a,a.v,a.m,g.f,oo,a.u,a.k,a.d,a.G,a.z,a.J,u.b,ns,fo,g.c,a.F,Do],pipes:[i.b],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}),e})();const Qo=["*"];let Jo=(()=>{class e{constructor(e){this.fb=e,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(e){Array.isArray(e)||(e=(e||"").split(":"));let[t,n]=e;!this.initiated&&this.setDefaultDate&&(t=t||this.defaultFrom,n=n||this.defaultTo),this.initiated=!0,this.form.patchValue({from:t,to:n})}registerOnChange(e){this.propagateChange=e,this.form.valueChanges.pipe(Object(X.a)(e=>e.from&&e.to)).subscribe(e=>{this.propagateChange(`${e.from}:${e.to}`)})}registerOnTouched(){}getDefaultDate(e=0){const t=new Date;t.setDate(t.getDate()-e);const n=this.addZero(t.getMonth()+1),i=this.addZero(t.getDate());return`${t.getFullYear()}-${n}-${i}`}addZero(e){return e<10?"0"+e:""+e}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(a.h))},e.\u0275cmp=o.Hb({type:e,selectors:[["between-input"]],inputs:{setDefaultDate:"setDefaultDate",showLabels:"showLabels"},features:[o.Ab([{provide:a.s,useExisting:e,multi:!0}])],ngContentSelectors:Qo,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(e,t){1&e&&(o.jc(),o.Tb(0,"fieldset",0),o.Tb(1,"legend",1),o.ic(2),o.Sb(),o.Tb(3,"div",2),o.Tb(4,"div",3),o.Tb(5,"label",4),o.Hc(6,"From"),o.Sb(),o.Ob(7,"input",5),o.Sb(),o.Tb(8,"div",3),o.Tb(9,"label",6),o.Hc(10,"To"),o.Sb(),o.Ob(11,"input",7),o.Sb(),o.Sb(),o.Sb()),2&e&&(o.kc("formGroup",t.form),o.Bb(5),o.Fb("hidden",!t.showLabels),o.Bb(2),o.kc("placeholder",t.defaultFrom)("pattern",t.datePattern),o.Bb(2),o.Fb("hidden",!t.showLabels),o.Bb(2),o.kc("placeholder",t.defaultTo)("pattern",t.datePattern))},directives:[a.v,a.m,vt.a,a.d,a.u,a.k,a.F,a.B],styles:["legend[_ngcontent-%COMP%]{text-transform:capitalize}legend[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0}),e})();function Ko(e,t){1&e&&(o.Tb(0,"div",2),o.Tb(1,"label",7),o.Hc(2,"Subscribed"),o.Sb(),o.Tb(3,"select",8),o.Tb(4,"option",5),o.Hc(5,"All"),o.Sb(),o.Tb(6,"option",5),o.Hc(7,"Subscribed"),o.Sb(),o.Tb(8,"option",5),o.Hc(9,"Not subscribed"),o.Sb(),o.Sb(),o.Sb()),2&e&&(o.Bb(4),o.kc("ngValue",null),o.Bb(2),o.kc("ngValue",!0),o.Bb(2),o.kc("ngValue",!1))}let Wo=(()=>{class e{constructor(e,t,n){this.fb=e,this.datable=t,this.settings=n,this.form=this.fb.group({subscribed:null,email_verified_at:null,created_at:null}),this.form.patchValue(this.datable.filters$.value)}ngOnInit(){this.form.valueChanges.subscribe(e=>{this.datable.filters$.next(e)})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(a.h),o.Nb(jt),o.Nb(at.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["user-index-filters"]],decls:14,vars:7,consts:[[1,"many-inputs",3,"formGroup"],["class","input-container",4,"ngIf"],[1,"input-container"],["for","user-status-filter","trans",""],["id","user-status-filter","formControlName","email_verified_at"],["trans","",3,"ngValue"],["formControlName","created_at",3,"setDefaultDate","showLabels"],["for","user-subscribed-filter","trans",""],["id","user-subscribed-filter","formControlName","subscribed"]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Fc(1,Ko,10,3,"div",1),o.Tb(2,"div",2),o.Tb(3,"label",3),o.Hc(4,"Status"),o.Sb(),o.Tb(5,"select",4),o.Tb(6,"option",5),o.Hc(7,"All"),o.Sb(),o.Tb(8,"option",5),o.Hc(9,"Email confirmed"),o.Sb(),o.Tb(10,"option",5),o.Hc(11,"Email not confirmed"),o.Sb(),o.Sb(),o.Sb(),o.Tb(12,"between-input",6),o.Hc(13,"Created Between"),o.Sb(),o.Sb()),2&e&&(o.kc("formGroup",t.form),o.Bb(1),o.kc("ngIf",t.settings.get("billing.enable")),o.Bb(5),o.kc("ngValue",null),o.Bb(2),o.kc("ngValue",!0),o.Bb(2),o.kc("ngValue",!1),o.Bb(2),o.kc("setDefaultDate",!1)("showLabels",!1))},directives:[a.v,a.m,i.t,vt.a,a.G,a.u,a.k,a.z,a.J,Jo],styles:[""],changeDetection:0}),e})();function Zo(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",14),o.ac("click",(function(){return o.vc(e),o.ec().showCrupdateUserModal()})),o.Hc(1,"Add"),o.Sb()}}function er(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",15),o.ac("click",(function(){return o.vc(e),o.ec().maybeDeleteSelectedUsers()})),o.fc(1,"trans"),o.Hc(2,"Delete Selected"),o.Sb()}2&e&&o.kc("matTooltip",o.gc(1,1,"Delete selected"))}function tr(e,t){1&e&&o.Ob(0,"user-index-filters")}function nr(e,t){1&e&&(o.Tb(0,"th",10),o.Hc(1,"Subscribed"),o.Sb())}function ir(e,t){if(1&e&&(o.Tb(0,"td",24),o.Hc(1),o.Sb()),2&e){const e=o.ec().$implicit;o.Bb(1),o.Ic(null!=e.subscriptions&&e.subscriptions.length?"Yes":"No")}}function ar(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",25),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec().showCrupdateUserModal(t)})),o.fc(1,"trans"),o.Ob(2,"mat-icon",26),o.Sb()}2&e&&o.kc("matTooltip",o.gc(1,1,"Edit user"))}function sr(e,t){if(1&e&&(o.Tb(0,"tr"),o.Ob(1,"td",16),o.Tb(2,"td"),o.Ob(3,"user-column",17),o.Sb(),o.Fc(4,ir,2,1,"td",18),o.Tb(5,"td",19),o.Hc(6),o.Sb(),o.Tb(7,"td",20),o.Hc(8),o.Sb(),o.Tb(9,"td",21),o.Hc(10),o.Sb(),o.Tb(11,"td"),o.Hc(12),o.fc(13,"formattedDate"),o.Sb(),o.Tb(14,"td",22),o.Fc(15,ar,3,3,"button",23),o.Sb(),o.Sb()),2&e){const e=t.$implicit,n=o.ec();o.Bb(1),o.kc("table-body-checkbox",e.id),o.Bb(2),o.kc("user",e),o.Bb(1),o.kc("ngIf",n.settings.get("billing.enable")),o.Bb(2),o.Ic(n.makeRolesList(e.roles)),o.Bb(2),o.Ic(e.first_name||"-"),o.Bb(2),o.Ic(e.last_name||"-"),o.Bb(2),o.Ic(o.gc(13,8,e.created_at)),o.Bb(3),o.kc("ngIf",n.currentUser.hasPermission("users.update"))}}function or(e,t){1&e&&(o.Tb(0,"no-results-message",27),o.Tb(1,"span",28),o.Hc(2,"No users have been created yet"),o.Sb(),o.Sb())}let rr=(()=>{class e{constructor(e,t,n,i,a){this.userService=e,this.currentUser=t,this.settings=n,this.toast=i,this.datatable=a,this.users$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:Rs.a.BASE_URI})}ngOnDestroy(){this.datatable.destroy()}makeRolesList(e){return e.slice(0,3).map(e=>e.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")},e=>{this.toast.open(e.message||As.a.Default)})})}showCrupdateUserModal(e){this.datatable.openCrupdateResourceModal(Xo,{user:e}).subscribe()}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(Rs.a),o.Nb(st.a),o.Nb(at.a),o.Nb(mt.b),o.Nb(jt))},e.\u0275cmp=o.Hb({type:e,selectors:[["user-index"]],features:[o.Ab([jt])],decls:29,vars:9,consts:[[1,"datatable","responsive-table"],["pluralResourceName","users"],["leftContent",""],["mat-raised-button","","color","accent","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","accent","rightContent","","trans","",3,"matTooltip","click",4,"ngIf"],["tableFilters",""],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","email","trans",""],["trans","",4,"ngIf"],["trans",""],["table-sort-header","","trans",""],[4,"ngFor","ngForOf"],["svgImage","people.svg",4,"ngIf"],["mat-raised-button","","color","accent","trans","",3,"click"],["mat-raised-button","","color","accent","rightContent","","trans","",3,"matTooltip","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"],["svgImage","people.svg"],["primary-text","","trans",""]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"datatable-header",1),o.Rb(2,2),o.Fc(3,Zo,2,0,"button",3),o.Qb(),o.Fc(4,er,3,3,"button",4),o.Fc(5,tr,1,0,"ng-template",null,5,o.Gc),o.Sb(),o.Tb(7,"table",6),o.Tb(8,"thead"),o.Tb(9,"tr"),o.Ob(10,"th",7),o.Tb(11,"th",8),o.Hc(12,"User"),o.Sb(),o.Fc(13,nr,2,0,"th",9),o.Tb(14,"th",10),o.Hc(15,"Roles"),o.Sb(),o.Tb(16,"th",11),o.Hc(17,"First Name"),o.Sb(),o.Tb(18,"th",11),o.Hc(19,"Last Name"),o.Sb(),o.Tb(20,"th",11),o.Hc(21,"Created At"),o.Sb(),o.Ob(22,"th"),o.Sb(),o.Sb(),o.Tb(23,"tbody"),o.Fc(24,sr,16,10,"tr",12),o.fc(25,"async"),o.Sb(),o.Sb(),o.Fc(26,or,3,0,"no-results-message",13),o.fc(27,"async"),o.Ob(28,"datatable-footer"),o.Sb()),2&e&&(o.Bb(3),o.kc("ngIf",t.currentUser.hasPermission("users.create")),o.Bb(1),o.kc("ngIf",t.currentUser.hasPermission("users.delete")),o.Bb(9),o.kc("ngIf",t.settings.get("billing.enable")),o.Bb(11),o.kc("ngForOf",o.gc(25,5,t.users$)),o.Bb(2),o.kc("ngIf",o.gc(27,7,t.datatable.paginator.noResults$)))},directives:[bn,i.t,hn,vn,vt.a,i.s,yn,u.b,I.a,Wo,Tn,Rn,P.a,Cn.a],pipes:[i.b,lt.a,wn.a],styles:[".mat-column-permissions[_ngcontent-%COMP%]{max-height:49px}.mat-column-email[_ngcontent-%COMP%]{margin-right:15px}"],changeDetection:0}),e})();class cr{constructor(e={}){for(const t in e)this[t]=e[t]}}function lr(e,t){1&e&&(o.Tb(0,"h2",5),o.Hc(1,"Update Role"),o.Sb())}function dr(e,t){1&e&&(o.Tb(0,"h2",5),o.Hc(1,"Create a New Role"),o.Sb())}function br(e,t){if(1&e&&(o.Tb(0,"div",24),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.name)}}function ur(e,t){1&e&&(o.Tb(0,"div",8),o.Tb(1,"label",25),o.Hc(2,"Type"),o.Sb(),o.Tb(3,"select",26),o.Tb(4,"option",27),o.Hc(5,"Site Wide"),o.Sb(),o.Tb(6,"option",28),o.Hc(7,"Workspace"),o.Sb(),o.Sb(),o.Sb())}function hr(e,t){if(1&e&&(o.Tb(0,"div",24),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(null==e?null:e.permissions)}}function pr(e,t){if(1&e&&(o.Tb(0,"div",24),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.default)}}function gr(e,t){if(1&e&&(o.Tb(0,"div",24),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(e.guests)}}function mr(e,t){if(1&e&&(o.Tb(0,"div",16),o.Tb(1,"mat-slide-toggle",29),o.Hc(2,"Guests"),o.Sb(),o.Tb(3,"p",18),o.Hc(4,"Assign this role to guests (not logged in users)."),o.Sb(),o.Fc(5,gr,2,1,"div",11),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(5),o.kc("ngIf",e.guests)}}function fr(e,t){1&e&&(o.Tb(0,"span",18),o.Hc(1,"Update"),o.Sb())}function vr(e,t){1&e&&(o.Tb(0,"span",18),o.Hc(1,"Create"),o.Sb())}function _r(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",6),o.ac("submit",(function(){return o.vc(e),o.ec().confirm()})),o.Tb(1,"div",7),o.Tb(2,"div",8),o.Tb(3,"label",9),o.Hc(4,"Name"),o.Sb(),o.Ob(5,"input",10),o.Fc(6,br,2,1,"div",11),o.Sb(),o.Tb(7,"div",8),o.Tb(8,"label",12),o.Hc(9,"Description"),o.Sb(),o.Ob(10,"textarea",13),o.Sb(),o.Fc(11,ur,8,0,"div",14),o.Ob(12,"permission-manager",15),o.Fc(13,hr,2,1,"div",11),o.Tb(14,"div",16),o.Tb(15,"mat-slide-toggle",17),o.Hc(16,"Default"),o.Sb(),o.Tb(17,"p",18),o.Hc(18,"Assign this role to new users automatically."),o.Sb(),o.Fc(19,pr,2,1,"div",11),o.Sb(),o.Fc(20,mr,6,1,"div",19),o.Sb(),o.Tb(21,"div",20),o.Tb(22,"button",21),o.ac("click",(function(){return o.vc(e),o.ec().close()})),o.Hc(23,"Cancel"),o.Sb(),o.Tb(24,"button",22),o.fc(25,"async"),o.Fc(26,fr,2,0,"span",23),o.Fc(27,vr,2,0,"span",23),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.kc("formGroup",n.form),o.Bb(6),o.kc("ngIf",e.name),o.Bb(5),o.kc("ngIf",n.settings.get("workspaces.integrated")),o.Bb(1),o.kc("valueListKey","workspace"===n.form.get("type").value?"workspacePermissions":"permissions")("hideRestrictions",null==n.data||null==n.data.role?null:n.data.role.guests),o.Bb(1),o.kc("ngIf",null==e?null:e.permissions),o.Bb(6),o.kc("ngIf",e.default),o.Bb(1),o.kc("ngIf","sitewide"===n.form.get("type").value),o.Bb(4),o.kc("disabled",o.gc(25,11,n.loading$)),o.Bb(2),o.kc("ngIf",n.data.role),o.Bb(1),o.kc("ngIf",!n.data.role)}}let Sr=(()=>{class e{constructor(e,t,n,i,a,s,o){this.toast=e,this.roleService=t,this.modal=n,this.fb=i,this.dialogRef=a,this.settings=s,this.data=o,this.form=this.fb.group({name:[""],description:[""],type:["sitewide"],default:[!1],guests:[!1],permissions:[]}),this.loading$=new ht.a(!1),this.errors$=new ht.a({})}ngOnInit(){this.resetState(),this.data.role&&this.form.patchValue(this.data.role)}close(e){this.resetState(),this.dialogRef.close(e)}confirm(){let e;this.loading$.next(!0),e=this.data.role?this.roleService.update(this.data.role.id,this.form.value):this.roleService.createNew(this.form.value),e.pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(e=>{this.toast.open("Role "+(this.data.role?"Updated":"Created")),this.close(e.data)},e=>this.errors$.next(e.errors))}resetState(){this.form.reset(),this.errors$.next({})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(mt.b),o.Nb(lo),o.Nb(Lt.a),o.Nb(a.h),o.Nb(g.h),o.Nb(at.a),o.Nb(g.a))},e.\u0275cmp=o.Hb({type:e,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"],[1,"setting-container"],["formControlName","default","id","default","trans",""],["trans",""],["class","setting-container",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",""],["id","guest","formControlName","guests","trans",""]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Fc(1,lr,2,0,"h2",1),o.Fc(2,dr,2,0,"h2",1),o.Tb(3,"button",2),o.ac("click",(function(){return t.close()})),o.Ob(4,"mat-icon",3),o.Sb(),o.Sb(),o.Fc(5,_r,28,13,"form",4),o.fc(6,"async")),2&e&&(o.Bb(1),o.kc("ngIf",t.data.role),o.Bb(1),o.kc("ngIf",!t.data.role),o.Bb(3),o.kc("ngIf",o.gc(6,3,t.errors$)))},directives:[i.t,P.a,g.i,vt.a,a.v,a.m,g.f,a.d,a.u,a.k,a.F,a.p,Do,w.a,g.c,u.b,a.G,a.z,a.J],pipes:[i.b],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}),e})();function yr(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",9),o.ac("click",(function(){o.vc(e);const n=t.$implicit;return o.ec().close(n)})),o.Ob(1,"img",10),o.Tb(2,"div",11),o.Tb(3,"div",12),o.Hc(4),o.Sb(),o.Tb(5,"div",13),o.Hc(6),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=t.$implicit;o.Bb(1),o.kc("src",e.avatar,o.xc),o.Bb(3),o.Ic(e.display_name),o.Bb(2),o.Ic(e.email)}}let kr=(()=>{class e{constructor(e,t,n){this.dialogRef=e,this.data=t,this.users=n,this.searchFormControl=new a.i,this.loading$=new ht.a(!1),this.users$=new ht.a([])}ngOnInit(){this.searchFormControl.valueChanges.pipe(Object(Ht.a)(250),Object(Jt.a)(),Object(Yn.a)(e=>this.searchUsers(e)),Object(Xn.a)(()=>Object(U.a)([]))).subscribe(e=>{this.users$.next(e),this.loading$.next(!1)})}searchUsers(e){return this.loading$.next(!0),e?this.users.getAll({query:e}):Object(U.a)([])}close(e){this.dialogRef.close(e)}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(g.h),o.Nb(g.a),o.Nb(Rs.a))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"h2",1),o.Hc(2,"Find User"),o.Sb(),o.Tb(3,"button",2),o.ac("click",(function(){return t.close()})),o.Ob(4,"mat-icon",3),o.Sb(),o.Sb(),o.Tb(5,"mat-dialog-content"),o.Tb(6,"div",4),o.Ob(7,"input",5),o.Ob(8,"loading-indicator",6),o.fc(9,"async"),o.Sb(),o.Tb(10,"div",7),o.Fc(11,yr,7,3,"div",8),o.fc(12,"async"),o.Sb(),o.Sb()),2&e&&(o.Bb(7),o.kc("formControl",t.searchFormControl),o.Bb(1),o.kc("isVisible",o.gc(9,3,t.loading$)),o.Bb(3),o.kc("ngForOf",o.gc(12,5,t.users$)))},directives:[g.i,vt.a,P.a,g.f,a.d,a.u,a.j,si.a,i.s],pipes:[i.b],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:30px;position:relative}loading-indicator[_ngcontent-%COMP%]{top:12px;right:12px}.users[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:space-between}.user[_ngcontent-%COMP%]{display:flex;width:calc(50% - 10px);flex-shrink:0;min-width:0;margin-bottom:20px;cursor:pointer}.user[_ngcontent-%COMP%]:hover{color:var(--be-accent-default)}.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}),e})();function Tr(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",15),o.ac("click",(function(){return o.vc(e),o.ec().showCrupdateRoleModal()})),o.Hc(1,"New Role"),o.Sb()}}function Cr(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",22),o.ac("click",(function(){o.vc(e);const n=t.$implicit;return o.ec(2).selectRole(n)})),o.fc(1,"async"),o.Hc(2),o.Sb()}if(2&e){const e=t.$implicit,n=o.ec(2);o.Fb("selected",o.gc(1,3,n.selectedRole$).id===e.id),o.Bb(2),o.Ic(e.name)}}function wr(e,t){if(1&e&&(o.Rb(0),o.Tb(1,"button",16),o.Tb(2,"span",17),o.Hc(3),o.fc(4,"async"),o.Sb(),o.Ob(5,"mat-icon",18),o.Sb(),o.Tb(6,"mat-menu",19,20),o.Fc(8,Cr,3,5,"button",21),o.fc(9,"async"),o.Sb(),o.Qb()),2&e){const e=o.sc(7),t=o.ec();o.Bb(1),o.kc("matMenuTriggerFor",e),o.Bb(2),o.Ic(o.gc(4,3,t.selectedRole$).name),o.Bb(5),o.kc("ngForOf",o.gc(9,5,t.roles$))}}function xr(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",32),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec(2).showCrupdateRoleModal(t)})),o.Hc(1,"Edit"),o.Sb()}}function Ir(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",32),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec(2).maybeDeleteRole(t)})),o.Hc(1,"Delete"),o.Sb()}}function Or(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",25),o.ac("click",(function(){o.vc(e);const n=t.$implicit;return o.ec(2).selectRole(n)})),o.fc(1,"async"),o.Tb(2,"div",17),o.Tb(3,"div"),o.Hc(4),o.Sb(),o.Tb(5,"div",26),o.Hc(6),o.Sb(),o.Sb(),o.Tb(7,"div",27),o.Tb(8,"button",28),o.ac("click",(function(t){return o.vc(e),t.stopPropagation()})),o.Ob(9,"mat-icon",29),o.Sb(),o.Tb(10,"mat-menu",null,30),o.Fc(12,xr,2,0,"div",31),o.Fc(13,Ir,2,0,"div",31),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=t.$implicit,n=o.sc(11),i=o.ec(2);o.Fb("selected",o.gc(1,7,i.selectedRole$).id===e.id),o.Bb(4),o.Ic(e.name),o.Bb(2),o.Ic(e.type),o.Bb(2),o.kc("matMenuTriggerFor",n),o.Bb(4),o.kc("ngIf",i.currentUser.hasPermission("roles.update")),o.Bb(1),o.kc("ngIf",i.currentUser.hasPermission("roles.delete"))}}function Mr(e,t){if(1&e&&(o.Tb(0,"aside",23),o.Fc(1,Or,14,9,"div",24),o.fc(2,"async"),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.kc("ngForOf",o.gc(2,1,e.roles$))}}function Dr(e,t){if(1&e){const e=o.Ub();o.Rb(0,33),o.Tb(1,"button",34),o.ac("click",(function(){return o.vc(e),o.ec().showAssignUsersModal()})),o.Hc(2,"Assign Users"),o.Sb(),o.Tb(3,"button",35),o.ac("click",(function(){return o.vc(e),o.ec().maybeDetachUsers()})),o.fc(4,"async"),o.Hc(5,"Unassign Users"),o.Sb(),o.Qb()}if(2&e){const e=o.ec();o.Bb(1),o.kc("disabled",!e.canAssignUsers()),o.Bb(2),o.kc("disabled",!o.gc(4,2,e.datatable.selectedRows$).length)}}function Br(e,t){if(1&e&&(o.Tb(0,"tr"),o.Ob(1,"td",36),o.Tb(2,"td",37),o.Ob(3,"user-column",38),o.Sb(),o.Tb(4,"td",39),o.Hc(5),o.Sb(),o.Tb(6,"td",40),o.Hc(7),o.Sb(),o.Tb(8,"td",41),o.Hc(9),o.fc(10,"formattedDate"),o.Sb(),o.Sb()),2&e){const e=t.$implicit;o.Bb(1),o.kc("table-body-checkbox",e.id),o.Bb(2),o.kc("user",e),o.Bb(2),o.Ic(e.first_name||"-"),o.Bb(2),o.Ic(e.last_name||"-"),o.Bb(2),o.Ic(o.gc(10,5,e.created_at))}}function Hr(e,t){1&e&&(o.Tb(0,"no-results-message",44),o.Tb(1,"span",45),o.Hc(2,"This role can't be assigned to users."),o.Sb(),o.Sb())}function Pr(e,t){1&e&&(o.Tb(0,"no-results-message",44),o.Tb(1,"span",45),o.Hc(2,"No users are assigned this role yet."),o.Sb(),o.Sb())}function Fr(e,t){if(1&e&&(o.Fc(0,Pr,3,0,"no-results-message",46),o.fc(1,"async"),o.fc(2,"async")),2&e){const e=o.ec(2);o.kc("ngIf",o.gc(1,1,e.datatable.paginator.noResults$)&&!o.gc(2,3,e.datatable.paginator.loading$))}}function Ar(e,t){if(1&e&&(o.Rb(0),o.Fc(1,Hr,3,0,"no-results-message",42),o.Fc(2,Fr,3,5,"ng-template",null,43,o.Gc),o.Qb()),2&e){const e=t.ngIf,n=o.sc(3);o.Bb(1),o.kc("ngIf",e.guests||"sitewide"!==e.type)("ngIfElse",n)}}function Rr(e,t){1&e&&(o.Tb(0,"no-results-message",44),o.Tb(1,"span",45),o.Hc(2,"No role selected."),o.Sb(),o.Sb())}let Nr=(()=>{class e{constructor(e,t,n,i,a,s){this.roleApi=e,this.toast=t,this.modal=n,this.currentUser=i,this.breakpoints=a,this.datatable=s,this.roles$=new ht.a([]),this.users$=this.datatable.data$,this.selectedRole$=new ht.a(new cr)}ngOnInit(){this.refreshRoles().then(()=>{var e;this.datatable.init({uri:Rs.a.BASE_URI,staticParams:{role_id:null===(e=this.selectedRole$.value)||void 0===e?void 0:e.id}})})}selectRole(e){this.selectedRole$.value.id!==e.id&&(this.selectedRole$.next(e),this.refreshRoleUsers(e))}refreshRoles(){return new Promise(e=>{this.roleApi.getRoles().subscribe(t=>{if(this.roles$.next(t.pagination.data),this.roles$.value.length)if(this.selectedRole$.value.id){const e=this.roles$.value.find(e=>e.id===this.selectedRole$.value.id);e&&this.selectedRole$.next(e)}else this.selectRole(this.roles$.value[0]);e()})})}refreshRoleUsers(e){this.datatable.reset("sitewide"!==e.type||e.guests?{role_id:999}:{role_id:e.id})}showAssignUsersModal(){this.modal.open(kr).afterClosed().subscribe(e=>{e&&this.roleApi.addUsers(this.selectedRole$.value.id,[e.email]).subscribe(()=>{this.toast.open("User assigned to role"),this.refreshRoleUsers(this.selectedRole$.value)})})}showCrupdateRoleModal(e){this.modal.show(Sr,{role:e}).afterClosed().subscribe(e=>{e&&this.refreshRoles()})}maybeDeleteRole(e){this.modal.open(Nt.a,{title:"Delete Role",body:"Are you sure you want to delete this role?",ok:"Delete"}).afterClosed().subscribe(t=>{t&&this.deleteRole(e)})}deleteRole(e){this.roleApi.delete(e.id).subscribe(()=>{this.selectedRole$.next(new cr),this.refreshRoles().then(()=>{this.refreshRoleUsers(this.selectedRole$.value)})})}maybeDetachUsers(){this.modal.show(Nt.a,{title:"Remove users from role",body:"Are you sure you want to remove selected users from this role?",ok:"Remove"}).afterClosed().subscribe(e=>{e&&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 e.\u0275fac=function(t){return new(t||e)(o.Nb(lo),o.Nb(mt.b),o.Nb(Lt.a),o.Nb(st.a),o.Nb(ot.a),o.Nb(jt))},e.\u0275cmp=o.Hb({type:e,selectors:[["role-index"]],features:[o.Ab([jt])],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(e,t){if(1&e&&(o.Tb(0,"section",0),o.Tb(1,"div",1),o.Fc(2,Tr,2,0,"button",2),o.Sb(),o.Fc(3,wr,10,7,"ng-container",3),o.fc(4,"async"),o.Fc(5,Mr,3,3,"ng-template",null,4,o.Gc),o.Sb(),o.Tb(7,"div",5),o.Tb(8,"datatable-header",6),o.Fc(9,Dr,6,4,"ng-container",7),o.Sb(),o.Tb(10,"table",8),o.Tb(11,"thead"),o.Tb(12,"tr"),o.Ob(13,"th",9),o.Tb(14,"th",10),o.Hc(15,"User"),o.Sb(),o.Tb(16,"th",11),o.Hc(17,"First Name"),o.Sb(),o.Tb(18,"th",11),o.Hc(19,"Last Name"),o.Sb(),o.Tb(20,"th",12),o.Hc(21,"Assigned At"),o.Sb(),o.Sb(),o.Sb(),o.Tb(22,"tbody"),o.Fc(23,Br,11,7,"tr",13),o.fc(24,"async"),o.Sb(),o.Sb(),o.Fc(25,Ar,4,2,"ng-container",3),o.fc(26,"async"),o.Fc(27,Rr,3,0,"ng-template",null,14,o.Gc),o.Ob(29,"datatable-footer"),o.Sb()),2&e){const e=o.sc(6),n=o.sc(28);o.Bb(2),o.kc("ngIf",t.currentUser.hasPermission("roles.create")),o.Bb(1),o.kc("ngIf",o.gc(4,8,t.breakpoints.isMobile$))("ngIfElse",e),o.Bb(5),o.kc("showSelectedActions",!1),o.Bb(1),o.kc("ngIf",t.currentUser.hasPermission("roles.update")),o.Bb(14),o.kc("ngForOf",o.gc(24,10,t.users$)),o.Bb(2),o.kc("ngIf",o.gc(26,12,t.selectedRole$))("ngIfElse",n)}},directives:[i.t,bn,hn,vn,vt.a,i.s,yn,u.b,C.c,P.a,C.d,C.a,Tn,Rn,Cn.a],pipes:[i.b,wn.a],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}),e})();var Er=n("PPuo");function Vr(e,t){1&e&&(o.Tb(0,"span",6),o.Hc(1,"Update Localization"),o.Sb())}function $r(e,t){1&e&&(o.Tb(0,"span",6),o.Hc(1,"Create Localization"),o.Sb())}function Lr(e,t){if(1&e&&(o.Tb(0,"div",18),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.name)}}function zr(e,t){if(1&e&&(o.Tb(0,"option",19),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("value",e.code),o.Bb(1),o.Ic(e.name)}}function jr(e,t){1&e&&(o.Tb(0,"span",6),o.Hc(1,"Update"),o.Sb())}function Ur(e,t){1&e&&(o.Tb(0,"span",6),o.Hc(1,"Create"),o.Sb())}function qr(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",7),o.ac("ngSubmit",(function(){return o.vc(e),o.ec().confirm()})),o.Tb(1,"mat-dialog-content",8),o.Tb(2,"div",9),o.Tb(3,"label",10),o.Hc(4,"Name"),o.Sb(),o.Ob(5,"input",11),o.Fc(6,Lr,2,1,"div",12),o.Sb(),o.Tb(7,"div",9),o.Tb(8,"label",13),o.Hc(9,"Language"),o.Sb(),o.Tb(10,"select",14),o.Fc(11,zr,2,2,"option",15),o.fc(12,"async"),o.Sb(),o.Sb(),o.Sb(),o.Tb(13,"mat-dialog-actions"),o.Tb(14,"button",16),o.ac("click",(function(){return o.vc(e),o.ec().close()})),o.Hc(15,"Cancel"),o.Sb(),o.Tb(16,"button",17),o.fc(17,"async"),o.Fc(18,jr,2,0,"span",2),o.Fc(19,Ur,2,0,"span",2),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.kc("formGroup",n.form),o.Bb(6),o.kc("ngIf",e.name),o.Bb(5),o.kc("ngForOf",o.gc(12,6,n.languages$)),o.Bb(5),o.kc("disabled",o.gc(17,8,n.loading$)),o.Bb(2),o.kc("ngIf",n.data.localization),o.Bb(1),o.kc("ngIf",!n.data.localization)}}let Gr=(()=>{class e{constructor(e,t,n,i,a,s){this.fb=e,this.localizations=t,this.dialogRef=n,this.data=i,this.toast=a,this.lists=s,this.loading$=new ht.a(!1),this.errors$=new ht.a({}),this.languages$=new ht.a([]),this.form=this.fb.group({name:[""],language:[""]})}ngOnInit(){this.lists.get(["languages"]).subscribe(e=>{this.languages$.next(e.languages)}),this.data.localization&&this.form.patchValue(this.data.localization.model)}confirm(){this.loading$.next(!0),(this.data.localization?this.updateLocalization():this.createNewLocalization()).pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(e=>{this.close(e.localization),this.toast.open("Localization "+(this.data.localization?"updated":"created"))},e=>this.errors$.next(e.errors))}close(e){this.dialogRef.close(e)}createNewLocalization(){return this.localizations.create(this.form.value)}updateLocalization(){return this.localizations.update(this.data.localization.model.id,this.form.value)}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(a.h),o.Nb(Er.a),o.Nb(g.h),o.Nb(g.a),o.Nb(mt.b),o.Nb(qn.a))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"h2",1),o.Fc(2,Vr,2,0,"span",2),o.Fc(3,$r,2,0,"span",2),o.Sb(),o.Tb(4,"button",3),o.ac("click",(function(){return t.close()})),o.Ob(5,"mat-icon",4),o.Sb(),o.Sb(),o.Fc(6,qr,20,10,"form",5),o.fc(7,"async")),2&e&&(o.Bb(2),o.kc("ngIf",t.data.localization),o.Bb(1),o.kc("ngIf",!t.data.localization),o.Bb(3),o.kc("ngIf",o.gc(7,3,t.errors$)))},directives:[g.i,i.t,P.a,vt.a,a.v,a.m,g.f,a.d,a.u,a.k,a.B,a.F,a.G,i.s,g.c,u.b,a.z,a.J],pipes:[i.b],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}"],changeDetection:0}),e})(),Yr=(()=>{class e{constructor(e){this.dialogRef=e,this.form=new a.l({key:new a.i,value:new a.i})}confirm(){this.close(this.form.value)}close(e){this.dialogRef.close(e)}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(g.h))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"h2",1),o.Hc(2,"Add New Translation Line"),o.Sb(),o.Tb(3,"button",2),o.ac("click",(function(){return t.close()})),o.Ob(4,"mat-icon",3),o.Sb(),o.Sb(),o.Tb(5,"form",4),o.ac("ngSubmit",(function(){return t.confirm()})),o.Tb(6,"mat-dialog-content",5),o.Tb(7,"div",6),o.Tb(8,"label",7),o.Hc(9,"Translation Key"),o.Sb(),o.Ob(10,"input",8),o.Tb(11,"p",9),o.Hc(12,"Word or sentence you want to translate."),o.Sb(),o.Sb(),o.Tb(13,"div",6),o.Tb(14,"label",10),o.Hc(15,"Translation Value"),o.Sb(),o.Ob(16,"input",11),o.Tb(17,"p",9),o.Hc(18,"What word or sentence should be translated to."),o.Sb(),o.Sb(),o.Sb(),o.Tb(19,"mat-dialog-actions"),o.Tb(20,"button",12),o.ac("click",(function(){return t.close()})),o.Hc(21,"Cancel"),o.Sb(),o.Tb(22,"button",13),o.Hc(23,"Add"),o.Sb(),o.Sb(),o.Sb()),2&e&&(o.Bb(5),o.kc("formGroup",t.form))},directives:[g.i,vt.a,P.a,a.v,a.m,g.f,a.d,a.u,a.k,a.F,g.c,u.b],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}"],changeDetection:0}),e})();var Xr=n("VaLf"),Qr=n("JxJJ");function Jr(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",18),o.ac("click",(function(){return o.vc(e),o.ec().showCrupdateLocalizationModal()})),o.Ob(1,"mat-icon",19),o.Tb(2,"span",15),o.Hc(3,"New Localization"),o.Sb(),o.Sb()}}function Kr(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",26),o.ac("click",(function(){o.vc(e);const n=t.$implicit;return o.ec(2).setSelectedLocalization(n)})),o.Hc(1),o.Sb()}if(2&e){const e=t.$implicit,n=o.ec(2);o.Fb("selected",(null==n.selectedLocalization?null:n.selectedLocalization.model.id)==e.model.id),o.Bb(1),o.Ic(e.model.name)}}function Wr(e,t){if(1&e&&(o.Rb(0),o.Tb(1,"button",20),o.Tb(2,"span",21),o.Hc(3),o.Sb(),o.Ob(4,"mat-icon",22),o.Sb(),o.Tb(5,"mat-menu",23,24),o.Fc(7,Kr,2,3,"button",25),o.fc(8,"async"),o.Sb(),o.Qb()),2&e){const e=o.sc(6),t=o.ec();o.Bb(1),o.kc("matMenuTriggerFor",e),o.Bb(2),o.Ic(null==t.selectedLocalization?null:t.selectedLocalization.model.name),o.Bb(4),o.kc("ngForOf",o.gc(8,3,t.localizations$))}}function Zr(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",35),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec(2).setDefaultLocalization(t)})),o.Hc(1,"Set as Default"),o.Sb()}}function ec(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",35),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec(2).showCrupdateLocalizationModal(t)})),o.Hc(1,"Update"),o.Sb()}}function tc(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",35),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec(2).confirmLocalizationDeletion(t)})),o.Hc(1,"Delete"),o.Sb()}}function nc(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",28),o.ac("click",(function(){o.vc(e);const n=t.$implicit;return o.ec(2).setSelectedLocalization(n)})),o.Tb(1,"div",29),o.Hc(2),o.Sb(),o.Tb(3,"div",30),o.Tb(4,"button",31),o.ac("click",(function(t){return o.vc(e),t.stopPropagation()})),o.Ob(5,"mat-icon",32),o.Sb(),o.Tb(6,"mat-menu",null,33),o.Fc(8,Zr,2,0,"div",34),o.Fc(9,ec,2,0,"div",34),o.Fc(10,tc,2,0,"div",34),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=t.$implicit,n=o.sc(7),i=o.ec(2);o.Fb("selected",(null==i.selectedLocalization?null:i.selectedLocalization.model.id)==e.model.id),o.kc("@fadeIn",void 0),o.Bb(2),o.Ic(e.model.name.replace("-"," ")),o.Bb(2),o.kc("matMenuTriggerFor",n),o.Bb(4),o.kc("ngIf",i.currentUser.hasPermission("settings.update")),o.Bb(1),o.kc("ngIf","English"!==e.name&&i.currentUser.hasPermission("localizations.update")),o.Bb(1),o.kc("ngIf","English"!==e.name&&i.currentUser.hasPermission("localizations.delete"))}}function ic(e,t){1&e&&(o.Tb(0,"div",37),o.Ob(1,"skeleton",38),o.Sb())}const ac=function(){return[1,2,3,4,5]};function sc(e,t){1&e&&(o.Tb(0,"div"),o.Fc(1,ic,2,0,"div",36),o.Sb()),2&e&&(o.Bb(1),o.kc("ngForOf",o.nc(1,ac)))}function oc(e,t){if(1&e&&(o.Fc(0,nc,11,8,"div",27),o.fc(1,"async"),o.Fc(2,sc,2,2,"div",16),o.fc(3,"async")),2&e){const e=o.ec();o.kc("ngForOf",o.gc(1,3,e.localizations$))("ngForTrackBy",e.trackByFn),o.Bb(2),o.kc("ngIf",o.gc(3,5,!e.selectedLocalization&&e.loading$))}}function rc(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",39),o.ac("click",(function(){return o.vc(e),o.ec().updateLocalization()})),o.fc(1,"async"),o.Hc(2,"Update"),o.Sb()}if(2&e){const e=o.ec();o.kc("disabled",o.gc(1,1,e.loading$))}}function cc(e,t){1&e&&(o.Tb(0,"tr"),o.Tb(1,"td"),o.Ob(2,"skeleton",40),o.Sb(),o.Tb(3,"td"),o.Ob(4,"skeleton",40),o.Sb(),o.Sb())}const lc=function(){return[1,2,3,4,5,6,7,8,9,10]};function dc(e,t){1&e&&(o.Rb(0),o.Fc(1,cc,5,0,"tr",17),o.Qb()),2&e&&(o.Bb(1),o.kc("ngForOf",o.nc(1,lc)))}function bc(e,t){if(1&e){const e=o.Ub();o.Tb(0,"tr"),o.Tb(1,"td",41),o.Hc(2),o.Sb(),o.Tb(3,"td",42),o.Tb(4,"input",43),o.ac("ngModelChange",(function(n){o.vc(e);const i=t.$implicit;return o.ec().selectedLocalization.lines[i.key]=n})),o.Sb(),o.Sb(),o.Tb(5,"td",44),o.Tb(6,"button",45),o.ac("click",(function(){o.vc(e);const n=t.$implicit;return o.ec().removeLine(n)})),o.fc(7,"trans"),o.Ob(8,"mat-icon",46),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=t.$implicit,n=o.ec();o.kc("@fadeIn",void 0),o.Bb(2),o.Ic(e.key),o.Bb(2),o.lc("id",e.key),o.kc("ngModel",n.selectedLocalization.lines[e.key]),o.Bb(2),o.kc("matTooltip",o.gc(7,5,"Remove"))}}let uc=(()=>{class e{constructor(e,t,n,i,s,o,r,c){this.toast=e,this.modal=t,this.settings=n,this.i18n=i,this.route=s,this.currentUser=o,this.localizationsApi=r,this.breakpoints=c,this.loading$=new ht.a(!1),this.loadingLines$=new ht.a(!1),this.searchQuery=new a.i,this.localizations$=new ht.a([]),this.lines$=new ht.a([]),this.trackByFn=(e,t)=>t.model.id}ngOnInit(){this.loading$.next(!0),this.localizationsApi.all().pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(e=>{this.setLocalizations(e.localizations),this.bindSearchQuery()})}setLocalizations(e){this.localizations$.next(e);const t=e.find(e=>e.model.language===this.settings.get("i18n.default_localization"))||e[0];t&&this.setSelectedLocalization(t)}setSelectedLocalization(e){var t;(null===(t=this.selectedLocalization)||void 0===t?void 0:t.model.id)!==e.model.id&&(this.selectedLocalization=e,this.searchQuery.setValue(null),e.lines?this.lines$.next(this.originalLines()):(this.selectedLocalization.lines={},this.loadingLines$.next(!0),this.localizationsApi.get(this.selectedLocalization.model.name).pipe(Object(pt.a)(()=>this.loadingLines$.next(!1))).subscribe(t=>{this.selectedLocalization=t.localization;const n=[...this.localizations$.value],i=n.findIndex(t=>t.model.id===e.model.id);n[i]=t.localization,this.localizations$.next(n),this.lines$.next(this.originalLines())})))}addLine(){this.modal.open(Yr).beforeClosed().subscribe(e=>{e&&(this.selectedLocalization.lines[e.key]=e.value,this.lines$.next(this.originalLines()))})}setDefaultLocalization(e){this.selectedLocalization.model.id||this.setSelectedLocalization(e),this.localizationsApi.setDefault(e.model).subscribe(()=>{this.toast.open("Default Localization Changed")},()=>{this.toast.open(As.a.Default)})}updateLocalization(){this.loading$.next(!0),this.localizationsApi.update(this.selectedLocalization.model.id,this.selectedLocalization).pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Localizations updated"),this.selectedLocalization.model.id===this.i18n.getActive().model.id&&this.i18n.setLocalization(this.selectedLocalization)})}showCrupdateLocalizationModal(e){this.modal.show(Gr,{localization:e}).afterClosed().subscribe(t=>{if(!t)return;let n=[...this.localizations$.value];e?n=n.map(e=>e.model.id===t.model.id?t:e):(n.push(t),this.setSelectedLocalization(t)),this.localizations$.next(n)})}confirmLocalizationDeletion(e){this.localizations$.value.length<2?this.toast.open("There must be at least one localization."):this.modal.open(Nt.a,{title:"Delete Localization",body:"Are you sure you want to delete this localization?",ok:"Delete"}).afterClosed().subscribe(t=>{t&&this.deleteLocalization(e)})}deleteLocalization(e){this.localizationsApi.delete(e.model.id).subscribe(()=>{this.toast.open("Localization deleted");const t=[...this.localizations$.value];t.splice(t.indexOf(e),1),this.localizations$.next(t),this.selectedLocalization.model.id===e.model.id&&this.setSelectedLocalization(t[0])})}bindSearchQuery(){this.searchQuery.valueChanges.pipe(Object(Jt.a)()).subscribe(e=>{const t=this.originalLines();this.lines$.next(e?t.filter(t=>this.filterPredicate(t,e)):t)})}filterPredicate(e,t){const n=Object.keys(e).reduce((t,n)=>t+e[n]+"\u25ec","").toLowerCase(),i=t.trim().toLowerCase();return-1!=n.indexOf(i)}linesToArray(e){const t=[];for(const n in e)t.push({key:n,translation:e[n]});return t}originalLines(){return this.selectedLocalization.lines?this.linesToArray(this.selectedLocalization.lines):[]}removeLine(e){delete this.selectedLocalization.lines[e.key],this.lines$.next(this.originalLines())}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(mt.b),o.Nb(Lt.a),o.Nb(at.a),o.Nb(Xr.a),o.Nb(c.a),o.Nb(st.a),o.Nb(Er.a),o.Nb(ot.a))},e.\u0275cmp=o.Hb({type:e,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(e,t){if(1&e&&(o.Tb(0,"aside",0),o.Tb(1,"div",1),o.Fc(2,Jr,4,0,"button",2),o.Sb(),o.Fc(3,Wr,9,5,"ng-container",3),o.fc(4,"async"),o.Fc(5,oc,4,7,"ng-template",null,4,o.Gc),o.Tb(7,"div",5),o.Fc(8,rc,3,3,"button",6),o.Sb(),o.Sb(),o.Tb(9,"div",7),o.Tb(10,"div",8),o.Tb(11,"button",9),o.ac("click",(function(){return t.addLine()})),o.Hc(12,"Add New Translation"),o.Sb(),o.Tb(13,"div",10),o.Ob(14,"input",11),o.Ob(15,"mat-icon",12),o.Sb(),o.Sb(),o.Tb(16,"table",13),o.Tb(17,"thead"),o.Tb(18,"tr"),o.Tb(19,"th",14),o.Hc(20,"Source Text"),o.Sb(),o.Tb(21,"th",15),o.Hc(22,"Translation"),o.Sb(),o.Ob(23,"th"),o.Sb(),o.Sb(),o.Tb(24,"tbody"),o.Fc(25,dc,2,2,"ng-container",16),o.fc(26,"async"),o.Fc(27,bc,9,7,"tr",17),o.fc(28,"async"),o.Sb(),o.Sb(),o.Sb()),2&e){const e=o.sc(6);o.Bb(2),o.kc("ngIf",t.currentUser.hasPermission("localizations.create")),o.Bb(1),o.kc("ngIf",o.gc(4,7,t.breakpoints.isMobile$))("ngIfElse",e),o.Bb(5),o.kc("ngIf",t.currentUser.hasPermission("localizations.update")),o.Bb(6),o.kc("formControl",t.searchQuery),o.Bb(11),o.kc("ngIf",o.gc(26,9,t.loadingLines$)),o.Bb(2),o.kc("ngForOf",o.gc(28,11,t.lines$))}},directives:[i.t,u.b,vt.a,a.d,a.u,a.j,P.a,i.s,C.c,C.d,C.a,Qr.a,a.x,I.a],pipes:[i.b,lt.a],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:[Object(Q.m)("fadeIn",[Object(Q.l)(":enter",[Object(Q.k)({opacity:0}),Object(Q.e)("325ms ease-in",Object(Q.k)({opacity:1}))])])]},changeDetection:0}),e})();var hc=n("MNfM");let pc=(()=>{class e{constructor(e,t){this.fb=e,this.datable=t,this.form=this.fb.group({type:null,public:null,password:null,created_at:null,owner:null}),this.form.patchValue(this.datable.filters$.value)}ngOnInit(){this.form.valueChanges.subscribe(e=>{this.datable.filters$.next(e)})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(a.h),o.Nb(jt))},e.\u0275cmp=o.Hb({type:e,selectors:[["file-entry-index-filters"]],decls:46,vars:10,consts:[[1,"many-inputs",3,"formGroup"],[1,"input-container"],["for","file-type-filter","trans",""],["id","file-type-filter","formControlName","type"],["trans","",3,"ngValue"],["value","text","trans",""],["value","audio","trans",""],["value","video","trans",""],["value","image","trans",""],["value","Folder","trans",""],["value","pdf","trans",""],["value","archive","trans",""],["for","file-status-filter","trans",""],["id","file-status-filter","formControlName","public"],["for","file-password-filter","trans",""],["id","file-password-filter","formControlName","password"],["formControlName","created_at",3,"setDefaultDate","showLabels"],["formControlName","owner"]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Tb(2,"label",2),o.Hc(3,"Type"),o.Sb(),o.Tb(4,"select",3),o.Tb(5,"option",4),o.Hc(6,"All"),o.Sb(),o.Tb(7,"option",5),o.Hc(8,"Text"),o.Sb(),o.Tb(9,"option",6),o.Hc(10,"Audio"),o.Sb(),o.Tb(11,"option",7),o.Hc(12,"Video"),o.Sb(),o.Tb(13,"option",8),o.Hc(14,"Image"),o.Sb(),o.Tb(15,"option",9),o.Hc(16,"Folder"),o.Sb(),o.Tb(17,"option",10),o.Hc(18,"PDF"),o.Sb(),o.Tb(19,"option",11),o.Hc(20,"Archive"),o.Sb(),o.Sb(),o.Sb(),o.Tb(21,"div",1),o.Tb(22,"label",12),o.Hc(23,"Status"),o.Sb(),o.Tb(24,"select",13),o.Tb(25,"option",4),o.Hc(26,"All"),o.Sb(),o.Tb(27,"option",4),o.Hc(28,"Public"),o.Sb(),o.Tb(29,"option",4),o.Hc(30,"Private"),o.Sb(),o.Sb(),o.Sb(),o.Tb(31,"div",1),o.Tb(32,"label",14),o.Hc(33,"Protection"),o.Sb(),o.Tb(34,"select",15),o.Tb(35,"option",4),o.Hc(36,"All"),o.Sb(),o.Tb(37,"option",4),o.Hc(38,"Has Password"),o.Sb(),o.Tb(39,"option",4),o.Hc(40,"Does Not Have Password"),o.Sb(),o.Sb(),o.Sb(),o.Tb(41,"div",1),o.Tb(42,"between-input",16),o.Hc(43,"Uploaded Between"),o.Sb(),o.Sb(),o.Tb(44,"div",1),o.Ob(45,"select-user-input",17),o.Sb(),o.Sb()),2&e&&(o.kc("formGroup",t.form),o.Bb(5),o.kc("ngValue",null),o.Bb(20),o.kc("ngValue",null),o.Bb(2),o.kc("ngValue",!0),o.Bb(2),o.kc("ngValue",!1),o.Bb(6),o.kc("ngValue",null),o.Bb(2),o.kc("ngValue",!0),o.Bb(2),o.kc("ngValue",!1),o.Bb(3),o.kc("setDefaultDate",!1)("showLabels",!1))},directives:[a.v,a.m,vt.a,a.G,a.u,a.k,a.z,a.J,Jo,hc.a],styles:[""],changeDetection:0}),e})();var gc=n("6SKC");function mc(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",13),o.ac("click",(function(){return o.vc(e),o.ec().maybeDeleteSelectedEntries()})),o.fc(1,"trans"),o.Hc(2,"Delete Selected"),o.Sb()}2&e&&o.kc("matTooltip",o.gc(1,1,"Delete selected"))}function fc(e,t){1&e&&o.Ob(0,"file-entry-index-filters")}function vc(e,t){if(1&e&&(o.Tb(0,"tr"),o.Ob(1,"td",14),o.Tb(2,"td",15),o.Hc(3),o.Sb(),o.Tb(4,"td",16),o.Hc(5),o.Sb(),o.Tb(6,"td"),o.Ob(7,"user-column",17),o.Sb(),o.Tb(8,"td",18),o.Hc(9),o.Sb(),o.Tb(10,"td",19),o.Hc(11),o.Sb(),o.Tb(12,"td",20),o.Hc(13),o.fc(14,"formattedFileSize"),o.Sb(),o.Tb(15,"td"),o.Hc(16),o.fc(17,"formattedDate"),o.Sb(),o.Sb()),2&e){const e=t.$implicit;o.Bb(1),o.kc("table-body-checkbox",e.id),o.Bb(2),o.Ic(e.name),o.Bb(2),o.Ic(e.file_name),o.Bb(2),o.kc("user",e.users[0]),o.Bb(2),o.Ic(e.type),o.Bb(2),o.Ic(e.public?"Yes":"No"),o.Bb(2),o.Jc(" ",e.file_size?o.gc(14,8,e.file_size):"-"," "),o.Bb(3),o.Ic(o.gc(17,10,e.created_at))}}function _c(e,t){1&e&&(o.Tb(0,"no-results-message",21),o.Tb(1,"span",22),o.Hc(2,"No files have been created yet"),o.Sb(),o.Sb())}let Sc=(()=>{class e{constructor(e,t,n,i){this.currentUser=e,this.settings=t,this.uploads=n,this.datatable=i,this.files$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:js.a.BASE_URI})}maybeDeleteSelectedEntries(){this.datatable.confirmResourceDeletion("files").subscribe(()=>{this.uploads.delete({entryIds:this.datatable.selectedRows$.value,deleteForever:!0}).subscribe(()=>{this.datatable.reset()})})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(st.a),o.Nb(at.a),o.Nb(js.a),o.Nb(jt))},e.\u0275cmp=o.Hb({type:e,selectors:[["file-entry-index"]],features:[o.Ab([jt])],decls:33,vars:7,consts:[[1,"datatable","responsive-table"],["pluralResourceName","files"],["leftContent",""],["headerActions","","trans","",1,"title"],["mat-raised-button","","color","accent","rightContent","","trans","",3,"matTooltip","click",4,"ngIf"],["tableFilters",""],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","user_id","trans",""],["table-sort-header","created_at","trans",""],[4,"ngFor","ngForOf"],["svgImage","file-searching.svg",4,"ngIf"],["mat-raised-button","","color","accent","rightContent","","trans","",3,"matTooltip","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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"datatable-header",1),o.Rb(2,2),o.Tb(3,"div",3),o.Hc(4,"File Entries"),o.Sb(),o.Qb(),o.Fc(5,mc,3,3,"button",4),o.Fc(6,fc,1,0,"ng-template",null,5,o.Gc),o.Sb(),o.Tb(8,"table",6),o.Tb(9,"thead"),o.Tb(10,"tr"),o.Ob(11,"th",7),o.Tb(12,"th",8),o.Hc(13,"Name"),o.Sb(),o.Tb(14,"th",8),o.Hc(15,"File Name"),o.Sb(),o.Tb(16,"th",9),o.Hc(17,"Owner"),o.Sb(),o.Tb(18,"th",8),o.Hc(19,"Type"),o.Sb(),o.Tb(20,"th",8),o.Hc(21,"Public"),o.Sb(),o.Tb(22,"th",8),o.Hc(23,"File Size"),o.Sb(),o.Tb(24,"th",10),o.Hc(25,"Uploaded At"),o.Sb(),o.Ob(26,"th"),o.Sb(),o.Sb(),o.Tb(27,"tbody"),o.Fc(28,vc,18,12,"tr",11),o.fc(29,"async"),o.Sb(),o.Sb(),o.Fc(30,_c,3,0,"no-results-message",12),o.fc(31,"async"),o.Ob(32,"datatable-footer"),o.Sb()),2&e&&(o.Bb(5),o.kc("ngIf",t.currentUser.hasPermission("files.delete")),o.Bb(23),o.kc("ngForOf",o.gc(29,3,t.files$)),o.Bb(2),o.kc("ngIf",o.gc(31,5,t.datatable.paginator.noResults$)))},directives:[bn,vt.a,i.t,hn,vn,i.s,yn,u.b,I.a,pc,Tn,Rn,Cn.a],pipes:[i.b,lt.a,gc.a,wn.a],styles:[".title[_ngcontent-%COMP%]{font-size:1.8rem;color:var(--be-secondary-text);margin-left:15px}"],changeDetection:0}),e})(),yc=(()=>{class e{constructor(e,t){this.data=e,this.overlayPanelRef=t}close(){this.overlayPanelRef.close()}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(qt.a,8),o.Nb(Gt.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["image-zoom-overlay"]],hostVars:1,hostBindings:function(e,t){2&e&&o.Ec("@dialogContainer","enter")},decls:3,vars:2,consts:[[3,"src","alt"],["mat-mini-fab","","color","accent",1,"close-button",3,"click"],["svgIcon","close"]],template:function(e,t){1&e&&(o.Ob(0,"img",0),o.Tb(1,"button",1),o.ac("click",(function(){return t.close()})),o.Ob(2,"mat-icon",2),o.Sb()),2&e&&o.kc("src",t.data.src,o.xc)("alt",t.data.alt)},directives:[u.b,P.a],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:[g.j.dialogContainer]},changeDetection:0}),e})(),kc=(()=>{class e{constructor(e){this.overlay=e}zoomImage(){this.overlay.open(yc,{position:"center",origin:"global",data:{src:this.src,alt:this.alt},panelClass:"image-zoom-overlay-container"})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(Qt.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["image-zoom"]],inputs:{src:"src",alt:"alt"},decls:1,vars:2,consts:[[3,"src","alt","click"]],template:function(e,t){1&e&&(o.Tb(0,"img",0),o.ac("click",(function(){return t.zoomImage()})),o.Sb()),2&e&&o.kc("src",t.src,o.xc)("alt",t.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}),e})();function Tc(e,t){if(1&e&&(o.Tb(0,"div",8),o.Tb(1,"div",9),o.Tb(2,"label",10),o.Hc(3),o.Sb(),o.Ob(4,"textarea",11),o.Sb(),o.Ob(5,"image-zoom",12),o.Sb()),2&e){const e=t.$implicit,n=o.ec();o.Bb(2),o.kc("for",e.slot),o.Bb(1),o.Ic(e.description),o.Bb(1),o.kc("name",e.slot)("id",e.slot)("formControlName",e.slot),o.Bb(1),o.kc("src",n.getPreviewUrl(e))}}function Cc(e,t){1&e&&o.Ob(0,"mat-progress-bar",13)}let wc=(()=>{class e{constructor(e,t,n){this.settings=e,this.toast=t,this.fb=n,this.loading$=new ht.a(!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(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Ads updated")},()=>{this.toast.open(As.a.Default)})}allAds(){return this.settings.get("vebto.admin.ads",[])}getPreviewUrl(e){return`client/assets/images/verts/${e.slot.replace(/\./g,"-").replace("ads-","")}.png`}hydrate(){const e=this.settings.getFlat()||{};this.form.patchValue({"ads.disable":e["ads.disable"]}),this.allAds().forEach(t=>{this.form.addControl(t.slot,this.fb.control(e[t.slot]))})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(at.a),o.Nb(mt.b),o.Nb(a.h))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"form",0),o.ac("ngSubmit",(function(){return t.saveAds()})),o.Tb(1,"div",1),o.Hc(2,"Predefined AD Slots"),o.Sb(),o.Fc(3,Tc,6,6,"div",2),o.Tb(4,"div",3),o.Tb(5,"mat-slide-toggle",4),o.Hc(6,"Disable Ads"),o.Sb(),o.Tb(7,"p",5),o.Hc(8,"Disable all ad related functionality."),o.Sb(),o.Sb(),o.Tb(9,"button",6),o.fc(10,"async"),o.Hc(11,"Save"),o.Sb(),o.Fc(12,Cc,1,0,"mat-progress-bar",7),o.fc(13,"async"),o.Sb()),2&e&&(o.kc("formGroup",t.form),o.Bb(3),o.kc("ngForOf",t.allAds()),o.Bb(6),o.kc("disabled",o.gc(10,4,t.loading$)),o.Bb(3),o.kc("ngIf",o.gc(13,6,t.loading$)))},directives:[a.v,a.m,vt.a,i.s,w.a,a.u,a.k,u.b,i.t,a.d,kc,s.a],pipes:[i.b],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}),e})();var xc=n("Y7pB");function Ic(e,t){1&e&&(o.Tb(0,"h2",6),o.Hc(1,"Update Plan Details"),o.Sb())}function Oc(e,t){1&e&&(o.Tb(0,"h2",6),o.Hc(1,"Create a New Plan"),o.Sb())}function Mc(e,t){if(1&e&&(o.Tb(0,"div",23),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.name)}}function Dc(e,t){if(1&e&&(o.Tb(0,"option",24),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("ngValue",e.id),o.Bb(1),o.Ic(e.name)}}function Bc(e,t){if(1&e&&(o.Tb(0,"div",23),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.parent_id)}}function Hc(e,t){1&e&&(o.Rb(0),o.Tb(1,"p",17),o.Hc(2,"How much subscribers of this plan should be charged. (Dollars, euros etc.)"),o.Sb(),o.Tb(3,"p",17),o.Hc(4,"For example, Amount=100, Interval=Year and Interval Count=1, will charge user 100 dollars every year."),o.Sb(),o.Qb())}function Pc(e,t){1&e&&(o.Tb(0,"p",17),o.Hc(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.Sb())}function Fc(e,t){if(1&e&&(o.Tb(0,"div",23),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(e.amount)}}function Ac(e,t){if(1&e&&(o.Tb(0,"option",24),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("ngValue",e.code),o.Bb(1),o.Kc("",e.code," - ",e.name,"")}}function Rc(e,t){if(1&e&&(o.Tb(0,"div",23),o.Hc(1),o.Sb()),2&e){const e=o.ec(3).ngIf;o.Bb(1),o.Ic(e.currency)}}function Nc(e,t){if(1&e&&(o.Tb(0,"div",9),o.Tb(1,"label",30),o.Hc(2,"Currency"),o.Sb(),o.Tb(3,"select",31),o.Fc(4,Ac,2,3,"option",16),o.fc(5,"async"),o.Sb(),o.Fc(6,Rc,2,1,"div",12),o.Sb()),2&e){const e=o.ec(2).ngIf,t=o.ec();o.Bb(4),o.kc("ngForOf",o.gc(5,2,t.currencies$)),o.Bb(2),o.kc("ngIf",e.currency)}}function Ec(e,t){if(1&e&&(o.Tb(0,"option",24),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("ngValue",e),o.Bb(1),o.Ic(e)}}function Vc(e,t){if(1&e&&(o.Tb(0,"div",23),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(e.interval)}}function $c(e,t){if(1&e&&(o.Tb(0,"div",23),o.Hc(1),o.Sb()),2&e){const e=o.ec(3).ngIf;o.Bb(1),o.Ic(e.interval_count)}}function Lc(e,t){if(1&e&&(o.Tb(0,"div",9),o.Tb(1,"label",32),o.Hc(2,"Interval Count"),o.Sb(),o.Ob(3,"input",33),o.Tb(4,"p",17),o.Hc(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.Sb(),o.Fc(6,$c,2,1,"div",12),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(6),o.kc("ngIf",e.interval_count)}}function zc(e,t){if(1&e&&(o.Rb(0),o.Tb(1,"div",9),o.Tb(2,"label",25),o.Hc(3,"Amount"),o.Sb(),o.Ob(4,"input",26),o.Fc(5,Hc,5,0,"ng-container",18),o.Fc(6,Pc,2,0,"p",22),o.Fc(7,Fc,2,1,"div",12),o.Sb(),o.Fc(8,Nc,7,4,"div",27),o.Tb(9,"div",9),o.Tb(10,"label",28),o.Hc(11,"Interval"),o.Sb(),o.Tb(12,"select",29),o.Fc(13,Ec,2,2,"option",16),o.Sb(),o.Tb(14,"p",17),o.Hc(15,"The frequency with which a subscription should be billed."),o.Sb(),o.Fc(16,Vc,2,1,"div",12),o.Sb(),o.Fc(17,Lc,7,1,"div",27),o.Qb()),2&e){const e=o.ec().ngIf,t=o.ec();o.Bb(4),o.kc("min",t.getMinAmount())("max",t.getMaxAmount()),o.Bb(1),o.kc("ngIf",!t.data.plan),o.Bb(1),o.kc("ngIf",t.data.plan),o.Bb(1),o.kc("ngIf",e.amount),o.Bb(1),o.kc("ngIf",!t.formValue().parent_id),o.Bb(5),o.kc("ngForOf",t.intervals),o.Bb(3),o.kc("ngIf",e.interval),o.Bb(1),o.kc("ngIf","year"!==t.formValue().interval)}}function jc(e,t){if(1&e&&(o.Tb(0,"div",23),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(e.position)}}function Uc(e,t){1&e&&(o.Tb(0,"div",36),o.Tb(1,"mat-slide-toggle",53),o.Hc(2,"Free"),o.Sb(),o.Tb(3,"p",17),o.Hc(4,"Basic free plan that will be assigned to new users that have not upgraded to other plans."),o.Sb(),o.Sb())}function qc(e,t){if(1&e&&(o.Tb(0,"div",23),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(null==e?null:e.permissions)}}function Gc(e,t){if(1&e){const e=o.Ub();o.Tb(0,"li",54),o.Tb(1,"button",55),o.Ob(2,"mat-icon",56),o.Sb(),o.Tb(3,"div",57),o.Hc(4),o.Sb(),o.Tb(5,"button",58),o.ac("click",(function(){o.vc(e);const n=t.$implicit;return o.ec(3).removeFeature(n)})),o.Ob(6,"mat-icon",59),o.Sb(),o.Sb()}if(2&e){const e=t.$implicit;o.Cb("data-id",e.id),o.Bb(4),o.Ic(e.content)}}function Yc(e,t){1&e&&(o.Tb(0,"p",17),o.Hc(1,"No custom features yet."),o.Sb())}function Xc(e,t){if(1&e&&(o.Tb(0,"div",23),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(e.available_space)}}function Qc(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",9),o.Tb(2,"label",34),o.Hc(3,"Position"),o.Sb(),o.Tb(4,"select",35),o.Tb(5,"option",24),o.Hc(6,"1"),o.Sb(),o.Tb(7,"option",24),o.Hc(8,"2"),o.Sb(),o.Tb(9,"option",24),o.Hc(10,"3"),o.Sb(),o.Tb(11,"option",24),o.Hc(12,"4"),o.Sb(),o.Tb(13,"option",24),o.Hc(14,"5"),o.Sb(),o.Tb(15,"option",24),o.Hc(16,"6"),o.Sb(),o.Tb(17,"option",24),o.Hc(18,"7"),o.Sb(),o.Tb(19,"option",24),o.Hc(20,"8"),o.Sb(),o.Sb(),o.Tb(21,"p",17),o.Hc(22,"Order of plans. Lower position will appear first."),o.Sb(),o.Fc(23,jc,2,1,"div",12),o.Sb(),o.Tb(24,"div",36),o.Tb(25,"mat-slide-toggle",37),o.Hc(26,"Recommended"),o.Sb(),o.Tb(27,"p",17),o.Hc(28,'Plan will be marked as "Most Popular" and emphasized to users.'),o.Sb(),o.Sb(),o.Fc(29,Uc,5,0,"div",38),o.Tb(30,"div",36),o.Tb(31,"mat-slide-toggle",39),o.Hc(32,"Show Permissions"),o.Sb(),o.Tb(33,"p",17),o.Hc(34,"Whether plan permissions should be displayed as features to users."),o.Sb(),o.Sb(),o.Tb(35,"div",36),o.Tb(36,"mat-slide-toggle",40),o.Hc(37,"Hidden"),o.Sb(),o.Tb(38,"p",17),o.Hc(39,"Whether this plan should be hidden on upgrade and pricing pages."),o.Sb(),o.Sb(),o.Ob(40,"permission-manager",41),o.Fc(41,qc,2,1,"div",12),o.Tb(42,"div",42),o.Tb(43,"div",43),o.Hc(44,"Custom Features"),o.Sb(),o.Tb(45,"ul",44),o.ac("cdkDropListDropped",(function(t){return o.vc(e),o.ec(2).reorderPlanFeatures(t)})),o.Fc(46,Gc,7,2,"li",45),o.fc(47,"async"),o.Sb(),o.Fc(48,Yc,2,0,"p",22),o.fc(49,"async"),o.Tb(50,"form",46),o.ac("ngSubmit",(function(){return o.vc(e),o.ec(2).addFeature()})),o.Tb(51,"div",9),o.Tb(52,"div",47),o.Tb(53,"input",48),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).newFeature=t})),o.Sb(),o.Tb(54,"button",49),o.Hc(55,"Add"),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Tb(56,"div",50),o.Tb(57,"div",43),o.Hc(58,"Available Space"),o.Sb(),o.Tb(59,"space-input",51),o.Tb(60,"p",52),o.Hc(61,"Hard drive space available to users subscribed to this plan."),o.Sb(),o.Fc(62,Xc,2,1,"div",12),o.Sb(),o.Sb(),o.Qb()}if(2&e){const e=o.ec().ngIf,t=o.ec();o.Bb(5),o.kc("ngValue",1),o.Bb(2),o.kc("ngValue",2),o.Bb(2),o.kc("ngValue",3),o.Bb(2),o.kc("ngValue",4),o.Bb(2),o.kc("ngValue",5),o.Bb(2),o.kc("ngValue",6),o.Bb(2),o.kc("ngValue",7),o.Bb(2),o.kc("ngValue",8),o.Bb(4),o.kc("ngIf",e.position),o.Bb(6),o.kc("ngIf",!t.data.plan||t.data.plan.free),o.Bb(12),o.kc("ngIf",null==e?null:e.permissions),o.Bb(5),o.kc("ngForOf",o.gc(47,15,t.features$)),o.Bb(2),o.kc("ngIf",!o.gc(49,17,t.features$).length),o.Bb(5),o.kc("ngModel",t.newFeature),o.Bb(9),o.kc("ngIf",e.available_space)}}function Jc(e,t){1&e&&(o.Tb(0,"span",17),o.Hc(1,"Update Plan"),o.Sb())}function Kc(e,t){1&e&&(o.Tb(0,"span",17),o.Hc(1,"Create Plan"),o.Sb())}function Wc(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",7),o.ac("ngSubmit",(function(){return o.vc(e),o.ec().confirm()})),o.Tb(1,"div",8),o.Tb(2,"div",9),o.Tb(3,"label",10),o.Hc(4,"Name"),o.Sb(),o.Ob(5,"input",11),o.Fc(6,Mc,2,1,"div",12),o.Sb(),o.Tb(7,"div",9),o.Tb(8,"label",13),o.Hc(9,"Parent Plan"),o.Sb(),o.Tb(10,"select",14),o.Tb(11,"option",15),o.Hc(12,"None"),o.Sb(),o.Fc(13,Dc,2,2,"option",16),o.Sb(),o.Tb(14,"p",17),o.Hc(15,"Used for creating yearly, weekly etc versions of base plan. Child plans will inherit their parent permissions/features."),o.Sb(),o.Fc(16,Bc,2,1,"div",12),o.Sb(),o.Fc(17,zc,18,9,"ng-container",18),o.Fc(18,Qc,63,19,"ng-container",18),o.Sb(),o.Tb(19,"div",19),o.Tb(20,"button",20),o.ac("click",(function(){return o.vc(e),o.ec().close()})),o.Hc(21,"Cancel"),o.Sb(),o.Tb(22,"button",21),o.fc(23,"async"),o.Fc(24,Jc,2,0,"span",22),o.Fc(25,Kc,2,0,"span",22),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec();o.kc("formGroup",n.form),o.Bb(6),o.kc("ngIf",e.name),o.Bb(5),o.kc("ngValue",null),o.Bb(2),o.kc("ngForOf",n.getBasePlans(n.data.plan)),o.Bb(3),o.kc("ngIf",e.parent_id),o.Bb(1),o.kc("ngIf",!n.formValue().free),o.Bb(1),o.kc("ngIf",!n.formValue().parent_id),o.Bb(4),o.kc("disabled",o.gc(23,10,n.loading$)),o.Bb(2),o.kc("ngIf",n.data.plan),o.Bb(1),o.kc("ngIf",!n.data.plan)}}let Zc=(()=>{class e{constructor(e,t,n,i,a,s){this.dialogRef=e,this.data=t,this.plans=n,this.toast=i,this.valueLists=a,this.fb=s,this.loading$=new ht.a(!1),this.features$=new ht.a([]),this.errors$=new ht.a({}),this.currencies$=new ht.a([]),this.intervals=["day","week","month","year"],this.allPlans$=new ht.a([]),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(e=>{this.currencies$.next(Object.values(e.currencies))}),this.data.plan&&this.hydrateModel(this.data.plan)}confirm(){let e;this.loading$.next(!0),e=this.data.plan?this.plans.update(this.data.plan.id,this.getPayload()):this.plans.create(this.getPayload()),e.pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(e=>{this.close(e.plan),this.toast.open("Plan has been "+(this.data.plan?"updated":"created"))},e=>{this.errors$.next(e.errors)})}getPayload(){const e=Object.assign({},this.form.getRawValue());e.features=this.features$.value.map(e=>e.content);const t=this.currencies$.value.find(t=>t.code===e.currency);return e.currency_symbol=t.symbol,"year"===e.interval&&(e.interval_count=1),e}close(e){this.resetState(),this.dialogRef.close(e)}addFeature(){!(this.features$.value.findIndex(e=>e.content===this.newFeature)>-1)&&this.newFeature&&(this.features$.next([...this.features$.value,{content:this.newFeature,id:Object(Xa.a)(5)}]),this.newFeature=null)}removeFeature(e){const t=this.features$.value.filter(t=>t.id!==e.id);this.features$.next(t)}getBasePlans(e){return this.allPlans$.value.filter(t=>!(t.parent_id||t.free||e&&e.id===t.id))}hydrateModel(e){this.form.patchValue(e);const t=e.features.map(e=>({content:e,id:Object(Xa.a)(5)}));this.form.get("amount").disable(),this.features$.next(t)}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(e){const t=[...this.features$.value];Object(it.f)(t,e.previousIndex,e.currentIndex),this.features$.next(t)}formValue(){return this.form.value}getMinAmount(){return this.form.get("parent_id").value?1:0}getMaxAmount(){if(this.form.get("parent_id").value){const e=this.allPlans$.value.find(e=>e.id===this.form.get("parent_id").value);return e.amount/e.interval_count*this.form.get("interval_count").value-.01}return null}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(g.h),o.Nb(g.a),o.Nb(xc.a),o.Nb(mt.b),o.Nb(qn.a),o.Nb(a.h))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Fc(1,Ic,2,0,"h2",1),o.Fc(2,Oc,2,0,"h2",1),o.Tb(3,"button",2),o.ac("click",(function(){return t.close()})),o.Ob(4,"mat-icon",3),o.Sb(),o.Sb(),o.Fc(5,Wc,26,12,"form",4),o.fc(6,"async"),o.Ob(7,"loading-indicator",5),o.fc(8,"async")),2&e&&(o.Bb(1),o.kc("ngIf",t.data.plan),o.Bb(1),o.kc("ngIf",!t.data.plan),o.Bb(3),o.kc("ngIf",o.gc(6,4,t.errors$)),o.Bb(2),o.kc("isVisible",o.gc(8,6,t.loading$)))},directives:[i.t,P.a,si.a,g.i,vt.a,a.v,a.m,g.f,a.d,a.u,a.k,a.F,a.G,a.z,a.J,i.s,g.c,u.b,a.A,w.a,Do,it.d,a.w,a.x,ns,it.a,it.b],pipes:[i.b],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}),e})(),el=(()=>{class e{constructor(e,t){this.fb=e,this.datable=t,this.form=this.fb.group({currency:null,interval:null,parent_id:null,recommended:null}),this.form.patchValue(this.datable.filters$.value)}ngOnInit(){this.form.valueChanges.subscribe(e=>{this.datable.filters$.next(e)})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(a.h),o.Nb(jt))},e.\u0275cmp=o.Hb({type:e,selectors:[["plan-index-filters"]],decls:49,vars:9,consts:[[1,"many-inputs",3,"formGroup"],[1,"input-container"],["for","plan-currency-filter","trans",""],["id","plan-currency-filter","formControlName","currency"],["trans","",3,"ngValue"],["value","USD","trans",""],["value","EUR","trans",""],["value","GBP","trans",""],["value","CAD","trans",""],["for","link-interval-filter","trans",""],["id","link-interval-filter","formControlName","interval"],["value","day","trans",""],["value","week","trans",""],["value","month","trans",""],["value","year","trans",""],["for","plan-type-filter","trans",""],["id","plan-type-filter","formControlName","parent_id"],["for","plan-recommended-filter","trans",""],["id","plan-recommended-filter","formControlName","recommended"]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Tb(2,"label",2),o.Hc(3,"Currency"),o.Sb(),o.Tb(4,"select",3),o.Tb(5,"option",4),o.Hc(6,"Any"),o.Sb(),o.Tb(7,"option",5),o.Hc(8,"USD"),o.Sb(),o.Tb(9,"option",6),o.Hc(10,"Eur"),o.Sb(),o.Tb(11,"option",7),o.Hc(12,"Pound Sterling"),o.Sb(),o.Tb(13,"option",8),o.Hc(14,"Canadian Dollar"),o.Sb(),o.Sb(),o.Sb(),o.Tb(15,"div",1),o.Tb(16,"label",9),o.Hc(17,"Interval"),o.Sb(),o.Tb(18,"select",10),o.Tb(19,"option",4),o.Hc(20,"Any"),o.Sb(),o.Tb(21,"option",11),o.Hc(22,"Day"),o.Sb(),o.Tb(23,"option",12),o.Hc(24,"Week"),o.Sb(),o.Tb(25,"option",13),o.Hc(26,"Month"),o.Sb(),o.Tb(27,"option",14),o.Hc(28,"Year"),o.Sb(),o.Sb(),o.Sb(),o.Tb(29,"div",1),o.Tb(30,"label",15),o.Hc(31,"Type"),o.Sb(),o.Tb(32,"select",16),o.Tb(33,"option",4),o.Hc(34,"Any"),o.Sb(),o.Tb(35,"option",4),o.Hc(36,"Child"),o.Sb(),o.Tb(37,"option",4),o.Hc(38,"Parent"),o.Sb(),o.Sb(),o.Sb(),o.Tb(39,"div",1),o.Tb(40,"label",17),o.Hc(41,"Recommended"),o.Sb(),o.Tb(42,"select",18),o.Tb(43,"option",4),o.Hc(44,"Any"),o.Sb(),o.Tb(45,"option",4),o.Hc(46,"Yes"),o.Sb(),o.Tb(47,"option",4),o.Hc(48,"No"),o.Sb(),o.Sb(),o.Sb(),o.Sb()),2&e&&(o.kc("formGroup",t.form),o.Bb(5),o.kc("ngValue",null),o.Bb(14),o.kc("ngValue",null),o.Bb(14),o.kc("ngValue",null),o.Bb(2),o.kc("ngValue",!0),o.Bb(2),o.kc("ngValue",!1),o.Bb(6),o.kc("ngValue",null),o.Bb(2),o.kc("ngValue",!0),o.Bb(2),o.kc("ngValue",!1))},directives:[a.v,a.m,vt.a,a.G,a.u,a.k,a.z,a.J],styles:[""],changeDetection:0}),e})();function tl(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",14),o.ac("click",(function(){return o.vc(e),o.ec().showCrupdatePlanModal()})),o.fc(1,"async"),o.Hc(2,"Add"),o.Sb()}if(2&e){const e=o.ec();o.kc("disabled",o.gc(1,1,e.loading$))}}function nl(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",15),o.ac("click",(function(){return o.vc(e),o.ec().syncPlans()})),o.fc(1,"async"),o.Hc(2,"Sync"),o.Sb()}if(2&e){const e=o.ec();o.kc("disabled",o.gc(1,2,e.loading$))("matTooltip","Sync if one of payment gateways was enabled after plan has already been created")}}function il(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",16),o.ac("click",(function(){return o.vc(e),o.ec().maybeDeleteSelectedPlans()})),o.Hc(1,"Delete Selected"),o.Sb()}}function al(e,t){1&e&&o.Ob(0,"plan-index-filters")}function sl(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",28),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec().showCrupdatePlanModal(t)})),o.fc(1,"trans"),o.Ob(2,"mat-icon",29),o.Sb()}2&e&&o.kc("matTooltip",o.gc(1,1,"Edit plan"))}function ol(e,t){if(1&e&&(o.Tb(0,"tr"),o.Ob(1,"td",17),o.Tb(2,"td",18),o.Hc(3),o.Sb(),o.Tb(4,"td",19),o.Hc(5),o.Sb(),o.Tb(6,"td",20),o.Hc(7),o.fc(8,"currency"),o.Sb(),o.Tb(9,"td",21),o.Hc(10),o.Sb(),o.Tb(11,"td",22),o.Hc(12),o.Sb(),o.Tb(13,"td",23),o.Hc(14),o.Sb(),o.Tb(15,"td",24),o.Hc(16),o.Sb(),o.Tb(17,"td",25),o.Hc(18),o.fc(19,"formattedDate"),o.Sb(),o.Tb(20,"td",26),o.Fc(21,sl,3,3,"button",27),o.Sb(),o.Sb()),2&e){const e=t.$implicit,n=o.ec();o.Bb(1),o.kc("table-body-checkbox",e.id),o.Bb(2),o.Ic(e.name),o.Bb(2),o.Ic(e.parent?e.parent.name:"-"),o.Bb(2),o.Ic(e.free?"Free":o.hc(8,10,e.amount,e.currency)),o.Bb(3),o.Ic(e.free?"Free":e.currency),o.Bb(2),o.Ic(e.free?"Free":e.interval),o.Bb(2),o.Ic(e.parent_id?"-":e.recommended?"Yes":"No"),o.Bb(2),o.Ic(e.parent_id?"-":e.position),o.Bb(2),o.Ic(o.gc(19,13,e.updated_at)),o.Bb(3),o.kc("ngIf",n.currentUser.hasPermission("plans.update"))}}function rl(e,t){1&e&&(o.Tb(0,"no-results-message",30),o.Tb(1,"span",31),o.Hc(2,"No plans have been created yet"),o.Sb(),o.Sb())}let cl=(()=>{class e{constructor(e,t,n,i){this.plans=e,this.currentUser=t,this.toast=n,this.datatable=i,this.loading$=new ht.a(!1),this.plans$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:xc.a.BASE_URI})}maybeDeleteSelectedPlans(){this.datatable.confirmResourceDeletion("plans").subscribe(()=>{this.loading$.next(!0),this.plans.delete(this.datatable.selectedRows$.value).pipe(Object(pt.a)(()=>{this.loading$.next(!1),this.datatable.reset()})).subscribe()})}showCrupdatePlanModal(e){this.datatable.openCrupdateResourceModal(Zc,{plan:e,plans:this.datatable.data$.value}).subscribe()}syncPlans(){this.loading$.next(!0),this.plans.sync().pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Synced plans across all enabled payment gateways")})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(xc.a),o.Nb(st.a),o.Nb(mt.b),o.Nb(jt))},e.\u0275cmp=o.Hb({type:e,selectors:[["plan-index"]],features:[o.Ab([jt])],decls:35,vars:9,consts:[[1,"datatable","responsive-table"],["pluralResourceName","plans"],["leftContent",""],["mat-raised-button","","color","accent","trans","",3,"disabled","click",4,"ngIf"],["mat-button","","trans","",3,"disabled","matTooltip","click",4,"ngIf"],["mat-raised-button","","color","accent","rightContent","","trans","",3,"click",4,"ngIf"],["tableFilters",""],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","parent_id","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngFor","ngForOf"],["svgImage","online-payments.svg",4,"ngIf"],["mat-raised-button","","color","accent","trans","",3,"disabled","click"],["mat-button","","trans","",3,"disabled","matTooltip","click"],["mat-raised-button","","color","accent","rightContent","","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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"datatable-header",1),o.Rb(2,2),o.Fc(3,tl,3,3,"button",3),o.Fc(4,nl,3,4,"button",4),o.Qb(),o.Fc(5,il,2,0,"button",5),o.Fc(6,al,1,0,"ng-template",null,6,o.Gc),o.Sb(),o.Tb(8,"table",7),o.Tb(9,"thead"),o.Tb(10,"tr"),o.Ob(11,"th",8),o.Tb(12,"th",9),o.Hc(13,"Name"),o.Sb(),o.Tb(14,"th",10),o.Hc(15,"Parent Plan"),o.Sb(),o.Tb(16,"th",9),o.Hc(17,"Amount"),o.Sb(),o.Tb(18,"th",9),o.Hc(19,"Currency"),o.Sb(),o.Tb(20,"th",9),o.Hc(21,"Interval"),o.Sb(),o.Tb(22,"th",9),o.Hc(23,"Recommended"),o.Sb(),o.Tb(24,"th",9),o.Hc(25,"Position"),o.Sb(),o.Tb(26,"th",11),o.Hc(27,"Last Updated"),o.Sb(),o.Ob(28,"th"),o.Sb(),o.Sb(),o.Tb(29,"tbody"),o.Fc(30,ol,22,15,"tr",12),o.fc(31,"async"),o.Sb(),o.Sb(),o.Fc(32,rl,3,0,"no-results-message",13),o.fc(33,"async"),o.Ob(34,"datatable-footer"),o.Sb()),2&e&&(o.Bb(3),o.kc("ngIf",t.currentUser.hasPermission("plans.create")),o.Bb(1),o.kc("ngIf",t.currentUser.hasPermission("plans.create")),o.Bb(1),o.kc("ngIf",t.currentUser.hasPermission("plans.delete")),o.Bb(25),o.kc("ngForOf",o.gc(31,5,t.plans$)),o.Bb(2),o.kc("ngIf",o.gc(33,7,t.datatable.paginator.noResults$)))},directives:[bn,i.t,hn,vn,vt.a,i.s,yn,u.b,I.a,el,Tn,P.a,Cn.a],pipes:[i.b,i.d,wn.a,lt.a],styles:[""],changeDetection:0}),e})();var ll=n("NjxG"),dl=n("uHcB"),bl=n("8k5P");function ul(e,t){1&e&&(o.Tb(0,"h2",6),o.Hc(1,"Update Subscription Details"),o.Sb())}function hl(e,t){1&e&&(o.Tb(0,"h2",6),o.Hc(1,"Create a New Subscription"),o.Sb())}function pl(e,t){if(1&e&&(o.Tb(0,"div",35),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.user_id)}}function gl(e,t){if(1&e&&(o.Tb(0,"mat-option",36),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("value",e),o.Bb(1),o.Ic(e.email)}}function ml(e,t){if(1&e&&(o.Tb(0,"option",37),o.Ob(1,"full-plan-name",38),o.Hc(2),o.fc(3,"currency"),o.Sb()),2&e){const e=t.$implicit;o.kc("ngValue",e.id),o.Bb(1),o.kc("plan",e),o.Bb(1),o.Jc(" (",o.hc(3,3,e.amount,e.currency),") ")}}function fl(e,t){if(1&e&&(o.Tb(0,"div",35),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.description)}}function vl(e,t){if(1&e&&(o.Tb(0,"div",35),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.renews_at)}}function _l(e,t){if(1&e&&(o.Tb(0,"div",35),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.ends_at)}}function Sl(e,t){1&e&&(o.Tb(0,"span",26),o.Hc(1,"Update"),o.Sb())}function yl(e,t){1&e&&(o.Tb(0,"span",26),o.Hc(1,"Create"),o.Sb())}function kl(e,t){if(1&e){const e=o.Ub();o.Tb(0,"form",7),o.ac("ngSubmit",(function(){return o.vc(e),o.ec().confirm()})),o.Tb(1,"div",8),o.Tb(2,"div",9),o.Tb(3,"label",10),o.Hc(4,"User"),o.Sb(),o.Ob(5,"input",11),o.Fc(6,pl,2,1,"div",12),o.Tb(7,"mat-autocomplete",13,14),o.Fc(9,gl,2,2,"mat-option",15),o.fc(10,"async"),o.Sb(),o.Sb(),o.Rb(11,16),o.Tb(12,"div",9),o.Tb(13,"label",17),o.Hc(14,"Plan"),o.Sb(),o.Tb(15,"select",18),o.Fc(16,ml,4,6,"option",19),o.Sb(),o.Sb(),o.Tb(17,"div",9),o.Tb(18,"label",20),o.Hc(19,"Description"),o.Sb(),o.Ob(20,"textarea",21),o.Fc(21,fl,2,1,"div",12),o.Sb(),o.Tb(22,"div",22),o.Tb(23,"label",23),o.Hc(24,"Renews At"),o.Sb(),o.Tb(25,"input",24),o.ac("click",(function(){o.vc(e);const t=o.sc(31);return o.ec().toggleDatePicker(t)})),o.Sb(),o.Ob(26,"mat-datepicker-toggle",25),o.Tb(27,"p",26),o.Hc(28,"This will only change local records. User will continue to be billed on their original cycle on the payment gateway."),o.Sb(),o.Fc(29,vl,2,1,"div",12),o.Ob(30,"mat-datepicker",null,27),o.Sb(),o.Tb(32,"div",22),o.Tb(33,"label",28),o.Hc(34,"Ends At"),o.Sb(),o.Tb(35,"input",29),o.ac("click",(function(){o.vc(e);const t=o.sc(41);return o.ec().toggleDatePicker(t)})),o.Sb(),o.Tb(36,"p",26),o.Hc(37,"This will only change local records. User will continue to be billed on their original cycle on the payment gateway."),o.Sb(),o.Fc(38,_l,2,1,"div",12),o.Ob(39,"mat-datepicker-toggle",25),o.Ob(40,"mat-datepicker",null,30),o.Sb(),o.Qb(),o.Sb(),o.Tb(42,"div",31),o.Tb(43,"button",32),o.ac("click",(function(){return o.vc(e),o.ec().close()})),o.Hc(44,"Cancel"),o.Sb(),o.Tb(45,"button",33),o.fc(46,"async"),o.Fc(47,Sl,2,0,"span",34),o.Fc(48,yl,2,0,"span",34),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=t.ngIf,n=o.sc(8),i=o.sc(31),a=o.sc(41),s=o.ec();o.Bb(5),o.kc("formControl",s.userAutocomplete)("matAutocomplete",n),o.Bb(1),o.kc("ngIf",e.user_id),o.Bb(1),o.kc("displayWith",s.displayFn),o.Bb(2),o.kc("ngForOf",o.gc(10,17,s.filteredUsers)),o.Bb(2),o.kc("formGroup",s.form),o.Bb(5),o.kc("ngForOf",s.plans),o.Bb(5),o.kc("ngIf",e.description),o.Bb(4),o.kc("matDatepicker",i),o.Bb(1),o.kc("for",i),o.Bb(3),o.kc("ngIf",e.renews_at),o.Bb(6),o.kc("matDatepicker",a),o.Bb(3),o.kc("ngIf",e.ends_at),o.Bb(1),o.kc("for",a),o.Bb(6),o.kc("disabled",o.gc(46,19,s.loading$)),o.Bb(2),o.kc("ngIf",s.data.subscription),o.Bb(1),o.kc("ngIf",!s.data.subscription)}}let Tl=(()=>{class e{constructor(e,t,n,i,s,o,r){this.dialogRef=e,this.data=t,this.subscriptions=n,this.toast=i,this.users=s,this.plansApi=o,this.fb=r,this.loading$=new ht.a(!1),this.form=this.fb.group({plan_id:[""],description:[""],renews_at:[""],ends_at:[""]}),this.errors$=new ht.a({}),this.userAutocomplete=new a.i(null),this.filteredUsers=new v.a,this.plans=[],this.resetState()}ngOnInit(){this.resetState(),this.bindToUserAutocomplete(),this.fetchPlans(),this.form.get("ends_at").valueChanges.pipe(Object(Jt.a)()).subscribe(e=>{e?this.form.get("renews_at").disable():this.form.get("renews_at").enable()}),this.form.get("renews_at").valueChanges.pipe(Object(Jt.a)()).subscribe(e=>{e?this.form.get("ends_at").disable():this.form.get("ends_at").enable()}),this.data.subscription&&this.hydrateModel(this.data.subscription)}confirm(){let e;this.loading$.next(!0),e=this.data.subscription?this.subscriptions.update(this.data.subscription.id,this.getPayload()):this.subscriptions.create(this.getPayload()),e.pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(e=>{this.close(e.subscription),this.toast.open("Subscription "+(this.data.subscription?"updated":"created"))},e=>this.errors$.next(e.errors))}close(e){this.resetState(),this.dialogRef.close(e)}displayFn(e){return e?e.email:null}hydrateModel(e){const t=Object.assign({},e);t.renews_at&&(t.renews_at=this.mysqlToDate(t.renews_at)),t.ends_at&&(t.ends_at=this.mysqlToDate(t.ends_at)),e.user_id&&this.userAutocomplete.setValue(e.user),this.form.patchValue(t)}getPayload(){const e=this.form.value,t=this.dateToMysql(e.renews_at),n=this.dateToMysql(e.ends_at);return t&&(e.renews_at=t),n&&(e.ends_at=n),!this.data.subscription&&this.userAutocomplete.value&&(e.user_id=this.userAutocomplete.value.id),e}dateToMysql(e){return e&&"string"!=typeof e?e.toJSON().split(".")[0].replace("T"," "):e}mysqlToDate(e){const t=e.split(/[- :]/);return new Date(Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5]))}resetState(){this.form.reset(),this.errors$.next({})}toggleDatePicker(e){e.opened?e.close():e.open()}bindToUserAutocomplete(){this.filteredUsers=this.userAutocomplete.valueChanges.pipe(Object(Ht.a)(400),Object(Yn.a)(e=>e?this.users.getAll({query:e}):Object(U.a)([])))}fetchPlans(){this.plansApi.all().subscribe(e=>{this.plans=e.pagination.data,!this.form.value.plan_id&&this.plans.length&&this.form.patchValue({plan_id:this.plans[0].id})})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(g.h),o.Nb(g.a),o.Nb(dl.a),o.Nb(mt.b),o.Nb(Rs.a),o.Nb(xc.a),o.Nb(a.h))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Fc(1,ul,2,0,"h2",1),o.Fc(2,hl,2,0,"h2",1),o.Tb(3,"button",2),o.ac("click",(function(){return t.close()})),o.Ob(4,"mat-icon",3),o.Sb(),o.Sb(),o.Fc(5,kl,49,21,"form",4),o.fc(6,"async"),o.Ob(7,"loading-indicator",5),o.fc(8,"async")),2&e&&(o.Bb(1),o.kc("ngIf",t.data.subscription),o.Bb(1),o.kc("ngIf",!t.data.subscription),o.Bb(3),o.kc("ngIf",o.gc(6,4,t.errors$)),o.Bb(2),o.kc("isVisible",o.gc(8,6,t.loading$)))},directives:[i.t,P.a,si.a,g.i,vt.a,a.v,a.w,g.f,a.d,b.c,a.F,a.u,a.j,b.a,i.s,a.m,a.G,a.k,Xe,Je,ze,g.c,u.b,S.l,a.z,a.J,bl.a],pipes:[i.b,i.d],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}),e})(),Cl=(()=>{class e{constructor(e,t){this.fb=e,this.datable=t,this.form=this.fb.group({ends_at:null,gateway:null,created_at:null}),this.form.patchValue(this.datable.filters$.value)}ngOnInit(){this.form.valueChanges.subscribe(e=>{this.datable.filters$.next(e)})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(a.h),o.Nb(jt))},e.\u0275cmp=o.Hb({type:e,selectors:[["subscription-index-filters"]],decls:23,vars:7,consts:[[1,"many-inputs",3,"formGroup"],[1,"input-container"],["for","subscription-status-filter","trans",""],["id","subscription-status-filter","formControlName","ends_at"],["trans","",3,"ngValue"],["for","subscription-gateway-filter","trans",""],["id","subscription-gateway-filter","formControlName","gateway"],["value","paypal","trans",""],["value","stripe","trans",""],["formControlName","created_at",3,"setDefaultDate","showLabels"]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Tb(2,"label",2),o.Hc(3,"Status"),o.Sb(),o.Tb(4,"select",3),o.Tb(5,"option",4),o.Hc(6,"Any"),o.Sb(),o.Tb(7,"option",4),o.Hc(8,"Active"),o.Sb(),o.Tb(9,"option",4),o.Hc(10,"Cancelled"),o.Sb(),o.Sb(),o.Sb(),o.Tb(11,"div",1),o.Tb(12,"label",5),o.Hc(13,"Gateway"),o.Sb(),o.Tb(14,"select",6),o.Tb(15,"option",4),o.Hc(16,"Any"),o.Sb(),o.Tb(17,"option",7),o.Hc(18,"Paypal"),o.Sb(),o.Tb(19,"option",8),o.Hc(20,"Stripe"),o.Sb(),o.Sb(),o.Sb(),o.Tb(21,"between-input",9),o.Hc(22,"Subscribed Between"),o.Sb(),o.Sb()),2&e&&(o.kc("formGroup",t.form),o.Bb(5),o.kc("ngValue",null),o.Bb(2),o.kc("ngValue",!1),o.Bb(2),o.kc("ngValue",!0),o.Bb(6),o.kc("ngValue",null),o.Bb(6),o.kc("setDefaultDate",!1)("showLabels",!1))},directives:[a.v,a.m,vt.a,a.G,a.u,a.k,a.z,a.J,Jo],styles:[""],changeDetection:0}),e})();function wl(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",13),o.ac("click",(function(){return o.vc(e),o.ec().openCrupdateSubscriptionModal()})),o.fc(1,"async"),o.Hc(2,"Add"),o.Sb()}if(2&e){const e=o.ec();o.kc("disabled",o.gc(1,1,e.loading$))}}function xl(e,t){1&e&&o.Ob(0,"subscription-index-filters")}function Il(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"button",23),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec().openCrupdateSubscriptionModal(t)})),o.fc(2,"trans"),o.Ob(3,"mat-icon",24),o.Sb(),o.Tb(4,"button",25),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec().maybeCancelSubscription(t)})),o.fc(5,"trans"),o.Ob(6,"mat-icon",26),o.Sb(),o.Tb(7,"button",23),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec().maybeDeleteSubscription(t)})),o.fc(8,"trans"),o.Ob(9,"mat-icon",27),o.Sb(),o.Qb()}if(2&e){const e=o.ec().$implicit;o.Bb(1),o.kc("matTooltip",o.gc(2,4,"Edit")),o.Bb(3),o.kc("disabled",e.cancelled)("matTooltip",o.gc(5,6,"Cancel/Suspend")),o.Bb(3),o.kc("matTooltip",o.gc(8,8,"Delete"))}}function Ol(e,t){if(1&e&&(o.Tb(0,"tr"),o.Tb(1,"td"),o.Ob(2,"user-column",14),o.Sb(),o.Tb(3,"td",15),o.Hc(4),o.Sb(),o.Tb(5,"td",16),o.Hc(6),o.Sb(),o.Tb(7,"td",17),o.Hc(8),o.Sb(),o.Tb(9,"td",18),o.Hc(10),o.fc(11,"formattedDate"),o.Sb(),o.Tb(12,"td",19),o.Hc(13),o.fc(14,"formattedDate"),o.Sb(),o.Tb(15,"td",20),o.Hc(16),o.fc(17,"formattedDate"),o.Sb(),o.Tb(18,"td",21),o.Fc(19,Il,10,10,"ng-container",22),o.Sb(),o.Sb()),2&e){const e=t.$implicit,n=o.ec();o.Bb(2),o.kc("user",e.user),o.Bb(2),o.Ic(e.gateway),o.Bb(2),o.Ic(e.cancelled?"Yes":"No"),o.Bb(2),o.Ic(e.on_grace_period?"Yes":"No"),o.Bb(2),o.Ic(e.renews_at?o.gc(11,8,e.renews_at):"-"),o.Bb(3),o.Ic(e.ends_at?o.gc(14,10,e.ends_at):"-"),o.Bb(3),o.Ic(o.gc(17,12,e.created_at)),o.Bb(3),o.kc("ngIf",n.currentUser.hasPermission("subscriptions.delete"))}}function Ml(e,t){1&e&&(o.Tb(0,"no-results-message",28),o.Tb(1,"span",29),o.Hc(2,"No subscriptions have been created yet"),o.Sb(),o.Sb())}let Dl=(()=>{class e{constructor(e,t,n,i,a){this.modal=e,this.subscriptions=t,this.currentUser=n,this.toast=i,this.datatable=a,this.loading$=new ht.a(!1),this.subscriptions$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:dl.a.BASE_URI})}maybeCancelSubscription(e){this.modal.open(Nt.a,{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(t=>{t&&this.cancelOrDeleteSubscription(e,{delete:!1})})}maybeDeleteSubscription(e){this.modal.open(Nt.a,{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(t=>{t&&this.cancelOrDeleteSubscription(e,{delete:!0})})}cancelOrDeleteSubscription(e,t={}){this.loading$.next(!0),this.subscriptions.cancel(e.id,{delete:t.delete}).pipe(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(()=>{this.datatable.reset(),this.toast.open("Subscription cancelled.")})}openCrupdateSubscriptionModal(e){this.modal.open(Tl,{subscription:e}).afterClosed().subscribe(e=>{e&&this.datatable.reset()})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(Lt.a),o.Nb(dl.a),o.Nb(st.a),o.Nb(mt.b),o.Nb(jt))},e.\u0275cmp=o.Hb({type:e,selectors:[["subscription-index"]],features:[o.Ab([jt])],decls:30,vars:7,consts:[[1,"datatable","responsive-table"],["pluralResourceName","subscriptions"],["leftContent",""],["mat-raised-button","","color","accent","headerActions","","trans","",3,"disabled","click",4,"ngIf"],["tableFilters",""],[1,"material-table"],["table-sort-header","user_id","trans",""],["table-sort-header","","trans",""],["table-sort-header","ends_at","trans",""],["trans",""],["table-sort-header","created_at","trans",""],[4,"ngFor","ngForOf"],["svgImage","subscriptions.svg",4,"ngIf"],["mat-raised-button","","color","accent","headerActions","","trans","",3,"disabled","click"],[3,"user"],["data-label","Gateway"],["data-label","Cancelled"],["data-label","On Grace Period"],["data-label","Renews At"],["data-label","Ends At"],["data-label","Created At"],[1,"edit-column"],[4,"ngIf"],["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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"datatable-header",1),o.Rb(2,2),o.Fc(3,wl,3,3,"button",3),o.Qb(),o.Fc(4,xl,1,0,"ng-template",null,4,o.Gc),o.Sb(),o.Tb(6,"table",5),o.Tb(7,"thead"),o.Tb(8,"tr"),o.Tb(9,"th",6),o.Hc(10,"Owner"),o.Sb(),o.Tb(11,"th",7),o.Hc(12,"Gateway"),o.Sb(),o.Tb(13,"th",8),o.Hc(14,"Cancelled"),o.Sb(),o.Tb(15,"th",9),o.Hc(16,"On Grace Period"),o.Sb(),o.Tb(17,"th",7),o.Hc(18,"Renews At"),o.Sb(),o.Tb(19,"th",7),o.Hc(20,"Ends At"),o.Sb(),o.Tb(21,"th",10),o.Hc(22,"Created At"),o.Sb(),o.Ob(23,"th"),o.Sb(),o.Sb(),o.Tb(24,"tbody"),o.Fc(25,Ol,20,14,"tr",11),o.fc(26,"async"),o.Sb(),o.Sb(),o.Fc(27,Ml,3,0,"no-results-message",12),o.fc(28,"async"),o.Ob(29,"datatable-footer"),o.Sb()),2&e&&(o.Bb(3),o.kc("ngIf",t.currentUser.hasPermission("subscriptions.create")),o.Bb(22),o.kc("ngForOf",o.gc(26,3,t.subscriptions$)),o.Bb(2),o.kc("ngIf",o.gc(28,5,t.datatable.paginator.noResults$)))},directives:[bn,i.t,vn,vt.a,i.s,yn,u.b,Cl,Rn,I.a,P.a,Cn.a],pipes:[i.b,wn.a,lt.a],styles:[""],changeDetection:0}),e})();function Bl(e,t){if(1&e&&(o.Tb(0,"option",26),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("value",e.action),o.Bb(1),o.Ic(e.label)}}function Hl(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",17),o.Tb(1,"label",22),o.Hc(2,"Learn More Link"),o.Sb(),o.Tb(3,"select",23),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec(2).state.client["cookie_notice.learn_more"]=t})),o.Tb(4,"option",24),o.Hc(5,"None (Hide learn more link)"),o.Sb(),o.Fc(6,Bl,2,2,"option",25),o.Sb(),o.Sb()}if(2&e){const e=t.ngIf,n=o.ec(2);o.Bb(3),o.kc("ngModel",n.state.client["cookie_notice.learn_more"]),o.Bb(1),o.kc("ngValue",void 0),o.Bb(2),o.kc("ngForOf",e.items)}}function Pl(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",15),o.Fc(1,Hl,7,3,"div",16),o.fc(2,"async"),o.Tb(3,"div",17),o.Tb(4,"div",17),o.Tb(5,"label",18),o.Hc(6,"Cookie Notice Position"),o.Sb(),o.Tb(7,"select",19),o.ac("ngModelChange",(function(t){return o.vc(e),o.ec().state.client["cookie_notice.position"]=t})),o.Tb(8,"option",20),o.Hc(9,"Top"),o.Sb(),o.Tb(10,"option",21),o.Hc(11,"Bottom"),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=o.ec();o.Bb(1),o.kc("ngIf",o.gc(2,2,e.customPages$)),o.Bb(6),o.kc("ngModel",e.state.client["cookie_notice.position"])}}function Fl(e,t){if(1&e&&o.Ob(0,"input",39),2&e){const e=o.ec().index;o.mc("id","policy-action-",e,"")}}function Al(e,t){if(1&e&&(o.Tb(0,"option",26),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("value",e.action),o.Bb(1),o.Ic(e.label)}}function Rl(e,t){if(1&e&&(o.Tb(0,"select",40),o.Fc(1,Al,2,2,"option",25),o.fc(2,"async"),o.Sb()),2&e){const e=o.ec().index,t=o.ec();o.mc("id","policy-action-",e,""),o.Bb(1),o.kc("ngForOf",o.gc(2,2,t.customPages$).items)}}function Nl(e,t){if(1&e){const e=o.Ub();o.Tb(0,"li",27),o.Tb(1,"div",17),o.Tb(2,"label",28),o.Tb(3,"span",6),o.Hc(4,"Name"),o.Sb(),o.Tb(5,"button",29),o.ac("click",(function(){o.vc(e);const n=t.index;return o.ec().removeRegisterPolicy(n)})),o.Ob(6,"mat-icon",30),o.Sb(),o.Sb(),o.Ob(7,"input",31),o.Sb(),o.Tb(8,"div",17),o.Tb(9,"label",32),o.Hc(10,"Link"),o.Sb(),o.Tb(11,"div",33),o.Tb(12,"select",34),o.ac("change",(function(){o.vc(e);const n=t.$implicit;return o.ec().onPolicyTypeChange(n)})),o.Tb(13,"option",35),o.Hc(14,"Page"),o.Sb(),o.Tb(15,"option",36),o.Hc(16,"Link"),o.Sb(),o.Sb(),o.Fc(17,Fl,1,1,"input",37),o.Fc(18,Rl,3,4,"select",38),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=t.$implicit,n=t.index;o.kc("formGroup",e),o.Bb(2),o.mc("for","policy-name-",n,""),o.Bb(3),o.kc("disableRipple",!0),o.Bb(2),o.mc("id","policy-name-",n,""),o.Bb(2),o.mc("for","policy-action-",n,""),o.Bb(3),o.mc("id","policy-type-",n,""),o.Bb(5),o.kc("ngIf","link"===e.value.type),o.Bb(1),o.kc("ngIf","page"===e.value.type)}}function El(e,t){1&e&&o.Ob(0,"mat-progress-bar",41)}let Vl=(()=>{class e extends Gn{constructor(){super(...arguments),this.customPages$=new ht.a({name:"",items:[]}),this.registerPolicies=new a.f([])}ngOnInit(){this.valueLists.get(["menuItemCategories"]).subscribe(e=>{this.customPages$.next(e.menuItemCategories.find(e=>"Custom Page"===e.name))}),this.settings.getJson("register_policies",[]).forEach(e=>{this.addRegisterPolicy(e)})}saveSettings(){const e=this.state.getModified();e.client.register_policies=JSON.stringify(this.registerPolicies.value),super.saveSettings(e)}addRegisterPolicy(e={}){this.registerPolicies.push(new a.l({label:new a.i(e.label||""),action:new a.i(e.action||this.getFirstCustomPageAction()),type:new a.i(e.type||"page")}))}removeRegisterPolicy(e){this.registerPolicies.removeAt(e)}onPolicyTypeChange(e){e.get("action").reset(),"page"===e.get("type").value&&e.get("action").setValue(this.getFirstCustomPageAction())}getFirstCustomPageAction(){return this.customPages$.value.items[0]&&this.customPages$.value.items[0].action}}return e.\u0275fac=function(t){return $l(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["gdpr-settings"]],hostAttrs:[1,"settings-panel"],features:[o.yb],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"],["trans","",3,"ngValue"],[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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Hc(2,"GDPR"),o.Sb(),o.Tb(3,"div",2),o.Hc(4,"Configure settings related to EU General Data Protection Regulation."),o.Sb(),o.Sb(),o.Tb(5,"form",3),o.ac("ngSubmit",(function(){return t.saveSettings()})),o.Tb(6,"div",4),o.Tb(7,"mat-slide-toggle",5),o.ac("ngModelChange",(function(e){return t.state.client["cookie_notice.enable"]=e})),o.Hc(8,"Enable Cookie Notice"),o.Sb(),o.Tb(9,"p",6),o.Hc(10,"Whether cookie notice should be shown automatically to users from EU until it is accepted."),o.Sb(),o.Sb(),o.Fc(11,Pl,12,4,"div",7),o.Tb(12,"div",8),o.Tb(13,"h2"),o.Tb(14,"span"),o.Hc(15,"Registration Page Policies"),o.Sb(),o.Tb(16,"button",9),o.ac("click",(function(){return t.addRegisterPolicy()})),o.Ob(17,"mat-icon",10),o.Sb(),o.Sb(),o.Tb(18,"p",6),o.Hc(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.Sb(),o.Tb(20,"ul",11),o.Fc(21,Nl,19,8,"li",12),o.Sb(),o.Sb(),o.Tb(22,"button",13),o.fc(23,"async"),o.Hc(24,"Update"),o.Sb(),o.Fc(25,El,1,0,"mat-progress-bar",14),o.fc(26,"async"),o.Sb()),2&e&&(o.Bb(7),o.kc("ngModel",t.state.client["cookie_notice.enable"]),o.Bb(4),o.kc("ngIf",t.state.client["cookie_notice.enable"]),o.Bb(10),o.kc("ngForOf",t.registerPolicies.controls),o.Bb(1),o.kc("disabled",o.gc(23,5,t.loading$)),o.Bb(3),o.kc("ngIf",o.gc(26,7,t.loading$)))},directives:[vt.a,a.v,a.w,w.a,a.u,a.x,i.t,u.b,P.a,i.s,a.G,a.z,a.J,a.m,a.d,a.k,a.F,s.a],pipes:[i.b],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}),e})();const $l=o.Vb(Vl);let Ll=(()=>{class e{constructor(e){this.http=e}index(t){return this.http.get(e.BASE_URI,t)}create(t){return this.http.post(e.BASE_URI,t)}update(t,n){return this.http.put(`${e.BASE_URI}/${t}`,n)}delete(t){return this.http.delete(`${e.BASE_URI}/${t}`)}}return e.BASE_URI="tags",e.\u0275fac=function(t){return new(t||e)(o.Xb(r.a))},e.\u0275prov=o.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function zl(e,t){1&e&&(o.Tb(0,"span",10),o.Hc(1,"Update Tag"),o.Sb())}function jl(e,t){1&e&&(o.Tb(0,"span",10),o.Hc(1,"Create a New Tag"),o.Sb())}function Ul(e,t){if(1&e&&(o.Tb(0,"div",19),o.Hc(1),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Ic(e.errors.name)}}function ql(e,t){if(1&e&&(o.Tb(0,"div",19),o.Hc(1),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Ic(e.errors.display_name)}}function Gl(e,t){if(1&e&&(o.Tb(0,"option",20),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("value",e.name),o.Bb(1),o.Ic(e.name)}}function Yl(e,t){if(1&e&&(o.Tb(0,"div",19),o.Hc(1),o.Sb()),2&e){const e=o.ec();o.Bb(1),o.Ic(e.errors.type)}}function Xl(e,t){1&e&&(o.Tb(0,"span",10),o.Hc(1,"Update"),o.Sb())}function Ql(e,t){1&e&&(o.Tb(0,"span",10),o.Hc(1,"Create"),o.Sb())}let Jl=(()=>{class e{constructor(e,t,n,i,s){this.dialogRef=e,this.data=t,this.toast=n,this.tags=i,this.settings=s,this.errors={},this.isSystemTag=!1,this.form=new a.l({name:new a.i(""),display_name:new a.i(""),type:new a.i("")}),this.hydrate()}close(e){this.errors={},this.dialogRef.close(e)}hydrate(){var e,t,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===(e=this.tagTypes[0])||void 0===e?void 0:e.name)||"");const i=this.data.forceType||(null===(t=this.data.tag)||void 0===t?void 0:t.type);this.isSystemTag=null===(n=this.tagTypes.find(e=>e.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(e=>{this.toast.open("Tag "+(this.data.tag?"Updated":"Created")),this.close(e.tag)},e=>this.errors=e.errors)}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(g.h),o.Nb(g.a),o.Nb(mt.b),o.Nb(Ll),o.Nb(at.a))},e.\u0275cmp=o.Hb({type:e,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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"h2",1),o.Fc(2,zl,2,0,"span",2),o.Fc(3,jl,2,0,"span",2),o.Sb(),o.Tb(4,"button",3),o.ac("click",(function(){return t.close()})),o.Ob(5,"mat-icon",4),o.Sb(),o.Sb(),o.Tb(6,"form",5),o.ac("ngSubmit",(function(){return t.confirm()})),o.Tb(7,"mat-dialog-content",6),o.Tb(8,"div",7),o.Tb(9,"label",8),o.Hc(10,"Name"),o.Sb(),o.Ob(11,"input",9),o.Tb(12,"p",10),o.Hc(13,"Unique tag identifier."),o.Sb(),o.Fc(14,Ul,2,1,"div",11),o.Sb(),o.Tb(15,"div",7),o.Tb(16,"label",12),o.Hc(17,"Display Name"),o.Sb(),o.Ob(18,"input",13),o.Tb(19,"p",10),o.Hc(20,"User friendly tag name."),o.Sb(),o.Fc(21,ql,2,1,"div",11),o.Sb(),o.Tb(22,"div",7),o.Tb(23,"label",14),o.Hc(24,"Type"),o.Sb(),o.Tb(25,"select",15),o.Fc(26,Gl,2,2,"option",16),o.Sb(),o.Fc(27,Yl,2,1,"div",11),o.Sb(),o.Sb(),o.Tb(28,"mat-dialog-actions"),o.Tb(29,"button",17),o.ac("click",(function(){return t.close()})),o.Hc(30,"Cancel"),o.Sb(),o.Tb(31,"button",18),o.Fc(32,Xl,2,0,"span",2),o.Fc(33,Ql,2,0,"span",2),o.Sb(),o.Sb(),o.Sb()),2&e&&(o.Bb(2),o.kc("ngIf",t.data.tag),o.Bb(1),o.kc("ngIf",!t.data.tag),o.Bb(3),o.kc("formGroup",t.form),o.Bb(8),o.kc("ngIf",t.errors.name),o.Bb(7),o.kc("ngIf",t.errors.display_name),o.Bb(5),o.kc("ngForOf",t.tagTypes),o.Bb(1),o.kc("ngIf",t.errors.type),o.Bb(5),o.kc("ngIf",t.data.tag),o.Bb(1),o.kc("ngIf",!t.data.tag))},directives:[g.i,i.t,u.b,P.a,a.v,a.m,g.f,vt.a,a.d,a.u,a.k,a.F,a.G,i.s,g.c,a.z,a.J],styles:["[_nghost-%COMP%]{display:block;width:400px;max-width:100%}.capitalize[_ngcontent-%COMP%]{text-transform:capitalize}"]}),e})();function Kl(e,t){if(1&e&&(o.Tb(0,"option",6),o.Hc(1),o.Sb()),2&e){const e=t.$implicit;o.kc("value",e.name),o.Bb(1),o.Ic(e.name)}}let Wl=(()=>{class e{constructor(e,t,n){this.fb=e,this.datable=t,this.settings=n,this.types=[],this.form=this.fb.group({type:null}),this.form.patchValue(this.datable.filters$.value)}ngOnInit(){this.types=this.settings.get("vebto.admin.tagTypes"),this.form.valueChanges.subscribe(e=>{this.datable.filters$.next(e)})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(a.h),o.Nb(jt),o.Nb(at.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["tag-index-filters"]],decls:8,vars:3,consts:[[1,"many-inputs",3,"formGroup"],[1,"input-container"],["for","tag-type-filter","trans",""],["id","tag-type-filter","formControlName","type"],["trans","",3,"ngValue"],["trans","",3,"value",4,"ngFor","ngForOf"],["trans","",3,"value"]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"div",1),o.Tb(2,"label",2),o.Hc(3,"Type"),o.Sb(),o.Tb(4,"select",3),o.Tb(5,"option",4),o.Hc(6,"Any"),o.Sb(),o.Fc(7,Kl,2,2,"option",5),o.Sb(),o.Sb(),o.Sb()),2&e&&(o.kc("formGroup",t.form),o.Bb(5),o.kc("ngValue",null),o.Bb(2),o.kc("ngForOf",t.types))},directives:[a.v,a.m,vt.a,a.G,a.u,a.k,a.z,a.J,i.s],styles:[""],changeDetection:0}),e})();function Zl(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",12),o.ac("click",(function(){return o.vc(e),o.ec().showCrupdateTagModal()})),o.Hc(1,"Add"),o.Sb()}}function ed(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",13),o.ac("click",(function(){return o.vc(e),o.ec().maybeDeleteSelectedTags()})),o.Hc(1,"Delete Selected"),o.Sb()}}function td(e,t){1&e&&o.Ob(0,"tag-index-filters")}function nd(e,t){1&e&&o.Fc(0,td,1,0,"ng-template",null,14,o.Gc)}function id(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",22),o.ac("click",(function(){o.vc(e);const t=o.ec().$implicit;return o.ec().showCrupdateTagModal(t)})),o.fc(1,"trans"),o.Ob(2,"mat-icon",23),o.Sb()}2&e&&o.kc("matTooltip",o.gc(1,1,"Edit tag"))}function ad(e,t){if(1&e&&(o.Tb(0,"tr"),o.Ob(1,"td",15),o.Tb(2,"td",16),o.Hc(3),o.Sb(),o.Tb(4,"td",17),o.Hc(5),o.Sb(),o.Tb(6,"td",18),o.Hc(7),o.Sb(),o.Tb(8,"td",19),o.Hc(9),o.fc(10,"formattedDate"),o.Sb(),o.Tb(11,"td",20),o.Fc(12,id,3,3,"button",21),o.Sb(),o.Sb()),2&e){const e=t.$implicit,n=o.ec();o.Bb(1),o.kc("table-body-checkbox",e.id),o.Bb(2),o.Ic(e.name),o.Bb(2),o.Ic(e.type),o.Bb(2),o.Ic(e.display_name),o.Bb(2),o.Ic(e.updated_at?o.gc(10,6,e.updated_at):"-"),o.Bb(3),o.kc("ngIf",n.currentUser.hasPermission("tags.update"))}}function sd(e,t){1&e&&(o.Tb(0,"no-results-message",24),o.Tb(1,"span",25),o.Hc(2,"No tags have been created yet"),o.Sb(),o.Sb())}let od=(()=>{class e{constructor(e,t,n,i){this.tags=e,this.currentUser=t,this.datatable=n,this.settings=i,this.tags$=this.datatable.data$}ngOnInit(){var e;this.showFilterPanel=(null===(e=this.settings.get("vebto.admin.tagTypes"))||void 0===e?void 0:e.length)>1,this.datatable.init({uri:Ll.BASE_URI})}maybeDeleteSelectedTags(){this.datatable.confirmResourceDeletion("tags").subscribe(()=>{this.tags.delete(this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset()})})}showCrupdateTagModal(e){this.datatable.openCrupdateResourceModal(Jl,{tag:e}).subscribe()}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(Ll),o.Nb(st.a),o.Nb(jt),o.Nb(at.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["tags"]],features:[o.Ab([jt])],decls:25,vars:9,consts:[[1,"datatable","responsive-table"],["pluralResourceName","tags"],["leftContent",""],["mat-raised-button","","color","accent","headerActions","","trans","",3,"click",4,"ngIf"],["mat-raised-button","","color","accent","rightContent","","trans","",3,"click",4,"ngIf"],[4,"ngIf"],[1,"material-table"],["table-header-checkbox",""],["table-sort-header","","trans",""],["table-sort-header","updated_at","trans",""],[4,"ngFor","ngForOf"],["svgImage","folder.svg",4,"ngIf"],["mat-raised-button","","color","accent","headerActions","","trans","",3,"click"],["mat-raised-button","","color","accent","rightContent","","trans","",3,"click"],["tableFilters",""],[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(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"datatable-header",1),o.Rb(2,2),o.Fc(3,Zl,2,0,"button",3),o.Qb(),o.Fc(4,ed,2,0,"button",4),o.Fc(5,nd,2,0,void 0,5),o.Sb(),o.Tb(6,"table",6),o.Tb(7,"thead"),o.Tb(8,"tr"),o.Ob(9,"th",7),o.Tb(10,"th",8),o.Hc(11,"Name"),o.Sb(),o.Tb(12,"th",8),o.Hc(13,"Type"),o.Sb(),o.Tb(14,"th",8),o.Hc(15,"Display Name"),o.Sb(),o.Tb(16,"th",9),o.Hc(17,"Last Updated"),o.Sb(),o.Ob(18,"th"),o.Sb(),o.Sb(),o.Tb(19,"tbody"),o.Fc(20,ad,13,8,"tr",10),o.fc(21,"async"),o.Sb(),o.Sb(),o.Fc(22,sd,3,0,"no-results-message",11),o.fc(23,"async"),o.Ob(24,"datatable-footer"),o.Sb()),2&e&&(o.Bb(3),o.kc("ngIf",t.currentUser.hasPermission("tags.create")),o.Bb(1),o.kc("ngIf",t.currentUser.hasPermission("tags.delete")),o.Bb(1),o.kc("ngIf",t.showFilterPanel),o.Bb(15),o.kc("ngForOf",o.gc(21,5,t.tags$)),o.Bb(2),o.kc("ngIf",o.gc(23,7,t.datatable.paginator.noResults$)))},directives:[bn,i.t,hn,vn,vt.a,i.s,yn,u.b,Wl,Tn,I.a,P.a,Cn.a],pipes:[i.b,wn.a,lt.a],encapsulation:2}),e})();var rd=n("90az");const cd=["editButton"];function ld(e,t){1&e&&(o.Tb(0,"th",2),o.Hc(1,"Owner"),o.Sb())}function dd(e,t){1&e&&(o.Tb(0,"th",8),o.Hc(1,"Type"),o.Sb())}function bd(e,t){if(1&e&&(o.Tb(0,"td",18),o.Ob(1,"user-column",19),o.Sb()),2&e){const e=o.ec().$implicit;o.Bb(1),o.kc("user",e.user)}}function ud(e,t){if(1&e&&(o.Tb(0,"td",20),o.Hc(1),o.Sb()),2&e){const e=o.ec().$implicit,t=o.ec();o.Bb(1),o.Ic(e.type?t.viewName(e.type):"default")}}function hd(e,t){1&e&&o.Pb(0)}const pd=function(e){return{page:e}};function gd(e,t){if(1&e&&(o.Tb(0,"tr"),o.Ob(1,"td",9),o.Tb(2,"td",10),o.Tb(3,"a",11),o.Hc(4),o.Sb(),o.Sb(),o.Fc(5,bd,2,1,"td",12),o.Tb(6,"td",13),o.Hc(7),o.Sb(),o.Fc(8,ud,2,1,"td",14),o.Tb(9,"td",15),o.Hc(10),o.fc(11,"formattedDate"),o.Sb(),o.Tb(12,"td",16),o.Fc(13,hd,1,0,"ng-container",17),o.Sb(),o.Sb()),2&e){const e=t.$implicit,n=o.ec();o.Bb(1),o.kc("table-body-checkbox",e.id),o.Bb(2),o.kc("href",n.getPageUrl(e),o.xc),o.Bb(1),o.Ic(e.slug),o.Bb(1),o.kc("ngIf",n.showOwnerColumn),o.Bb(2),o.Ic(e.body),o.Bb(1),o.kc("ngIf",n.showTypeColumn),o.Bb(2),o.Ic(o.gc(11,9,e.updated_at)),o.Bb(3),o.kc("ngTemplateOutlet",n.editButtonTemplate)("ngTemplateOutletContext",o.oc(11,pd,e))}}let md=(()=>{class e{constructor(e){this.settings=e,this.pages=[],this.showOwnerColumn=!1,this.showTypeColumn=!1}getPageUrl(e){return this.settings.getBaseUrl()+"pages/"+e.id+"/"+e.slug}viewName(e){return e.replace(/_/g," ")}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(at.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["custom-page-table"]],contentQueries:function(e,t,n){var i;1&e&&o.Gb(n,cd,!0),2&e&&o.rc(i=o.bc())&&(t.editButtonTemplate=i.first)},inputs:{pages:"pages",showOwnerColumn:"showOwnerColumn",showTypeColumn:"showTypeColumn"},decls:15,vars:3,consts:[[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"],["trans",""],[4,"ngFor","ngForOf"],["table-sort-header","","trans","",1,"type-column"],[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"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["data-label","Owner"],[3,"user"],["data-label","Type",1,"type-column"]],template:function(e,t){1&e&&(o.Tb(0,"table",0),o.Tb(1,"thead"),o.Tb(2,"tr"),o.Ob(3,"th",1),o.Tb(4,"th",2),o.Hc(5,"Slug"),o.Sb(),o.Fc(6,ld,2,0,"th",3),o.Tb(7,"th",4),o.Hc(8,"Body"),o.Sb(),o.Fc(9,dd,2,0,"th",5),o.Tb(10,"th",6),o.Hc(11,"Last Updated"),o.Sb(),o.Ob(12,"th"),o.Sb(),o.Sb(),o.Tb(13,"tbody"),o.Fc(14,gd,14,13,"tr",7),o.Sb(),o.Sb()),2&e&&(o.Bb(6),o.kc("ngIf",t.showOwnerColumn),o.Bb(3),o.kc("ngIf",t.showTypeColumn),o.Bb(5),o.kc("ngForOf",t.pages))},directives:[hn,vn,vt.a,i.t,i.s,Tn,i.A,Rn],pipes:[wn.a],styles:[".body-column[_ngcontent-%COMP%]{margin-right:25px;overflow:hidden}.type-column[_ngcontent-%COMP%]{text-transform:capitalize}"],changeDetection:0}),e})();function fd(e,t){1&e&&(o.Tb(0,"a",7),o.Hc(1,"Add"),o.Sb())}const vd=function(e){return[e,"edit"]};function _d(e,t){if(1&e&&(o.Tb(0,"a",9),o.fc(1,"trans"),o.Ob(2,"mat-icon",10),o.Sb()),2&e){const e=o.ec().page;o.kc("routerLink",o.oc(4,vd,e.id))("matTooltip",o.gc(1,2,"Edit page"))}}function Sd(e,t){if(1&e&&o.Fc(0,_d,3,6,"a",8),2&e){const e=o.ec();o.kc("ngIf",e.currentUser.hasPermission("custom_pages.update"))}}function yd(e,t){1&e&&(o.Tb(0,"no-results-message",11),o.Tb(1,"span",12),o.Hc(2,"No pages have been created yet"),o.Sb(),o.Sb())}let kd=(()=>{class e{constructor(e,t,n,i,a,s,o){this.settings=e,this.datatable=t,this.currentUser=n,this.customPages=i,this.toast=a,this.router=s,this.route=o,this.endpoint=this.route.snapshot.data.endpoint,this.pages$=this.datatable.data$}ngOnInit(){this.datatable.init({uri:this.endpoint||rd.a.BASE_URI,staticParams:{with:["user"]}})}maybeDeleteSelectedPages(){this.datatable.confirmResourceDeletion("tracking pixels").subscribe(()=>{this.customPages.delete(this.datatable.selectedRows$.value).subscribe(()=>{this.datatable.reset(),this.toast.open("Pages deleted")},e=>{this.toast.open(e.message||As.a.Default)})})}showUserColumn(){return this.router.url.indexOf("admin")>-1}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(at.a),o.Nb(jt),o.Nb(st.a),o.Nb(rd.a),o.Nb(mt.b),o.Nb(c.d),o.Nb(c.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["custom-pages-index"]],features:[o.Ab([jt])],decls:13,vars:12,consts:[[1,"datatable","responsive-table"],["pluralResourceName","custom pages"],["routerLink","new","mat-raised-button","","color","accent","leftContent","","trans","",4,"ngIf"],["mat-raised-button","","color","accent","rightContent","","trans","",3,"matTooltip","click"],[3,"showOwnerColumn","showTypeColumn","pages"],["editButton",""],["svgImage","custom-page.svg",4,"ngIf"],["routerLink","new","mat-raised-button","","color","accent","leftContent","","trans",""],["mat-icon-button","",3,"routerLink","matTooltip",4,"ngIf"],["mat-icon-button","",3,"routerLink","matTooltip"],["svgIcon","edit"],["svgImage","custom-page.svg"],["primary-text","","trans",""]],template:function(e,t){1&e&&(o.Tb(0,"div",0),o.Tb(1,"datatable-header",1),o.Fc(2,fd,2,0,"a",2),o.Tb(3,"button",3),o.ac("click",(function(){return t.maybeDeleteSelectedPages()})),o.fc(4,"trans"),o.Hc(5,"Delete Selected"),o.Sb(),o.Sb(),o.Tb(6,"custom-page-table",4),o.fc(7,"async"),o.Fc(8,Sd,1,1,"ng-template",null,5,o.Gc),o.Sb(),o.Fc(10,yd,3,0,"no-results-message",6),o.fc(11,"async"),o.Ob(12,"datatable-footer"),o.Sb()),2&e&&(o.Bb(2),o.kc("ngIf",t.currentUser.hasPermission("custom_pages.create")),o.Bb(1),o.kc("matTooltip",o.gc(4,6,"Delete selected")),o.Bb(3),o.kc("showOwnerColumn",t.showUserColumn())("showTypeColumn",!t.endpoint)("pages",o.gc(7,8,t.datatable.data$)),o.Bb(4),o.kc("ngIf",o.gc(11,10,t.datatable.paginator.noResults$)))},directives:[bn,i.t,u.b,vt.a,I.a,md,yn,c.g,u.a,P.a,Cn.a],pipes:[lt.a,i.b],encapsulation:2,changeDetection:0}),e})();var Td=n("3E0/"),Cd=n("mrSG"),wd=n("5o4b");let xd=(()=>{class e{constructor(e,t,n,i,a){this.settings=e,this.zone=t,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(e){return this.editorIsReady()&&this.tinymceInstance.queryCommandState(e)}execCommand(e,t=null){this.waitForEditor().then(()=>{this.zone.run(()=>{this.tinymceInstance.execCommand(e,!1,t)})})}getContents(e){return this.editorIsReady()?this.tinymceInstance.getContent(e):""}setContents(e){this.waitForEditor().then(()=>{this.tinymceInstance.undoManager&&(this.tinymceInstance.undoManager.transact(()=>{this.tinymceInstance.setContent(e)}),this.tinymceInstance.selection.setCursorLocation(),this.tinymceInstance.nodeChanged(),this.tinymceInstance.execCommand("mceResize"))})}insertContents(e){this.waitForEditor().then(()=>{this.tinymceInstance.execCommand("mceInsertContent",!1,e),setTimeout(()=>this.tinymceInstance.selection.collapse())})}insertImage(e){this.waitForEditor().then(()=>{this.insertContents('<img src="'+e+'"/>'),setTimeout(()=>this.execCommand("mceAutoResize"),500)})}waitForEditor(){return this.tinymceInstance?new Promise(e=>e(this.tinymceInstance)):this.bootstrapPromise?this.bootstrapPromise:void 0}setConfig(e){this.config=e,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 e={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,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:e=>{this.tinymceInstance=e,e.on("change",()=>this.config.onChange.emit(e.getContent())),e.on("click",()=>{this.zone.run(()=>{})}),e.shortcuts.add("ctrl+13","desc",()=>{this.zone.run(()=>{this.config.onChange.emit(e.getContent()),this.config.onCtrlEnter.emit()})})},init_instance_callback:()=>{this.bootstrapPromise=!1,this.bootstrapPromiseResolve(this.tinymceInstance)}};if(this.breakpoints.isMobile$.value||(e.toolbar=!1),this.config.showAdvancedControls&&(e.plugins=e.plugins.concat(["media","hr","visualblocks","visualchars","wordcount"]),e.forced_root_block="p",e.statusbar=!0,e.autoresize_on_init=!0,e.extended_valid_elements="svg[*],use[*],iframe[src|frameborder|width|height|allow=*|allowfullscreen],script[src]",e.elementpath=!0,e.content_css.push(this.settings.getAssetUrl()+"css/advanced-editor-styles.css"),e.target_list=[{title:this.i18n.t("Current window"),value:""},{title:this.i18n.t("New Window"),value:"_blank"}]),"auto"===this.config.minHeight){const t=this.config.editorEl.nativeElement.parentElement.offsetHeight-74-4;e.min_height=t,e.max_height=t}tinymce.init(e)}destroyEditor(){try{this.tinymceInstance&&this.tinymceInstance.remove(),this.tinymceInstance=null,this.makeBootstrapPromise()}catch(e){}}makeBootstrapPromise(){this.bootstrapPromise=new Promise(e=>this.bootstrapPromiseResolve=e)}}return e.\u0275fac=function(t){return new(t||e)(o.Xb(at.a),o.Xb(o.A),o.Xb(wd.a),o.Xb(ot.a),o.Xb(Xr.a))},e.\u0275prov=o.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Id=n("JYI4"),Od=n("WmcL"),Md=n("sJvS"),Dd=n("tU2R"),Bd=n("JWVf");let Hd=(()=>{class e extends Md.a{constructor(){super(...arguments),this.DEFAULT_MAX_SIZE_MB=3}initValidations(){const e=[new Dd.a({maxSize:Object(Ja.a)(this.DEFAULT_MAX_SIZE_MB,"MB")},this.i18n),new Bd.a({types:["image"]},this.i18n)];this.validations.push(...e)}}return e.\u0275fac=function(t){return Pd(t||e)},e.\u0275prov=o.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const Pd=o.Vb(Hd),Fd=["visualArea"],Ad=["sourceArea"];function Rd(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",3),o.Tb(1,"button",4),o.ac("click",(function(){return o.vc(e),o.ec().openFileUploadDialog()})),o.fc(2,"trans"),o.Ob(3,"mat-icon",19),o.Sb(),o.Sb()}2&e&&(o.Bb(1),o.kc("matTooltip",o.gc(2,1,"Add Attachment")))}function Nd(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",3),o.Tb(1,"button",4),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("codesample")})),o.fc(2,"trans"),o.Ob(3,"mat-icon",20),o.Sb(),o.Sb()}2&e&&(o.Bb(1),o.kc("matTooltip",o.gc(2,1,"Insert Code Sample")))}function Ed(e,t){if(1&e){const e=o.Ub();o.Tb(0,"button",23),o.ac("click",(function(){return o.vc(e),o.ec(2).openInsertImageModal()})),o.fc(1,"trans"),o.Ob(2,"mat-icon",24),o.Sb()}2&e&&o.kc("matTooltip",o.gc(1,1,"Insert Image"))}function Vd(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",3),o.Tb(1,"button",4),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("mceLink")})),o.fc(2,"trans"),o.Ob(3,"mat-icon",21),o.Sb(),o.Fc(4,Ed,3,3,"button",22),o.Sb()}if(2&e){const e=o.ec();o.Bb(1),o.Fb("active",e.queryCommandState("link")),o.kc("matTooltip",o.gc(2,4,"Insert Link")),o.Bb(3),o.kc("ngIf",e.currentUser.hasPermission("files.create"))}}function $d(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",1),o.Tb(1,"div",3),o.Tb(2,"button",25),o.Tb(3,"span",26),o.Hc(4,"Insert"),o.Sb(),o.Ob(5,"mat-icon",27),o.Sb(),o.Tb(6,"mat-menu",null,28),o.Tb(8,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("InsertHorizontalRule")})),o.Ob(9,"mat-icon",30),o.Tb(10,"span",26),o.Hc(11,"Horizontal Line"),o.Sb(),o.Sb(),o.Tb(12,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("mceLink")})),o.Ob(13,"mat-icon",21),o.Tb(14,"span",26),o.Hc(15,"Link"),o.Sb(),o.Sb(),o.Tb(16,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("mceMedia")})),o.Ob(17,"mat-icon",31),o.Tb(18,"span",26),o.Hc(19,"Media"),o.Sb(),o.Sb(),o.Tb(20,"div",32),o.ac("click",(function(){return o.vc(e),o.ec().insertInfoContainer("important")})),o.Ob(21,"mat-icon",33),o.Tb(22,"span",26),o.Hc(23,"Important"),o.Sb(),o.Sb(),o.Tb(24,"div",32),o.ac("click",(function(){return o.vc(e),o.ec().insertInfoContainer("warning")})),o.Ob(25,"mat-icon",34),o.Tb(26,"span",26),o.Hc(27,"Warning"),o.Sb(),o.Sb(),o.Tb(28,"div",32),o.ac("click",(function(){return o.vc(e),o.ec().insertInfoContainer("note")})),o.Ob(29,"mat-icon",35),o.Tb(30,"span",26),o.Hc(31,"Note"),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Tb(32,"div",3),o.Tb(33,"button",36),o.Tb(34,"span",26),o.Hc(35,"Format"),o.Sb(),o.Ob(36,"mat-icon",27),o.Sb(),o.Tb(37,"mat-menu",37,38),o.Tb(39,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("FormatBlock","h1")})),o.Tb(40,"div",39),o.Hc(41,"Heading 1"),o.Sb(),o.Tb(42,"div",40),o.Hc(43,"Ctrl+Alt+1"),o.Sb(),o.Sb(),o.Tb(44,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("FormatBlock","h2")})),o.Tb(45,"div",39),o.Hc(46,"Heading 2"),o.Sb(),o.Tb(47,"div",40),o.Hc(48,"Ctrl+Alt+2"),o.Sb(),o.Sb(),o.Tb(49,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("FormatBlock","h3")})),o.Tb(50,"div",39),o.Hc(51,"Heading 3"),o.Sb(),o.Tb(52,"div",40),o.Hc(53,"Ctrl+Alt+3"),o.Sb(),o.Sb(),o.Tb(54,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("strikethrough")})),o.Tb(55,"div",39),o.Hc(56,"Strikethrough"),o.Sb(),o.Tb(57,"div",40),o.Hc(58,"Alt+Shift+5"),o.Sb(),o.Sb(),o.Tb(59,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("superscript")})),o.Tb(60,"div",39),o.Hc(61,"Superscript"),o.Sb(),o.Tb(62,"div",40),o.Hc(63,"Ctrl+."),o.Sb(),o.Sb(),o.Tb(64,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("subscript")})),o.Tb(65,"div",39),o.Hc(66,"Subscript"),o.Sb(),o.Tb(67,"div",40),o.Hc(68,"Ctrl+,"),o.Sb(),o.Sb(),o.Tb(69,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("mceBlockQuote")})),o.Tb(70,"div",39),o.Hc(71,"Blockquote"),o.Sb(),o.Tb(72,"div",40),o.Hc(73,"Ctrl+Alt+B"),o.Sb(),o.Sb(),o.Tb(74,"div",29),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("FormatBlock","p")})),o.Tb(75,"div",39),o.Hc(76,"Paragraph"),o.Sb(),o.Tb(77,"div",40),o.Hc(78,"Ctrl+Alt+0"),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Tb(79,"div",3),o.Tb(80,"button",41,42),o.Tb(82,"span",26),o.Hc(83,"Color"),o.Sb(),o.Ob(84,"mat-icon",27),o.Sb(),o.Tb(85,"mat-menu",43,44),o.Tb(87,"div",45),o.ac("click",(function(){o.vc(e);const t=o.sc(81);return o.ec().showColorPicker("ForeColor",t)})),o.Ob(88,"mat-icon",46),o.Tb(89,"span",26),o.Hc(90,"Text Color"),o.Sb(),o.Sb(),o.Tb(91,"div",47),o.ac("click",(function(){o.vc(e);const t=o.sc(81);return o.ec().showColorPicker("HiliteColor",t)})),o.Ob(92,"mat-icon",48),o.Tb(93,"span",26),o.Hc(94,"Background Color"),o.Sb(),o.Sb(),o.Sb(),o.Sb(),o.Tb(95,"div",3),o.Tb(96,"button",4),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("justifyLeft")})),o.fc(97,"trans"),o.Ob(98,"mat-icon",49),o.Sb(),o.Tb(99,"button",4),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("justifyCenter")})),o.fc(100,"trans"),o.Ob(101,"mat-icon",50),o.Sb(),o.Tb(102,"button",4),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("justifyRight")})),o.fc(103,"trans"),o.Ob(104,"mat-icon",51),o.Sb(),o.Sb(),o.Tb(105,"div",3),o.Tb(106,"button",4),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("Outdent")})),o.fc(107,"trans"),o.Ob(108,"mat-icon",52),o.Sb(),o.Tb(109,"button",4),o.ac("click",(function(){return o.vc(e),o.ec().execCommand("Indent")})),o.fc(110,"trans"),o.Ob(111,"mat-icon",53),o.Sb(),o.Sb(),o.Tb(112,"div",54),o.Tb(113,"button",55),o.ac("click",(function(){return o.vc(e),o.ec().showVisualEditor()})),o.Hc(114,"Visual "),o.Sb(),o.Tb(115,"button",56),o.ac("click",(function(){return o.vc(e),o.ec().showSourceEditor()})),o.Hc(116,"Source "),o.Sb(),o.Sb(),o.Sb()}if(2&e){const e=o.sc(7),t=o.sc(38),n=o.sc(86),i=o.ec();o.Bb(2),o.kc("matMenuTriggerFor",e),o.Bb(31),o.kc("matMenuTriggerFor",t),o.Bb(47),o.kc("matMenuTriggerFor",n),o.Bb(16),o.Fb("active",i.queryCommandState("justifyLeft")),o.kc("matTooltip",o.gc(97,18,"Align Left")),o.Bb(3),o.Fb("active",i.queryCommandState("justifyCenter")),o.kc("matTooltip",o.gc(100,20,"Center")),o.Bb(3),o.Fb("active",i.queryCommandState("justifyRight")),o.kc("matTooltip",o.gc(103,22,"Align Right")),o.Bb(4),o.kc("matTooltip",o.gc(107,24,"Decrease Indent")),o.Bb(3),o.kc("matTooltip",o.gc(110,26,"Increase Indent")),o.Bb(4),o.Fb("active","visual"===i.activeEditor),o.Bb(2),o.Fb("active","source"===i.activeEditor)}}const Ld=[[["","customButtons",""]],[["","header",""]],[["","footer",""]]],zd=["[customButtons]","[header]","[footer]"];let jd=(()=>{class e{constructor(e,t,n,i,s,r,c,l){this.editor=e,this.currentUser=t,this.uploadQueue=n,this.settings=i,this.renderer=s,this.el=r,this.overlayPanel=c,this.imageValidator=l,this.sourceAreaControl=new a.i,this.activeEditor="visual",this.showAdvancedControls=!1,this.basic=!1,this.minHeight=183,this.maxHeight=530,this.onChange=new o.n,this.onCtrlEnter=new o.n,this.onFileUpload=new o.n}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(e){return this.editor.queryCommandState(e)}execCommand(e,t=null){this.editor.execCommand(e,t)}insertInfoContainer(e){this.insertContents(`<div class="widget widget-${e}"><div class="title">${Object(Od.a)(e)}:</div><br></div><br>`)}showColorPicker(e,t){return Object(Cd.a)(this,void 0,void 0,(function*(){const{BeColorPickerModule:i}=yield n.e(1).then(n.bind(null,"0PT2"));this.overlayPanel.open(i.components.panel,{origin:new o.l(t),position:Id.a}).valueChanged().pipe(Object(Ht.a)(50)).subscribe(t=>{this.execCommand(e,t)})}))}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(){Object(Ls.a)({multiple:!0}).then(e=>{this.onFileUpload.emit(e)})}openInsertImageModal(){const e={uri:Fs.a.Image,validator:this.imageValidator,httpParams:{diskPrefix:this.inlineUploadPrefix}};Object(Ls.a)({types:[$s.a.image]}).then(t=>{this.uploadQueue.start(t,e).subscribe(e=>{this.insertImage(e.fileEntry.url)})})}getContents(){return this.editor.getContents()}setContents(e){this.editor.setContents(e)}insertContents(e){this.editor.insertContents(e)}insertImage(e){this.editor.insertImage(e)}insertLink(e){this.insertContents(`<a href="${e.href}" target="${e.target||"self"}">${e.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 e.\u0275fac=function(t){return new(t||e)(o.Nb(xd),o.Nb(st.a),o.Nb(Vs.a),o.Nb(at.a),o.Nb(o.G),o.Nb(o.l),o.Nb(Qt.a),o.Nb(Hd))},e.\u0275cmp=o.Hb({type:e,selectors:[["text-editor"]],viewQuery:function(e,t){var n;1&e&&(o.Bc(Fd,!0),o.Bc(Ad,!0)),2&e&&(o.rc(n=o.bc())&&(t.visualTextArea=n.first),o.rc(n=o.bc())&&(t.sourceTextArea=n.first))},inputs:{showAdvancedControls:"showAdvancedControls",basic:"basic",minHeight:"minHeight",maxHeight:"maxHeight",inlineUploadPrefix:"inlineUploadPrefix"},outputs:{onChange:"onChange",onCtrlEnter:"onCtrlEnter",onFileUpload:"onFileUpload"},features:[o.Ab([Vs.a,xd])],ngContentSelectors:zd,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(e,t){1&e&&(o.jc(Ld),o.Tb(0,"div",0),o.Tb(1,"div",1),o.Fc(2,Rd,4,3,"div",2),o.Fc(3,Nd,4,3,"div",2),o.Tb(4,"div",3),o.Tb(5,"button",4),o.ac("click",(function(){return t.execCommand("undo")})),o.fc(6,"trans"),o.Ob(7,"mat-icon",5),o.Sb(),o.Tb(8,"button",4),o.ac("click",(function(){return t.execCommand("redo")})),o.fc(9,"trans"),o.Ob(10,"mat-icon",6),o.Sb(),o.Sb(),o.Tb(11,"div",3),o.Tb(12,"button",4),o.ac("click",(function(){return t.execCommand("bold")})),o.fc(13,"trans"),o.Ob(14,"mat-icon",7),o.Sb(),o.Tb(15,"button",4),o.ac("click",(function(){return t.execCommand("italic")})),o.fc(16,"trans"),o.Ob(17,"mat-icon",8),o.Sb(),o.Tb(18,"button",4),o.ac("click",(function(){return t.execCommand("underline")})),o.fc(19,"trans"),o.Ob(20,"mat-icon",9),o.Sb(),o.Sb(),o.Tb(21,"div",3),o.Tb(22,"button",4),o.ac("click",(function(){return t.execCommand("insertunorderedlist")})),o.fc(23,"trans"),o.Ob(24,"mat-icon",10),o.Sb(),o.Tb(25,"button",4),o.ac("click",(function(){return t.execCommand("insertorderedlist")})),o.fc(26,"trans"),o.Ob(27,"mat-icon",11),o.Sb(),o.Sb(),o.Fc(28,Vd,5,6,"div",2),o.ic(29),o.Tb(30,"div",12),o.Tb(31,"button",4),o.ac("click",(function(){return t.execCommand("removeformat")})),o.fc(32,"trans"),o.Ob(33,"mat-icon",13),o.Sb(),o.Sb(),o.ic(34,1),o.Sb(),o.Fc(35,$d,117,28,"div",14),o.Sb(),o.Tb(36,"textarea",15,16),o.ac("blur",(function(){return t.setContents(t.sourceAreaControl.value)})),o.Sb(),o.Ob(38,"textarea",17,18),o.ic(40,2)),2&e&&(o.Bb(2),o.kc("ngIf",t.inlineUploadPrefix&&t.currentUser.hasPermission("files.create")&&t.onFileUpload.observers.length),o.Bb(1),o.kc("ngIf",!t.basic),o.Bb(2),o.Fb("disabled",!t.hasUndo()),o.kc("matTooltip",o.gc(6,31,"Undo")),o.Bb(3),o.Fb("disabled",!t.hasRedo()),o.kc("matTooltip",o.gc(9,33,"Redo")),o.Bb(4),o.Fb("active",t.queryCommandState("bold")),o.kc("matTooltip",o.gc(13,35,"Bold")),o.Bb(3),o.Fb("active",t.queryCommandState("italic")),o.kc("matTooltip",o.gc(16,37,"Italic")),o.Bb(3),o.Fb("active",t.queryCommandState("underline")),o.kc("matTooltip",o.gc(19,39,"Underline")),o.Bb(4),o.Fb("active",t.queryCommandState("unorderedlist")),o.kc("matTooltip",o.gc(23,41,"Unordered List")),o.Bb(3),o.Fb("active",t.queryCommandState("orderedlist")),o.kc("matTooltip",o.gc(26,43,"Ordered List")),o.Bb(3),o.kc("ngIf",!t.basic),o.Bb(3),o.kc("matTooltip",o.gc(32,45,"Remove Formatting")),o.Bb(4),o.kc("ngIf",t.showAdvancedControls),o.Bb(1),o.Cc("min-height",t.minHeight),o.kc("formControl",t.sourceAreaControl),o.Bb(2),o.Cc("min-height",t.minHeight))},directives:[i.t,I.a,P.a,a.d,a.u,a.j,C.c,vt.a,C.d,C.a],pipes:[lt.a],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){.editor-header[_ngcontent-%COMP%]{display:none}}"],changeDetection:0}),e})();function Ud(e,t){if(1&e){const e=o.Ub();o.Rb(0),o.Tb(1,"div",3),o.Hc(2),o.Sb(),o.Tb(3,"div",4),o.Ob(4,"input",5),o.Sb(),o.Tb(5,"button",6),o.ac("click",(function(){return o.vc(e),o.ec().save()})),o.Hc(6,"Save"),o.Sb(),o.Qb()}if(2&e){const e=o.ec();o.Bb(2),o.Ic(e.baseUri+e.getPrefix()),o.Bb(2),o.kc("formControl",e.slugControl)}}function qd(e,t){if(1&e&&(o.Rb(0),o.Tb(1,"a",8),o.Hc(2),o.Sb(),o.Qb()),2&e){const e=t.ngIf;o.Bb(1),o.kc("href",e,o.xc)("title",e),o.Bb(1),o.Ic(e)}}function Gd(e,t){if(1&e){const e=o.Ub();o.Fc(0,qd,3,3,"ng-container",7),o.fc(1,"async"),o.Tb(2,"button",6),o.ac("click",(function(){return o.vc(e),o.ec().startEditing()})),o.Hc(3,"Edit"),o.Sb()}if(2&e){const e=o.ec();o.kc("ngIf",e.baseUri+e.getPrefix()+o.gc(1,1,e.slug$))}}let Yd=(()=>{class e{constructor(e){this.settings=e,this.slug$=new ht.a(""),this.editing$=new ht.a(!1),this.slugControl=new a.i,this.baseUri=this.settings.getBaseUrl()}writeValue(e){this.slug$.next(e),this.slugControl.setValue(e)}registerOnChange(e){this.propagateChange=e}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 e.\u0275fac=function(t){return new(t||e)(o.Nb(at.a))},e.\u0275cmp=o.Hb({type:e,selectors:[["slug-control"]],inputs:{prefix:"prefix"},features:[o.Ab([{provide:a.s,useExisting:e,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(e,t){if(1&e&&(o.Ob(0,"mat-icon",0),o.Fc(1,Ud,7,2,"ng-container",1),o.fc(2,"async"),o.Fc(3,Gd,4,3,"ng-template",null,2,o.Gc)),2&e){const e=o.sc(4);o.Bb(1),o.kc("ngIf",o.gc(2,2,t.editing$))("ngIfElse",e)}},directives:[P.a,i.t,a.d,a.u,a.j,u.b,vt.a],pipes:[i.b],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}),e})();function Xd(e,t){if(1&e&&(o.Tb(0,"div",19),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.title)}}function Qd(e,t){if(1&e&&(o.Tb(0,"div",19),o.Hc(1),o.Sb()),2&e){const e=o.ec(2).ngIf;o.Bb(1),o.Ic(e.slug)}}function Jd(e,t){if(1&e&&(o.Tb(0,"div",20),o.Ob(1,"slug-control",21),o.Fc(2,Qd,2,1,"div",6),o.Sb()),2&e){const e=o.ec().ngIf,t=o.ec();o.Bb(1),o.kc("prefix",t.slugPrefix()),o.Bb(1),o.kc("ngIf",e.slug)}}function Kd(e,t){1&e&&(o.Tb(0,"span",10),o.Hc(1,"Update"),o.Sb())}function Wd(e,t){1&e&&(o.Tb(0,"span",10),o.Hc(1,"Create"),o.Sb())}function Zd(e,t){if(1&e&&(o.Tb(0,"div",19),o.Hc(1),o.Sb()),2&e){const e=o.ec().ngIf;o.Bb(1),o.Ic(e.body)}}function eb(e,t){if(1&e){const e=o.Ub();o.Rb(0,1),o.Tb(1,"div",2),o.Tb(2,"div",3),o.Tb(3,"label",4),o.Hc(4,"Page Title"),o.Sb(),o.Ob(5,"input",5),o.Fc(6,Xd,2,1,"div",6),o.Sb(),o.Fc(7,Jd,3,2,"div",7),o.Tb(8,"div",8),o.Tb(9,"mat-slide-toggle",9),o.Hc(10,"Hide Navbar"),o.Sb(),o.Tb(11,"p",10),o.Hc(12,"Whether default site navbar should be hidden for this page."),o.Sb(),o.Sb(),o.Sb(),o.Tb(13,"div",11),o.Tb(14,"button",12),o.ac("click",(function(){return o.vc(e),o.ec().crupdatePage()})),o.Fc(15,Kd,2,0,"span",13),o.Fc(16,Wd,2,0,"span",13),o.Sb(),o.Tb(17,"a",14),o.Hc(18,"Cancel"),o.Sb(),o.Sb(),o.Tb(19,"div",15),o.Fc(20,Zd,2,1,"div",6),o.Sb(),o.Tb(21,"div",16),o.Tb(22,"text-editor",17),o.ac("onChange",(function(t){return o.vc(e),o.ec().setBody(t)})),o.Sb(),o.Sb(),o.Ob(23,"loading-indicator",18),o.fc(24,"async"),o.Qb()}if(2&e){const e=t.ngIf,n=o.ec();o.kc("formGroup",n.form),o.Bb(6),o.kc("ngIf",e.title),o.Bb(1),o.kc("ngIf",!n.hideSlug),o.Bb(8),o.kc("ngIf",n.page),o.Bb(1),o.kc("ngIf",!n.page),o.Bb(1),o.kc("routerLink",n.backRoute()),o.Bb(3),o.kc("ngIf",e.body),o.Bb(2),o.kc("showAdvancedControls",!0),o.Bb(1),o.kc("isVisible",o.gc(24,9,n.loading$))}}let tb=(()=>{class e{constructor(e,t,n,i,a){this.pages=e,this.route=t,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 ht.a(!1),this.updating$=new ht.a(!1),this.form=this.fb.group({title:[""],slug:[""],body:[""],type:[""],hide_nav:[!1]}),this.errors$=new ht.a({})}ngOnInit(){var e;this.route.params.subscribe(e=>{this.getPage(e.id)}),this.route.snapshot.data.hideSlug||(e=this.form.get("title")).valueChanges.pipe(Object(X.a)(e=>!!e),Object(Jt.a)()).subscribe(t=>{e.parent.get("slug").dirty||e.parent.get("slug").setValue(Object(pn.a)(t))})}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(Object(pt.a)(()=>this.loading$.next(!1))).subscribe(()=>{this.router.navigate(this.backRoute(),{relativeTo:this.route}),this.toast.open(this.updating$.value?"Page updated":"Page created")},e=>this.errors$.next(e.errors))}getPage(e){e&&(this.loading$.next(!0),this.pages.get(e).pipe(Object(Td.a)(0)).subscribe(e=>{this.updating$.next(!0),this.page=e.page,this.form.patchValue(e.page),this.textEditor.setContents(e.page.body||""),this.loading$.next(!1)}))}getPayload(){return Object.assign({},this.form.value)}setBody(e){this.form.patchValue({body:e})}backRoute(){return this.page?["../../"]:["../"]}slugPrefix(){return"pages/"+(this.page?this.page.id:"*")}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(rd.a),o.Nb(c.a),o.Nb(mt.b),o.Nb(c.d),o.Nb(a.h))},e.\u0275cmp=o.Hb({type:e,selectors:[["crupdate-page"]],viewQuery:function(e,t){var n;1&e&&o.Nc(jd,!0),2&e&&o.rc(n=o.bc())&&(t.textEditor=n.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(e,t){1&e&&(o.Fc(0,eb,25,11,"ng-container",0),o.fc(1,"async")),2&e&&o.kc("ngIf",o.gc(1,1,t.errors$))},directives:[i.t,a.v,a.m,vt.a,a.d,a.u,a.k,w.a,u.b,u.a,c.g,jd,si.a,Yd],pipes:[i.b],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}),e})();const nb=[{path:"",component:dt,canActivate:[bt.a,ut.a],canActivateChild:[bt.a,ut.a],data:{permissions:["admin.access"]},children:[{path:"",redirectTo:"analytics",pathMatch:"full"},{path:"analytics",loadChildren:()=>n.e(9).then(n.bind(null,"xur1")).then(e=>e.AnalyticsModule),canActivate:[bt.a],canActivateChild:[bt.a],data:{permissions:["reports.view"]}},{path:"users",component:rr,data:{permissions:["users.view"]}},{path:"roles",component:Nr,data:{permissions:["roles.view"]}},{path:"translations",component:uc,data:{permissions:["localizations.view"]}},{path:"tags",component:od,data:{permissions:["tags.view"]}},{path:"files",component:Sc,data:{permissions:["files.view"]}},{path:"ads",component:wc,data:{permissions:["ads.update"]}},{path:"custom-pages",component:kd,data:{permissions:["custom_pages.view"],name:"Custom Pages"}},{path:"custom-pages/new",component:tb,data:{permissions:["custom_pages.create"],name:"Add New Page"}},{path:"custom-pages/:id/edit",component:tb,data:{permissions:["custom_pages.update"],name:"Edit Page"}},{path:"plans",component:cl,canActivate:[ll.a],data:{permissions:["plans.view"]}},{path:"subscriptions",component:Dl,canActivate:[ll.a],data:{permissions:["subscriptions.view"]}},...bi,{path:"settings",component:Ti,resolve:{settings:l},data:{permissions:["settings.view"]},children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",component:Pi,pathMatch:"full"},{path:"authentication",component:Gi},{path:"cache",component:Wi},{path:"analytics",component:aa},{path:"localization",component:ba},{path:"mail",component:wa},{path:"logging",component:Da},{path:"queue",component:Ra},{path:"billing",component:Ga},{path:"uploading",component:Cs},{path:"recaptcha",component:Ps},{path:"gdpr",component:Vl},...ui]}]},{path:"appearance",loadChildren:()=>n.e(10).then(n.bind(null,"Eh8b")).then(e=>e.AppAppearanceModule),canActivate:[bt.a],canActivateChild:[bt.a],data:{permissions:["appearance.update"]}}];let ib=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[c.h.forChild(nb)],c.h]}),e})();var ab=n("X3pI");let sb=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,a.E,O.a,ab.a,P.b,g.g]]}),e})();var ob=n("gFpt"),rb=n("6JYt"),cb=n("Iysn");let lb=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,u.c,s.b,P.b]]}),e})();var db=n("MKyN");let bb=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,lb,db.a,O.a,s.b,P.b,u.c,C.b]]}),e})(),ub=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,g.g,u.c,P.b],P.b]}),e})(),hb=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,a.E,u.c,O.a,P.b]]}),e})(),pb=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,O.a,u.c,P.b,p.e]]}),e})();var gb=n("1ImS");let mb=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,c.h,gb.a,O.a,F.a,cb.a,N,ab.a,a.o,a.E,hb,P.b,u.c,I.b,w.b]]}),e})(),fb=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,O.a,a.E]]}),e})();var vb=n("CHUN"),_b=n("losq");let Sb=(()=>{class e{constructor(e){this.settings=e,this.settings.merge({vebto:et})}}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)(o.Xb(at.a))},providers:[Lt.a],imports:[[c.h,i.c,a.o,a.E,N,R,ob.a,rb.a,tt.a,M,gb.a,F.a,O.a,cb.a,ab.a,bb,ub,hb,pb,ib,mb,u.c,P.b,I.b,g.g,C.b,w.b,p.e,b.b,Ze.g,it.e,s.b,We.b,S.p,Ke,S.k,fb,vb.a,nt,S.r,sb,_b.a],c.h,i.c,a.o,a.E,N,R,O.a,F.a,ub,gb.a,u.c,P.b,x.c,h.b,I.b,g.g,C.b,w.b,p.e]}),e})(),yb=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[i.c,a.o,a.E,Sb,ub,cb.a,ab.a,gb.a,s.b,B.g]]}),e})()},JxJJ:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("fXoL"),a=n("L317");let s=(()=>{class e{constructor(e){this.theme=e,this.animation="wave",this.variant="text",this.dark=this.theme.isDarkMode()}get pulsate(){return"pulsate"===this.animation}get wave(){return"wave"===this.animation}get avatar(){return"avatar"===this.variant}get text(){return"text"===this.variant}get rect(){return"rect"===this.variant}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(a.a))},e.\u0275cmp=i.Hb({type:e,selectors:[["skeleton"]],hostAttrs:["aria-busy","true","aria-valuemin","0","aria-valuemax","100","aria-valuetext","Loading...","role","progressbar"],hostVars:12,hostBindings:function(e,t){2&e&&i.Fb("dark",t.dark)("pulsate",t.pulsate)("wave",t.wave)("avatar",t.avatar)("text",t.text)("rect",t.rect)},inputs:{animation:"animation",variant:"variant"},decls:0,vars:0,template:function(e,t){},styles:['@charset "UTF-8";[_nghost-%COMP%]{display:inline-block;overflow:hidden;position:relative;background-color:var(--be-divider-lighter);background-repeat:no-repeat;border-radius:4px;width:100%;height:100%;will-change:transform}.wave[_nghost-%COMP%]{-webkit-animation:wave 2s ease-in-out infinite;animation:wave 2s ease-in-out infinite;background-size:200px 100%;background-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.6),hsla(0,0%,100%,0))}.wave.dark[_nghost-%COMP%]{background-image:linear-gradient(90deg,transparent,rgba(0,0,0,.2),transparent)}.pulsate[_nghost-%COMP%]{-webkit-animation:pulse 1.5s ease-in-out infinite;animation:pulse 1.5s ease-in-out infinite;-webkit-animation-delay:.5s;animation-delay:.5s}.avatar[_nghost-%COMP%]{width:40px;height:40px;margin-right:10px;border-radius:4px;flex-shrink:0}.circle[_nghost-%COMP%]{border-radius:50%}.text[_nghost-%COMP%]{height:1.4rem;vertical-align:middle}.text[_nghost-%COMP%]:before{content:"\xa0"}@-webkit-keyframes wave{0%{background-position:-200px 0}to{background-position:calc(200px + 100%) 0}}@keyframes wave{0%{background-position:-200px 0}to{background-position:calc(200px + 100%) 0}}@-webkit-keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}@keyframes pulse{0%{opacity:1}50%{opacity:.4}to{opacity:1}}'],changeDetection:0}),e})()},NjxG:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n("fXoL"),a=n("kmQS"),s=n("tyNb");let o=(()=>{class e{constructor(e,t){this.settings=e,this.router=t}canActivate(e,t){return this.handle()}canActivateChild(e,t){return this.handle()}handle(){return!(!this.settings.get("billing.integrated")||!this.settings.get("billing.enable"))||(this.router.navigate(["/"]),!1)}}return e.\u0275fac=function(t){return new(t||e)(i.Xb(a.a),i.Xb(s.d))},e.\u0275prov=i.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},QibW:function(e,t,n){"use strict";n.d(t,"a",(function(){return C})),n.d(t,"b",(function(){return _})),n.d(t,"c",(function(){return w}));var i=n("fXoL"),a=n("FKr1"),s=n("8LU1"),o=n("3Pt+"),r=n("R1ws"),c=n("u47x"),l=n("0EQZ");const d=["input"],b=function(){return{enterDuration:150}},u=["*"],h=new i.r("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let p=0;const g={provide:o.s,useExisting:Object(i.V)(()=>_),multi:!0};class m{constructor(e,t){this.source=e,this.value=t}}const f=new i.r("MatRadioGroup");let v=(()=>{class e{constructor(e){this._changeDetector=e,this._value=null,this._name="mat-radio-group-"+p++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new i.n}get name(){return this._name}set name(e){this._name=e,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(e){this._labelPosition="before"===e?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(e){this._selected=e,this.value=e?e.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(e){this._disabled=Object(s.c)(e),this._markRadiosForCheck()}get required(){return this._required}set required(e){this._required=Object(s.c)(e),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(e=>{e.name=this.name,e._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(e=>{e.checked=this.value===e.value,e.checked&&(this._selected=e)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new m(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(e=>e._markForCheck())}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetector.markForCheck()}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(i.h))},e.\u0275dir=i.Ib({type:e,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),e})(),_=(()=>{class e extends v{}return e.\u0275fac=function(t){return S(t||e)},e.\u0275dir=i.Ib({type:e,selectors:[["mat-radio-group"]],contentQueries:function(e,t,n){var a;1&e&&i.Gb(n,C,!0),2&e&&i.rc(a=i.bc())&&(t._radios=a)},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[i.Ab([g,{provide:f,useExisting:e}]),i.yb]}),e})();const S=i.Vb(_);class y{constructor(e){this._elementRef=e}}const k=Object(a.w)(Object(a.z)(y));let T=(()=>{class e extends k{constructor(e,t,n,a,s,o,r){super(t),this._changeDetector=n,this._focusMonitor=a,this._radioDispatcher=s,this._animationMode=o,this._providerOverride=r,this._uniqueId="mat-radio-"+ ++p,this.id=this._uniqueId,this.change=new i.n,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=e,this._removeUniqueSelectionListener=s.listen((e,t)=>{e!==this.id&&t===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(e){const t=Object(s.c)(e);this._checked!==t&&(this._checked=t,t&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!t&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),t&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===e),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(e){this._labelPosition=e}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(e){this._setDisabled(Object(s.c)(e))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(e){this._required=Object(s.c)(e)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(e){this._color=e}get inputId(){return(this.id||this._uniqueId)+"-input"}focus(e){this._focusMonitor.focusVia(this._inputElement,"keyboard",e)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{!e&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new m(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(e){e.stopPropagation()}_onInputChange(e){e.stopPropagation();const t=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),t&&this.radioGroup._emitChangeEvent())}_setDisabled(e){this._disabled!==e&&(this._disabled=e,this._changeDetector.markForCheck())}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(v),i.Nb(i.l),i.Nb(i.h),i.Nb(c.h),i.Nb(l.c),i.Nb(String),i.Nb(void 0))},e.\u0275dir=i.Ib({type:e,viewQuery:function(e,t){var n;1&e&&i.Nc(d,!0),2&e&&i.rc(n=i.bc())&&(t._inputElement=n.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.yb]}),e})(),C=(()=>{class e extends T{constructor(e,t,n,i,a,s,o){super(e,t,n,i,a,s,o)}}return e.\u0275fac=function(t){return new(t||e)(i.Nb(f,8),i.Nb(i.l),i.Nb(i.h),i.Nb(c.h),i.Nb(l.c),i.Nb(r.a,8),i.Nb(h,8))},e.\u0275cmp=i.Hb({type:e,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(e,t){1&e&&i.ac("focus",(function(){return t._inputElement.nativeElement.focus()})),2&e&&(i.Cb("tabindex",-1)("id",t.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),i.Fb("mat-radio-checked",t.checked)("mat-radio-disabled",t.disabled)("_mat-animation-noopable","NoopAnimations"===t._animationMode)("mat-primary","primary"===t.color)("mat-accent","accent"===t.color)("mat-warn","warn"===t.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[i.yb],ngContentSelectors:u,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(e,t){if(1&e&&(i.jc(),i.Tb(0,"label",0,1),i.Tb(2,"div",2),i.Ob(3,"div",3),i.Ob(4,"div",4),i.Tb(5,"input",5,6),i.ac("change",(function(e){return t._onInputChange(e)}))("click",(function(e){return t._onInputClick(e)})),i.Sb(),i.Tb(7,"div",7),i.Ob(8,"div",8),i.Sb(),i.Sb(),i.Tb(9,"div",9),i.Tb(10,"span",10),i.Hc(11,"\xa0"),i.Sb(),i.ic(12),i.Sb(),i.Sb()),2&e){const e=i.sc(1);i.Cb("for",t.inputId),i.Bb(5),i.kc("id",t.inputId)("checked",t.checked)("disabled",t.disabled)("tabIndex",t.tabIndex)("required",t.required),i.Cb("name",t.name)("value",t.value)("aria-label",t.ariaLabel)("aria-labelledby",t.ariaLabelledby)("aria-describedby",t.ariaDescribedby),i.Bb(2),i.kc("matRippleTrigger",e)("matRippleDisabled",t._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",i.nc(18,b)),i.Bb(2),i.Fb("mat-radio-label-before","before"==t.labelPosition)}},directives:[a.q],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;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;height:20px;left:0;position:absolute;top:0;transition:transform ease 280ms,background-color ease 280ms;width:20px;transform:scale(0.001)}._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}.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}),e})(),w=(()=>{class e{}return e.\u0275mod=i.Lb({type:e}),e.\u0275inj=i.Kb({factory:function(t){return new(t||e)},imports:[[a.r,a.h],a.h]}),e})()},W5HX:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var i=function(e){return e.Image="uploads/images",e}({})},XhcP:function(e,t,n){"use strict";n.d(t,"a",(function(){return V})),n.d(t,"b",(function(){return $})),n.d(t,"c",(function(){return E})),n.d(t,"d",(function(){return z})),n.d(t,"e",(function(){return U})),n.d(t,"f",(function(){return L})),n.d(t,"g",(function(){return G}));var i=n("nLfN"),a=n("vxfF"),s=n("ofXK"),o=n("fXoL"),r=n("FKr1"),c=n("8LU1"),l=n("FtGj"),d=n("XNiG"),b=n("xgIS"),u=n("VRyK"),h=n("pLZG"),p=n("lJxs"),g=n("1G5W"),m=n("/uUt"),f=n("IzEk"),v=n("JX91"),_=n("Kj3r"),S=n("R0Ic"),y=n("R1ws"),k=n("u47x"),T=n("cH1L");const C=["*"];function w(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",2),o.ac("click",(function(){return o.vc(e),o.ec()._onBackdropClicked()})),o.Sb()}if(2&e){const e=o.ec();o.Fb("mat-drawer-shown",e._isShowingBackdrop())}}function x(e,t){1&e&&(o.Tb(0,"mat-drawer-content"),o.ic(1,2),o.Sb())}const I=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],O=["mat-drawer","mat-drawer-content","*"];function M(e,t){if(1&e){const e=o.Ub();o.Tb(0,"div",2),o.ac("click",(function(){return o.vc(e),o.ec()._onBackdropClicked()})),o.Sb()}if(2&e){const e=o.ec();o.Fb("mat-drawer-shown",e._isShowingBackdrop())}}function D(e,t){1&e&&(o.Tb(0,"mat-sidenav-content",3),o.ic(1,2),o.Sb())}const B=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],H=["mat-sidenav","mat-sidenav-content","*"],P=".mat-drawer-container{position:relative;z-index:1;box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer{transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}\n",F={transformDrawer:Object(S.m)("transform",[Object(S.j)("open, open-instant",Object(S.k)({transform:"none",visibility:"visible"})),Object(S.j)("void",Object(S.k)({"box-shadow":"none",visibility:"hidden"})),Object(S.l)("void => open-instant",Object(S.e)("0ms")),Object(S.l)("void <=> open, open-instant => void",Object(S.e)("400ms cubic-bezier(0.25, 0.8, 0.25, 1)"))])};function A(e){throw Error(`A drawer was already declared for 'position="${e}"'`)}const R=new o.r("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:function(){return!1}}),N=new o.r("MAT_DRAWER_CONTAINER");let E=(()=>{class e extends a.a{constructor(e,t,n,i,a){super(n,i,a),this._changeDetectorRef=e,this._container=t}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.h),o.Nb(Object(o.V)(()=>$)),o.Nb(o.l),o.Nb(a.c),o.Nb(o.A))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:4,hostBindings:function(e,t){2&e&&o.Cc("margin-left",t._container._contentMargins.left,"px")("margin-right",t._container._contentMargins.right,"px")},features:[o.yb],ngContentSelectors:C,decls:1,vars:0,template:function(e,t){1&e&&(o.jc(),o.ic(0))},encapsulation:2,changeDetection:0}),e})(),V=(()=>{class e{constructor(e,t,n,i,a,s,r){this._elementRef=e,this._focusTrapFactory=t,this._focusMonitor=n,this._platform=i,this._ngZone=a,this._doc=s,this._container=r,this._elementFocusedBeforeDrawerWasOpened=null,this._enableAnimations=!1,this._position="start",this._mode="over",this._disableClose=!1,this._opened=!1,this._animationStarted=new d.a,this._animationEnd=new d.a,this._animationState="void",this.openedChange=new o.n(!0),this._openedStream=this.openedChange.pipe(Object(h.a)(e=>e),Object(p.a)(()=>{})),this._closedStream=this.openedChange.pipe(Object(h.a)(e=>!e),Object(p.a)(()=>{})),this._destroyed=new d.a,this.onPositionChanged=new o.n,this._modeChanged=new d.a,this.openedChange.subscribe(e=>{e?(this._doc&&(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement),this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus()}),this._ngZone.runOutsideAngular(()=>{Object(b.a)(this._elementRef.nativeElement,"keydown").pipe(Object(h.a)(e=>e.keyCode===l.g&&!this.disableClose&&!Object(l.s)(e)),Object(g.a)(this._destroyed)).subscribe(e=>this._ngZone.run(()=>{this.close(),e.stopPropagation(),e.preventDefault()}))}),this._animationEnd.pipe(Object(m.a)((e,t)=>e.fromState===t.fromState&&e.toState===t.toState)).subscribe(e=>{const{fromState:t,toState:n}=e;(0===n.indexOf("open")&&"void"===t||"void"===n&&0===t.indexOf("open"))&&this.openedChange.emit(this._opened)})}get position(){return this._position}set position(e){(e="end"===e?"end":"start")!=this._position&&(this._position=e,this.onPositionChanged.emit())}get mode(){return this._mode}set mode(e){this._mode=e,this._updateFocusTrapState(),this._modeChanged.next()}get disableClose(){return this._disableClose}set disableClose(e){this._disableClose=Object(c.c)(e)}get autoFocus(){const e=this._autoFocus;return null==e?"side"!==this.mode:e}set autoFocus(e){this._autoFocus=Object(c.c)(e)}get opened(){return this._opened}set opened(e){this.toggle(Object(c.c)(e))}get openedStart(){return this._animationStarted.pipe(Object(h.a)(e=>e.fromState!==e.toState&&0===e.toState.indexOf("open")),Object(p.a)(()=>{}))}get closedStart(){return this._animationStarted.pipe(Object(h.a)(e=>e.fromState!==e.toState&&"void"===e.toState),Object(p.a)(()=>{}))}_takeFocus(){this.autoFocus&&this._focusTrap&&this._focusTrap.focusInitialElementWhenReady().then(e=>{e||"function"!=typeof this._elementRef.nativeElement.focus||this._elementRef.nativeElement.focus()})}_restoreFocus(){this.autoFocus&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,this._openedVia):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null,this._openedVia=null)}_isFocusWithinDrawer(){var e;const t=null===(e=this._doc)||void 0===e?void 0:e.activeElement;return!!t&&this._elementRef.nativeElement.contains(t)}ngAfterContentInit(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState()}ngAfterContentChecked(){this._platform.isBrowser&&(this._enableAnimations=!0)}ngOnDestroy(){this._focusTrap&&this._focusTrap.destroy(),this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(e){return this.toggle(!0,e)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0)}toggle(e=!this.opened,t){return this._setOpen(e,!e&&this._isFocusWithinDrawer(),t)}_setOpen(e,t,n="program"){return this._opened=e,e?(this._animationState=this._enableAnimations?"open":"open-instant",this._openedVia=n):(this._animationState="void",t&&this._restoreFocus()),this._updateFocusTrapState(),new Promise(e=>{this.openedChange.pipe(Object(f.a)(1)).subscribe(t=>e(t?"open":"close"))})}_getWidth(){return this._elementRef.nativeElement&&this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=this.opened&&"side"!==this.mode)}_animationStartListener(e){this._animationStarted.next(e)}_animationDoneListener(e){this._animationEnd.next(e)}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.l),o.Nb(k.i),o.Nb(k.h),o.Nb(i.a),o.Nb(o.A),o.Nb(s.e,8),o.Nb(N,8))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-drawer"]],hostAttrs:["tabIndex","-1",1,"mat-drawer"],hostVars:12,hostBindings:function(e,t){1&e&&o.Dc("@transform.start",(function(e){return t._animationStartListener(e)}))("@transform.done",(function(e){return t._animationDoneListener(e)})),2&e&&(o.Cb("align",null),o.Ec("@transform",t._animationState),o.Fb("mat-drawer-end","end"===t.position)("mat-drawer-over","over"===t.mode)("mat-drawer-push","push"===t.mode)("mat-drawer-side","side"===t.mode)("mat-drawer-opened",t.opened))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",onPositionChanged:"positionChanged",openedStart:"openedStart",closedStart:"closedStart"},exportAs:["matDrawer"],ngContentSelectors:C,decls:2,vars:0,consts:[[1,"mat-drawer-inner-container"]],template:function(e,t){1&e&&(o.jc(),o.Tb(0,"div",0),o.ic(1),o.Sb())},encapsulation:2,data:{animation:[F.transformDrawer]},changeDetection:0}),e})(),$=(()=>{class e{constructor(e,t,n,i,a,s=!1,r){this._dir=e,this._element=t,this._ngZone=n,this._changeDetectorRef=i,this._animationMode=r,this._drawers=new o.E,this.backdropClick=new o.n,this._destroyed=new d.a,this._doCheckSubject=new d.a,this._contentMargins={left:null,right:null},this._contentMarginChanges=new d.a,e&&e.change.pipe(Object(g.a)(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),a.change().pipe(Object(g.a)(this._destroyed)).subscribe(()=>this.updateContentMargins()),this._autosize=s}get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(e){this._autosize=Object(c.c)(e)}get hasBackdrop(){return null==this._backdropOverride?!this._start||"side"!==this._start.mode||!this._end||"side"!==this._end.mode:this._backdropOverride}set hasBackdrop(e){this._backdropOverride=null==e?null:Object(c.c)(e)}get scrollable(){return this._userContent||this._content}ngAfterContentInit(){this._allDrawers.changes.pipe(Object(v.a)(this._allDrawers),Object(g.a)(this._destroyed)).subscribe(e=>{this._drawers.reset(e.filter(e=>!e._container||e._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe(Object(v.a)(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(e=>{this._watchDrawerToggle(e),this._watchDrawerPosition(e),this._watchDrawerMode(e)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe(Object(_.a)(10),Object(g.a)(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(e=>e.open())}close(){this._drawers.forEach(e=>e.close())}updateContentMargins(){let e=0,t=0;if(this._left&&this._left.opened)if("side"==this._left.mode)e+=this._left._getWidth();else if("push"==this._left.mode){const n=this._left._getWidth();e+=n,t-=n}if(this._right&&this._right.opened)if("side"==this._right.mode)t+=this._right._getWidth();else if("push"==this._right.mode){const n=this._right._getWidth();t+=n,e-=n}e=e||null,t=t||null,e===this._contentMargins.left&&t===this._contentMargins.right||(this._contentMargins={left:e,right:t},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(e){e._animationStarted.pipe(Object(h.a)(e=>e.fromState!==e.toState),Object(g.a)(this._drawers.changes)).subscribe(e=>{"open-instant"!==e.toState&&"NoopAnimations"!==this._animationMode&&this._element.nativeElement.classList.add("mat-drawer-transition"),this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),"side"!==e.mode&&e.openedChange.pipe(Object(g.a)(this._drawers.changes)).subscribe(()=>this._setContainerClass(e.opened))}_watchDrawerPosition(e){e&&e.onPositionChanged.pipe(Object(g.a)(this._drawers.changes)).subscribe(()=>{this._ngZone.onMicrotaskEmpty.asObservable().pipe(Object(f.a)(1)).subscribe(()=>{this._validateDrawers()})})}_watchDrawerMode(e){e&&e._modeChanged.pipe(Object(g.a)(Object(u.a)(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(e){const t=this._element.nativeElement.classList,n="mat-drawer-container-has-open";e?t.add(n):t.remove(n)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(e=>{"end"==e.position?(null!=this._end&&A("end"),this._end=e):(null!=this._start&&A("start"),this._start=e)}),this._right=this._left=null,this._dir&&"rtl"===this._dir.value?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&"over"!=this._start.mode||this._isDrawerOpen(this._end)&&"over"!=this._end.mode}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(e=>e&&!e.disableClose&&this._canHaveBackdrop(e)).forEach(e=>e._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._canHaveBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._canHaveBackdrop(this._end)}_canHaveBackdrop(e){return"side"!==e.mode||!!this._backdropOverride}_isDrawerOpen(e){return null!=e&&e.opened}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(T.c,8),o.Nb(o.l),o.Nb(o.A),o.Nb(o.h),o.Nb(a.e),o.Nb(R),o.Nb(y.a,8))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-drawer-container"]],contentQueries:function(e,t,n){var i;1&e&&(o.Gb(n,E,!0),o.Gb(n,V,!0)),2&e&&(o.rc(i=o.bc())&&(t._content=i.first),o.rc(i=o.bc())&&(t._allDrawers=i))},viewQuery:function(e,t){var n;1&e&&o.Nc(E,!0),2&e&&o.rc(n=o.bc())&&(t._userContent=n.first)},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(e,t){2&e&&o.Fb("mat-drawer-container-explicit-backdrop",t._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],features:[o.Ab([{provide:N,useExisting:e}])],ngContentSelectors:O,decls:4,vars:2,consts:[["class","mat-drawer-backdrop",3,"mat-drawer-shown","click",4,"ngIf"],[4,"ngIf"],[1,"mat-drawer-backdrop",3,"click"]],template:function(e,t){1&e&&(o.jc(I),o.Fc(0,w,1,2,"div",0),o.ic(1),o.ic(2,1),o.Fc(3,x,2,0,"mat-drawer-content",1)),2&e&&(o.kc("ngIf",t.hasBackdrop),o.Bb(3),o.kc("ngIf",!t._content))},directives:[s.t,E],styles:[P],encapsulation:2,changeDetection:0}),e})(),L=(()=>{class e extends E{constructor(e,t,n,i,a){super(e,t,n,i,a)}}return e.\u0275fac=function(t){return new(t||e)(o.Nb(o.h),o.Nb(Object(o.V)(()=>U)),o.Nb(o.l),o.Nb(a.c),o.Nb(o.A))},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],hostVars:4,hostBindings:function(e,t){2&e&&o.Cc("margin-left",t._container._contentMargins.left,"px")("margin-right",t._container._contentMargins.right,"px")},features:[o.yb],ngContentSelectors:C,decls:1,vars:0,template:function(e,t){1&e&&(o.jc(),o.ic(0))},encapsulation:2,changeDetection:0}),e})(),z=(()=>{class e extends V{constructor(){super(...arguments),this._fixedInViewport=!1,this._fixedTopGap=0,this._fixedBottomGap=0}get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(e){this._fixedInViewport=Object(c.c)(e)}get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(e){this._fixedTopGap=Object(c.f)(e)}get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(e){this._fixedBottomGap=Object(c.f)(e)}}return e.\u0275fac=function(t){return j(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-sidenav"]],hostAttrs:["tabIndex","-1",1,"mat-drawer","mat-sidenav"],hostVars:17,hostBindings:function(e,t){2&e&&(o.Cb("align",null),o.Cc("top",t.fixedInViewport?t.fixedTopGap:null,"px")("bottom",t.fixedInViewport?t.fixedBottomGap:null,"px"),o.Fb("mat-drawer-end","end"===t.position)("mat-drawer-over","over"===t.mode)("mat-drawer-push","push"===t.mode)("mat-drawer-side","side"===t.mode)("mat-drawer-opened",t.opened)("mat-sidenav-fixed",t.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],features:[o.yb],ngContentSelectors:C,decls:2,vars:0,consts:[[1,"mat-drawer-inner-container"]],template:function(e,t){1&e&&(o.jc(),o.Tb(0,"div",0),o.ic(1),o.Sb())},encapsulation:2,data:{animation:[F.transformDrawer]},changeDetection:0}),e})();const j=o.Vb(z);let U=(()=>{class e extends ${}return e.\u0275fac=function(t){return q(t||e)},e.\u0275cmp=o.Hb({type:e,selectors:[["mat-sidenav-container"]],contentQueries:function(e,t,n){var i;1&e&&(o.Gb(n,L,!0),o.Gb(n,z,!0)),2&e&&(o.rc(i=o.bc())&&(t._content=i.first),o.rc(i=o.bc())&&(t._allDrawers=i))},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(e,t){2&e&&o.Fb("mat-drawer-container-explicit-backdrop",t._backdropOverride)},exportAs:["matSidenavContainer"],features:[o.Ab([{provide:N,useExisting:e}]),o.yb],ngContentSelectors:H,decls:4,vars:2,consts:[["class","mat-drawer-backdrop",3,"mat-drawer-shown","click",4,"ngIf"],["cdkScrollable","",4,"ngIf"],[1,"mat-drawer-backdrop",3,"click"],["cdkScrollable",""]],template:function(e,t){1&e&&(o.jc(B),o.Fc(0,M,1,2,"div",0),o.ic(1),o.ic(2,1),o.Fc(3,D,2,0,"mat-sidenav-content",1)),2&e&&(o.kc("ngIf",t.hasBackdrop),o.Bb(3),o.kc("ngIf",!t._content))},directives:[s.t,L,a.a],styles:[P],encapsulation:2,changeDetection:0}),e})();const q=o.Vb(U);let G=(()=>{class e{}return e.\u0275mod=o.Lb({type:e}),e.\u0275inj=o.Kb({factory:function(t){return new(t||e)},imports:[[s.c,r.h,i.b,a.b],a.b,r.h]}),e})()},Y7pB:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("fXoL"),a=n("LRXf");let s=(()=>{class e{constructor(e){this.http=e}all(t){return this.http.get(e.BASE_URI,t)}get(t){return this.http.get(`${e.BASE_URI}/${t}`)}create(t){return this.http.post(e.BASE_URI,t)}update(t,n){return this.http.put(`${e.BASE_URI}/${t}`,n)}delete(t){return this.http.delete(`${e.BASE_URI}/${t}`)}sync(){return this.http.post(e.BASE_URI+"/sync")}}return e.BASE_URI="billing-plan",e.\u0275fac=function(t){return new(t||e)(i.Xb(a.a))},e.\u0275prov=i.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},h4Ec:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("fXoL");let a=(()=>{class e{}return e.\u0275mod=i.Lb({type:e}),e.\u0275inj=i.Kb({factory:function(t){return new(t||e)}}),e})()},h586:function(e,t,n){"use strict";n.d(t,"a",(function(){return B}));var i=n("XNiG"),a=n("2Vo4"),s=n("jtHE"),o=n("oJgS");class r{constructor(e,t){this.canceled$=new i.a,this.processing$=new a.a(!1),this.uploadedResponse$=new s.a(1),this.progress$=new a.a({percentage:0}),this.error$=new a.a(null),this.customData={},this.uploadedFile=e,this.id=t||Object(o.a)()}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(e){this.error$.next(e)}setProgress(e){this.progress$.next(Object.assign(Object.assign({},this.progress$.value),e))}}var c=n("Cfvw"),l=n("z6cu"),d=n("EY2u"),b=n("5+tZ"),u=n("JIr8"),h=n("1G5W"),p=n("lJxs"),g=n("pLZG"),m=n("JfjL"),f=n("VfAk"),v=n("fXoL"),_=n("oVOl"),S=n("sJvS"),y=n("tU2R"),k=n("1MND");class T extends k.a{constructor(e,t){super(),this.params=e,this.i18n=t,this.errorMessage=this.i18n.t("Only these file types are allowed: :extensions",{extensions:this.params.extensions.join(", ")})}fails(e){return!this.params.extensions.some(t=>t.toLowerCase()===e.extension.toLowerCase())}}class C extends k.a{constructor(e,t){super(),this.params=e,this.i18n=t,this.errorMessage=this.i18n.t("These file types are not allowed: :extensions",{extensions:this.params.extensions.join(", ")})}fails(e){return this.params.extensions.some(t=>t===e.extension)}}var w=n("PCqb");let x=(()=>{class e extends S.a{constructor(){super(...arguments),this.DEFAULT_MAX_FILE_SIZE_MB=8,this.showToast=!0}initValidations(){this.validations.push(new y.a({maxSize:this.getMaxFileSize()},this.i18n));const e=this.getAllowedExtensions(),t=this.getBlockedExtensions();e&&e.length&&this.validations.push(new T({extensions:e},this.i18n)),t&&t.length&&this.validations.push(new C({extensions:t},this.i18n))}getMaxFileSize(){return this.settings.get("uploads.max_size",Object(w.a)(this.DEFAULT_MAX_FILE_SIZE_MB,"MB"))}getAllowedExtensions(){return this.settings.getJson("uploads.allowed_extensions")}getBlockedExtensions(){return this.settings.getJson("uploads.blocked_extensions")}}return e.\u0275fac=function(t){return I(t||e)},e.\u0275prov=v.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();const I=v.Vb(x);var O=n("i2dy"),M=n("twBr"),D=n("kmQS");let B=(()=>{class e{constructor(e,t,n,o,r){this.api=e,this.defaultValidator=t,this.toast=n,this.currentUser=o,this.settings=r,this.uploads$=new a.a([]),this.totalProgress$=new s.a(1),this.uploadsAdded$=new i.a,this.count$=new a.a({pending:0,completed:0})}isEmpty(){return!this.uploads$.value.length}getAllCompleted(){return this.uploads$.value.filter(e=>e.completed).map(e=>e.fileEntry)}updateTotalProgress(){const e=this.uploads$.value.map(e=>e.progress$.value.percentage||0);this.totalProgress$.next(e.reduce((e,t)=>e+t,0)/e.length)}totalProgress(){return this.totalProgress$.asObservable()}start(e,t={}){const n=t.validator||this.defaultValidator;let i=[];if(Array.isArray(e))i=this.transformUploads(e,n),this.uploads$.next(this.uploads$.value.concat(i)),this.uploadsAdded$.next(i);else{const t=this.uploads$.value.map(t=>{if(e[t.id]){const a=this.transformUploads([e[t.id]],n,t.id)[0];return i.push(a),a}return t});this.uploads$.next(t)}return this.updateCount(),Object(c.a)(i.filter(e=>!e.error$.value)).pipe(Object(b.a)(e=>this.api.upload(e.uploadedFile,t).pipe(Object(u.a)(i=>(this.handleUploadFailure(i,e,n),t.bubbleError?Object(l.a)(i):d.a)),Object(h.a)(e.canceled$),Object(p.a)(n=>(this.handleUploadEvent(n,e,t.willProcessFiles),n.name===m.a.COMPLETED&&(n.body.queueItemId=e.id),n))),1),Object(g.a)(e=>e.name===m.a.COMPLETED),Object(p.a)(e=>e.body))}updateProgress(e,t){const n=this.find(e);n&&(n.setProgress({eta:t.eta,speed:t.speed,percentage:t.progress,totalBytes:t.totalBytes,completedBytes:t.completedBytes}),this.updateTotalProgress())}completeUpload(e,t){const n=this.find(e);n&&(n.uploadedResponse$.next(t),n.fileEntry=t.fileEntry,n.complete(),this.updateTotalProgress())}errorUpload(e,t){this.find(e).addError(t)}reset(){this.uploads$.value.forEach(e=>e.cancel()),this.uploads$.next([])}remove(e){const t=this.uploads$.value.findIndex(t=>t.id===e),n=this.uploads$.value[t];n.completed?n.finalize():n.cancel(),this.uploads$.value.splice(t,1),this.uploads$.next(this.uploads$.value)}find(e){return this.uploads$.value.find(t=>t.id===e)}transformUploads(e,t,n){return e.map(e=>{const i=new r(e,n);if(t){const n=t.validate(e);n.failed&&i.addError(n.errorMessage)}return i})}handleUploadEvent(e,t,n=!1){e.name===m.a.PROGRESS?(100===e.progress&&(e=Object.assign(Object.assign({},e),{progress:99}),n&&t.processing$.next(!0)),this.updateProgress(t.id,e)):e.name===m.a.COMPLETED&&(this.completeUpload(t.id,e.body),this.updateCount())}handleUploadFailure(e,t,n){var i;let a=null===(i=null==e?void 0:e.errors)||void 0===i?void 0:i.file,s=null;a||(a=f.a.DefaultUpload,s=this.currentUser.isAdmin()&&!this.settings.get("site.hide_docs_buttons")),this.errorUpload(t.id,a),this.updateCount(),this.updateTotalProgress(),n.showToast&&this.toast.open(a,{action:s?"Learn More":null}).onAction().subscribe(()=>{window.open(f.b)})}updateCount(){const e=this.uploads$.value.filter(e=>e.inProgress).length;this.count$.next({pending:e,completed:this.uploads$.value.length-e})}}return e.\u0275fac=function(t){return new(t||e)(v.Xb(_.a),v.Xb(x),v.Xb(O.b),v.Xb(M.a),v.Xb(D.a))},e.\u0275prov=v.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},losq:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("ofXK"),a=n("fXoL");let s=(()=>{class e{}return e.\u0275mod=a.Lb({type:e}),e.\u0275inj=a.Kb({factory:function(t){return new(t||e)},imports:[[i.c]]}),e})()}}]); //# sourceMappingURL=7-es2015.dae98915e7221ad1c785.js.map