1import{a as We,b as we,c as pn,d as xt,e as St}from"./chunk-7NQNY7V4.js";import{b as Zi}from"./chunk-JT2JTPDA.js";import{a as cn,b as hn}from"./chunk-OGKBPECN.js";import{a as en,b as wt}from"./chunk-LY7BLC2N.js";import{a as Bn}from"./chunk-ULH3CVOK.js";import{a as Xi,b as Qi,c as Ct}from"./chunk-ZJQGE4TN.js";import{a as qi,b as Ki,c as Ji}from"./chunk-OBNCKVFA.js";import{x as an,y as ln}from"./chunk-FBPTJYVW.js";import{d as Gi}from"./chunk-MW4XNDYZ.js";import"./chunk-MHNKS4ZX.js";import"./chunk-RIK4RH5M.js";import{a as tn}from"./chunk-DRRJD65U.js";import"./chunk-HAJNCCJF.js";import{a as dn}from"./chunk-XHCKOZMQ.js";import{a as Yi,b as ji}from"./chunk-HKY6FACR.js";import{a as Ce}from"./chunk-HCIBNUPL.js";import"./chunk-SWUOSIC5.js";import{e as sn,f as on,g as rn}from"./chunk-WG7KUOJM.js";import{a as nn}from"./chunk-LPDDA2N3.js";import{a as Ni}from"./chunk-FYBVQUMJ.js";import"./chunk-OA6RSADH.js";import{a as vt}from"./chunk-NOPRY6BJ.js";import{a as Hi}from"./chunk-RKOD6SQC.js";import{b as Bi}from"./chunk-WFJKWBND.js";import"./chunk-Q4HNVMGF.js";import"./chunk-3HWY6SEC.js";import{b as oe,c as G,d as Oi,f as pe,h as Z,j as yt,l as X,m as ee}from"./chunk-JHEK5B3H.js";import{a as W}from"./chunk-PTFVZH2M.js";import"./chunk-T5ABL6GV.js";import"./chunk-OEW6BOWJ.js";import{a as Ui,c as Di}from"./chunk-FNG56J7K.js";import{b as Ei}from"./chunk-254WTS54.js";import{a as re}from"./chunk-3KC2QHRH.js";import{C as Wi,D as bt,E as Vi,c as Re,f as $e,l as Le,n as zi,t as Ri,u as $i,v as Li}from"./chunk-7QU4DVBB.js";import{a as _e}from"./chunk-FR5BZMYJ.js";import"./chunk-DHQFFTLW.js";import{c as ve,g as ze,h as Ti,i as J,n as Fi}from"./chunk-LVJRXQ3Y.js";import{m as ye,n as se}from"./chunk-HIPDSQEU.js";import{B as K,F as ki,a as _t,k as be,l as ce,m as he,n as $,q as Si,s as Mi,u as Ii,x as Pi,y as Ai}from"./chunk-VPP56BL3.js";import{Aa as ft,Ab as De,B as Me,C as zt,Db as yi,Ea as b,Eb as p,Fb as ge,G as Qe,Gb as V,H as gt,Hb as Oe,Ib as vi,Jb as T,Kb as F,L as de,Lb as U,Qb as Ke,Rb as R,Sb as Vt,Tb as Ci,Wa as c,Xa as bi,Xb as ne,Yb as Je,Zb as Bt,_b as Ze,bb as Rt,bc as wi,c as pi,d as pt,ga as fi,gb as r,h as mi,hb as a,hc as Ee,i as Se,ia as _i,ib as C,jb as D,ka as ut,kb as O,ma as h,mb as y,p as Xe,pb as u,qb as d,qc as xi,ra as qe,rb as $t,s as m,sa as f,sb as Lt,t as g,tb as Wt,u as mt,ub as L,v as gi,yb as Fe,z as ui,za as I,zb as Ue}from"./chunk-MSDPDPRL.js";import{E as oi,G as ri,L as ai,N as li,Q as di,U as fe,V as ci,a as ht,ca as Te,da as v,fa as hi,g as P,r as Ge,w as ni,y as si,z as j}from"./chunk-4I6C6WA7.js";import{a as je,b as Et,f as Vn,h as ii}from"./chunk-SDIY36DU.js";var un=["*"];function Nn(s,n){if(s&1&&C(0,"div",3),s&2){let e=n.index,t=d();c("ngStyle",t.gridRenderer.getGridColumnStyle(e))}}function Hn(s,n){if(s&1&&C(0,"div",4),s&2){let e=n.index,t=d();c("ngStyle",t.gridRenderer.getGridRowStyle(e))}}function Yn(s,n){if(s&1){let e=y();r(0,"div",8),u("mousedown",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))})("touchstart",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))}),a()}}function jn(s,n){if(s&1){let e=y();r(0,"div",9),u("mousedown",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))})("touchstart",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))}),a()}}function Gn(s,n){if(s&1){let e=y();r(0,"div",10),u("mousedown",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))})("touchstart",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))}),a()}}function Xn(s,n){if(s&1){let e=y();r(0,"div",11),u("mousedown",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))})("touchstart",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))}),a()}}function Qn(s,n){if(s&1){let e=y();r(0,"div",12),u("mousedown",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))})("touchstart",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))}),a()}}function qn(s,n){if(s&1){let e=y();r(0,"div",13),u("mousedown",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))})("touchstart",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))}),a()}}function Kn(s,n){if(s&1){let e=y();r(0,"div",14),u("mousedown",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))})("touchstart",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))}),a()}}function Jn(s,n){if(s&1){let e=y();r(0,"div",15),u("mousedown",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))})("touchstart",function(i){m(e);let o=d();return g(o.resize.dragStartDelay(i))}),a()}}var M=function(s){return s.Fit="fit",s.ScrollVertical="scrollVertical",s.ScrollHorizontal="scrollHorizontal",s.Fixed="fixed",s.VerticalFixed="verticalFixed",s.HorizontalFixed="horizontalFixed",s}(M||{}),It=function(s){return s.Always="always",s.OnDragAndResize="onDrag&Resize",s.None="none",s}(It||{}),A=function(s){return s.None="none",s.CompactUp="compactUp",s.CompactLeft="compactLeft",s.CompactUpAndLeft="compactUp&Left",s.CompactLeftAndUp="compactLeft&Up",s.CompactRight="compactRight",s.CompactUpAndRight="compactUp&Right",s.CompactRightAndUp="compactRight&Up",s.CompactDown="compactDown",s.CompactDownAndLeft="compactDown&Left",s.CompactLeftAndDown="compactLeft&Down",s.CompactDownAndRight="compactDown&Right",s.CompactRightAndDown="compactRight&Down",s}(A||{}),B=function(s){return s.LTR="ltr",s.RTL="rtl",s}(B||{}),Nt=class{constructor(n){this.gridster=n}destroy(){this.gridster=null}checkCompact(){this.gridster.$options.compactType!==A.None&&(this.gridster.$options.compactType===A.CompactUp?this.checkCompactMovement("y",-1):this.gridster.$options.compactType===A.CompactLeft?this.checkCompactMovement("x",-1):this.gridster.$options.compactType===A.CompactUpAndLeft?(this.checkCompactMovement("y",-1),this.checkCompactMovement("x",-1)):this.gridster.$options.compactType===A.CompactLeftAndUp?(this.checkCompactMovement("x",-1),this.checkCompactMovement("y",-1)):this.gridster.$options.compactType===A.CompactRight?this.checkCompactMovement("x",1):this.gridster.$options.compactType===A.CompactUpAndRight?(this.checkCompactMovement("y",-1),this.checkCompactMovement("x",1)):this.gridster.$options.compactType===A.CompactRightAndUp?(this.checkCompactMovement("x",1),this.checkCompactMovement("y",-1)):this.gridster.$options.compactType===A.CompactDown?this.checkCompactMovement("y",1):this.gridster.$options.compactType===A.CompactDownAndLeft?(this.checkCompactMovement("y",1),this.checkCompactMovement("x",-1)):this.gridster.$options.compactType===A.CompactDownAndRight?(this.checkCompactMovement("y",1),this.checkCompactMovement("x",1)):this.gridster.$options.compactType===A.CompactLeftAndDown?(this.checkCompactMovement("x",-1),this.checkCompactMovement("y",1)):this.gridster.$options.compactType===A.CompactRightAndDown&&(this.checkCompactMovement("x",1),this.checkCompactMovement("y",1)))}checkCompactItem(n){this.gridster.$options.compactType!==A.None&&(this.gridster.$options.compactType===A.CompactUp?this.moveTillCollision(n,"y",-1):this.gridster.$options.compactType===A.CompactLeft?this.moveTillCollision(n,"x",-1):this.gridster.$options.compactType===A.CompactUpAndLeft?(this.moveTillCollision(n,"y",-1),this.moveTillCollision(n,"x",-1)):this.gridster.$options.compactType===A.CompactLeftAndUp?(this.moveTillCollision(n,"x",-1),this.moveTillCollision(n,"y",-1)):this.gridster.$options.compactType===A.CompactUpAndRight?(this.moveTillCollision(n,"y",-1),this.moveTillCollision(n,"x",1)):this.gridster.$options.compactType===A.CompactDown?this.moveTillCollision(n,"y",1):this.gridster.$options.compactType===A.CompactDownAndLeft?(this.moveTillCollision(n,"y",1),this.moveTillCollision(n,"x",-1)):this.gridster.$options.compactType===A.CompactLeftAndDown?(this.moveTillCollision(n,"x",-1),this.moveTillCollision(n,"y",1)):this.gridster.$options.compactType===A.CompactDownAndRight?(this.moveTillCollision(n,"y",1),this.moveTillCollision(n,"x",1)):this.gridster.$options.compactType===A.CompactRightAndDown&&(this.moveTillCollision(n,"x",1),this.moveTillCollision(n,"y",1)))}checkCompactMovement(n,e){let t=!1;
1this.gridster.grid.forEach(i=>{i.$item.compactEnabled!==!1&&this.moveTillCollision(i.$item,n,e)&&(t=!0,i.item[n]=i.$item[n],i.itemChanged())}),t&&this.checkCompact()}moveTillCollision(n,e,t){return n[e]+=t,this.gridster.checkCollision(n)?(n[e]-=t,!1):(this.moveTillCollision(n,e,t),!0)}},Zn={gridType:M.Fit,scale:1,fixedColWidth:250,fixedRowHeight:250,keepFixedHeightInMobile:!1,keepFixedWidthInMobile:!1,setGridSize:!1,compactType:A.None,mobileBreakpoint:640,useBodyForBreakpoint:!1,allowMultiLayer:!1,defaultLayerIndex:0,maxLayerIndex:2,baseLayerIndex:1,minCols:1,maxCols:100,minRows:1,maxRows:100,defaultItemCols:1,defaultItemRows:1,maxItemCols:50,maxItemRows:50,minItemCols:1,minItemRows:1,minItemArea:1,maxItemArea:2500,addEmptyRowsCount:0,rowHeightRatio:1,margin:10,outerMargin:!0,outerMarginTop:null,outerMarginRight:null,outerMarginBottom:null,outerMarginLeft:null,useTransformPositioning:!0,scrollSensitivity:10,scrollSpeed:20,initCallback:void 0,destroyCallback:void 0,gridSizeChangedCallback:void 0,itemChangeCallback:void 0,itemResizeCallback:void 0,itemInitCallback:void 0,itemRemovedCallback:void 0,itemValidateCallback:void 0,enableEmptyCellClick:!1,enableEmptyCellContextMenu:!1,enableEmptyCellDrop:!1,enableEmptyCellDrag:!1,enableOccupiedCellDrop:!1,emptyCellClickCallback:void 0,emptyCellContextMenuCallback:void 0,emptyCellDropCallback:void 0,emptyCellDragCallback:void 0,emptyCellDragMaxCols:50,emptyCellDragMaxRows:50,ignoreMarginInRow:!1,draggable:{delayStart:0,enabled:!1,ignoreContentClass:"gridster-item-content",ignoreContent:!1,dragHandleClass:"drag-handler",stop:void 0,start:void 0,dropOverItems:!1,dropOverItemsCallback:void 0},resizable:{delayStart:0,enabled:!1,handles:{s:!0,e:!0,n:!0,w:!0,se:!0,ne:!0,sw:!0,nw:!0},stop:void 0,start:void 0},swap:!0,swapWhileDragging:!1,pushItems:!1,disablePushOnDrag:!1,disablePushOnResize:!1,pushDirections:{north:!0,east:!0,south:!0,west:!0},pushResizeItems:!1,displayGrid:It.OnDragAndResize,disableWindowResize:!1,disableWarnings:!1,scrollToNewItems:!1,disableScrollHorizontal:!1,disableScrollVertical:!1,enableBoundaryControl:!1,disableAutoPositionOnConflict:!1,dirType:B.LTR},Q=class s{static merge(n,e,t){for(let i in e)e[i]!==void 0&&t.hasOwnProperty(i)&&(typeof e[i]=="object"?(i in n||(n[i]={}),n[i]=s.merge(n[i],e[i],t[i])):n[i]=e[i]);return n}static checkTouchEvent(n){n.clientX===void 0&&n.touches&&(n.touches&&n.touches.length?(n.clientX=n.touches[0].clientX,n.clientY=n.touches[0].clientY):n.changedTouches&&n.changedTouches.length&&(n.clientX=n.changedTouches[0].clientX,n.clientY=n.changedTouches[0].clientY))}static checkContentClassForEvent(n,e){if(n.$options.draggable.ignoreContent){if(!s.checkDragHandleClass(e.target,e.currentTarget,n.$options.draggable.dragHandleClass,n.$options.draggable.ignoreContentClass))return!0}else if(s.checkContentClass(e.target,e.currentTarget,n.$options.draggable.ignoreContentClass))return!0;return!1}static checkContentClassForEmptyCellClickEvent(n,e){return s.checkContentClass(e.target,e.currentTarget,n.$options.draggable.ignoreContentClass)||s.checkContentClass(e.target,e.currentTarget,n.$options.draggable.dragHandleClass)}static checkDragHandleClass(n,e,t,i){if(!n||n===e)return!1;if(n.hasAttribute("class")){let o=n.getAttribute("class").split(" ");if(o.indexOf(t)>-1)return!0;if(o.indexOf(i)>-1)return!1}return s.checkDragHandleClass(n.parentNode,e,t,i)}static checkContentClass(n,e,t){return!n||n===e?!1:n.hasAttribute("class")&&n.getAttribute("class").split(" ").indexOf(t)>-1?!0:s.checkContentClass(n.parentNode,e,t)}static compareItems(n,e){return n.y>e.y?-1:n.y<e.y?1:n.x>e.x?-1:1}},Ht=class{constructor(n){this.gridster=n,this.emptyCellClickCb=e=>{if(!this.gridster||this.gridster.movingItem||Q.checkContentClassForEmptyCellClickEvent(this.gridster,e))return;let t=this.getValidItemFromEvent(e);t&&(this.gridster.options.emptyCellClickCallback&&this.gridster.options.emptyCellClickCallback(e,t),this.gridster.cdRef.markForCheck())},this.emptyCellContextMenuCb=e=>{if(this.gridster.movingItem||Q.checkContentClassForEmptyCellClickEvent(this.gridster,e))return;e.preventDefault(),e.stopPropagation();let t=this.getValidItemFromEvent(e);t&&(this.gridster.options.emptyCellContextMenuCallback&&this.gridster.options.emptyCellContextMenuCallback(e,t),this.gridster.cdRef.markForCheck())},this.emptyCellDragDrop=e=>{let t=this.getValidItemFromEvent(e);t&&(this.gridster.options.emptyCellDropCallback&&this.gridster.options.emptyCellDropCallback(e,t),this.gridster.cdRef.markForCheck())},this.emptyCellDragOver=e=>{e.preventDefault(),e.stopPropagation();let t=this.getValidItemFromEvent(e);t?(e.dataTransfer&&(e.dataTransfer.dropEffect="move"),this.gridster.movingItem=t):(e.dataTransfer&&(e.dataTransfer.dropEffect="none"),this.gridster.movingItem=null),this.gridster.previewStyle()},this.emptyCellMouseDown=e=>{if(Q.checkContentClassForEmptyCellClickEvent(this.gridster,e))return;e.preventDefault(),e.stopPropagation();let t=this.getValidItemFromEvent(e);!t||e.buttons!==1&&!(e instanceof TouchEvent)||(this.initialItem=t,this.gridster.movingItem=t,this.gridster.previewStyle(),this.gridster.zone.runOutsideAngular(()=>{this.removeWindowMousemoveListenerFn=this.gridster.renderer.listen("window","mousemove",this.emptyCellMouseMove),this.removeWindowTouchmoveListenerFn=this.gridster.renderer.listen("window","touchmove",this.emptyCellMouseMove)}),this.removeWindowMouseupListenerFn=this.gridster.renderer.listen("window","mouseup",this.emptyCellMouseUp),this.removeWindowTouchendListenerFn=this.gridster.renderer.listen("window","touchend",this.emptyCellMouseUp))},this.emptyCellMouseMove=e=>{e.preventDefault(),e.stopPropagation();let t=this.getValidItemFromEvent(e,this.initialItem);t&&(this.gridster.movingItem=t,this.gridster.previewStyle())},this.emptyCellMouseUp=e=>{this.removeWindowMousemoveListenerFn(),this.removeWindowTouchmoveListenerFn(),this.removeWindowMouseupListenerFn(),this.removeWindowTouchendListenerFn();let t=this.getValidItemFromEvent(e,this.initialItem);t&&(this.gridster.movingItem=t),this.gridster.options.emptyCellDragCallback&&this.gridster.movingItem&&this.gridster.options.emptyCellDragCallback(e,this.gridster.movingItem),setTimeout(()=>{this.initialItem=null,this.gridster&&(this.gridster.movingItem=null,this.gridster.previewStyle())}),this.gridster.cdRef.markForCheck()}}destroy(){this.gridster.previewStyle&&this.gridster.previewStyle(),this.gridster.movingItem=null,this.initialItem=this.gridster=null,this.removeDocumentDragendListenerFn&&(this.removeDocumentDragendListenerFn(),this.removeDocumentDragendListenerFn=null)}updateOptions(){this.gridster.$options.enableEmptyCellClick&&!this.removeEmptyCellClickListenerFn&&this.gridster.options.emptyCellClickCallback?(this.removeEmptyCellClickListenerFn=this.gridster.renderer.listen(this.gridster.el,"click",this.emptyCellClickCb),this.removeEmptyCellTouchendListenerFn=this.gridster.renderer.listen(this.gridster.el,"touchend",this.emptyCellClickCb)):!this.gridster.$options.enableEmptyCellClick&&this.removeEmptyCellClickListenerFn&&this.removeEmptyCellTouchendListenerFn&&(this.removeEmptyCellClickListenerFn(),this.removeEmptyCellTouchendListenerFn(),this.removeEmptyCellClickListenerFn=null,this.removeEmptyCellTouchendListenerFn=null),this.gridster.$options.enableEmptyCellContextMenu&&!this.removeEmptyCellContextMenuListenerFn&&this.gridster.options.emptyCellContextMenuCallback?this.removeEmptyCellContextMenuListenerFn=this.gridster.renderer.listen(this.gridster.el,"contextmenu",this.emptyCellContextMenuCb):!this.gridster.$options.enableEmptyCellContextMenu&&this.removeEmptyCellContextMenuListenerFn&&(this.removeEmptyCellContextMenuListenerFn(),this.removeEmptyCellContextMenuListenerFn=null),this.gridster.$options.enableEmptyCellDrop&&!this.removeEmptyCellDropListenerFn&&this.gridster.options.emptyCellDropCallback?(this.removeEmptyCellDropListenerFn=this.gridster.renderer.listen(this.gridster.el,"drop",this.emptyCellDragDrop),this.gridster.zone.runOutsideAngular(()=>{this.removeEmptyCellDragoverListenerFn=this.gridster.renderer.listen(this.gridster.el,"dragover",this.emptyCellDragOver)}),this.removeDocumentDragendListenerFn=this.gridster.renderer.listen("document","dragend",()=>{this.gridster.movingItem=null,this.gridster.previewStyle()}
1)):!this.gridster.$options.enableEmptyCellDrop&&this.removeEmptyCellDropListenerFn&&this.removeEmptyCellDragoverListenerFn&&this.removeDocumentDragendListenerFn&&(this.removeEmptyCellDropListenerFn(),this.removeEmptyCellDragoverListenerFn(),this.removeDocumentDragendListenerFn(),this.removeEmptyCellDragoverListenerFn=null,this.removeEmptyCellDropListenerFn=null,this.removeDocumentDragendListenerFn=null),this.gridster.$options.enableEmptyCellDrag&&!this.removeEmptyCellMousedownListenerFn&&this.gridster.options.emptyCellDragCallback?(this.removeEmptyCellMousedownListenerFn=this.gridster.renderer.listen(this.gridster.el,"mousedown",this.emptyCellMouseDown),this.removeEmptyCellTouchstartListenerFn=this.gridster.renderer.listen(this.gridster.el,"touchstart",this.emptyCellMouseDown)):!this.gridster.$options.enableEmptyCellDrag&&this.removeEmptyCellMousedownListenerFn&&this.removeEmptyCellTouchstartListenerFn&&(this.removeEmptyCellMousedownListenerFn(),this.removeEmptyCellTouchstartListenerFn(),this.removeEmptyCellMousedownListenerFn=null,this.removeEmptyCellTouchstartListenerFn=null)}getPixelsX(n,e){let t=this.gridster.options.scale;return t?(n.clientX-e.left)/t+this.gridster.el.scrollLeft-this.gridster.gridRenderer.getLeftMargin():n.clientX+this.gridster.el.scrollLeft-e.left-this.gridster.gridRenderer.getLeftMargin()}getPixelsY(n,e){let t=this.gridster.options.scale;return t?(n.clientY-e.top)/t+this.gridster.el.scrollTop-this.gridster.gridRenderer.getTopMargin():n.clientY+this.gridster.el.scrollTop-e.top-this.gridster.gridRenderer.getTopMargin()}getValidItemFromEvent(n,e){n.preventDefault(),n.stopPropagation(),Q.checkTouchEvent(n);let t=this.gridster.el.getBoundingClientRect(),i=this.getPixelsX(n,t),o=this.getPixelsY(n,t),l={x:this.gridster.pixelsToPositionX(i,Math.floor,!0),y:this.gridster.pixelsToPositionY(o,Math.floor,!0),cols:this.gridster.$options.defaultItemCols,rows:this.gridster.$options.defaultItemRows};if(e&&(l.cols=Math.min(Math.abs(e.x-l.x)+1,this.gridster.$options.emptyCellDragMaxCols),l.rows=Math.min(Math.abs(e.y-l.y)+1,this.gridster.$options.emptyCellDragMaxRows),e.x<l.x?l.x=e.x:e.x-l.x>this.gridster.$options.emptyCellDragMaxCols-1&&(l.x=this.gridster.movingItem?this.gridster.movingItem.x:0),e.y<l.y?l.y=e.y:e.y-l.y>this.gridster.$options.emptyCellDragMaxRows-1&&(l.y=this.gridster.movingItem?this.gridster.movingItem.y:0)),!(!this.gridster.$options.enableOccupiedCellDrop&&this.gridster.checkCollision(l)))return l}},Yt=class{constructor(n){this.gridster=n,this.lastGridColumnStyles={},this.lastGridRowStyles={}}destroy(){this.gridster=null}updateItem(n,e,t){if(this.gridster.mobile)this.clearCellPosition(t,n),this.gridster.$options.keepFixedHeightInMobile?t.setStyle(n,"height",(e.rows-1)*this.gridster.$options.margin+e.rows*this.gridster.$options.fixedRowHeight+"px"):t.setStyle(n,"height",e.rows*this.gridster.curWidth/e.cols+"px"),this.gridster.$options.keepFixedWidthInMobile?t.setStyle(n,"width",this.gridster.$options.fixedColWidth+"px"):t.setStyle(n,"width",""),t.setStyle(n,"margin-bottom",this.gridster.$options.margin+"px"),t.setStyle(n,B.LTR?"margin-right":"margin-left","");else{let i=Math.round(this.gridster.curColWidth*e.x),o=Math.round(this.gridster.curRowHeight*e.y),l=this.gridster.curColWidth*e.cols-this.gridster.$options.margin,_=this.gridster.curRowHeight*e.rows-this.gridster.$options.margin;this.setCellPosition(t,n,i,o),t.setStyle(n,"width",l+"px"),t.setStyle(n,"height",_+"px");let w=null,x=null;this.gridster.$options.outerMargin&&(this.gridster.rows===e.rows+e.y&&(this.gridster.$options.outerMarginBottom!==null?w=this.gridster.$options.outerMarginBottom+"px":w=this.gridster.$options.margin+"px"),this.gridster.columns===e.cols+e.x&&(this.gridster.$options.outerMarginBottom!==null?x=this.gridster.$options.outerMarginRight+"px":x=this.gridster.$options.margin+"px")),t.setStyle(n,"margin-bottom",w),t.setStyle(n,B.LTR?"margin-right":"margin-left",x)}}updateGridster(){let n="",e="",t="",i="";if(this.gridster.$options.gridType===M.Fit)n=M.Fit,e=M.ScrollVertical,t=M.ScrollHorizontal,i=M.Fixed;else if(this.gridster.$options.gridType===M.ScrollVertical)this.gridster.curRowHeight=this.gridster.curColWidth*this.gridster.$options.rowHeightRatio,n=M.ScrollVertical,e=M.Fit,t=M.ScrollHorizontal,i=M.Fixed;else if(this.gridster.$options.gridType===M.ScrollHorizontal){let o=this.gridster.$options.rowHeightRatio,l=o>=1?o:o+1;this.gridster.curColWidth=this.gridster.curRowHeight*l,n=M.ScrollHorizontal,e=M.Fit,t=M.ScrollVertical,i=M.Fixed}else this.gridster.$options.gridType===M.Fixed?(this.gridster.curColWidth=this.gridster.$options.fixedColWidth+(this.gridster.$options.ignoreMarginInRow?0:this.gridster.$options.margin),this.gridster.curRowHeight=this.gridster.$options.fixedRowHeight+(this.gridster.$options.ignoreMarginInRow?0:this.gridster.$options.margin),n=M.Fixed,e=M.Fit,t=M.ScrollVertical,i=M.ScrollHorizontal):this.gridster.$options.gridType===M.VerticalFixed?(this.gridster.curRowHeight=this.gridster.$options.fixedRowHeight+(this.gridster.$options.ignoreMarginInRow?0:this.gridster.$options.margin),n=M.ScrollVertical,e=M.Fit,t=M.ScrollHorizontal,i=M.Fixed):this.gridster.$options.gridType===M.HorizontalFixed&&(this.gridster.curColWidth=this.gridster.$options.fixedColWidth+(this.gridster.$options.ignoreMarginInRow?0:this.gridster.$options.margin),n=M.ScrollHorizontal,e=M.Fit,t=M.ScrollVertical,i=M.Fixed);this.gridster.mobile||this.gridster.$options.setGridSize&&this.gridster.$options.gridType!==M.Fit?this.gridster.renderer.removeClass(this.gridster.el,n):this.gridster.renderer.addClass(this.gridster.el,n),this.gridster.renderer.removeClass(this.gridster.el,e),this.gridster.renderer.removeClass(this.gridster.el,t),this.gridster.renderer.removeClass(this.gridster.el,i)}getGridColumnStyle(n){let e={left:this.gridster.curColWidth*n,width:this.gridster.curColWidth-this.gridster.$options.margin,height:this.gridster.gridRows.length*this.gridster.curRowHeight-this.gridster.$options.margin,style:{}};e.style=Et(je({},this.getLeftPosition(e.left)),{width:e.width+"px",height:e.height+"px"});let t=this.lastGridColumnStyles[n];return t&&t.left===e.left&&t.width===e.width&&t.height===e.height?t.style:(this.lastGridColumnStyles[n]=e,e.style)}getGridRowStyle(n){let e={top:this.gridster.curRowHeight*n,width:this.gridster.gridColumns.length*this.gridster.curColWidth+this.gridster.$options.margin,height:this.gridster.curRowHeight-this.gridster.$options.margin,style:{}};e.style=Et(je({},this.getTopPosition(e.top)),{width:e.width+"px",height:e.height+"px"});let t=this.lastGridRowStyles[n];return t&&t.top===e.top&&t.width===e.width&&t.height===e.height?t.style:(this.lastGridRowStyles[n]=e,e.style)}getLeftPosition(n){let e=this.gridster.$options.dirType===B.RTL?-n:n;return this.gridster.$options.useTransformPositioning?{transform:"translateX("+e+"px)"}:{left:this.getLeftMargin()+e+"px"}}getTopPosition(n){return this.gridster.$options.useTransformPositioning?{transform:"translateY("+n+"px)"}:{top:this.getTopMargin()+n+"px"}}clearCellPosition(n,e){this.gridster.$options.useTransformPositioning?n.setStyle(e,"transform",""):(n.setStyle(e,"top",""),n.setStyle(e,"left",""))}setCellPosition(n,e,t,i){let o=this.gridster.$options.dirType===B.RTL?-t:t;if(this.gridster.$options.useTransformPositioning){let l="translate3d("+o+"px, "+i+"px, 0)";n.setStyle(e,"transform",l)}else n.setStyle(e,"left",this.getLeftMargin()+o+"px"),n.setStyle(e,"top",this.getTopMargin()+i+"px")}getLeftMargin(){return this.gridster.$options.outerMargin?this.gridster.$options.outerMarginLeft!==null?this.gridster.$options.outerMarginLeft:this.gridster.$options.margin:0}getTopMargin(){return this.gridster.$options.outerMargin?this.gridster.$options.outerMarginTop!==null?this.gridster.$options.outerMarginTop:this.gridster.$options.margin:0}},es=(()=>{class s{constructor(e,t){this.renderer=t,this.el=e.nativeElement}ngOnInit(){this.sub=this.previewStyle$.subscribe(e=>this.previewStyle(e))}ngOnDestroy(){this.sub&&this.sub.unsubscribe()}previewStyle(e){e?(this.renderer.setStyle(this.el,"display","block"),this.gridRenderer.updateItem(this.el,e,this.renderer)):this.renderer.setStyle(this.el,"display","")}static{this.\u0275fac=function(t){return new(t||s)(f(Qe),f(qe))}}static{this.\u0275cmp=I({type:s,selectors:[["gridster-preview"]],inputs:{previewStyle$:"previewStyle$",gridRenderer:"gridRenderer"},decls:0,vars:0,template:function(t,i){},styles:[`gridster-preview{position:absolute;display:none;background:rgba(0,0,0,.15)} 2`],encapsulation:2})}}return s})(),qt=(()=>{class s{constructor(e,t,i,o){this.renderer=t,this.cdRef=i,this.zone=o,this.columns=0,this.rows=0,this.gridColumns=[],this.gridRows=[],this.previewStyle$=new Me,this.calculateLayout$=new P,this.resize$=new P,this.destroy$=new P,this.optionsChanged=()=>{this.setOptions();let l=this.grid.length-1,_;for(;l>=0;l--)_=this.grid[l],_.updateOptions();this.calculateLayout()},this.onResize=()=>{this.el.clientWidth&&(this.options.setGridSize&&(this.renderer.setStyle(this.el,"width",""),this.renderer.setStyle(this.el,"height","")),this.setGridSize(),this.calculateLayout())},this.getNextPossiblePosition=(l,_={})=>{l.cols===-1&&(l.cols=this.$options.defaultItemCols),l.rows===-1&&(l.rows=this.$options.defaultItemRows),this.setGridDimensions();let w=_.y||0,x;for(;w<this.rows;
2w++)for(l.y=w,x=_.x||0;x<this.columns;x++)if(l.x=x,!this.checkCollision(l))return!0;let S=this.$options.maxRows>=this.rows+l.rows,k=this.$options.maxCols>=this.columns+l.cols;return!(this.rows<=this.columns&&S)&&k?(l.x=this.columns,l.y=0,!0):S?(l.y=this.rows,l.x=0,!0):!1},this.getFirstPossiblePosition=l=>{let _=Object.assign({},l);return this.getNextPossiblePosition(_),_},this.getLastPossiblePosition=l=>{let _={y:0,x:0};_=this.grid.reduce((x,S)=>{let k={y:S.$item.y+S.$item.rows-1,x:S.$item.x+S.$item.cols-1};return Q.compareItems(x,k)===1?k:x},_);let w=Object.assign({},l);return this.getNextPossiblePosition(w,_),w},this.el=e.nativeElement,this.$options=JSON.parse(JSON.stringify(Zn)),this.mobile=!1,this.curWidth=0,this.curHeight=0,this.grid=[],this.curColWidth=0,this.curRowHeight=0,this.dragInProgress=!1,this.emptyCell=new Ht(this),this.compact=new Nt(this),this.gridRenderer=new Yt(this)}static checkCollisionTwoItemsForSwaping(e,t){let i=e.cols===1?0:1,o=t.cols===1?0:1,l=e.rows===1?0:1,_=t.rows===1?0:1;return e.x+i<t.x+t.cols&&e.x+e.cols>t.x+o&&e.y+l<t.y+t.rows&&e.y+e.rows>t.y+_}checkCollisionTwoItems(e,t){if(!(e.x<t.x+t.cols&&e.x+e.cols>t.x&&e.y<t.y+t.rows&&e.y+e.rows>t.y))return!1;if(!this.$options.allowMultiLayer)return!0;let o=this.$options.defaultLayerIndex,l=e.layerIndex===void 0?o:e.layerIndex,_=t.layerIndex===void 0?o:t.layerIndex;return l===_}ngOnInit(){this.options.initCallback&&this.options.initCallback(this),this.calculateLayout$.pipe(di(0),v(this.destroy$)).subscribe(()=>this.calculateLayout()),this.resize$.pipe(Te(()=>ri(100)),v(this.destroy$)).subscribe(()=>this.resize())}ngOnChanges(e){e.options&&(this.setOptions(),this.options.api={optionsChanged:this.optionsChanged,resize:this.onResize,getNextPossiblePosition:this.getNextPossiblePosition,getFirstPossiblePosition:this.getFirstPossiblePosition,getLastPossiblePosition:this.getLastPossiblePosition,getItemComponent:t=>this.getItemComponent(t)},this.columns=this.$options.minCols,this.rows=this.$options.minRows+this.$options.addEmptyRowsCount,this.setGridSize(),this.calculateLayout())}resize(){let e,t;this.$options.gridType==="fit"&&!this.mobile?(t=this.el.offsetWidth,e=this.el.offsetHeight):(t=this.el.clientWidth,e=this.el.clientHeight),(t!==this.curWidth||e!==this.curHeight)&&this.checkIfToResize()&&this.onResize()}setOptions(){this.$options=Q.merge(this.$options,this.options,this.$options),!this.$options.disableWindowResize&&!this.windowResize?this.windowResize=this.renderer.listen("window","resize",this.onResize):this.$options.disableWindowResize&&this.windowResize&&(this.windowResize(),this.windowResize=null),this.emptyCell.updateOptions()}ngOnDestroy(){this.destroy$.next(),this.previewStyle$.complete(),this.windowResize&&this.windowResize(),this.options&&this.options.destroyCallback&&this.options.destroyCallback(this),this.options&&this.options.api&&(this.options.api.resize=void 0,this.options.api.optionsChanged=void 0,this.options.api.getNextPossiblePosition=void 0,this.options.api=void 0),this.emptyCell.destroy(),this.emptyCell=null,this.compact.destroy(),this.compact=null}checkIfToResize(){let e=this.el.clientWidth,t=this.el.offsetWidth,i=this.el.scrollWidth,o=this.el.clientHeight,l=this.el.offsetHeight,_=this.el.scrollHeight,w=e<t&&_>l&&_-l<t-e,x=o<l&&i>t&&i-t<l-o;return w?!1:!x}checkIfMobile(){return this.$options.useBodyForBreakpoint?this.$options.mobileBreakpoint>document.body.clientWidth:this.$options.mobileBreakpoint>this.curWidth}setGridSize(){let e=this.el,t,i;this.$options.setGridSize||this.$options.gridType===M.Fit&&!this.mobile?(t=e.offsetWidth,i=e.offsetHeight):(t=e.clientWidth,i=e.clientHeight),this.curWidth=t,this.curHeight=i}setGridDimensions(){this.setGridSize(),!this.mobile&&this.checkIfMobile()?(this.mobile=!this.mobile,this.renderer.addClass(this.el,"mobile")):this.mobile&&!this.checkIfMobile()&&(this.mobile=!this.mobile,this.renderer.removeClass(this.el,"mobile"));let e=this.$options.minRows,t=this.$options.minCols,i=this.grid.length-1,o;for(;i>=0;i--)o=this.grid[i],o.notPlaced||(e=Math.max(e,o.$item.y+o.$item.rows),t=Math.max(t,o.$item.x+o.$item.cols));e+=this.$options.addEmptyRowsCount,(this.columns!==t||this.rows!==e)&&(this.columns=t,this.rows=e,this.options.gridSizeChangedCallback&&this.options.gridSizeChangedCallback(this))}calculateLayout(){if(this.compact&&this.compact.checkCompact(),this.setGridDimensions(),this.$options.outerMargin){let i=-this.$options.margin;this.$options.outerMarginLeft!==null?(i+=this.$options.outerMarginLeft,this.renderer.setStyle(this.el,"padding-left",this.$options.outerMarginLeft+"px")):(i+=this.$options.margin,this.renderer.setStyle(this.el,"padding-left",this.$options.margin+"px")),this.$options.outerMarginRight!==null?(i+=this.$options.outerMarginRight,this.renderer.setStyle(this.el,"padding-right",this.$options.outerMarginRight+"px")):(i+=this.$options.margin,this.renderer.setStyle(this.el,"padding-right",this.$options.margin+"px")),this.curColWidth=(this.curW
2idth-i)/this.columns;let o=-this.$options.margin;this.$options.outerMarginTop!==null?(o+=this.$options.outerMarginTop,this.renderer.setStyle(this.el,"padding-top",this.$options.outerMarginTop+"px")):(o+=this.$options.margin,this.renderer.setStyle(this.el,"padding-top",this.$options.margin+"px")),this.$options.outerMarginBottom!==null?(o+=this.$options.outerMarginBottom,this.renderer.setStyle(this.el,"padding-bottom",this.$options.outerMarginBottom+"px")):(o+=this.$options.margin,this.renderer.setStyle(this.el,"padding-bottom",this.$options.margin+"px")),this.curRowHeight=(this.curHeight-o)/this.rows*this.$options.rowHeightRatio}else this.curColWidth=(this.curWidth+this.$options.margin)/this.columns,this.curRowHeight=(this.curHeight+this.$options.margin)/this.rows*this.$options.rowHeightRatio,this.renderer.setStyle(this.el,"padding-left","0px"),this.renderer.setStyle(this.el,"padding-right","0px"),this.renderer.setStyle(this.el,"padding-top","0px"),this.renderer.setStyle(this.el,"padding-bottom","0px");this.gridRenderer.updateGridster(),this.$options.setGridSize?(this.renderer.addClass(this.el,"gridSize"),this.mobile||(this.renderer.setStyle(this.el,"width",this.columns*this.curColWidth+this.$options.margin+"px"),this.renderer.setStyle(this.el,"height",this.rows*this.curRowHeight+this.$options.margin+"px"))):(this.renderer.removeClass(this.el,"gridSize"),this.renderer.setStyle(this.el,"width",""),this.renderer.setStyle(this.el,"height","")),this.updateGrid();let e=this.grid.length-1,t;for(;e>=0;e--)t=this.grid[e],t.setSize(),t.drag.toggle(),t.resize.toggle();this.resize$.next()}updateGrid(){this.$options.displayGrid==="always"&&!this.mobile?this.renderer.addClass(this.el,"display-grid"):this.$options.displayGrid==="onDrag&Resize"&&this.dragInProgress?this.renderer.addClass(this.el,"display-grid"):(this.$options.displayGrid==="none"||!this.dragInProgress||this.mobile)&&this.renderer.removeClass(this.el,"display-grid"),this.setGridDimensions(),this.gridColumns.length=s.getNewArrayLength(this.columns,this.curWidth,this.curColWidth),this.gridRows.length=s.getNewArrayLength(this.rows,this.curHeight,this.curRowHeight),this.cdRef.markForCheck()}addItem(e){e.$item.cols===void 0&&(e.$item.cols=this.$options.defaultItemCols,e.item.cols=e.$item.cols,e.itemChanged()),e.$item.rows===void 0&&(e.$item.rows=this.$options.defaultItemRows,e.item.rows=e.$item.rows,e.itemChanged()),e.$item.x===-1||e.$item.y===-1?this.autoPositionItem(e):this.checkCollision(e.$item)&&(this.$options.disableWarnings||(e.notPlaced=!0,console.warn("Can't be placed in the bounds of the dashboard, trying to auto position!/n"+JSON.stringify(e.item,["cols","rows","x","y"]))),this.$options.disableAutoPositionOnConflict?e.notPlaced=!0:this.autoPositionItem(e)),this.grid.push(e),this.calculateLayout$.next()}removeItem(e){this.grid.splice(this.grid.indexOf(e),1),this.calculateLayout$.next(),this.options.itemRemovedCallback&&this.options.itemRemovedCallback(e.item,e)}checkCollision(e){let t=!1;if(this.options.itemValidateCallback&&(t=!this.options.itemValidateCallback(e)),!t&&this.checkGridCollision(e)&&(t=!0),!t){let i=this.findItemWithItem(e);i&&(t=i)}return t}checkGridCollision(e){let t=e.y>-1&&e.x>-1,i=e.cols+e.x<=this.$options.maxCols,o=e.rows+e.y<=this.$options.maxRows,l=e.maxItemCols===void 0?this.$options.maxItemCols:e.maxItemCols,_=e.minItemCols===void 0?this.$options.minItemCols:e.minItemCols,w=e.maxItemRows===void 0?this.$options.maxItemRows:e.maxItemRows,x=e.minItemRows===void 0?this.$options.minItemRows:e.minItemRows,S=e.cols<=l&&e.cols>=_,k=e.rows<=w&&e.rows>=x,H=e.minItemArea===void 0?this.$options.minItemArea:e.minItemArea,q=e.maxItemArea===void 0?this.$options.maxItemArea:e.maxItemArea,E=e.cols*e.rows,Y=H<=E,z=q>=E;return!(t&&i&&o&&S&&k&&Y&&z)}findItemWithItem(e){let t=0,i;for(;t<this.grid.length;t++)if(i=this.grid[t],i.$item!==e&&this.checkCollisionTwoItems(i.$item,e))return i;return!1}findItemsWithItem(e){let t=[],i=0,o;for(;i<this.grid.length;i++)o=this.grid[i],o.$item!==e&&this.checkCollisionTwoItems(o.$item,e)&&t.push(o);return t}autoPositionItem(e){this.getNextPossiblePosition(e.$item)?(e.notPlaced=!1,e.item.x=e.$item.x,e.item.y=e.$item.y,e.itemChanged()):(e.notPlaced=!0,this.$options.disableWarnings||console.warn("Can't be placed in the bounds of the dashboard!/n"+JSON.stringify(e.item,["cols","rows","x","y"])))}pixelsToPositionX(e,t,i){let o=t(e/this.curColWidth);return i?o:Math.max(o,0)}pixelsToPositionY(e,t,i){let o=t(e/this.curRowHeight);return i?o:Math.max(o,0)}positionXToPixels(e){return e*this.curColWidth}positionYToPixels(e){return e*this.curRowHeight}getItemComponent(e){return this.grid.find(t=>t.item===e)}checkCollisionForSwaping(e){let t=!1;if(this.options.itemValidateCallback&&(t=!this.options.itemValidateCallback(e)),!t&&this.checkGridCollision(e)&&(t=!0),!t){let i=this.findItemWithItemForSwapping(e);
2i&&(t=i)}return t}findItemWithItemForSwapping(e){let t=this.grid.length-1,i;for(;t>-1;t--)if(i=this.grid[t],i.$item!==e&&s.checkCollisionTwoItemsForSwaping(i.$item,e))return i;return!1}previewStyle(e=!1){this.movingItem?(this.compact&&e&&this.compact.checkCompactItem(this.movingItem),this.previewStyle$.next(this.movingItem)):this.previewStyle$.next(null)}static getNewArrayLength(e,t,i){let o=Math.max(e,Math.floor(t/i));return o<0?0:Number.isFinite(o)?Math.floor(o):0}static{this.\u0275fac=function(t){return new(t||s)(f(Qe),f(qe),f(Ee),f(zt))}}static{this.\u0275cmp=I({type:s,selectors:[["gridster"]],inputs:{options:"options"},features:[Xe],ngContentSelectors:un,decls:4,vars:4,consts:[["class","gridster-column",3,"ngStyle",4,"ngFor","ngForOf"],["class","gridster-row",3,"ngStyle",4,"ngFor","ngForOf"],[1,"gridster-preview",3,"gridRenderer","previewStyle$"],[1,"gridster-column",3,"ngStyle"],[1,"gridster-row",3,"ngStyle"]],template:function(t,i){t&1&&($t(),b(0,Nn,1,1,"div",0)(1,Hn,1,1,"div",1),Lt(2),C(3,"gridster-preview",2)),t&2&&(c("ngForOf",i.gridColumns),h(),c("ngForOf",i.gridRows),h(2),c("gridRenderer",i.gridRenderer)("previewStyle$",i.previewStyle$))},dependencies:[he,Si,es],styles:[`gridster{position:relative;box-sizing:border-box;background:grey;width:100%;height:100%;-webkit-user-select:none;user-select:none;display:block}gridster.fit{overflow-x:hidden;overflow-y:hidden}gridster.scrollVertical{overflow-x:hidden;overflow-y:auto}gridster.scrollHorizontal{overflow-x:auto;overflow-y:hidden}gridster.fixed{overflow:auto}gridster.mobile{overflow-x:hidden;overflow-y:auto}gridster.mobile gridster-item{position:relative}gridster.gridSize{height:initial;width:initial}gridster.gridSize.fit{height:100%;width:100%}gridster .gridster-column,gridster .gridster-row{position:absolute;display:none;transition:.3s;box-sizing:border-box}gridster.display-grid .gridster-column,gridster.display-grid .gridster-row{display:block}gridster .gridster-column{border-left:1px solid white;border-right:1px solid white}gridster .gridster-row{border-top:1px solid white;border-bottom:1px solid white} 3`],encapsulation:2})}}return s})(),Mt=class{constructor(n){this.iteration=0,this.pushedItems=[],this.pushedItemsTemp=[],this.pushedItemsTempPath=[],this.pushedItemsPath=[],this.gridsterItem=n,this.gridster=n.gridster,this.tryPattern={fromEast:[this.tryWest,this.trySouth,this.tryNorth,this.tryEast],fromWest:[this.tryEast,this.trySouth,this.tryNorth,this.tryWest],fromNorth:[this.trySouth,this.tryEast,this.tryWest,this.tryNorth],fromSouth:[this.tryNorth,this.tryEast,this.tryWest,this.trySouth]},this.fromSouth="fromSouth",this.fromNorth="fromNorth",this.fromEast="fromEast",this.fromWest="fromWest"}destroy(){this.gridster=this.gridsterItem=null}pushItems(n,e){if(this.gridster.$options.pushItems&&!e){this.pushedItemsOrder=[],this.iteration=0;let t=this.push(this.gridsterItem,n);return t||this.restoreTempItems(),this.pushedItemsOrder=[],this.pushedItemsTemp=[],this.pushedItemsTempPath=[],t}else return!1}restoreTempItems(){let n=this.pushedItemsTemp.length-1;for(;n>-1;n--)this.removeFromTempPushed(this.pushedItemsTemp[n])}restoreItems(){let n=0,e=this.pushedItems.length,t;for(;n<e;n++)t=this.pushedItems[n],t.$item.x=t.item.x||0,t.$item.y=t.item.y||0,t.setSize();this.pushedItems=[],this.pushedItemsPath=[]}setPushedItems(){let n=0,e=this.pushedItems.length,t;for(;n<e;n++)t=this.pushedItems[n],t.checkItemChanges(t.$item,t.item);this.pushedItems=[],this.pushedItemsPath=[]}checkPushBack(){let n=this.pushedItems.length-1,e=!1;for(;n>-1;n--)this.checkPushedItem(this.pushedItems[n],n)&&(e=!0);e&&this.checkPushBack()}push(n,e){if(this.iteration>100)return console.warn("max iteration reached"),!1;if(this.gridster.checkGridCollision(n.$item)||e==="")return!1;let t=this.gridster.findItemsWithItem(n.$item),i=e===this.fromNorth||e===this.fromWest;t.sort((x,S)=>i?S.$item.y-x.$item.y||S.$item.x-x.$item.x:x.$item.y-S.$item.y||x.$item.x-S.$item.x);let o=0,l,_=!0,w=[];for(;o<t.length;o++){if(l=t[o],l===this.gridsterItem)continue;if(!l.canBeDragged()){_=!1;break}let x=this.pushedItemsTemp.indexOf(l);if(x>-1&&this.pushedItemsTempPath[x].length>10){_=!1;break}if(this.tryPattern[e][0].call(this,l,n))this.pushedItemsOrder.push(l),w.push(l);else if(this.tryPattern[e][1].call(this,l,n))this.pushedItemsOrder.push(l),w.push(l);else if(this.tryPattern[e][2].call(this,l,n))this.pushedItemsOrder.push(l),w.push(l);else if(this.tryPattern[e][3].call(this,l,n))this.pushedItemsOrder.push(l),w.push(l);else{_=!1;break}}if(!_&&(o=this.pushedItemsOrder.lastIndexOf(w[0]),o>-1)){let x=this.pushedItemsOrder.length-1;for(;x>=o;x--)l=this.pushedItemsOrder[x],this.pushedItemsOrder.pop(),this.removeFromTempPushed(l),this.removeFromPushedItem(l)}return this.iteration++,_}trySouth(n,e){return this.gridster.$options.pushDirections.south?(this.addToTempPushed(n),n.$item.y=e.$item.y+e.$item.rows,this.push(n,this.fromNorth)?(n.setSize(),this.addToPushed(n),!0):(this.removeFromTempPushed(n),!1)):!1}tryNorth(n,e){return this.gridster.$options.pushDirections.north?(this.addToTempPushed(n),n.$item.y=e.$item.y-n.$item.rows,this.push(n,this.fromSouth)?(n.setSize(),this.addToPushed(n),!0):(this.removeFromTempPushed(n),!1)):!1}tryEast(n,e){return this.gridster.$options.pushDirections.east?(this.addToTempPushed(n),n.$item.x=e.$item.x+e.$item.cols,this.push(n,this.fromWest)?(n.setSize(),this.addToPushed(n),!0):(this.removeFromTempPushed(n),!1)):!1}tryWest(n,e){return this.gridster.$options.pushDirections.west?(this.addToTempPushed(n),n.$item.x=e.$item.x-n.$item.cols,this.push(n,this.fromEast)?(n.setSize(),this.addToPushed(n),!0):(this.removeFromTempPushed(n),!1)):!1}addToTempPushed(n){let e=this.pushedItemsTemp.indexOf(n);e===-1&&(e=this.pushedItemsTemp.push(n)-1,this.pushedItemsTempPath[e]=[]),this.pushedItemsTempPath[e].push({x:n.$item.x,y:n.$item.y})}removeFromTempPushed(n){let e=this.pushedItemsTemp.indexOf(n),t=this.pushedItemsTempPath[e].pop();t&&(n.$item.x=t.x,n.$item.y=t.y,n.setSize(),this.pushedItemsTempPath[e].length||(this.pushedItemsTemp.splice(e,1),this.pushedItemsTempPath.splice(e,1)))}addToPushed(n){if(this.pushedItems.indexOf(n)<0)this.pushedItems.push(n),this.pushedItemsPath.push([{x:n.item.x||0,y:n.item.y||0},{x:n.$item.x,y:n.$item.y}]);else{let e=this.pushedItems.indexOf(n);this.pushedItemsPath[e].push({x:n.$item.x,y:n.$item.y})}}removeFromPushed(n){n>-1&&(this.pushedItems.splice(n,1),this.pushedItemsPath.splice(n,1))}removeFromPushedItem(n){let e=this.pushedItems.indexOf(n);e>-1&&(this.pushedItemsPath[e].pop(),this.pushedItemsPath.length||(this.pushedItems.splice(e,1),this.pushedItemsPath.splice(e,1)))}checkPushedItem(n,e){let t=this.pushedItemsPath[e],i=t.length-2,o,l,_,w=!1;for(;i>-1;i--)o=t[i],l=n.$item.x,_=n.$item.y,n.$item.x=o.x,n.$item.y=o.y,this.gridster.findItemWithItem(n.$item)?(n.$item.x=l,n.$item.y=_):(n.setSize(),t.splice(i+1,t.length-i-1),w=!0);return t.length<2&&this.removeFromPushed(e),w}},et,Ie,fn=50,ae,tt,ue,it,nt,st,ot;function _n(s,n,e,t,i,o,l,_,w,x){et=s.$options.scrollSensitivity,Ie=s.$options.scrollSpeed,ae=s.el,tt=w,ue=x;let S=ae.offsetWidth,k=ae.offsetHeight,H=ae.scrollLeft,q=ae.scrollTop,E=e-q,Y=k+q-e-i,{clientX:z,clientY:ie}=o;
3if(!s.$options.disableScrollVertical)if(l.clientY<ie&&Y<et){if(wn(),tt&&ue&&!ue.south||ot)return;ot=mn(1,_,l)}else if(l.clientY>ie&&q>0&&E<et){if(Cn(),tt&&ue&&!ue.north||st)return;st=mn(-1,_,l)}else l.clientY!==ie&&Jt();let Ot=H+S-n-t,Wn=n-H;if(!s.$options.disableScrollHorizontal)if(l.clientX<z&&Ot<=et){if(vn(),tt&&ue&&!ue.east||it)return;it=gn(1,_,l)}else if(l.clientX>z&&H>0&&Wn<et){if(yn(),tt&&ue&&!ue.west||nt)return;nt=gn(-1,_,l)}else l.clientX!==z&&Kt()}function mn(s,n,e){let t=e.clientY;return window.setInterval(()=>{(!ae||s===-1&&ae.scrollTop-Ie<0)&&Jt(),ae.scrollTop+=s*Ie,t+=s*Ie,n({clientX:e.clientX,clientY:t})},fn)}function gn(s,n,e){let t=e.clientX;return window.setInterval(()=>{(!ae||s===-1&&ae.scrollLeft-Ie<0)&&Kt(),ae.scrollLeft+=s*Ie,t+=s*Ie,n({clientX:t,clientY:e.clientY})},fn)}function bn(){Kt(),Jt(),ae=null}function Kt(){yn(),vn()}function Jt(){wn(),Cn()}function yn(){it&&(clearInterval(it),it=0)}function vn(){nt&&(clearInterval(nt),nt=0)}function Cn(){ot&&(clearInterval(ot),ot=0)}function wn(){st&&(clearInterval(st),st=0)}var jt=class{constructor(n){this.gridsterItem=n,this.gridster=n.gridster}destroy(){this.gridster=this.gridsterItem=this.swapedItem=null}swapItems(){this.gridster.$options.swap&&(this.checkSwapBack(),this.checkSwap(this.gridsterItem))}checkSwapBack(){if(this.swapedItem){let n=this.swapedItem.$item.x,e=this.swapedItem.$item.y;this.swapedItem.$item.x=this.swapedItem.item.x||0,this.swapedItem.$item.y=this.swapedItem.item.y||0,this.gridster.checkCollision(this.swapedItem.$item)?(this.swapedItem.$item.x=n,this.swapedItem.$item.y=e):(this.swapedItem.setSize(),this.gridsterItem.$item.x=this.gridsterItem.item.x||0,this.gridsterItem.$item.y=this.gridsterItem.item.y||0,this.swapedItem=void 0)}}restoreSwapItem(){this.swapedItem&&(this.swapedItem.$item.x=this.swapedItem.item.x||0,this.swapedItem.$item.y=this.swapedItem.item.y||0,this.swapedItem.setSize(),this.swapedItem=void 0)}setSwapItem(){this.swapedItem&&(this.swapedItem.checkItemChanges(this.swapedItem.$item,this.swapedItem.item),this.swapedItem=void 0)}checkSwap(n){let e;if(this.gridster.$options.swapWhileDragging?e=this.gridster.checkCollisionForSwaping(n.$item):e=this.gridster.checkCollision(n.$item),e&&e!==!0&&e.canBeDragged()){let t=e,i=t.$item.x,o=t.$item.y,l=n.$item.x,_=n.$item.y,w=l-i,x=_-o;t.$item.x=n.item.x-w,t.$item.y=n.item.y-x,n.$item.x=t.item.x+w,n.$item.y=t.item.y+x,this.gridster.checkCollision(t.$item)||this.gridster.checkCollision(n.$item)?(n.$item.x=l,n.$item.y=_,t.$item.x=i,t.$item.y=o):(t.setSize(),this.swapedItem=t,this.gridster.$options.swapWhileDragging&&(this.gridsterItem.checkItemChanges(this.gridsterItem.$item,this.gridsterItem.item),this.setSwapItem()))}}},ts="gridster-item-resizable-handler",te=function(s){return s.UP="UP",s.DOWN="DOWN",s.LEFT="LEFT",s.RIGHT="RIGHT",s}(te||{}),Gt=class{constructor(n,e,t){this.zone=t,this.collision=!1,this.dragMove=i=>{i.stopPropagation(),i.preventDefault(),Q.checkTouchEvent(i);let o=this.getDirections(i);this.gridster.options.enableBoundaryControl&&(o.includes(te.UP)&&this.gridsterItem.el.getBoundingClientRect().top<this.gridster.el.getBoundingClientRect().top+(this.outerMarginTop??this.margin)&&(o=o.filter(l=>l!=te.UP),i=new MouseEvent(i.type,{clientX:i.clientX,clientY:this.lastMouse.clientY})),o.includes(te.LEFT)&&this.gridsterItem.el.getBoundingClientRect().left<this.gridster.el.getBoundingClientRect().left+(this.outerMarginLeft??this.margin)&&(o=o.filter(l=>l!=te.LEFT),i=new MouseEvent(i.type,{clientX:this.lastMouse.clientX,clientY:i.clientY})),o.includes(te.RIGHT)&&this.gridsterItem.el.getBoundingClientRect().right>this.gridster.el.getBoundingClientRect().right-(this.outerMarginRight??this.margin)&&(o=o.filter(l=>l!=te.RIGHT),i=new MouseEvent(i.type,{clientX:this.lastMouse.clientX,clientY:i.clientY})),o.includes(te.DOWN)&&this.gridsterItem.el.getBoundingClientRect().bottom>this.gridster.el.getBoundingClientRect().bottom-(this.outerMarginBottom??this.margin)&&(o=o.filter(l=>l!=te.DOWN),i=new MouseEvent(i.type,{clientX:i.clientX,clientY:this.lastMouse.clientY}))),o.length&&(this.offsetLeft=this.gridster.el.scrollLeft-this.gridster.el.offsetLeft,this.offsetTop=this.gridster.el.scrollTop-this.gridster.el.offsetTop,_n(this.gridster,this.left,this.top,this.width,this.height,i,this.lastMouse,this.calculateItemPositionFromMousePosition),this.calculateItemPositionFromMousePosition(i))},this.calculateItemPositionFromMousePosition=i=>{this.gridster.options.scale?this.calculateItemPositionWithScale(i,this.gridster.options.scale):this.calculateItemPositionWithoutScale(i),this.calculateItemPosition(),this.lastMouse.clientX=i.clientX,this.lastMouse.clientY=i.clientY,this.zone.run(()=>{this.gridster.updateGrid()})},this.dragStop=i=>{i.stopPropagation(),i.preventDefault(),bn(),this.cancelOnBlur(),this.mousemove(),this.mouseup(),this.mouseleave(),this.touchmove(),this.touchend(),this.touchcancel(),this.gridsterItem.renderer.removeClass(this.gridsterItem.el,"gridster-item-moving"),this.gridster.dragInProgress=!1,this.gridster.updateGrid(),this.path=[],this.gridster.options.draggable&&this.gridster.options.draggable.stop?Promise.resolve(this.gridster.options.draggable.stop(this.gridsterItem.item,this.gridsterItem,i)).then(this.makeDrag,this.cancelDrag):this.makeDrag(),setTimeout(()=>{this.gridster&&(this.gridster.movingItem=null,this.gridster.previewStyle(!0))})},this.cancelDrag=()=>{this.gridsterItem.$item.x=this.gridsterItem.item.x||0,this.gridsterItem.$item.y=this.gridsterItem.item.y||0,this.gridsterItem.setSize(),this.push&&this.push.restoreItems(),this.swap&&this.swap.restoreSwapItem(),this.push&&(this.push.destroy(),this.push=null),this.swap&&(this.swap.destroy(),this.swap=null)},this.makeDrag=()=>{this.gridster.$options.draggable.dropOverItems&&this.gridster.options.draggable&&this.gridster.options.draggable.dropOverItemsCallback&&this.collision&&this.collision!==!0&&this.collision.$item&&this.gridster.options.draggable.dropOverItemsCallback(this.gridsterItem.item,this.collision.item,this.gridster),this.collision=!1,this.gridsterItem.setSize(),this.gridsterItem.checkItemChanges(this.gridsterItem.$item,this.gridsterItem.item),this.push&&this.push.setPushedItems(),this.swap&&this.swap.setSwapItem(),this.push&&(this.push.destroy(),this.push=null),this.swap&&(this.swap.destroy(),this.swap=null)},this.dragStartDelay=i=>{if(i.target.classList.contains(ts)||Q.checkContentClassForEvent(this.gridster,i))return;if(Q.checkTouchEvent(i),!this.gridster.$options.draggable.delayStart){this.dragStart(i);return}let l=setTimeout(()=>{this.dragStart(i),E()},this.gridster.$options.draggable.delayStart),_=this.gridsterItem.renderer.listen("document","mouseup",E),w=this.gridsterItem.renderer.listen("document","mouseleave",E),x=this.gridsterItem.renderer.listen("window","blur",E),S=this.gridsterItem.renderer.listen("document","touchmove",q),k=this.gridsterItem.renderer.listen("document","touchend",E),H=this.gridsterItem.renderer.listen("document","touchcancel",E);function q(Y){Q.checkTouchEvent(Y),(Math.abs(Y.clientX-i.clientX)>9||Math.abs(Y.clientY-i.clientY)>9)&&E()}function E(){clearTimeout(l),x(),_(),w(),S(),k(),H()}},this.gridsterItem=n,this.gridster=e,this.lastMouse={clientX:0,clientY:0},this.path=[]}destroy(){this.gridster.previewStyle&&this.gridster.previewStyle(!0),this.gridsterItem=this.gridster=this.collision=null,this.mousedown&&(this.mousedown(),this.touchstart())}dragStart(n){n.which&&n.which!==1||(this.gridster.options.draggable&&this.gridster.options.draggable.start&&this.gridster.options.draggable.start(this.gridsterItem.item,this.gridsterItem,n),n.stopPropagation(),n.preventDefault(),this.zone.runOutsideAngular(()=>{this.mousemove=this.gridsterItem.renderer.listen("document","mousemove",this.dragMove),this.touchmove=this.gridster.renderer.listen(this.gridster.el,"touchmove",this.dragMove)}),this.mouseup=this.gridsterItem.renderer.listen("document","mouseup",this.dragStop),this.mouseleave=this.gridsterItem.renderer.listen("document","mouseleave",this.dragStop),this.cancelOnBlur=this.gridsterItem.renderer.listen("window","blur",this.dragStop),this.touchend=this.gridsterItem.renderer.listen("document","touchend",this.dragStop),this.touchcancel=this.gridsterItem.renderer.listen("document","touchcancel",this.dragStop),this.gridsterItem.renderer.addClass(this.gridsterItem.el,"gridster-item-moving"),this.margin=this.gridster.$options.margin,this.outerMarginTop=this.gridster.$options.outerMarginTop,this.outerMarginRight=this.gridster.$options.outerMarginRight,this.outerMarginBottom=this.gridster.$options.outerMarginBottom,this.outerMarginLeft=this.gridster.$options.outerMarginLeft,this.offsetLeft=this.gridster.el.scrollLeft-this.gridster.el.offsetLeft,this.offsetTop=this.gridster.el.scrollTop-this.gridster.el.offsetTop,this.left=this.gridsterItem.left-this.margin,this.top=this.gridsterItem.top-this.margin,this.originalClientX=n.clientX,this.originalClientY=n.clientY,this.width=this.gridsterItem.width,this.height=this.gridsterItem.height,this.gridster.$options.dirType===B.RTL?this.diffLeft=n.clientX-this.gridster.el.scrollWidth+this.gridsterItem.left:this.diffLeft=n.clientX+this.offsetLeft-this.margin-this.left,this.diffTop=n.clientY+this.offsetTop-this.margin-this.top,this.gridster.movingItem=this.gridsterItem.$item,this.gridster.previewStyle(!0),this.push=new Mt(this.gridsterItem),this.swap=new jt(this.gridsterItem),this.gridster.dragInProgress=!0,this.gridster.updateGrid(),this.path.push({x:this.gridsterItem.item.x||0,y:this.gridsterItem.item.y||0}))}calculateItemPositionWithScale(n,e){this.gridster.$options.dirType===B.RTL?this.left=this.gridster.el.scrollWidth-this.originalClientX+(n.clientX-this.originalClientX)/e+this.diffLeft:this.left=this.originalClientX+(n.clientX-this.originalClientX)/e+this.offsetLeft-this.diffLeft,this.top=this.originalClientY+(n.clientY-this.originalClientY)/e+this.offsetTop-this.diffTop}calculateItemPositionWithoutScale(n){this.gridster.$options.dirType===B.RTL?this.left=this.gridster.el.scrollWidth-n.clientX+this.diffLeft:this.left=n.clientX+this.offsetLeft-this.diffLeft,this.top=n.clientY+this.offsetTop-this.diffTop}calculateItemPosition(){if(this.gridster.movingItem=this.gridsterItem.$item,this.positionX=this.gridster.pixelsToPositionX(this.left,Math.round),this.positionY=this.gridster.pixelsToPositionY(this.top,Math.round),this.positionXBackup=this.gridsterItem.$item.x,this.positionYBackup=this.gridsterItem.$item.y,this.gridsterItem.$item.x=this.positionX,this.gridster.checkGridCollision(this.gridsterItem.$item)&&(this.gridsterItem.$item.x=this.positionXBackup),this.gridsterItem.$item.y=this.positionY,this.gridster.checkGridCollision(this.gridsterItem.$item)&&(this.gridsterItem.$item.y=this.positionYBackup),this.gridster.gridRenderer.setCellPosition(this.gridsterItem.renderer,this.gridsterItem.el,this.left,this.top),this.positionXBackup!==this.gridsterItem.$item.x||this.positionYBackup!==this.gridsterItem.$item.y){let n=this.path[this.path.length-1],e="";n.x<this.gridsterItem.$item.x?e=this.push.fromWest:n.x>this.gridsterItem.$item.x?e=this.push.fromEast:n.y<this.gridsterItem.$item.y?e=this.push.fromNorth:n.y>this.gridsterItem.$item.y&&(e=this.push.fromSouth),this.push.pushItems(e,this.gridster.$options.disablePushOnDrag),this.swap.swapItems(),this.collision=this.gridster.checkCollision(this.gridsterItem.$item),this.collision?(this.gridsterItem.$item.x=this.positionXBackup,this.gridsterItem.$item.y=this.positionYBackup,this.gridster.$options.draggable.dropOverItems&&this.collision!==!0&&this.collision.$item&&(this.gridster.movingItem=null)):this.path.push({x:this.gridsterItem.$item.x,y:this.gridsterItem.$item.y}),this.push.checkPushBack()}else this.collision=!1;this.gridster.previewStyle(!0)}toggle(){let n=this.gridsterItem.canBeDragged();!this.enabled&&n?(this.enabled=!this.enabled,this.mousedown=this.gridsterItem.renderer.listen(this.gridsterItem.el,"mousedown",this.dragStartDelay),this.touchstart=this.gridsterItem.renderer.listen(this.gridsterItem.el,"touchstart",this.dragStartDelay)):this.enabled&&!n&&(this.enabled=!this.enabled,this.mousedown(),this.touchstart())}getDirections(n){let e=[];return this.lastMouse.clientX===0&&this.lastMouse.clientY===0&&(this.lastMouse.clientY=n.clientY,this.lastMouse.clientX=n.clientX),this.lastMouse.clientY>
3n.clientY&&e.push(te.UP),this.lastMouse.clientY<n.clientY&&e.push(te.DOWN),this.lastMouse.clientX<n.clientX&&e.push(te.RIGHT),this.lastMouse.clientX>n.clientX&&e.push(te.LEFT),e}},Xt=class{constructor(n){this.pushedItems=[],this.pushedItemsPath=[],this.gridsterItem=n,this.gridster=n.gridster,this.tryPattern={fromEast:this.tryWest,fromWest:this.tryEast,fromNorth:this.trySouth,fromSouth:this.tryNorth},this.fromSouth="fromSouth",this.fromNorth="fromNorth",this.fromEast="fromEast",this.fromWest="fromWest"}destroy(){this.gridster=this.gridsterItem=null}pushItems(n){return this.gridster.$options.pushResizeItems?this.push(this.gridsterItem,n):!1}restoreItems(){let n=0,e=this.pushedItems.length,t;for(;n<e;n++)t=this.pushedItems[n],t.$item.x=t.item.x||0,t.$item.y=t.item.y||0,t.$item.cols=t.item.cols||1,t.$item.row=t.item.row||1,t.setSize();this.pushedItems=[],this.pushedItemsPath=[]}setPushedItems(){let n=0,e=this.pushedItems.length,t;for(;n<e;n++)t=this.pushedItems[n],t.checkItemChanges(t.$item,t.item);this.pushedItems=[],this.pushedItemsPath=[]}checkPushBack(){let n=this.pushedItems.length-1,e=!1;for(;n>-1;n--)this.checkPushedItem(this.pushedItems[n],n)&&(e=!0);e&&this.checkPushBack()}push(n,e){let t=this.gridster.checkCollision(n.$item);if(t&&t!==!0&&t!==this.gridsterItem&&t.canBeResized()){if(this.tryPattern[e].call(this,t,n,e))return!0}else if(t===!1)return!0;return!1}trySouth(n,e,t){let i=n.$item.y,o=n.$item.rows;return n.$item.y=e.$item.y+e.$item.rows,n.$item.rows=o+i-n.$item.y,!this.gridster.checkCollisionTwoItems(n.$item,e.$item)&&!this.gridster.checkGridCollision(n.$item)?(n.setSize(),this.addToPushed(n),this.push(e,t),!0):(n.$item.y=i,n.$item.rows=o,!1)}tryNorth(n,e,t){let i=n.$item.rows;return n.$item.rows=e.$item.y-n.$item.y,!this.gridster.checkCollisionTwoItems(n.$item,e.$item)&&!this.gridster.checkGridCollision(n.$item)?(n.setSize(),this.addToPushed(n),this.push(e,t),!0):(n.$item.rows=i,!1)}tryEast(n,e,t){let i=n.$item.x,o=n.$item.cols;return n.$item.x=e.$item.x+e.$item.cols,n.$item.cols=o+i-n.$item.x,!this.gridster.checkCollisionTwoItems(n.$item,e.$item)&&!this.gridster.checkGridCollision(n.$item)?(n.setSize(),this.addToPushed(n),this.push(e,t),!0):(n.$item.x=i,n.$item.cols=o,!1)}tryWest(n,e,t){let i=n.$item.cols;return n.$item.cols=e.$item.x-n.$item.x,!this.gridster.checkCollisionTwoItems(n.$item,e.$item)&&!this.gridster.checkGridCollision(n.$item)?(n.setSize(),this.addToPushed(n),this.push(e,t),!0):(n.$item.cols=i,!1)}addToPushed(n){if(this.pushedItems.indexOf(n)<0)this.pushedItems.push(n),this.pushedItemsPath.push([{x:n.item.x||0,y:n.item.y||0,cols:n.item.cols||0,rows:n.item.rows||0},{x:n.$item.x,y:n.$item.y,cols:n.$item.cols,rows:n.$item.rows}]);else{let e=this.pushedItems.indexOf(n);this.pushedItemsPath[e].push({x:n.$item.x,y:n.$item.y,cols:n.$item.cols,rows:n.$item.rows})}}removeFromPushed(n){n>-1&&(this.pushedItems.splice(n,1),this.pushedItemsPath.splice(n,1))}checkPushedItem(n,e){let t=this.pushedItemsPath[e],i=t.length-2,o,l,_,w,x;for(;i>-1;i--)o=t[i],l=n.$item.x,_=n.$item.y,w=n.$item.cols,x=n.$item.rows,n.$item.x=o.x,n.$item.y=o.y,n.$item.cols=o.cols,n.$item.rows=o.rows,this.gridster.findItemWithItem(n.$item)?(n.$item.x=l,n.$item.y=_,n.$item.cols=w,n.$item.rows=x):(n.setSize(),t.splice(i+1,t.length-1-i));return t.length<2?(this.removeFromPushed(e),!0):!1}},Qt=class{constructor(n,e,t){this.zone=t,this.directionFunction=null,this.dragMove=i=>{if(this.directionFunction===null)throw new Error("The `directionFunction` has not been set before calling `dragMove`.");i.stopPropagation(),i.preventDefault(),Q.checkTouchEvent(i),this.offsetTop=this.gridster.el.scrollTop-this.gridster.el.offsetTop,this.offsetLeft=this.gridster.el.scrollLeft-this.gridster.el.offsetLeft,_n(this.gridster,this.left,this.top,this.width,this.height,i,this.lastMouse,this.directionFunction,!0,this.resizeEventScrollType);let o=this.gridster.options.scale||1;this.directionFunction({clientX:this.originalClientX+(i.clientX-this.originalClientX)/o,clientY:this.originalClientY+(i.clientY-this.originalClientY)/o}),this.lastMouse.clientX=i.clientX,this.lastMouse.clientY=i.clientY,this.zone.run(()=>{this.gridster.updateGrid()})},this.dragStop=i=>{i.stopPropagation(),i.preventDefault(),bn(),this.mousemove(),this.mouseup(),this.mouseleave(),this.cancelOnBlur(),this.touchmove(),this.touchend(),this.touchcancel(),this.gridster.dragInProgress=!1,this.gridster.updateGrid(),this.gridster.options.resizable&&this.gridster.options.resizable.stop?Promise.resolve(this.gridster.options.resizable.stop(this.gridsterItem.item,this.gridsterItem,i)).then(this.makeResize,this.cancelResize):this.makeResize(),setTimeout(()=>{this.gridsterItem.renderer.removeClass(this.gridsterItem.el,"gridster-item-resizing"),this.gridster&&(this.gridster.movingItem=null,this.gridster.previewStyle())})},this.cancelResize=()=>{this.gridsterItem.$item.cols=this.gridsterItem.item.cols||1,this.gridsterItem.$item.rows=this.gridsterItem.item.rows||1,this.gridsterItem.$item.x=this.gridsterItem.item.x||0,this.gridsterItem.$item.y=this.gridsterItem.item.y||0,this.gridsterItem.setSize(),this.push.restoreItems(),this.pushResize.restoreItems(),this.push.destroy(),this.push=null,this.pushResize.destroy(),this.pushResize=null},this.makeResize=()=>{this.gridsterItem.setSize(),this.gridsterItem.checkItemChanges(this.gridsterItem.$item,this.gridsterItem.item),this.push.setPushedItems(),this.pushResize.setPushedItems(),this.push.destroy(),this.push=null,this.pushResize.destroy(),this.pushResize=null},this.handleNorth=i=>{this.top=i.clientY+this.offsetTop-this.diffTop,this.height=this.bottom-this.top,this.minHeight>this.height?(this.height=this.minHeight,this.top=this.bottom-this.minHeight):this.gridster.options.enableBoundaryControl&&(this.top=Math.max(0,this.top),this.height=this.bottom-this.top);let o=this.gridster.options.pushItems?this.margin:0;if(this.newPosition=this.gridster.pixelsToPositionY(this.top+o,Math.floor),this.gridsterItem.$item.y!==this.newPosition){if(this.itemBackup[1]=this.gridsterItem.$item.y,this.itemBackup[3]=this.gridsterItem.$item.rows,this.gridsterItem.$item.rows+=this.gridsterItem.$item.y-this.newPosition,this.gridsterItem.$item.y=this.newPosition,this.pushResize.pushItems(this.pushResize.fromSouth),this.push.pushItems(this.push.fromSouth,this.gridster.$options.disablePushOnResize),this.gridster.checkCollision(this.gridsterItem.$item)){this.gridsterItem.$item.y=this.itemBackup[1],this.gridsterItem.$item.rows=this.itemBackup[3],this.top=this.gridster.positionYToPixels(this.gridsterItem.$item.y),this.setItemTop(this.gridster.positionYToPixels(this.gridsterItem.$item.y)),this.setItemHeight(this.gridster.positionYToPixels(this.gridsterItem.$item.rows)-this.margin);return}else this.gridster.previewStyle();this.pushResize.checkPushBack(),this.push.checkPushBack()}this.setItemTop(this.top),this.setItemHeight(this.height)},this.handleWest=i=>{let o=this.gridster.$options.dirType===B.RTL?this.originalClientX+(this.originalClientX-i.clientX):i.clientX;this.left=o+this.offsetLeft-this.diffLeft,this.width=this.right-this.left,this.minWidth>this.width?(this.width=this.minWidth,this.left=this.right-this.minWidth):this.gridster.options.enableBoundaryControl&&(this.left=Math.max(0,this.left),this.width=this.right-this.left);let l=this.gridster.options.pushItems?this.margin:0;if(this.newPosition=this.gridster.pixelsToPositionX(this.left+l,Math.floor),this.gridsterItem.$item.x!==this.newPosition){if(this.itemBackup[0]=this.gridsterItem.$item.x,this.itemBackup[2]=this.gridsterItem.$item.cols,this.gridsterItem.$item.cols+=this.gridsterItem.$item.x-this.newPosition,this.gridsterItem.$item.x=this.newPosition,this.pushResize.pushItems(this.pushResize.fromEast),this.push.pushItems(this.push.fromEast,this.gridster.$options.disablePushOnResize),this.gridster.checkCollision(this.gridsterItem.$item)){this.gridsterItem.$item.x=this.itemBackup[0],this.gridsterItem.$item.cols=this.itemBackup[2],this.left=this.gridster.positionXToPixels(this.gridsterItem.$item.x),this.setItemLeft(this.gridster.positionXToPixels(this.gridsterItem.$item.x)),this.setItemWidth(this.gridster.positionXToPixels(this.gridsterItem.$item.cols)-this.margin);return}else this.gridster.previewStyle();this.pushResize.checkPushBack(),this.push.checkPushBack()}this.setItemLeft(this.left),this.setItemWidth(this.width)},this.handleSouth=i=>{if(this.height=i.clientY+this.offsetTop-this.diffBottom-this.top,this.minHeight>this.height&&(this.height=this.minHeight),this.bottom=this.top+this.height,this.gridster.options.enableBoundaryControl){let l=this.outerMarginBottom??this.margin,_=this.gridster.el.getBoundingClientRect();this.bottom=Math.min(this.bottom,_.bottom-_.top-2*l),this.height=this.bottom-this.top}let o=this.gridster.options.pushItems?0:this.margin;if(this.newPosition=this.gridster.pixelsToPositionY(this.bottom+o,Math.ceil),this.gridsterItem.$item.y+this.gridsterItem.$item.rows!==this.newPosition){if(this.itemBackup[3]=this.gridsterItem.$item.rows,this.gridsterItem.$item.rows=this.newPosition-this.gridsterItem.$item.y,this.pushResize.pushItems(this.pushResize.fromNorth),this.push.pushItems(this.push.fromNorth,this.gridster.$options.disablePushOnResize),this.gridster.checkCollision(this.gridsterItem.$item)){this.gridsterItem.$item.rows=this.itemBackup[3],this.setItemHeight(this.gridster.positionYToPixels(this.gridsterItem.$item.rows)-this.margin);return}else this.gridster.previewStyle();this.pushResize.checkPushBack(),this.push.checkPushBack()}this.setItemHeight(this.height)},this.handleEast=i=>{let o=this.gridster.$options.dirType===B.RTL?this.originalClientX+(this.originalClientX-i.clientX):i.clientX;if(this.width=o+this.offsetLeft-this.diffRight-this.left,this.minWidth>this.width&&(this.width=this.minWidth),this.right=this.left+this.width,this.gridster.options.enableBoundaryControl){let _=this.outerMarginRight??this.margin,w=this.gridster.el.getBoundingClientRect();this.right=Math.min(this.right,w.right-w.left-2*_),this.width=this.right-this.left}let l=this.gridster.options.pushItems?0:this.margin;if(this.newPosition=this.gridster.pixelsToPositionX(this.right+l,Math.
3ceil),this.gridsterItem.$item.x+this.gridsterItem.$item.cols!==this.newPosition){if(this.itemBackup[2]=this.gridsterItem.$item.cols,this.gridsterItem.$item.cols=this.newPosition-this.gridsterItem.$item.x,this.pushResize.pushItems(this.pushResize.fromWest),this.push.pushItems(this.push.fromWest,this.gridster.$options.disablePushOnResize),this.gridster.checkCollision(this.gridsterItem.$item)){this.gridsterItem.$item.cols=this.itemBackup[2],this.setItemWidth(this.gridster.positionXToPixels(this.gridsterItem.$item.cols)-this.margin);return}else this.gridster.previewStyle();this.pushResize.checkPushBack(),this.push.checkPushBack()}this.setItemWidth(this.width)},this.handleNorthWest=i=>{this.handleNorth(i),this.handleWest(i)},this.handleNorthEast=i=>{this.handleNorth(i),this.handleEast(i)},this.handleSouthWest=i=>{this.handleSouth(i),this.handleWest(i)},this.handleSouthEast=i=>{this.handleSouth(i),this.handleEast(i)},this.gridsterItem=n,this.gridster=e,this.lastMouse={clientX:0,clientY:0},this.itemBackup=[0,0,0,0],this.resizeEventScrollType={west:!1,east:!1,north:!1,south:!1}}destroy(){this.gridster?.previewStyle(),this.gridster=this.gridsterItem=null}dragStart(n){if(n.which&&n.which!==1)return;this.gridster.options.resizable&&this.gridster.options.resizable.start&&this.gridster.options.resizable.start(this.gridsterItem.item,this.gridsterItem,n),n.stopPropagation(),n.preventDefault(),this.zone.runOutsideAngular(()=>{this.mousemove=this.gridsterItem.renderer.listen("document","mousemove",this.dragMove),this.touchmove=this.gridster.renderer.listen(this.gridster.el,"touchmove",this.dragMove)}),this.mouseup=this.gridsterItem.renderer.listen("document","mouseup",this.dragStop),this.mouseleave=this.gridsterItem.renderer.listen("document","mouseleave",this.dragStop),this.cancelOnBlur=this.gridsterItem.renderer.listen("window","blur",this.dragStop),this.touchend=this.gridsterItem.renderer.listen("document","touchend",this.dragStop),this.touchcancel=this.gridsterItem.renderer.listen("document","touchcancel",this.dragStop),this.gridsterItem.renderer.addClass(this.gridsterItem.el,"gridster-item-resizing"),this.lastMouse.clientX=n.clientX,this.lastMouse.clientY=n.clientY,this.left=this.gridsterItem.left,this.top=this.gridsterItem.top,this.originalClientX=n.clientX,this.originalClientY=n.clientY,this.width=this.gridsterItem.width,this.height=this.gridsterItem.height,this.bottom=this.gridsterItem.top+this.gridsterItem.height,this.right=this.gridsterItem.left+this.gridsterItem.width,this.margin=this.gridster.$options.margin,this.outerMarginTop=this.gridster.$options.outerMarginTop,this.outerMarginRight=this.gridster.$options.outerMarginRight,this.outerMarginBottom=this.gridster.$options.outerMarginBottom,this.outerMarginLeft=this.gridster.$options.outerMarginLeft,this.offsetLeft=this.gridster.el.scrollLeft-this.gridster.el.offsetLeft,this.offsetTop=this.gridster.el.scrollTop-this.gridster.el.offsetTop,this.diffLeft=n.clientX+this.offsetLeft-this.left,this.diffRight=n.clientX+this.offsetLeft-this.right,this.diffTop=n.clientY+this.offsetTop-this.top,this.diffBottom=n.clientY+this.offsetTop-this.bottom,this.minHeight=this.gridster.positionYToPixels(this.gridsterItem.$item.minItemRows||this.gridster.$options.minItemRows)-this.margin,this.minWidth=this.gridster.positionXToPixels(this.gridsterItem.$item.minItemCols||this.gridster.$options.minItemCols)-this.margin,this.gridster.movingItem=this.gridsterItem.$item,this.gridster.previewStyle(),this.push=new Mt(this.gridsterItem),this.pushResize=new Xt(this.gridsterItem),this.gridster.dragInProgress=!0,this.gridster.updateGrid();let{classList:e}=n.target;e.contains("handle-n")?(this.resizeEventScrollType.north=!0,this.directionFunction=this.handleNorth):e.contains("handle-w")?this.gridster.$options.dirType===B.RTL?(this.resizeEventScrollType.east=!0,this.directionFunction=this.handleEast):(this.resizeEventScrollType.west=!0,this.directionFunction=this.handleWest):e.contains("handle-s")?(this.resizeEventScrollType.south=!0,this.directionFunction=this.handleSouth):e.contains("handle-e")?this.gridster.$options.dirType===B.RTL?(this.resizeEventScrollType.west=!0,this.directionFunction=this.handleWest):(this.resizeEventScrollType.east=!0,this.directionFunction=this.handleEast):e.contains("handle-nw")?this.gridster.$options.dirType===B.RTL?(this.resizeEventScrollType.north=!0,this.resizeEventScrollType.east=!0,this.directionFunction=this.handleNorthEast):(this.resizeEventScrollType.north=!0,this.resizeEventScrollType.west=!0,this.directionFunction=this.handleNorthWest):e.contains("handle-ne")?this.gridster.$options.dirType===B.RTL?(this.resizeEventScrollType.north=!0,this.resizeEventScrollType.west=!0,this.directionFunction=this.handleNorthWest):(this.resizeEventScrollType.north=!0,this.resizeEventScrollType.east=!0,this.directionFunction=this.handleNorthEast):e.contains("handle-sw")?this.gridster.$options.dirType===B.RTL?(this.resizeEventScrollType.south=!0,this.resizeEventScrollType.east=!0,this.directionFunction=this.handleSouthEast):(this.resizeEventScrollType.south=!0,this.resizeEventScrollType.west=!0,this.directionFunction=this.handleSouthWest):e.contains("handle-se")&&(this.gridster.$options.dirType===B.RTL?(this.resizeEventScrollType.south=!0,this.resizeEventScrollType.west=!0,this.directionFunction=this.handleSouthWest):(this.resizeEventScrollType.south=!0,this.resizeEventScrollType.east=!0,this.directionFunction=this.handleSouthEast))}toggle(){this.resizeEnabled=this.gridsterItem.canBeResized(),this.resizableHandles=this.gridsterItem.getResizableHandles()}dragStartDelay(n){if(Q.checkTouchEvent(n),!this.gridster.$options.resizable.delayStart){this.dragStart(n);return}let e=setTimeout(()=>{this.dragStart(n),S()},this.gridster.$options.resizable.delayStart),{cancelMouse:t,cancelMouseLeave:i,cancelOnBlur:o,cancelTouchMove:l,cancelTouchEnd:_,cancelTouchCancel:w}=this.zone.runOutsideAngular(()=>{let k=this.gridsterItem.renderer.listen("document","mouseup",S),H=this.gridsterItem.renderer.listen("document","mouseleave",S),q=this.gridsterItem.renderer.listen("window","blur",S),E=this.gridsterItem.renderer.listen("document","touchmove",x),Y=this.gridsterItem.renderer.listen("document","touchend",S),z=this.gridsterItem.renderer.listen("document","touchcancel",S);return{cancelMouse:k,cancelMouseLeave:H,cancelOnBlur:q,cancelTouchMove:E,cancelTouchEnd:Y,cancelTouchCancel:z}});function x(k){Q.checkTouchEvent(k),(Math.abs(k.clientX-n.clientX)>9||Math.abs(k.clientY-n.clientY)>9)&&S()}function S(){clearTimeout(e),o(),t(),i(),l(),_(),w()}}setItemTop(n){this.gridster.gridRenderer.setCellPosition(this.gridsterItem.renderer,this.gridsterItem.el,this.left,n)}setItemLeft(n){this.gridster.gridRenderer.setCellPosition(this.gridsterItem.renderer,this.gridsterItem.el,n,this.top)}setItemHeight(n){this.gridsterItem.renderer.setStyle(this.gridsterItem.el,"height",n+"px")}setItemWidth(n){this.gridsterItem.renderer.setStyle(this.gridsterItem.el,"width",n+"px")}},xn=(()=>{class s{get zIndex(){return this.getLayerIndex()+this.gridster.$options.baseLayerIndex}constructor(e,t,i,o){this.renderer=i,this.zone=o,this.itemInit=new Me,this.itemChange=new Me,this.itemResize=new Me,this.el=e.nativeElement,this.$item={cols:-1,rows:-1,x:-1,y:-1},this.gridster=t,this.drag=new Gt(this,t,this.zone),this.resize=new Qt(this,t,this.zone)}ngOnInit(){this.gridster.addItem(this)}ngOnChanges(e){e.item&&(this.updateOptions(),this.init||this.gridster.calculateLayout$.next()),e.item&&e.item.previousValue&&this.setSize()}updateOptions(){this.$item=Q.merge(this.$item,this.item,{cols:void 0,rows:void 0,x:void 0,y:void 0,layerIndex:void 0,dragEnabled:void 0,resizeEnabled:void 0,compactEnabled:void 0,maxItemRows:void 0,minItemRows:void 0,maxItemCols:void 0,minItemCols:void 0,maxItemArea:void 0,minItemArea:void 0,resizableHandles:{s:void 0,e:void 0,n:void 0,w:void 0,se:void 0,ne:void 0,sw:void 0,nw:void 0}})}ngOnDestroy(){this.gridster.removeItem(this),this.drag.destroy(),this.resize.destroy(),this.gridster=this.drag=this.resize=null}setSize(){this.renderer.setStyle(this.el,"display",this.notPlaced?"":"block"),this.gridster.gridRenderer.updateItem(this.el,this.$item,this.renderer),this.updateItemSize()}updateItemSize(){let e=this.$item.y*this.gridster.curRowHeight,t=this.$item.x*this.gridster.curColWidth,i=this.$item.cols*this.gridster.curColWidth-this.gridster.$options.margin,o=this.$item.rows*this.gridster.curRowHeight-this.gridster.$options.margin;this.top=e,this.left=t,!this.init&&i>0&&o>0&&(this.init=!0,this.item.initCallback&&this.item.initCallback(this.item,this),this.gridster.options.itemInitCallback&&this.gridster.options.itemInitCallback(this.item,this),this.itemInit.next({item:this.item,itemComponent:this}),this.gridster.$options.scrollToNewItems&&this.el.scrollIntoView(!1)),(i!==this.width||o!==this.height)&&(this.width=i,this.height=o,this.gridster.options.itemResizeCallback&&this.gridster.options.itemResizeCallback(this.item,this),this.itemResize.next({item:this.item,itemComponent:this}))}itemChanged(){this.gridster.options.itemChangeCallback&&this.gridster.options.itemChangeCallback(this.item,this),this.itemChange.next({item:this.item,itemComponent:this})}checkItemChanges(e,t){e.rows===t.rows&&e.cols===t.cols&&e.x===t.x&&e.y===t.y||(this.gridster.checkCollision(this.$item)?(this.$item.x=t.x||0,this.$item.y=t.y||0,this.$item.cols=t.cols||1,this.$item.rows=t.rows||1,this.setSize()):(this.item.cols=this.$item.cols,this.item.rows=this.$item.rows,this.item.x=this.$item.x,this.item.y=this.$item.y,this.gridster.calculateLayout$.next(),this.itemChanged()))}canBeDragged(){let e=this.gridster.$options.draggable.enabled,t=this.$item.dragEnabled===void 0?e:this.$item.dragEnabled;return!this.gridster.mobile&&e&&t}canBeResized(){let e=this.gridster.$options.resizable.enabled,t=this.$item.resizeEnabled===void 0?e:this.$item.resizeEnabled;return!this.gridster.mobile&&e&&t}getResizableHandles(){let e=this.gridster.$options.resizable.handles,t=this.$item.resizableHandles;return t===void 0?e:je(je({},e),t)}bringToFront(e){if(e&&e<=0)return;let t=this.getLayerIndex(),i=this.gridster.$options.maxLayerIndex;if(t<i){let o=e?t+e:i;this.item.layerIndex=this.$item.layerIndex=o>i?i:o}}sendToBack(e){if(e&&e<=0)return;let t=this.getLayerIndex();if(t>0){let i=e?t-e:0;this.item.layerIndex=this.$item.layerIndex=i<0?0:i}}getLayerIndex(){return this.item.layerIndex!==void 0?this.item.layerIndex:this.gridster.$options.defaultLayerIndex!==void 0?this.gridster.$options.defaultLayerIndex:0}static{this.\u0275fac=function(t){return new(t||s)(f(Qe),f(qt),f(qe),f(zt))}}static{this.\u0275cmp=I({type:s,selectors:[["gridster-item"]],hostVars:2,hostBindings:function(t,i){t&2&&bi("z-index",i.zIndex)},inputs:{item:"item"},outputs:{itemInit:"itemInit",itemChange:"itemChange",itemResize:"itemResize"},features:[Xe],ngContentSelectors:un,decls:9,vars:8,consts:[["class","gridster-item-resizable-handler handle-s",3,"mousedown","touchstart",4,"ngIf"],["class","gridster-item-resizable-handler handle-e",3,"mousedown","touchstart",4,"ngIf"],["class","gridster-item-resizable-handler handle-n",3,"mousedown","touchstart",4,"ngIf"],["class","gridster-item-resizable-handler handle-w",3,"mousedown","touchstart",4,"ngIf"],["class","gridster-item-resizable-handler handle-se",3,"mousedown","touchstart",4,"ngIf"],["class","gridster-item-resizable-handler handle-ne",3,"mousedown","touchstart",4,"ngIf"],["class","gridster-item-resizable-handler handle-sw",3,"mousedown","touchstart",4,"ngIf"],["class","gridster-item-resizable-handler handle-nw",3,"mousedown","touchstart",4,"ngIf"],[1,"gridster-item-resizable-handler","handle-s",3,"mousedown","touchstart"],[1,"gridster-item-resizable-handler","handle-e",3,"mousedown","touchstart"],[1,"gridster-item-resizable-handler","handle-n",3,"mousedown","touchstart"],[1,"gridster-item-resizable-handler","handle-w",3,"mousedown","touchstart"],[1,"gridster-item-resizable-handler","handle-se",3,"mousedown","touchstart"],[1,"gridster-item-resizable-handler","handle-ne",3,"mousedown","touchstart"],[1,"gridster-item-resizable-handler","handle-sw",3,"mousedown","touchstart"],[1,"gridster-item-resizable-handler","handle-nw",3,"mousedown","touchstart"]],template:function(t,i){t&1&&($t(),Lt(0),b(1,Yn,1,0,"div",0)(2,jn,1,0,"div",1)(3,Gn,1,0,"div",2)(4,Xn,1,0,"div",3)(5,Qn,1,0,"div",4)(6,qn,1,0,"div",5)(7,Kn,1,0,"div",6)(8,Jn,1,0,"div",7)),t&2&&(h(),c("ngIf",(i.resize.resizableHandles==null?null:i.resize.resizableHandles.s)&&i.resize.resizeEnabled),h(),c("ngIf",(i.resize.resizableHandles==null?null:i.resize.resizableHandles.e)&&i.resize.resizeEnabled),h(),c("ngIf",(i.resize.resizableHandles==null?null:i.resize.resizableHandles.n)&&i.resize.resizeEnabled),h(),c("ngIf",(i.resize.resizableHandles==null?null:i.resize.resizableHandles.w)&&i.resize.resizeEnabled),h(),c("ngIf",(i.resize.resizableHandles==null?null:i.resize.resizableHandles.se)&&i.resize.resizeEnabled),h(),c("ngIf",(i.resize.resizableHandles==null?null:i.resize.resizableHandles.ne)&&i.resize.resizeEnabled),h(),c("ngIf",(i.resize.resizableHandles==null?null:i.resize.resizableHandles.sw)&&i.resize.resizeEnabled),h(),c("ngIf",(i.resize.resizableHandles==null?null:i.resize.resizableHandles.nw)&&i.resize.resizeEnabled))},dependencies:[$],styles:[`gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:white;-webkit-user-select:text;user-select:text}gridster-item.gridster-item-moving{cursor:move}gridster-item.gridster-item-resizing,gridster-item.gridster-item-moving{transition:0s;z-index:2;box-shadow:0 0 5px 5px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.gridster-item-resizable-handler{position:absolute;z-index:2}.gridster-item-resizable-handler.handle-n{cursor:ns-resize;height:10px;right:0;top:0;left:0}.gridster-item-resizable-handler.handle-e{cursor:ew-resize;width:10px;bottom:0;right:0;top:0}.gridster-item-resizable-handler.handle-s{cursor:ns-resize;height:10px;right:0;bottom:0;left:0}.gridster-item-resizable-handler.handle-w{cursor:ew-resize;width:10px;left:0;top:0;bottom:0}.gridster-item-resizable-handler.handle-ne{cursor:ne-resize;width:10px;height:10px;right:0;top:0}.gridster-item-resizable-handler.handle-nw{cursor:nw-resize;width:10px;height:10px;left:0;top:0}.gridster-item-resizable-handler.handle-se{cursor:se-resize;width:0;height:0;right:0;bottom:0;border-style:solid;border-width:0 0 10px 10px;border-color:transparent}.gridster-item-resizable-handler.handle-sw{cursor:sw-resize;width:10px;height:10px;left:0;bottom:0}gridster-item:hover .gridster-item-resizable-handler.handle-se{border-color:transparent transparent #ccc} 4`],encapsulation:2})}}return s})();var Sn=(()=>{class s{static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275mod=ft({type:s})}static{this.\u0275inj=pt({})}}return s})();function ns(s,n){if(s&1&&(r(0,"p")(1,"i"),p(2),a()()),s&2){let e=d().$implicit;h(2),ge(e._description)}}function ss(s,n){s&1&&(r(0,"span"),p(1,"Upgrade"),a())}function os(s,n){s&1&&C(0,"img",11)}function rs(s,n){if(s&1){let e=y();r(0,"tr")(1,"td")(2,"del"),p(3),ne(4,"currency"),a(),C(5,"i",7),p(6),ne(7,"currency"),b(8,ns,3,1,"p",8),a(),r(9,"td")(10,"button",9),u("click",function(){let i=m(e).$implicit,o=d();return g(o.onPlanUpgradeAreYouSure(i))}),b(11,ss,2,0,"span",8)(12,os,1,0,"img",10),a()()()}if(s&2){let e=n.$implicit,t=d();h(3),Oe("",t.getBasePlanName()," ",Ze(4,9,t.getBasePlanPrice(),"USD","$"),""),h(3),vi(" ",e.name," ",Ze(7,13,e.unitAmou
4nt/100,"USD","$")," ",t.getDuration(e)," "),h(2),c("ngIf",e._description),h(2),c("disabled",t.planUpgradeBusy),h(),c("ngIf",!e.busy),h(),c("ngIf",e.busy)}}var Mn=(()=>{class s{constructor(e,t,i,o,l,_,w){this.bsModalRef=e,this.sanitizer=t,this.authService=i,this.adminApiService=o,this.toastService=l,this.modalService=_,this.upgradeService=w,this.planUpgradeBusy=!1}ngOnInit(){this.onClose=new P,this.onOpenTab=new P}sanitize(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}setParameters(e,t){this.accountUsage=e,this.planUpgrades=t}onCancel(){this.onClose.next(void 0),this.bsModalRef.hide()}getBasePlanName(){return this.accountUsage.subscriptionItems.filter(t=>!t.price.isUpsell)[0].price.name.split("-")[0]}getBasePlanPrice(){let e=this.accountUsage.subscriptionItems.filter(t=>!t.price.isUpsell);return e[0].price.unitAmount>0?e[0].price.unitAmount/100:0}onPlanUpgradeAreYouSure(e){let t=this.modalService.show(pe),i=e.unitAmount/100-this.getBasePlanPrice();t.content.setConfirmationModal("Confirm Upgrade","Your base plan upgraded. Your account will be charged an additional "+be(i,"en_US","$")+" per "+this.getDuration(e).toLowerCase()+". The first month will be prorated for the current billing cycle."),t.content.onClose.subscribe(o=>{o===!0&&this.onUpgrade(e)})}onUpgrade(e){this.planUpgradeBusy=!0,e.busy=!0,this.adminApiService.getUpgradeBasePlan(e.id).subscribe(()=>{this.planUpgradeBusy=!1,e.busy=void 0,this.upgradeService.trackSuccessfulBasePlanUpgrade(e,{upgrade_surface:"in-app modal",upgrade_component:"dashboard upgrade modal",page_name:"dashboard",upgrade_flow:"in-app upgrade"},this.accountUsage),this.toastService.showSuccessToast("Your plan was successfully upgraded"),this.authService.getPortfolioUsage(),this.onClose.next(void 0),this.bsModalRef.hide()},t=>{this.planUpgradeBusy=!1,e.busy=void 0,this.toastService.showErrorToast(t.error),this.bsModalRef.hide()})}getDuration(e){let t="";return e.interval==="month"&&e.intervalCount===3?t+="Quarter":(e.intervalCount===1||e.intervalCount!==1&&(t="every "+e.intervalCount+" "),e.interval==="day"?t+="day":e.interval==="week"?t+="week":e.interval==="month"?t+="month":e.interval==="year"&&(t+="year")),t}static{this.\u0275fac=function(t){return new(t||s)(f(oe),f(se),f(Z),f(W),f(re),f(G),f(yt))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-dashboard-upgrade-modal"]],standalone:!1,decls:10,vars:1,consts:[[1,"modal-header"],["type","button","role","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-title","altos-ui-title"],[1,"modal-body"],[1,"table","panel"],[4,"ngFor","ngForOf"],[1,"fa","fa-arrow-right",2,"padding-left","5px"],[4,"ngIf"],["ng-style","{ 'background' : chartColor}",1,"btn","btn-primary",3,"click","disabled"],["src","data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==",4,"ngIf"],["src","data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA=="]],template:function(t,i){t&1&&(r(0,"div",0)(1,"button",1),u("click",function(){return i.onCancel()}),r(2,"span",2),p(3,"\xD7"),a()(),r(4,"h3",3),p(5,"Upgrade Account"),a()(),r(6,"div",4)(7,"table",5)(8,"tbody"),b(9,rs,13,17,"tr",6),a()()()),t&2&&(h(9),c("ngForOf",i.planUpgrades))},dependencies:[he,$,Pi],styles:['@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Bold-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Bold.otf) format("opentype");font-weight:700;font-style:normal;font-display:swap;
4unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Light-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Light.otf) format("opentype");font-weight:300;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Medium-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Medium.otf) format("opentype");font-weight:500;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Roman-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Roman.otf) format("opentype");font-weight:400;font-style:normal;font-display:swap;
4unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Thin-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Thin.otf) format("opentype");font-weight:100;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Bold-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Bold.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Variable-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-VariableFont.ttf) format("truetype");font-weight:300;font-style:normal;font-display:swap;
4unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Regular-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Regular.ttf) format("truetype");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Semibold-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Semibold.ttf) format("truetype");font-weight:600;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:OpenSans;src:url(/assets/fonts/subsets/OpenSans-Regular-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Regular.ttf) format("truetype");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD} body{font-family:OpenSans,Helvetica Neue,Helvetica,Arial,sans-serif}
4.new-angular[_ngcontent-%COMP%]{background:#029acf;color:#fff;text-align:center;cursor:pointer}h3.new-angular[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;padding-top:5px;padding-bottom:5px}.badge[_ngcontent-%COMP%]{background-color:var(--altos-red)}.table-padding[_ngcontent-%COMP%]{margin-right:4px}a[_ngcontent-%COMP%]{color:var(--altos-red)}a.btn-primary[_ngcontent-%COMP%], a.btn-primary[_ngcontent-%COMP%]:hover{color:#fff}a[_ngcontent-%COMP%]:focus, a[_ngcontent-%COMP%]:hover{color:#91170a}.info-block[_ngcontent-%COMP%]{display:block;margin-top:5px;margin-bottom:10px;color:#737373}.btn-primary[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:hover:disabled{background-color:var(--altos-red);border-color:var(--altos-red)}.btn-primary[_ngcontent-%COMP%]:hover, .btn-primary[_ngcontent-%COMP%]:hover:enabled, .btn-primary.active[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active, .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-primary[_ngcontent-%COMP%], .btn-primary.focus[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active:focus{background-color:#91170a!important;border-color:#91170a}.btn-default[_ngcontent-%COMP%]{color:#fff;background-color:#4f5151;border-color:#4f5151}.btn-default[_ngcontent-%COMP%]:hover, .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-default[_ngcontent-%COMP%], .btn-default.active[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:active, .btn-default.focus[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:focus, .btn-default[_ngcontent-%COMP%]:active:focus{color:#fff;background-color:#3f4141;border-color:#3f4141}.btn-outline-secondary[_ngcontent-%COMP%], .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-default[_ngcontent-%COMP%], .btn-default.active[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:active, .btn-default.focus[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:focus, .btn-default[_ngcontent-%COMP%]:active:focus{border-color:#bbb;color:#bbb;background-color:#fff}.btn-outline-secondary[_ngcontent-%COMP%]:hover{background-color:#4f5151;color:#fff}a[_ngcontent-%COMP%]:hover, a[_ngcontent-%COMP%]:focus{color:#91170a;text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]{color:var(--altos-red);text-decoration:none}a.altos-secondary[_ngcontent-%COMP%]:hover, a.altos-secondary[_ngcontent-%COMP%]:focus{color:#a9a9a9;text-decoration:underline;cursor:pointer}a.altos-secondary[_ngcontent-%COMP%]{color:gray;text-decoration:none}a.btn-primary[_ngcontent-%COMP%], a.btn-primary[_ngcontent-%COMP%]:hover, a.btn-secondary[_ngcontent-%COMP%], a.btn-secondary[_ngcontent-%COMP%]:hover, a.btn-default[_ngcontent-%COMP%], a.btn-default[_ngcontent-%COMP%]:hover{color:#fff;text-decoration:none}.pagination[_ngcontent-%COMP%] {margin-top:5px;margin-bottom:5px}.pagination[_ngcontent-%COMP%] .ngx-pagination .current{background:var(--altos-red)}.table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{font-family:OpenSans}.header[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:10px;font-family:OpenSans}hr[_ngcontent-%COMP%]{margin-top:5px}.nounderline[_ngcontent-%COMP%]:hover{text-decoration:none}.option-btn[_ngcontent-%COMP%]{margin-bottom:10px}.title[_ngcontent-%COMP%]{font-size:120%;font-weight:700;font-family:OpenSans}.row[_ngcontent-%COMP%]{margin-right:0}.glyphicon-sort-by-attributes-alt[_ngcontent-%COMP%]{cursor:pointer}@media (min-width:0px) and (max-width: 767px){.header[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:10px;padding-left:10px}}@media (min-width: 768px){.header[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:10px;padding-left:55px}}','@import"//hello.myfonts.net/count/3e13fa";@font-face{font-family:UniversUltraCondensed;src:url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff) format("woff");font-display:block}@font-face{font-family:Univers47CondensedLight;src:url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff) format("woff");font-display:block}@font-face{font-family:UIActionBarText;src:url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff) format("woff");font-display:block}@font-face{font-family:UITitle;src:url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff) format("woff");font-display:block}@font-face{font-family:UIElement;src:url(/assets/fonts/webFonts/UniversLTCondensedBold/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTCondensedBold/font.woff) format("woff");font-display:block}@font-face{font-family:UIDashboardTitle;src:url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff) format("woff");font-display:block}@font-face{font-family:UIExplanatoryText;src:url(/assets/fonts/webFonts/UniversLTProCondensedObl/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProCondensedObl/font.woff) format("woff");font-display:block}[_nghost-%COMP%]{font-size:16px;font-family:Univers47CondensedLight,Helvetica;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[_nghost-%COMP%] .univers-font>.form-control{padding-top:8px;padding-bottom:4px;font-size:16px}[_nghost-%COMP%] .univers-font>
4.ng-select .ng-select-container{color:#555;padding-top:8px;padding-bottom:4px;font-size:16px}[_nghost-%COMP%] .univers-font>.action-bar a, [_nghost-%COMP%] .univers-font>.action-bar button{line-height:1em}.altos-ui-dashboard-header[_ngcontent-%COMP%]{font-family:UniversUltraCondensed;font-size:3em}.altos-ui-dashboard-header-frame[_ngcontent-%COMP%]{padding-top:1em}.altos-ui-actionbar-text[_ngcontent-%COMP%]{font-family:UIActionBarText;font-size:1.4em;font-weight:unset!important}.altos-ui-title[_ngcontent-%COMP%]{font-family:UITitle,Helvetica;font-size:1.7em}.altos-ui-subtitle[_ngcontent-%COMP%]{font-family:UITitle,Helvetica;font-size:1.5em}.altos-ui-element[_ngcontent-%COMP%]{font-family:UIElement,Helvetica;font-size:1em}.altos-ui-dashboard-title[_ngcontent-%COMP%]{font-family:UIDashboardTItle,Helvetica;font-size:2.6em}.altos-ui-explanatory-text[_ngcontent-%COMP%]{font-family:UIExplanatoryText,Helvetica;font-size:1em}@font-face{font-family:Univers_65_Bold;src:url(/assets/fonts/Univers_65_Bold.ttf)}@font-face{font-family:Univers_57_Condensed;src:url(/assets/fonts/Univers_57_Condensed.ttf)}@font-face{font-family:Univers_45_Light;src:url(/assets/fonts/Univers_45_Light.ttf)}.container-fluid[_ngcontent-%COMP%]{max-width:95%;position:relative}.analytics-info[_ngcontent-%COMP%]{font-family:Open Sans,Helvetica Neue,sans-serif;line-height:1.75}.altos-site-h1[_ngcontent-%COMP%], .altos-site-h2[_ngcontent-%COMP%]{font-weight:400}.altos-site-h1[_ngcontent-%COMP%]{font-size:4.5rem;line-height:1.2698}.altos-site-h2[_ngcontent-%COMP%]{font-size:3.2rem;line-height:1.2698}.altos-site-btn[_ngcontent-%COMP%]{color:#fff;border-color:#00b5a7;background:#00b5a7;border-radius:0;border-width:2px;border-style:solid}.altos-site-btn[_ngcontent-%COMP%]:hover{border-color:#00c4b5;background:#00c4b5}p[_ngcontent-%COMP%]{display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0px;margin-inline-end:0px;color:#414042;font-weight:300}ul[_ngcontent-%COMP%], li[_ngcontent-%COMP%]{color:#414042;font-weight:300}.center[_ngcontent-%COMP%]{text-align:center}.dashboard-wrapper[_ngcontent-%COMP%]{font-family:sans-serif,Helvetica Neue,Helvetica,Arial}gridster[_ngcontent-%COMP%]{height:100vh}.dashboard-header[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;padding-bottom:10px;height:37px}.dash-add-dropdown[_ngcontent-%COMP%]{top:31px}.action-bar[_ngcontent-%COMP%]{padding:5px 10px;background-color:var(--altos-dark-red);margin-top:10px;z-index:10}.action-bar[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .action-bar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#fff;font-size:1.8em;padding:4px 9px 0!important}.action-bar[_ngcontent-%COMP%] a.btn[_ngcontent-%COMP%]:hover, .action-bar[_ngcontent-%COMP%] a.btn.focus[_ngcontent-%COMP%], .action-bar[_ngcontent-%COMP%] a.btn[_ngcontent-%COMP%]:focus{color:var(--altos-dark-red)}.action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{background-color:#d3d3d3}.action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%], .action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover:disabled{background-color:var(--altos-dark-red);border-color:var(--altos-dark-red)}.action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover, .action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover:enabled, .btn-primary.active[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active, .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-primary[_ngcontent-%COMP%], .btn-primary.focus[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active:focus{background-color:#fff!important;border-color:#fff;color:var(--altos-dark-red)}.nav-pills[_ngcontent-%COMP%] > li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .nav-pills[_ngcontent-%COMP%] > li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .nav-pills[_ngcontent-%COMP%] > li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover{background-color:#fff!important;border-color:#fff;color:var(--altos-dark-red)}.action-bar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] >
4 a[_ngcontent-%COMP%]:hover, .action-bar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > a.active[_ngcontent-%COMP%]{background-color:#fff!important;border-color:#fff;color:var(--altos-dark-red)}.altos-new-header[_ngcontent-%COMP%]{color:#ac8d32;background:#f7eecf;padding:.5em;display:inline-flex;align-items:center}.altos-new-text[_ngcontent-%COMP%]{padding-top:4px}.btn-new[_ngcontent-%COMP%]{margin-left:auto;background-color:#ac7c3b;color:#fff;font-weight:700}.btn-new[_ngcontent-%COMP%]:hover{background-color:#b49846}',".altos-dashboard-dl-modal-wrapper .action-bar{margin-top:0} .altos-dashboard-dl-modal-wrapper .modal-footer{background-color:var(--altos-dark-red);border-bottom-left-radius:5px;border-bottom-right-radius:5px;padding:0 5px 5px;border:1px solid rgba(0,0,0,.2)} .altos-dashboard-dl-modal-wrapper .modal-header{padding-left:35px;padding-top:5px;padding-bottom:5px} .altos-dashboard-dl-modal-wrapper .modal-body{padding-left:35px;padding-right:35px} .altos-dashboard-dl-modal-wrapper .modal-content{border:0} .altos-dashboard-dl-modal-wrapper .modal-header .close{margin-top:5px}input[type=checkbox][_ngcontent-%COMP%]{margin:auto;vertical-align:middle}@media (min-width: 768px){ .altos-dashboard-dl-modal-wrapper{width:350px!important}}.png-size[_ngcontent-%COMP%]{margin-left:15px}.altos-unselected[_ngcontent-%COMP%]{color:gray}.form-group[_ngcontent-%COMP%]{margin-bottom:5px}.date-option[_ngcontent-%COMP%]{margin-bottom:25px}.modal-footer[_ngcontent-%COMP%]{clear:both}"]})}}return s})();function as(s,n){if(s&1){let e=y();r(0,"button",13),u("click",function(){m(e);let i=d();return g(i.upgrade())}),p(1," Upgrade to Advanced "),a()}}function ls(s,n){s&1&&(r(0,"div",10),p(1," Loading "),a())}function ds(s,n){s&1&&C(0,"full-screen-loading")}var Pt=(()=>{class s{constructor(){this.upgradeService=Se(yt),this.adminApiService=Se(W),this.modalService=Se(G),this.authService=Se(Z),this.mixpanelService=Se(ee),this.destroyRef=Se(ui),this.isLoading=gt(!1),this.basePlans=Di(this.adminApiService.getPublicBasePlans().pipe(li(e=>(console.error(e),Ge(null)))),{initialValue:null}),this.isPremiumOrAdvancedPrice=xi(()=>{let e=this.basePlans();return e?.basePlans?.length?e.basePlans.find(t=>t.id===_e.altos.premiumProductId||t.id===_e.altos.advancedProductId)??null:null}),this.upgradeService.loadScript()}upgrade(){let e=Ni.open(this.modalService,{pricing:[this.upgradeService.getAdvancedPlan()]});this.mixpanelService.onTrackAdmin("Dashboard AA lock upgrade button clicked",null),e.content.onUpgraded$$.pipe(Ui(this.destroyRef)).subscribe(()=>{this.isLoading.set(!0),this.mixpanelService.onTrackAdmin("Dashboard AA lock account base plan upgraded",this.upgradeService.getAdvancedPlan()),this.authService.getPortfolioUsage(()=>{setTimeout(()=>this.isLoading.set(!1),500)})})}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275cmp=I({type:s,selectors:[["admin-dashboard-freemium-lock"]],decls:30,vars:2,consts:[[1,"t-px-12","t-max-w-[1500px]","t-mx-auto"],[1,"t-grid","t-grid-cols-1","lg:t-grid-cols-2","t-gap-14","t-pt-20","t-pb-28"],[1,"text-content"],[1,"font-scale","t-text-[32px]","t-m-0","t-mb-12","stretch"],[1,"confidence"],[1,"t-text-[21px]","font-hanken","t-font-light","t-m-0"],[1,"t-text-[21px]","t-my-12","font-hanken","t-space-y-2"],[1,"t-list-disc","t-list-inside","t-space-y-2","t-ml-4"],[1,"font-hanken","t-text-[21px]"],[1,"t-btn","btn-turquoise","font-cofo-mono","t-text-[20px]","t-mt-12","t-font-light","t-w-full","sm:t-w-[330px]","t-h-[50px]","t-rounded-none","t-uppercase"],[1,"t-skeleton","t-btn","font-cofo-mono","t-text-[20px]","t-mt-12","t-font-light","t-w-full","sm:t-w-[330px]","t-h-[50px]","t-rounded-none","t-uppercase"],[1,"t-m-auto"],["ngSrc","assets/images/analytics.png","alt","analytics","fetchpriority","high","width","640","height","480",1,"t-w-full","t-shadow-lg","t-rounded-md","t-max-w-[640px]"],[1,"t-btn","btn-turquoise","font-cofo-mono","t-text-[20px]","t-mt-12","t-font-light","t-w-full","sm:t-w-[330px]","t-h-[50px]","t-rounded-none","t-uppercase",3,"click"]],template:function(t,i){t&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),p(4," Go Further with "),r(5,"span",4),p(6,"Advanced Analytics"),a()(),r(7,"div",5)(8,"strong"),p(9,"Advanced Analytics"),a(),p(10," gives you deeper, broader access to the data that drives smart decisions. Whether you're tracking buyer activity or comparing counties, this upgrade puts you in full control. "),a(),r(11,"div",6)(12,"div"),p(13,"Here\u2019s what you unlock when you upgrade to Advanced:"),a(),r(14,"ul",7)(15,"li"),p(16,"Access all ZIP, city, county, and regional reports within your chosen state"),a(),r(17,"li"),p(18,"Compare multiple markets side by side in a single dashboard"),a(),r(19,"li"),p(20,"Use exclusive Advanced charts to track signals before they hit the headlines"),a(),r(21,"li"),p(22,"Identify pricing trends, volatility, and inventory shifts with precision"),a()()(),r(23,"p",8),p(24," It\u2019s everything you need to turn insight into action. "),a(),b(25,as,2,0,"button",9)(26,ls,2,0,"div",10),a(),r(27,"div",11),C(28,"img",12),a()()(),b(29,ds,1,0,"full-screen-loading")),t&2&&(h(25),Rt(i.isPremiumOrAdvancedPrice()?25:26),h(4),Rt(i.isLoading()?29:-1))},dependencies:[vt,Hi,ki],styles:["[_nghost-%COMP%]{font-family:sans-serif,Helvetica Neue,Helvetica,Arial}.stretch[_ngcontent-%COMP%]{font-stretch:expanded}.confidence[_ngcontent-%COMP%]{background:-webkit-linear-gradient(0deg,#9747FF 42.62%,#07F0E8 90.97%);-webkit-background-clip:text;-webkit-text-fill-color:transparent}"],changeDetection:0})}}return s})();function hs(s,n){s&1&&C(0,"router-outlet")}function ps(s,n){s&1&&(r(0,"div")(1,"div",3)(2,"div",4)(3,"h2",5),p(4,"Advanced Analytics"),a(),r(5,"p"),p(6,"Re-en
4able your account to use Advanced Analytics. Visit "),r(7,"a",6),p(8,"payment settings"),a(),p(9," to re-enable."),a()()()())}function ms(s,n){if(s&1&&(r(0,"div",2),b(1,hs,1,0,"router-outlet",1),ne(2,"async"),b(3,ps,10,0,"div",1),ne(4,"async"),a()),s&2){let e=d();h(),c("ngIf",e.isDashboardEnabled&&Je(2,2,e.isAccountEnabled$)),h(2),c("ngIf",e.isDashboardEnabled&&Je(4,4,e.isAccountDisabled$))}}function gs(s,n){s&1&&C(0,"admin-dashboard-freemium-lock")}var In=(()=>{class s{constructor(e,t,i,o,l){this.authService=e,this.dataService=t,this.adminApiService=i,this.modalService=o,this.flagService=l,this.destroy$=new P,this.isDashboardEnabled=!1,this.usageReady=!1,this.planUpgrades=[],this.isFreemium=null,this.isLite=null,this.isProfessional=null,this.wideScreen=!1,this.isExistingUser=!1,t.isLegacyUser().subscribe(_=>{this.isExistingUser=_}),this.dataService.isFreemium().pipe(v(this.destroy$)).subscribe(_=>{this.isFreemium=_}),this.dataService.isLite().pipe(v(this.destroy$)).subscribe(_=>{this.isLite=_}),this.dataService.isProfessional().pipe(v(this.destroy$)).subscribe(_=>{this.isProfessional=_}),this.dataService.hasLightOrFreemium().pipe(v(this.destroy$)).subscribe(_=>{this.wideScreen=_})}ngOnInit(){this.isAccountEnabled$=this.dataService.isAccountEnabled(),this.isAccountDisabled$=this.dataService.isAccountDisabled(),j(this.dataService.currentPortfolioUsage,this.dataService.currentActiveAccount).pipe(v(this.destroy$)).subscribe(e=>{if(this.portfolioUsage=e[0],this.activeAccount=e[1],this.accountUsage=this.portfolioUsage.accounts[this.activeAccount.accountIndex],this.portfolioUsage.accounts[this.activeAccount.accountIndex]){let t=this.portfolioUsage.accounts[this.activeAccount.accountIndex].accountId,[i,o]=this.flagService.accountSettings(t,!0);if(i?.hasOwnProperty("dashboard")&&!i.dashboard&&!o.includes(t)){dn.open(this.modalService);return}this.usageReady=!0,this.isDashboardEnabled=this.portfolioUsage.accounts[this.activeAccount.accountIndex].enDashboard||this.portfolioUsage.accounts[this.activeAccount.accountIndex].maximum.customDashboard}this.accountUsage&&this.getPlanUpgrades()})}getBasePlan(){return this.accountUsage.subscriptionItems.filter(t=>!t.price.isUpsell)[0]}getPlanUpgrades(){this.adminApiService.getPlanUpgrades(this.getBasePlan().price.id).pipe(v(this.destroy$)).subscribe(e=>{this.planUpgrades=e.upgrades})}isSubAccount(){return this.accountUsage.price===0}onUpgrade(){this.upgradeModalRef=this.modalService.show(Mn),this.upgradeModalRef.content.setParameters(this.accountUsage,this.planUpgrades),this.upgradeModalRef.content.onClose.pipe(v(this.destroy$)).subscribe(e=>{setTimeout(()=>{this.authService.getPortfolioUsage()},1e3)})}static{this.\u0275fac=function(t){return new(t||s)(f(Z),f(X),f(W),f(G),f(nn))}}static{this.\u0275cmp=I({type:s,selectors:[["app-dashboard"]],standalone:!1,decls:4,vars:6,consts:[["class","dashboard-wrapper univers-font",4,"ngIf"],[4,"ngIf"],[1,"dashboard-wrapper","univers-font"],[1,"t-flex","t-w-full"],[1,"t-w-full"],[1,"t-text-center"],["href","/admin/settings/payments"]],template:function(t,i){t&1&&(b(0,ms,5,6,"div",0),ne(1,"async"),b(2,gs,1,0,"admin-dashboard-freemium-lock",1),ne(3,"async")),t&2&&(c("ngIf",i.isFreemium===!1&&i.isLite===!1&&i.isProfessional===!1||i.isDashboardEnabled&&Je(1,2,i.isAccountEnabled$)),h(2),c("ngIf",i.isFreemium||i.isLite||i.isProfessional||i.usageReady&&!i.isDashboardEnabled&&!Je(3,4,i.isAccountEnabled$)&&i.planUpgrades.length>0))},dependencies:[$,Pt,Ti,Mi],styles:['@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Bold-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Bold.otf) format("opentype");font-weight:700;font-style:normal;font-display:swap;
4unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Light-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Light.otf) format("opentype");font-weight:300;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Medium-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Medium.otf) format("opentype");font-weight:500;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Roman-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Roman.otf) format("opentype");font-weight:400;font-style:normal;font-display:swap;
4unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Thin-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Thin.otf) format("opentype");font-weight:100;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Bold-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Bold.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Variable-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-VariableFont.ttf) format("truetype");font-weight:300;font-style:normal;font-display:swap;
4unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Regular-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Regular.ttf) format("truetype");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Semibold-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Semibold.ttf) format("truetype");font-weight:600;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:OpenSans;src:url(/assets/fonts/subsets/OpenSans-Regular-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Regular.ttf) format("truetype");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD} body{font-family:OpenSans,Helvetica Neue,Helvetica,Arial,sans-serif}
4.new-angular[_ngcontent-%COMP%]{background:#029acf;color:#fff;text-align:center;cursor:pointer}h3.new-angular[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;padding-top:5px;padding-bottom:5px}.badge[_ngcontent-%COMP%]{background-color:var(--altos-red)}.table-padding[_ngcontent-%COMP%]{margin-right:4px}a[_ngcontent-%COMP%]{color:var(--altos-red)}a.btn-primary[_ngcontent-%COMP%], a.btn-primary[_ngcontent-%COMP%]:hover{color:#fff}a[_ngcontent-%COMP%]:focus, a[_ngcontent-%COMP%]:hover{color:#91170a}.info-block[_ngcontent-%COMP%]{display:block;margin-top:5px;margin-bottom:10px;color:#737373}.btn-primary[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:hover:disabled{background-color:var(--altos-red);border-color:var(--altos-red)}.btn-primary[_ngcontent-%COMP%]:hover, .btn-primary[_ngcontent-%COMP%]:hover:enabled, .btn-primary.active[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active, .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-primary[_ngcontent-%COMP%], .btn-primary.focus[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active:focus{background-color:#91170a!important;border-color:#91170a}.btn-default[_ngcontent-%COMP%]{color:#fff;background-color:#4f5151;border-color:#4f5151}.btn-default[_ngcontent-%COMP%]:hover, .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-default[_ngcontent-%COMP%], .btn-default.active[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:active, .btn-default.focus[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:focus, .btn-default[_ngcontent-%COMP%]:active:focus{color:#fff;background-color:#3f4141;border-color:#3f4141}.btn-outline-secondary[_ngcontent-%COMP%], .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-default[_ngcontent-%COMP%], .btn-default.active[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:active, .btn-default.focus[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:focus, .btn-default[_ngcontent-%COMP%]:active:focus{border-color:#bbb;color:#bbb;background-color:#fff}.btn-outline-secondary[_ngcontent-%COMP%]:hover{background-color:#4f5151;color:#fff}a[_ngcontent-%COMP%]:hover, a[_ngcontent-%COMP%]:focus{color:#91170a;text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]{color:var(--altos-red);text-decoration:none}a.altos-secondary[_ngcontent-%COMP%]:hover, a.altos-secondary[_ngcontent-%COMP%]:focus{color:#a9a9a9;text-decoration:underline;cursor:pointer}a.altos-secondary[_ngcontent-%COMP%]{color:gray;text-decoration:none}a.btn-primary[_ngcontent-%COMP%], a.btn-primary[_ngcontent-%COMP%]:hover, a.btn-secondary[_ngcontent-%COMP%], a.btn-secondary[_ngcontent-%COMP%]:hover, a.btn-default[_ngcontent-%COMP%], a.btn-default[_ngcontent-%COMP%]:hover{color:#fff;text-decoration:none}.pagination[_ngcontent-%COMP%] {margin-top:5px;margin-bottom:5px}.pagination[_ngcontent-%COMP%] .ngx-pagination .current{background:var(--altos-red)}.table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{font-family:OpenSans}.header[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:10px;font-family:OpenSans}hr[_ngcontent-%COMP%]{margin-top:5px}.nounderline[_ngcontent-%COMP%]:hover{text-decoration:none}.option-btn[_ngcontent-%COMP%]{margin-bottom:10px}.title[_ngcontent-%COMP%]{font-size:120%;font-weight:700;font-family:OpenSans}.row[_ngcontent-%COMP%]{margin-right:0}.glyphicon-sort-by-attributes-alt[_ngcontent-%COMP%]{cursor:pointer}@media (min-width:0px) and (max-width: 767px){.header[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:10px;padding-left:10px}}@media (min-width: 768px){.header[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:10px;padding-left:55px}}','@import"//hello.myfonts.net/count/3e13fa";@font-face{font-family:UniversUltraCondensed;src:url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff) format("woff");font-display:block}@font-face{font-family:Univers47CondensedLight;src:url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff) format("woff");font-display:block}@font-face{font-family:UIActionBarText;src:url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff) format("woff");font-display:block}@font-face{font-family:UITitle;src:url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff) format("woff");font-display:block}@font-face{font-family:UIElement;src:url(/assets/fonts/webFonts/UniversLTCondensedBold/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTCondensedBold/font.woff) format("woff");font-display:block}@font-face{font-family:UIDashboardTitle;src:url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff) format("woff");font-display:block}@font-face{font-family:UIExplanatoryText;src:url(/assets/fonts/webFonts/UniversLTProCondensedObl/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProCondensedObl/font.woff) format("woff");font-display:block}[_nghost-%COMP%]{font-size:16px;font-family:Univers47CondensedLight,Helvetica;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[_nghost-%COMP%] .univers-font>.form-control{padding-top:8px;padding-bottom:4px;font-size:16px}[_nghost-%COMP%] .univers-font>
4.ng-select .ng-select-container{color:#555;padding-top:8px;padding-bottom:4px;font-size:16px}[_nghost-%COMP%] .univers-font>.action-bar a, [_nghost-%COMP%] .univers-font>.action-bar button{line-height:1em}.altos-ui-dashboard-header[_ngcontent-%COMP%]{font-family:UniversUltraCondensed;font-size:3em}.altos-ui-dashboard-header-frame[_ngcontent-%COMP%]{padding-top:1em}.altos-ui-actionbar-text[_ngcontent-%COMP%]{font-family:UIActionBarText;font-size:1.4em;font-weight:unset!important}.altos-ui-title[_ngcontent-%COMP%]{font-family:UITitle,Helvetica;font-size:1.7em}.altos-ui-subtitle[_ngcontent-%COMP%]{font-family:UITitle,Helvetica;font-size:1.5em}.altos-ui-element[_ngcontent-%COMP%]{font-family:UIElement,Helvetica;font-size:1em}.altos-ui-dashboard-title[_ngcontent-%COMP%]{font-family:UIDashboardTItle,Helvetica;font-size:2.6em}.altos-ui-explanatory-text[_ngcontent-%COMP%]{font-family:UIExplanatoryText,Helvetica;font-size:1em}@font-face{font-family:Univers_65_Bold;src:url(/assets/fonts/Univers_65_Bold.ttf)}@font-face{font-family:Univers_57_Condensed;src:url(/assets/fonts/Univers_57_Condensed.ttf)}@font-face{font-family:Univers_45_Light;src:url(/assets/fonts/Univers_45_Light.ttf)}.container-fluid[_ngcontent-%COMP%]{max-width:95%;position:relative}.analytics-info[_ngcontent-%COMP%]{font-family:Open Sans,Helvetica Neue,sans-serif;line-height:1.75}.altos-site-h1[_ngcontent-%COMP%], .altos-site-h2[_ngcontent-%COMP%]{font-weight:400}.altos-site-h1[_ngcontent-%COMP%]{font-size:4.5rem;line-height:1.2698}.altos-site-h2[_ngcontent-%COMP%]{font-size:3.2rem;line-height:1.2698}.altos-site-btn[_ngcontent-%COMP%]{color:#fff;border-color:#00b5a7;background:#00b5a7;border-radius:0;border-width:2px;border-style:solid}.altos-site-btn[_ngcontent-%COMP%]:hover{border-color:#00c4b5;background:#00c4b5}p[_ngcontent-%COMP%]{display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0px;margin-inline-end:0px;color:#414042;font-weight:300}ul[_ngcontent-%COMP%], li[_ngcontent-%COMP%]{color:#414042;font-weight:300}.center[_ngcontent-%COMP%]{text-align:center}.dashboard-wrapper[_ngcontent-%COMP%]{font-family:sans-serif,Helvetica Neue,Helvetica,Arial}gridster[_ngcontent-%COMP%]{height:100vh}.dashboard-header[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;padding-bottom:10px;height:37px}.dash-add-dropdown[_ngcontent-%COMP%]{top:31px}.action-bar[_ngcontent-%COMP%]{padding:5px 10px;background-color:var(--altos-dark-red);margin-top:10px;z-index:10}.action-bar[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .action-bar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#fff;font-size:1.8em;padding:4px 9px 0!important}.action-bar[_ngcontent-%COMP%] a.btn[_ngcontent-%COMP%]:hover, .action-bar[_ngcontent-%COMP%] a.btn.focus[_ngcontent-%COMP%], .action-bar[_ngcontent-%COMP%] a.btn[_ngcontent-%COMP%]:focus{color:var(--altos-dark-red)}.action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{background-color:#d3d3d3}.action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%], .action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover:disabled{background-color:var(--altos-dark-red);border-color:var(--altos-dark-red)}.action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover, .action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover:enabled, .btn-primary.active[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active, .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-primary[_ngcontent-%COMP%], .btn-primary.focus[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active:focus{background-color:#fff!important;border-color:#fff;color:var(--altos-dark-red)}.nav-pills[_ngcontent-%COMP%] > li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .nav-pills[_ngcontent-%COMP%] > li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .nav-pills[_ngcontent-%COMP%] > li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover{background-color:#fff!important;border-color:#fff;color:var(--altos-dark-red)}.action-bar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] >
4 a[_ngcontent-%COMP%]:hover, .action-bar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > a.active[_ngcontent-%COMP%]{background-color:#fff!important;border-color:#fff;color:var(--altos-dark-red)}.altos-new-header[_ngcontent-%COMP%]{color:#ac8d32;background:#f7eecf;padding:.5em;display:inline-flex;align-items:center}.altos-new-text[_ngcontent-%COMP%]{padding-top:4px}.btn-new[_ngcontent-%COMP%]{margin-left:auto;background-color:#ac7c3b;color:#fff;font-weight:700}.btn-new[_ngcontent-%COMP%]:hover{background-color:#b49846}']})}}return s})();function us(s,n){if(s&1){let e=y();r(0,"button",8),u("click",function(){m(e);let i=d(2);return g(i.onSubmit())}),p(1," Get Pendings "),a()}}function fs(s,n){if(s&1&&(r(0,"div",5)(1,"div",6),b(2,us,2,0,"button",7),a()()),s&2){let e=d();h(2),c("ngIf",!e.pendingsEnabled)}}var Be=(()=>{class s{constructor(e){this.bsModalRef=e,this.pendingsEnabled=!1}ngOnInit(){this.onClose=new P}setModalData(e=!1){this.pendingsEnabled=e}onSubmit(){this.onClose.next(!0),this.bsModalRef.hide()}onCancel(){this.onClose.next(!1),this.bsModalRef.hide()}hideConfirmationModal(){this.onClose.next(null),this.bsModalRef.hide()}static{this.\u0275fac=function(t){return new(t||s)(f(oe))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-pending-info-modal"]],standalone:!1,decls:9,vars:1,consts:[[1,"t-p-6","t-border-b","t-border-b-gray-300","t-flex","t-justify-between"],[1,"t-m-0","font-scale","t-text-[24px]"],["type","button",1,"t-text-[21px]","t-float-right","t-cursor-pointer","t-relative","t-bottom-2","hover:t-opacity-75",3,"click"],["width","100%","height","315","src",_i`https://www.youtube.com/embed/quthLCJL6-E?si=qxMt1KwNQR_mh_ya`,"title","YouTube video player","frameborder","0","allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share","referrerpolicy","strict-origin-when-cross-origin","allowfullscreen",""],["class","t-p-6 t-border-t t-border-t-gray-300",4,"ngIf"],[1,"t-p-6","t-border-t","t-border-t-gray-300"],[1,"t-w-full","t-text-end"],["type","submit","class","t-btn btn-purple t-text-[14px] font-cofo-mono",3,"click",4,"ngIf"],["type","submit",1,"t-btn","btn-purple","t-text-[14px]","font-cofo-mono",3,"click"]],template:function(t,i){t&1&&(r(0,"div",0)(1,"h2",1),p(2," Demo: Pending Sales Data "),a(),r(3,"button",2),u("click",function(){return i.onCancel()}),r(4,"span"),p(5,"\xD7"),a()()(),r(6,"div"),C(7,"iframe",3),a(),b(8,fs,3,1,"div",4)),t&2&&(h(8),c("ngIf",!i.pendingsEnabled))},dependencies:[$],encapsulation:2})}}return s})();var Ne=(()=>{class s{constructor(e){this.bsModalRef=e}ngOnInit(){this.onClose=new P}onSubmit(){this.onClose.next(!0),this.bsModalRef.hide()}onCancel(){this.onClose.next(!1),this.bsModalRef.hide()}hideConfirmationModal(){this.onClose.next(null),this.bsModalRef.hide()}static{this.\u0275fac=function(t){return new(t||s)(f(oe))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-pending-addon-modal"]],standalone:!1,decls:29,vars:0,consts:[[1,"t-p-6","t-border-b","t-border-b-gray-300","t-flex","t-justify-between"],[1,"t-m-0","font-scale","t-text-[24px]","t-relative","t-top-1"],["type","button",1,"t-text-[21px]","t-float-right","t-cursor-pointer","t-relative","t-bottom-2","hover:t-opacity-75",3,"click"],[1,"t-p-6","font-hanken"],[1,"t-mt-7"],[1,"t-p-6","t-border-t","t-border-t-gray-300"],[1,"t-w-full","t-text-end"],["type","submit",1,"t-btn","btn-purple","t-text-[14px]","font-cofo-mono",3,"click"]],template:function(t,i){t&1&&(r(0,"div",0)(1,"h2",1),p(2," New in Advanced Analytics "),a(),r(3,"button",2),u("click",function(){return i.onCancel()}),r(4,"span"),p(5,"\xD7"),a()()(),r(6,"div",3),p(7," Pending Sales data is our clearest signal to date for future home sales. With Pendings Sales data, you\u2019ll be able to spot trends in home sales weeks before transactions close. "),C(8,"br"),r(9,"h3",4),p(10,"Use Pending Sales data to understand:"),a(),C(11,"br"),r(12,"ul")(13,"li"),p(14,"Transaction volume and market growth"),a(),r(15,"li"),p(16,"The current pace of home sales"),a(),r(17,"li"),p(18,"Consumer reactions to mortgage rate changes"),a(),r(19,"li"),p(20,"Future sales prices and trends"),a(),r(21,"dd"),p(22,"\u2026 and many other home sales trends."),a()(),C(23,"br"),p(24,` Pending Sales data is available for $30/month. 5`),a(),r(25,"div",5)(26,"div",6)(27,"button",7),u("click",function(){return i.onSubmit()}),p(28," Get Add-on "),a()()())},styles:[".btn-default[_ngcontent-%COMP%]{color:#fff;background-color:#4f5151;border-color:#4f5151}.btn-default[_ngcontent-%COMP%]:hover{color:#fff;background-color:#3f4141;border-color:#3f4141}.btn-primary[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:hover:disabled{background-color:var(--altos-red);border-color:var(--altos-red)}
5.btn-primary[_ngcontent-%COMP%]:hover:enabled{background-color:#91170a;border-color:#91170a}"]})}}return s})();var He=(()=>{class s{constructor(e){this.bsModalRef=e}ngOnInit(){}static{this.\u0275fac=function(t){return new(t||s)(f(oe))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-account-updating-modal"]],decls:7,vars:0,consts:[[1,"t-p-6","t-border-b","t-border-b-gray-300","t-flex","t-justify-between"],["src","/assets/site/images/logo_1.svg","alt","logo",1,"altos-logo"],[1,"t-p-6"],[1,"font-scale","t-text-center","t-w-full"]],template:function(t,i){t&1&&(r(0,"div",0),C(1,"img",1),a(),r(2,"div",2)(3,"h4",3),p(4," This account is being updated "),a(),C(5,"br")(6,"br"),a())},styles:[".btn-default[_ngcontent-%COMP%]{color:#fff;background-color:#4f5151;border-color:#4f5151}.btn-default[_ngcontent-%COMP%]:hover{color:#fff;background-color:#3f4141;border-color:#3f4141}.btn-primary[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:hover:disabled{background-color:var(--altos-red);border-color:var(--altos-red)}.btn-primary[_ngcontent-%COMP%]:hover:enabled{background-color:#91170a;border-color:#91170a}.altos-logo[_ngcontent-%COMP%]{height:30px;padding-top:0;padding-bottom:0;padding-left:50px}.modal-title[_ngcontent-%COMP%]{font-weight:700}.altos-text-center[_ngcontent-%COMP%]{text-align:center}"]})}}return s})();var Tt=Vn(Bn());var me=(()=>{class s{constructor(e){this.document=e}getDashboardCols(e){return e.analysisType==="rank"||e.analysisType==="profile_table"||e.analysisType==="comparison"&&e.chartType==="sparkline"?2:(e.analysisType==="mai"||e.analyzeType==="yoy",4)}getDashboardRows(e){let t=50.86,i=this.document.getElementById("capture-ready")?.getAttribute("data-height"),o=i?+i:365;if(e.analysisType==="rank"){let l=Math.ceil(o/t);return 7*Math.ceil(l/7)}else{if(e.analysisType==="profile_table")return 14;if(e.analysisType==="comparison"&&e.chartType==="sparkline"){let l=Math.ceil(o/t);return 7*Math.ceil(l/7)}else return e.analysisType==="mai"||e.analyzeType==="yoy",7}}getDashboardRatio(e){return e.analysisType==="rank"||e.analysisType==="profile_table"||e.analysisType==="comparison"&&e.chartType==="sparkline"?"2:1":e.analysisType==="mai"?"100:53":(e.analyzeType==="yoy","3:2")}getDashboardWidth(e){return e.analysisType==="rank"||e.analysisType==="profile_table"||e.analysisType==="comparison"&&e.chartType==="sparkline"?300:e.analysisType==="mai"?450:(e.analyzeType==="yoy",750)}getDefaultPngWidthHeightRatio(e,t=-1){let i=t,o;return e.analysisType==="rank"?(i=t!=-1?t:500,o=this.aspectRatio(322,i),{width:322,height:i,ratio:o}):e.analysisType==="profile_table"?{width:322,height:668,ratio:"161:334"}:e.analysisType==="comparison"&&e.chartType==="sparkline"?(i=t!=-1?t:500,o=this.aspectRatio(322,i),{width:322,height:i,ratio:o}):e.analysisType==="mai"?{width:500,height:380,ratio:"30:19"}:e.analyzeType==="yoy"?{width:600,height:338,ratio:"16:9"}:{width:600,height:338,ratio:"16:9"}}gcd(e,t){return t?this.gcd(t,e%t):e}aspectRatio(e,t){let i=this.gcd(e,t);return`${e/i}:${t/i}`}defaultWidgetsParam(e,t){return[this.defaultLineGraph(e,t),this.defaultSparkLine(e,t),this.defaultRankWidget(e,t),this.defaultYearOverYear(e,t),this.defaultWidgetMai(e,t),this.defaultMarketProfile(e,t)]}defaultLineGraph(e,t){return{accountId:e,geoLocations:t,presetParams:{defaultWidget:{x:0,y:28},title:"Median Price",uuid:"",chartType:"line",analysisType:"comparison",stats:["price_median"],resTypes:["100"],windowSizes:["7D"],marketSegments:["0"],years:[this.getYear()],isGroupYAxis:!1,enDataLabels:!1,enAnnotations:!1,enYoyMarkers:!0,categories:["city","zip"],nValue:10,isTop:!1,inventory:10,dateRange:"3y"}}}defaultRankWidget(e,t){return{accountId:e,geoLocations:t,presetParams:{defaultWidget:{x:0,y:0},title:"Median Price Ranking",uuid:"",chartType:"sparkline",analysisType:"rank",stats:["price_median"],resTypes:["100"],windowSizes:["90D"],marketSegments:["0"],years:[this.getYear()],isGroupYAxis:!1,enDataLabels:!1,enAnnotations:!1,enYoyMarkers:!0,categories:["city"],nValue:10,isTop:!0,inventory:10,dateRange:"3y"}}}defaultYearOverYear(e,t){return{accountId:e,geoLocations:t,presetParams:{defaultWidget:{x:0,y:21},title:"Median New Listings Price",uuid:"",chartType:"line",anal
5ysisType:"comparison",stats:["new_price_median"],resTypes:["100"],windowSizes:["7D"],marketSegments:["0"],years:[2024,2023,2022],isGroupYAxis:!1,enDataLabels:!1,enAnnotations:!1,enYoyMarkers:!0,categories:["city","zip"],nValue:10,isTop:!1,inventory:10,dateRange:"3y"}}}defaultSparkLine(e,t){return{accountId:e,geoLocations:t,presetParams:{defaultWidget:{x:4,y:0},title:"Median Price",uuid:"",chartType:"sparkline",analysisType:"comparison",stats:["price_median"],resTypes:["100"],windowSizes:["90D"],marketSegments:["0"],years:[this.getYear()],isGroupYAxis:!1,enDataLabels:!1,enAnnotations:!1,enYoyMarkers:!0,categories:["city","zip"],nValue:10,isTop:!1,inventory:10,dateRange:"3y"}}}defaultWidgetMai(e,t){return{accountId:e,geoLocations:t,presetParams:{defaultWidget:{x:0,y:14},title:"Market Action Index",uuid:"",chartType:"",analysisType:"mai",stats:["price_median"],resTypes:["100"],windowSizes:["7D"],marketSegments:["0"],years:[this.getYear()],isGroupYAxis:!1,enDataLabels:!1,enAnnotations:!1,enYoyMarkers:!0,categories:["city","zip"],nValue:10,isTop:!1,inventory:10,dateRange:"custom"}}}defaultMarketProfile(e,t){return{accountId:e,geoLocations:t,presetParams:{defaultWidget:{x:2,y:0},title:"Market Profile",uuid:"",chartType:"",analysisType:"profile_table",stats:["price_median"],resTypes:["100"],windowSizes:["7D"],marketSegments:["0"],years:[this.getYear()],isGroupYAxis:!1,enDataLabels:!1,enAnnotations:!1,enYoyMarkers:!0,categories:["city","zip"],nValue:10,isTop:!1,inventory:10,dateRange:"custom"}}}getYear(){return new Date().getFullYear()}static{this.\u0275fac=function(t){return new(t||s)(mi(_t))}}static{this.\u0275prov=pi({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var _s=s=>({"has-error":s}),Pn=()=>["btn-purple"],An=()=>["btn-purple-outline"];function bs(s,n){if(s&1){let e=y();r(0,"div",17)(1,"label",21),p(2," Height (pixels) "),a(),r(3,"input",22),U("ngModelChange",function(i){m(e);let o=d(2);return F(o.height,i)||(o.height=i),g(i)}),a()()}if(s&2){let e=d(2);h(3),T("ngModel",e.height)}}function ys(s,n){if(s&1){let e=y();r(0,"div",17)(1,"label",23),p(2," Aspect Ratio "),a(),r(3,"input",24),U("ngModelChange",function(i){m(e);let o=d(2);return F(o.ratio,i)||(o.ratio=i),g(i)}),a()()}if(s&2){let e=d(2);h(3),T("ngModel",e.ratio)}}function vs(s,n){s&1&&(r(0,"span",25),p(1,"Provide a number"),a())}function Cs(s,n){s&1&&(r(0,"span",25),p(1,"Provide a <number>:<number> (i.e. 16:9)"),a())}function ws(s,n){if(s&1){let e=y();r(0,"div",12)(1,"div",13)(2,"button",14),u("click",function(){m(e);let i=d();return g(i.onTypeChange())}),p(3," Standard "),a(),r(4,"button",15),u("click",function(){m(e);let i=d();return g(i.onTypeChange())}),p(5," Advanced "),a()(),b(6,bs,4,1,"div",16)(7,ys,4,1,"div",16),r(8,"div",17)(9,"label",18),p(10," Width (pixels) "),a(),r(11,"input",19),U("ngModelChange",function(i){m(e);let o=d();return F(o.width,i)||(o.width=i),g(i)}),a()(),b(12,vs,2,0,"span",20)(13,Cs,2,0,"span",20),a()}if(s&2){let e=d();c("ngClass",R(8,_s,e.checkRatioInvalid()||e.checkWidthInvalid())),h(2),c("ngClass",e.isTypeStandard?Ke(10,Pn):Ke(11,An)),h(2),c("ngClass",e.isTypeStandard?Ke(13,An):Ke(12,Pn)),h(2),c("ngIf",e.isTypeStandard),h(),c("ngIf",!e.isTypeStandard),h(4),T("ngModel",e.width),h(),c("ngIf",e.checkWidthInvalid()),h(),c("ngIf",e.checkRatioInvalid())}}function xs(s,n){s&1&&(r(0,"div",26),C(1,"div",27),a())}var At=(()=>{class s{constructor(e,t,i,o,l,_){this.platformId=e,this.bsModalRef=t,this.sanitizer=i,this.adminApiService=o,this.dataService=l,this.dashboardUtils=_,this.downloadSelect="png",this.shareSize="landscape",this.ratio="16:9",this.width=600,this.isAlwaysCurrent=!0,this.isTypeStandard=!0,this.newTable=!1,this.isDownload=!1}ngOnInit(){this.onClose=new P,this.onOpenTab=new P}setModalData(e,t,i,o,l){this.url=e,this.width=t,this.height=i,this.ratio=o,this.newTable=l}sanitize(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}onCancel(){this.onClose.next(void 0),this.bsModalRef.hide()}onDownloadChanged(e){this.downloadSelect=e}onTypeChange(){this.isTypeStandard=!this.isTypeStandard}updateAspect(){this.isTypeStandard&&(this.ratio=this.dashboardUtils.aspectRatio(this.width,this.height))}onDownload(){this.updateAspect();let e;e=this.buildUrl(),e=e.replace(/html\/analysis-chart\/widget/,"api/analysis-chart-dl"),this.adminApiService.getChartUrl(e).subscribe(t=>{this.downloadImage(t.url,t.filename,"image/png")})}getShareUrl(){let e=this.buildUrl();return e=e.replace(/html\/analysis-chart\/widget/,"api/analysis-chart"),e}onShare(){let e=this.getShareUrl();K(this.platformId)&&(this.onOpenTab.next(e),this.bsModalRef.hide())}buildUrl(){let e=this.url+"&ratio="+this.ratio+"&width="+this.width;if(this.newTable&&(e+="&is_new_aa=true"),this.isAlwaysCurrent)e+="&is-always-current=true";else{let t=new Date().toISOString().split("T")[0];e+="&endDate="+t}return e+="&ma="+Date.now(),e}downloadImage(e,t,i){this.isDownload=!0,this.adminApiService.getImageBlob(e).subscribe(o=>{if(this.isDownload=!1,K(this.platformId)){let w=t,x=o.headers.get("Content-Disposition");if(x){let k=x.split(";")[1].split("filename")[1].split("=")[1].trim();k&&(w=decodeURIComponent(k)+".png")}var l=new Blob([o.body],{type:i});if(this.onClose.next(void 0),this.bsModalRef.hide(),window.navigator&&window.navigator.msSaveOrOpenBlob){window.navigator.msSaveOrOpenBlob(l);return}let S=window.URL.createObjectURL(l);var _=document.createElement("a");_.href=S,_.download=w||"image.png",_.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),setTimeout(function(){window.URL.revokeObjectURL(S),_.remove()},100)}},o=>{this.isDownload=!1,console.error(o)})}checkRatioInvalid(){let e=this.ratio.split(":");return!(e.length===2&&Number.isInteger(Number(e[0]))&&Number.isInteger(Number(e[1])))}checkWidthInvalid(){return!(this.width.toString().length>0&&typeof this.width<"u"&&Number.isInteger(Number(this.width)))}static{this.\u0275fac=function(t){return new(t||s)(f(de),f(oe),f(se),f(W),f(X),f(me))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-dashboard-download-modal"]],standalone:!1,decls:17,vars:2,consts:[[1,"t-p-6","t-border-b","t-border-b-gray-300","t-flex","t-justify-between"],[1,"t-m-0","font-scale","t-text-[24px]"],["type","button","role","button",1,"t-text-[21px]","t-float-right","t-cursor-pointer","t-relative","t-bottom-2","hover:t-opacity-75",3,"click"],["aria-hidden","true"],[1,"t-p-6","t-h-[140px]"],[3,"ngClass",4,"ngIf"],[1,"t-p-6","t-border-t","t-border-t-gray-300"],[1,"t-flex","t-justify-end","t-gap-x-4"],["type","button","id","cancel-btn",1,"t-btn","t-cursor-pointer","t-text-[14px]","font-cofo-mono","t-border","t-border-[#A9A9A9]","t-text-[#A9A9A9]",3,"click"],["type","button",1,"t-btn","t-cursor-pointer","t-text-[14px]","font-cofo-mono","t-border","t-border-[#A9A9A9]","t-text-[#A9A9A9]",3,"click"],["type","button",1,"t-btn","btn-purple","t-text-[14px]","font-cofo-mono",3,"click"],["class","t-absolute t-w-full t-h-full t-left-0 t-top-0 t-flex t-justify-center t-items-center t-bg-[#7676764d]",4,"ngIf"],[3,"ngClass"],[1,"t-join","t-mb-4"],["type","button","name","standard","id","standard",1,"t-btn","t-join-item","t-text-[14px]","font-cofo-mono",3,"click","ngClass"],["type","button","name","advanced","id","advanced",1,"t-btn","t-join-item","t-text-[14px]","font-cofo-mono",3,"click","ngClass"],["class","t-flex t-justify-between t-mb-4",4,"ngIf"],[1,"t-flex","t-justify-between","t-mb-4"],["for","width",1,"t-font-inter","t-w-7/12","t-m-0","t-flex","t-items-center"],["id","width","type","text",1,"t-w-5/12","t-input","t-input-bordered","t-text-[14px]",3,"ngModelChange","ngModel"],["class","help-block",4,"ngIf"],["for","height",1,"t-font-inter","t-w-7/12","t-m-0","t-flex","t-items-center"],["id","height","type","text",1,"t-w-5/12","t-input","t-input-bordered","t-text-[14px]",3,"ngModelChange","ngModel"],["for","ratio",1,"t-font-inter","t-w-7/12","t-m-0","t-flex","t-items-center"],["id","ratio","type","text",1,"t-w-5/12","t-input","t-input-bordered","t-text-[14px]",3,"ngModelChange","ngModel"],[1,"help-block"],[1,"t-absolute","t-w-full","t-h-full","t-left-0","t-top-0","t-flex","t-justify-center","t-items-center","t-bg-[#7676764d]"],[1,"t-loading","t-loading-ring","t-w-40","bg-purple"]],template:function(t,i){t&1&&(r(0,"div",0)(1,"h3",1),p(2," Download PNG "),a(),r(3,"button",2),u("click",function(){return i.onCancel()}),r(4,"span",3),p(5,"\xD7"),a()()(),r(6,"div",4),b(7,ws,14,14,"div",5),a(),r(8,"div",6)(9,"div",7)(10,"button",8),u("click",function(){return i.onCancel()}),p(11," Cancel "),a(),r(12,"button",9),u("click",function(){return i.onShare()}),p(13," New Tab "),a(),r(14,"button",10),u("click",function(){return i.onDownload()}),p(15," Download "),a()(),b(16,xs,2,0,"div",11),a()),t&2&&(h(7),c("ngIf",i.downloadSelect==="png"),h(9),c("ngIf",i.isDownload))},dependencies:[ce,$,Re,$e,Le],styles:[".altos-dashboard-dl-modal-wrapper .action-bar{margin-top:0} .altos-dashboard-dl-modal-wrapper .modal-footer{background-color:var(--altos-dark-red);border-bottom-left-radius:5px;border-bottom-right-radius:5px;padding:0 5px 5px;border:1px solid rgba(0,0,0,.2)} .altos-dashboard-dl-modal-wrapper .modal-header{padding-left:35px;padding-top:5px;padding-bottom:5px} .altos-dashboard-dl-modal-wrapper .modal-body{padding-left:35px;padding-right:35px} .altos-dashboard-dl-modal-wrapper .modal-content{border:0} .altos-dashboard-dl-modal-wrapper .modal-header .close{margin-top:5px}input[type=checkbox][_ngcontent-%COMP%]{margin:auto;vertical-align:middle}@media (min-width: 768px){ .altos-dashboard-dl-modal-wrapper{width:350px!important}}.png-size[_ngcontent-%COMP%]{margin-left:15px}.altos-unselected[_ngcontent-%COMP%]{color:gray}.form-group[_ngcontent-%COMP%]{margin-bottom:5px}.date-option[_ngcontent-%COMP%]{margin-bottom:25px}.modal-footer[_ngcontent-%COMP%]{clear:both}.btn-altos-red[_ngcontent-%COMP%]{color:#fff;background-color:var(--altos-red);border-color:var(--altos-dark-red)}
5.btn-altos-red.active[_ngcontent-%COMP%], .btn-altos-red[_ngcontent-%COMP%]:active, .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-altos-red[_ngcontent-%COMP%]{color:#fff;background-color:var(--altos-dark-red);background-image:none;border-color:var(--altos-dark-red)}.btn-altos-red[_ngcontent-%COMP%]:focus{outline:none;box-shadow:none}.type-toggle[_ngcontent-%COMP%]{padding-bottom:5px}"]})}}return s})();var kt=(()=>{class s{constructor(e,t){this.bsModalRef=e,this.sanitizer=t,this.isAlwaysCurrent=!0,this.isInteractive=!1}ngOnInit(){this.onClose=new P}setModalData(e,t,i){this.url=e,this.ratio=t,this.width=i,this.createHtml()}sanitize(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}onCancel(){this.onClose.next(void 0),this.bsModalRef.hide()}createHtml(){let e=this.getShareUrl();this.html='<img src="'+e+'"/></a>'}createIframe(){let e=this.buildUrl();this.html='<iframe src="'+e+'" height="100%" width="'+this.width+'"></iframe>'}onCopyHtml(){this.onClose.next("Successfully copied image html to the clipboard."),this.bsModalRef.hide()}onUpdateHtml(){this.isInteractive=!this.isInteractive,this.isInteractive?this.createIframe():this.createHtml()}onUpdateTime(){this.isAlwaysCurrent=!this.isAlwaysCurrent,this.createHtml()}getShareUrl(){let e=this.buildUrl();return e=e.replace(/html\/analysis-chart\/widget/,"api/analysis-chart"),e}buildUrl(){let e=this.url+"&ratio="+this.ratio+"&width="+this.width;if(this.isAlwaysCurrent)e+="&is-always-current=true";else{let t=new Date().toISOString().split("T")[0];e+="&endDate="+t}return e}static{this.\u0275fac=function(t){return new(t||s)(f(oe),f(se))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-dashboard-embed-modal"]],standalone:!1,decls:40,vars:10,consts:[[1,"t-p-6","t-border-b","t-border-b-gray-300","t-flex","t-justify-between"],[1,"t-m-0","font-scale","t-text-[24px]"],["type","button","role","button",1,"t-text-[21px]","t-float-right","t-cursor-pointer","t-relative","t-bottom-2","hover:t-opacity-75",3,"click"],["aria-hidden","true"],[1,"t-p-6"],["id","date-option",1,"date-option"],[1,"font-hanken","t-text-[24px]","t-m-0","t-mb-4"],[1,"altos-ui-element","t-flex","t-gap-x-2"],["name","current-yes","id","current-yes","type","radio",1,"t-radio","checked:bg-purple",3,"ngModelChange","click","value","ngModel"],["name","current-no","id","current-no","type","radio",1,"t-radio","checked:bg-purple",3,"ngModelChange","click","value","ngModel"],["id","iframe-option"],["name","interactive-yes","id","interactive-yes","type","radio",1,"t-radio","checked:bg-purple",3,"ngModelChange","click","value","ngModel"],["name","interactive-no","id","interactive-no","type","radio",1,"t-radio","checked:bg-purple",3,"ngModelChange","click","value","ngModel"],["id","location",1,"t-mt-4"],["id","embedLink","type","text","readonly","readonly",1,"t-input","t-input-bordered","t-text-[14px]","t-w-full",3,"ngModelChange","ngModel"],[1,"t-p-6","t-border-t","t-border-t-gray-300"],[1,"t-flex","t-justify-end","t-gap-x-4"],["type","button","id","cancel-btn",1,"t-btn","t-cursor-pointer","t-text-[14px]","font-cofo-mono","t-border","t-border-[#A9A9A9]","t-text-[#A9A9A9]",3,"click"],["id","share-button","type","button","ngxClipboard","",1,"t-btn","btn-purple","t-text-[14px]","font-cofo-mono",3,"click","cbContent"]],template:function(t,i){t&1&&(r(0,"div",0)(1,"h3",1),p(2," Embed Code "),a(),r(3,"button",2),u("click",function(){return i.onCancel()}),r(4,"span",3),p(5,"\xD7"),a()()(),r(6,"div",4)(7,"div")(8,"div",5)(9,"div")(10,"h3",6),p(11," Keep up-to-date? "),a(),r(12,"div")(13,"label",7)(14,"input",8),U("ngModelChange",function(l){return F(i.isAlwaysCurrent,l)||(i.isAlwaysCurrent=l),l}),u("click",function(){return i.onUpdateTime()}),a(),p(15," Yes, always show up-to-date data "),a()(),r(16,"div")(17,"label",7)(18,"input",9),U("ngModelChange",function(l){return F(i.isAlwaysCurrent,l)||(i.isAlwaysCurrent=l),l}),u("click",function(){return i.onUpdateTime()}),a(),p(19," No, use the current defined date range "),a()()()(),r(20,"div",10)(21,"div")(22,"h3",6),p(23,"Make it Interactive?"),a(),r(24,"div")(25,"label",7)(26,"input",11),U("ngModelChange",function(l){return F(i.isInteractive,l)||(i.isInteractive=l),l}),u("click",function(){return i.onUpdateHtml()}),a(),p(27," Yes, enable interactive embed "),a()(),r(28,"div")(29,"label",7)(30,"input",12),U("ngModelChange",function(l){return F(i.isInteractive,l)||(i.isInteractive=l),l}),u("click",function(){return i.onUpdateHtml()}),a(),p(31," No, embed is static "),a()()()(),r(32,"div",13)(33,"input",14),U("ngModelChange",function(l){return F(i.html,l)||(i.html=l),l}),a()()()(),r(34,"div",15)(35,"div",16)(36,"button",17),u("click",function(){return i.onCancel()}),p(37," Cancel "),a(),r(38,"button",18),u("click",function(){return i.onCopyHtml()}),p(39," Copy Code "),a()()()),t&2&&(h(14),c("value",!0),T("ngModel",i.isAlwaysCurrent),h(4),c("value",!1),T("ngModel",i.isAlwaysCurrent),h(8),c("value",!0),T("ngModel",i.isInteractive),h(4),c("value",!1),T("ngModel",i.isInteractive),h(3),T("ngModel",i.html),h(5),c("cbContent",i.html))},dependencies:[Re,zi,$e,Le,Yi],styles:[".altos-dashboard-dl-modal-wrapper .action-bar{margin-top:0} .altos-dashboard-dl-modal-wrapper .modal-footer{background-color:var(--altos-dark-red);border-bottom-left-radius:5px;border-bottom-right-radius:5px;padding:0 5px 5px;border:1px solid rgba(0,0,0,.2)} .altos-dashboard-dl-modal-wrapper .modal-header{padding-left:35px;padding-top:5px;padding-bottom:5px} .altos-dashboard-dl-modal-wrapper .modal-body{padding-left:35px;padding-right:35px} .altos-dashboard-dl-modal-wrapper .modal-content{border:0} .altos-dashboard-dl-modal-wrapper .modal-header .close{margin-top:5px}input[type=checkbox][_ngcontent-%COMP%]{margin:auto;vertical-align:middle}@media (min-width: 768px){ .altos-dashboard-dl-modal-wrapper{width:350px!important}}.png-size[_ngcontent-%COMP%]{margin-left:15px}.altos-unselected[_ngcontent-%COMP%]{color:gray}.form-group[_ngcontent-%COMP%]{margin-bottom:5px}.date-option[_ngcontent-%COMP%]{margin-bottom:25px}.modal-footer[_ngcontent-%COMP%]{clear:both}"]})}}return s})();function Ms(s,n){s&1&&C(0,"div",12)}function Is(s,n){if(s&1){let e=y();r(0,"li",9),u("click",function(){m(e);let i=d();return g(i.onEdit())}),p(1," Edit "),a()}}function Ps(s,n){if(s&1){let e=y();r(0,"li",9),u("click",function(){m(e);let i=d();return g(i.onEmbed())}),p(1," Embed Code "),a()}}function As(s,n){if(s&1){let e=y();r(0,"li",13),u("click",function(){m(e);let i=d();return g(i.onDelete())}),p(1," Archive "),a()}}function ks(s,n){if(s&1&&C(0,"html-dashboard-analysis",14),s&2){let e=d();c("index",e.index)("triggerCsv",e.triggerCsv)("isDashboardView",!0)("isRearrange",e.isRearrange)}}var Fn=(()=>{class s{constructor(e,t,i,o,l,_,w,x,S){this.adminApiService=e,this.sanitizer=t,this.toastService=i,this.modalService=o,this.router=l,this.dashboardService=_,this.dashboardDataService=w,this.utils=x,this.dashboardUtils=S,this.isResizable=!1,this.deleteIndex=new Me,this.destroy$=new P,this.showHeader=!1,this.triggerCsv=null}ngOnChanges(){this.item.presetParams&&this.accountHash&&this.buildUrl(),this.item&&this.dashboardDataService.insertDashboardItem(this.index,this.item),this.accountHash&&this.dashboardDataService.changePai(this.accountHash)}getTarget(){return"altos-chart-"+this.index}buildUrl(){this.chartUrl=_e.altos.baseUrl+"/html/analysis-chart/widget?pai="+this.accountHash+"&uuid="+this.item.chartUuid}onCopyLink(){this.toastService.showSuccessToast("Successfully copied image to the clipboard.")}onDownload(){let e=this.dashboardUtils.getDefaultPngWidthHeightRatio(this.item.presetParams);this.downloadModalRef=this.modalService.show(At,{class:"altos-dashboard-dl-modal-wrapper"}),this.downloadModalRef.content.setModalData(this.chartUrl,e.width,e.height,e.ratio,!1),this.downloadModalRef.content.onClose.pipe(v(this.destroy$)).subscribe(t=>{t&&this.toastService.showSuccessToast(t)}),this.downloadModalRef.content.onOpenTab.pipe(v(this.destroy$)).subscribe(t=>{setTimeout(()=>{window.open(t,"_blank")},150)})}onEmbed(){this.embedModalRef=this.modalService.show(kt,{class:"altos-dashboard-dl-modal-wrapper"}),this.embedModalRef.content.setModalData(this.chartUrl,this.item.dashboardSize.ratio,this.item.dashboardSize.width),this.embedModalRef.content.onClose.pipe(v(this.destroy$)).subscribe(e=>{e&&this.toastService.showSuccessToast(e)})}onDownloadCsv(){this.triggerCsv=!this.triggerCsv}onEdit(){this.router.navigate(["/admin/dashboard/widget-edit/"+this.item.chartUuid])}
5onDelete(){this.deleteIndex.emit(this.index)}static{this.\u0275fac=function(t){return new(t||s)(f(W),f(se),f(re),f(G),f(J),f(we),f(We),f(Ce),f(me))}}static{this.\u0275cmp=I({type:s,selectors:[["dashboard-item"]],inputs:{index:"index",accountHash:"accountHash",document:"document",item:"item",isRearrange:"isRearrange",isResizable:"isResizable",isAdmin:"isAdmin"},outputs:{deleteIndex:"deleteIndex"},standalone:!1,features:[Xe],decls:16,vars:7,consts:[[1,"altos-dashboard-item",3,"id"],["id","overlay","class","rearrange-overlay",4,"ngIf"],[1,"t-dropdown","t-absolute","t-right-0","t-z-10",3,"click"],[1,"t-flex","t-justify-end"],["type","button","id","dash-add","aria-haspopup","true","aria-expanded","false","tabindex","0",1,"t-bg-white","t-flex","t-items-center","t-justify-center","t-p-2","t-transition","t-border","t-border-transparent","hover:t-rounded-l-lg","hover:t-border-base-200","hover:t-bg-gray-800","t-group"],["xmlns","http://www.w3.org/2000/svg","width","14","height","14","fill","currentColor","viewBox","0 -65 192 512"],["d","M96 64a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm0 192a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm0 192a64 64 0 1 0 0-128 64 64 0 1 0 0 128z",1,"t-fill-gray-400","group-hover:t-fill-white"],["aria-labelledby","dash-add","tabindex","0",1,"t-dropdown-content","t-menu","t-bg-base-100","t-rounded-box","t-z-20","t-w-52","t-p-2","t-shadow-md","t-absolute","t-right-0","t-mt-2"],["class","t-py-2 t-px-4 t-cursor-pointer hover:t-bg-base-200 t-rounded-md t-text-[14px]",3,"click",4,"ngIf"],[1,"t-py-2","t-px-4","t-cursor-pointer","hover:t-bg-base-200","t-rounded-md","t-text-[14px]",3,"click"],["class","t-py-2 t-px-4 t-cursor-pointer hover:t-bg-base-200 t-rounded-md t-text-[14px] t-text-red-500",3,"click",4,"ngIf"],[3,"index","triggerCsv","isDashboardView","isRearrange",4,"ngIf"],["id","overlay",1,"rearrange-overlay"],[1,"t-py-2","t-px-4","t-cursor-pointer","hover:t-bg-base-200","t-rounded-md","t-text-[14px]","t-text-red-500",3,"click"],[3,"index","triggerCsv","isDashboardView","isRearrange"]],template:function(t,i){t&1&&(r(0,"div",0),b(1,Ms,1,0,"div",1),r(2,"div",2),u("click",function(l){return l.stopImmediatePropagation()}),r(3,"div",3)(4,"button",4),mt(),r(5,"svg",5),C(6,"path",6),a()()(),gi(),r(7,"ul",7),b(8,Is,2,0,"li",8),r(9,"li",9),u("click",function(){return i.onDownload()}),p(10," Download PNG "),a(),r(11,"li",9),u("click",function(){return i.onDownloadCsv()}),p(12," Download CSV "),a(),b(13,Ps,2,0,"li",8)(14,As,2,0,"li",10),a()(),b(15,ks,1,4,"html-dashboard-analysis",11),a()),t&2&&(L("id","dashboard-item-",i.index,""),h(),c("ngIf",i.isRearrange&&!i.isResizable),h(7),c("ngIf",i.isAdmin),h(5),c("ngIf",i.isAdmin),h(),c("ngIf",i.isAdmin),h(),c("ngIf",i.accountHash&&i.item&&i.item.chartUuid))},dependencies:[$,xt],styles:['@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Bold-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Bold.otf) format("opentype");font-weight:700;font-style:normal;font-display:swap;
5unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Light-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Light.otf) format("opentype");font-weight:300;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Medium-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Medium.otf) format("opentype");font-weight:500;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Roman-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Roman.otf) format("opentype");font-weight:400;font-style:normal;font-display:swap;
5unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Helvetica Neue;src:url(/assets/fonts/subsets/HelveticaNeue-Thin-latin.woff2) format("woff2"),url(/assets/fonts/webFonts/Helvetica-Neue/HelveticaNeue-Thin.otf) format("opentype");font-weight:100;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Bold-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Bold.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Variable-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-VariableFont.ttf) format("truetype");font-weight:300;font-style:normal;font-display:swap;
5unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Regular-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Regular.ttf) format("truetype");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Open Sans;src:url(/assets/fonts/subsets/OpenSans-Semibold-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Semibold.ttf) format("truetype");font-weight:600;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:OpenSans;src:url(/assets/fonts/subsets/OpenSans-Regular-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Regular.ttf) format("truetype");font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0100-017F,U+0180-024F,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD} body{font-family:OpenSans,Helvetica Neue,Helvetica,Arial,sans-serif}
5.new-angular[_ngcontent-%COMP%]{background:#029acf;color:#fff;text-align:center;cursor:pointer}h3.new-angular[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;padding-top:5px;padding-bottom:5px}.badge[_ngcontent-%COMP%]{background-color:var(--altos-red)}.table-padding[_ngcontent-%COMP%]{margin-right:4px}a[_ngcontent-%COMP%]{color:var(--altos-red)}a.btn-primary[_ngcontent-%COMP%], a.btn-primary[_ngcontent-%COMP%]:hover{color:#fff}a[_ngcontent-%COMP%]:focus, a[_ngcontent-%COMP%]:hover{color:#91170a}.info-block[_ngcontent-%COMP%]{display:block;margin-top:5px;margin-bottom:10px;color:#737373}.btn-primary[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:hover:disabled{background-color:var(--altos-red);border-color:var(--altos-red)}.btn-primary[_ngcontent-%COMP%]:hover, .btn-primary[_ngcontent-%COMP%]:hover:enabled, .btn-primary.active[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active, .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-primary[_ngcontent-%COMP%], .btn-primary.focus[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active:focus{background-color:#91170a!important;border-color:#91170a}.btn-default[_ngcontent-%COMP%]{color:#fff;background-color:#4f5151;border-color:#4f5151}.btn-default[_ngcontent-%COMP%]:hover, .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-default[_ngcontent-%COMP%], .btn-default.active[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:active, .btn-default.focus[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:focus, .btn-default[_ngcontent-%COMP%]:active:focus{color:#fff;background-color:#3f4141;border-color:#3f4141}.btn-outline-secondary[_ngcontent-%COMP%], .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-default[_ngcontent-%COMP%], .btn-default.active[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:active, .btn-default.focus[_ngcontent-%COMP%], .btn-default[_ngcontent-%COMP%]:focus, .btn-default[_ngcontent-%COMP%]:active:focus{border-color:#bbb;color:#bbb;background-color:#fff}.btn-outline-secondary[_ngcontent-%COMP%]:hover{background-color:#4f5151;color:#fff}a[_ngcontent-%COMP%]:hover, a[_ngcontent-%COMP%]:focus{color:#91170a;text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]{color:var(--altos-red);text-decoration:none}a.altos-secondary[_ngcontent-%COMP%]:hover, a.altos-secondary[_ngcontent-%COMP%]:focus{color:#a9a9a9;text-decoration:underline;cursor:pointer}a.altos-secondary[_ngcontent-%COMP%]{color:gray;text-decoration:none}a.btn-primary[_ngcontent-%COMP%], a.btn-primary[_ngcontent-%COMP%]:hover, a.btn-secondary[_ngcontent-%COMP%], a.btn-secondary[_ngcontent-%COMP%]:hover, a.btn-default[_ngcontent-%COMP%], a.btn-default[_ngcontent-%COMP%]:hover{color:#fff;text-decoration:none}.pagination[_ngcontent-%COMP%] {margin-top:5px;margin-bottom:5px}.pagination[_ngcontent-%COMP%] .ngx-pagination .current{background:var(--altos-red)}.table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{font-family:OpenSans}.header[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:10px;font-family:OpenSans}hr[_ngcontent-%COMP%]{margin-top:5px}.nounderline[_ngcontent-%COMP%]:hover{text-decoration:none}.option-btn[_ngcontent-%COMP%]{margin-bottom:10px}.title[_ngcontent-%COMP%]{font-size:120%;font-weight:700;font-family:OpenSans}.row[_ngcontent-%COMP%]{margin-right:0}.glyphicon-sort-by-attributes-alt[_ngcontent-%COMP%]{cursor:pointer}@media (min-width:0px) and (max-width: 767px){.header[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:10px;padding-left:10px}}@media (min-width: 768px){.header[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:10px;padding-left:55px}}','@import"//hello.myfonts.net/count/3e13fa";@font-face{font-family:UniversUltraCondensed;src:url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff) format("woff");font-display:block}@font-face{font-family:Univers47CondensedLight;src:url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff) format("woff");font-display:block}@font-face{font-family:UIActionBarText;src:url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProUltCond/font.woff) format("woff");font-display:block}@font-face{font-family:UITitle;src:url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff) format("woff");font-display:block}@font-face{font-family:UIElement;src:url(/assets/fonts/webFonts/UniversLTCondensedBold/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTCondensedBold/font.woff) format("woff");font-display:block}@font-face{font-family:UIDashboardTitle;src:url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProLightCond/font.woff) format("woff");font-display:block}@font-face{font-family:UIExplanatoryText;src:url(/assets/fonts/webFonts/UniversLTProCondensedObl/font.woff2) format("woff2"),url(/assets/fonts/webFonts/UniversLTProCondensedObl/font.woff) format("woff");font-display:block}[_nghost-%COMP%]{font-size:16px;font-family:Univers47CondensedLight,Helvetica;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[_nghost-%COMP%] .univers-font>.form-control{padding-top:8px;padding-bottom:4px;font-size:16px}[_nghost-%COMP%] .univers-font>
5.ng-select .ng-select-container{color:#555;padding-top:8px;padding-bottom:4px;font-size:16px}[_nghost-%COMP%] .univers-font>.action-bar a, [_nghost-%COMP%] .univers-font>.action-bar button{line-height:1em}.altos-ui-dashboard-header[_ngcontent-%COMP%]{font-family:UniversUltraCondensed;font-size:3em}.altos-ui-dashboard-header-frame[_ngcontent-%COMP%]{padding-top:1em}.altos-ui-actionbar-text[_ngcontent-%COMP%]{font-family:UIActionBarText;font-size:1.4em;font-weight:unset!important}.altos-ui-title[_ngcontent-%COMP%]{font-family:UITitle,Helvetica;font-size:1.7em}.altos-ui-subtitle[_ngcontent-%COMP%]{font-family:UITitle,Helvetica;font-size:1.5em}.altos-ui-element[_ngcontent-%COMP%]{font-family:UIElement,Helvetica;font-size:1em}.altos-ui-dashboard-title[_ngcontent-%COMP%]{font-family:UIDashboardTItle,Helvetica;font-size:2.6em}.altos-ui-explanatory-text[_ngcontent-%COMP%]{font-family:UIExplanatoryText,Helvetica;font-size:1em}@font-face{font-family:Univers_65_Bold;src:url(/assets/fonts/Univers_65_Bold.ttf)}@font-face{font-family:Univers_57_Condensed;src:url(/assets/fonts/Univers_57_Condensed.ttf)}@font-face{font-family:Univers_45_Light;src:url(/assets/fonts/Univers_45_Light.ttf)}.container-fluid[_ngcontent-%COMP%]{max-width:95%;position:relative}.analytics-info[_ngcontent-%COMP%]{font-family:Open Sans,Helvetica Neue,sans-serif;line-height:1.75}.altos-site-h1[_ngcontent-%COMP%], .altos-site-h2[_ngcontent-%COMP%]{font-weight:400}.altos-site-h1[_ngcontent-%COMP%]{font-size:4.5rem;line-height:1.2698}.altos-site-h2[_ngcontent-%COMP%]{font-size:3.2rem;line-height:1.2698}.altos-site-btn[_ngcontent-%COMP%]{color:#fff;border-color:#00b5a7;background:#00b5a7;border-radius:0;border-width:2px;border-style:solid}.altos-site-btn[_ngcontent-%COMP%]:hover{border-color:#00c4b5;background:#00c4b5}p[_ngcontent-%COMP%]{display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0px;margin-inline-end:0px;color:#414042;font-weight:300}ul[_ngcontent-%COMP%], li[_ngcontent-%COMP%]{color:#414042;font-weight:300}.center[_ngcontent-%COMP%]{text-align:center}.dashboard-wrapper[_ngcontent-%COMP%]{font-family:sans-serif,Helvetica Neue,Helvetica,Arial}gridster[_ngcontent-%COMP%]{height:100vh}.dashboard-header[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;padding-bottom:10px;height:37px}.dash-add-dropdown[_ngcontent-%COMP%]{top:31px}.action-bar[_ngcontent-%COMP%]{padding:5px 10px;background-color:var(--altos-dark-red);margin-top:10px;z-index:10}.action-bar[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .action-bar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#fff;font-size:1.8em;padding:4px 9px 0!important}.action-bar[_ngcontent-%COMP%] a.btn[_ngcontent-%COMP%]:hover, .action-bar[_ngcontent-%COMP%] a.btn.focus[_ngcontent-%COMP%], .action-bar[_ngcontent-%COMP%] a.btn[_ngcontent-%COMP%]:focus{color:var(--altos-dark-red)}.action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{background-color:#d3d3d3}.action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%], .action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover:disabled{background-color:var(--altos-dark-red);border-color:var(--altos-dark-red)}.action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover, .action-bar[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover:enabled, .btn-primary.active[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active, .open[_ngcontent-%COMP%] > .dropdown-toggle.btn-primary[_ngcontent-%COMP%], .btn-primary.focus[_ngcontent-%COMP%], .btn-primary[_ngcontent-%COMP%]:active:focus{background-color:#fff!important;border-color:#fff;color:var(--altos-dark-red)}.nav-pills[_ngcontent-%COMP%] > li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .nav-pills[_ngcontent-%COMP%] > li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .nav-pills[_ngcontent-%COMP%] > li.active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover{background-color:#fff!important;border-color:#fff;color:var(--altos-dark-red)}.action-bar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] >
5 a[_ngcontent-%COMP%]:hover, .action-bar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > a.active[_ngcontent-%COMP%]{background-color:#fff!important;border-color:#fff;color:var(--altos-dark-red)}.altos-new-header[_ngcontent-%COMP%]{color:#ac8d32;background:#f7eecf;padding:.5em;display:inline-flex;align-items:center}.altos-new-text[_ngcontent-%COMP%]{padding-top:4px}.btn-new[_ngcontent-%COMP%]{margin-left:auto;background-color:#ac7c3b;color:#fff;font-weight:700}.btn-new[_ngcontent-%COMP%]:hover{background-color:#b49846}',"img[_ngcontent-%COMP%]{max-height:100%;max-width:100%}.chart-menu-dropdown[_ngcontent-%COMP%]{top:31px}.isDisabled[_ngcontent-%COMP%]{color:currentColor;cursor:not-allowed;opacity:.5;text-decoration:none}.item-header[_ngcontent-%COMP%]{position:absolute;z-index:10;width:100%}.translucent-edit[_ngcontent-%COMP%]{position:absolute;left:0;top:0;background:#00000040;z-index:7;width:100%;height:100%}.altos-item-action[_ngcontent-%COMP%]{position:absolute;right:0;border-color:#fff;z-index:9}.rearrange-overlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;background-color:#363c4540;z-index:9999}"]})}}return s})();var Un=s=>({"t-tab-active":s});function Fs(s,n){if(s&1){let e=y();r(0,"button",24),u("click",function(){m(e);let i=d();return g(i.onPendingPurchase())}),p(1," Get Add-On "),a()}if(s&2){let e=d();c("disabled",e.pendingAddons.length==0)}}function Us(s,n){if(s&1){let e=y();r(0,"button",33),u("click",function(){m(e);let i=d(2);return g(i.undo())}),mt(),r(1,"svg",34),C(2,"path",35),a()()}}function Ds(s,n){if(s&1){let e=y();r(0,"div",25),C(1,"div"),r(2,"div",26)(3,"div",27),u("click",function(){m(e);let i=d();return g(i.onMove())}),p(4,"Move"),a(),r(5,"div",27),u("click",function(){m(e);let i=d();return g(i.onResize())}),p(6,"Resize"),a()(),r(7,"div",28)(8,"div",4),b(9,Us,3,0,"button",29),r(10,"button",30),u("click",function(){m(e);let i=d();return g(i.save())})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(11," Save "),a(),r(12,"button",31),u("click",function(){m(e);let i=d();return g(i.cancel())})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(13," Cancel "),a()(),r(14,"div")(15,"button",32),u("click",function(){m(e);let i=d();return g(i.onCompactUp())})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(16," Auto Layout "),a()()()()}if(s&2){let e=d();h(3),c("ngClass",R(3,Un,e.options.draggable.enabled)),h(2),c("ngClass",R(5,Un,e.options.resizable.enabled)),h(4),c("ngIf",e.undoStack.length)}}function Os(s,n){if(s&1){let e=y();r(0,"gridster-item",39)(1,"dashboard-item",40),u("deleteIndex",function(i){m(e);let o=d(2);return g(o.onDelete(i))}),a()()}if(s&2){let e=n.$implicit,t=n.index,i=d(2);c("item",e.dashboardLocation)("id",e.uuid)("ngClass","gridster-item-"+t),h(),c("index",t)("item",e)("accountHash",i.accountHash)("isAdmin",i.isAdmin)("isRearrange",i.isRearrange)("isResizable",i.isResizable)}}function Es(s,n){if(s&1&&(r(0,"div",36)(1,"gridster",37),b(2,Os,2,9,"gridster-item",38),a()()),s&2){let e=d();h(),c("options",e.options),h(),c("ngForOf",e.dashboardItems)}}function zs(s,n){s&1&&(r(0,"div",41)(1,"div",42)(2,"div",43),C(3,"span",44)(4,"span",44),a(),C(5,"span",45),a()())}var Dn="DEFAULT_WIDGET_CREATED",On=(()=>{class s{resize(){this.updateAllWidgets()}constructor(e,t,i,o,l,_,w,x,S,k,H,q,E,Y){this.authService=e,this.adminApiService=t,this.mixpanelService=i,this.router=o,this.changeDetection=l,this.toastService=_,this.dataService=w,this.utils=x,this.modalService=S,this.dashboardDataService=k,this.dashboardUtils=H,this.titleService=q,this.chartService=E,this.document=Y,this.destroy$=new P,this.isRearrange=!1,this.isAdmin=!1,this.isLoading=!0,this.pendingsEnabled=!1,this.pendingAddons=new Array,this.isResizable=!1,this.undoStack=[],this.date=new Date().toISOString().split("T")[0],this.options={gridType:M.VerticalFixed,compactType:A.None,margin:15,outerMargin:!0,outerMarginTop:null,outerMarginRight:12,outerMarginBottom:null,outerMarginLeft:0,useTransformPositioning:!1,mobileBreakpoint:640,minCols:0,maxCols:12,minRows:3,maxRows:994,max
5ItemCols:100,minItemCols:1,maxItemRows:100,minItemRows:1,maxItemArea:2500,minItemArea:1,defaultItemCols:3,defaultItemRows:3,fixedColWidth:1,fixedRowHeight:50,keepFixedHeightInMobile:!0,keepFixedWidthInMobile:!1,scrollSensitivity:10,scrollSpeed:20,enableEmptyCellClick:!1,enableEmptyCellContextMenu:!1,enableEmptyCellDrop:!1,enableEmptyCellDrag:!1,enableOccupiedCellDrop:!1,emptyCellDragMaxCols:50,emptyCellDragMaxRows:50,ignoreMarginInRow:!1,draggable:{enabled:!1,stop:()=>{this.pushCurrentState()}},resizable:{enabled:!1,stop:(z,ie)=>{this.pushCurrentState(),setTimeout(()=>{this.updateWidget(z,ie)})}},swap:!1,pushItems:!0,disablePushOnDrag:!1,disablePushOnResize:!1,pushDirections:{north:!0,east:!0,south:!0,west:!0},pushResizeItems:!1,displayGrid:It.OnDragAndResize,disableWindowResize:!1,disableWarnings:!1,scrollToNewItems:!1,itemResizeCallback:this.itemResize.bind(this),setGridSize:!0},this.router.events.pipe(fe((z,ie)=>ie instanceof ve?z.url===ie.url:!0)).pipe(v(this.destroy$)).subscribe(()=>{this.mixpanelService.onTrackAdmin("Analytics Dashboard viewed",null)}),this.chartService.resetZoom$.pipe(v(this.destroy$)).subscribe(z=>{if(z&&z.uuid){let ie={el:{attributes:{id:{value:z.uuid}}}};this.updateWidget(null,ie)}})}get getShowAddAddons(){return!this.isLoading&&!(this.currentUser&&this.currentUser.isInternal)&&!this.pendingsEnabled}undo(){if(this.undoStack.length>0){let e=this.undoStack.pop();e&&(this.dashboardItems.forEach((t,i)=>{e[i]&&(t.dashboardLocation=e[i].dashboardLocation)}),this.options.api.optionsChanged(),this.changeDetection.detectChanges())}}itemResize(e,t){if(t.el.attributes.id){let i=this.dashboardItems.findIndex(l=>l.uuid===t.el.attributes.id.value),o=this.document.querySelector(".gridster-item-"+i);o&&(this.width=o.clientWidth,this.ratio=this.utils.aspectRatio(this.width,o.clientHeight),this.dashboardDataService.insertWidth(i,this.width),this.dashboardDataService.insertRatio(i,this.ratio))}}pushCurrentState(){let e=(0,Tt.cloneDeep)(this.dashboardItems);this.undoStack.push(e)}ngOnInit(){j([this.dataService.currentPortfolioUsage,this.dataService.currentActiveAccount]).pipe(v(this.destroy$)).subscribe(e=>{this.portfolioUsage=e[0],this.activeAccount=e[1],this.initDefaultWidgets()})}initDefaultWidgets(){this.adminApiService.getAnalysisWidgets().pipe(Te(e=>{if(!e.widgets.length&&!localStorage.getItem(Dn)){let t=this.portfolioUsage.accounts[this.activeAccount.accountIndex].accountId;return this.adminApiService.getReportsByAccount(t,1,1,null,!0).pipe(Te(i=>{if(!i.results.length)return Ge(null);let o=this.dashboardUtils.defaultWidgetsParam(t,i.results.map(l=>l.hash)).map(l=>this.adminApiService.postDashboardChart(l).pipe(si(_=>({response:_,param:l}))));return ai(o).pipe(Te(l=>oi([l.map(_=>this.onCreateDashboard(_.response.chart.uuid,_.param.presetParams))])),hi(()=>localStorage.setItem(Dn,"true")))}))}return Ge(null)})).subscribe(()=>{this.initWidgets()})}initWidgets(){this.accountHash=this.portfolioUsage.accounts[this.activeAccount.accountIndex].accountHash,this.pendingsEnabled=this.portfolioUsage.accounts[this.activeAccount.accountIndex].maximum.dashboardPendings,this.isAdmin=this.portfolioUsage.accounts[this.activeAccount.accountIndex].isAccountAdmin,this.changeDetection.detectChanges(),this.getPendingAddons(),this.dataService.currentCurrentUser.pipe(v(this.destroy$)).subscribe(e=>{this.currentUser=e,this.setMeta()}),this.getDashboardItems()}onCreateDashboard(e,t){let i={chartUuid:e,dashboardLocation:{x:t.defaultWidget?.x,y:t.defaultWidget?.y,cols:this.dashboardUtils.getDashboardCols(t),rows:this.dashboardUtils.getDashboardRows(t)},dashboardSize:{ratio:this.dashboardUtils.getDashboardRatio(t),width:this.dashboardUtils.getDashboardWidth(t)}};this.adminApiService.postAddChartToDashboard(i).pipe(v(this.destroy$)).subscribe(()=>{this.router.navigate(["/admin/dashboard"])})}setMeta(){let e="Altos Research | Advanced Analytics";e+=this.currentUser.company?" | "+this.currentUser.company:"",this.titleService.setTitle(e)}getDashboardItems(){this.isLoading=!0,this.adminApiService.getDashboardItems().pipe(v(this.destroy$),ci(()=>this.isLoading=!1)).subscribe(e=>{this.dashboardItems=e.items,this.dashboardItemsResize=this.dashboardItems.map(()=>
5!1),this.dashboardItems.forEach((t,i)=>{t.presetParams.stats=new Set(t.presetParams.stats),t.presetParams.resTypes=new Set(t.presetParams.resTypes),t.presetParams.windowSizes=new Set(t.presetParams.windowSizes),t.presetParams.marketSegments=new Set(t.presetParams.marketSegments),t.presetParams.years=new Set(t.presetParams.years),t.presetParams.categories=new Set(t.presetParams.categories),t.presetParams.withinStates=new Set(t.presetParams.withinStates),t.presetParams.withinCounties=new Set(t.presetParams.withinCounties),this.dashboardDataService.insertWidth(i,t.dashboardSize.width),this.dashboardDataService.insertRatio(i,t.dashboardSize.ratio)}),this.changeDetection.detectChanges()})}getPendingAddons(){let e=this.portfolioUsage.accounts[this.activeAccount.accountIndex].subscriptionItems.filter(t=>t.price.isBase==!0)[0];this.adminApiService.getDashboardPendingAddons(e.price.interval,e.price.intervalCount).pipe(v(this.destroy$)).subscribe(t=>{this.pendingAddons=t.addOns})}onNewChart(){this.router.navigate(["/admin/dashboard/widget-create"])}onViewWidgetList(){this.router.navigate(["/admin/dashboard/widgets"])}onDelete(e){this.adminApiService.deleteDashboardItem(this.dashboardItems[e].uuid).pipe(v(this.destroy$)).subscribe(()=>{this.dashboardItems.splice(e,1)},t=>{console.error(t),this.toastService.showErrorToast("Error removing widget from dashboard")})}onRearrange(){this.isRearrange=!this.isRearrange,this.isResizable=!1,this.options.draggable.enabled=!0,this.options.api.optionsChanged(),this.defaultDashboardItems=(0,Tt.cloneDeep)(this.dashboardItems)}onResize(){this.isResizable=!0,this.options.resizable.enabled=!0,this.options.draggable.enabled=!1,this.options.api.optionsChanged()}onMove(){this.isResizable=!1,this.options.resizable.enabled=!1,this.options.draggable.enabled=!0,this.options.api.optionsChanged()}save(){this.dashboardItems.length>0&&this.dashboardItems.forEach(e=>ii(this,null,function*(){if(e.uuid){let t={uuid:e.uuid,dashboardLocation:e.dashboardLocation};yield ni(this.adminApiService.patchDashboardItem(t))}})),this.undoStack=[],this.exit()}updateWidget(e,t){let i=this.dashboardItems.findIndex(o=>o.uuid===t.el.attributes.id.value);i>=0&&(this.dashboardItems[i]=(0,Tt.cloneDeep)(this.dashboardItems[i]))}updateAllWidgets(){this.dashboardItems.forEach(e=>{this.updateWidget(null,{el:{attributes:{id:{value:e.uuid}}}})})}cancel(){this.dashboardItems=this.defaultDashboardItems,this.undoStack=[],this.exit()}exit(){this.isRearrange=!this.isRearrange,this.options.resizable.enabled=!1,this.options.draggable.enabled=!1,this.options.api.optionsChanged()}onCompactUp(){this.options.compactType=A.CompactUp,this.options.api.optionsChanged(),this.options.compactType=A.None,this.options.api.optionsChanged()}onPendingInfo(){this.pendingInfoModalRef=this.modalService.show(Be,{class:"altos-dashboard-pending-modal-wrapper"}),this.pendingInfoModalRef.content.setModalData(this.pendingsEnabled),this.pendingInfoModalRef.content.onClose.pipe(v(this.destroy$)).subscribe(e=>{e==!0&&this.onPendingPurchase()}),this.mixpanelService.onTrackAdmin("Analytics: Pending Info Modal Open",{isInternal:this.currentUser.isInternal})}onPendingPurchase(){this.pendingPurchaseModalRef=this.modalService.show(Ne,{class:"altos-dashboard-pending-modal-wrapper"}),this.pendingPurchaseModalRef.content.onClose.pipe(v(this.destroy$)).subscribe(e=>{e==!0&&this.onPlanUpgradeAreYouSure(this.pendingAddons[0])}),this.mixpanelService.onTrackAdmin("Analytics: Pending Purchase Modal Open",{isInternal:this.currentUser.isInternal})}getBasePlanPrice(){let e=this.portfolioUsage.accounts[this.activeAccount.accountIndex].subscriptionItems.filter(t=>!t.price.isUpsell);return e[0].price.unitAmount>0?e[0].price.unitAmount/100:0}getDuration(e){let t="";return e.interval==="month"&&e.intervalCount===3?t+="Quarter":(e.intervalCount===1||e.intervalCount!==1&&(t="every "+e.intervalCount+" "),e.interval==="day"?t+="day":e.interval==="week"?t+="week":e.interval==="month"?t+="month":e.interval==="year"&&(t+="year")),t}onPlanUpgradeAreYouSure(e){let t=this.modalService.show(pe),i=e.unitAmount/100;t.content.setConfirmationModal("Confirm Pendings Add-On","Your account will be charged an additional "+be(i,"en_US","$")+" per "+this.getDuration(e).toLowerCase()+". Your first month will be prorated for the current billing cycle."),t.content.onClose.subscribe(o=>{o===!0&&(this.onUpdatingAccountModal(),this.onUpgrade(e))}),this.mixpanelService.onTrackAdmin("Analytics: Pending Are You Sure Modal Open",{isInternal:this.currentUser.isInternal})}onUpgrade(e){let t={priceId:e.id,quantity:1};this.adminApiService.postAccountUpsell(t).subscribe(()=>{this.toastService.showSuccessToast("You have successfully purchased an upgrade."),this.authService.getPortfolioUsage(),this.updatingModalRef.hide()},i=>{console.error(i),this.updatingModalRef.hide(),this.toastService.showErrorToast("There was and error purchasing the upgrade. Please, contact support.")}),this.mixpanelService.onTrackAdmin("Analytics: Pending Upgrade",{isInternal:this.currentUser.isInternal})}onUpdatingAccountModal(){this.updatingModalRef=this.modalService.show(He,{class:"modal-sm"})}static{this.\u0275fac=function(t){return new(t||s)(f(Z),f(W),f(ee),f(J),f(Ee),f(re),f(X),f(Ce),f(G),f(We),f(me),f(ye),f(we),f(_t))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-analyze-dashboard"]],hostBindings:function(t,i){t&1&&u("resize",function(){return i.resize()},!1,ut)},standalone:!1,decls:38,vars:5,consts:[[1,"t-navbar","t-py-7","sm:t-py-4","bg-lavender"],[1,"t-navbar-start"],[1,"t-navbar-center"],[1,"font-cofo-mono","t-text-[16
5px]","text-olive","t-flex","t-gap-x-4","t-items-center","t-flex-col","sm:t-flex-row"],[1,"t-flex","t-gap-x-4"],["src","assets/images/icons/warning.svg",1,"t-size-8"],["href","javascript: void(0);",1,"text-olive","font-cofo-mono","t-underline",3,"click"],[1,"t-navbar-end"],["class","t-btn btn-purple font-cofo-mono t-text-[16px] t-mr-2 t-relative t-top-6 sm:t-top-0",3,"disabled","click",4,"ngIf"],[1,"t-navbar","t-px-8","sm:t-px-12","t-mt-4","md:t-mt-10"],[1,"font-scale","t-text-[27px]","t-whitespace-nowrap","md:t-whitespace-normal"],[1,"t-navbar-center","t-hidden","sm:t-inline-flex","t-gap-x-4","t-m-0"],[1,"t-bg-white","text-purple","t-border-transparent","t-btn","t-btn-outline","t-px-8","t-text-[16px]","font-hanken","t-border-gray-400","t-bg-transparent","t-font-light","t-rounded-xl","t-transition","hover:border-purple","hover:text-purple"],[1,"t-btn","t-btn-outline","t-px-8","t-text-[16px]","font-hanken","t-border-gray-400","t-bg-transparent","t-font-light","t-rounded-xl","t-transition","hover:border-purple","hover:text-purple",3,"click"],[1,"t-navbar-end","t-hidden","lg:t-inline-flex"],[1,"t-btn","t-flex","t-w-[190px]","btn-purple-outline","font-cofo-mono","t-cursor-pointer","t-h-[45px]","t-text-[16px]","disabled:t-text-gray-400","disabled:t-border-gray-400",3,"click","disabled"],[1,"fa","fa-plus"],[1,"t-inline-flex","sm:t-hidden","t-justify-center","t-w-full"],[1,"t-flex","t-gap-x-4","t-m-0","t-mb-2","sm:t-mb-0"],[1,"t-bg-white","text-purple","t-border-transparent","t-btn","t-btn-outline","t-px-3","t-text-[16px]","font-hanken","t-border-gray-400","t-bg-transparent","t-font-light","t-rounded-xl","t-transition","hover:border-purple","hover:text-purple"],[1,"t-btn","t-btn-outline","t-px-3","t-text-[16px]","font-hanken","t-border-gray-400","t-bg-transparent","t-font-light","t-rounded-xl","t-transition","hover:border-purple","hover:text-purple",3,"click"],["class","t-px-12 t-py-4 t-grid t-grid-cols-3",4,"ngIf"],["class","t-px-8 sm:t-px-12",4,"ngIf"],["class","dashboard-container t-px-12",4,"ngIf"],[1,"t-btn","btn-purple","font-cofo-mono","t-text-[16px]","t-mr-2","t-relative","t-top-6","sm:t-top-0",3,"click","disabled"],[1,"t-px-12","t-py-4","t-grid","t-grid-cols-3"],[1,"t-tabs","t-tabs-bordered"],[1,"t-tab","t-text-[14px]","font-hanken","t-h-[40px]",3,"click","ngClass"],[1,"t-flex","t-gap-x-4","t-justify-end"],["class","t-group",3,"click",4,"ngIf"],["type","button","id","dash-rearrange-exit",1,"t-btn","btn-purple","font-cofo-mono","t-h-[35px]","t-text-[15px]",3,"click","mousedown"],["type","button","id","dash-rearrange-cancel",1,"t-btn","btn-purple","font-cofo-mono","t-h-[35px]","t-text-[15px]",3,"click","mousedown"],["type","button","id","dash-compact-up",1,"t-btn","btn-purple-outline","font-cofo-mono","t-h-[35px]","t-text-[15px]",3,"click","mousedown"],[1,"t-group",3,"click"],["version","1.1","xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","-17 0 48 48"],["d","M0 0 C0.99 0.33 1.98 0.66 3 1 C1.84008573 4.0157771 0.18762631 5.92363645 -2.0859375 8.1484375 C-2.63040527 8.68388184 -3.17487305 9.21932617 -3.73583984 9.77099609 C-4.1530127 10.17656738 -4.57018555 10.58213867 -5 11 C-4.04746338 11.01401855 -4.04746338 11.01401855 -3.07568359 11.02832031 C-0.174692 11.08228733 2.72473244 11.16588127 5.625 11.25 C6.62402344 11.26417969 7.62304688 11.27835938 8.65234375 11.29296875 C14.72020415 11.49389128 18.37381718 11.96691754 23 16 C26.39090366 19.9263095 27.6746341 22.94972447 27.3828125 28.046875 C26.48762602 32.61415298 23.74181853 35.31246087 20.4375 38.375 C15.60487561 40.65951335 11.25639338 40.33670847 6 40 C6 38.68 6 37.36 6 36 C6.67546875 35.95101562 7.3509375 35.90203125 8.046875 35.8515625 C8.93890625 35.77679688 9.8309375 35.70203125 10.75 35.625 C12.07257812 35.52058594 12.07257812 35.52058594 13.421875 35.4140625 C16.02090362 34.99664275 17.76438879 34.36731579 20 33 C22.30567313 29.77205762 22.32369432 26.88433181 22 23 C21.13639355 20.40918066 20.55708656 19.34598494 18.23339844 17.90283203 C15.65740634 16.86150947 13.78749673 16.77088419 11.015625 16.8046875 C9.61376953 16.81435547 9.61376953 16.81435547 8.18359375 16.82421875 C6.73146484 16.84935547 6.73146484 16.84935547 5.25 16.875 C4.26644531 16.88402344 3.28289063 16.89304687 2.26953125 16.90234375 C-0.15375026 16.92587075 -2.57690631 16.96174063 -5 17 C-2.36 19.64 0.28 22.28 3 25 C2.67 25.99 2.34 26.98 2 28 C-2.07376031 26.38989473 -4.76507069 23.46177729 -7.75 20.375 C-8.25660156 19.859375 -8.76320313 19.34375 -9.28515625 18.8125 C-10.52803902 17.54616661 -11.76465276 16.2736856 -13 15 C-11.38989473 10.92623969 -8.46177729 8.23492931 -5.375 5.25 C-4.859375 4.74339844 -4.34375 4.23679687 -3.8125 3.71484375 C-2.54616661 2.47196098 -1.2736856 1.23534724 0 0 Z ","fill","#868D95",1,"group-hover:t-fill-[#FFFFFF]","t-transition"],[1,"t-px-8","sm:t-px-12"],[1,"t-bg-[#ededed]","t-px-0",3,"options"],["class","t-rounded-xl",3,"item","id","ngClass",4,"ngFor","ngForOf"],[1,"t-rou
5nded-xl",3,"item","id","ngClass"],[3,"deleteIndex","index","item","accountHash","isAdmin","isRearrange","isResizable"],[1,"dashboard-container","t-px-12"],[1,"loading-cards"],[1,"loading-cards--short-wrapper"],[1,"loading-cards--short"],[1,"loading-cards--tall"]],template:function(t,i){t&1&&(r(0,"div")(1,"div",0),C(2,"div",1),r(3,"div",2)(4,"div",3)(5,"div",4),C(6,"img",5),p(7," Pendings data is now available! "),a(),r(8,"a",6),u("click",function(){return i.onPendingInfo()}),p(9," Learn more "),a()()(),r(10,"div",7),b(11,Fs,2,1,"button",8),a()(),r(12,"div",9)(13,"div",1)(14,"h4",10),p(15,"Advanced Analytics"),a()(),r(16,"ul",11)(17,"li",12),p(18," Dashboard "),a(),r(19,"li",13),u("click",function(){return i.onNewChart()}),p(20," New Analysis "),a(),r(21,"li",13),u("click",function(){return i.onViewWidgetList()}),p(22," Recent Analysis "),a()(),r(23,"li",14)(24,"button",15),u("click",function(){return i.onRearrange()}),C(25,"i",16),p(26," Rearrange Tiles "),a()()(),r(27,"div",17)(28,"ul",18)(29,"li",19),p(30," Dashboard "),a(),r(31,"li",20),u("click",function(){return i.onNewChart()}),p(32," New Analysis "),a(),r(33,"li",20),u("click",function(){return i.onViewWidgetList()}),p(34," Recent Analysis "),a()()()(),b(35,Ds,17,7,"div",21)(36,Es,3,2,"div",22)(37,zs,6,0,"div",23)),t&2&&(h(11),c("ngIf",i.getShowAddAddons),h(13),c("disabled",i.isRearrange),h(11),c("ngIf",i.isRearrange),h(),c("ngIf",!i.isLoading),h(),c("ngIf",i.isLoading))},dependencies:[ce,he,$,qt,xn,Fn],styles:[".t-tab-active[_ngcontent-%COMP%]{border-color:#9747ff!important}gridster[_ngcontent-%COMP%]{height:100vh;width:inherit!important}.dash-add-dropdown[_ngcontent-%COMP%]{top:31px}.dashboard-container[_ngcontent-%COMP%]{padding-left:0;padding-right:0}gridster[_ngcontent-%COMP%] .gridster-column[_ngcontent-%COMP%], gridster[_ngcontent-%COMP%] .gridster-row[_ngcontent-%COMP%], gridster-item[_ngcontent-%COMP%], gridster-item.gridster-item-resizing[_ngcontent-%COMP%], gridster-item.gridster-item-moving[_ngcontent-%COMP%]{transition:unset!important}gridster.mobile[_ngcontent-%COMP%] > .altos-item-action[_ngcontent-%COMP%]{position:absolute!important;right:2px}.dashboard-label-frame[_ngcontent-%COMP%]{position:relative;padding-top:1em}.altos-source-text[_ngcontent-%COMP%]{position:absolute;float:right;font-family:UIExplanatoryText;color:gray;bottom:0;right:0}.altos-exit-rearrange[_ngcontent-%COMP%], .altos-compact-up[_ngcontent-%COMP%]{margin-top:30px}.altos-compact-up[_ngcontent-%COMP%]{margin-left:20px}.altos-new-header[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--altos-red);text-decoration:underline}.altos-new-header[_ngcontent-%COMP%]{font-size:18px}.loading[_ngcontent-%COMP%]{display:flex;flex-flow:column;justify-content:center;align-items:center;gap:12px;height:200px}.loading-cards[_ngcontent-%COMP%]{display:grid;grid-template-columns:66.7% 33.3%}.loading-cards[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;border:solid 1px #b6b6b6;animation:_ngcontent-%COMP%_backgroundColorChange 3s infinite;display:flex;align-items:center;justify-content:center}.loading-cards[_ngcontent-%COMP%] .loading-cards--short[_ngcontent-%COMP%]{aspect-ratio:2/1;border-right-style:none!important}.loading-cards[_ngcontent-%COMP%] .loading-cards--short[_ngcontent-%COMP%]:first-child{aspect-ratio:2/1;border-bottom-style:none!important}@keyframes _ngcontent-%COMP%_backgroundColorChange{0%{background-color:#fff}50%{background-color:#f5f5f5}to{background-color:#fff}}"]})}}return s})();var Ft=class{constructor(){this.categories=[{val:"city",name:"City"},{val:"zip",name:"Zip"},{val:"county",name:"County"},{val:"state",name:"State"},{val:"metro",name:"Metro"}],this.analysisTypes=[{val:"comparison",name:"Comparison"},{val:"rank",name:"Rank"},{val:"yoy",name:"Year over Year"}],this.chartTypes=[{val:"line",name:"Line"},{val:"sparkline",name:"Spark Line"},{val:"mai",name:"MAI"},{val:"profile_table",name:"Profile Table"},{val:"area",name:"Area"},{val:"bar_and_line",name:"Bar and Line"}],this.stats=[{category:"basic",isInternal:!1,val:"age_mean",name:"Age, Avg"},{category:"basic",isInternal:!1,val:"age_median",name:"Age, Median"},{category:"basic",isInternal:!1,val:"baths_mean",name:"Baths, Avg"},{category:"basic",isInternal:!1,val:"baths_median",name:"Baths, Median"},{category:"basic",isInternal:!1,val:"beds_mean",name:"Beds, Avg"},{category:"basic",isInternal:!1,val:"beds_median",name:"Beds, Median"},{category:"basic",isInternal:!1,val:"dom_mean",name:"Days on Market (DOM), Avg"},{category:"basic",isInternal:!1,val:"dom_median",name:"Days on Market (DOM), Median"},{category:"basic",isInternal:!1,val:"count",name:"Inventory"},{category:"basic",isInternal:!1,val:"price_mean",name:"Price, Avg"},{category:"basic",isInternal:!1,val:"price_median",name:"Price, Median"},{category:"basic",isInternal:!1,val:"mai",name:"Market Action Index"},{category:"basic",isInternal:!1,val:"per_sqft_mean",name:"SqFt, Price, Avg"},{category:"basic",isInternal:!1,val:"per_sqft_median",name:"Price/SqFt"},{category:"basic",isInternal:!1,val:"sqft_mean",name:"SqFt, Avg"},{category:"basic",isInternal:!1,val:"sqft_median",name:"SqFt, Median"},{category:"basic",isInternal:!1,val:"lot_mean",name:"Lot Size, Avg"},{category:"basic",isInternal:!1,val:"lot_median",name:"Lot Size, Median"},{category:"advanced",isInternal:!1,val:"price_max",name:"Price, Max"}
5,{category:"advanced",isInternal:!1,val:"price_min",name:"Price, Min"},{category:"advanced",isInternal:!1,val:"relisted_percent",name:"Relisted, %"},{category:"advanced",isInternal:!1,val:"new_price_median",name:"New Listings, Price, Median"},{category:"advanced",isInternal:!1,val:"new_count",name:"New Listings Count"},{category:"advanced",isInternal:!1,val:"price_decreased_percent",name:"Price, Decrease %"},{category:"advanced",isInternal:!1,val:"price_increased_percent",name:"Price, Increase %"},{category:"advanced",isInternal:!1,val:"absorbed_count",name:"Absorbed Count"},{category:"advanced",isInternal:!1,val:"absorbed_price_median",name:"Absorbed, Price, Median"},{category:"pending",isInternal:!1,val:"pending_count",name:"Pending Count"},{category:"pending",isInternal:!1,val:"pending_new_count",name:"Pending New Count"},{category:"pending",isInternal:!1,val:"pending_new_price_median",name:"Pending New Price Median"},{category:"pending",isInternal:!1,val:"pending_age_mean",name:"Pending, Age, Avg"},{category:"pending",isInternal:!1,val:"pending_baths_mean",name:"Pending, Baths, Avg"},{category:"pending",isInternal:!1,val:"pending_beds_mean",name:"Pending, Beds, Avg"},{category:"pending",isInternal:!1,val:"pending_lot_mean",name:"Pending, Lot, Avg"},{category:"pending",isInternal:!1,val:"pending_price_max",name:"Pending, Price, Max"},{category:"pending",isInternal:!1,val:"pending_price_median",name:"Pending, Price, Median"},{category:"pending",isInternal:!1,val:"pending_price_min",name:"Pending, Price, Min"},{category:"pending",isInternal:!1,val:"pending_per_sqft_median",name:"Pending, Price/SqFt, Median"},{category:"pending",isInternal:!1,val:"pending_sqft_mean",name:"Pending, SqFt, Avg"},{category:"pending",isInternal:!1,val:"pending_dom_mean",name:"Pending, Days on Market (DOM), Avg"},{category:"pending",isInternal:!1,val:"pending_dom_median",name:"Pending, Days on Market (DOM), Median"},{category:"pending",isInternal:!1,val:"pending_days_in_contract_mean",name:"Pending, Days in Contract, Avg"},{category:"pending",isInternal:!1,val:"pending_days_in_contract_median",name:"Pending, Days in Contract, Median"},{category:"other",isInternal:!0,val:"new_age_mean",name:"New Listings, Age, Avg"},{category:"other",isInternal:!0,val:"new_baths_mean",name:"New Listings, Baths, Avg"},{category:"other",isInternal:!0,val:"new_beds_mean",name:"New Listings, Beds, Avg"},{category:"other",isInternal:!0,val:"new_lot_mean",name:"New Listings, Lot, Avg"},{category:"other",isInternal:!0,val:"new_price_max",name:"New Listings, Price, Max"},{category:"other",isInternal:!0,val:"new_price_min",name:"New Listings, Price, Min"},{category:"other",isInternal:!0,val:"new_sqft_mean",name:"New Listings, SqFt, Avg"},{category:"other",isInternal:!0,val:"new_sqft_median",name:"New Listings, SqFt, Median"},{category:"other",isInternal:!0,val:"absorbed_age_median",name:"Absorbed, Age, Median"},{category:"other",isInternal:!0,val:"absorbed_baths_mean",name:"Absorbed, Baths, Avg"},{category:"other",isInternal:!0,val:"absorbed_beds_mean",name:"Absorbed, Beds, Avg"},{category:"other",isInternal:!0,val:"absorbed_dom_mean",name:"Absorbed, Days on Market (DOM), Avg"},{category:"other",isInternal:!0,val:"absorbed_dom_median",name:"Absorbed, Days on Market (DOM), Median"},{category:"other",isInternal:!0,val:"absorbed_lot_mean",name:"Absorbed, Lot, Avg"},{category:"other",isInternal:!0,val:"absorbed_price_max",name:"Absorbed, Price, Max"},{category:"other",isInternal:!0,val:"absorbed_price_min",name:"Absorbed, Price, Min"},{category:"other",isInternal:!0,val:"absorbed_sqft_mean",name:"Absorbed, SqFt, Avg"},{category:"other",isInternal:!0,val:"absorbed_sqft_median",name:"Absorbed, SqFt, Median"},{category:"other",isInternal:!0,val:"price_std",name:"Price, Std Dev"},{category:"other",isInternal:!0,val:"rental_count",name:"Rental Count"},{category:"other",isInternal:!0,val:"rental_beds_mean",name:"Rental, Beds, Avg"},{category:"other",isInternal:!0,val:"rental_price_mean",name:"Rental, Price, Avg"},{category:"other",isInternal:!0,val:"rental_price_median",name:"Rental, Price, Median"},{category:"other",isInternal:!0,val:"rental_price_per_bedroom",name:"Rental, Price/Bed"},{category:"other",isInternal:!0,val:"rental_price_per_sqft",name:"Rental, Price/SqFt"},{category:"other",isInternal:!0,val:"rental_sqft_mean",name:"Rental, SqFt, Avg"},{category:"other",isInternal:!0,val:"rental_per_sqft_mean",name:"Rental, SqFt, Avg"}],this.quartiles=[{val:"4",name:"Top"},{val:"3",name:"Upper"},{val:"2",name:"Lower"},{val:"1",name:"Bottom"},{val:"0",name:"Full Market"}],this.resTypes=[{val:"100",name:"Single Family Home"},{val:"200",name:"Condo/Townhome"},{val:"400",name:"Co-Op"}],this.windowSizes=[{val:"7D",name:"7-Day"},{val:"90D",name:"90-Day"}],this.chartSizes=[{val:"landscape",name:"Landscape [520x240]"},{val:"intermediate",name:"Intermediate [360x240]"},{val:"fb",name:"Facebook [600x315]"},{val:"medium",name:"Medium [480x320]"},{val:"large",name:"Large [600x400]"}
5],this.previewSizes={blog:[180,120],small:[240,160],tower:[180,200],smLandscape:[240,160],landscape:[520,240],intermediate:[360,240],fb:[600,315],medium:[480,320],large:[600,400]}}};var Ut=s=>({"t-bg-white text-purple hover:t-bg-white t-border-white":s});function Rs(s,n){if(s&1){let e=y();r(0,"button",18),u("click",function(){m(e);let i=d();return g(i.onPendingPurchase())}),p(1," Get Add-On "),a()}if(s&2){let e=d();c("disabled",e.pendingAddons.length==0)}}function $s(s,n){if(s&1){let e=y();r(0,"li",19),u("click",function(){m(e);let i=d();return g(i.onNewChart())}),p(1," New Analysis "),a()}if(s&2){let e=d();c("ngClass",R(1,Ut,e.activeTab==="create"))}}function Ls(s,n){if(s&1){let e=y();r(0,"li",19),u("click",function(){m(e);let i=d();return g(i.onViewWidgetList())}),p(1," Recent Analysis "),a()}if(s&2){let e=d();c("ngClass",R(1,Ut,e.activeTab==="widgets"))}}function Ws(s,n){if(s&1){let e=y();r(0,"li",20),u("click",function(){m(e);let i=d();return g(i.onNewChart())}),p(1," New Analysis "),a()}if(s&2){let e=d();c("ngClass",R(1,Ut,e.activeTab==="create"))}}function Vs(s,n){if(s&1){let e=y();r(0,"li",20),u("click",function(){m(e);let i=d();return g(i.onViewWidgetList())}),p(1," Recent Analysis "),a()}if(s&2){let e=d();c("ngClass",R(1,Ut,e.activeTab==="widgets"))}}var Dt=(()=>{class s{constructor(e,t,i,o,l,_,w,x){this.platformId=e,this.dataService=t,this.adminApiService=i,this.router=o,this.modalService=l,this.mixpanelService=_,this.toastService=w,this.authService=x,this.destroy$=new P,this.pendingAddons=new Array,this.pendingsEnabled=!1,this.isLoading=!1}ngOnInit(){this.setActiveTab(void 0),j(this.dataService.currentPortfolioUsage,this.dataService.currentActiveAccount).pipe(v(this.destroy$)).subscribe(e=>{let t=e[0],i=e[1];t.accounts[i.accountIndex]&&(this.isAdmin=t.accounts[i.accountIndex].isAccountAdmin)}),this.dataService.currentCurrentUser.pipe(v(this.destroy$)).subscribe(e=>{this.currentUser=e}),j([this.dataService.currentPortfolioUsage,this.dataService.currentActiveAccount]).pipe(v(this.destroy$)).subscribe(e=>{this.portfolioUsage=e[0],this.activeAccount=e[1],this.pendingsEnabled=this.portfolioUsage.accounts[this.activeAccount.accountIndex].maximum.dashboardPendings}),this.getPendingAddons()}ngOnDestroy(){this.destroy$.next(),this.destroy$.unsubscribe()}onNewChart(){this.router.navigate(["/admin/dashboard/widget-create"])}onDashboard(){this.router.navigate(["/admin/dashboard"])}onViewWidgetList(){this.router.navigate(["/admin/dashboard/widgets"])}setActiveTab(e){let t=e;e||K(this.platformId)&&(t=window.location.href),K(this.platformId)&&(/create/.test(t)?this.activeTab="create":/widgets/.test(t)&&(this.activeTab="widgets"))}onPendingPurchase(){this.modalService.show(Ne,{class:"altos-dashboard-pending-modal-wrapper"}).content.onClose.pipe(v(this.destroy$)).subscribe(t=>{t==!0&&this.onPlanUpgradeAreYouSure(this.pendingAddons[0])}),this.mixpanelService.onTrackAdmin("Analytics: Pending Purchase Modal Open",{isInternal:this.currentUser.isInternal})}getPendingAddons(){let e=this.portfolioUsage.accounts[this.activeAccount.accountIndex].subscriptionItems.filter(t=>t.price.isBase==!0)[0];this.adminApiService.getDashboardPendingAddons(e.price.interval,e.price.intervalCount).pipe(v(this.destroy$)).subscribe(t=>{this.pendingAddons=t.addOns})}onPlanUpgradeAreYouSure(e){let t=this.modalService.show(pe),i=e.unitAmount/100;t.content.setConfirmationModal("Confirm Pendings Add-On","Your account will be charged an additional "+be(i,"en_US","$")+" per "+this.getDuration(e).toLowerCase()+". Your first month will be prorated for the current billing cycle."),t.content.onClose.subscribe(o=>{o===!0&&(this.onUpdatingAccountModal(),this.onUpgrade(e))}),this.mixpanelService.onTrackAdmin("Analytics: Pending Are You Sure Modal Open",{isInternal:this.currentUser.isInternal})}onPendingInfo(){let e=this.modalService.show(Be,{class:"altos-dashboard-pending-modal-wrapper"});e.content.setModalData(this.pendingsEnabled),e.content.onClose.pipe(v(this.destroy$)).subscribe(t=>{t==!0&&this.onPendingPurchase()}),this.mixpanelService.onTrackAdmin("Analytics: Pending Info Modal Open",{isInternal:this.currentUser.isInternal})}onUpdatingAccountModal(){this.updatingModalRef=this.modalService.show(He,{class:"modal-sm"})}get getShowAddAddons(){return!this.isLoading&&!(this.currentUser&&this.currentUser.isInternal)&&!this.pendingsEnabled}onUpgrade(e){let t={priceId:e.id,quantity:1};this.adminApiService.postAccountUpsell(t).pipe(v(this.destroy$)).subscribe(()=>{this.toastService.showSuccessToast("You have successfully purchased an upgrade."),this.authService.getPortfolioUsage(),this.updatingModalRef.hide()},i=>{console.error(i),this.updatingModalRef.hide(),this.toastService.showErrorToast("There was and error purchasing the upgrade. Please, contact support.")}),this.mixpanelService.onTrackAdmin("Analytics: Pending Upgrade",{isInternal:this.currentUser.isInternal})}getDuration(e){let t="";return e.interval==="month"&&e.intervalCount===3?t+="Quarter":(e.intervalCount===1||e.intervalCount!==1&&(t="every "+e.intervalCount+" "),e.interval==="day"?t+="day":e.interval==="week"?t+="week":e.interval==="month"?t+="month":e.interval==="year"&&(t+="year")),t}static{this.\u0275fac=function(t){return new(t||s)(f(de),f(X),f(W),f(J),f(G),f(ee),f(re),f(Z))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-dashboard-nav"]],decls:27,vars:6,consts:[[1,"t-navbar","t-py-7","sm:t-py-4","bg-lavender"],[1,"t-navbar-start"],[1,"t-navbar-center"],[1,"font-cofo-mono","t-text-[16
5px]","text-olive","t-flex","t-gap-x-4","t-items-center","t-flex-col","sm:t-flex-row"],[1,"t-flex","t-gap-x-4"],["src","assets/images/icons/warning.svg",1,"t-size-8"],["href","javascript: void(0);",1,"text-olive","font-cofo-mono","t-underline",3,"click"],[1,"t-navbar-end"],["class","t-btn btn-purple font-cofo-mono t-text-[16px] t-mr-2 t-relative t-top-6 sm:t-top-0",3,"disabled","click",4,"ngIf"],[1,"t-navbar","t-px-8","sm:t-px-12","t-mt-4","md:t-mt-10"],[1,"t-m-0","font-scale","t-text-[27px]","t-whitespace-nowrap","md:t-whitespace-normal"],[1,"t-navbar-center","t-hidden","sm:t-inline-flex","t-gap-x-4","t-m-0"],[1,"t-btn","t-btn-outline","t-px-8","t-text-[16px]","font-hanken","t-border-gray-400","t-font-light","t-rounded-xl","t-transition","hover:border-purple","hover:t-bg-transparent","hover:text-purple",3,"click"],["class","t-btn t-btn-outline t-px-8 t-text-[16px] font-hanken t-border-gray-400 t-font-light t-rounded-xl t-transition hover:border-purple hover:t-bg-transparent hover:text-purple",3,"ngClass","click",4,"ngIf"],[1,"t-inline-flex","sm:t-hidden","t-justify-center","t-w-full"],[1,"t-flex","t-gap-x-4","t-m-0","t-mb-2","sm:t-mb-0"],[1,"t-btn","t-btn-outline","t-px-3","t-text-[16px]","font-hanken","t-border-gray-400","t-font-light","t-rounded-xl","t-transition","hover:border-purple","hover:t-bg-transparent","hover:text-purple",3,"click"],["class","t-btn t-btn-outline t-px-3 t-text-[16px] font-hanken t-border-gray-400 t-font-light t-rounded-xl t-transition hover:border-purple hover:t-bg-transparent hover:text-purple",3,"ngClass","click",4,"ngIf"],[1,"t-btn","btn-purple","font-cofo-mono","t-text-[16px]","t-mr-2","t-relative","t-top-6","sm:t-top-0",3,"click","disabled"],[1,"t-btn","t-btn-outline","t-px-8","t-text-[16px]","font-hanken","t-border-gray-400","t-font-light","t-rounded-xl","t-transition","hover:border-purple","hover:t-bg-transparent","hover:text-purple",3,"click","ngClass"],[1,"t-btn","t-btn-outline","t-px-3","t-text-[16px]","font-hanken","t-border-gray-400","t-font-light","t-rounded-xl","t-transition","hover:border-purple","hover:t-bg-transparent","hover:text-purple",3,"click","ngClass"]],template:function(t,i){t&1&&(r(0,"div",0),C(1,"div",1),r(2,"div",2)(3,"div",3)(4,"div",4),C(5,"img",5),p(6," Pendings data is now available! "),a(),r(7,"a",6),u("click",function(){return i.onPendingInfo()}),p(8," Learn more "),a()()(),r(9,"div",7),b(10,Rs,2,1,"button",8),a()(),r(11,"ul",9)(12,"li",1)(13,"h4",10),p(14),a()(),r(15,"ul",11)(16,"li",12),u("click",function(){return i.onDashboard()}),p(17," Dashboard "),a(),b(18,$s,2,3,"li",13)(19,Ls,2,3,"li",13),a(),C(20,"li",7),a(),r(21,"div",14)(22,"ul",15)(23,"li",16),u("click",function(){return i.onDashboard()}),p(24," Dashboard "),a(),b(25,Ws,2,3,"li",17)(26,Vs,2,3,"li",17),a()()),t&2&&(h(10),c("ngIf",i.getShowAddAddons),h(4),V(" ",i.activeTab==="widgets"?"Recent Analysis":"New Analysis"," "),h(4),c("ngIf",i.isAdmin),h(),c("ngIf",i.isAdmin),h(6),c("ngIf",i.isAdmin),h(),c("ngIf",i.isAdmin))},dependencies:[ce,$],encapsulation:2})}}return s})();var Ns=["geoSelect"],Hs=["statSelect"],Ys=["rankStateFilter"],js=["rankCountyFilter"],Gs=["preview"],ti=s=>({active:s}),Xs=s=>({internal:s}),ct=s=>({"t-tab-active":s});function Qs(s,n){if(s&1){let e=y();r(0,"ng-select",39),U("ngModelChange",function(i){m(e);let o=d();return F(o.widgetSelect,i)||(o.widgetSelect=i),g(i)}),u("ngModelChange",function(){m(e);let i=d();return g(i.onWidgetSelect())}),r(1,"ng-option",40),p(2,"Line Graph"),a(),r(3,"ng-option",41),p(4,"Year over Year"),a(),r(5,"ng-option",42),p(6,"Sparkline"),a(),r(7,"ng-option",43),p(8,"Rank"),a(),r(9,"ng-option",44),p(10,"Market Profile"),a(),r(11,"ng-option",45),p(12,"MAI"),a()()}if(s&2){let e=d();c("searchable",!1)("clearable",!1),T("ngModel",e.widgetSelect)}}function qs(s,n){if(s&1&&(D(0),r(1,"ng-option",49)(2,"div",50)(3,"div",51),p(4),a(),r(5,"div",52),p(6),a()()(),O()),s&2){let e=n.$implicit;h(),c("value",e),h(3),ge(e.displayName),h(2),V(" ",e.category," ")}}function Ks(s,n){if(s&1){let e=y();r(0,"ng-select",48,1),U("ngModelChange",function(i){m(e);let o=d(2);return F(o.geoSelectedReport,i)||(o.geoSelectedReport=i),g(i)}),u("change",function(i){m(e);let o=d(2);return g(o.onReportChanged(i))})("close",function(){m(e);let i=d(2);return g(i.onGeoSelectClose())})("search",function(i){m(e);let o=d(2);return g(o.onSearchReports(i))})("scroll",function(i){m(e);let o=d(2);return g(o.onScroll(i))})("scrollToEnd",function(){m(e);let i=d(2);return g(i.onScrollToEnd())}),b(2,qs,7,3,"ng-container",37),a()}if(s&2){let e=d(2);c("virtualScroll",!0)("loading",e.reportsLoading)("placeholder",e.getGeoDisabled()?"Disabled (only one with multiple data)":"Type for search"),T("ngModel",e.geoSelectedReport),c("clearable",!0)("disabled",e.getGeoDisabled()),h(2),c("ngForOf",e.geoSelectReports)}}function Js(s,n){if(s&1){let e=y();r(0,"div")(1,"button",53),u("click",function(){let i=m(e).index,o=d(2);return g(o.onRemoveReport(i))})("mousedown",function(i){return m(e),g(i.preventDefault())}),C(2,"div"),r(3,"div"),p(4),a(),r(5,"div"),p(6,"x"),a()()()}if(s&2){let e=n.$implicit;h(4),ge(e.displayName)}}function Zs(s,n){if(s&1&&(r(0,"div")(1,"h4",10),p(2," Location "),a(),D(3),b(4,Ks,3,7,"ng-select",46),O(),r(5,"div",47),b(6,Js,7,1,"div",37),a()()),s&2){let e=d();h(4),c("ngIf",e.isBrowser()),h(2),c("ngForOf",e.geoSelectedReports)}}function eo(s,n){if(s&1){let e=y();r(0,"button",63),u("click",function(){m(e);let i=d(3);
5return g(i.onDataFilterSelect("pending"))})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(1," Pending "),a()}if(s&2){let e=d(3);c("ngClass",R(1,ti,e.dataFilter=="pending"))}}function to(s,n){if(s&1){let e=y();r(0,"button",64),u("click",function(){m(e);let i=d(3);return g(i.onPendingPurchase())})("mousedown",function(i){return m(e),g(i.preventDefault())}),C(1,"i",65),p(2," Pending "),a()}}function io(s,n){s&1&&C(0,"ng-option",69)}function no(s,n){if(s&1&&(D(0),r(1,"ng-option",67),p(2),a(),b(3,io,1,0,"ng-option",68),O()),s&2){let e=n.$implicit;h(),c("value",e.val)("ngClass",R(4,Xs,e.isInternal)),h(),V("",(e.isInternal?"** ":"")+e.name," "),h(),c("ngIf",e.val==="per_sqft_mean"||e.val==="lot_mean"||e.val==="new_price_median"||e.val==="per_lot_median"||e.val==="new_sqft_median"||e.val==="pending_sqft_median"||e.val==="rental_per_sqft_median")}}function so(s,n){if(s&1){let e=y();r(0,"ng-select",66,2),U("ngModelChange",function(i){m(e);let o=d(3);return F(o.statSelected,i)||(o.statSelected=i),g(i)}),u("change",function(i){m(e);let o=d(3);return g(o.onStatMultiClick(i))})("close",function(){m(e);let i=d(3);return g(i.onStatSelectClose())}),b(2,no,4,6,"ng-container",37),a()}if(s&2){let e=d(3);c("virtualScroll",!0)("placeholder",e.getStatDisabled()?"Disabled (only one with multiple geographies)":"Type for search"),T("ngModel",e.statSelected),c("clearable",!0)("disabled",e.getStatDisabled()),h(2),c("ngForOf",e.availableStats)}}function oo(s,n){if(s&1){let e=y();D(0,70),r(1,"div")(2,"button",71),u("click",function(){let i=m(e).index,o=d(3);return g(o.onRemoveStat(i))})("mousedown",function(i){return m(e),g(i.preventDefault())}),C(3,"i",72),p(4),a()(),O()}if(s&2){let e=n.$implicit,t=d(3);h(4),V(" ",t.getStatName(e)," ")}}function ro(s,n){if(s&1){let e=y();D(0),r(1,"h4",8),p(2,"Advanced Data"),a(),r(3,"div",54)(4,"button",55),u("click",function(){m(e);let i=d(2);return g(i.onDataFilterSelect("basic"))})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(5," Basic "),a(),r(6,"button",56),u("click",function(){m(e);let i=d(2);return g(i.onDataFilterSelect("advanced"))})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(7," Advanced "),a(),b(8,eo,2,3,"button",57)(9,to,3,0,"button",58),a(),D(10,59),b(11,so,3,6,"ng-select",60),O(),r(12,"div",61),b(13,oo,5,1,"ng-container",62),a(),O()}if(s&2){let e=d(2);h(4),c("ngClass",R(6,ti,e.dataFilter=="basic")),h(2),c("ngClass",R(8,ti,e.dataFilter=="advanced")),h(2),c("ngIf",e.user.isInternal||e.pendingsEnabled),h(),c("ngIf",!e.user.isInternal&&!e.pendingsEnabled),h(2),c("ngIf",e.isBrowser()),h(2),c("ngForOf",e.stats)}}function ao(s,n){if(s&1){let e=y();r(0,"button",81),u("click",function(){m(e);let i=d(3);return g(i.onDataFilterSelect("pending"))})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(1," Pending "),a()}if(s&2){let e=d(3);c("ngClass",R(1,ct,e.dataFilter=="pending"))}}function lo(s,n){if(s&1){let e=y();r(0,"button",82),u("click",function(){m(e);let i=d(3);return g(i.onPendingPurchase())})("mousedown",function(i){return m(e),g(i.preventDefault())}),C(1,"i",65),p(2," Pending "),a()}}function co(s,n){s&1&&(r(0,"span",86),p(1," New! "),a())}function ho(s,n){s&1&&C(0,"ng-option",69)}function po(s,n){s&1&&C(0,"ng-option",69)}function mo(s,n){if(s&1&&(D(0),r(1,"ng-option",84),p(2),b(3,co,2,0,"span",85),a(),b(4,ho,1,0,"ng-option",68)(5,po,1,0,"ng-option",68),O()),s&2){let e=d().$implicit;h(),c("value",e.val),h(),V("",(e.isInternal&&e.category!="pending"?"** ":"")+e.name," "),h(),c("ngIf",e.category=="pending"),h(),c("ngIf",e.val==="absorbed_price_median"),h(),c("ngIf",e.val==="absorbed_price_median")}}function go(s,n){if(s&1&&(D(0),b(1,mo,6,5,"ng-container",16),O()),s&2){let e=n.$implicit,t=d(4);h(),c("ngIf",e.category==t.dataFilter||e.category=="other"&&t.user.isInternal&&t.dataFilter=="advanced")}}function uo(s,n){if(s&1){let e=y();r(0,"ng-select",83),U("ngModelChange",function(i){m(e);let o=d(3);return F(o.statSelected,i)||(o.statSelected=i),g(i)}),u("change",function(i){m(e);let o=d(3);return g(o.onDualStatClick(i))})("close",function(){m(e);let i=d(3);return g(i.onStatSelectClose())}),b(1,go,2,1,"ng-container",37),a()}if(s&2){let e=d(3);c("virtualScroll",!0)("placeholder",e.getDualStatDisabled()?"Disabled (maximum selected)":"Type for search"),T("ngModel",e.statSelected),c("clearable",!0)("disabled",e.getDualStatDisabled()),h(),c("ngForOf",e.availableStats)}}function fo(s,n){if(s&1){let e=y();r(0,"div")(1,"button",53),u("click",function(){let i=m(e).index,o=d(3);return g(o.onRemoveStat(i))})("mousedown",function(i){return m(e),g(i.preventDefault())}),C(2,"div"),r(3,"div"),p(4),a(),r(5,"div"),p(6,"x"),a()()()}if(s&2){let e=n.$implicit,t=d(3);h(4),ge(t.getStatName(e))}}function _o(s,n){if(s&1){let e=y();D(0),r(1,"h4",73),p(2,"Advanced Data"),a(),r(3,"div",54)(4,"button",74),u("click",function(){m(e);let i=d(2);
5return g(i.onDataFilterSelect("basic"))})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(5," Basic "),a(),r(6,"button",75),u("click",function(){m(e);let i=d(2);return g(i.onDataFilterSelect("advanced"))})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(7," Advanced "),a(),b(8,ao,2,3,"button",76)(9,lo,3,0,"button",77),a(),D(10,78),b(11,uo,2,6,"ng-select",79),O(),r(12,"div",80),b(13,fo,7,1,"div",37),a(),O()}if(s&2){let e=d(2);h(4),c("ngClass",R(6,ct,e.dataFilter=="basic")),h(2),c("ngClass",R(8,ct,e.dataFilter=="advanced")),h(2),c("ngIf",e.user.isInternal||e.pendingsEnabled),h(),c("ngIf",!e.user.isInternal&&!e.pendingsEnabled),h(2),c("ngIf",e.isBrowser()),h(2),c("ngForOf",e.stats)}}function bo(s,n){if(s&1&&(r(0,"div",34),b(1,ro,14,10,"ng-container",16)(2,_o,14,10,"ng-container",16),a()),s&2){let e=d();h(),c("ngIf",e.select.chartType==="sparkline"&&e.select.analysisType!=="rank"),h(),c("ngIf",e.select.chartType!=="sparkline"||e.select.analysisType==="rank")}}function yo(s,n){if(s&1){let e=y();r(0,"ng-select",91),U("ngModelChange",function(i){m(e);let o=d(2);return F(o.dateRangeSelect,i)||(o.dateRangeSelect=i),g(i)}),u("ngModelChange",function(){m(e);let i=d(2);return g(i.onDateRangeSelect())}),r(1,"ng-option",92),p(2,"3 Month"),a(),r(3,"ng-option",93),p(4,"1 Year"),a(),r(5,"ng-option",94),p(6,"3 Year"),a(),r(7,"ng-option",95),p(8,"5 Year"),a(),r(9,"ng-option",96),p(10,"Custom"),a()()}if(s&2){let e=d(2);c("searchable",!1)("clearable",!1),T("ngModel",e.dateRangeSelect)}}function vo(s,n){if(s&1){let e=y();r(0,"div",97)(1,"div",98)(2,"input",99),U("ngModelChange",function(i){m(e);let o=d(2);return F(o.dateRange.start,i)||(o.dateRange.start=i),g(i)}),u("bsValueChange",function(i){m(e);let o=d(2);return g(o.startDateChanged(i))}),a()(),r(3,"div")(4,"input",100),U("ngModelChange",function(i){m(e);let o=d(2);return F(o.dateRange.end,i)||(o.dateRange.end=i),g(i)}),u("bsValueChange",function(i){m(e);let o=d(2);return g(o.endDateChanged(i))}),a()()()}if(s&2){let e=d(2);h(2),T("ngModel",e.dateRange.start),c("bsConfig",e.dateOptions)("maxDate",e.todaysDate),h(2),T("ngModel",e.dateRange.end),c("bsConfig",e.dateOptions)("maxDate",e.todaysDate)}}function Co(s,n){if(s&1&&(r(0,"div",87)(1,"h4",73),p(2," Date Range "),a(),r(3,"div",88),D(4,70),b(5,yo,11,3,"ng-select",89)(6,vo,5,6,"div",90),O(),a()()),s&2){let e=d();h(5),c("ngIf",e.isBrowser()),h(),c("ngIf",e.dateRangeSelect=="custom")}}function wo(s,n){if(s&1){let e=y();r(0,"div",87)(1,"h4",73),p(2," Date "),a(),r(3,"div")(4,"div",101)(5,"input",100),U("ngModelChange",function(i){m(e);let o=d();return F(o.dateRange.end,i)||(o.dateRange.end=i),g(i)}),u("bsValueChange",function(i){m(e);let o=d();return g(o.endDateChanged(i))}),a()()()()}if(s&2){let e=d();h(5),T("ngModel",e.dateRange.end),c("bsConfig",e.dateOptions)("maxDate",e.todaysDate)}}function xo(s,n){if(s&1){let e=y();r(0,"div",102)(1,"ui-switch",103),u("change",function(i){m(e);let o=d();return g(o.onNewTableToggle(i))}),a()()}if(s&2){let e=d();h(),c("checked",e.newTable)}}function So(s,n){s&1&&(r(0,"div",104),C(1,"div",105),a())}function Mo(s,n){if(s&1&&C(0,"html-dashboard-analysis",106),s&2){let e=d();c("index",-1)("isDashboardPreview",!0)("triggerCsv",e.triggerCsv)}}function Io(s,n){if(s&1&&(r(0,"ng-option",49),p(1),a()),s&2){let e=n.$implicit;c("value",e),h(),ge(e.displayName)}}function Po(s,n){if(s&1){let e=y();r(0,"ng-select",117,3),U("ngModelChange",function(i){m(e);let o=d(3);return F(o.rankStateSelected,i)||(o.rankStateSelected=i),g(i)}),u("change",function(i){m(e);let o=d(3);return g(o.onStateFilterChanged(i))})("close",function(){m(e);let i=d(3);return g(i.onStateFilterClose())})("search",function(i){m(e);let o=d(3);return g(o.onSearchStateFilter(i))}),D(2),b(3,Io,2,2,"ng-option",118),O(),a()}if(s&2){let e=d(3);c("virtualScroll",!0),T("ngModel",e.rankStateSelected),c("clearable",!0),h(3),c("ngForOf",e.states)}}function Ao(s,n){if(s&1){let e=y();r(0,"div")(1,"button",53),u("click",function(){let i=m(e).index,o=d(3);return g(o.onRemoveRankStateFilter(i))})("mousedown",function(i){return m(e),g(i.preventDefault())}),C(2,"div"),r(3,"div"),p(4),a(),r(5,"div"),p(6,"x"),a()()()}if(s&2){let e=n.$implicit;h(4),ge(e.displayName)}}function ko(s,n){if(s&1&&(r(0,"div",114),b(1,Po,4,4,"ng-select",115),r(2,"div",116),b(3,Ao,7,1,"div",37),a()()),s&2){let e=d(2);h(),c("ngIf",e.isBrowser()),h(2),c("ngForOf",e.rankSelectedStateFilters)}}function To(s,n){if(s&1&&(r(0,"ng-option",49),p(1),a()),s&2){let e=n.$implicit;c("value",e),h(),Oe("",e.name,", ",e.state," ")}}function Fo(s,n){if(s&1){let e=y();r(0,"ng-select",122,4),U("ngModelChange",function(i){m(e);let o=d(3);return F(o.rankCountySelected,i)||(o.rankCountySelected=i),g(i)}),u("change",function(i){m(e);let o=d(3);return g(o.onCountyFilterChanged(i))})("close",function(){m(e);let i=d(3);return g(i.onCountyFilterClose())})("search",function(i){m(e);let o=d(3);return g(o.onSearchCountyFilter(i))}),D(2),b(3,To,2,3,"ng-option",118),O(),a()}if(s&2){let e=d(3);c("virtualScroll",!0),T("ngModel",e.rankCountySelected),c("clearable",!0),h(3),c("ngForOf",e.counties)}}function Uo(s,n){if(s&1){let e=y();r(0,"div")(1,"button",53),u("click",function(){let i=m(e).index,o=d(3);return g(o.onRemoveRankCountyFilter(i))})("mousedown",function(i){return m(e),g(i.preventDefault())}),C(2,"div"),r(3,"div"),p(4),a(),r(5,"div"),p(6,"x"),a()()()}if(s&2){let e=n.$implicit;h(4),ge(e.name)}
5}function Do(s,n){if(s&1&&(r(0,"div",119),b(1,Fo,4,4,"ng-select",120),r(2,"div",121),D(3),b(4,Uo,7,1,"div",37),O(),a()()),s&2){let e=d(2);h(),c("ngIf",e.isBrowser()),h(3),c("ngForOf",e.rankSelectedCountyFilters)}}function Oo(s,n){if(s&1){let e=y();r(0,"div"),D(1),r(2,"h4",73),p(3," By County/State "),a(),r(4,"div",54)(5,"button",107),u("click",function(){m(e);let i=d();return g(i.onRankCountyStateSelect("county"))})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(6," County "),a(),r(7,"button",108),u("click",function(){m(e);let i=d();return g(i.onRankCountyStateSelect("state"))})("mousedown",function(i){return m(e),g(i.preventDefault())}),p(8," State "),a()(),b(9,ko,4,2,"div",109)(10,Do,5,2,"div",110),O(),r(11,"h4",35),p(12," Number of Locations "),a(),r(13,"div",111),D(14,112),r(15,"input",113),U("ngModelChange",function(i){m(e);let o=d();return F(o.select.nValue,i)||(o.select.nValue=i),g(i)}),u("change",function(){m(e);let i=d();return g(i.onNValueChange())}),a(),O(),a()()}if(s&2){let e=d();h(5),c("ngClass",R(5,ct,e.rankCountyStateFilter=="county")),h(2),c("ngClass",R(7,ct,e.rankCountyStateFilter=="state")),h(2),c("ngIf",e.rankCountyStateFilter=="state"),h(),c("ngIf",e.rankCountyStateFilter=="county"),h(5),T("ngModel",e.select.nValue)}}function Eo(s,n){if(s&1){let e=y();r(0,"div",123)(1,"h4",35),p(2," Rank Group "),a(),r(3,"div",124),D(4,70),r(5,"select",125),U("ngModelChange",function(i){m(e);let o=d();return F(o.select.isTop,i)||(o.select.isTop=i),g(i)}),u("ngModelChange",function(i){m(e);let o=d();return g(o.onRankChange(i))}),r(6,"option",126),p(7,"Highest"),a(),r(8,"option",126),p(9,"Lowest"),a()(),O(),a()()}if(s&2){let e=d();h(5),T("ngModel",e.select.isTop),h(),c("ngValue",!0),h(2),c("ngValue",!1)}}function zo(s,n){if(s&1){let e=y();r(0,"div")(1,"h4",35),p(2," Minimum Inventory "),a(),r(3,"div",127)(4,"input",128),U("ngModelChange",function(i){m(e);let o=d();return F(o.select.inventory,i)||(o.select.inventory=i),g(i)}),u("change",function(){m(e);let i=d();return g(i.onInventoryChange())}),a()()()}if(s&2){let e=d();h(4),T("ngModel",e.select.inventory)}}function Ro(s,n){if(s&1){let e=y();r(0,"div")(1,"input",131),u("change",function(){let i=m(e).$implicit,o=d(2);return g(o.onCategoriesChange(i.val))}),a(),r(2,"label",132),p(3),a()()}if(s&2){let e=n.$implicit,t=d(2);h(),L("name","category-",e.val,""),L("id","category-",e.val,""),c("checked",t.select.categories.has(e.val)),h(),L("for","category-",e.val,""),h(),V(" ",e.name," ")}}function $o(s,n){if(s&1){let e=y();r(0,"div")(1,"h4",35),p(2," Region Type "),a(),r(3,"div",36),b(4,Ro,4,8,"div",37),a(),r(5,"div")(6,"input",129),u("change",function(){m(e);let i=d();return g(i.onCategoriesChange(null))}),a(),r(7,"label",130),p(8," All "),a()()()}if(s&2){let e=d();h(4),c("ngForOf",e.presetOptions.categories),h(2),c("checked",e.select.categories.size===0)}}function Lo(s,n){if(s&1){let e=y();D(0),r(1,"ui-switch",135),u("valueChange",function(i){let o=m(e).$implicit,l=d(2);return g(l.onYearToggle(o,i))}),a(),O()}if(s&2){let e=n.$implicit,t=d(2);h(),L("id","year-",e,""),Wt("checkedLabel",e),Wt("uncheckedLabel",e),c("checked",t.select.years.has(e))("disabled",t.onYearDisabled(e))}}function Wo(s,n){if(s&1&&(r(0,"div",34)(1,"h4",133),p(2," Years "),a(),r(3,"span",134),p(4,"No selection defaults to last three years."),a(),r(5,"div"),b(6,Lo,2,6,"ng-container",37),a()()),s&2){let e=d();h(6),c("ngForOf",e.availableYears)}}function Vo(s,n){if(s&1){let e=y();r(0,"input",139),u("change",function(){m(e);let i=d().$implicit,o=d();return g(o.onQuartilesClick(i.val))}),a()}if(s&2){let e=d().$implicit,t=d();L("id","quartile-",e.val,""),c("checked",t.select.marketSegments.has(e.val))}}function Bo(s,n){if(s&1){let e=y();r(0,"input",140),u("change",function(){m(e);let i=d().$implicit,o=d();return g(o.onQuartilesRadioClick(i.val))}),a()}if(s&2){let e=d().$implicit,t=d();L("id","quartile-",e.val,""),c("value",e.val)("checked",t.select.marketSegments.has(e.val))}}function No(s,n){if(s&1&&(r(0,"div"),b(1,Vo,1,3,"input",136)(2,Bo,1,4,"input",137),r(3,"label",138),p(4),a()()),s&2){let e=n.$implicit,t=d();h(),c("ngIf",t.select.analysisType!=="yoy"&&t.select.chartType!=="sparkline"&&t.select.analysisType!=="mai"&&t.select.analysisType!=="profile_table"),h(),c("ngIf",t.select.analysisType==="yoy"||t.select.chartType==="sparkline"||t.select.analysisType==="mai"||t.select.analysisType==="profile_table"),h(),L("for","quartile-",e.val,""),h(),V(" ",e.name," ")}}function Ho(s,n){if(s&1){let e=y();r(0,"input",139),u("change",function(){m(e);let i=d().$implicit,o=d();return g(o.onResTypeClick(i.val))}),a()}if(s&2){let e=d().$implicit,t=d();L("id","resType-",e.val,""),c("checked",t.select.resTypes.has(e.val))}}function Yo(s,n){if(s&1){let e=y();r(0,"input",142),u("change",function(){m(e);let i=d().$implicit,o=d();return g(o.onResTypeRadioClick(i.val))}),a()}if(s&2){let e=d().$implicit,t=d();L("id","resType-",e.val,""),c("value",e.val)("checked",t.select.resTypes.has(e.val))}}function jo(s,n){if(s&1&&(r(0,"div"),b(1,Ho,1,3,"input",136)(2,Yo,1,4,"input",141),r(3,"label",132),p(4),a()()),s&2){let e=n.$implicit,t=d();h(),c("ngIf",t.select.analysisType!=="yoy"&&t.select.analysisType!=="mai"&&t.select.analysisType!=="profile_table"&&t.select.chartType!=="sparkline"),h(),c("ngIf",t.select.analysisType==="yoy"||t.select.analysisType==="mai"||t.select.analysisType==="profile_table"||t.select.chartType==="sparkline"),h(),L("for","resType-",e.val,""),h(),V(" ",e.name," ")}}function Go(s,n){if(s&1){let e=y();r(0,"input",145),u("click",function(i){return m(e),g(i.stopPropagation())})("change",function(){m(e);let i=d().$implicit,o=d(2);return g(o.onWindowSizeClick(i.val))}),a()}if(s&2){let e=d().$implicit,t=d(2);L("id","rolling-avg-",e.val,""),c("checked",t.select.windowSizes.has(e.val))}}function Xo(s,n){if(s&1){let e=y();r(0,"input",146),u("change",function(){m(e);let i=d().$implicit,o=d(2);return g(o.onWindowSizeRadioClick(i.val))}),a()}if(s&2){let e=d().$implicit,t=d(2);L("id","rolling-avg-",e.val,""),c("value",e.val)("checked",t.select.windowSizes.has(e.val))}}function Qo(s,n){if(s&1&&(r(0,"div"),b(1,Go,1,3,"input",143)(2,Xo,1,4,"input",144),r(3,"label",132),p(4),a()()),s&2){let e=n.$implicit,t=d(2);h(),c("ngIf",t.select.analysisType!=="yoy"&&t.select.chartType!=="sparkline"),h(),c("ngIf",t.select.analysisType==="yoy"||t.select.chartType==="sparkline"),h(),L("for","rolling-avg-",e.val,""),h(),V(" ",e.name," ")}}function qo(s,n){if(s&1&&(r(0,"div")(1,"h4",35),p(2," Window Size "),a(),r(3,"div",36),b(4,Qo,5,5,"div",37),a()()),s&2){let e=d();h(4),c("ngForOf",e.presetOptions.windowSizes)}}function Ko(s,n){if(s&1){let e=y();r(0,"div")(1,"input",147),u("change",function(){m(e);let i=d(2);return g(i.onEnYoyMarkersClick())}),a(),r(2,"label",148),p(3," Show Yearly Pips "),a()()}if(s&2){let e=d(2);h(),c("checked",e.select.enYoyMarkers)}}function Jo(s,n){if(s&1){let e=y();r(0,"div")(1,"input",149),u("change",function(){m(e);let i=d(2);return g(i.onIsGroupYAxisClick())}),a(),r(2,"label",150),p(3," Group Similar Y-Axis "),a()()}if(s&2){let e=d(2);h(),c("checked",e.select.isGroupYAxis)}}function Zo(s,n){if(s&1&&(r(0,"div")(1,"h3",35),p(2," Add Context "),a(),b(3,Ko,4,1,"div",16)(4,Jo,4,1,"div",16),a()),s&2){let e=d();h(3),c("ngIf",e.select.analysisType!=="yoy"),h(),c("ngIf",e.select.analysisType!=="yoy")}}var Ye=(()=>{class s{constructor(e,t,i,o,l,_,w,x,S,k,H,q,E,Y,z,ie,Ot){this.platformId=e,this.formBuilder=t,this.sanitizer=i,this.apiService=o,this.authService=l,this.adminApiService=_,this.dataService=w,this.toastService=x,this.utils=S,this.dashboardUtils=k,this.dashboardService=H,this.router=q,this.activatedRoute=E,this.dashboardDataService=Y,this.modalService=z,this.mixpanelService=ie,this.changeDetectionRef=Ot,this.environment=_e,this.isBrowser=gt(!1),this.destroy$=new P,this.getReportSubscription=new ht,this.get
5StatesSubscription=new ht,this.getCountiesSubscription=new ht,this.todaysDate=new Date,this.selectedStats=new Array,this.ratio="16:9",this.previewIndex=-1,this.previewWidth=600,this.previewColWidth=600,this.widgetSelect="line",this.geoOpen=null,this.isStdWidget=!0,this.dateRangeSelect="3y",this.triggerCsv=null,this.states=new Array,this.counties=new Array,this.rankCountyStateFilter="county",this.rankSelectedStateFilters=new Array,this.rankSelectedCountyFilters=new Array,this.geoSelectReports=new Array,this.geoSelectCleared=!1,this.numberOfItemsFromEndBeforeFetchingMore=10,this.geoSelectedReports=new Array,this.dataFilter="basic",this.pendingsEnabled=!1,this.pendingAddons=new Array,this.newTable=!0,this.isChartLoading=!1,K(this.platformId)&&this.isBrowser.update(()=>!0),this.presetOptions=new Ft,this.geoCurrentPage=1,this.geoEmptyResults=!1,this.reportsLoading=!1}ngOnInit(){this.stats=new Array("price_median");let e=new Date().getUTCFullYear();this.availableYears=Array(e-2012).fill("").map((i,o)=>e-o),j(this.dataService.currentPortfolioUsage,this.dataService.currentActiveAccount,this.dataService.currentCurrentUser).pipe(v(this.destroy$)).subscribe(i=>{this.portfolioUsage=i[0],this.activeAccount=i[1],this.user=i[2],this.availableStats=this.presetOptions.stats.filter(o=>!o.isInternal||this.user.isInternal||this.portfolioUsage.accounts[this.activeAccount.accountIndex].accountId===6510&&o.val.includes("rental")),this.getStates(),this.getCounties(),this.portfolioUsage.accounts[this.activeAccount.accountIndex]&&(this.getReports(this.geoCurrentPage,!0,!0),this.pendingsEnabled=this.portfolioUsage.accounts[this.activeAccount.accountIndex].maximum.dashboardPendings,this.getPendingAddons())}),this.dateOptions={dateInputFormat:"MMM D YYYY",returnFocusToInput:!1,containerClass:"theme-default"};let t=new Date().getFullYear();this.select={title:"",chartType:"line",analysisType:"comparison",uuid:"",marketSegments:new Set().add("0"),resTypes:new Set().add("100"),windowSizes:new Set().add("7D"),years:new Set().add(t).add(t-1).add(t-2),enDataLabels:!1,enYoyMarkers:!0,enAnnotations:!1,stats:new Set(this.stats),reports:new Set,isGroupYAxis:!1,dateRange:"3y",startDate:"",endDate:"",isColor:!1,categories:new Set().add("city").add("zip"),nValue:10,isTop:!1,inventory:10,withinCounties:new Set,withinStates:new Set,newTable:!1},this.select.title=this.dashboardService.getTitle(this.select,this.geoSelectedReports),this.dateRange={start:null,end:null},this.widgetSelect="comp_line_graph",this.isEdit&&this.getEditItem()}ngAfterContentInit(){}onResize(e){K(this.platformId)&&(this.calcPreviewWidth(),this.buildPreviewUrl())}calcPreviewWidth(){this.previewColWidth=this.previewElement.nativeElement.offsetWidth-15,this.isEdit?this.editChart&&this.editChart.presetParams&&this.setPreviewWidth():this.previewWidth=this.previewColWidth}ngOnDestroy(){this.destroy$.next(),this.destroy$.unsubscribe()}getPendingAddons(){let e=this.portfolioUsage.accounts[this.activeAccount.accountIndex].subscriptionItems.filter(t=>t.price.isBase==!0)[0];this.adminApiService.getDashboardPendingAddons(e.price.interval,e.price.intervalCount).pipe(v(this.destroy$)).subscribe(t=>{this.pendingAddons=t.addOns})}getStates(){this.getStatesSubscription=this.adminApiService.getStatesByAccount().pipe(v(this.destroy$)).subscribe(e=>{this.states=e.states})}getCounties(){this.getCountiesSubscription=this.adminApiService.getCountiesByAccount().pipe(v(this.destroy$)).subscribe(e=>{this.counties=e.counties})}getReports(e,t=!1,i=!1){this.getReportSubscription&&this.getReportSubscription.unsubscribe(),this.getReportSubscription=this.adminApiService.getReportsByAccount(this.portfolioUsage.accounts[this.activeAccount.accountIndex].accountId,e,50,this.geoSelectQuery,!0).pipe(v(this.destroy$)).subscribe(o=>{this.reportsLoading=!1,o.results.length===0&&(this.geoEmptyResults=!0),this.geoSelectReports&&this.geoSelectReports.length>0&&!t?this.geoSelectReports=this.geoSelectReports.concat(o.results):(this.geoSelectReports=o.results,i&&(this.geoSelectedReports[0]=this.geoSelectReports[0],this.buildPreviewUrl()))})}onScroll({end:e}){if(!this.reportsLoading)if(e+this.numberOfItemsFromEndBeforeFetchingMore>=this.geoSelectReports.length)this.fetchMoreReports();else return}onScrollToEnd(){this.fetchMoreReports()}fetchMoreReports(){this.geoEmptyResults||(this.geoCurrentPage++,this.reportsLoading=!0,this.getReports(this.geoCurrentPage))}getEditItem(){j(this.adminApiService.getDashboardItem(this.widgetUuid),this.adminApiService.getDashboardChart(this.widgetUuid)).pipe(v(this.destroy$)).subscribe(e=>{this.editDashboardItem=e[0].dashboardItem,this.editChart=e[1].chart;let t={uuids:this.editChart.geoLocations};this.adminApiService.postReportsFromLocationUuids(t).pipe(v(this.destroy$)).subscribe(i=>{this.editChart.geoLocations.forEach((o,l)=>{this.geoSelectedReports[l]=i.locations.find(_=>_.hash==o)}),this.updateSelect(),this.updateWidgetSelect(),this.setPreviewWidth(),this.buildPreviewUrl()})})}setPreviewWidth(){(this.editChart.presetParams.analysisType==="rank"||this.editChart.presetParams.analysisType==="profile_table"||this.editChart.presetParams.chartType==="sparkline")&&(this.previewWidth=303),(this.editChart.presetParams.analysisType==="yoy"||this.editChart.presetParams.analysisType==="mai"||this.editChart.presetParams.chartType==="line"||this.editChart.presetParams.chartType==="bar")&&(this.previewWidth=this.previewColWidth)}updateSelect(){this.select.analysisType=this.editChart.presetParams.analysisType,this.select.chartType=this.editChart.presetParams.chartType,this.select.marketSegments=new Set(this.editChart.presetParams.marketSegments),this.select.resTypes=new Set(this.editChart.presetParams.resTypes),this.select.windowSizes=new Set(this.editChart.presetParams.windowSizes),this.select.years=new Set(this.editChart.presetParams.years),this.select.stats=new Set(this.editChart.presetParams.stats),this.select.categories=new Set(this.editChart.presetParams.categories),this.select.enDataLabels=this.editChart.presetParams.enDataLabels,this.select.enYoyMarkers=this.editChart.presetParams.enYoyMarkers,this.select.enAnnotations=this.editChart.presetParams.enAnnotations,this.select.nValue=this.editChart.presetParams.nValue,this.select.isTop=this.editChart.presetParams.isTop,this.select.isGroupYAxis=this.editChart.presetParams.isGroupYAxis,this.select.inventory=this.editChart.presetParams.inventory,this.select.withinStates=new Set(this.editChart.presetParams.withinStates),this.select.withinCounties=new Set(this.editChart.presetParams.withinCounties),this.select.withinStates.size>0?(this.rankCountyStateFilter="state",this.select.withinStates.forEac
5h(e=>{this.rankSelectedStateFilters.push(this.states.find(t=>t.abbreviation==e))})):(this.rankCountyStateFilter="county",this.select.withinCounties.forEach(e=>{this.rankSelectedCountyFilters.push(this.counties.find(t=>t.countyFipsCode==e))})),this.dateRangeSelect=this.editChart.presetParams.dateRange,this.stats=Array.from(this.editChart.presetParams.stats),this.select.title=this.editChart.presetParams.title?this.editChart.presetParams.title:this.dashboardService.getTitle(this.select,this.geoSelectedReports),(this.dateRangeSelect=="custom"||this.dateRangeSelect==null||this.select.analysisType==="mai"||this.select.analysisType==="profile_table")&&(this.dateRangeSelect="custom",this.editChart.presetParams.startDate&&(this.dateRange.start=new Date(this.editChart.presetParams.startDate)),this.editChart.presetParams.endDate&&(this.dateRange.end=new Date(this.editChart.presetParams.endDate)))}onTitleFocusOut(){(this.select.title==null||this.select.title=="")&&(this.select.title=this.dashboardService.getTitle(this.select,this.geoSelectedReports)),this.buildPreviewUrl()}onNValueChange(){this.buildPreviewUrl()}onRankChange(e){this.buildPreviewUrl()}onInventoryChange(){this.buildPreviewUrl()}onCategoriesChange(e){e===null?this.select.categories.clear():this.select.categories.has(e)?this.select.categories.delete(e):this.select.categories.add(e),this.buildPreviewUrl()}onStatMultiClick(e){e&&this.stats.filter(i=>i===e).length==0&&e&&(this.stats.push(e),this.select.stats=new Set(this.stats),this.statSelect&&(this.statSelect.blur(),this.statSelect.clearModel()),this.select.title=this.dashboardService.getTitle(this.select,this.geoSelectedReports),this.buildPreviewUrl(),e.startsWith("pending")&&this.mixpanelService.onTrackAdmin("Analytics: Pending Stat Selected",{isInternal:this.user.isInternal,dataFilter:"pending",isEdit:this.isEdit}))}clearYearsForPending(){this.select.years.forEach(e=>{e<2021&&this.select.years.delete(e)})}onYearDisabled(e){return this.select.analysisType==="yoy"&&this.stats.length&&this.stats[0]?.startsWith("pending")?e<2021:!1}onDualStatClick(e){e&&this.stats.length<2&&this.stats.filter(i=>i===e).length==0&&e&&(this.select.analysisType==="yoy"&&e.startsWith("pending")&&this.clearYearsForPending(),this.stats.push(e),this.select.stats=new Set(this.stats),this.statSelect&&(this.statSelect.blur(),this.statSelect.clearModel()),this.select.title=this.dashboardService.getTitle(this.select,this.geoSelectedReports),this.buildPreviewUrl(),e.startsWith("pending")&&this.mixpanelService.onTrackAdmin("Analytics: Pending Stat Selected",{isInternal:this.user.isInternal,dataFilter:"pending",isEdit:this.isEdit}))}onStatSelectClose(){}getGeoDisabled(){return this.select.chartType==="sparkline"&&this.geoSelectedReports.length==1&&this.stats.length>1}getDualStatDisabled(){return this.select.analysisType!=="yoy"&&this.stats.length>1||this.select.analysisType=="yoy"&&this.stats.length==1}getStatDisabled(){return this.geoSelectedReports.length>1&&this.stats.length==1}onRemoveStat(e){this.stats.splice(e,1),this.select.stats=new Set(this.stats),this.select.title=this.dashboardService.getTitle(this.select,this.geoSelectedReports),this.buildPreviewUrl()}getStatName(e){return this.presetOptions.stats.filter(t=>t.val===e)[0].name}onStandardWidget(){this.isStdWidget=!0,this.onWidgetSelect()}onDateRangeSelect(){this.buildPreviewUrl()}startDateChanged(e){e instanceof Date&&!isNaN(e.getTime())?this.dateRange.start=e:this.dateRange.start="",this.buildPreviewUrl()}endDateChanged(e){e instanceof Date&&!isNaN(e.getTime())?this.dateRange.end=e:this.dateRange.end="",this.buildPreviewUrl()}onSearchReports(e){this.geoEmptyResults=!1,this.geoSelectQuery=e.term,this.geoCurrentPage=1,this.getReports(this.geoCurrentPage,!0)}onReportChanged(e){e?(this.geoSelectCleared=!1,this.geoSelectedReports.filter(i=>i.hash===e.hash).length==0&&e&&(this.geoSelectedReports.push(e),this.geoSelectedReport=null,this.geoSelect.blur(),this.geoSelect.clearModel(),this.buildPreviewUrl())):(this.geoSelectCleared=!0,this.geoEmptyResults=!1,this.geoCurrentPage=1,this.geoSelectQuery=null,this.getReports(this.geoCurrentPage,!0))}onGeoSelectClose(){}onStateFilterChanged(e){e&&this.rankSelectedStateFilters.filter(i=>i.stateId===e.stateId).length==0&&e&&(this.rankSelectedStateFilters.push(e),this.select.withinStates.add(e.abbreviation),this.rankStateSelected=void 0,this.rankStateSelect.blur(),this.rankStateSelect.clearModel(),this.buildPreviewUrl())}onStateFilterClose(){}onSearchStateFilter(e){}onRemoveRankStateFilter(e){this.select.withinStates.delete(this.rankSelectedStateFilters[e].abbreviation),this.rankSelectedStateFilters.splice(e,1),this.buildPreviewUrl()}onCountyFilterChanged(e){e&&this.rankSelectedCountyFilters.filter(i=>i.countyFipsCode===e.countyFipsCode).length==0&&e&&(this.rankSelectedCountyFilters.push(e),this.select.withinCounties.add(e.countyFipsCode),this.rankCountySelected=void 0,this.rankCountySelect.blur(),this.rankCountySelect.clearModel(),this.buildPreviewUrl())}onCountyFilterClose(){}onSearchCountyFilter(e){}onRemoveRankCountyFilter(e){this.select.withinCounties.delete(this.rankSelectedCountyFilters[e].countyFipsCode),this.rankSelectedCountyFilters.splice(e,1),this.buildPreviewUrl()}onRankCountyStateSelect(e){this.rankCountyStateFilter=e,this.buildPreviewUrl()}onDataFilterSelect(e){this.dataFilter=e,this.mixpanelService.onTrackAdmin("Analytics: Data Filter Changed",{isInternal:this.user.isInternal,dataFilter:e,isEdit:this.isEdit})}onSave(e){this.isEdit?e==!0?this.onCreateChart(e):this.onUpdateChart(e):this.onCreateChart(e)}buildUrl(){this.chartUrl=_e.altos.baseUrl+"/html/analysis-chart/widget?pai="+this.portfolioUsage.accounts[this.activeAccount.accountIndex].accountHash+"&uuid="+this.chartUuid}createUpdateParams(){let e={accountId:this.portfolioUsage.accounts[this.activeAccount.accountIndex].accountId,geoLocations:this.geoSelectedReports.map(t=>t.hash),presetParams:{title:this.select.title,uuid:this.select.uuid,chartType:this.select.chartType,analysisType:this.select.analysisType,stats:Array.from(this.select.stats),resTypes:Array.from(this.select.resTypes),windowSizes:Array.from(this.select.windowSizes),marketSegments:Array.from(this.select.marketSegments),years:Array.from(this.select.years),isGroupYAxis:this.select.isGroupYAxis,enDataLabels:this.select.enDataLabels,enAnnotations:this.select.enAnnotations,enYoyMarkers:this.select.enYoyMarkers,categories:Array.from(this.select.categories),nValue:this.select.nValue,isTop:this.select.isTop,inventory:this.select.inventory}};return this.select.analysisType=="rank"&&(this.rankCountyStateFilter=="state"&&this.rankSelectedStateFilters.length>0&&(e.presetParams.withinStates=this.rankSelectedStateFilters.map(t=>t.abbreviation)),this.rankCountyStateFilter=="county"&&this.rankSelectedCountyFilters.length>0&&(e.presetParams.withinCounties=this.rankSelectedCountyFilters.map(t=>t.countyFipsCode))),this.widgetSelect!="mai"&&this.widgetSelect!="profile_table"&&this.dateRangeSelect!="custom"?e.presetParams.dateRange=this.dateRangeSelect:(e.presetParams.dateRange="custom",this.dateRange.start&&(e.presetParams.startDate=this._formatDate(this.dateRange.start)),this.dateRange.end&&(e.presetParams.endDate=this._formatDate(this.dateRange.end))),e}onCreateChart(e,t=!0,i=null){let o=this.createUpdateParams();this.adminApiService.postDashboardChart(o).pipe(v(this.destroy$)).subscribe(l=>{this.isChartLoading=!1,this.chartUuid=l.chart.uuid,i=="downloadPng"?this._downloadPngModal():i=="embedModal"&&this._embedModal(),e?this.onCreateDashboard(l.chart.uuid,o.presetParams):t&&this.toastService.showSuccessToast("Successfully saved to recent analyses")},l=>{this.isChartLoading=!1,t&&this.toastService.showErrorToast("Error saving recent analyses")})}onUpdateChart(e,t=!0,i=null){let o=this.createUpdateParams();this.adminApiService.patchDashboardChart(this.widgetUuid,o).pipe(v(this.destroy$)).subscribe(l=>{this.isChartLoading=!1,this.chartUuid=l.chart.uuid,i=="downloadPng"?this._downloadPngModal():i=="embedModal"&&this._embedModal(),e?this.editDashboardItem!=null?this.onUpdateDashboard(o.presetParams):this.onCreateDashboard(l.chart.uuid,o.presetParams):t&&this.toastService.showSuccessToast("Successfully updated recent analyses")},l=>{this.isChartLoading=!1,t&&this.toastService.showErrorToast("Error updating recent analyses")})}onUpdateDashboard(e){let t={uuid:this.editDashboardItem.uuid,dashboardLocation:{x:this.editDashboardItem.dashboardLocation.x,y:this.editDashboardItem.dashboardLocation.y,cols:this.dashboardUtils.getDashboardCols(e),rows:this.dashboardUtils.getDashboardRows(e)},dashboardSize:{ratio:this.dashboardUtils.getDashboardRatio(e),width:this.dashboardUtils.getDashboardWidth(e)}};this.adminApiService.patchDashboardItem(t).pipe(v(this.destroy$)).subscribe(i=>{this.router.navigate(["/admin/dashboard"]),this.toastService.showSuccessToast("Successfully updated recent analyses and updated dashboard")},i=>{this.toastService.showErrorToast("Error updating analysis on dashboard")})}onCreateDashboard(e,t){let i={chartUuid:e,dashboardLocation:{x:0,y:0,cols:this.dashboardUtils.getDashboardCols(t),rows:this.dashboardUtils.getDashboardRows(t)},dashboardSize:{ratio:this.dashboardUtils.getDashboardRatio(t),width:this.dashboardUtils.getDashboardWidth(t)}};this.adminApiService.postAddChartToDashboard(i).pipe(v(this.destroy$)).subscribe(o=>{this.router.navigate(["/admin/dashboard"])})}onWidgetSelect(){if(this.isEdit&&this.updateSelect(),this.widgetSelect=="rank"&&(this.select.analysisType="rank",this.select.chartType="sparkline",this.select.title=this.dashboardService.getTitle(this.select,this.geoSelectedReports),this.previewWidth=303,this.select.nValue=10,this.select.isTop=!0,this.select.windowSizes.clear(),this.select.windowSizes.add("90D"),this.select.categories.clear(),this.select.categories.add("city"),this.stats.length>0)){let e=this.select.stats.values().next().value;this.select.stats.clear(),this.select.stats.add(e),this.stats.length=0,this.stats[0]=e}if(this.widgetSelect==="yoy"){if(this.select.analysisType="yoy",this.select.chartType="line",this.previewWidth=this.previewColWidth,this.dateRange.start="",this.dateRange.end="",this.stats.length>0){let e=this.select.stats.values().next().value;this.select.stats.clear(),this.select.stats.add(e),this.stats.length=0,this.stats[0]=e,this.select.title=this.dashboardService.getTitle(this.select,this.geoSelectedReports)}if(this.select.resTypes.size>0){let e=this.select.resTypes.values().next().value;this.select.resTypes.clear(),this.select.resTypes.add(e)}if(this.select.windowSizes.size>0){let e=this.select.windowSizes.values().next().value;this.select.windowSizes.clear(),this.select.windowSizes.add(e)}if(this.select.marketSegments.size>0){let e=this.select.marketSegments.values().next().value;this.select.marketSegments.clear(),this.select.marketSegments.add(e)}this.clearYearsForPending()}if(this.widgetSelect==="mai"&&(this.select.analysisType="mai",this.select.chartType="",this.select.title=this.dashboardService.getTitle(this.select,this.geoSelectedReports),this.previewWidth=this.previewColWidth,this.geoSelectedReports.length>0)){let e=this.geoSelectedReports.values().next().value;this.geoSelectedReports.length=0,this.geoSelectedReports[0]=e}if(this.widgetSelect==="profile_table"&&(this.select.analysisType="profile_table",this.select.chartType="",this.select.title=this.dashboardService.getTitle(this.select,this.geoSelectedReports),this.previewWidth=303,this.geoSelectedReports.length>0)){let e=this.geoSelectedReports.values().next().value;this.geoSelectedReports.length=0,this.geoSelectedReports[0]=e}if(this.widgetSelect==="comp_sparkline"&&(this.select.analysisType="comparison",this.select.chartType="sparkline",this.select.title=this.dashboardService.getTitle(this.select,this.geoSelectedReports),this.previewWidth=303,this.select.windowSizes.clear(),this.select.windowSizes.add("90D")),this.widgetSelect==="comp_line_graph"&&(this.select.analysisType="comparison",this.select.chartType="line",this.previewWidth=this.previewColWidth),this.widgetSelect==="comp_bar_chart"&&(this.select.analysisType="comparison",this.select.chartType="bar",this.previewWidth=this.previewColWidth),(this.widgetSelect==="mai"||this.widgetSelect=="profile_table"||this.select.chartType==="sparkline")&&this.select.resTypes.size>0){let e=this.select.resTypes.values().next().value;this.select.resTypes.clear(),this.select.resTypes.add(e)}if(this.select.chartType==="sparkline"){if(this.select.windowSizes.size>0){let e=this.select.windowSizes.values().next().value;this.select.windowSizes.clear(),this.select.windowSizes.add(e)}if(this.select.marketSegments.size>0){let e=this.select.marketSegments.values().next().value;this.select.marketSegments.clear(),this.select.marketSegments.add(e)}}this.buildPreviewUrl()}onQuartilesRadioClick(e){this.select.marketSegments.has(e)||(this.select.marketSegments.clear(),this.select.marketSegments.add(e)),this.buildPreviewUrl()}onQuartilesClick(e){this.select.marketSegments.has(e)?this.select.marketSegments.delete(e):this.select.marketSegments.add(e),this.buildPreviewUrl()}onResTypeRadioClick(e){this.select.resTypes.has(e)||(this.select.resTypes.clear(),this.select.resTypes.add(e)),this.buildPreviewUrl()}onResTypeClick(e){this.select.resTypes.has(e)?this.select.resTypes.delete(e):this.select.resTypes.add(e),this.buildPreviewUrl()}onWindowSizeRadioClick(e){this.select.windowSizes.has(e)||(this.select.windowSizes.clear(),this.select.windowSizes.add(e)),this.buildPreviewUrl()}onWindowSizeClick(e){this.select.windowSizes.has(e)?this.select.windowSizes.delete(e):this.select.windowSizes.add(e),this.buildPreviewUrl()}onEnDataLabelsClick(){this.select.enDataLabels=!this.select.enDataLabels,this.buildPreviewUrl()}onEnYoyMarkersClick(){this.select.enYoyMarkers=!this.select.enYoyMarkers,this.buildPreviewUrl()}onIsGroupYAxisClick(){this.select.isGroupYAxis=!this.select.isGroupYAxis,this.buildPreviewUrl()}onYearToggle(e,t){t?this.select.years.add(e):this.select.years.delete(e),this.buildPreviewUrl()}onNewTableToggle(e){this.newTable=!!e,this.buildPreviewUrl()}onRemoveReport(e){this.geoSelectedReports.splice(e,1),this.buildPreviewUrl()}buildPreviewUrl(){let e;e=this.select,e.stats=new Set(this.stats),this.select.analysisType=="rank"?this.rankCountyStateFilter=="state"?(e.withinStates=new Set(this.rankSelectedStateFilters.map(i=>i.abbreviation)),e.withinCounties.clear()):(e.withinCounties=new Set(this.rankSelectedCountyFilters.map(i=>i.countyFipsCode)),e.withinStates.clear()):(e.withinStates.clear(),e.withinCounties.clear()),this.select.analysisType!=="mai"&&this.select.analysisType!=="profile_table"&&this.dateRangeSelect!="custom"?(e.dateRange=this.dateRangeSelect,e.startDate=null,e.endD
5ate=null):(e.dateRange=null,this.dateRange.start&&(e.startDate=this._formatDate(this.dateRange.start)),this.dateRange.end&&(e.endDate=this._formatDate(this.dateRange.end))),e.newTable=this.newTable,e.analysisType=this.select.analysisType,e.chartType=this.select.chartType;let t=new pn;t.presetParams=e,t.geoLocations=this.geoSelectedReports.map(i=>i.hash),this.dashboardDataService.insertDashboardItem(this.previewIndex,t),this.dashboardDataService.insertRatio(this.previewIndex,this.ratio),this.dashboardDataService.insertWidth(this.previewIndex,this.previewWidth-3),this.dashboardDataService.changePai(this.portfolioUsage.accounts[this.activeAccount.accountIndex].accountHash)}onCancel(){this.router.navigate(["/admin/dashboard/view"])}onDownloadPng(){this.isChartLoading=!0,this.isEdit?this.onUpdateChart(!1,!1,"downloadPng"):this.onCreateChart(!1,!1,"downloadPng"),this.mixpanelService.onTrackAdmin("Analytics: Download PNG",{isInternal:this.user.isInternal,isEdit:this.isEdit}),this.handleClick()}_downloadPngModal(){this.buildUrl();let e=this.createUpdateParams(),t=this.dashboardUtils.getDefaultPngWidthHeightRatio(e.presetParams);this.downloadModalRef=this.modalService.show(At,{class:"altos-dashboard-dl-modal-wrapper"}),this.downloadModalRef.content.setModalData(this.chartUrl,t.width,t.height,t.ratio,this.newTable),this.downloadModalRef.content.onClose.pipe(v(this.destroy$)).subscribe(i=>{i&&this.toastService.showSuccessToast(i)}),this.downloadModalRef.content.onOpenTab.pipe(v(this.destroy$)).subscribe(i=>{setTimeout(()=>{window.open(i,"_blank")},150)})}onDownloadCsv(){this.isChartLoading=!0,this.isEdit?this.onUpdateChart(!1,!1):this.onCreateChart(!1,!1),this.triggerCsv=!this.triggerCsv,this.mixpanelService.onTrackAdmin("Analytics: Download CSV",{isInternal:this.user.isInternal,isEdit:this.isEdit}),this.handleClick()}onEmbed(){this.isChartLoading=!0,this.isEdit?this.onUpdateChart(!1,!1,"embedModal"):this.onCreateChart(!1,!1,"embedModal"),this.mixpanelService.onTrackAdmin("Analytics: Embed Modal",{isInternal:this.user.isInternal,isEdit:this.isEdit}),this.handleClick()}_embedModal(){this.buildUrl();let e=this.createUpdateParams();this.embedModalRef=this.modalService.show(kt,{class:"altos-dashboard-dl-modal-wrapper"}),this.embedModalRef.content.setModalData(this.chartUrl,this.dashboardUtils.getDashboardRatio(e.presetParams),this.dashboardUtils.getDashboardWidth(e.presetParams)),this.embedModalRef.content.onClose.pipe(v(this.destroy$)).subscribe(t=>{t&&this.toastService.showSuccessToast(t)})}_formatDate(e){return e.toISOString().split("T")[0]}updateWidgetSelect(){this.select.analysisType==="mai"&&(this.widgetSelect="mai"),this.select.analysisType==="rank"&&(this.widgetSelect="rank"),this.select.analysisType==="yoy"&&(this.widgetSelect="yoy"),this.select.analysisType==="profile_table"&&(this.widgetSelect="profile_table"),this.select.analysisType==="comparison"&&(this.select.chartType==="sparkline"&&(this.widgetSelect="comp_sparkline"),this.select.chartType==="line"&&(this.widgetSelect="comp_line_graph")),this.mixpanelService.onTrackAdmin("Analytics: Widget Select",{isInternal:this.user.isInternal,widgetType:this.widgetSelect,isEdit:this.isEdit})}onPendingInfo(){this.pendingInfoModalRef=this.modalService.show(Be,{class:"altos-dashboard-pending-modal-wrapper"}),this.pendingInfoModalRef.content.setModalData(this.pendingsEnabled),this.pendingInfoModalRef.content.onClose.pipe(v(this.destroy$)).subscribe(e=>{e==!0&&this.onPendingPurchase()}),this.mixpanelService.onTrackAdmin("Analytics: Pending Info Modal Open",{isInternal:this.user.isInternal,isEdit:this.isEdit})}onPendingPurchase(){this.pendingPurchaseModalRef=this.modalService.show(Ne,{class:"altos-dashboard-pending-modal-wrapper"}),this.pendingPurchaseModalRef.content.onClose.pipe(v(this.destroy$)).subscribe(e=>{e==!0&&this.onPlanUpgradeAreYouSure(this.pendingAddons[0])}),this.mixpanelService.onTrackAdmin("Analytics: Pending Purchase Modal Open",{isInternal:this.user.isInternal,isEdit:this.isEdit})}getBasePlanPrice(){let e=this.portfolioUsage.accounts[this.activeAccount.accountIndex].subscriptionItems.filter(i=>!i.price.isUpsell);
5return e[0].price.unitAmount>0?e[0].price.unitAmount/100:0}getDuration(e){let t="";return e.interval==="month"&&e.intervalCount===3?t+="Quarter":(e.intervalCount===1||e.intervalCount!==1&&(t="every "+e.intervalCount+" "),e.interval==="day"?t+="day":e.interval==="week"?t+="week":e.interval==="month"?t+="month":e.interval==="year"&&(t+="year")),t}onPlanUpgradeAreYouSure(e){let t=this.modalService.show(pe),i=e.unitAmount/100;t.content.setConfirmationModal("Confirm Pendings Add-On","Your account will be charged an additional "+be(i,"en_US","$")+" per "+this.getDuration(e).toLowerCase()+". Your first month will be prorated for the current billing cycle."),t.content.onClose.subscribe(o=>{o===!0&&(this.onUpdatingAccountModal(),this.onUpgrade(e))}),this.mixpanelService.onTrackAdmin("Analytics: Pending Are You Sure Modal Open",{isInternal:this.user.isInternal,isEdit:this.isEdit})}onUpgrade(e){let t={priceId:e.id,quantity:1};this.adminApiService.postAccountUpsell(t).subscribe(i=>{this.toastService.showSuccessToast("You have successfully purchased an upgrade."),this.authService.getPortfolioUsage(),this.updatingModalRef.hide()},i=>{this.updatingModalRef.hide(),this.toastService.showErrorToast("There was and error purchasing the upgrade. Please, contact support.")}),this.mixpanelService.onTrackAdmin("Analytics: Pending Upgrade",{isInternal:this.user.isInternal,isEdit:this.isEdit})}onUpdatingAccountModal(){this.updatingModalRef=this.modalService.show(He,{class:"modal-sm"})}handleClick(){if(K(this.platformId)){let e=document.activeElement;e&&e.blur()}}static{this.\u0275fac=function(t){return new(t||s)(f(de),f(Wi),f(se),f(tn),f(Z),f(W),f(X),f(re),f(Ce),f(me),f(we),f(J),f(ze),f(We),f(G),f(ee),f(Ee))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-analyze-widget-form"]],viewQuery:function(t,i){if(t&1&&(Fe(Ns,5),Fe(Hs,5),Fe(Ys,5),Fe(js,5),Fe(Gs,5)),t&2){let o;Ue(o=De())&&(i.geoSelect=o.first),Ue(o=De())&&(i.statSelect=o.first),Ue(o=De())&&(i.rankStateSelect=o.first),Ue(o=De())&&(i.rankCountySelect=o.first),Ue(o=De())&&(i.previewElement=o.first)}},hostBindings:function(t,i){t&1&&u("resize",function(l){return i.onResize(l)},!1,ut)},inputs:{isEdit:"isEdit",widgetUuid:"widgetUuid"},decls:66,vars:18,consts:[["preview",""],["geoSelect",""],["statSelect",""],["rankStateFilter",""],["rankCountyFilter",""],[1,"t-px-8","sm:t-px-12","t-mt-8","new-analysis"],[1,"t-flex","t-flex-col","lg:t-flex-row","t-gap-8"],[1,"t-w-full","lg:t-w-3/12","t-bg-white","t-rounded-xl","t-p-6"],[1,"t-m-0","font-hanken","t-text-[20px]","t-mb-8"],["id","chart-title",1,"t-form-control","t-mb-8"],[1,"t-label-text","t-text-[14px]","font-inter","t-font-light","t-text-black","t-mb-4"],["id","chart-title-label"],["type","text","name","t-input t-input-bordered t-text-[14px] t-h-[35px] font-inter placeholder:t-text-gray-400 placeholder:t-font-normal","autocomplete","off",1,"form-control",3,"ngModelChange","focusout","ngModel"],[1,"t-form-control","t-mb-8"],["id","widget-type"],["name","preset","class","t-select t-select-bordered t-text-[14px] t-w-full font-inter t-p-0 t-border-0",3,"searchable","clearable","ngModel","ngModelChange",4,"ngIf"],[4,"ngIf"],["class","t-form-control",4,"ngIf"],["class","t-form-control date-range",4,"ngIf"],[1,"t-w-full","lg:t-w-6/12","t-bg-white","t-rounded-xl","t-p-6","t-h-fit"],["class","t-flex t-justify-end t-w-full t-mb-8",4,"ngIf"],[1,"preview-frame","t-w-full","t-relative","t-flex","t-justify-center"],["class","t-absolute t-w-full t-h-full t-left-0 t-top-0 t-flex t-justify-center t-items-center",4,"ngIf"],[1,"t-dropdown","t-dropdown-end","t-absolute","t-right-0"],["type","button","id","dash-add","tabindex","0",1,"t-btn","t-h-[30px]","t-text-[14px]"],[1,"fa","fa-ellipsis-v"],["tabindex","0",1,"t-dropdown-content","t-menu","t-bg-base-100","t-rounded-box","t-p-4","t-shadow","t-text-[14px]","t-z-20","t-w-72","t-text-black"],[3,"click"],[3,"index","isDashboardPreview","triggerCsv",4,"ngIf"],[1,"t-flex","t-justify-end","t-gap-x-4","t-mt-4"],[1,"t-btn","t-uppercase","t-px-3","sm:t-px-6","btn-purple-outline","font-cofo-mono","t-cursor-pointer","t-h-[45px]","t-text-[15px]","sm:t-text-[16
5px]",3,"click"],[1,"t-btn","t-uppercase","t-px-3","sm:t-px-6","btn-purple","font-cofo-mono","t-cursor-pointer","t-h-[45px]","t-text-[15px]","sm:t-text-[16px]",3,"click"],[1,"t-m-0","font-hanken","t-text-[20px]"],["class","t-form-control rank-direction",4,"ngIf"],[1,"t-form-control"],[1,"t-text-[15px]","font-hanken","t-text-black","t-mb-4"],[1,"t-flex","t-flex-wrap","t-gap-x-8"],[4,"ngFor","ngForOf"],[1,"t-form-control","res-type"],["name","preset",1,"t-select","t-select-bordered","t-text-[14px]","t-w-full","font-inter","t-p-0","t-border-0",3,"ngModelChange","searchable","clearable","ngModel"],["value","comp_line_graph"],["value","yoy"],["value","comp_sparkline"],["value","rank"],["value","profile_table"],["value","mai"],["id","geo_select","name","geo_select","class","t-select t-select-bordered t-text-[14px] t-w-full font-inter t-p-0 t-border-0 t-mb-4","bindLabel","displayName",3,"virtualScroll","loading","placeholder","ngModel","clearable","disabled","ngModelChange","change","close","search","scroll","scrollToEnd",4,"ngIf"],["id","geography-container",1,"t-flex","t-gap-x-4","t-flex-wrap"],["id","geo_select","name","geo_select","bindLabel","displayName",1,"t-select","t-select-bordered","t-text-[14px]","t-w-full","font-inter","t-p-0","t-border-0","t-mb-4",3,"ngModelChange","change","close","search","scroll","scrollToEnd","virtualScroll","loading","placeholder","ngModel","clearable","disabled"],[3,"value"],[1,"t-flex","t-items-center","t-gap-x-4"],[1,"t-mr-auto"],[1,"t-badge","t-badge-outline","t-badge-md","t-text-gray-500","t-border-gray-500"],[1,"t-btn","t-bg-gray-300","text-olive","t-flex","t-justify-between","t-group","t-text-[12px]","t-h-[25px]","t-mt-2","t-flex-nowrap","hover:t-bg-transparent","hover:border-olive","t-transition",3,"click","mousedown"],[1,"t-tabs","t-tabs-bordered","t-mb-8"],["type","button","name","filter-data-basic",1,"t-tab","t-h-[40px]","font-inter","t-text-[14px]",3,"click","mousedown","ngClass"],["type","button","name","fitler-data-advanced",1,"t-tab","t-h-[40px]","font-inter","t-text-[14px]",3,"click","mousedown","ngClass"],["class","t-tab t-h-[40px] font-inter t-text-[14px]","type","button","name","fitler-data-pendings",3,"ngClass","click","mousedown",4,"ngIf"],["class","t-tab t-h-[40px] font-inter t-text-[14px]","type","button","name","fitler-data-pendings",3,"click","mousedown",4,"ngIf"],["id","data-sparkline",1,"adv-label"],["id","stat_select","name","stat_select","class","t-select t-select-bordered t-text-[14px] t-w-full font-inter t-p-0 t-border-0 t-mb-4","bindLabel","displayName",3,"virtualScroll","placeholder","ngModel","clearable","disabled","ngModelChange","change","close",4,"ngIf"],["id","stat-container"],["class","adv-label",4,"ngFor","ngForOf"],["type","button","name","fitler-data-pendings",1,"t-tab","t-h-[40px]","font-inter","t-text-[14px]",3,"click","mousedown","ngClass"],["type","button","name","fitler-data-pendings",1,"t-tab","t-h-[40px]","font-inter","t-text-[14px]",3,"click","mousedown"],[1,"fa","fa-lock"],["id","stat_select","name","stat_select","bindLabel","displayName",1,"t-select","t-select-bordered","t-text-[14px]","t-w-full","font-inter","t-p-0","t-border-0","t-mb-4",3,"ngModelChange","change","close","virtualScroll","placeholder","ngModel","clearable","disabled"],[3,"value","ngClass"],["disabled","",4,"ngIf"],["disabled",""],[1,"adv-label"],[1,"btn","btn-outline-secondary","geo-minus-button","minus",3,"click","mousedown"],[1,"fa","fa-minus","geo-i-button","geo-i-button-minus"],[1,"t-m-0","font-hanken","t-text-[20px]","t-mb-6","t-mt-8"],["type","button","name","filter-data-basic","id","filter-data-basic",1,"t-tab","t-h-[40px]","font-inter","t-text-[14px]",3,"click","mousedown","ngClass"],["type","button","name","fitler-data-advanced","id","fitler-data-advanced",1,"t-tab","t-h-[40px]","font-inter","t-text-[14px]",3,"click","mousedown","ngClass"],["class","t-tab t-h-[40px] font-inter t-text-[14px]","type","button","name","fitler-data-pendings","id","fitler-data-pendings",3,"ngClass","click","mousedown",4,"ngIf"],["class","t-tab t-h-[40px] font-inter t-text-[14px] t-gap-x-3","type","button","name","fitler-data-pendings-1","id","fitler-data-pendings-1",3,"click","mousedown",4,"ngIf"],["id","geography-search",1,"adv-label"],["name","stat_select","class","t-select t-select-bordered t-text-[14px] t-w-full font-inter t-p-0 t-border-0 t-mb-4",3,"virtualScroll","placeholder","ngModel","clearable","disabled","ngModelChange","change","close",4,"ngIf"],[1,"t-flex","t-gap-x-4","t-flex-wrap"],["type","button","name","fitler-data-pendings","id","fitler-data-pendings",1,"t-tab","t-h-[40px]","font-inter","t-text-[14px]",3,"click","mousedown","ngClass"],["type","button","name","fitler-data-pendings-1","id","fitler-data-pendings-1",1,"t-tab","t-h-[40px]","font-inter","t-text-[14px]","t-gap-x-3",3,"click","mousedown"],["name","stat_select",1,"t-select","t-select-bordered","t-text-[14px]","t-w-full","font-inter","t-p-0","t-border-0","t-mb-4",3,"ngModelChange","change","close","virtualScroll","placeholder","ngModel","clearable","disabled"],[1,"altos-new",3,"value"],["class","t-float-end bg-purple t
5-text-white t-px-2 t-text-[10px] t-mt-2",4,"ngIf"],[1,"t-float-end","bg-purple","t-text-white","t-px-2","t-text-[10px]","t-mt-2"],[1,"t-form-control","date-range"],["id","date-range"],["name","range-select","class","t-select t-select-bordered t-text-[14px] t-w-full font-inter t-p-0 t-border-0 t-mb-4",3,"searchable","clearable","ngModel","ngModelChange",4,"ngIf"],["class","date-wrapper",4,"ngIf"],["name","range-select",1,"t-select","t-select-bordered","t-text-[14px]","t-w-full","font-inter","t-p-0","t-border-0","t-mb-4",3,"ngModelChange","searchable","clearable","ngModel"],["value","3m"],["value","1y"],["value","3y"],["value","5y"],["value","custom"],[1,"date-wrapper"],[1,"start-date-input"],["placeholder","Start","name","startDate","bsDatepicker","","placement","bottom","autocomplete","off",1,"t-input","t-input-bordered","t-text-[14px]","t-h-[35px]","font-inter","placeholder:t-text-gray-400","placeholder:t-font-normal",3,"ngModelChange","bsValueChange","ngModel","bsConfig","maxDate"],["placeholder","End","name","endDate","bsDatepicker","","placement","bottom","autocomplete","off",1,"t-input","t-input-bordered","t-text-[14px]","t-h-[35px]","font-inter","placeholder:t-text-gray-400","placeholder:t-font-normal","date-input-end",3,"ngModelChange","bsValueChange","ngModel","bsConfig","maxDate"],[1,"date"],[1,"t-flex","t-justify-end","t-w-full","t-mb-8"],["id","newTable","checkedLabel","New Table","uncheckedLabel","New Table",3,"change","checked"],[1,"t-absolute","t-w-full","t-h-full","t-left-0","t-top-0","t-flex","t-justify-center","t-items-center"],[1,"t-loading","t-loading-ring","t-w-40","bg-purple"],[3,"index","isDashboardPreview","triggerCsv"],["type","button","name","filter-counties","id","filter-county-toggle",1,"t-tab","t-h-[40px]","font-inter","t-text-[14px]",3,"click","mousedown","ngClass"],["type","button","name","fitler-states","id","filter-state-toggle",1,"t-tab","t-h-[40px]","font-inter","t-text-[14px]",3,"click","mousedown","ngClass"],["id","rank-state-filter",4,"ngIf"],["id","rank-county-filter",4,"ngIf"],["id","n-val",1,"t-m-0","font-hanken","t-text-[20px]","t-mb-6","t-mt-4"],[1,"adv-label","n-val"],["name","n-val","placeholder","Limit rank to N values",1,"t-input","t-input-bordered","t-w-full","t-bg-white","t-text-[16px]","font-inter","t-h-[35px]",3,"ngModelChange","change","ngModel"],["id","rank-state-filter"],["id","rank_state_filter","name","rank_state_filter","class","t-select t-select-bordered t-text-[14px] t-w-full font-inter t-p-0 t-border-0 t-mb-4","placeholder","Type for search",3,"virtualScroll","ngModel","clearable","ngModelChange","change","close","search",4,"ngIf"],["id","rank-state-filter-container",1,"t-flex","t-gap-x-4","t-flex-wrap"],["id","rank_state_filter","name","rank_state_filter","placeholder","Type for search",1,"t-select","t-select-bordered","t-text-[14px]","t-w-full","font-inter","t-p-0","t-border-0","t-mb-4",3,"ngModelChange","change","close","search","virtualScroll","ngModel","clearable"],[3,"value",4,"ngFor","ngForOf"],["id","rank-county-filter"],["id","rank_county_filter","name","rank_county_filter","class","t-select t-select-bordered t-text-[14px] t-w-full font-inter t-p-0 t-border-0 t-mb-4","placeholder","Type for search",3,"virtualScroll","ngModel","clearable","ngModelChange","change","close","search",4,"ngIf"],["id","rank-county-filter-container",1,"t-flex","t-gap-x-4","t-flex-wrap"],["id","rank_county_filter","name","rank_county_filter","placeholder","Type for search",1,"t-select","t-select-bordered","t-text-[14px]","t-w-full","font-inter","t-p-0","t-border-0","t-mb-4",3,"ngModelChange","change","close","search","virtualScroll","ngModel","clearable"],[1,"t-form-control","rank-direction"],["id","rank-group"],["name","rank-direction",1,"t-select","t-select-bordered","t-text-[15px]","t-w-full","t-h-[35px]",3,"ngModelChange","ngModel"],[3,"ngValue"],["id","inventory-val"],["name","inventory-val",1,"t-input","t-input-bordered","t-w-full","t-bg-white","t-text-[16px]","font-inter","t-h-[35px]",3,"ngModelChange","change","ngModel"],["name","category-all","type","checkbox","id","category-all",1,"checkbox-purple",3,"change","checked"],["for","category-all",1,"font-inter","t-ml-2","t-font-light"],["type","checkbox",1,"checkbox-purple",3,"change","name","checked","id"],[1,"font-inter","t-ml-2","t-font-light",3,"for"],[1,"t-text-[15px]","font-hanken","t-text-black","t-mb-2"],[1,"font-hanken","t-text-[13px]","t-mb-4"],[3,"valueChange","id","checkedLabel","uncheckedLabel","checked","disabled"],["type","checkbox","class","checkbox-purple",3,"id","checked","change",4,"ngIf"],["type","radio","name","quartiles","class","checkbox-purple",3,"id","value","checked","change",4,"ngIf"],["title","Represents approximately 25% of the market ordered by price",1,"font-inter","t-ml-2","t-font-light",3,"for"],["type","checkbox",1,"checkbox-purple",3,"change","id","checked"],["type","radio","name","quartiles",1,"checkbox-purple",3,"change","id","value","checked"],["type","radio","name","resTypes","class","checkbox-purple",3,"id","value","checked","change",4,"ngIf"],["type","radio","name","resTypes",1,"checkbox-purple",3,"change","id","value","checked"],["type","checkbox","class","checkbox-purple",3,"id","checked","click","change",4,"ngIf"],["type","radio","name","windowSizes","class","checkbox-purple",3,"id","value","checked","change",4,"ngIf"],["type","checkbox",1,"checkbox-purple",3,"click","change","id","checked"],["type","radio","name","windowSizes",1,"checkbox-purple",3,"change","id","value","checked"],["
5id","en-yoy-markers","type","checkbox",1,"checkbox-purple",3,"change","checked"],["for","en-yoy-markers",1,"font-inter","t-ml-2","t-font-light"],["id","is-group-y-axis","type","checkbox",1,"checkbox-purple",3,"change","checked"],["for","is-group-y-axis",1,"font-inter","t-ml-2","t-font-light"]],template:function(t,i){if(t&1){let o=y();C(0,"admin-dashboard-nav"),r(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),p(5," Configure Data "),a(),r(6,"div",9)(7,"label",10),p(8," Title "),a(),D(9,11),r(10,"input",12),U("ngModelChange",function(_){return m(o),F(i.select.title,_)||(i.select.title=_),g(_)}),u("focusout",function(){return m(o),g(i.onTitleFocusOut())}),a(),O(),a(),r(11,"div",13)(12,"label",10),p(13," Data Visualization Type "),a(),D(14,14),b(15,Qs,13,3,"ng-select",15),O(),a(),b(16,Zs,7,2,"div",16)(17,bo,3,2,"div",17)(18,Co,7,2,"div",18)(19,wo,6,3,"div",18),a(),r(20,"div",19,0),b(22,xo,2,1,"div",20),r(23,"div",21),b(24,So,2,0,"div",22),r(25,"div",23)(26,"button",24),C(27,"i",25),a(),r(28,"ul",26)(29,"li")(30,"div",27),u("click",function(){return m(o),g(i.onDownloadPng())}),p(31,"Download PNG"),a()(),r(32,"li")(33,"div",27),u("click",function(){return m(o),g(i.onDownloadCsv())}),p(34,"Download CSV"),a()(),r(35,"li")(36,"div",27),u("click",function(){return m(o),g(i.onEmbed())}),p(37,"Embed Code"),a()()()(),b(38,Mo,1,3,"html-dashboard-analysis",28),a(),r(39,"ul",29)(40,"li",30),u("click",function(){return m(o),g(i.onCancel())}),p(41," Cancel "),a(),r(42,"li",30),u("click",function(){return m(o),g(i.onSave(!0))}),p(43," Add to Dashboard "),a(),r(44,"li",31),u("click",function(){return m(o),g(i.onSave(!1))}),p(45," Save "),a()()(),r(46,"div",7)(47,"h3",32),p(48," Filter Data "),a(),b(49,Oo,16,9,"div",16)(50,Eo,10,3,"div",33)(51,zo,5,1,"div",16)(52,$o,9,2,"div",16)(53,Wo,7,1,"div",17),r(54,"div",34)(55,"h4",35),p(56," Market Segments "),a(),r(57,"div",36),b(58,No,5,5,"div",37),a()(),r(59,"div",38)(60,"h4",35),p(61," Residence Type "),a(),r(62,"div",36),b(63,jo,5,5,"div",37),a()(),b(64,qo,5,1,"div",16)(65,Zo,5,2,"div",16),a()()()}t&2&&(h(10),T("ngModel",i.select.title),h(5),c("ngIf",i.isStdWidget&&i.isBrowser()),h(),c("ngIf",i.select.analysisType!=="rank"),h(),c("ngIf",i.select.analysisType!=="mai"&&i.select.analysisType!=="profile_table"),h(),c("ngIf",i.select.analysisType!=="yoy"&&i.select.analysisType!=="mai"&&i.select.analysisType!=="profile_table"),h(),c("ngIf",i.select.analysisType==="mai"||i.select.analysisType==="profile_table"),h(3),c("ngIf",i.user.isInternal),h(2),c("ngIf",i.isChartLoading),h(14),c("ngIf",i.portfolioUsage.accounts[i.activeAccount.accountIndex].accountHash),h(11),c("ngIf",i.select.analysisType==="rank"),h(),c("ngIf",i.select.analysisType==="rank"),h(),c("ngIf",i.select.analysisType==="rank"),h(),c("ngIf",i.select.analysisType==="rank"),h(),c("ngIf",i.select.analysisType==="yoy"),h(5),c("ngForOf",i.presetOptions.quartiles),h(5),c("ngForOf",i.presetOptions.resTypes),h(),c("ngIf",i.select.analysisType!=="mai"&&i.select.analysisType!=="profile_table"),h(),c("ngIf",i.select.analysisType!=="mai"&&i.select.analysisType!=="profile_table"&&i.select.chartType!=="sparkline"))},dependencies:[Dt,bt,$i,Li,Re,Ri,$e,Le,rn,on,sn,$,ce,Ct,Xi,Qi,wt,en,St,xt,he],styles:["[_nghost-%COMP%] .ng-value-label{display:flex;align-content:center;gap:10px}.t-tab-active[_ngcontent-%COMP%]{border-color:#9747ff!important}.preview-frame[_ngcontent-%COMP%]{min-height:357px;margin:auto}.new-analysis[_ngcontent-%COMP%] .switch{font-family:Hanken Grotesk,sans-serif}.new-analysis[_ngcontent-%COMP%] .switch.checked{background-color:#9747ff;color:#fff}"]})}}return s})();var zn=(()=>{class s{constructor(e,t,i,o,l){this.router=e,this.activatedRoute=t,this.mixpanelService=i,this.dataService=o,this.titleService=l,this.destroy$=new P,this.router.events.pipe(fe((_,w)=>w instanceof ve?_.url===w.url:!0)).pipe(v(this.destroy$)).subscribe(()=>{this.mixpanelService.onTrackAdmin("Analytics new analysis viewed",null)})}ngOnInit(){j(this.dataService.currentPortfolioUsage,this.dataService.currentActiveAccount).pipe(v(this.destroy$)).subscribe(e=>{let t=e[0],i=e[1];t.accounts[i.accountIndex]&&(this.isAdmin=t.accounts[i.accountIndex].isAccountAdmin,this.isAdmin||this.router.navigate(["/admin/dashboard"]))}),this.dataService.currentCurrentUser.pipe(v(this.destroy$)).subscribe(e=>{this.currentUser=e,this.setMeta()})}setMeta(){let e="Altos Research | New Analysis";e+=this.currentUser.company?" | "+this.currentUser.company:"",this.titleService.setTitle(e)}static{this.\u0275fac=function(t){return new(t||s)(f(J),f(ze),f(ee),f(X),f(ye))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-analyze-widget-create"]],standalone:!1,decls:1,vars:2,consts:[[3,"isEdit","widgetUuid"]],template:function(t,i){t&1&&C(0,"admin-analyze-widget-form",0),t&2&&c("isEdit",!1)("widgetUuid",null)},dependencies:[Ye],styles:[".geo-select[_ngcontent-%COMP%]{width:calc(100% - 37px)!important}.actions[_ngcontent-%COMP%]{margin-top:15px}.preview-frame[_ngcontent-%COMP%]{border-style:solid;border-color:#d3d3d3}.global-preset-wrapper[_ngcontent-%COMP%] a.active[_ngcontent-%COMP%]{background-color:#d3d3d3}"]})}}return s})();var Rn=(()=>{class s{constructor(e,t,i,o,l,_){this.router=e,this.activatedRoute=t,this.mixpanelService=i,this.dataService=o,this.titleService=l,this.platformId=_,this.destroy$=new P,this.router.events.pipe(fe((w,x)=>x instanceof ve?w.url===x.url:!0)).pipe(v(this.destroy$)).subscribe(()=>{this.mixpanelService.onTrackAdmin("Analytics edit analysis viewed",null)})}ngOnInit(){this.widgetUuid=this.activatedRoute.snapshot.params.id,K(this.platformId)&&window.scroll(0,0),j(this.dataService.currentPortfolioUsage,this.dataService.currentActiveAccount).pipe(v(this.destroy$)).subscribe(e=>{let t=e[0],i=e[1];t.accounts[i.accountIndex]&&(this.isAdmin=t.accounts[i.accountIndex].isAccountAdmin,this.isAdmin||this.router.navigate(["/admin/dashboard"]))}),this.dataService.currentCurrentUser.pipe(v(this.destroy$)).subscribe(e=>{this.currentUser=e,this.setMeta()})}setMeta(){let e="Altos Research | Edit Analysis";e+=this.currentUser.company?" | "+this.currentUser.company:"",this.titleService.setTitle(e)}static{this.\u0275fac=function(t){return new(t||s)(f(J),f(ze),f(ee),f(X),f(ye),f(de))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-analyze-widget-edit"]],standalone:!1,decls:1,vars:2,consts:[[3,"isEdit","widgetUuid"]],template:function(t,i){t&1&&C(0,"admin-analyze-widget-form",0),t&2&&c("isEdit",!0)("widgetUuid",i.widgetUuid)},dependencies:[Ye],encapsulation:2})}}return s})();var er=(s,n,e)=>({itemsPerPage:s,currentPage:n,totalItems:e}),$n=(s,n)=>({"glyphicon-chevron-up":s,"glyphicon-chevron-down":n});
5function tr(s,n){if(s&1){let e=y();r(0,"div",12)(1,"button",13),p(2),a(),r(3,"ul",14)(4,"li")(5,"a",15),u("click",function(i){m(e);let o=d();return g(o.onSetContactsPerPage(10,i))}),p(6,"10"),a()(),r(7,"li")(8,"a",15),u("click",function(i){m(e);let o=d();return g(o.onSetContactsPerPage(25,i))}),p(9,"25"),a()(),r(10,"li")(11,"a",15),u("click",function(i){m(e);let o=d();return g(o.onSetContactsPerPage(100,i))}),p(12,"100"),a()()()()}if(s&2){let e=d();h(2),Oe(" ",e.totalItems," widgets (",e.pageSize," per page) ")}}function ir(s,n){if(s&1){let e=y();r(0,"input",24),u("click",function(i){m(e);let o=d(2);return g(o.onToggleSelected(i.target.checked))}),a()}if(s&2){let e=d(2);c("checked",e.allSelected)}}function nr(s,n){s&1&&C(0,"span",25)}function sr(s,n){if(s&1&&C(0,"span",26),s&2){let e=d(2);c("ngClass",Vt(1,$n,e.sortReverse,!e.sortReverse))}}function or(s,n){s&1&&C(0,"span",25)}function rr(s,n){if(s&1&&C(0,"span",26),s&2){let e=d(2);c("ngClass",Vt(1,$n,e.sortReverse,!e.sortReverse))}}function ar(s,n){if(s&1){let e=y();r(0,"input",34),u("change",function(i){m(e);let o=d(),l=o.$implicit,_=o.index,w=d(2);return g(w.onSelectWidget(_,l.uuid,i.target.checked))}),a()}if(s&2){let e=d(),t=e.$implicit,i=e.index,o=d(2);c("id",i)("checked",o.selectedWidgetUuids.has(t.uuid))}}function lr(s,n){if(s&1){let e=y();r(0,"tr",27)(1,"td"),b(2,ar,1,2,"input",28),a(),r(3,"td")(4,"a",29),p(5),a()(),r(6,"td"),p(7),a(),r(8,"td"),p(9),a(),r(10,"td"),p(11),ne(12,"date"),a(),r(13,"td")(14,"div",30)(15,"label",31)(16,"span",32),p(17),a(),r(18,"input",33),u("change",function(i){let o=m(e).$implicit,l=d(2);return g(l.onDashboardToggle(o,i))}),a()()()()()}if(s&2){let e=n.$implicit,t=d(2);h(2),c("ngIf",t.portfolioUsage&&t.activeAccount&&t.portfolioUsage.accounts[t.activeAccount.accountIndex]&&t.portfolioUsage.accounts[t.activeAccount.accountIndex].isAccountAdmin),h(2),L("href","/admin/dashboard/widget-edit/",e.uuid,"",fi),h(),V(" ",t.getTypeDisplay(e)," "),h(2),V(" ",t.statsToString(e)," "),h(2),V(" ",t.getLocationsDisplay(e)," "),h(2),V(" ",e.modifiedAt?Bt(12,9,e.modifiedAt,"mediumDate"):""," "),h(6),V(" ",e.inDashboard?"ON":"OFF"," "),h(),c("checked",e.inDashboard)}}function dr(s,n){if(s&1){let e=y();r(0,"table",16)(1,"tbody")(2,"tr",17)(3,"th",18),b(4,ir,1,1,"input",19),a(),r(5,"th"),p(6,"Type"),a(),r(7,"th"),p(8,"Stats"),a(),r(9,"th"),p(10,"Locations "),a(),r(11,"th",20),u("click",function(){m(e);let i=d();return g(i.onSetSortKey("modifiedAt"))}),p(12," Last Modified "),b(13,nr,1,0,"span",21)(14,sr,1,4,"span",22),a(),r(15,"th",20),u("click",function(){m(e);let i=d();return g(i.onSetSortKey("inDashboard"))}),p(16," Dashboard "),b(17,or,1,0,"span",21)(18,rr,1,4,"span",22),a()(),b(19,lr,19,12,"tr",23),ne(20,"orderBy"),ne(21,"paginate"),a()()}if(s&2){let e=d();h(4),c("ngIf",e.portfolioUsage&&e.activeAccount&&e.portfolioUsage.accounts[e.activeAccount.accountIndex]&&e.portfolioUsage.accounts[e.activeAccount.accountIndex].isAccountAdmin),h(9),c("ngIf",e.sortKey!="modifiedAt"),h(),c("ngIf",e.sortKey=="modifiedAt"),h(3),c("ngIf",e.sortKey!="inDashboard"),h(),c("ngIf",e.sortKey=="inDashboard"),h(),c("ngForOf",Bt(21,10,Ze(20,6,e.widgets,e.sortKey,e.sortReverse),Ci(13,er,e.pageSize,e.currentPage,e.totalItems)))}}function cr(s,n){s&1&&C(0,"div",35)}var Ln=(()=>{class s{constructor(e,t,i,o,l,_,w,x,S,k,H,q,E){this.platformId=e,this.sanitizer=t,this.adminApiService=i,this.dataService=o,this.authService=l,this.utils=_,this.mixpanelService=w,this.dashboardUtils=x,this.modalService=S,this.toastService=k,this.dashboardService=H,this.titleService=q,this.router=E,this.destroy$=new P,this.totalItems=0,this.pageSize=10,this.currentPage=1,this.sortKey="modifiedAt",this.sortReverse=!0,this.selectedWidgetUuids=new Set,this.router.events.pipe(fe((Y,z)=>z instanceof ve?Y.url===z.url:!0)).pipe(v(this.destroy$)).subscribe(Y=>{this.mixpanelService.onTrackAdmin("Analytics recent analyses viewed",null)})}ngOnInit(){j(this.dataService.currentPortfolioUsage,this.dataService.currentActiveAccount).pipe(v(this.destroy$)).subscribe(e=>{this.portfolioUsage=e[0],this.activeAccount=e[1],this.portfolioUsage.accounts!=null&&this.activeAccount.accountIndex!=null&&(this.isAdmin=this.portfolioUsage.accounts[this.activeAccount.accountIndex].isAccountAdmin,this.isAdmin||this.router.navigate(["/admin/dashboard"]),this.getReports(),this.getWidgets())}),this.dataService.currentCurrentUser.pipe(v(this.destroy$)).subscribe(e=>{this.currentUser=e,this.setMeta()}),this.dataService.currentReportsAll.pipe(v(this.destroy$)).subscribe(e=>{this.reports=e})}ngOnDestroy(){this.destroy$.next(),this.destroy$.unsubscribe(),this.getAnalysisWidgetsSub&&this.getAnalysisWidgetsSub.unsubscribe()}setMeta(){let e="Altos Research | Recent Analysis";e+=this.currentUser.company?" | "+this.currentUser.company:"",this.titleService.setTitle(e)}sanitize(e){return this.sanitizer.bypassSecurityTrustUrl(e)}getWidgets(){this.getAnalysisWidgetsSub&&this.getAnalysisWidgetsSub.unsubscribe(),this.getAnalysisWidgetsSub=this.adminApiService.getAnalysisWidgets().subscribe(e=>{this.widgets=e.widgets,this.totalItems=this.widgets.length})}getReports(){this.adminApiService.getReportsAll().pipe(v(this.destroy$)).subscribe(e=>{this.dataService.changeReportsAll(e.results)})}getTypeDisplay(e){if(e.presetParams.analysisType==="rank")return"Rank - "+(e.presetParams.isTop?"Top ":"Bottom ")+e.presetParams.nValue;if(e.presetParams.analysisType==="yoy")return"Year over Year";if(e.presetParams.analysisType==="mai")return"Market Action Index";if(e.presetParams.analysisType==="profile_table")return"Profile Table";if(e.presetParams.analysisType==="comparison")return e.presetParams.chartType==="line"?"Line Chart":"Sparkline"}getParamsDisplay(e){let t="";return e.presetParams.analysisType==="yoy"?t+="Years: "+e.presetParams.years.toString():e.presetParams.analysisType==="mai"||e.presetParams.analysisType==="profile_table"||e.presetParams.analysisType==="comparison"&&e.presetParams.chartType,t}getLocationsDisplay(e){let t="";return e.presetParams.analysisType!=="rank"&&this.reports&&this.reports.length>0&&e.geoLocations.forEach(i=>
5{t=this.reports.filter(o=>o.hash==i).map(o=>o.displayName).toString()},this),t}onDashboardToggle(e,t){if(t.target.checked){let o={chartUuid:e.uuid,dashboardLocation:{x:0,y:0,cols:this.dashboardUtils.getDashboardCols(e.presetParams),rows:this.dashboardUtils.getDashboardRows(e.presetParams)},dashboardSize:{ratio:this.dashboardUtils.getDashboardRatio(e.presetParams),width:this.dashboardUtils.getDashboardWidth(e.presetParams)}};this.adminApiService.postAddChartToDashboard(o).pipe(v(this.destroy$)).subscribe(l=>{console.log(e),e.inDashboard=!0})}else console.log(e),this.adminApiService.deleteDashboardItem(e.dashboardUuid).pipe(v(this.destroy$)).subscribe(o=>{this.toastService.showSuccessToast("Successfully removed widget from dashboard."),e.inDashboard=!1},o=>{this.toastService.showErrorToast("Error removing widget from dashboard.")})}onPageChanged(e){this.selectedWidgetUuids.clear(),this.allSelected=!1,this.currentPage=e}onSetContactsPerPage(e,t){t.preventDefault(),this.pageSize=e,this.handleClick()}statsToString(e){let t;return e.presetParams.analysisType!=="mai"&&e.presetParams.analysisType!=="profile_table"&&(t=e.presetParams.stats.map(i=>this.dashboardService.columnToDisplayText(i)).toString()),t}onSetSortKey(e){this.sortReverse=!this.sortReverse,this.sortKey=e}onSelectWidget(e,t,i){i?this.selectedWidgetUuids.add(t):this.selectedWidgetUuids.delete(t)}onToggleSelected(e){e?(this.allSelected=!0,this.widgets.forEach(function(t,i){this.selectedWidgetUuids.add(t.uuid)},this)):(this.allSelected=!1,this.selectedWidgetUuids.clear())}onRemoveSelected(){let e=this.modalService.show(pe);e.content.setConfirmationModal("Delete Anlysis","Are you sure you want to delete the selected analyses?"),e.content.onClose.pipe(v(this.destroy$)).subscribe(t=>{if(t===!0){let i=this.widgets.filter((l,_)=>this.selectedWidgetUuids.has(l.uuid)),o={chartUuids:i.map(l=>l.uuid),dashboardUuids:i.map(l=>l.dashboardUuid?l.dashboardUuid:null).filter(l=>l!=null)};this.adminApiService.deleteAnalyses(o).pipe(v(this.destroy$)).subscribe(l=>{this.toastService.showSuccessToast("Successfully deleted selected analyses.")}),i.forEach(l=>{let _=this.widgets.findIndex(w=>l.uuid==w.uuid);this.widgets.splice(_,1)}),this.totalItems-=this.selectedWidgetUuids.size,this.selectedWidgetUuids.clear(),this.allSelected=!1}},t=>{this.toastService.showErrorToast("Error creating deleting selected analyses.")})}handleClick(){if(K(this.platformId)){let e=document.activeElement;e&&e.blur()}}static{this.\u0275fac=function(t){return new(t||s)(f(de),f(se),f(W),f(X),f(Z),f(Ce),f(ee),f(me),f(G),f(re),f(we),f(ye),f(J))}}static{this.\u0275cmp=I({type:s,selectors:[["admin-analyze-list"]],standalone:!1,decls:16,vars:4,consts:[["tableLoading",""],["id","widget_list",1,"t-mt-8","t-px-8","sm:t-px-12"],[1,"t-navbar","t-mb-4"],[1,"t-navbar-start"],["type","button",1,"t-btn","btn-purple","font-cofo-mono","t-text-[14px]","disabled:t-opacity-50",3,"click","disabled"],[1,"t-navbar-center"],[1,"t-navbar-end"],["class","t-dropdown t-dropdown-end t-my-8",4,"ngIf"],[1,"t-flex","t-flex-col","t-overflow-x-auto","t-overflow-y-hidden","md:t-overflow-x-visible","md:t-overflow-y-visible"],["class","t-table t-bg-white t-rounded-2xl font-inter",4,"ngIf","ngIfElse"],[1,"t-flex","t-justify-center"],["maxSize","4","directionLinks","true","autoHide","true","previousLabel","Previous","nextLabel","Next","screenReaderPaginationLabel","Pagination","screenReaderPageLabel","page","screenReaderCurrentLabel","You're on page",1,"pagination",3,"pageChange"],[1,"t-dropdown","t-dropdown-end","t-my-8"],[1,"t-btn","font-cofo-mono","t-text-[13px]","t-w-[220px]","sm:t-w-auto"],[1,"t-dropdown-content","t-menu","t-bg-base-100","t-rounded-box","t-z-10","t-w-64","t-p-2","t-shadow","t-text-[14px]"],["href","#",3,"click"],[1,"t-table","t-bg-white","t-rounded-2xl","font-inter"],[1,"font-inter","t-text-gray-400","t-font-bold","t-h-[40px]","t-text-[13px]"],[1,"t-cursor-pointer","hover:t-text-gray-600","t-transition"],["type","checkbox","id","toggle-selected","class","checkbox-navy t-checkbox-lg",3,"checked","click",4,"ngIf"],[1,"t-cursor-pointer","hover:t-text-gray-600","t-transition",3,"click"],["class","glyphicon glyphicon-sort-by-attributes-alt",4,"ngIf"],["class","glyphicon sort-icon",3,"ngClass",4,"ngIf"],["class","t-text-[14px] font-inter t-h-[70px]",4,"ngFor","ngForOf"],["type","checkbox","id","toggle-selected",1,"checkbox-navy","t-checkbox-lg",3,"click","checked"],[1,"glyphicon","glyphicon-sort-by-attributes-alt"],[1,"glyphicon","sort-icon",3,"ngClass"],[1,"t-text-[14px]","font-inter","t-h-[70px]"],["type","checkbox","class","checkbox-navy t-checkbox-lg",3,"id","checked","change",4,"ngIf"],[1,"t-text-black","t-font-bold",3,"href"],[1,"t-form-control"],[1,"t-label","t-cursor-pointer","t-justify-start","t-gap-x-4"],[1,"t-label-text","t-text-[14px]","font-inter","t-font-light"],["type","checkbox",1,"t-toggle","t-toggle-lg","t-border-gray-400","t-bg-gray-400","checked:bg-lavender","[--tglbg:white]","hover:bg-blue-700",3,"change","checked"],["type","checkbox",1,"checkbox-navy","t-checkbox-lg",3,"change","id","checked"],[1,"t-skeleton","t-h-[750px]","t-w-full","t-mt-5"]],template:function(t,i){if(t&1){let o=y();C(0,"admin-dashboard-nav"),r(1,"div",1)(2,"div",2)(3,"div",3)(4,"button",4),u("click",function(){return m(o),g(i.selectedWidgetUuids.size>0&&i.onRemoveSelected())}),p(5," Delete "),a()(),C(6,"div",5),r(7,"div",6),b(8,tr,13,2,"div",7),a()(),r(9,"div",8),b(10,dr,22,17,"table",9)(11,cr,1,0,"ng-template",null,0,wi),a(),r(13,"div",10)(14,"div",10)(15,"pagination-controls",11),u("pageChange",function(_){return m(o),g(i.onPageChanged(_))}),a()()()()}if(t&2){let o=yi(12);h(4),c("disabled",i.selectedWidgetUuids.size==null||i.selectedWidgetUuids.size==0),h(4),c("ngIf",i.totalItems>10),h(2),c("ngIf",i.widgets&&i.portfolioUsage.accounts&&i.activeAccount)("ngIfElse",o)}},dependencies:[ce,he,$,Dt,Ki,Ii,qi,cn],styles:[".t-toggle-lg[_ngcontent-%COMP%]{--handleoffset: 2.5rem;height:3rem;width:5.5rem}.t-dropdown-content[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1));font-family:Hanken Grotesk,sans-serif}"]})}}return s})();var wd=(()=>{class s{static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275mod=ft({type:s})}static{this.\u0275inj=pt({imports:[Ai,Pt,ln,an,bt,Ye,Vi,Oi,Bi.forRoot(),Gi.forRoot(),
5Ct.forRoot(),Ji,hn,ji,St,wt,Sn,Zi,Ei,vt,Fi.forChild([{path:"",component:In,children:[{path:"",component:On},{path:"widget-create",component:zn},{path:"widget-edit/:id",component:Rn},{path:"widgets",component:Ln},{path:"**",redirectTo:""}]}])]})}}return s})();export{wd as DashboardModule};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.