vendor: 5,005 bytes, line 1
1import{a as ot}from"./chunk-MAMFLHKE.js";import{c as Ui,d as qi,f as jt,g as Qi,k as rn,l as ro}from"./chunk-GWLVIRI5.js";import{a as oo}from"./chunk-27BCARM7.js";import{a as Zt}from"./chunk-QEHL4RNB.js";import{a as gi}from"./chunk-ZXWVDQPO.js";import{a as ft}from"./chunk-3VEEXYI6.js";import{$e as on,Bc as qs,C as Gs,Ca as Ws,Cc as Qs,D as Hs,Dc as Ks,Ea as ea,Ec as Zs,G as Xs,H as Ys,Jb as an,Lb as Us,O as zs,Oe as no,Pb as me,Qb as kt,Tb as fe,Ue as ao,Ve as so,Xa as ta,Ya as js,ab as Kt,da as en,ea as Qt,ga as gt,hc as Ee,me as Js,oe as eo,pe as to,rb as ia,s as Ps,ta as tn,ua as $s,w as Vs,xe as io,zc as sn}from"./chunk-LSEEKP5Z.js";import{X as Ds,Z as q,aa as Es,ba as Bs,ga as Ns,la as Ms,ma as Fs,sa as Rs,ua as Os,wa as qt}from"./chunk-KLMY5WXS.js";import{c as nn}from"./chunk-2HBVDDJY.js";import"./chunk-L4OM4CP7.js";import{c as he}from"./chunk-35H7FDEF.js";import{$ as ms,$a as T,$b as ce,A as hs,Bc as U,Bd as $,Cb as Z,Cd as Jn,Da as qn,Db as Fe,Ea as S,Eb as $t,Ga as _s,Gb as Kn,Gd as ht,Hb as p,Hd as Ue,Ia as O,Ib as C,Ja as se,Jb as D,Jd as mt,Ka as Qn,Kb as V,Lb as Zn,Mc as Ge,Na as xs,Nc as pt,Oa as R,Oc as je,Pd as ks,Q as be,Qc as Wi,R as ne,Rd as He,Sa as vs,T as pe,Tc as As,U as Q,Ud as ui,Vb as Ts,X as w,Xa as Y,Xb as Ss,Y as I,Yc as ws,Z as M,Za as b,Zb as G,_b as F,_c as mi,ac as hi,ad as st,ba as us,bb as we,bc as Ls,bd as ji,ca as z,cb as Ie,da as Un,db as ke,eb as _,fb as l,gb as c,hb as y,hc as g,ic as f,jc as Le,jd as Wt,ka as ae,kd as Is,la as gs,lb as $e,lc as It,ma as nt,mb as We,nb as at,ob as E,od as ee,pa as Yt,pd as te,pe as Zi,qb as k,re as Ji,sa as le,sb as u,se as K,t as ps,ta as zt,tb as Cs,td as Ut,te as j,ub as ys,ud as Ki,ue as ut,vb as bs,wa as $i,wb as De,xa as fs,xb as Te,ya as o,yb as Se}from"./chunk-7FGYDUXA.js";import{b as ds}from"./chunk-WFMAM73Y.js";import{a as ze}from"./chunk-E5HSK5QB.js";var ln="http://www.w3.org/1999/xhtml",na={svg:"http://www.w3.org/2000/svg",xhtml:ln,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function rt(t){var a=t+="",e=a.indexOf(":");return e>=0&&(a=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),na.hasOwnProperty(a)?{space:na[a],local:t}:t}function nc(t){return function(){var a=this.ownerDocument,e=this.namespaceURI;return e===ln&&a.documentElement.namespaceURI===ln?a.createElement(t):a.createElementNS(e,t)}}function ac(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function cn(t){var a=rt(t);return(a.local?ac:nc)(a)}function sc(){}function Dt(t){return t==null?sc:function(){return this.querySelector(t)}}function lo(t){typeof t!="function"&&(t=Dt(t));for(var a=this._groups,e=a.length,i=new Array(e),n=0;n<e;++n)for(var s=a[n],r=s.length,d=i[n]=new Array(r),m,h,x=0;x<r;++x)(m=s[x])&&(h=t.call(m,m.__data__,x,s))&&("__data__"in m&&(h.__data__=m.__data__),d[x]=h);return new ie(i,this._parents)}function aa(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function oc(){return[]}function fi(t){return t==null?oc:function(){return this.querySelectorAll(t)}}function rc(t){return function(){return aa(t.apply(this,arguments))}}function co(t){typeof t=="function"?t=rc(t):t=fi(t);for(var a=this._groups,e=a.length,i=[],n=[],s=0;s<e;++s)for(var r=a[s],d=r.length,m,h=0;h<d;++h)(m=r[h])&&(i.push(t.call(m,m.__data__,h,r)),n.push(m));return new ie(i,n)}function _i(t){return function(){return this.matches(t)}}function dn(t){return function(a){return a.matches(t)}}var lc=Array.prototype.find;function cc(t){return function(){return lc.call(this.children,t)}}function dc(){return this.firstElementChild}function po(t){return this.select(t==null?dc:cc(typeof t=="function"?t:dn(t)))}var pc=Array.prototype.filter;function hc(){return Array.from(this.children)}function mc(t){return function(){return pc.call(this.children,t)}}function ho(t){return this.selectAll(t==null?hc:mc(typeof t=="function"?t:dn(t)))}function mo(t){typeof t!="function"&&(t=_i(t));for(var a=this._groups,e=a.length,i=new Array(e),n=0;n<e;++n)for(var s=a[n],r=s.length,d=i[n]=[],m,h=0;h<r;++h)(m=s[h])&&t.call(m,m.__data__,h,s)&&d.push(m);return new ie(i,this._parents)}function pn(t){return new Array(t.length)}function uo(){return new ie(this._enter||this._groups.map(pn),this._parents)}function xi(t,a){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=a}xi.prototype={constructor:xi,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,a){return this._parent.insertBefore(t,a)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function go(t){return function(){return t}}function uc(t,a,e,i,n,s){for(var r=0,d,m=a.length,h=s.length;r<h;++r)(d=a[r])?(d.__data__=s[r],i[r]=d):e[r]=new xi(t,s[r]);for(;r<m;++r)(d=a[r])&&(n[r]=d)}function gc(t,a,e,i,n,s,r){var d,m,h=new Map,x=a.length,v=s.length,L=new Array(x),A;for(d=0;d<x;
vendor: 31,445 bytes, line 1
1++d)(m=a[d])&&(L[d]=A=r.call(m,m.__data__,d,a)+"",h.has(A)?n[d]=m:h.set(A,m));for(d=0;d<v;++d)A=r.call(t,s[d],d,s)+"",(m=h.get(A))?(i[d]=m,m.__data__=s[d],h.delete(A)):e[d]=new xi(t,s[d]);for(d=0;d<x;++d)(m=a[d])&&h.get(L[d])===m&&(n[d]=m)}function fc(t){return t.__data__}function fo(t,a){if(!arguments.length)return Array.from(this,fc);var e=a?gc:uc,i=this._parents,n=this._groups;typeof t!="function"&&(t=go(t));for(var s=n.length,r=new Array(s),d=new Array(s),m=new Array(s),h=0;h<s;++h){var x=i[h],v=n[h],L=v.length,A=_c(t.call(x,x&&x.__data__,h,i)),B=A.length,N=d[h]=new Array(B),P=r[h]=new Array(B),re=m[h]=new Array(L);e(x,v,N,P,re,A,a);for(var ve=0,ye=0,ge,Ce;ve<B;++ve)if(ge=N[ve]){for(ve>=ye&&(ye=ve+1);!(Ce=P[ye])&&++ye<B;);ge._next=Ce||null}}return r=new ie(r,i),r._enter=d,r._exit=m,r}function _c(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function _o(){return new ie(this._exit||this._groups.map(pn),this._parents)}function xo(t,a,e){var i=this.enter(),n=this,s=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),a!=null&&(n=a(n),n&&(n=n.selection())),e==null?s.remove():e(s),i&&n?i.merge(n).order():n}function vo(t){for(var a=t.selection?t.selection():t,e=this._groups,i=a._groups,n=e.length,s=i.length,r=Math.min(n,s),d=new Array(n),m=0;m<r;++m)for(var h=e[m],x=i[m],v=h.length,L=d[m]=new Array(v),A,B=0;B<v;++B)(A=h[B]||x[B])&&(L[B]=A);for(;m<n;++m)d[m]=e[m];return new ie(d,this._parents)}function Co(){for(var t=this._groups,a=-1,e=t.length;++a<e;)for(var i=t[a],n=i.length-1,s=i[n],r;--n>=0;)(r=i[n])&&(s&&r.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(r,s),s=r);return this}function yo(t){t||(t=xc);function a(v,L){return v&&L?t(v.__data__,L.__data__):!v-!L}for(var e=this._groups,i=e.length,n=new Array(i),s=0;s<i;++s){for(var r=e[s],d=r.length,m=n[s]=new Array(d),h,x=0;x<d;++x)(h=r[x])&&(m[x]=h);m.sort(a)}return new ie(n,this._parents).order()}function xc(t,a){return t<a?-1:t>a?1:t>=a?0:NaN}function bo(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function To(){return Array.from(this)}function So(){for(var t=this._groups,a=0,e=t.length;a<e;++a)for(var i=t[a],n=0,s=i.length;n<s;++n){var r=i[n];if(r)return r}return null}function Lo(){let t=0;for(let a of this)++t;return t}function Ao(){return!this.node()}function wo(t){for(var a=this._groups,e=0,i=a.length;e<i;++e)for(var n=a[e],s=0,r=n.length,d;s<r;++s)(d=n[s])&&t.call(d,d.__data__,s,n);return this}function vc(t){return function(){this.removeAttribute(t)}}function Cc(t){return function(){this.removeAttributeNS(t.space,t.local)}}function yc(t,a){return function(){this.setAttribute(t,a)}}function bc(t,a){return function(){this.setAttributeNS(t.space,t.local,a)}}function Tc(t,a){return function(){var e=a.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function Sc(t,a){return function(){var e=a.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Io(t,a){var e=rt(t);if(arguments.length<2){var i=this.node();return e.local?i.getAttributeNS(e.space,e.local):i.getAttribute(e)}return this.each((a==null?e.local?Cc:vc:typeof a=="function"?e.local?Sc:Tc:e.local?bc:yc)(e,a))}function hn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Lc(t){return function(){this.style.removeProperty(t)}}function Ac(t,a,e){return function(){this.style.setProperty(t,a,e)}}function wc(t,a,e){return function(){var i=a.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,e)}}function ko(t,a,e){return arguments.length>1?this.each((a==null?Lc:typeof a=="function"?wc:Ac)(t,a,e??"")):_t(this.node(),t)}function _t(t,a){return t.style.getPropertyValue(a)||hn(t).getComputedStyle(t,null).getPropertyValue(a)}function Ic(t){return function(){delete this[t]}}function kc(t,a){return function(){this[t]=a}}function Dc(t,a){return function(){var e=a.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function Do(t,a){return arguments.length>1?this.each((a==null?Ic:typeof a=="function"?Dc:kc)(t,a)):this.node()[t]}function Eo(t){return t.trim().split(/^|\s+/)}function sa(t){return t.classList||new Bo(t)}function Bo(t){this._node=t,this._names=Eo(t.getAttribute("class")||"")}Bo.prototype={add:function(t){var a=this._names.indexOf(t);a<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var a=this._names.indexOf(t);a>=0&&(this._names.splice(a,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function No(t,a){for(var e=sa(t),i=-1,n=a.length;++i<n;)e.add(a[i])}function Mo(t,a){for(var e=sa(t),i=-1,n=a.length;++i<n;)e.remove(a[i])}function Ec(t){return function(){No(this,t)}}function Bc(t){return function(){Mo(this,t)}}function Nc(t,a){return function(){(a.apply(this,arguments)?No:Mo)(this,t)}}function Fo(t,a){var e=Eo(t+"");if(arguments.length<2){for(var i=sa(this.node()),n=-1,s=e.length;++n<s;)if(!i.contains(e[n]))return!1;return!0}return this.each((typeof a=="function"?Nc:a?Ec:Bc)(e,a))}function Mc(){this.textContent=""}function Fc(t){return function(){this.textContent=t}}function Rc(t){return function(){var a=t.apply(this,arguments);this.textContent=a??""}}function Ro(t){return arguments.length?this.each(t==null?Mc:(typeof t=="function"?Rc:Fc)(t)):this.node().textContent}function Oc(){this.innerHTML=""}function Pc(t){return function(){this.innerHTML=t}}function Vc(t){return function(){var a=t.apply(this,arguments);this.innerHTML=a??""}}function Oo(t){return arguments.length?this.each(t==null?Oc:(typeof t=="function"?Vc:Pc)(t)):this.node().innerHTML}function Gc(){this.nextSibling&&this.parentNode.appendChild(this)}function Po(){return this.each(Gc)}function Hc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Vo(){return this.each(Hc)}function Go(t){var a=typeof t=="function"?t:cn(t);return this.select(function(){return this.appendChild(a.apply(this,arguments))})}function Xc(){return null}function Ho(t,a){var e=typeof t=="function"?t:cn(t),i=a==null?Xc:typeof a=="function"?a:Dt(a);return this.select(function(){return this.insertBefore(e.apply(this,arguments),i.apply(this,arguments)||null)})}function Yc(){var t=this.parentNode;t&&t.removeChild(this)}function Xo(){return this.each(Yc)}function zc(){var t=this.cloneNode(!1),a=this.parentNode;return a?a.insertBefore(t,this.nextSibling):t}function $c(){var t=this.cloneNode(!0),a=this.parentNode;return a?a.insertBefore(t,this.nextSibling):t}function Yo(t){return this.select(t?$c:zc)}function zo(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Wc(t){return function(a){t.call(this,a,this.__data__)}}function jc(t){return t.trim().split(/^|\s+/).map(function(a){var e="",i=a.indexOf(".");return i>=0&&(e=a.slice(i+1),a=a.slice(0,i)),{type:a,name:e}})}function Uc(t){return function(){var a=this.__on;if(a){for(var e=0,i=-1,n=a.length,s;e<n;++e)s=a[e],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):a[++i]=s;++i?a.length=i:delete this.__on}}}function qc(t,a,e){return function(){var i=this.__on,n,s=Wc(a);if(i){for(var r=0,d=i.length;r<d;++r)if((n=i[r]).type===t.type&&n.name===t.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=s,n.options=e),n.value=a;return}}this.addEventListener(t.type,s,e),n={type:t.type,name:t.name,value:a,listener:s,options:e},i?i.push(n):this.__on=[n]}}function $o(t,a,e){var i=jc(t+""),n,s=i.length,r;if(arguments.length<2){var d=this.node().__on;if(d){for(var m=0,h=d.length,x;m<h;++m)for(n=0,x=d[m];n<s;++n)if((r=i[n]).type===x.type&&r.name===x.name)return x.value}return}for(d=a?qc:Uc,n=0;n<s;++n)this.each(d(i[n],a,e));return this}function Wo(t,a,e){var i=hn(t),n=i.CustomEvent;typeof n=="function"?n=new n(a,e):(n=i.document.createEvent("Event"),e?(n.initEvent(a,e.bubbles,e.cancelable),n.detail=e.detail):n.initEvent(a,!1,!1)),t.dispatchEvent(n)}function Qc(t,a){return function(){return Wo(this,t,a)}}function Kc(t,a){return function(){return Wo(this,t,a.apply(this,arguments))}}function jo(t,a){return this.each((typeof a=="function"?Kc:Qc)(t,a))}function*Uo(){for(var t=this._groups,a=0,e=t.length;a<e;++a)for(var i=t[a],n=0,s=i.length,r;n<s;++n)(r=i[n])&&(yield r)}var oa=[null];function ie(t,a){this._groups=t,this._parents=a}function qo(){return new ie([[document.documentElement]],oa)}function Zc(){return this}ie.prototype=qo.prototype={constructor:ie,select:lo,selectAll:co,selectChild:po,selectChildren:ho,filter:mo,data:fo,enter:uo,exit:_o,join:xo,merge:vo,selection:Zc,order:Co,sort:yo,call:bo,nodes:To,node:So,size:Lo,empty:Ao,each:wo,attr:Io,style:ko,property:Do,classed:Fo,text:Ro,html:Oo,raise:Po,lower:Vo,append:Go,insert:Ho,remove:Xo,clone:Yo,datum:zo,on:$o,dispatch:jo,[Symbol.iterator]:Uo};var lt=qo;function ra(t){return typeof t=="string"?new ie([[document.querySelector(t)]],[document.documentElement]):new ie([[t]],oa)}var Jc={value:()=>{}};function Ko(){for(var t=0,a=arguments.length,e={},i;t<a;++t){if(!(i=arguments[t]+"")||i in e||/[\s.]/.test(i))throw new Error("illegal type: "+i);e[i]=[]}return new mn(e)}function mn(t){this._=t}function ed(t,a){return t.trim().split(/^|\s+/).map(function(e){var i="",n=e.indexOf(".");if(n>=0&&(i=e.slice(n+1),e=e.slice(0,n)),e&&!a.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:i}})}mn.prototype=Ko.prototype={constructor:mn,on:function(t,a){var e=this._,i=ed(t+"",e),n,s=-1,r=i.length;if(arguments.length<2){for(;++s<r;)if((n=(t=i[s]).type)&&(n=td(e[n],t.name)))return n;return}if(a!=null&&typeof a!="function")throw new Error("invalid callback: "+a);for(;++s<r;)if(n=(t=i[s]).type)e[n]=Qo(e[n],t.name,a);else if(a==null)for(n in e)e[n]=Qo(e[n],t.name,null);return this},copy:function(){var t={},a=this._;for(var e in a)t[e]=a[e].slice();return new mn(t)},call:function(t,a){if((n=arguments.length-2)>0)for(var e=new Array(n),i=0,n,s;i<n;++i)e[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],i=0,n=s.length;i<n;++i)s[i].value.apply(a,e)},apply:function(t,a,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],n=0,s=i.length;n<s;++n)i[n].value.apply(a,e)}};function td(t,a){for(var e=0,i=t.length,n;e<i;++e)if((n=t[e]).name===a)return n.value}function Qo(t,a,e){for(var i=0,n=t.length;i<n;++i)if(t[i].name===a){t[i]=Jc,t=t.slice(0,i).concat(t.slice(i+1));break}return e!=null&&t.push({name:a,value:e}),t}var la=Ko;function un(t,a,e){t.prototype=a.prototype=e,e.constructor=t}function ca(t,a){var e=Object.create(t.prototype);for(var i in a)e[i]=a[i];return e}function yi(){}var vi=.7,_n=1/vi,Jt="\\s*([+-]?\\d+)\\s*",Ci="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",id=/^#([0-9a-f]{3,8})$/,nd=new RegExp(`^rgb\\(${Jt},${Jt},${Jt}\\)$`),ad=new RegExp(`^rgb\\(${Ze},${Ze},${Ze}\\)$`),sd=new RegExp(`^rgba\\(${Jt},${Jt},${Jt},${Ci}\\)$`),od=new RegExp(`^rgba\\(${Ze},${Ze},${Ze},${Ci}\\)$`),rd=new RegExp(`^hsl\\(${Ci},${Ze},${Ze}\\)$`),ld=new RegExp(`^hsla\\(${Ci},${Ze},${Ze},${Ci}\\)$`),Zo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};un(yi,Qe,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Jo,formatHex:Jo,formatHex8:cd,formatHsl:dd,formatRgb:er,toString:er});function Jo(){return this.rgb().formatHex()}function cd(){return this.rgb().formatHex8()}function dd(){return or(this).formatHsl()}function er(){return this.rgb().formatRgb()}function Qe(t){var a,e;return t=(t+"").trim().toLowerCase(),(a=id.exec(t))?(e=a[1].length,a=parseInt(a[1],16),e===6?tr(a):e===3?new Be(a>>8&15|a>>4&240,a>>4&15|a&240,(a&15)<<4|a&15,1):e===8?gn(a>>24&255,a>>16&255,a>>8&255,(a&255)/255):e===4?gn(a>>12&15|a>>8&240,a>>8&15|a>>4&240,a>>4&15|a&240,((a&15)<<4|a&15)/255):null):(a=nd.exec(t))?new Be(a[1],a[2],a[3],1):(a=ad.exec(t))?new Be(a[1]*255/100,a[2]*255/100,a[3]*255/100,1):(a=sd.exec(t))?gn(a[1],a[2],a[3],a[4]):(a=od.exec(t))?gn(a[1]*255/100,a[2]*255/100,a[3]*255/100,a[4]):(a=rd.exec(t))?ar(a[1],a[2]/100,a[3]/100,1):(a=ld.exec(t))?ar(a[1],a[2]/100,a[3]/100,a[4]):Zo.hasOwnProperty(t)?tr(Zo[t]):t==="transparent"?new Be(NaN,NaN,NaN,0):null}function tr(t){return new Be(t>>16&255,t>>8&255,t&255,1)}function gn(t,a,e,i){return i<=0&&(t=a=e=NaN),new Be(t,a,e,i)}function pd(t){return t instanceof yi||(t=Qe(t)),t?(t=t.rgb(),new Be(t.r,t.g,t.b,t.opacity)):new Be}function ei(t,a,e,i){return arguments.length===1?pd(t):new Be(t,a,e,i??1)}function Be(t,a,e,i){this.r=+t,this.g=+a,this.b=+e,this.opacity=+i}un(Be,ei,ca(yi,{brighter(t){return t=t==null?_n:Math.pow(_n,t),new Be(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?vi:Math.pow(vi,t),new Be(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Be(Bt(this.r),Bt(this.g),Bt(this.b),xn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ir,formatHex:ir,formatHex8:hd,formatRgb:nr,toString:nr}));function ir(){return`#${Et(this.r)}${Et(this.g)}${Et(this.b)}`}function hd(){return`#${Et(this.r)}${Et(this.g)}${Et(this.b)}${Et((isNaN(this.opacity)?1:this.opacity)*255)}`}function nr(){let t=xn(this.opacity);return`${t===1?"rgb(":"rgba("}${Bt(this.r)}, ${Bt(this.g)}, ${Bt(this.b)}${t===1?")":`, ${t})`}`}function xn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Bt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Et(t){return t=Bt(t),(t<16?"0":"")+t.toString(16)}function ar(t,a,e,i){return i<=0?t=a=e=NaN:e<=0||e>=1?t=a=NaN:a<=0&&(t=NaN),new qe(t,a,e,i)}function or(t){if(t instanceof qe)return new qe(t.h,t.s,t.l,t.opacity);if(t instanceof yi||(t=Qe(t)),!t)return new qe;if(t instanceof qe)return t;t=t.rgb();var a=t.r/255,e=t.g/255,i=t.b/255,n=Math.min(a,e,i),s=Math.max(a,e,i),r=NaN,d=s-n,m=(s+n)/2;return d?(a===s?r=(e-i)/d+(e<i)*6:e===s?r=(i-a)/d+2:r=(a-e)/d+4,d/=m<.5?s+n:2-s-n,r*=60):d=m>0&&m<1?0:r,new qe(r,d,m,t.opacity)}function rr(t,a,e,i){return arguments.length===1?or(t):new qe(t,a,e,i??1)}function qe(t,a,e,i){this.h=+t,this.s=+a,this.l=+e,this.opacity=+i}un(qe,rr,ca(yi,{brighter(t){return t=t==null?_n:Math.pow(_n,t),new qe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?vi:Math.pow(vi,t),new qe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,a=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*a,n=2*e-i;return new Be(da(t>=240?t-240:t+120,n,i),da(t,n,i),da(t<120?t+240:t-120,n,i),this.opacity)},clamp(){return new qe(sr(this.h),fn(this.s),fn(this.l),xn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=xn(this.opacity);return`${t===1?"hsl(":"hsla("}${sr(this.h)}, ${fn(this.s)*100}%, ${fn(this.l)*100}%${t===1?")":`, ${t})`}`}}));function sr(t){return t=(t||0)%360,t<0?t+360:t}function fn(t){return Math.max(0,Math.min(1,t||0))}function da(t,a,e){return(t<60?a+(e-a)*t/60:t<180?e:t<240?a+(e-a)*(240-t)/60:a)*255}function pa(t,a,e,i,n){var s=t*t,r=s*t;return((1-3*t+3*s-r)*a+(4-6*s+3*r)*e+(1+3*t+3*s-3*r)*i+r*n)/6}function lr(t){var a=t.length-1;return function(e){var i=e<=0?e=0:e>=1?(e=1,a-1):Math.floor(e*a),n=t[i],s=t[i+1],r=i>0?t[i-1]:2*n-s,d=i<a-1?t[i+2]:2*s-n;return pa((e-i/a)*a,r,n,s,d)}}function cr(t){var a=t.length;return function(e){var i=Math.floor(((e%=1)<0?++e:e)*a),n=t[(i+a-1)%a],s=t[i%a],r=t[(i+1)%a],d=t[(i+2)%a];return pa((e-i/a)*a,n,s,r,d)}}var bi=t=>()=>t;function md(t,a){return function(e){return t+e*a}}function ud(t,a,e){return t=Math.pow(t,e),a=Math.pow(a,e)-t,e=1/e,function(i){return Math.pow(t+i*a,e)}}function dr(t){return(t=+t)==1?vn:function(a,e){return e-a?ud(a,e,t):bi(isNaN(a)?e:a)}}function vn(t,a){var e=a-t;return e?md(t,e):bi(isNaN(t)?a:t)}var Nt=(function t(a){var e=dr(a);function i(n,s){var r=e((n=ei(n)).r,(s=ei(s)).r),d=e(n.g,s.g),m=e(n.b,s.b),h=vn(n.opacity,s.opacity);return function(x){return n.r=r(x),n.g=d(x),n.b=m(x),n.opacity=h(x),n+""}}return i.gamma=t,i})(1);function pr(t){return function(a){var e=a.length,i=new Array(e),n=new Array(e),s=new Array(e),r,d;for(r=0;r<e;++r)d=ei(a[r]),i[r]=d.r||0,n[r]=d.g||0,s[r]=d.b||0;return i=t(i),n=t(n),s=t(s),d.opacity=1,function(m){return d.r=i(m),d.g=n(m),d.b=s(m),d+""}}}var gd=pr(lr),fd=pr(cr);function hr(t,a){a||(a=[]);var e=t?Math.min(a.length,t.length):0,i=a.slice(),n;return function(s){for(n=0;n<e;++n)i[n]=t[n]*(1-s)+a[n]*s;return i}}function mr(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ur(t,a){var e=a?a.length:0,i=t?Math.min(e,t.length):0,n=new Array(i),s=new Array(e),r;for(r=0;r<i;++r)n[r]=Mt(t[r],a[r]);for(;r<e;++r)s[r]=a[r];return function(d){for(r=0;r<i;++r)s[r]=n[r](d);return s}}function gr(t,a){var e=new Date;return t=+t,a=+a,function(i){return e.setTime(t*(1-i)+a*i),e}}function _e(t,a){return t=+t,a=+a,function(e){return t*(1-e)+a*e}}function fr(t,a){var e={},i={},n;(t===null||typeof t!="object")&&(t={}),(a===null||typeof a!="object")&&(a={});for(n in a)n in t?e[n]=Mt(t[n],a[n]):i[n]=a[n];return function(s){for(n in e)i[n]=e[n](s);return i}}var ma=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ha=new RegExp(ma.source,"g");function _d(t){return function(){return t}}function xd(t){return function(a){return t(a)+""}}function Ti(t,a){var e=ma.lastIndex=ha.lastIndex=0,i,n,s,r=-1,d=[],m=[];for(t=t+"",a=a+"";(i=ma.exec(t))&&(n=ha.exec(a));)(s=n.index)>e&&(s=a.slice(e,s),d[r]?d[r]+=s:d[++r]=s),(i=i[0])===(n=n[0])?d[r]?d[r]+=n:d[++r]=n:(d[++r]=null,m.push({i:r,x:_e(i,n)})),e=ha.lastIndex;return e<a.length&&(s=a.slice(e),d[r]?d[r]+=s:d[++r]=s),d.length<2?m[0]?xd(m[0].x):_d(a):(a=m.length,function(h){for(var x=0,v;x<a;++x)d[(v=m[x]).i]=v.x(h);return d.join("")})}function Mt(t,a){var e=typeof a,i;return a==null||e==="boolean"?bi(a):(e==="number"?_e:e==="string"?(i=Qe(a))?(a=i,Nt):Ti:a instanceof Qe?Nt:a instanceof Date?gr:mr(a)?hr:Array.isArray(a)?ur:typeof a.valueOf!="function"&&typeof a.toString!="function"||isNaN(a)?fr:_e)(t,a)}function ua(t,a){return t=+t,a=+a,function(e){return Math.round(t*(1-e)+a*e)}}var _r=180/Math.PI,Cn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ga(t,a,e,i,n,s){var r,d,m;return(r=Math.sqrt(t*t+a*a))&&(t/=r,a/=r),(m=t*e+a*i)&&(e-=t*m,i-=a*m),(d=Math.sqrt(e*e+i*i))&&(e/=d,i/=d,m/=d),t*i<a*e&&(t=-t,a=-a,m=-m,r=-r),{translateX:n,translateY:s,rotate:Math.atan2(a,t)*_r,skewX:Math.atan(m)*_r,scaleX:r,scaleY:d}}var yn;function xr(t){let a=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return a.isIdentity?Cn:ga(a.a,a.b,a.c,a.d,a.e,a.f)}function vr(t){return t==null?Cn:(yn||(yn=document.createElementNS("http://www.w3.org/2000/svg","g")),yn.setAttribute("transform",t),(t=yn.transform.baseVal.consolidate())?(t=t.matrix,ga(t.a,t.b,t.c,t.d,t.e,t.f)):Cn)}function Cr(t,a,e,i){function n(h){return h.length?h.pop()+" ":""}function s(h,x,v,L,A,B){if(h!==v||x!==L){var N=A.push("translate(",null,a,null,e);B.push({i:N-4,x:_e(h,v)},{i:N-2,x:_e(x,L)})}else(v||L)&&A.push("translate("+v+a+L+e)}function r(h,x,v,L){h!==x?(h-x>180?x+=360:x-h>180&&(h+=360),L.push({i:v.push(n(v)+"rotate(",null,i)-2,x:_e(h,x)})):x&&v.push(n(v)+"rotate("+x+i)}function d(h,x,v,L){h!==x?L.push({i:v.push(n(v)+"skewX(",null,i)-2,x:_e(h,x)}):x&&v.push(n(v)+"skewX("+x+i)}function m(h,x,v,L,A,B){if(h!==v||x!==L){var N=A.push(n(A)+"scale(",null,",",null,")");B.push({i:N-4,x:_e(h,v)},{i:N-2,x:_e(x,L)})}else(v!==1||L!==1)&&A.push(n(A)+"scale("+v+","+L+")")}return function(h,x){var v=[],L=[];return h=t(h),x=t(x),s(h.translateX,h.translateY,x.translateX,x.translateY,v,L),r(h.rotate,x.rotate,v,L),d(h.skewX,x.skewX,v,L),m(h.scaleX,h.scaleY,x.scaleX,x.scaleY,v,L),h=x=null,function(A){for(var B=-1,N=L.length,P;++B<N;)v[(P=L[B]).i]=P.x(A);return v.join("")}}}var fa=Cr(xr,"px, ","px)","deg)"),_a=Cr(vr,", ",")",")");var ti=0,Li=0,Si=0,br=1e3,bn,Ai,Tn=0,Ft=0,Sn=0,wi=typeof performance=="object"&&performance.now?performance:Date,Tr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ki(){return Ft||(Tr(vd),Ft=wi.now()+Sn)}function vd(){Ft=0}function Ii(){this._call=this._time=this._next=null}Ii.prototype=Ln.prototype={constructor:Ii,restart:function(t,a,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?ki():+e)+(a==null?0:+a),!this._next&&Ai!==this&&(Ai?Ai._next=this:bn=this,Ai=this),this._call=t,this._time=e,xa()},stop:function(){this._call&&(this._call=null,this._time=1/0,xa())}};function Ln(t,a,e){var i=new Ii;return i.restart(t,a,e),i}function Sr(){ki(),++ti;for(var t=bn,a;t;)(a=Ft-t._time)>=0&&t._call.call(void 0,a),t=t._next;--ti}function yr(){Ft=(Tn=wi.now())+Sn,ti=Li=0;try{Sr()}finally{ti=0,yd(),Ft=0}}function Cd(){var t=wi.now(),a=t-Tn;a>br&&(Sn-=a,Tn=t)}function yd(){for(var t,a=bn,e,i=1/0;a;)a._call?(i>a._time&&(i=a._time),t=a,a=a._next):(e=a._next,a._next=null,a=t?t._next=e:bn=e);Ai=t,xa(i)}function xa(t){if(!ti){Li&&(Li=clearTimeout(Li));var a=t-Ft;a>24?(t<1/0&&(Li=setTimeout(yr,t-wi.now()-Sn)),Si&&(Si=clearInterval(Si))):(Si||(Tn=wi.now(),Si=setInterval(Cd,br)),ti=1,Tr(yr))}}function An(t,a,e){var i=new Ii;return a=a==null?0:+a,i.restart(n=>{i.stop(),t(n+a)},a,e),i}var bd=la("start","end","cancel","interrupt"),Td=[],wr=0,Lr=1,In=2,wn=3,Ar=4,kn=5,Di=6;function xt(t,a,e,i,n,s){var r=t.__transition;if(!r)t.__transition={};else if(e in r)return;Sd(t,e,{name:a,index:i,group:n,on:bd,tween:Td,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:wr})}function Ei(t,a){var e=de(t,a);if(e.state>wr)throw new Error("too late; already scheduled");return e}function xe(t,a){var e=de(t,a);if(e.state>wn)throw new Error("too late; already running");return e}function de(t,a){var e=t.__transition;if(!e||!(e=e[a]))throw new Error("transition not found");return e}function Sd(t,a,e){var i=t.__transition,n;i[a]=e,e.timer=Ln(s,0,e.time);function s(h){e.state=Lr,e.timer.restart(r,e.delay,e.time),e.delay<=h&&r(h-e.delay)}function r(h){var x,v,L,A;if(e.state!==Lr)return m();for(x in i)if(A=i[x],A.name===e.name){if(A.state===wn)return An(r);A.state===Ar?(A.state=Di,A.timer.stop(),A.on.call("interrupt",t,t.__data__,A.index,A.group),delete i[x]):+x<a&&(A.state=Di,A.timer.stop(),A.on.call("cancel",t,t.__data__,A.index,A.group),delete i[x])}if(An(function(){e.state===wn&&(e.state=Ar,e.timer.restart(d,e.delay,e.time),d(h))}),e.state=In,e.on.call("start",t,t.__data__,e.index,e.group),e.state===In){for(e.state=wn,n=new Array(L=e.tween.length),x=0,v=-1;x<L;++x)(A=e.tween[x].value.call(t,t.__data__,e.index,e.group))&&(n[++v]=A);n.length=v+1}}function d(h){for(var x=h<e.duration?e.ease.call(null,h/e.duration):(e.timer.restart(m),e.state=kn,1),v=-1,L=n.length;++v<L;)n[v].call(t,x);e.state===kn&&(e.on.call("end",t,t.__data__,e.index,e.group),m())}function m(){e.state=Di,e.timer.stop(),delete i[a];for(var h in i)return;delete t.__transition}}function va(t,a){var e=t.__transition,i,n,s=!0,r;if(e){a=a==null?null:a+"";for(r in e){if((i=e[r]).name!==a){s=!1;continue}n=i.state>In&&i.state<kn,i.state=Di,i.timer.stop(),i.on.call(n?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete e[r]}s&&delete t.__transition}}function Ir(t){return this.each(function(){va(this,t)})}function Ld(t,a){var e,i;return function(){var n=xe(this,t),s=n.tween;if(s!==e){i=e=s;for(var r=0,d=i.length;r<d;++r)if(i[r].name===a){i=i.slice(),i.splice(r,1);break}}n.tween=i}}function Ad(t,a,e){var i,n;if(typeof e!="function")throw new Error;return function(){var s=xe(this,t),r=s.tween;if(r!==i){n=(i=r).slice();for(var d={name:a,value:e},m=0,h=n.length;m<h;++m)if(n[m].name===a){n[m]=d;break}m===h&&n.push(d)}s.tween=n}}function kr(t,a){var e=this._id;if(t+="",arguments.length<2){for(var i=de(this.node(),e).tween,n=0,s=i.length,r;n<s;++n)if((r=i[n]).name===t)return r.value;return null}return this.each((a==null?Ld:Ad)(e,t,a))}function ii(t,a,e){var i=t._id;return t.each(function(){var n=xe(this,i);(n.value||(n.value={}))[a]=e.apply(this,arguments)}),function(n){return de(n,i).value[a]}}function Dn(t,a){var e;return(typeof a=="number"?_e:a instanceof Qe?Nt:(e=Qe(a))?(a=e,Nt):Ti)(t,a)}function wd(t){return function(){this.removeAttribute(t)}}function Id(t){return function(){this.removeAttributeNS(t.space,t.local)}}function kd(t,a,e){var i,n=e+"",s;return function(){var r=this.getAttribute(t);return r===n?null:r===i?s:s=a(i=r,e)}}function Dd(t,a,e){var i,n=e+"",s;return function(){var r=this.getAttributeNS(t.space,t.local);return r===n?null:r===i?s:s=a(i=r,e)}}function Ed(t,a,e){var i,n,s;return function(){var r,d=e(this),m;return d==null?void this.removeAttribute(t):(r=this.getAttribute(t),m=d+"",r===m?null:r===i&&m===n?s:(n=m,s=a(i=r,d)))}}function Bd(t,a,e){var i,n,s;return function(){var r,d=e(this),m;return d==null?void this.removeAttributeNS(t.space,t.local):(r=this.getAttributeNS(t.space,t.local),m=d+"",r===m?null:r===i&&m===n?s:(n=m,s=a(i=r,d)))}}function Dr(t,a){var e=rt(t),i=e==="transform"?_a:Dn;return this.attrTween(t,typeof a=="function"?(e.local?Bd:Ed)(e,i,ii(this,"attr."+t,a)):a==null?(e.local?Id:wd)(e):(e.local?Dd:kd)(e,i,a))}function Nd(t,a){return function(e){this.setAttribute(t,a.call(this,e))}}function Md(t,a){return function(e){this.setAttributeNS(t.space,t.local,a.call(this,e))}}function Fd(t,a){var e,i;function n(){var s=a.apply(this,arguments);return s!==i&&(e=(i=s)&&Md(t,s)),e}return n._value=a,n}function Rd(t,a){var e,i;function n(){var s=a.apply(this,arguments);return s!==i&&(e=(i=s)&&Nd(t,s)),e}return n._value=a,n}function Er(t,a){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(a==null)return this.tween(e,null);if(typeof a!="function")throw new Error;var i=rt(t);return this.tween(e,(i.local?Fd:Rd)(i,a))}function Od(t,a){return function(){Ei(this,t).delay=+a.apply(this,arguments)}}function Pd(t,a){return a=+a,function(){Ei(this,t).delay=a}}function Br(t){var a=this._id;return arguments.length?this.each((typeof t=="function"?Od:Pd)(a,t)):de(this.node(),a).delay}function Vd(t,a){return function(){xe(this,t).duration=+a.apply(this,arguments)}}function Gd(t,a){return a=+a,function(){xe(this,t).duration=a}}function Nr(t){var a=this._id;return arguments.length?this.each((typeof t=="function"?Vd:Gd)(a,t)):de(this.node(),a).duration}function Hd(t,a){if(typeof a!="function")throw new Error;return function(){xe(this,t).ease=a}}function Mr(t){var a=this._id;return arguments.length?this.each(Hd(a,t)):de(this.node(),a).ease}function Xd(t,a){return function(){var e=a.apply(this,arguments);if(typeof e!="function")throw new Error;xe(this,t).ease=e}}function Fr(t){if(typeof t!="function")throw new Error;return this.each(Xd(this._id,t))}function Rr(t){typeof t!="function"&&(t=_i(t));for(var a=this._groups,e=a.length,i=new Array(e),n=0;n<e;++n)for(var s=a[n],r=s.length,d=i[n]=[],m,h=0;h<r;++h)(m=s[h])&&t.call(m,m.__data__,h,s)&&d.push(m);return new Ae(i,this._parents,this._name,this._id)}function Or(t){if(t._id!==this._id)throw new Error;for(var a=this._groups,e=t._groups,i=a.length,n=e.length,s=Math.min(i,n),r=new Array(i),d=0;d<s;++d)for(var m=a[d],h=e[d],x=m.length,v=r[d]=new Array(x),L,A=0;A<x;++A)(L=m[A]||h[A])&&(v[A]=L);for(;d<i;++d)r[d]=a[d];return new Ae(r,this._parents,this._name,this._id)}function Yd(t){return(t+"").trim().split(/^|\s+/).every(function(a){var e=a.indexOf(".");return e>=0&&(a=a.slice(0,e)),!a||a==="start"})}function zd(t,a,e){var i,n,s=Yd(a)?Ei:xe;return function(){var r=s(this,t),d=r.on;d!==i&&(n=(i=d).copy()).on(a,e),r.on=n}}function Pr(t,a){var e=this._id;return arguments.length<2?de(this.node(),e).on.on(t):this.each(zd(e,t,a))}function $d(t){return function(){var a=this.parentNode;for(var e in this.__transition)if(+e!==t)return;a&&a.removeChild(this)}}function Vr(){return this.on("end.remove",$d(this._id))}function Gr(t){var a=this._name,e=this._id;typeof t!="function"&&(t=Dt(t));for(var i=this._groups,n=i.length,s=new Array(n),r=0;r<n;++r)for(var d=i[r],m=d.length,h=s[r]=new Array(m),x,v,L=0;L<m;++L)(x=d[L])&&(v=t.call(x,x.__data__,L,d))&&("__data__"in x&&(v.__data__=x.__data__),h[L]=v,xt(h[L],a,e,L,h,de(x,e)));return new Ae(s,this._parents,a,e)}function Hr(t){var a=this._name,e=this._id;typeof t!="function"&&(t=fi(t));for(var i=this._groups,n=i.length,s=[],r=[],d=0;d<n;++d)for(var m=i[d],h=m.length,x,v=0;v<h;++v)if(x=m[v]){for(var L=t.call(x,x.__data__,v,m),A,B=de(x,e),N=0,P=L.length;N<P;++N)(A=L[N])&&xt(A,a,e,N,L,B);s.push(L),r.push(x)}return new Ae(s,r,a,e)}var Wd=lt.prototype.constructor;function Xr(){return new Wd(this._groups,this._parents)}
1function jd(t,a){var e,i,n;return function(){var s=_t(this,t),r=(this.style.removeProperty(t),_t(this,t));return s===r?null:s===e&&r===i?n:n=a(e=s,i=r)}}function Yr(t){return function(){this.style.removeProperty(t)}}function Ud(t,a,e){var i,n=e+"",s;return function(){var r=_t(this,t);return r===n?null:r===i?s:s=a(i=r,e)}}function qd(t,a,e){var i,n,s;return function(){var r=_t(this,t),d=e(this),m=d+"";return d==null&&(m=d=(this.style.removeProperty(t),_t(this,t))),r===m?null:r===i&&m===n?s:(n=m,s=a(i=r,d))}}function Qd(t,a){var e,i,n,s="style."+a,r="end."+s,d;return function(){var m=xe(this,t),h=m.on,x=m.value[s]==null?d||(d=Yr(a)):void 0;(h!==e||n!==x)&&(i=(e=h).copy()).on(r,n=x),m.on=i}}function zr(t,a,e){var i=(t+="")=="transform"?fa:Dn;return a==null?this.styleTween(t,jd(t,i)).on("end.style."+t,Yr(t)):typeof a=="function"?this.styleTween(t,qd(t,i,ii(this,"style."+t,a))).each(Qd(this._id,t)):this.styleTween(t,Ud(t,i,a),e).on("end.style."+t,null)}function Kd(t,a,e){return function(i){this.style.setProperty(t,a.call(this,i),e)}}function Zd(t,a,e){var i,n;function s(){var r=a.apply(this,arguments);return r!==n&&(i=(n=r)&&Kd(t,r,e)),i}return s._value=a,s}function $r(t,a,e){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(a==null)return this.tween(i,null);if(typeof a!="function")throw new Error;return this.tween(i,Zd(t,a,e??""))}function Jd(t){return function(){this.textContent=t}}function ep(t){return function(){var a=t(this);this.textContent=a??""}}function Wr(t){return this.tween("text",typeof t=="function"?ep(ii(this,"text",t)):Jd(t==null?"":t+""))}function tp(t){return function(a){this.textContent=t.call(this,a)}}function ip(t){var a,e;function i(){var n=t.apply(this,arguments);return n!==e&&(a=(e=n)&&tp(n)),a}return i._value=t,i}function jr(t){var a="text";if(arguments.length<1)return(a=this.tween(a))&&a._value;if(t==null)return this.tween(a,null);if(typeof t!="function")throw new Error;return this.tween(a,ip(t))}function Ur(){for(var t=this._name,a=this._id,e=En(),i=this._groups,n=i.length,s=0;s<n;++s)for(var r=i[s],d=r.length,m,h=0;h<d;++h)if(m=r[h]){var x=de(m,a);xt(m,t,e,h,r,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new Ae(i,this._parents,t,e)}function qr(){var t,a,e=this,i=e._id,n=e.size();return new Promise(function(s,r){var d={value:r},m={value:function(){--n===0&&s()}};e.each(function(){var h=xe(this,i),x=h.on;x!==t&&(a=(t=x).copy(),a._.cancel.push(d),a._.interrupt.push(d),a._.end.push(m)),h.on=a}),n===0&&s()})}var np=0;function Ae(t,a,e,i){this._groups=t,this._parents=a,this._name=e,this._id=i}function Qr(t){return lt().transition(t)}function En(){return++np}var ct=lt.prototype;Ae.prototype=Qr.prototype={constructor:Ae,select:Gr,selectAll:Hr,selectChild:ct.selectChild,selectChildren:ct.selectChildren,filter:Rr,merge:Or,selection:Xr,transition:Ur,call:ct.call,nodes:ct.nodes,node:ct.node,size:ct.size,empty:ct.empty,each:ct.each,on:Pr,attr:Dr,attrTween:Er,style:zr,styleTween:$r,text:Wr,textTween:jr,remove:Vr,tween:kr,delay:Br,duration:Nr,ease:Mr,easeVarying:Fr,end:qr,[Symbol.iterator]:ct[Symbol.iterator]};function Bn(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var ap={time:null,delay:0,duration:250,ease:Bn};function sp(t,a){for(var e;!(e=t.__transition)||!(e=e[a]);)if(!(t=t.parentNode))throw new Error(`transition ${a} not found`);return e}function Kr(t){var a,e;t instanceof Ae?(a=t._id,t=t._name):(a=En(),(e=ap).time=ki(),t=t==null?null:t+"");for(var i=this._groups,n=i.length,s=0;s<n;++s)for(var r=i[s],d=r.length,m,h=0;h<d;++h)(m=r[h])&&xt(m,t,a,h,r,e||sp(m,a));return new Ae(i,this._parents,t,a)}lt.prototype.interrupt=Ir;lt.prototype.transition=Kr;var{abs:Zy,max:Jy,min:eb}=Math;function Zr(t){return[+t[0],+t[1]]}function op(t){return[Zr(t[0]),Zr(t[1])]}var tb={name:"x",handles:["w","e"].map(Ca),input:function(t,a){return t==null?null:[[+t[0],a[0][1]],[+t[1],a[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ib={name:"y",handles:["n","s"].map(Ca),input:function(t,a){return t==null?null:[[a[0][0],+t[0]],[a[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},nb={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ca),input
1:function(t){return t==null?null:op(t)},output:function(t){return t}};function Ca(t){return{type:t}}function Je(t,a){return t==null||a==null?NaN:t<a?-1:t>a?1:t>=a?0:NaN}function ya(t,a){return t==null||a==null?NaN:a<t?-1:a>t?1:a>=t?0:NaN}function Nn(t){let a,e,i;t.length!==2?(a=Je,e=(d,m)=>Je(t(d),m),i=(d,m)=>t(d)-m):(a=t===Je||t===ya?t:lp,e=t,i=t);function n(d,m,h=0,x=d.length){if(h<x){if(a(m,m)!==0)return x;do{let v=h+x>>>1;e(d[v],m)<0?h=v+1:x=v}while(h<x)}return h}function s(d,m,h=0,x=d.length){if(h<x){if(a(m,m)!==0)return x;do{let v=h+x>>>1;e(d[v],m)<=0?h=v+1:x=v}while(h<x)}return h}function r(d,m,h=0,x=d.length){let v=n(d,m,h,x-1);return v>h&&i(d[v-1],m)>-i(d[v],m)?v-1:v}return{left:n,center:r,right:s}}function lp(){return 0}function Bi(t){return t===null?NaN:+t}var Jr=Nn(Je),el=Jr.right,cp=Jr.left,dp=Nn(Bi).center,Ni=el;var ni=class extends Map{constructor(a,e=mp){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),a!=null)for(let[i,n]of a)this.set(i,n)}get(a){return super.get(tl(this,a))}has(a){return super.has(tl(this,a))}set(a,e){return super.set(pp(this,a),e)}delete(a){return super.delete(hp(this,a))}};function tl({_intern:t,_key:a},e){let i=a(e);return t.has(i)?t.get(i):e}function pp({_intern:t,_key:a},e){let i=a(e);return t.has(i)?t.get(i):(t.set(i,e),e)}function hp({_intern:t,_key:a},e){let i=a(e);return t.has(i)&&(e=t.get(i),t.delete(i)),e}function mp(t){return t!==null&&typeof t=="object"?t.valueOf():t}var up=Math.sqrt(50),gp=Math.sqrt(10),fp=Math.sqrt(2);function Mn(t,a,e){let i=(a-t)/Math.max(0,e),n=Math.floor(Math.log10(i)),s=i/Math.pow(10,n),r=s>=up?10:s>=gp?5:s>=fp?2:1,d,m,h;return n<0?(h=Math.pow(10,-n)/r,d=Math.round(t*h),m=Math.round(a*h),d/h<t&&++d,m/h>a&&--m,h=-h):(h=Math.pow(10,n)*r,d=Math.round(t/h),m=Math.round(a/h),d*h<t&&++d,m*h>a&&--m),m<d&&.5<=e&&e<2?Mn(t,a,e*2):[d,m,h]}function Fn(t,a,e){if(a=+a,t=+t,e=+e,!(e>0))return[];if(t===a)return[t];let i=a<t,[n,s,r]=i?Mn(a,t,e):Mn(t,a,e);if(!(s>=n))return[];let d=s-n+1,m=new Array(d);if(i)if(r<0)for(let h=0;h<d;++h)m[h]=(s-h)/-r;else for(let h=0;h<d;++h)m[h]=(s-h)*r;else if(r<0)for(let h=0;h<d;++h)m[h]=(n+h)/-r;else for(let h=0;h<d;++h)m[h]=(n+h)*r;return m}function Mi(t,a,e){return a=+a,t=+t,e=+e,Mn(t,a,e)[2]}function ba(t,a,e){a=+a,t=+t,e=+e;let i=a<t,n=i?Mi(a,t,e):Mi(t,a,e);return(i?-1:1)*(n<0?1/-n:n)}function Ta(t,a,e=Bi){if(!(!(i=t.length)||isNaN(a=+a))){if(a<=0||i<2)return+e(t[0],0,t);if(a>=1)return+e(t[i-1],i-1,t);var i,n=(i-1)*a,s=Math.floor(n),r=+e(t[s],s,t),d=+e(t[s+1],s+1,t);return r+(d-r)*(n-s)}}function ai(t,a,e){t=+t,a=+a,e=(n=arguments.length)<2?(a=t,t=0,1):n<3?1:+e;for(var i=-1,n=Math.max(0,Math.ceil((a-t)/e))|0,s=new Array(n);++i<n;)s[i]=t+i*e;return s}function vt(t,a){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(a).domain(t);break}return this}var Sa=Symbol("implicit");function Rt(){var t=new ni,a=[],e=[],i=Sa;function n(s){let r=t.get(s);if(r===void 0){if(i!==Sa)return i;t.set(s,r=a.push(s)-1)}return e[r%e.length]}return n.domain=function(s){if(!arguments.length)return a.slice();a=[],t=new ni;for(let r of s)t.has(r)||t.set(r,a.push(r)-1);return n},n.range=function(s){return arguments.length?(e=Array.from(s),n):e.slice()},n.unknown=function(s){return arguments.length?(i=s,n):i},n.copy=function(){return Rt(a,e).unknown(i)},vt.apply(n,arguments),n}function Ot(){var t=Rt().unknown(void 0),a=t.domain,e=t.range,i=0,n=1,s,r,d=!1,m=0,h=0,x=.5;delete t.unknown;function v(){var L=a().length,A=n<i,B=A?n:i,N=A?i:n;s=(N-B)/Math.max(1,L-m+h*2),d&&(s=Math.floor(s)),B+=(N-B-s*(L-m))*x,r=s*(1-m),d&&(B=Math.round(B),r=Math.round(r));var P=ai(L).map(function(re){return B+s*re});return e(A?P.reverse():P)}return t.domain=function(L){return arguments.length?(a(L),v()):a()},t.range=function(L){return arguments.length?([i,n]=L,i=+i,n=+n,v()):[i,n]},t.rangeRound=function(L){return[i,n]=L,i=+i,n=+n,d=!0,v()},t.bandwidth=function(){return r},t.step=function(){return s},t.round=function(L){return arguments.length?(d=!!L,v()):d},t.padding=function(L){return arguments.length?(m=Math.min(1,h=+L),v()):m},t.paddingInner=function(L){return arguments.length?(m=Math.min(1,L),v()):m},t.paddingOuter=function(L){return arguments.length?(h=+L,v()):h},t.align=function(L){return arguments.length?(x=Math.max(0,Math.min(1,L)),v()):x},t.copy=function(){return Ot(a(),[i,n]).round(d).paddingInner(m).paddingOuter(h).align(x)},vt.apply(v(),arguments)}function La(t){return function(){return t}}function Aa(t){return+t}var il=[0,1];function si(t){return t}function wa(t,a){return(a-=t=+t)?function(e){return(e-t)/a}:La(isNaN(a)?NaN:.5)}function xp(t,a){var e;return t>a&&(e=t,t=a,a=e),function(i){return Math.max(t,Math.min(a,i))}}function vp(t,a,e){var i=t[0],n=t[1],s=a[0],r=a[1];return n<i?(i=wa(n,i),s=e(r,s)):(i=wa(i,n),s=e(s,r)),function(d){return s(i(d))}}function Cp(t,a,e){var i=Math.min(t.length,a.length)-1,n=new Array(i),s=new Array(i),r=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),a=a.slice().reverse());++r<i;)n[r]=wa(t[r],t[r+1]),s[r]=e(a[r],a[r+1]);return function(d){var m=Ni(t,d,1,i)-1;return s[m](n[m](d))}}function nl(t,a){return a.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function yp(){var t=il,a=il,e=Mt,i,n,s,r=si,d,m,h;function x(){var L=Math.min(t.length,a.length);return r!==si&&(r=xp(t[0],t[L-1])),d=L>2?Cp:vp,m=h=null,v}function v(L){return L==null||isNaN(L=+L)?s:(m||(m=d(t.map(i),a,e)))(i(r(L)))}return v.invert=function(L){return r(n((h||(h=d(a,t.map(i),_e)))(L)))},v.domain=function(L){return arguments.length?(t=Array.from(L,Aa),x()):t.slice()},v.range=function(L){return arguments.length?(a=Array.from(L),x()):a.slice()},v.rangeRound=function(L){return a=Array.from(L),e=ua,x()},v.clamp=function(L){return arguments.length?(r=L?!0:si,x()):r!==si},v.interpolate=function(L){return arguments.length?(e=L,x()):e},v.unknown=function(L){return arguments.length?(s=L,v):s},function(L,A){return i=L,n=A,x()}}function Ia(){return yp()(si,si)}function al(t){return Math.abs(t=Math.round(t))>
vendor: 5,106 bytes, line 1
1=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Pt(t,a){if(!isFinite(t)||t===0)return null;var e=(t=a?t.toExponential(a-1):t.toExponential()).indexOf("e"),i=t.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+t.slice(e+1)]}function et(t){return t=Pt(Math.abs(t)),t?t[1]:NaN}function sl(t,a){return function(e,i){for(var n=e.length,s=[],r=0,d=t[0],m=0;n>0&&d>0&&(m+d+1>i&&(d=Math.max(1,i-m)),s.push(e.substring(n-=d,n+d)),!((m+=d+1)>i));)d=t[r=(r+1)%t.length];return s.reverse().join(a)}}function ol(t){return function(a){return a.replace(/[0-9]/g,function(e){return t[+e]})}}var bp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ct(t){if(!(a=bp.exec(t)))throw new Error("invalid format: "+t);var a;return new Rn({fill:a[1],align:a[2],sign:a[3],symbol:a[4],zero:a[5],width:a[6],comma:a[7],precision:a[8]&&a[8].slice(1),trim:a[9],type:a[10]})}Ct.prototype=Rn.prototype;function Rn(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Rn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function rl(t){e:for(var a=t.length,e=1,i=-1,n;e<a;++e)switch(t[e]){case".":i=n=e;break;case"0":i===0&&(i=e),n=e;break;default:if(!+t[e])break e;i>0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(n+1):t}var Fi;function ll(t,a){var e=Pt(t,a);if(!e)return Fi=void 0,t.toPrecision(a);var i=e[0],n=e[1],s=n-(Fi=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,r=i.length;return s===r?i:s>r?i+new Array(s-r+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Pt(t,Math.max(0,a+s-1))[0]}function ka(t,a){var e=Pt(t,a);if(!e)return t+"";var i=e[0],n=e[1];return n<0?"0."+new Array(-n).join("0")+i:i.length>n+1?i.slice(0,n+1)+"."+i.slice(n+1):i+new Array(n-i.length+2).join("0")}var Da={"%":(t,a)=>(t*100).toFixed(a),b:t=>Math.round(t).toString(2),c:t=>t+"",d:al,e:(t,a)=>t.toExponential(a),f:(t,a)=>t.toFixed(a),g:(t,a)=>t.toPrecision(a),o:t=>Math.round(t).toString(8),p:(t,a)=>ka(t*100,a),r:ka,s:ll,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ea(t){return t}var cl=Array.prototype.map,dl=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function pl(t){var a=t.grouping===void 0||t.thousands===void 0?Ea:sl(cl.call(t.grouping,Number),t.thousands+""),e=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",n=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?Ea:ol(cl.call(t.numerals,String)),r=t.percent===void 0?"%":t.percent+"",d=t.minus===void 0?"\u2212":t.minus+"",m=t.nan===void 0?"NaN":t.nan+"";function h(v,L){v=Ct(v);var A=v.fill,B=v.align,N=v.sign,P=v.symbol,re=v.zero,ve=v.width,ye=v.comma,ge=v.precision,Ce=v.trim,Pe=v.type;Pe==="n"?(ye=!0,Pe="g"):Da[Pe]||(ge===void 0&&(ge=12),Ce=!0,Pe="g"),(re||A==="0"&&B==="=")&&(re=!0,A="0",B="=");var ec=(L&&L.prefix!==void 0?L.prefix:"")+(P==="$"?e:P==="#"&&/[boxX]/.test(Pe)?"0"+Pe.toLowerCase():""),tc=(P==="$"?i:/[%p]/.test(Pe)?r:"")+(L&&L.suffix!==void 0?L.suffix:""),rs=Da[Pe],ic=/[defgprs%]/.test(Pe);ge=ge===void 0?6:/[gprs]/.test(Pe)?Math.max(1,Math.min(21,ge)):Math.max(0,Math.min(20,ge));function ls(X){var wt=ec,Ve=tc,Xt,cs,Xi;if(Pe==="c")Ve=rs(X)+Ve,X="";else{X=+X;var Yi=X<0||1/X<0;if(X=isNaN(X)?m:rs(Math.abs(X),ge),Ce&&(X=rl(X)),Yi&&+X==0&&N!=="+"&&(Yi=!1),wt=(Yi?N==="("?N:d:N==="-"||N==="("?"":N)+wt,Ve=(Pe==="s"&&!isNaN(X)&&Fi!==void 0?dl[8+Fi/3]:"")+Ve+(Yi&&N==="("?")":""),ic){for(Xt=-1,cs=X.length;++Xt<cs;)if(Xi=X.charCodeAt(Xt),48>Xi||Xi>57){Ve=(Xi===46?n+X.slice(Xt+1):X.slice(Xt))+Ve,X=X.slice(0,Xt);break}}}ye&&!re&&(X=a(X,1/0));var zi=wt.length+X.length+Ve.length,it=zi<ve?new Array(ve-zi+1).join(A):"";switch(ye&&re&&(X=a(it+X,it.length?ve-Ve.length:1/0),it=""),B){case"<":X=wt+X+Ve+it;break;case"=":X=wt+it+X+Ve;break;case"^":X=it.slice(0,zi=it.length>>1)+wt+X+Ve+it.slice(zi);break;default:X=it+wt+X+Ve;break}return s(X)}return ls.toString=function(){return v+""},ls}function x(v,L){var A=Math.max(-8,Math.min(8,Math.floor(et(L)/3)))*3,B=Math.pow(10,-A),N=h((v=Ct(v),v.type="f",v),{suffix:dl[8+A/3]});return function(P){return N(B*P)}}return{format:h,formatPrefix:x}}var On,Pn,Vn;Ba({thousands:",",grouping:[3],currency:["$",""]});function Ba(t){return On=pl(t),Pn=On.format,Vn=On.formatPrefix,On}function Na(t){return Math.max(0,-et(Math.abs(t)))}function Ma(t,a){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(et(a)/3)))*3-et(Math.abs(t)))}function Fa(t,a){return t=Math.abs(t),a=Math.abs(a)-t,Math.max(0,et(a)-et(t))+1}function Ra(t,a,e,i){var n=ba(t,a,e),s;switch(i=Ct(i??",f"),i.type){case"s":{var r=Math.max(Math.abs(t),Math.abs(a)
1);return i.precision==null&&!isNaN(s=Ma(n,r))&&(i.precision=s),Vn(i,r)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=Fa(n,Math.max(Math.abs(t),Math.abs(a))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=Na(n))&&(i.precision=s-(i.type==="%")*2);break}}return Pn(i)}function Tp(t){var a=t.domain;return t.ticks=function(e){var i=a();return Fn(i[0],i[i.length-1],e??10)},t.tickFormat=function(e,i){var n=a();return Ra(n[0],n[n.length-1],e??10,i)},t.nice=function(e){e==null&&(e=10);var i=a(),n=0,s=i.length-1,r=i[n],d=i[s],m,h,x=10;for(d<r&&(h=r,r=d,d=h,h=n,n=s,s=h);x-- >0;){if(h=Mi(r,d,e),h===m)return i[n]=r,i[s]=d,a(i);if(h>0)r=Math.floor(r/h)*h,d=Math.ceil(d/h)*h;else if(h<0)r=Math.ceil(r*h)/h,d=Math.floor(d*h)/h;else break;m=h}return t},t}function yt(){var t=Ia();return t.copy=function(){return nl(t,yt())},vt.apply(t,arguments),Tp(t)}function Ri(){var t=[],a=[],e=[],i;function n(){var r=0,d=Math.max(1,a.length);for(e=new Array(d-1);++r<d;)e[r-1]=Ta(t,r/d);return s}function s(r){return r==null||isNaN(r=+r)?i:a[Ni(e,r)]}return s.invertExtent=function(r){var d=a.indexOf(r);return d<0?[NaN,NaN]:[d>0?e[d-1]:t[0],d<e.length?e[d]:t[t.length-1]]},s.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let d of r)d!=null&&!isNaN(d=+d)&&t.push(d);return t.sort(Je),n()},s.range=function(r){return arguments.length?(a=Array.from(r),n()):a.slice()},s.unknown=function(r){return arguments.length?(i=r,s):i},s.quantiles=function(){return e.slice()},s.copy=function(){return Ri().domain(t).range(a).unknown(i)},vt.apply(s,arguments)}var kp=["caretElm"],Dp=t=>({model:t});function Ep(t,a){}function Bp(t,a){if(t&1&&(l(0,"span"),R(1,Ep,0,0,"ng-template",5),c()),t&2){let e=u();o(),_("ngTemplateOutlet",e.template)("ngTemplateOutletContext",F(2,Dp,e.context))}}function Np(t,a){if(t&1&&y(0,"span",6),t&2){let e=u();_("innerHTML",e.title,le)}}function Mp(t,a){if(t&1&&(l(0,"header",4)(1,"span",5),p(2),c()()),t&2){let e=u();o(2),C(e.title)}}function Fp(t,a){if(t&1){let e=E();l(0,"li",6)(1,"ngx-charts-legend-entry",7),k("select",function(n){w(e);let s=u();return I(s.labelClick.emit(n))})("activate",function(n){w(e);let s=u();return I(s.activate(n))})("deactivate",function(n){w(e);let s=u();return I(s.deactivate(n))}),c()()}if(t&2){let e=a.$implicit,i=u();o(),_("label",e.label)("formattedLabel",e.formattedLabel)("color",e.color)("isActive",i.isActive(e))}}var Rp=["*"];function Op(t,a){if(t&1&&y(0,"ngx-charts-scale-legend",4),t&2){let e=u();Fe("width",e.legendWidth,"px")("max-width",e.legendWidth,"px"),_("horizontal",e.legendOptions&&e.legendOptions.position===e.LegendPosition.Below)("valueRange",e.legendOptions.domain)("colors",e.legendOptions.colors)("height",e.view[1])("width",e.legendWidth)}}function Pp(t,a){if(t&1){let e=E();l(0,"ngx-charts-legend",5),k("labelClick",function(n){w(e);let s=u();return I(s.legendLabelClick.emit(n))})("labelActivate",function(n){w(e);let s=u();return I(s.legendLabelActivate.emit(n))})("labelDeactivate",function(n){w(e);let s=u();return I(s.legendLabelDeactivate.emit(n))}),c()}if(t&2){let e=u();Fe("width",e.legendWidth,"px")("max-width",e.legendWidth,"px"),_("horizontal",e.legendOptions&&e.legendOptions.position===e.LegendPosition.Below)("data",e.legendOptions.domain)("title",e.legendOptions.title)("colors",e.legendOptions.colors)("height",e.view[1])("width",e.legendWidth)("activeEntries",e.activeEntries)}}var Vp=["ngx-charts-axis-label",""],yl=["ticksel"],Gp=["ngx-charts-x-axis-ticks",""];function Hp(t,a){t&1&&(M(),at(0))}function Xp(t,a){if(t&1&&(M(),l(0,"tspan",12),p(1),c()),t&2){let e=a.$implicit,i=a.index;Y("y",i*12),o(),D(" ",e," ")}}function Yp(t,a){if(t&1&&(M(),$e(0),R(1,Xp,2,2,"tspan",11),We()),t&2){let e=a.ngIf;o(),_("ngForOf",e)}}function zp(t,a){if(t&1&&R(0,Yp,2,1,"ng-container",8),t&2){let e=u(2).$implicit,i=u();_("ngIf",i.tickChunks(e))}}function $p(t,a){if(t&1&&p(0),t&2){let e=u().ngIf,i=u(2);D(" ",i.tickTrim(e)," ")}}function Wp(t,a){if(t&1&&(M(),$e(0),l(1,"title"),p(2),c(),l(3,"text",9),R(4,Hp,1,0,"ng-container",10),c(),R(5,zp,1,1,"ng-template",null,1,It)(7,$p,1,1,"ng-template",null,2,It),We()),t&2){let e=a.ngIf,i=Z(6),n=Z(8),s=u(2);o(2),C(e),o(),Y("text-anchor",s.textAnchor)("transform",s.textTransform),o(),_("ngIf",s.isWrapTicksSupported)("ngIfThen",i)("ngIfElse",n)}}function jp(t,a){if(t&1&&(M(),l(0,"g",7),R(1,Wp,9,6,"ng-container",8),c()),t&2){let e=a.$implicit,i=u();Y("transform",i.tickTransform(e)),o(),_("ngIf",i.tickFormat(e))}}function Up(t,a){if(t&1&&(M(),l(0,"g"),y(1,"line",13),c()),t&2){let e=u(2);Y("transform",e.gridLineTransform()),o(),Y("y1",-e.gridLineHeight)}}function qp(t,a){if(t&1&&(M(),l(0,"g"),R(1,Up,2,2,"g",8),c()),t&2){let e=a.$implicit,i=u();Y("transform",i.tickTransform(e)),o(),_("ngIf",i.showGridLines)}}function Qp(t,a){if(t&1&&(M(),y(0,"path",14)),t&2){let e=u();Y("d",e.referenceAreaPath)("transform",e.gridLineTransform())}}function Kp(t,a){if(t&1&&(M(),l(0,"g")(1,"title"),p(2),c(),l(3,"text",17),p(4),c()()),t&2){let e=u(2).$implicit,i=u();o(2),C(i.tickTrim(i.tickFormat(e.value))),o(2),D(" ",e.name," ")}}function Zp(t,a){if(t&1&&(M(),l(0,"g"),y(1,"line",16),R(2,Kp,5,2,"g",8),c()),t&2){let e=u().$implicit,i=u();Y("transform",i.transform(e.value)),o(),Y("y2",25+i.gridLineHeight)("transform",i.gridLineTransform()),o(),_("ngIf",i.showRefLabels)}}function Jp(t,a){if(t&1&&(M(),l(0,"g",15),R(1,Zp,3,4,"g",8),c()),t&2){let e=u();o(),_("ngIf",e.showRefLines)}}var eh=["ngx-charts-x-axis",""];function th(t,a){if(t&1){let e=E();M(),l(0,"g",2),k("dimensionsChanged",function(n){w(e);let s=u();return I(s.emitTicksHeight(n))}),c()}if(t&2){let e=u();_("trimTicks",e.trimTicks)("rotateTicks",e.rotateTicks)("maxTickLength",e.maxTickLength)("tickFormatting",e.tickFormatting)("tickArguments",e.tickArguments)("tickStroke",e.tickStroke)("scale",e.xScale)("orient",e.xOrient)("showGridLines",e.showGridLines)("gridLineHeight",e.dims.height)("referenceLines",e.referenceLines)("showRefLines",e.showRefLines)("showRefLabels",e.showRefLabels)("width",e.dims.width)("tickValues",e.ticks)("wrapTicks",e.wrapTicks)}}function ih(t,a){if(t&1&&(M(),y(0,"g",3)),t&2){let e=u();_("label",e.labelText)("offset",e.labelOffset)("orient",e.orientation.Bottom)("height",e.dims.height)("width",e.dims.width)}}var nh=["ngx-charts-y-axis-ticks",""];function ah(t,a){t&1&&(M(),at(0))}function sh(t,a){if(t&1&&(M(),l(0,"tspan",13),p(1),c()),t&2){let e=a.$implicit,i=a.index,n=u(6);Y("y",i*(8+n.tickSpacing)),o(),D(" ",e," ")}}function oh(t,a){if(t&1&&(M(),$e(0),R(1,sh,2,2,"tspan",12),We()),t&2){let e=u().ngIf;o(),_("ngForOf",e)}}function rh(t,a){if(t&1&&(M(),$e(0),R(1,oh,2,1,"ng-container",11),We()),t&2){let e=a.ngIf;u(2);let i=Z(8);o(),_("ngIf",e.length>1)("ngIfElse",i)}}function lh(t,a){if(t&1&&R(0,rh,2,2,"ng-container",8),t&2){let e=u(2).$implicit,i=u();_("ngIf",i.tickChunks(e))}}function ch(t,a){if(t&1&&p(0),t&2){let e=u().ngIf,i=u(2);D(" ",i.tickTrim(e)," ")}}function dh(t,a){if(t&1&&(M(),$e(0),l(1,"title"),p(2),c(),l(3,"text",9),R(4,ah,1,0,"ng-container",10),c(),R(5,lh,1,1,"ng-template",null,1,It)(7,ch,1,1,"ng-template",null,2,It),We()),t&2){let e=a.ngIf,i=Z(6),n=Z(8),s=u(2);o(2),C(e),o(),Fe("font-size","12px"),Y("dy",s.dy)("x",s.x1)("y",s.y1)("text-anchor",s.textAnchor),o(),_("ngIf",s.wrapTicks)("ngIfThen",i)("ngIfElse",n)}}function ph(t,a){if(t&1&&(M(),l(0,"g",7),R(1,dh,9,10,"ng-container",8),c()),t&2){let e=a.$implicit,i=u();Y("transform",i.transform(e)),o(),_("ngIf",i.tickFormat(e))}}function hh(t,a){if(t&1&&(M(),y(0,"path",14)),t&2){let e=u();Y("d",e.referenceAreaPath)("transform",e.gridLineTransform())}}function mh(t,a){if(t&1&&(M(),y(0,"line",16)),t&2){let e=u(3);Y("x2",e.gridLineWidth)}}function uh(t,a){if(t&1&&(M(),y(0,"line",16)),t&2){let e=u(3);Y("x2",-e.gridLineWidth)}}function gh(t,a){if(t&1&&(M(),l(0,"g"),R(1,mh,1,1,"line",15)(2,uh,1,1,"line",15),c()),t&2){let e=u(2);Y("transform",e.gridLineTransform()),o(),_("ngIf",e.orient===e.Orientation.Left),o(),_("ngIf",e.orient===e.Orientation.Right)}}function fh(t,a){if(t&1&&(M(),l(0,"g"),R(1,gh,3,3,"g",8),c()),t&2){let e=a.$implicit,i=u();Y("transform",i.transform(e)),o(),_("ngIf",i.showGridLines)}}function _h(t,a){if(t&1&&(M(),l(0,"g")(1,"title"),p(2),c(),l(3,"text",19),p(4),c()()),t&2){let e=u(2).$implicit,i=u();o(2),C(i.tickTrim(i.tickFormat(e.value))),o(),Y("dy",i.dy)("y",-6)("x",i.gridLineWidth)("text-anchor",i.textAnchor),o(),D(" ",e.name," ")}}function xh(t,a){if(t&1&&(M(),l(0,"g"),y(1,"line",18),R(2,_h,5,6,"g",8),c()),t&2){let e=u().$implicit,i=u();Y("transform",i.transform(e.value)),o(),Y("x2",i.gridLineWidth),o(),_("ngIf",i.showRefLabels)}}function vh(t,a){if(t&1&&(M(),l(0,"g",17),R(1,xh,3,3,"g",8),c()),t&2){let e=u();o(),_("ngIf",e.showRefLines)}}var Ch=["ngx-charts-y-axis",""];function yh(t,a){if(t&1){let e=E();M(),l(0,"g",2),k("dimensionsChanged",function(n){w(e);let s=u();return I(s.emitTicksWidth(n))}),c()}if(t&2){let e=u();_("trimTicks",e.trimTicks)("maxTickLength",e.maxTickLength)("tickFormatting",e.tickFormatting)("tickArguments",e.tickArguments)("tickValues",e.ticks)("tickStroke",e.tickStroke)("scale",e.yScale)("orient",e.yOrient)("showGridLines",e.showGridLines)("gridLineWidth",e.dims.width)("referenceLines",e.referenceLines)("showRefLines",e.showRefLines)("showRefLabels",e.showRefLabels)("height",e.dims.height)("wrapTicks",e.wrapTicks)}}function bh(t,a){if(t&1&&(M(),y(0,"g",3)),t&2){let e=u();_("label",e.labelText)("offset",e.labelOffset)("orient",e.yOrient)("height",e.dims.height)("width",e.dims.width)}}var Th=["ngx-charts-svg-linear-gradient",""];function Sh(t,a){if(t&1&&(M(),y(0,"stop")),t&2){let e=a.$implicit;Fe("stop-color",e.color)("stop-opacity",e.opacity),Y("offset",e.offset+"%")}}var Lh=["ngx-charts-grid-panel",""],Ah=["ngx-charts-grid-panel-series",""];function wh(t,a){if(t&1&&(M(),y(0,"g",1)),t&2){let e=a.$implicit;$t("grid-panel",!0)("odd",e.class==="odd")("even",e.class==="even"),_("height",e.height)("width",e.width)("x",e.x)("y",e.y)}}var Ih=["tooltipTemplate"];var kh=(t,a)=>[t,a];var Dh=`.ngx-charts-outer{animation:chartFadeIn linear .6s}@keyframes chartFadeIn{0%{opacity:0}
120%{opacity:0}to{opacity:1}}.ngx-charts{float:left;overflow:visible}.ngx-charts .circle,.ngx-charts .cell,.ngx-charts .bar,.ngx-charts .node,.ngx-charts .link,.ngx-charts .arc{cursor:pointer}.ngx-charts .bar.active,.ngx-charts .bar:hover,.ngx-charts .cell.active,.ngx-charts .cell:hover,.ngx-charts .arc.active,.ngx-charts .arc:hover,.ngx-charts .node.active,.ngx-charts .node:hover,.ngx-charts .link.active,.ngx-charts .link:hover,.ngx-charts .card.active,.ngx-charts .card:hover{opacity:.8;transition:opacity .1s ease-in-out}.ngx-charts .bar:focus,.ngx-charts .cell:focus,.ngx-charts .arc:focus,.ngx-charts .node:focus,.ngx-charts .link:focus,.ngx-charts .card:focus{outline:none}.ngx-charts .bar.hidden,.ngx-charts .cell.hidden,.ngx-charts .arc.hidden,.ngx-charts .node.hidden,.ngx-charts .link.hidden,.ngx-charts .card.hidden{display:none}.ngx-charts g:focus{outline:none}.ngx-charts .line-series.inactive,.ngx-charts .line-series-range.inactive,.ngx-charts .polar-series-path.inactive,.ngx-charts .polar-series-area.inactive,.ngx-charts .area-series.inactive{transition:opacity .1s ease-in-out;opacity:.2}.ngx-charts .line-highlight{display:none}.ngx-charts .line-highlight.active{display:block}.ngx-charts .area{opacity:.6}.ngx-charts .circle:hover{cursor:pointer}.ngx-charts .label{font-size:12px;font-weight:400}.ngx-charts .tooltip-anchor{fill:#000}.ngx-charts .gridline-path{stroke:#ddd;stroke-width:1;fill:none}.ngx-charts .refline-path{stroke:#a8b2c7;stroke-width:1;stroke-dasharray:5;stroke-dashoffset:5}.ngx-charts .refline-label{font-size:9px}.ngx-charts .reference-area{fill-opacity:.05;fill:#000}.ngx-charts .gridline-path-dotted{stroke:#ddd;stroke-width:1;fill:none;stroke-dasharray:1,20;stroke-dashoffset:3}.ngx-charts .grid-panel rect{fill:none}.ngx-charts .grid-panel.odd rect{fill:#0000000d} 2`;var Eh=["ngx-charts-bar",""];function Bh(t,a){if(t&1&&(M(),l(0,"defs"),y(1,"g",2),c()),t&2){let e=u();o(),_("orientation",e.orientation)("name",e.gradientId)("stops",e.gradientStops)}}var Nh=["ngx-charts-bar-label",""];var Mh=["ngx-charts-series-vertical",""];function Fh(t,a){if(t&1){let e=E();M(),l(0,"g",2),k("select",function(n){w(e);let s=u(2);return I(s.onClick(n))})("activate",function(n){w(e);let s=u(2);return I(s.activate.emit(n))})("deactivate",function(n){w(e);let s=u(2);return I(s.deactivate.emit(n))}),c()}if(t&2){let e=a.$implicit,i=u(2);_("@animationState","active")("@.disabled",!i.animations)("width",e.width)("height",e.height)("x",e.x)("y",e.y)("fill",e.color)("stops",e.gradientStops)("data",e.data)("orientation",i.barOrientation.Vertical)("roundEdges",e.roundEdges)("gradient",i.gradient)("ariaLabel",e.ariaLabel)("isActive",i.isActive(e.data))("tooltipDisabled",i.tooltipDisabled)("tooltipPlacement",i.tooltipPlacement)("tooltipType",i.tooltipType)("tooltipTitle",i.tooltipTemplate?void 0:e.tooltipText)("tooltipTemplate",i.tooltipTemplate)("tooltipContext",e.data)("noBarWhenZero",i.noBarWhenZero)("animations",i.animations)}}function Rh(t,a){if(t&1&&(M(),l(0,"g"),R(1,Fh,1,22,"g",1),c()),t&2){let e=u();o(),_("ngForOf",e.bars)("ngForTrackBy",e.trackBy)}}function Oh(t,a){if(t&1){let e=E();M(),l(0,"g",2),k("select",function(n){w(e);let s=u(2);return I(s.onClick(n))})("activate",function(n){w(e);let s=u(2);return I(s.activate.emit(n))})("deactivate",function(n){w(e);let s=u(2);return I(s.deactivate.emit(n))}),c()}if(t&2){let e=a.$implicit,i=u(2);_("width",e.width)("height",e.height)("x",e.x)("y",e.y)("fill",e.color)("stops",e.gradientStops)("data",e.data)("orientation",i.barOrientation.Vertical)("roundEdges",e.roundEdges)("gradient",i.gradient)("ariaLabel",e.ariaLabel)("isActive",i.isActive(e.data))("tooltipDisabled",i.tooltipDisabled)("tooltipPlacement",i.tooltipPlacement)("tooltipType",i.tooltipType)("tooltipTitle",i.tooltipTemplate?void 0:e.tooltipText)("tooltipTemplate",i.tooltipTemplate)("tooltipContext",e.data)("noBarWhenZero",i.noBarWhenZero)("animations",i.animations)}}function Ph(t,a){if(t&1&&(M(),l(0,"g"),R(1,Oh,1,20,"g",1),c()),t&2){let e=u();o(),_("ngForOf",e.bars)("ngForTrackBy",e.trackBy)}}function Vh(t,a){if(t&1){let e=E();M(),l(0,"g",4),k("dimensionsChanged",function(n){let s=w(e).index,r=u(2);return I(r.dataLabelHeightChanged.emit({size:n,index:s}))}),c()}if(t&2){let e=a.$implicit,i=u(2);_("barX",e.x)("barY",e.y)("barWidth",e.width)("barHeight",e.height)("value",e.total)("valueFormatting",i.dataLabelFormatting)("orientation",i.barOrientation.Vertical)}}function Gh(t,a){if(t&1&&(M(),l(0,"g"),R(1,Vh,1,7,"g",3),c()),t&2){let e=u();o(),_("ngForOf",e.barsForDataLabels)("ngForTrackBy",e.trackDataLabelBy)}}function Hh(t,a){if(t&1){let e=E();M(),l(0,"g",6),k("dimensionsChanged",function(n){w(e);let s=u();return I(s.updateXAxisHeight(n))}),c()}if(t&2){let e=u();_("xScale",e.groupScale)("dims",e.dims)("showLabel",e.showXAxisLabel)("labelText",e.xAxisLabel)("trimTicks",e.trimXAxisTicks)("rotateTicks",e.rotateXAxisTicks)("maxTickLength",e.maxXAxisTickLength)("tickFormatting",e.xAxisTickFormatting)("ticks",e.xAxisTicks)("xAxisOffset",e.dataLabelMaxHeight.negative)("wrapTicks",e.wrapTicks)}}function Xh(t,a){if(t&1){let e=E();M(),l(0,"g",7),k("dimensionsChanged",function(n){w(e);let s=u();return I(s.updateYAxisWidth(n))}),c()}if(t&2){let e=u();_("yScale",e.valueScale)("dims",e.dims)("showGridLines",e.showGridLines)("showLabel",e.showYAxisLabel)("labelText",e.yAxisLabel)("trimTicks",e.trimYAxisTicks)("maxTickLength",e.maxYAxisTickLength)("tickFormatting",e.yAxisTickFormatting)("ticks",e.yAxisTicks)("wrapTicks",e.wrapTicks)}}function Yh(t,a){if(t&1){let e=E();M(),l(0,"g",9),k("select",function(n){let s=w(e).$implicit,r=u(2);return I(r.onClick(n,s))})("activate",function(n){let s=w(e).$implicit,r=u(2);return I(r.onActivate(n,s))})("deactivate",function(n){let s=w(e).$implicit,r=u(2);return I(r.onDeactivate(n,s))})("dataLabelHeightChanged",function(n){let s=w(e).index,r=u(2);return I(r.onDataLabelMaxHeightChanged(n,s))}),c()}if(t&2){let e=a.$implicit,i=u(2);_("@animationState","active")("activeEntries",i.activeEntries)("xScale",i.innerScale)("yScale",i.valueScale)("colors",i.colors)("series",e.series)("dims",i.dims)("gradient",i.gradient)("tooltipDisabled",i.tooltipDisabled)("tooltipTemplate",i.tooltipTemplate)("showDataLabel",i.showDataLabel)("dataLabelFormatting",i.dataLabelFormatting)("seriesName",e.name)("roun
2dEdges",i.roundEdges)("animations",i.animations)("noBarWhenZero",i.noBarWhenZero),Y("transform",i.groupTransform(e))}}function zh(t,a){if(t&1&&(M(),l(0,"g"),R(1,Yh,1,17,"g",8),c()),t&2){let e=u();o(),_("ngForOf",e.results)("ngForTrackBy",e.trackBy)}}function $h(t,a){if(t&1){let e=E();M(),l(0,"g",9),k("select",function(n){let s=w(e).$implicit,r=u(2);return I(r.onClick(n,s))})("activate",function(n){let s=w(e).$implicit,r=u(2);return I(r.onActivate(n,s))})("deactivate",function(n){let s=w(e).$implicit,r=u(2);return I(r.onDeactivate(n,s))})("dataLabelHeightChanged",function(n){let s=w(e).index,r=u(2);return I(r.onDataLabelMaxHeightChanged(n,s))}),c()}if(t&2){let e=a.$implicit,i=u(2);_("activeEntries",i.activeEntries)("xScale",i.innerScale)("yScale",i.valueScale)("colors",i.colors)("series",e.series)("dims",i.dims)("gradient",i.gradient)("tooltipDisabled",i.tooltipDisabled)("tooltipTemplate",i.tooltipTemplate)("showDataLabel",i.showDataLabel)("dataLabelFormatting",i.dataLabelFormatting)("seriesName",e.name)("roundEdges",i.roundEdges)("animations",i.animations)("noBarWhenZero",i.noBarWhenZero),Y("transform",i.groupTransform(e))}}function Wh(t,a){if(t&1&&(M(),l(0,"g"),R(1,$h,1,16,"g",8),c()),t&2){let e=u();o(),_("ngForOf",e.results)("ngForTrackBy",e.trackBy)}}function jh(t,a,e){e=e||{};let i,n,s,r=null,d=0;function m(){d=e.leading===!1?0:+new Date,r=null,s=t.apply(i,n)}return function(){let h=+new Date;!d&&e.leading===!1&&(d=h);let x=a-(h-d);return i=this,n=arguments,x<=0?(clearTimeout(r),r=null,d=h,s=t.apply(i,n)):!r&&e.trailing!==!1&&(r=setTimeout(m,x)),s}}function Uh(t,a){return function(i,n,s){return{configurable:!0,enumerable:s.enumerable,get:function(){return Object.defineProperty(this,n,{configurable:!0,enumerable:s.enumerable,value:jh(s.value,t,a)}),this[n]}}}}var H=(function(t){return t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t.Center="center",t})(H||{}),Tt=7;function hl(t,a,e){if(e===H.Top)return t.top-Tt;if(e===H.Bottom)return t.top+t.height-a.height+Tt;if(e===H.Center)return t.top+t.height/2-a.height/2}function ml(t,a,e){if(e===H.Left)return t.left-Tt;if(e===H.Right)return t.left+t.width-a.width+Tt;if(e===H.Center)return t.left+t.width/2-a.width/2}var Pi=class t{static calculateVerticalAlignment(a,e,i){let n=hl(a,e,i);return n+e.height>window.innerHeight&&(n=window.innerHeight-e.height),n}static calculateVerticalCaret(a,e,i,n){let s;n===H.Top&&(s=a.height/2-i.height/2+Tt),n===H.Bottom&&(s=e.height-a.height/2-i.height/2-Tt),n===H.Center&&(s=e.height/2-i.height/2);let r=hl(a,e,n);return r+e.height>window.innerHeight&&(s+=r+e.height-window.innerHeight),s}static calculateHorizontalAlignment(a,e,i){let n=ml(a,e,i);return n+e.width>window.innerWidth&&(n=window.innerWidth-e.width),n}static calculateHorizontalCaret(a,e,i,n){let s;n===H.Left&&(s=a.width/2-i.width/2+Tt),n===H.Right&&(s=e.width-a.width/2-i.width/2-Tt),n===H.Center&&(s=e.width/2-i.width/2);let r=ml(a,e,n);return r+e.width>window.innerWidth&&(s+=r+e.width-window.innerWidth),s}static shouldFlip(a,e,i,n){let s=!1;return i===H.Right&&a.left+a.width+e.width+n>window.innerWidth&&(s=!0),i===H.Left&&a.left-e.width-n<0&&(s=!0),i===H.Top&&a.top-e.height-n<0&&(s=!0),i===H.Bottom&&a.top+a.height+e.height+n>window.innerHeight&&(s=!0),s}static positionCaret(a,e,i,n,s){let r=0,d=0;return a===H.Right?(d=-7,r=t.calculateVerticalCaret(i,e,n,s)):a===H.Left?(d=e.width,r=t.calculateVerticalCaret(i,e,n,s)):a===H.Top?(r=e.height,d=t.calculateHorizontalCaret(i,e,n,s)):a===H.Bottom&&(r=-7,d=t.calculateHorizontalCaret(i,e,n,s)),{top:r,left:d}}static positionContent(a,e,i,n,s){let r=0,d=0;return a===H.Right?(d=i.left+i.width+n,r=t.calculateVerticalAlignment(i,e,s)):a===H.Left?(d=i.left-e.width-n,r=t.calculateVerticalAlignment(i,e,s)):a===H.Top?(r=i.top-e.height-n,d=t.calculateHorizontalAlignment(i,e,s)):a===H.Bottom&&(r=i.top+i.height+n,d=t.calculateHorizontalAlignment(i,e,s)),{top:r,left:d}}static determinePlacement(a,e,i,n){if(t.shouldFlip(i,e,a,n)){if(a===H.Right)return H.Left;if(a===H.Left)return H.Right;if(a===H.Top)return H.Bottom;if(a===H.Bottom)return H.Top}return a}},qh=(()=>
2{class t{get cssClasses(){let e="ngx-charts-tooltip-content";return e+=` position-${this.placement}`,e+=` type-${this.type}`,e+=` ${this.cssClass}`,e}constructor(e,i,n){this.element=e,this.renderer=i,this.platformId=n}ngAfterViewInit(){setTimeout(this.position.bind(this))}position(){if(!st(this.platformId))return;let e=this.element.nativeElement,i=this.host.nativeElement.getBoundingClientRect();if(!i.height&&!i.width)return;let n=e.getBoundingClientRect();this.checkFlip(i,n),this.positionContent(e,i,n),this.showCaret&&this.positionCaret(i,n),setTimeout(()=>this.renderer.addClass(e,"animate"),1)}positionContent(e,i,n){let{top:s,left:r}=Pi.positionContent(this.placement,n,i,this.spacing,this.alignment);this.renderer.setStyle(e,"top",`${s}px`),this.renderer.setStyle(e,"left",`${r}px`)}positionCaret(e,i){let n=this.caretElm.nativeElement,s=n.getBoundingClientRect(),{top:r,left:d}=Pi.positionCaret(this.placement,i,e,s,this.alignment);this.renderer.setStyle(n,"top",`${r}px`),this.renderer.setStyle(n,"left",`${d}px`)}checkFlip(e,i){this.placement=Pi.determinePlacement(this.placement,i,e,this.spacing)}onWindowResize(){this.position()}static{this.\u0275fac=function(i){return new(i||t)(S(nt),S(qn),S(Yt))}}static{this.\u0275cmp=O({type:t,selectors:[["ngx-tooltip-content"]],viewQuery:function(i,n){if(i&1&&De(kp,5),i&2){let s;Te(s=Se())&&(n.caretElm=s.first)}},hostVars:2,hostBindings:function(i,n){i&1&&k("resize",function(){return n.onWindowResize()},$i),i&2&&Kn(n.cssClasses)},inputs:{host:"host",showCaret:"showCaret",type:"type",placement:"placement",alignment:"alignment",spacing:"spacing",cssClass:"cssClass",title:"title",template:"template",context:"context"},standalone:!1,decls:6,vars:6,consts:[["caretElm",""],[3,"hidden"],[1,"tooltip-content"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"innerHTML"]],template:function(i,n){i&1&&(l(0,"div"),y(1,"span",1,0),l(3,"div",2),R(4,Bp,2,4,"span",3)(5,Np,1,1,"span",4),c()()),i&2&&(o(),Kn(Ts("tooltip-caret position-",n.placement)),_("hidden",!n.showCaret),o(3),_("ngIf",!n.title),o(),_("ngIf",n.title))},dependencies:[je,Wi],styles:[`.ngx-charts-tooltip-content{position:fixed;border-radius:3px;z-index:5000;display:block;font-weight:400;opacity:0;pointer-events:none!important}.ngx-charts-tooltip-content.type-popover{background:#fff;color:#060709;border:1px solid #72809b;box-shadow:0 1px 3px #0003,0 1px 1px #00000024,0 2px 1px -1px #0000001f;font-size:13px;padding:4px}.ngx-charts-tooltip-content.type-popover .tooltip-caret{position:absolute;z-index:5001;width:0;height:0}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-left{border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-right{border-top:7px solid transparent;border-bottom:7px solid transparent;border-right:7px solid #fff}.ngx-charts-tooltip-content.type-popover .tooltip-caret.position-bottom{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #fff}.ngx-charts-tooltip-content.type-tooltip{color:#fff;background:#000000bf;font-size:12px;padding:0 10px;text-align:center;pointer-events:auto}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-left{border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-top{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-right{border-top:7px solid transparent;border-bottom:7px solid transparent;border-right:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content.type-tooltip .tooltip-caret.position-bottom{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(0,0,0,.75)}.ngx-charts-tooltip-content .tooltip-label{display:block;line-height:1em;padding:8px 5px 5px;font-size:1em}.ngx-charts-tooltip-content .tooltip-val{display:block;font-size:1.3em;line-height:1em;padding:0 5px 8px}.ngx-charts-tooltip-content .tooltip-caret{position:absolute;z-index:5001;width:0;height:0}.ngx-charts-tooltip-content.position-right{transform:translate3d(10px,0,0)}.ngx-charts-tooltip-content.position-left{transform:translate3d(-10px,0,0)}.ngx-charts-tooltip-content.position-top{transform:translate3d(0,-10px,0)}.ngx-charts-tooltip-content.position-bottom{transform:translate3d(0,10px,0)}.ngx-charts-tooltip-content.animate{opacity:1;transition:opacity .3s,transform .3s;transform:translateZ(0);pointer-events:auto}.area-tooltip-container{padding:5px 0;pointer-events:none}.tooltip-item{text-align:left;line-height:1.2em;padding:5px 0}.tooltip-item .tooltip-item-color{display:inline-block;height:12px;width:12px;margin-right:5px;color:#5b646b;border-radius:3px} 3`],encapsulation:2})}}return ds([Uh(100)],t.prototype,"onWindowResize",null),t})(),Oa=class{constructor(a){this.injectionService=a,this.defaults={},this.components=new Map}getByType(a=this.type){return this.components.get(a)}create(a){return this.createByType(this.type,a)}createByType(a,e){e=this.assignDefaults(e);let i=this.injectComponent(a,e);return this.register(a,i),i}destroy(a){let e=this.components.get(a.componentType);if(e&&e.length){let i=e.indexOf(a);i>-1&&(e[i].destroy(),e.splice(i,1))}}destroyAll(){this.destroyByType(this.type)}destroyByType(a){let e=this.components.get(a);if(e&&e.length){let i=e.length-1;for(;i>=0;)this.destroy(e[i--])}}injectComponent(a,e){return this.injectionService.appendComponent(a,e)}assignDefaults(a){let e=ze({},this.defaults.inputs),i=ze({},this.defaults.outputs);
3return!a.inputs&&!a.outputs&&(a={inputs:a}),e&&(a.inputs=ze(ze({},e),a.inputs)),i&&(a.outputs=ze(ze({},i),a.outputs)),a}register(a,e){this.components.has(a)||this.components.set(a,[]),this.components.get(a).push(e)}};function Qh(t){return t.element}var bl=(()=>{class t{static{this.globalRootViewContainer=null}static setGlobalRootViewContainer(e){t.globalRootViewContainer=e}constructor(e,i){this.applicationRef=e,this.injector=i}getRootViewContainer(){if(this._container)return this._container;if(t.globalRootViewContainer)return t.globalRootViewContainer;if(this.applicationRef.components.length)return this.applicationRef.components[0];throw new Error("View Container not found! ngUpgrade needs to manually set this via setRootViewContainer or setGlobalRootViewContainer.")}setRootViewContainer(e){this._container=e}getComponentRootNode(e){return Qh(e)?e.element.nativeElement:e.hostView&&e.hostView.rootNodes.length>0?e.hostView.rootNodes[0]:e.location.nativeElement}getRootViewContainerNode(e){return this.getComponentRootNode(e)}projectComponentBindings(e,i){if(i){if(i.inputs!==void 0){let n=Object.getOwnPropertyNames(i.inputs);for(let s of n)e.instance[s]=i.inputs[s]}if(i.outputs!==void 0){let n=Object.getOwnPropertyNames(i.outputs);for(let s of n)e.instance[s]=i.outputs[s]}}return e}appendComponent(e,i={},n){n||(n=this.getRootViewContainer());let s=this.getComponentRootNode(n),r=new Hs(s,this.applicationRef,this.injector),d=new Gs(e),m=r.attach(d);return this.projectComponentBindings(m,i),m}static{this.\u0275fac=function(i){return new(i||t)(pe(vs),pe(ms))}}static{this.\u0275prov=be({token:t,factory:t.\u0275fac})}}return t})(),Ha=(()=>{class t extends Oa{constructor(e){super(e),this.type=qh}static{this.\u0275fac=function(i){return new(i||t)(pe(bl))}}static{this.\u0275prov=be({token:t,factory:t.\u0275fac})}}return t})(),Vt=(function(t){return t.Right="right",t.Below="below",t})(Vt||{}),Oi=(function(t){return t.ScaleLegend="scaleLegend",t.Legend="legend",t})(Oi||{}),W=(function(t){return t.Time="time",t.Linear="linear",t.Ordinal="ordinal",t.Quantile="quantile",t})(W||{});function Xa(t){return t instanceof Date?t=t.toLocaleDateString():t=t.toLocaleString(),t}function Kh(t){return t.toLocaleString().replace(/[&'`"<>]/g,a=>({"&":"&","'":"'","`":"`",'"':""","<":"<",">":">"})[a])}var Zh=(()=>{class t{constructor(){this.isActive=!1,this.select=new z,this.activate=new z,this.deactivate=new z,this.toggle=new z}get trimmedLabel(){return this.formattedLabel||"(empty)"}onMouseEnter(){this.activate.emit({name:this.label})}onMouseLeave(){this.deactivate.emit({name:this.label})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["ngx-charts-legend-entry"]],hostBindings:function(i,n){i&1&&k("mouseenter",function(){return n.onMouseEnter()})("mouseleave",function(){return n.onMouseLeave()})},inputs:{color:"color",label:"label",formattedLabel:"formattedLabel",isActive:"isActive"},outputs:{select:"select",activate:"activate",deactivate:"deactivate",toggle:"toggle"},standalone:!1,decls:4,vars:6,consts:[["tabindex","-1",1,"legend-entry",3,"click","title"],[1,"legend-label-color",3,"click"],[1,"legend-label-text"]],template:function(i,n){i&1&&(l(0,"span",0),k("click",function(){return n.select.emit(n.formattedLabel)}),l(1,"span",1),k("click",function(){return n.toggle.emit(n.formattedLabel)}),c(),l(2,"span",2),p(3),c()()),i&2&&($t("active",n.isActive),_("title",n.formattedLabel),o(),Fe("background-color",n.color),o(2),D(" ",n.trimmedLabel," "))},encapsulation:2,changeDetection:0})}}return t})(),Jh=(()=>{class t{constructor(e){this.cd=e,this.horizontal=!1,this.labelClick=new z,this.labelActivate=new z,this.labelDeactivate=new z,this.legendEntries=[]}ngOnChanges(e){this.update()}update(){this.cd.markForCheck(),this.legendEntries=this.getLegendEntries()}getLegendEntries(){let e=[];for(let i of this.data){let n=Xa(i);e.findIndex(r=>r.label===n)===-1&&e.push({label:i,formattedLabel:n,color:this.colors.getColor(i)})}return e}isActive(e){return this.activeEntries?this.activeEntries.find(n=>e.label===n.name)!==void 0:!1}activate(e){this.labelActivate.emit(e)}deactivate(e){this.labelDeactivate.emit(e)}trackBy(e,i){return i.label}static{this.\u0275fac=function(i){return new(i||t)(S(U))}}static{this.\u0275cmp=O({type:t,selectors:[["ngx-charts-legend"]],inputs:{data:"data",title:"title",colors:"colors",height:"height",width:"width",activeEntries:"activeEntries",horizontal:"horizontal"},outputs:{labelClick:"labelClick",labelActivate:"labelActivate",labelDeactivate:"labelDeactivate"},standalone:!1,features:[ae],decls:5,vars:13,consts:[["class","legend-title",4,"ngIf"],[1,"legend-wrap"],[1,"legend-labels"],["class","legend-label",4,"ngFor","ngForOf","ngForTrackBy"],[1,"legend-title"],[1,"legend-title-text"],[1,"legend-label"],[3,"select","activate","deactivate","label","formattedLabel","color","isActive"]],template:function(i,n){i&1&&(l(0,"div"),R(1,Mp,3,1,"header",0),l(2,"div",1)(3,"ul",2),R(4,Fp,2,4,"li",3),c()()()),i&2&&(Fe("width",n.width,"px"),o(),_("ngIf",(n.title==null?null:n.title.length)>0),o(2),Fe("max-height",n.horizontal?null:n.height-45,"px")("max-width",n.horizontal&&n.width?n.width-10:null,"px"),$t("horizontal-legend",n.horizontal)("vertical-legend",!n.horizontal),o(),_("ngForOf",n.legendEntries)("ngForTrackBy",n.trackBy))}
3,dependencies:[pt,je,Zh],styles:[`.chart-legend{display:inline-block;padding:0;max-width:100%;box-sizing:border-box;overflow:hidden;vertical-align:top}.chart-legend .legend-title{white-space:nowrap;overflow:hidden;margin-left:10px;margin-bottom:5px;font-size:14px;font-weight:700}.chart-legend ul,.chart-legend li{padding:0;margin:0;list-style:none}.chart-legend .vertical-legend .legend-label{width:100%;max-width:calc(100% - 20px)}.chart-legend .vertical-legend .legend-entry{display:flex;flex-grow:1;align-items:center;overflow:hidden}.chart-legend .legend-wrap{width:calc(100% - 10px);min-width:0}.chart-legend .legend-labels{line-height:85%;list-style:none;text-align:left;display:flex;flex-wrap:wrap;white-space:nowrap;border-radius:3px;background:#0000000d}.chart-legend .legend-labels.vertical-legend{overflow-x:hidden;overflow-y:auto}.chart-legend .legend-labels.horizontal-legend{max-width:100%;overflow-x:auto;overflow-y:hidden}.chart-legend .legend-labels.horizontal-legend li{display:inline-block}.chart-legend .legend-label{cursor:pointer;font-size:90%;margin:8px;color:#afb7c8}.chart-legend .legend-label:hover{color:#000;-webkit-transition:.2s;-moz-transition:.2s;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{display:inline-block;height:15px;width:15px;min-width:15px;margin-right:5px;color:#5b646b;border-radius:3px}.chart-legend .legend-label-text{display:inline-block;vertical-align:top;line-height:15px;font-size:12px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chart-legend .legend-title-text{vertical-align:bottom;display:inline-block;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} 4`],encapsulation:2,changeDetection:0})}}return t})(),em=(()=>{class t{constructor(){this.horizontal=!1}ngOnChanges(e){let i=this.gradientString(this.colors.range(),this.colors.domain()),n=this.horizontal?"right":"bottom";this.gradient=`linear-gradient(to ${n}, ${i})`}gradientString(e,i){i.push(1);let n=[];return e.reverse().forEach((s,r)=>{n.push(`${s} ${Math.round(i[r]*100)}%`)}),n.join(", ")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["ngx-charts-scale-legend"]],inputs:{valueRange:"valueRange",colors:"colors",height:"height",width:"width",horizontal:"horizontal"},standalone:!1,features:[ae],decls:8,vars:10,consts:[[1,"scale-legend"],[1,"scale-legend-label"],[1,"scale-legend-wrap"]],template:function(i,n){i&1&&(l(0,"div",0)(1,"div",1)(2,"span"),p(3),c()(),y(4,"div",2),l(5,"div",1)(6,"span"),p(7),c()()()),i&2&&(Fe("height",n.horizontal?void 0:n.height,"px")("width",n.width,"px"),$t("horizontal-legend",n.horizontal),o(3),C(n.valueRange[1].toLocaleString()),o(),Fe("background",n.gradient),o(3),C(n.valueRange[0].toLocaleString()))},styles:[`.chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .scale-legend{text-align:center;display:flex;flex-direction:column}.chart-legend .scale-legend-wrap{display:inline-block;flex:1;width:30px;border-radius:5px;margin:0 auto}.chart-legend .scale-legend-label{font-size:12px}.chart-legend .horizontal-legend.scale-legend{flex-direction:row}.chart-legend .horizontal-legend .scale-legend-wrap{width:auto;height:30px;margin:0 16px} 5`],encapsulation:2,changeDetection:0})}}return t})(),tm=(()=>{class t{constructor(){this.showLegend=!1,this.animations=!0,this.legendLabelClick=new z,this.legendLabelActivate=new z,this.legendLabelDeactivate=new z,this.LegendPosition=Vt,this.LegendType=Oi}ngOnChanges(e){this.update()}update(){let e=0;this.showLegend&&(this.legendType=this.getLegendType(),(!this.legendOptions||this.legendOptions.position===Vt.Right)&&(this.legendType===Oi.ScaleLegend?e=1:e=2));let i=12-e;this.chartWidth=Math.floor(this.view[0]*i/12),this.legendWidth=!this.legendOptions||this.legendOptions.position===Vt.Right?Math.floor(this.view[0]*e/12):this.chartWidth}getLegendType(){return this.legendOptions.scaleType===W.Linear?Oi.ScaleLegend:Oi.Legend}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["ngx-charts-chart"]],inputs:{view:"view",showLegend:"showLegend",legendOptions:"legendOptions",legendType:"legendT
5ype",activeEntries:"activeEntries",animations:"animations"},outputs:{legendLabelClick:"legendLabelClick",legendLabelActivate:"legendLabelActivate",legendLabelDeactivate:"legendLabelDeactivate"},standalone:!1,features:[Ss([Ha]),ae],ngContentSelectors:Rp,decls:5,vars:8,consts:[[1,"ngx-charts-outer"],[1,"ngx-charts"],["class","chart-legend",3,"width","maxWidth","horizontal","valueRange","colors","height",4,"ngIf"],["class","chart-legend",3,"width","maxWidth","horizontal","data","title","colors","height","activeEntries","labelClick","labelActivate","labelDeactivate",4,"ngIf"],[1,"chart-legend",3,"horizontal","valueRange","colors","height","width"],[1,"chart-legend",3,"labelClick","labelActivate","labelDeactivate","horizontal","data","title","colors","height","width","activeEntries"]],template:function(i,n){i&1&&(Cs(),l(0,"div",0),M(),l(1,"svg",1),ys(2),c(),R(3,Op,1,9,"ngx-charts-scale-legend",2)(4,Pp,1,11,"ngx-charts-legend",3),c()),i&2&&(Fe("width",n.view[0],"px")("height",n.view[1],"px"),o(),Y("width",n.chartWidth)("height",n.view[1]),o(2),_("ngIf",n.showLegend&&n.legendType===n.LegendType.ScaleLegend),o(),_("ngIf",n.showLegend&&n.legendType===n.LegendType.Legend))},dependencies:[je,Jh,em],encapsulation:2,changeDetection:0})}}return t})(),im=(()=>{class t{constructor(e,i){this.element=e,this.zone=i,this.visible=new z,this.isVisible=!1,this.runCheck()}destroy(){clearTimeout(this.timeout)}onVisibilityChange(){this.zone.run(()=>{this.isVisible=!0,this.visible.emit(!0)})}runCheck(){let e=()=>{if(!this.element)return;let{offsetHeight:i,offsetWidth:n}=this.element.nativeElement;i&&n?(clearTimeout(this.timeout),this.onVisibilityChange()):(clearTimeout(this.timeout),this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>e(),100)}))};this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>e())})}static{this.\u0275fac=function(i){return new(i||t)(S(nt),S(Un))}}static{this.\u0275dir=Qn({type:t,selectors:[["visibility-observer"]],outputs:{visible:"visible"},standalone:!1})}}return t})();function ul(t){return toString.call(t)==="[object Date]"}var nm=(()=>{class t{constructor(e,i,n,s){this.chartElement=e,this.zone=i,this.cd=n,this.platformId=s,this.scheme="cool",this.schemeType=W.Ordinal,this.animations=!0,this.select=new z}ngOnInit(){ji(this.platformId)&&(this.animations=!1)}ngAfterViewInit(){this.bindWindowResizeEvent(),this.visibilityObserver=new im(this.chartElement,this.zone),this.visibilityObserver.visible.subscribe(this.update.bind(this))}ngOnDestroy(){this.unbindEvents(),this.visibilityObserver&&(this.visibilityObserver.visible.unsubscribe(),this.visibilityObserver.destroy())}ngOnChanges(e){this.update()}update(){if(this.results?this.results=this.cloneData(this.results):this.results=[],this.view)this.width=this.view[0],this.height=this.view[1];else{let e=this.getContainerDims();e&&(this.width=e.width,this.height=e.height)}this.width||(this.width=600),this.height||(this.height=400),this.width=Math.floor(this.width),this.height=Math.floor(this.height),this.cd&&this.cd.markForCheck()}getContainerDims(){let e,i,n=this.chartElement.nativeElement;if(st(this.platformId)&&n.parentNode!==null){let s=n.parentNode.getBoundingClientRect();e=s.width,i=s.height}return e&&i?{width:e,height:i}:null}formatDates(){for(let e=0;e<this.results.length;e++){let i=this.results[e];if(i.label=i.name,ul(i.label)&&(i.label=i.label.toLocaleDateString()),i.series)for(let n=0;n<i.series.length;n++){let s=i.series[n];s.label=s.name,ul(s.label)&&(s.label=s.label.toLocaleDateString())}}}unbindEvents(){this.resizeSubscription&&this.resizeSubscription.unsubscribe()}bindWindowResizeEvent(){if(!st(this.platformId))return;let i=ps(window,"resize").pipe(hs(200)).subscribe(n=>{this.update(),this.cd&&this.cd.markForCheck()});this.resizeSubscription=i}cloneData(e){let i=[];for(let n of e){let s={};if(n.name!==void 0&&(s.name=n.name),n.value!==void 0&&(s.value=n.value),n.series!==void 0){s.series=[];for(let r of n.series){let d=Object.assign({},r);s.series.push(d)}}n.extra!==void 0&&(s.extra=JSON.parse(JSON.stringify(n.extra))),n.source!==void 0&&(s.source=n.source),n.target!==void 0&&(s.target=n.target),i.push(s)}return i}static{this.\u0275fac=function(i){return new(i||t)(S(nt),S(Un),S(U),S(Yt))}}static{this.\u0275cmp=O({type:t,selectors:[["base-chart"]],inputs:{results:"results",view:"view",scheme:"scheme",schemeType:"schemeType",customColors:"customColors",animations:"animations"},outputs:{select:"select"},standalone:!1,features:[ae],decls:1,vars:0,template:function(i,n){i&1&&y(0,"div")},encapsulation:2})}}return t})(),J=(function(t){return t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t})(J||{}),Tl=(()=>{class t{constructor(e){this.textHeight=25,this.margin=5,this.element=e.nativeElement}ngOnChanges(e){this.update()}update(){switch(this.strokeWidth="0.01",this.textAnchor="middle",this.transform="",this.orient){case J.Top:this.y=this.offset,this.x=this.width/2;break;case J.Bottom:this.y=this.offset,this.x=this.width/2;break;case J.Left:this.y=-(this.offset+this.textHeight+this.margin),this.x=-this.height/2,this.transform="rotate(270)";break;case J.Right:this.y=this.offset+this.margin,this.x=-this.height/2,this.transform="rotate(270)";break;default:}}static{this.\u0275fac=function(i){return new(i||t)(S(nt))}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-axis-label",""]],inputs:{orient:"orient",label:"label",offset:"offset",width:"width",height:"height"},standalone:!1,features:[ae],attrs:Vp,decls:2,vars:6,template:function(i,n){i&1&&(M(),l(0,"text"),p(1),c()),i&2&&(Y("stroke-width",n.strokeWidth)("x",n.x)("y",n.y)("text-anchor",n.textAnchor)("transform",n.transform),o(),D(" ",n.label," "))},encapsulation:2,changeDetection:0})}}return t})();function Pa(t,a=16){return typeof t!="string"?typeof t=="number"?t+"":"":(t=t.trim(),t.length<=a?t:`${t.slice(0,a)}...`)}function Sl(t,a){if(t.length>a){let e=[],i=Math.floor(t.length/a);for(let n=0;n<t.length;n++)n%i===0&&e.push(t[n]);t=e}return t}function Ll(t,a,e){let i=(t||"").toString(),n=[];if(/\s/.test(i))n=i.split(/\s+/).reduce((s,r)=>{let d=(s.pop()||"")+" ";return d.length+r.length>a?[...s,d.trim(),r.trim()]:[...s,d+r]},[]);else{let s=0;for(;s<i.length;)n.push(i.substring(s,s+a)),s+=a}return n.length>e&&(n=n.splice(0,e),n[n.length-1]+="..."),n}var Re=(function(t){return t.Start="start",t.Middle="middle",t.End="end",t})(Re||{});function dt(t,a,e,i,n,[s,r,d,m]){let h="";return e=Math.floor(e),i=Math.floor(i),e=e===0?1:e,i=i===0?1:i,h=`M${[t+n,a]}`,h+=`h${e-2*n}`,r?h+=`a${[n,n]} 0 0 1 ${[n,n]}`:h+=`h${n}v${n}`,h+=`v${i-2*n}`,m?h+=`a${[n,n]} 0 0 1 ${[-n,n]}`:h+=`v${n}h${-n}`,h+=`h${2*n-e}`,d?h+=`a${[n,n]} 0 0 1 ${[-n,-n]}`:h+=`h${-n}v${-n}`,h+=`v${2*n-i}`,s?h+=`a${[n,n]} 0 0 1 ${[n,-n]}`:h+=`v${-n}h${n}`,h+="z",h}var gl=(()=>{class t{get isWrapTicksSupported(){return this.wrapTicks&&this.scale.step}constructor(e){this.platformId=e,this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.rotateTicks=!0,this.wrapTicks=!1,this.showRefLabels=!1,this.showRefLines=!1,this.dimensionsChanged=new z,this.verticalSpacing=20,this.rotateLabels=!1,this.innerTickSize=6,this.outerTickSize=6,this.tickPadding=3,this.textAnchor=Re.Middle,this.maxTicksLength=0,this.maxAllowedLength=16,this.height=0,this.approxHeight=10,this.maxPossibleLengthForTickIfWrapped=16,this.referenceLineLength=0}ngOnChanges(e){this.update()}ngAfterViewInit(){setTimeout(()=>this.updateDims())}updateDims(){if(!st(this.platformId)){this.dimensionsChanged.emit({height:this.approxHeight});return}let e=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().height,10);e!==this.height&&(this.height=e,this.dimensionsChanged.emit({height:this.height}),setTimeout(()=>this.updateDims()))}update(){let e=this.scale;this.adjustedScale=this.scale.bandwidth?function(s){return this.scale(s)+this.scale.bandwidth()*.5}:this.scale,this.ticks=this.getTicks();let i=this.orient===J.Top||this.orient===J.Right?-1:1;switch(this.tickSpacing=Math.max(this.innerTickSize,0)+this.tickPadding,this.orient){case J.Bottom:this.transform=function(s){return"translate("+this.adjustedScale(s)+",0)"},this.textAnchor=Re.Middle,this.x2=this.innerTickSize*i,this.x1=this.tickSpacing*i,this.dx=i<0?"0em":".71em";break;case J.Left:this.transform=function(s){return"translate(0,"+this.adjustedScale(s)+")"},this.textAnchor=Re.End,this.y2=this.innerTickSize*-i,this.y1=this.tickSpacing*-i,this.dx=".32em";break;case J.Top:this.transform=function(s){return"translate("+this.adjustedScale(s)+",0)"},this.textAnchor=Re.Middle,this.y2=this.innerTickSize*i,this.y1=this.tickSpacing*i,this.dx=i<0?"0em":".71em";break;case J.Right:this.transform=function(s){return"translate(0,"+this.adjustedScale(s)+")"},this.textAnchor=Re.Start,this.x2=this.innerTickSize*-i,this.x1=this.tickSpacing*-i,this.dx=".32em";break;default:}this.tickFormatting?this.tickFormat=this.tickFormatting:e.tickFormat?this.tickFormat=e.tickFormat.apply(e,this.tickArguments):this.tickFormat=function(s){return s.constructor.name==="Date"?s.toLocaleDateString():s.toLocaleStr
5ing()};let n=this.rotateTicks?this.getRotationAngle(this.ticks):null;this.textTransform="",n&&n!==0?(this.textTransform=`rotate(${n})`,this.textAnchor=Re.End,this.verticalSpacing=10):this.textAnchor=Re.Middle,setTimeout(()=>this.updateDims())}setReferencelines(){this.refMin=this.adjustedScale(Math.min.apply(null,this.referenceLines.map(e=>e.value))),this.refMax=this.adjustedScale(Math.max.apply(null,this.referenceLines.map(e=>e.value))),this.referenceLineLength=this.referenceLines.length,this.referenceAreaPath=dt(this.refMax,-this.gridLineHeight+25,this.refMin-this.refMax,this.gridLineHeight,0,[!1,!1,!1,!1])}getRotationAngle(e){let i=0;this.maxTicksLength=0;for(let v=0;v<e.length;v++){let L=this.tickFormat(e[v]).toString(),A=L.length;this.trimTicks&&(A=this.tickTrim(L).length),A>this.maxTicksLength&&(this.maxTicksLength=A)}let n=Math.min(this.maxTicksLength,this.maxAllowedLength),s=7,r=n*s,d=r,m=Math.floor(this.width/e.length);for(;d>m&&i>-90;)i-=30,d=Math.cos(i*(Math.PI/180))*r;let h=14;if(this.isWrapTicksSupported){let v=this.ticks.reduce((A,B)=>B.length>A.length?B:A,"");h=14*(this.tickChunks(v).length||1),this.maxPossibleLengthForTickIfWrapped=this.getMaxPossibleLengthForTick(v)}let x=i!==0?Math.max(Math.abs(Math.sin(i*Math.PI/180))*this.maxTickLength*s,10):h;return this.approxHeight=Math.min(x,200),this.showRefLines&&this.referenceLines&&this.setReferencelines(),i}getTicks(){let e,i=this.getMaxTicks(20),n=this.getMaxTicks(100);return this.tickValues?e=this.tickValues:this.scale.ticks?e=this.scale.ticks.apply(this.scale,[n]):(e=this.scale.domain(),e=Sl(e,i
5)),e}getMaxTicks(e){return Math.floor(this.width/e)}tickTransform(e){return"translate("+this.adjustedScale(e)+","+this.verticalSpacing+")"}gridLineTransform(){return`translate(0,${-this.verticalSpacing-5})`}tickTrim(e){return this.trimTicks?Pa(e,this.maxTickLength):e}getMaxPossibleLengthForTick(e){if(this.scale.bandwidth){let n=Math.floor(this.scale.bandwidth()/7),s=e.slice(0,n);return Math.max(s.length,this.maxTickLength)}return this.maxTickLength}tickChunks(e){if(e.toString().length>this.maxTickLength&&this.scale.bandwidth){let n=this.rotateTicks?Math.floor(this.scale.step()/14):5;if(n<=1)return[this.tickTrim(e)];let s=Math.max(this.maxPossibleLengthForTickIfWrapped,this.maxTickLength);return st(this.platformId)||(s=Math.floor(Math.min(this.approxHeight/5,Math.max(this.maxPossibleLengthForTickIfWrapped,this.maxTickLength)))),n=Math.min(n,5),Ll(e,s,n<1?1:n)}return[this.tickTrim(e)]}static{this.\u0275fac=function(i){return new(i||t)(S(Yt))}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-x-axis-ticks",""]],viewQuery:function(i,n){if(i&1&&De(yl,5),i&2){let s;Te(s=Se())&&(n.ticksElement=s.first)}},inputs:{scale:"scale",orient:"orient",tickArguments:"tickArguments",tickValues:"tickValues",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showGridLines:"showGridLines",gridLineHeight:"gridLineHeight",width:"width",rotateTicks:"rotateTicks",wrapTicks:"wrapTicks",referenceLines:"referenceLines",showRefLabels:"showRefLabels",showRefLines:"showRefLines"},outputs:{dimensionsChanged:"dimensionsChanged"},standalone:!1,features:[ae],attrs:Gp,decls:6,vars:4,consts:[["ticksel",""],["tmplMultilineTick",""],["tmplSinglelineTick",""],["class","tick",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["class","reference-area",4,"ngIf"],["class","ref-line",4,"ngFor","ngForOf"],[1,"tick"],[4,"ngIf"],["stroke-width","0.01","font-size","12px"],[4,"ngIf","ngIfThen","ngIfElse"],["x","0",4,"ngFor","ngForOf"],["x","0"],["y2","0",1,"gridline-path","gridline-path-vertical"],[1,"reference-area"],[1,"ref-line"],["y1","25",1,"refline-path","gridline-path-vertical"],["transform","rotate(-270) translate(5, -5)",1,"refline-label"]],template:function(i,n){i&1&&(M(),l(0,"g",null,0),R(2,jp,2,2,"g",3),c(),R(3,qp,2,2,"g",4)(4,Qp,1,2,"path",5)(5,Jp,2,1,"g",6)),i&2&&(o(2),_("ngForOf",n.ticks),o(),_("ngForOf",n.ticks),o(),_("ngIf",n.referenceLineLength>1&&n.refMax&&n.refMin&&n.showRefLines),o(),_("ngForOf",n.referenceLines))},dependencies:[pt,je],encapsulation:2,changeDetection:0})}}return t})(),am=(()=>{class t{constructor(){this.rotateTicks=!0,this.showGridLines=!1,this.xOrient=J.Bottom,this.xAxisOffset=0,this.wrapTicks=!1,this.dimensionsChanged=new z,this.xAxisClassName="x axis",this.labelOffset=0,this.fill="none",this.stroke="stroke",this.tickStroke="#ccc",this.strokeWidth="none",this.padding=5,this.orientation=J}ngOnChanges(e){this.update()}update(){this.transform=`translate(0,${this.xAxisOffset+this.padding+this.dims.height})`,typeof this.xAxisTickCount<"u"&&(this.tickArguments=[this.xAxisTickCount])}emitTicksHeight({height:e}){let i=e+25+5;i!==this.labelOffset&&(this.labelOffset=i,setTimeout(()=>{this.dimensionsChanged.emit({height:e})},0))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-x-axis",""]],viewQuery:function(i,n){if(i&1&&De(gl,5),i&2){let s;Te(s=Se())&&(n.ticksComponent=s.first)}},inputs:{xScale:"xScale",dims:"dims",trimTicks:"trimTicks",rotateTicks:"rotateTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showGridLines:"showGridLines",showLabel:"showLabel",labelText:"labelText",ticks:"ticks",xAxisTickCount:"xAxisTickCount",xOrient:"xOrient",referenceLines:"referenceLines",showRefLines:"showRefLines",showRefLabels:"showRefLabels",xAxisOffset:"xAxisOffset",wrapTicks:"wrapTicks"},outputs:{dimensionsChanged:"dimensionsChanged"},standalone:!1,features:[ae],attrs:eh,decls:3,vars:4,consts:[["ngx-charts-x-axis-ticks","",3,"trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","referenceLines","showRefLines","showRefLabels","width","tickValues","wrapTicks","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-x-axis-ticks","",3,"dimensionsChanged","trimTicks","rotateTicks","maxTickLength","tickFormatting","tickArguments","tickStroke","scale","orient","showGridLines","gridLineHeight","referenceLines","showRefLines","showRefLabels","width","tickValues","wrapTicks"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(i,n){i&1&&(M(),l(0,"g"),R(1,th,1,16,"g",0)(2,ih,1,5,"g",1),c()),i&2&&(Y("class",n.xAxisClassName)("transform",n.transform),o(),_("ngIf",n.xScale),o(),_("ngIf",n.showLabel))},dependencies:[je,Tl,gl],encapsulation:2,changeDetection:0})}}return t})(),fl=(()=>{class t{constructor(e){this.platformId=e,this.tickArguments=[5],this.tickStroke="#ccc",this.trimTicks=!0,this.maxTickLength=16,this.showGridLines=!1,this.showRefLabels=!1,this.showRefLines=!1,this.wrapTicks=!1,this.dimensionsChanged=new z,this.innerTickSize=6,this.tickPadding=3,this.verticalSpacing=20,this.textAnchor=Re.Middle,this.width=0,this.outerTickSize=6,this.rotateLabels=!1,this.referenceLineLength=0,this.Orientation=J}ngOnChanges(e){this.update()}ngAfterViewInit(){st(this.platformId)&&setTimeout(()=>this.updateDims())}updateDims(){if(!st(this.platformId)){let i=this.getApproximateAxisWidth();i>0&&i!==this.width&&(this.width=i,this.dimensionsChanged.emit({width:this.width}));return}let e=parseInt(this.ticksElement.nativeElement.getBoundingClientRect().width,10);e!==this.width&&(this.width=e,this.dimensionsChanged.emit({width:e}),setTimeout(()=>this.updateDims()))}update(){let e=this.scale,i=this.orient===J.Top||this.orient===J.Right?-1:1;switch(this.tickSpacing=Math.max(this.innerTickSize,0)+this.tickPadding,this.ticks=this.getTicks(),this.tickFormatting?this.tickFormat=this.tickFormatting:e.tickFormat?this.tickFormat=e.tickFormat.apply(e,this.tickArguments):this.tickFormat=function(n){return n.constructor.name==="Date"?n.toLocaleDateString():n.toLocaleStr
5ing()},this.adjustedScale=e.bandwidth?n=>{let s=e(n)+e.bandwidth()*.5;if(this.wrapTicks&&n.toString().length>this.maxTickLength){let r=this.tickChunks(n).length;if(r===1)return s;let d=e.bandwidth(),m=r*8,h=d*.5-m*.5;return e(n)+h}return s}:e,this.showRefLines&&this.referenceLines&&this.setReferencelines(),this.orient){case J.Top:this.transform=function(n){return"translate("+this.adjustedScale(n)+",0)"},this.textAnchor=Re.Middle,this.y2=this.innerTickSize*i,this.y1=this.tickSpacing*i,this.dy=i<0?"0em":".71em";break;case J.Bottom:this.transform=function(n){return"translate("+this.adjustedScale(n)+",0)"},this.textAnchor=Re.Middle,this.y2=this.innerTickSize*i,this.y1=this.tickSpacing*i,this.dy=i<0?"0em":".71em";break;case J.Left:this.transform=function(n){return"translate(0,"+this.adjustedScale(n)+")"},this.textAnchor=Re.End,this.x2=this.innerTickSize*-i,this.x1=this.tickSpacing*-i,this.dy=".32em";break;case J.Right:this.transform=function(n){return"translate(0,"+this.adjustedScale(n)+")"},this.textAnchor=Re.Start,this.x2=this.innerTickSize*-i,this.x1=this.tickSpacing*-i,this.dy=".32em";break;default:}st(this.platformId)?setTimeout(()=>this.updateDims()):this.updateDims()}setReferencelines(){this.refMin=this.adjustedScale(Math.min.apply(null,this.referenceLines.map(e=>e.value))),this.refMax=this.adjustedScale(Math.max.apply(null,this.referenceLines.map(e=>e.value))),this.referenceLineLength=this.referenceLines.length,this.referenceAreaPath=dt(0,this.refMax,this.gridLineWidth,this.refMin-this.refMax,0,[!1,!1,!1,!1])}getTicks(){let e,i=this.getMaxTicks(20),n=this.getMaxTicks(50);return this.tickValues?e=this.tickValues:this.scale.ticks?e=this.scale.ticks.apply(this.scale,[n]):(e=this.scale.domain(),e=Sl(e,i
5)),e}getMaxTicks(e){return Math.floor(this.height/e)}tickTransform(e){return`translate(${this.adjustedScale(e)},${this.verticalSpacing})`}gridLineTransform(){return"translate(5,0)"}tickTrim(e){return this.trimTicks?Pa(e,this.maxTickLength):e}static{this.APPROX_CHAR_WIDTH=7}static approximateTickLabelsWidth(e,i=!0,n=16){return e?.length?Math.max(0,...e.map(r=>(i?Pa(r,n):String(r)).length))*t.APPROX_CHAR_WIDTH:0}getApproximateAxisWidth(){if(!this.ticks?.length||!this.tickFormat)return 0;let e=this.ticks.map(i=>this.tickTrim(this.tickFormat(i)));return t.approximateTickLabelsWidth(e,!1,this.maxTickLength)}tickChunks(e){if(e.toString().length>this.maxTickLength&&this.scale.bandwidth){let i=this.maxTickLength,n=Math.floor(this.scale.bandwidth()/15);return n<=1?[this.tickTrim(e)]:Ll(e,i,Math.min(n,5))}return[this.tickFormat(e)]}static{this.\u0275fac=function(i){return new(i||t)(S(Yt))}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-y-axis-ticks",""]],viewQuery:function(i,n){if(i&1&&De(yl,5),i&2){let s;Te(s=Se())&&(n.ticksElement=s.first)}},inputs:{scale:"scale",orient:"orient",tickArguments:"tickArguments",tickValues:"tickValues",tickStroke:"tickStroke",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",showGridLines:"showGridLines",gridLineWidth:"gridLineWidth",height:"height",referenceLines:"referenceLines",showRefLabels:"showRefLabels",showRefLines:"showRefLines",wrapTicks:"wrapTicks"},outputs:{dimensionsChanged:"dimensionsChanged"},standalone:!1,features:[ae],attrs:nh,decls:6,vars:4,consts:[["ticksel",""],["tmplMultilineTick",""],["tmplSinglelineTick",""],["class","tick",4,"ngFor","ngForOf"],["class","reference-area",4,"ngIf"],[4,"ngFor","ngForOf"],["class","ref-line",4,"ngFor","ngForOf"],[1,"tick"],[4,"ngIf"],["stroke-width","0.01"],[4,"ngIf","ngIfThen","ngIfElse"],[4,"ngIf","ngIfElse"],["x","0",4,"ngFor","ngForOf"],["x","0"],[1,"reference-area"],["class","gridline-path gridline-path-horizontal","x1","0",4,"ngIf"],["x1","0",1,"gridline-path","gridline-path-horizontal"],[1,"ref-line"],["x1","0",1,"refline-path","gridline-path-horizontal"],[1,"refline-label"]],template:function(i,n){i&1&&(M(),l(0,"g",null,0),R(2,ph,2,2,"g",3),c(),R(3,hh,1,2,"path",4)(4,fh,2,2,"g",5)(5,vh,2,1,"g",6)),i&2&&(o(2),_("ngForOf",n.ticks),o(),_("ngIf",n.referenceLineLength>1&&n.refMax&&n.refMin&&n.showRefLines),o(),_("ngForOf",n.ticks),o(),_("ngForOf",n.referenceLines))},dependencies:[pt,je],encapsulation:2,changeDetection:0})}}return t})(),sm=(()=>{class t{constructor(){this.showGridLines=!1,this.yOrient=J.Left,this.yAxisOffset=0,this.wrapTicks=!1,this.dimensionsChanged=new z,this.yAxisClassName="y axis",this.labelOffset=15,this.fill="none",this.stroke="#CCC",this.tickStroke="#CCC",this.strokeWidth=1,this.padding=5,this.emittedTickWidth=null}ngOnChanges(e){this.update()}update(){this.offset=-(this.yAxisOffset+this.padding),this.yOrient===J.Right?(this.labelOffset=65,this.transform=`translate(${this.offset+this.dims.width} , 0)`):this.transform=`translate(${this.offset} , 0)`,this.yAxisTickCount!==void 0&&(this.tickArguments=[this.yAxisTickCount])}emitTicksWidth({width:e}){e==null||e===this.emittedTickWidth||(this.emittedTickWidth=e,this.yOrient===J.Right?this.labelOffset=e+65:this.labelOffset=e,this.dimensionsChanged.emit({width:e}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-y-axis",""]],viewQuery:function(i,n){if(i&1&&De(fl,5),i&2){let s;Te(s=Se())&&(n.ticksComponent=s.first)}},inputs:{yScale:"yScale",dims:"dims",trimTicks:"trimTicks",maxTickLength:"maxTickLength",tickFormatting:"tickFormatting",ticks:"ticks",showGridLines:"showGridLines",showLabel:"showLabel",labelText:"labelText",yAxisTickCount:"yAxisTickCount",yOrient:"yOrient",referenceLines:"referenceLines",showRefLines:"showRefLines",showRefLabels:"showRefLabels",yAxisOffset:"yAxisOffset",wrapTicks:"wrapTicks"},outputs:{dimensionsChanged:"dimensionsChanged"},standalone:!1,features:[ae],attrs:Ch,decls:3,vars:4,consts:[["ngx-charts-y-axis-ticks","",3,"trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","wrapTicks","dimensionsChanged",4,"ngIf"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width",4,"ngIf"],["ngx-charts-y-axis-ticks","",3,"dimensionsChanged","trimTicks","maxTickLength","tickFormatting","tickArguments","tickValues","tickStroke","scale","orient","showGridLines","gridLineWidth","referenceLines","showRefLines","showRefLabels","height","wrapTicks"],["ngx-charts-axis-label","",3,"label","offset","orient","height","width"]],template:function(i,n){i&1&&(M(),l(0,"g"),R(1,yh,1,15,"g",0)(2,bh,1,5,"g",1),c()),i&2&&(Y("class",n.yAxisClassName)("transform",n.transform),o(),_("ngIf",n.yScale),o(),_("ngIf",n.showLabel))},dependencies:[je,Tl,fl],encapsulation:2,changeDetection:0})}}return t})(),_l=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[mi]})}}return t})(),Ya=(function(t){return t.popover="popover",t.tooltip="tooltip",t})(Ya||{}),oi=(function(t){return t[t.all="all"]="all",t[t.focus="focus"]="focus",t[t.mouseover="mouseover"]="mouseover",t})(oi||{}),om=(()=>{class t{get listensForFocus(){return this.tooltipShowEvent===oi.all||this.tooltipShowEvent===oi.focus}get listensForHover(){return this.tooltipShowEvent===oi.all||this.tooltipShowEvent===oi.mouseover}
5constructor(e,i,n){this.tooltipService=e,this.viewContainerRef=i,this.renderer=n,this.tooltipCssClass="",this.tooltipAppendToBody=!0,this.tooltipSpacing=10,this.tooltipDisabled=!1,this.tooltipShowCaret=!0,this.tooltipPlacement=H.Top,this.tooltipAlignment=H.Center,this.tooltipType=Ya.popover,this.tooltipCloseOnClickOutside=!0,this.tooltipCloseOnMouseLeave=!0,this.tooltipHideTimeout=300,this.tooltipShowTimeout=100,this.tooltipShowEvent=oi.all,this.tooltipImmediateExit=!1,this.show=new z,this.hide=new z}ngOnDestroy(){this.hideTooltip(!0)}onFocus(){this.listensForFocus&&this.showTooltip()}onBlur(){this.listensForFocus&&this.hideTooltip(!0)}onMouseEnter(){this.listensForHover&&this.showTooltip()}onMouseLeave(e){if(this.listensForHover&&this.tooltipCloseOnMouseLeave){if(clearTimeout(this.timeout),this.component&&this.component.instance.element.nativeElement.contains(e))return;this.hideTooltip(this.tooltipImmediateExit)}}onMouseClick(){this.listensForHover&&this.hideTooltip(!0)}showTooltip(e){if(this.component||this.tooltipDisabled)return;let i=e?0:this.tooltipShowTimeout+(navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?400:0);clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.tooltipService.destroyAll();let n=this.createBoundOptions();this.component=this.tooltipService.create(n),setTimeout(()=>{this.component&&this.addHideListeners(this.component.instance.element.nativeElement)},10),this.show.emit(!0)},i)}addHideListeners(e){this.mouseEnterContentEvent=this.renderer.listen(e,"mouseenter",()=>{clearTimeout(this.timeout)}),this.tooltipCloseOnMouseLeave&&(this.mouseLeaveContentEvent=this.renderer.listen(e,"mouseleave",()=>{this.hideTooltip(this.tooltipImmediateExit)})),this.tooltipCloseOnClickOutside&&(this.documentClickEvent=this.renderer.listen("window","click",i=>{e.contains(i.target)||this.hideTooltip()}))}hideTooltip(e=!1){if(!this.component)return;let i=()=>{this.mouseLeaveContentEvent&&this.mouseLeaveContentEvent(),this.mouseEnterContentEvent&&this.mouseEnterContentEvent(),this.documentClickEvent&&this.documentClickEvent(),this.hide.emit(!0),this.tooltipService.destroy(this.component),this.component=void 0};clearTimeout(this.timeout),e?i():this.timeout=setTimeout(i,this.tooltipHideTimeout)}createBoundOptions(){return{title:this.tooltipTitle,template:this.tooltipTemplate,host:this.viewContainerRef.element,placement:this.tooltipPlacement,alignment:this.tooltipAlignment,type:this.tooltipType,showCaret:this.tooltipShowCaret,cssClass:this.tooltipCssClass,spacing:this.tooltipSpacing,context:this.tooltipContext}}static{this.\u0275fac=function(i){return new(i||t)(S(Ha),S(_s),S(qn))}}static{this.\u0275dir=Qn({type:t,selectors:[["","ngx-tooltip",""]],hostBindings:function(i,n){i&1&&k("focusin",function(){return n.onFocus()})("blur",function(){return n.onBlur()})("mouseenter",function(){return n.onMouseEnter()})("mouseleave",function(r){return n.onMouseLeave(r.target)})("click",function(){return n.onMouseClick()})},inputs:{tooltipCssClass:"tooltipCssClass",tooltipTitle:"tooltipTitle",tooltipAppendToBody:"tooltipAppendToBody",tooltipSpacing:"tooltipSpacing",tooltipDisabled:"tooltipDisabled",tooltipShowCaret:"tooltipShowCaret",tooltipPlacement:"tooltipPlacement",tooltipAlignment:"tooltipAlignment",tooltipType:"tooltipType",tooltipCloseOnClickOutside:"tooltipCloseOnClickOutside",tooltipCloseOnMouseLeave:"tooltipCloseOnMouseLeave",tooltipHideTimeout:"tooltipHideTimeout",tooltipShowTimeout:"tooltipShowTimeout",tooltipTemplate:"tooltipTemplate",tooltipShowEvent:"tooltipShowEvent",tooltipContext:"tooltipContext",tooltipImmediateExit:"tooltipImmediateExit"},outputs:{show:"show",hide:"hide"},standalone:!1})}}return t})(),xl=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({providers:[bl,Ha],imports:[mi]})}}return t})(),vl={};function Al(){let t=("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4);return t=`a${t}`,vl[t]?Al():(vl[t]=!0,t)}var ue=(function(t){return t.Vertical="vertical",t.Horizontal="horizontal",t})(ue||{});var rm=(()=>{class t{constructor(){this.orientation=ue.Vertical}ngOnChanges(e){this.x1="0%",this.x2="0%",this.y1="0%",this.y2="0%",this.orientation===ue.Horizontal?this.x2="100%":this.orientation===ue.Vertical&&(this.y1="100%")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-svg-linear-gradient",""]],inputs:{orientation:"orientation",name:"name",stops:"stops"},standalone:!1,features:[ae],attrs:Th,decls:2,vars:6,consts:[[3,"id"],[3,"stop-color","stop-opacity",4,"ngFor","ngForOf"]],template:function(i,n){i&1&&(M(),l(0,"linearGradient",0),R(1,Sh,1,5,"stop",1),c()),i&2&&(_("id",n.name),Y("x1",n.x1)("y1",n.y1)("x2",n.x2)("y2",n.y2),o(),_("ngForOf",n.stops))},dependencies:[pt],encapsulation:2,changeDetection:0})}}return t})();var lm=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-grid-panel",""]],inputs:{width:"width",height:"height",x:"x",y:"y"},standalone:!1,attrs:Lh,decls:1,vars:4,consts:[["stroke","none",1,"gridpanel"]],template:function(i,n){i&1&&(M(),y(0,"rect",0)),i&2&&Y("height",n.height)("width",n.width)("x",n.x)("y",n.y)},encapsulation:2,changeDetection:0})}}return t})(),Gn=(function(t){return t.Odd="odd",t.Even="even",t})(Gn||{}),cm=(()=>{class t{ngOnChanges(e){this.update()}update(){this.gridPanels=this.getGridPanels()}getGridPanels(){return this.data.map(e=>{let i,n,s,r,d,m=Gn.Odd;if(this.orient===ue.Vertical){let h=this.xScale(e.name);Number.parseInt((h/this.xScale.step()).toString(),10)%2===1&&(m=Gn.Even),i=this.xScale.bandwidth()*this.xScale.paddingInner(),n=this.xScale.bandwidth()+i,s=this.dims.height,r=this.xScale(e.name)-i/2,d=0}else if(this.orient===ue.Horizontal){let h=this.yScale(e.name);Number.parseInt((h/this.yScale.step()).toString(),10)%2===1&&(m=Gn.Even),i=this.yScale.bandwidth()*this.yScale.paddingInner(),n=this.dims.width,s=this.yScale.bandwidth()+i,r=0,d=this.yScale(e.name)-i/2}return{name:e.name,class:m,height:s,width:n,x:r,y:d}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-grid-panel-series",""]],inputs:{data:"data",dims:"dims",xScale:"xScale",yScale:"yScale",orient:"orient"},standalone:!1,features:[ae],attrs:Ah,decls:1,vars:1,consts:[["ngx-charts-grid-panel","",3,"height","width","x","y","grid-panel","odd","even",4,"ngFor","ngForOf"],["ngx-charts-grid-panel","",3,"height","width","x","y"]
5],template:function(i,n){i&1&&R(0,wh,1,10,"g",0),i&2&&_("ngForOf",n.gridPanels)},dependencies:[pt,lm],encapsulation:2,changeDetection:0})}}return t})();var Va;typeof window<"u"?Va=window:typeof global<"u"&&(Va=global);var HS=Va.MouseEvent;var Oe=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[mi,_l,xl,mi,_l,xl]})}}return t})();function dm({width:t,height:a,margins:e,showXAxis:i=!1,showYAxis:n=!1,xAxisHeight:s=0,yAxisWidth:r=0,showXLabel:d=!1,showYLabel:m=!1,showLegend:h=!1,legendType:x=W.Ordinal,legendPosition:v=Vt.Right,columns:L=12}){let A=e[3],B=t,N=a-e[0]-e[2];return h&&v===Vt.Right&&(x===W.Ordinal?L-=2:L-=1),B=B*L/12,B=B-e[1]-e[3],i&&(N-=5,N-=s,d&&(N-=30)),n&&(B-=5,B-=r,A+=r,A+=10,m&&(B-=30,A+=30)),B=Math.max(0,B),N=Math.max(0,N),{width:Math.floor(B),height:Math.floor(N),xOffset:Math.floor(A)}}var Cl=[{name:"vivid",selectable:!0,group:W.Ordinal,domain:["#647c8a","#3f51b5","#2196f3","#00b862","#afdf0a","#a7b61a","#f3e562","#ff9800","#ff5722","#ff4514"]},{name:"natural",selectable:!0,group:W.Ordinal,domain:["#bf9d76","#e99450","#d89f59","#f2dfa7","#a5d7c6","#7794b1","#afafaf","#707160","#ba9383","#d9d5c3"]},{name:"cool",selectable:!0,group:W.Ordinal,domain:["#a8385d","#7aa3e5","#a27ea8","#aae3f5","#adcded","#a95963","#8796c0","#7ed3ed","#50abcc","#ad6886"]},{name:"fire",selectable:!0,group:W.Ordinal,domain:["#ff3d00","#bf360c","#ff8f00","#ff6f00","#ff5722","#e65100","#ffca28","#ffab00"]},{name:"solar",selectable:!0,group:W.Linear,domain:["#fff8e1","#ffecb3","#ffe082","#ffd54f","#ffca28","#ffc107","#ffb300","#ffa000","#ff8f00","#ff6f00"]},{name:"air",selectable:!0,group:W.Linear,domain:["#e1f5fe","#b3e5fc","#81d4fa","#4fc3f7","#29b6f6","#03a9f4","#039be5","#0288d1","#0277bd","#01579b"]},{name:"aqua",selectable:!0,group:W.Linear,domain:["#e0f7fa","#b2ebf2","#80deea","#4dd0e1","#26c6da","#00bcd4","#00acc1","#0097a7","#00838f","#006064"]},{name:"flame",selectable:!1,group:W.Ordinal,domain:["#A10A28","#D3342D","#EF6D49","#FAAD67","#FDDE90","#DBED91","#A9D770","#6CBA67","#2C9653","#146738"]},{name:"ocean",selectable:!1,group:W.Ordinal,domain:["#1D68FB","#33C0FC","#4AFFFE","#AFFFFF","#FFFC63","#FDBD2D","#FC8A25","#FA4F1E","#FA141B","#BA38D1"]},{name:"forest",selectable:!1,group:W.Ordinal,domain:["#55C22D","#C1F33D","#3CC099","#AFFFFF","#8CFC9D","#76CFFA","#BA60FB","#EE6490","#C42A1C","#FC9F32"]},{name:"horizon",selectable:!1,group:W.Ordinal,domain:["#2597FB","#65EBFD","#99FDD0","#FCEE4B","#FEFCFA","#FDD6E3","#FCB1A8","#EF6F7B","#CB96E8","#EFDEE0"]},{name:"neons",selectable:!1,group:W.Ordinal,domain:["#FF3333","#FF33FF","#CC33FF","#0000FF","#33CCFF","#33FFFF","#33FF66","#CCFF33","#FFCC00","#FF6600"]},{name:"picnic",selectable:!1,group:W.Ordinal,domain:["#FAC51D","#66BD6D","#FAA026","#29BB9C","#E96B56","#55ACD2","#B7332F","#2C83C9","#9166B8","#92E7E8"]},{name:"night",selectable:!1,group:W.Ordinal,domain:["#2B1B5A","#501356","#183356","#28203F","#391B3C","#1E2B3C","#120634","#2D0432","#051932","#453080","#75267D","#2C507D","#4B3880","#752F7D","#35547D"]},{name:"nightLights",selectable:!1,group:W.Ordinal,domain:["#4e31a5","#9c25a7","#3065ab","#57468b","#904497","#46648b","#32118d","#a00fb3","#1052a2","#6e51bd","#b63cc3","#6c97cb","#8671c1","#b455be","#7496c3"]}],Ga=class{constructor(a,e,i,n){typeof a=="string"&&(a=Cl.find(s=>s.name===a)),this.colorDomain=a.domain,this.scaleType=e,this.domain=i,this.customColors=n,this.scale=this.generateColorScheme(a,e,this.domain)}generateColorScheme(a,e,i){typeof a=="string"&&(a=Cl.find(s=>s.name===a));let n;switch(e){case W.Quantile:n=Ri().range(a.domain).domain(i);break;case W.Ordinal:n=Rt().range(a.domain).domain(i);break;case W.Linear:{let s=[...a.domain];s.length===1&&(s.push(s[0]),this.colorDomain=s);let r=ai(0,1,1/s.length);n=yt().range(s).domain(r)}break;default:break}return n}getColor(a){if(a==null)throw new Error("Value can not be null");if(this.scaleType===W.Linear){let e=yt().domain(this.domain).range([0,1]);return this.scale(e(a))}else{if(typeof this.customColors=="function")return this.customColors(a);let e=a.toString(),i;return this.customColors&&this.customColors.length>0&&(i=this.customColors.find(n=>n.name.toLowerCase()===e.toLowerCase())),i?i.value:this.scale(a)}}getLinearGradientStops(a,e){e===void 0&&(e=this.domain[0]);let i=yt().domain(this.domain).range([0,1]),n=Ot().domain(this.colorDomain).range([0,1]),s=this.getColor(a),r=i(e),d=this.getColor(e),m=i(a),h=1,x=r,v=[];for(v.push({color:d,offset:r,originalOffset:r,opacity:1});x<m&&h<this.colorDomain.length;){let L=this.colorDomain[h],A=n(L);if(A<=r){h++;continue}if(A.toFixed(4)>=(m-n.bandwidth()).toFixed(4))break;v.push({color:L,offset:A,opacity:1}),x=A,h++}if(v[v.length-1].offset<100&&v.push({color:s,offset:m,opacity:1}),m===r)v[0].offset=0,v[1].offset=100;else if(v[v.length-1].offset!==100)for(let L of v)L.offset=(L.offset-r)/(m-r)*100;return v}};var pm=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe]}
5)}}return t})(),hm=(()=>{class t{constructor(e){this.roundEdges=!0,this.gradient=!1,this.offset=0,this.isActive=!1,this.animations=!0,this.noBarWhenZero=!0,this.select=new z,this.activate=new z,this.deactivate=new z,this.hasGradient=!1,this.hideBar=!1,this.element=e.nativeElement}ngOnChanges(e){e.roundEdges&&this.loadAnimation(),this.update()}update(){this.gradientId="grad"+Al().toString(),this.gradientFill=`url(#${this.gradientId})`,this.gradient||this.stops?(this.gradientStops=this.getGradient(),this.hasGradient=!0):this.hasGradient=!1,this.updatePathEl(),this.checkToHideBar()}loadAnimation(){this.path=this.getStartingPath(),setTimeout(this.update.bind(this),100)}updatePathEl(){let e=ra(this.element).select(".bar"),i=this.getPath();this.animations?e.transition().duration(500).attr("d",i):e.attr("d",i)}getGradient(){return this.stops?this.stops:[{offset:0,color:this.fill,opacity:this.getStartOpacity()},{offset:100,color:this.fill,opacity:1}]}getStartingPath(){if(!this.animations)return this.getPath();let e=this.getRadius(),i;return this.roundEdges?this.orientation===ue.Vertical?(e=Math.min(this.height,e),i=dt(this.x,this.y+this.height,this.width,1,0,this.edges)):this.orientation===ue.Horizontal&&(e=Math.min(this.width,e),i=dt(this.x,this.y,1,this.height,0,this.edges)):this.orientation===ue.Vertical?i=dt(this.x,this.y+this.height,this.width,1,0,this.edges):this.orientation===ue.Horizontal&&(i=dt(this.x,this.y,1,this.height,0,this.edges)),i}getPath(){let e=this.getRadius(),i;return this.roundEdges?this.orientation===ue.Vertical?(e=Math.min(this.height,e),i=dt(this.x,this.y,this.width,this.height,e,this.edges)):this.orientation===ue.Horizontal&&(e=Math.min(this.width,e),i=dt(this.x,this.y,this.width,this.height,e,this.edges)):i=dt(this.x,this.y,this.width,this.height,e,this.edges),i}getRadius(){let e=0;return this.roundEdges&&this.height>5&&this.width>5&&(e=Math.floor(Math.min(5,this.height/2,this.width/2))),e}getStartOpacity(){return this.roundEdges?.2:.5}get edges(){let e=[!1,!1,!1,!1];return this.roundEdges&&(this.orientation===ue.Vertical?this.data.value>0?e=[!0,!0,!1,!1]:e=[!1,!1,!0,!0]:this.orientation===ue.Horizontal&&(this.data.value>0?e=[!1,!0,!1,!0]:e=[!0,!1,!0,!1])),e}onMouseEnter(){this.activate.emit(this.data)}onMouseLeave(){this.deactivate.emit(this.data)}checkToHideBar(){this.hideBar=this.noBarWhenZero&&(this.orientation===ue.Vertical&&this.height===0||this.orientation===ue.Horizontal&&this.width===0)}static{this.\u0275fac=function(i){return new(i||t)(S(nt))}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-bar",""]],hostBindings:function(i,n){i&1&&k("mouseenter",function(){return n.onMouseEnter()})("mouseleave",function(){return n.onMouseLeave()})},inputs:{fill:"fill",data:"data",width:"width",height:"height",x:"x",y:"y",orientation:"orientation",roundEdges:"roundEdges",gradient:"gradient",offset:"offset",isActive:"isActive",stops:"stops",animations:"animations",ariaLabel:"ariaLabel",noBarWhenZero:"noBarWhenZero"},outputs:{select:"select",activate:"activate",deactivate:"deactivate"},standalone:!1,features:[ae],attrs:Eh,decls:2,vars:8,consts:[[4,"ngIf"],["stroke","none","role","img","tabIndex","-1",1,"bar",3,"click"],["ngx-charts-svg-linear-gradient","",3,"orientation","name","stops"]],template:function(i,n){i&1&&(R(0,Bh,2,3,"defs",0),M(),l(1,"path",1),k("click",function(){return n.select.emit(n.data)}),c()),i&2&&(_("ngIf",n.hasGradient),o(),$t("active",n.isActive)("hidden",n.hideBar),Y("d",n.path)("aria-label",n.ariaLabel)("fill",n.hasGradient?n.gradientFill:n.fill))},dependencies:[je,rm],encapsulation:2,changeDetection:0})}}return t})(),bt=(function(t){return t.Standard="standard",t.Normalized="normalized",t.Stacked="stacked",t})(bt||{}),ri=(function(t){return t.positive="positive",t.negative="negative",t})(ri||{}),mm=(()=>{class t{constructor(e){this.dimensionsChanged=new z,this.horizontalPadding=2,this.verticalPadding=5,this.element=e.nativeElement}ngOnChanges(e){this.update()}getSize(){let e=this.element.getBoundingClientRect().height,i=this.element.getBoundingClientRect().width;return{height:e,width:i,negative:this.value<0}}ngAfterViewInit(){this.dimensionsChanged.emit(this.getSize())}update(){this.valueFormatting?this.formatedValue=this.valueFormatting(this.value):this.formatedValue=Xa(this.value),this.orientation==="horizontal"?(this.x=this.barX+this.barWidth,this.value<0?(this.x=this.x-this.horizontalPadding,this.textAnchor="end"):(this.x=this.x+this.horizontalPadding,this.textAnchor="start"),this.y=this.barY+this.barHeight/2):(this.x=this.barX+this.barWidth/2,this.y=this.barY+this.barHeight,this.value<0?(this.y=this.y+this.verticalPadding,this.textAnchor="end"):(this.y=this.y-this.verticalPadding,this.textAnchor="start"),this.transform=`rotate(-45, ${this.x} , ${this.y})`)}static{this.\u0275fac=function(i){return new(i||t)(S(nt))}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-bar-label",""]],inputs:{value:"value",valueFormatting:"valueFormatting",barX:"barX",barY:"barY",barWidth:"barWidth",barHeight:"barHeight",orientation:"orientation"},outputs:{dimensionsChanged:"dimensionsChanged"},standalone:!1,features:[ae],attrs:Nh,decls:2,vars:5,consts:[["alignment-baseline","middle",1,"textDataLabel"]],template:function(i,n){i&1&&(M(),l(0,"text",0),p(1),c()),i&2&&(Y("text-anchor",n.textAnchor)("transform",n.transform)("x",n.x)("y",n.y),o(),D(" ",n.formatedValue," "))},styles:[".textDataLabel[_ngcontent-%COMP%]{font-size:11px}"],changeDetection:0})}}return t})();var um=(()=>{class t{constructor(e){this.platformId=e,this.type=bt.Standard,this.tooltipDisabled=!1,this.animations=!0,this.showDataLabel=!1,this.noBarWhenZero=!0,this.select=new z,this.activate=new z,this.deactivate=new z,this.dataLabelHeightChanged=new z,this.barsForDataLabels=[],this.barOrientation=ue,this.isSSR=!1}ngOnInit(){ji(this.platformId)&&(this.isSSR=!0)}ngOnChanges(){this.update()}update(){this.updateTooltipSettings();let e;this.series.length&&(e=this.xScale.bandwidth()),e=Math.round(e);let i=Math.max(this.yScale.domain()[0],0),n={[ri.positive]:0,[ri.negative]:0},s=ri.positive,r;this.type===bt.Normalized&&(r=this.series.map(d=>d.value).reduce((d,m)=>d+m,0)),this.bars=this.series.map((d,m)=>{let h=d.value,x=this.getLabel(d),v=Xa(x),L=this.roundEdges;s=h>0?ri.positive:ri.negative;let A={value:h,label:x,roundEdges:L,data:d,width:e,formattedLabel:v,height:0,x:0,y:0};
5if(this.type===bt.Standard)A.height=Math.abs(this.yScale(h)-this.yScale(i)),A.x=this.xScale(x),h<0?A.y=this.yScale(0):A.y=this.yScale(h);else if(this.type===bt.Stacked){let N=n[s],P=N+h;n[s]+=h,A.height=this.yScale(N)-this.yScale(P),A.x=0,A.y=this.yScale(P),A.offset0=N,A.offset1=P}else if(this.type===bt.Normalized){let N=n[s],P=N+h;n[s]+=h,r>0?(N=N*100/r,P=P*100/r):(N=0,P=0),A.height=this.yScale(N)-this.yScale(P),A.x=0,A.y=this.yScale(P),A.offset0=N,A.offset1=P,h=(P-N).toFixed(2)+"%"}this.colors.scaleType===W.Ordinal?A.color=this.colors.getColor(x):this.type===bt.Standard?(A.color=this.colors.getColor(h),A.gradientStops=this.colors.getLinearGradientStops(h)):(A.color=this.colors.getColor(A.offset1),A.gradientStops=this.colors.getLinearGradientStops(A.offset1,A.offset0));let B=v;return A.ariaLabel=v+" "+h.toLocaleString(),this.seriesName!==null&&this.seriesName!==void 0&&(B=`${this.seriesName} \u2022 ${v}`,A.data.series=this.seriesName,A.ariaLabel=this.seriesName+" "+A.ariaLabel),A.tooltipText=this.tooltipDisabled?void 0:` 6 <span class="tooltip-label">${Kh(B)}</span> 7 <span class="tooltip-val">${this.dataLabelFormatting?this.dataLabelFormatting(h):h.toLocaleString()}</span> 8 `,A}),this.updateDataLabels()}updateDataLabels(){if(this.type===bt.Stacked){this.barsForDataLabels=[];let e={};e.series=this.seriesName;let i=this.series.map(s=>s.value).reduce((s,r)=>r>0?s+r:s,0),n=this.series.map(s=>s.value).reduce((s,r)=>r<0?s+r:s,0);e.total=i+n,e.x=0,e.y=0,e.total>0?e.height=this.yScale(i):e.height=this.yScale(n),e.width=this.xScale.bandwidth(),this.barsForDataLabels.push(e)}else this.barsForDataLabels=this.series.map(e=>{let i={};return i.series=this.seriesName??e.label,i.total=e.value,i.x=this.xScale(e.label),i.y=this.yScale(0),i.height=this.yScale(i.total)-this.yScale(0),i.width=this.xScale.bandwidth(),i})}updateTooltipSettings(){this.tooltipPlacement=this.tooltipDisabled?void 0:H.Top,this.tooltipType=this.tooltipDisabled?void 0:Ya.tooltip}isActive(e){return this.activeEntries?this.activeEntries.find(n=>e.name===n.name&&e.value===n.value)!==void 0:!1}onClick(e){this.select.emit(e)}getLabel(e){return e.label?e.label:e.name}trackBy(e,i){return i.label}trackDataLabelBy(e,i){return e+"#"+i.series+"#"+i.total}static{this.\u0275fac=function(i){return new(i||t)(S(Yt))}}static{this.\u0275cmp=O({type:t,selectors:[["g","ngx-charts-series-vertical",""]],inputs:{dims:"dims",type:"type",series:"series",xScale:"xScale",yScale:"yScale",colors:"colors",gradient:"gradient",activeEntries:"activeEntries",seriesName:"seriesName",tooltipDisabled:"tooltipDisabled",tooltipTemplate:"tooltipTemplate",roundEdges:"roundEdges",animations:"animations",showDataLabel:"showDataLabel",dataLabelFormatting:"dataLabelFormatting",noBarWhenZero:"noBarWhenZero"},outputs:{select:"select",activate:"activate",deactivate:"deactivate",dataLabelHeightChanged:"dataLabelHeightChanged"},standalone:!1,features:[ae],attrs:Mh,decls:3,vars:3,consts:[[4,"ngIf"],["ngx-charts-bar","","ngx-tooltip","",3,"width","height","x","y","fill","stops","data","orientation","roundEdges","gradient","ariaLabel","isActive","tooltipDisabled","tooltipPlacement","tooltipType","tooltipTitle","tooltipTemplate","tooltipContext","noBarWhenZero","animations","select","activate","deactivate",4,"ngFor","ngForOf","ngForTrackBy"],["ngx-charts-bar","","ngx-tooltip","",3,"select","activate","deactivate","width","height","x","y","fill","stops","data","orientation","roundEdges","gradient","ariaLabel","isActive","tooltipDisabled","tooltipPlacement","tooltipType","tooltipTitle","tooltipTemplate","tooltipContext","noBarWhenZero","animations"],["ngx-charts-bar-label","",3,"barX","barY","barWidth","barHeight","value","valueFormatting","orientation","dimensionsChanged",4,"ngFor","ngForOf","ngForTrackBy"],["ngx-charts-bar-label","",3,"dimensionsChanged","barX","barY","barWidth","barHeight","value","valueFormatting","orientation"]],template:function(i,n){i&1&&R(0,Rh,2,2,"g",0)(1,Ph,2,2,"g",0)(2,Gh,2,2,"g",0),i&2&&(_("ngIf",!n.isSSR),o(),_("ngIf",n.isSSR),o(),_("ngIf",n.showDataLabel))},dependencies:[pt,je,om,hm,mm],encapsulation:2,data:{animation:[Ui("animationState",[Qi(":leave",[jt({opacity:1}),qi(500,jt({opacity:0}
8))])])]},changeDetection:0})}}return t})();var wl=(()=>{class t extends nm{constructor(){super(...arguments),this.legend=!1,this.legendTitle="Legend",this.legendPosition=Vt.Right,this.tooltipDisabled=!1,this.scaleType=W.Ordinal,this.showGridLines=!0,this.activeEntries=[],this.schemeType=W.Ordinal,this.trimXAxisTicks=!0,this.trimYAxisTicks=!0,this.rotateXAxisTicks=!0,this.maxXAxisTickLength=16,this.maxYAxisTickLength=16,this.groupPadding=16,this.barPadding=8,this.roundDomains=!1,this.roundEdges=!0,this.showDataLabel=!1,this.noBarWhenZero=!0,this.wrapTicks=!1,this.activate=new z,this.deactivate=new z,this.margin=[10,20,10,20],this.xAxisHeight=0,this.yAxisWidth=0,this.dataLabelMaxHeight={negative:0,positive:0},this.isSSR=!1,this.barOrientation=ue,this.trackBy=(e,i)=>i.name}ngOnInit(){ji(this.platformId)&&(this.isSSR=!0)}update(){super.update(),this.showDataLabel||(this.dataLabelMaxHeight={negative:0,positive:0}),this.margin=[10+this.dataLabelMaxHeight.positive,20,10+this.dataLabelMaxHeight.negative,20],this.dims=dm({width:this.width,height:this.height,margins:this.margin,showXAxis:this.xAxis,showYAxis:this.yAxis,xAxisHeight:this.xAxisHeight,yAxisWidth:this.yAxisWidth,showXLabel:this.showXAxisLabel,showYLabel:this.showYAxisLabel,showLegend:this.legend,legendType:this.schemeType,legendPosition:this.legendPosition}),this.showDataLabel&&(this.dims.height-=this.dataLabelMaxHeight.negative),this.formatDates(),this.groupDomain=this.getGroupDomain(),this.innerDomain=this.getInnerDomain(),this.valueDomain=this.getValueDomain(),this.groupScale=this.getGroupScale(),this.innerScale=this.getInnerScale(),this.valueScale=this.getValueScale(),this.setColors(),this.legendOptions=this.getLegendOptions(),this.transform=`translate(${this.dims.xOffset} , ${this.margin[0]+this.dataLabelMaxHeight.negative})`}onDataLabelMaxHeightChanged(e,i){e.size.negative?this.dataLabelMaxHeight.negative=Math.max(this.dataLabelMaxHeight.negative,e.size.height):this.dataLabelMaxHeight.positive=Math.max(this.dataLabelMaxHeight.positive,e.size.height),i===this.results.length-1&&setTimeout(()=>this.update())}getGroupScale(){let e=this.groupDomain.length/(this.dims.height/this.groupPadding+1);return Ot().rangeRound([0,this.dims.width]).paddingInner(e).paddingOuter(e/2).domain(this.groupDomain)}getInnerScale(){let e=this.groupScale.bandwidth(),i=this.innerDomain.length/(e/this.barPadding+1);return Ot().rangeRound([0,e]).paddingInner(i).domain(this.innerDomain)}getValueScale(){let e=yt().range([this.dims.height,0]).domain(this.valueDomain);return this.roundDomains?e.nice():e}getGroupDomain(){let e=[];for(let i of this.results)e.includes(i.label)||e.push(i.label);return e}getInnerDomain(){let e=[];for(let i of this.results)for(let n of i.series)e.includes(n.label)||e.push(n.label);return e}getValueDomain(){let e=[];for(let s of this.results)for(let r of s.series)e.includes(r.value)||e.push(r.value);let i=Math.min(0,...e),n=this.yScaleMax?Math.max(this.yScaleMax,...e):Math.max(0,...e);return[i,n]}groupTransform(e){return`translate(${this.groupScale(e.label)}, 0)`}onClick(e,i){i&&(e.series=i.name),this.select.emit(e)}setColors(){let e;this.schemeType===W.Ordinal?e=this.innerDomain:e=this.valueDomain,this.colors=new Ga(this.scheme,this.schemeType,e,this.customColors)}getLegendOptions(){let e={scaleType:this.schemeType,colors:void 0,domain:[],title:void 0,position:this.legendPosition};return e.scaleType===W.Ordinal?(e.domain=this.innerDomain,e.colors=this.colors,e.title=this.legendTitle):(e.domain=this.valueDomain,e.colors=this.colors.scale),e}updateYAxisWidth({width:e}){this.yAxisWidth=e,this.update()}updateXAxisHeight({height:e}){this.xAxisHeight=e,this.update()}onActivate(e,i,n=!1){let s=Object.assign({},e);i&&(s.series=i.name);let r=this.results.map(d=>d.series).flat().filter(d=>n?d.label===s.name:d.name===s.name&&d.series===s.series);this.activeEntries=[...r],this.activate.emit({value:s,entries:this.activeEntries})}onDeactivate(e,i,n=!1){let s=Object.assign({},e);i&&(s.series=i.name),this.activeEntries=this.activeEntries.filter(r=>n?r.label!==s.name:!(r.name===s.name&&r.series===s.series)),this.deactivate.emit({value:s,entries:this.activeEntries})}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=gs(t)))(n||t)}})()}static{this.\u0275cmp=O({type:t,selectors:[["ngx-charts-bar-vertical-2d"]],contentQueries:function(i,n,s){if(i&1&&bs(s,Ih,5),i&2){let r;Te(r=Se())&&(n.tooltipTemplate=r.first)}},inputs:{legend:"legend",legendTitle:"legendTitle",legendPosition:"legendPosition",xAxis:"xAxis",yAxis:"yAxis",showXAxisLabel:"showXAxisLabel",showYAxisLabel:"showYAxisLabel",xAxisLabel:"xAxisLabel",yAxisLabel:"yAxisLabel",tooltipDisabled:"tooltipDisabled",scaleType:"scaleType",gradient:"gradient",showGridLines:"showGridLines",activeEntries:"activeEntries",schemeType:"schemeType",trimXAxisTicks:"trimXAxisTicks",trimYAxisTicks:"trimYAxisTicks",rotateXAxisTicks:"rotateXAxisTicks",maxXAxisTickLength:"maxXAxisTickLength",maxYAxisTickLength:"maxYAxisTickLength",xAxisTickFormatting:"xAxisTickFormatting",yAxisTickFormatting:"yAxisTickFormatting",xAxisTicks:"xAxisTicks",yAxisTicks:"yAxisTicks",groupPadding:"groupPadding",barPadding:"barPadding",roundDomains:"roundDomains",roundEdges:"roundEdges",yScaleMax:"yScaleMax",showDataLabel:"showDataLabel",dataLabelFormatting:"dataLabelFormatting",noBarWhenZero:"noBarWhenZero",wrapTicks:"wrapTicks"},outputs:{activate:"activate",deactivate:"deactivate"},standalone:!1,features:[xs],decls:7,vars:18,consts:[[3,"legendLabelActivate","legendLabelDeactivate","legendLabelClick","view","showLegend","legendOptions","activeEntries","animations"],[1,"bar-chart","chart"],["ngx-charts-grid-panel-series","",3,"xScale","yScale","data","dims","orient"],["ngx-charts-x-axis","",3,"xScale","dims","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","xAxisOffset","wrapTicks","dimensionsChanged",4,"ngIf"],["ngx-charts-y-axis","",3,"yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","wrapTicks","dimensionsChanged",4,"ngIf"],[4,"ngIf"],["ngx-charts-x-axis","",3,"dimensionsChanged","xScale","dims","showLabel","labelText","trimTicks","rotateTicks","maxTickLength","tickFormatting","ticks","xAxisOffset","wrapTicks"],["ngx-charts-y-axis","",3,"dimensionsChanged","yScale","dims","showGridLines","showLabel","labelText","trimTicks","maxTickLength","tickFormatting","ticks","wrapTicks"],["ngx-charts-series-vertical","",3,"activeEntries","xScale","yScale","colors","series","dims","gradient","tooltipDisabled","tooltipTemplate","showDataLabel","dataLabelFormatting","seriesName","roundEdges","animations","noBarWhenZero","select","activate","deactivate","dataLabelHeightChanged",4,"ngFor","ngForOf","ngForTrackBy"],["ngx-charts-series-vertical","",3,"select","activate","deactivate","dataLabelHeightChanged","activeEntries","xScale","yScale","colors","series","dims","gradient","tooltipDisabled","tooltipTemplate","showDataLabel","dataLabelFormatting","seriesName","roundEdges","animations","noBarWhenZero"]],template:function(i,n){i&1&&(l(0,"ngx-charts-chart",0),k("legendLabelActivate",function(r){return n.onActivate(r,void 0,!0)})("legendLabelDeactivate",function(r){return n.onDeactivate(r,void 0,!0)})("legendLabelClick",function(r){return n.onClick(r)}),M(),l(1,"g",1),y(2,"g",2),R(3,Hh,1,11,"g",3)(4,Xh,1,10,"g",4)(5,zh,2,2,"g",5)(6,Wh,2,2,"g",5),c()()),i&2&&(_("view",ce(15,kh,n.width,n.height))("showLegend",n.legend)("legendOptions",n.legendOptions)("activeEntries",n.activeEntries)("animations",n.animations),o(),Y("transform",n.transform),o(),_("xScale",n.groupScale)("yScale",n.valueScale)("data",n.results)("dims",n.dims)("orient",n.barOrientation.Vertical),o(),_("ngIf",n.xAxis),o(),_("ngIf",n.yAxis),o(),_("ngIf",!n.isSSR),o(),_("ngIf",n.isSSR))},dependencies:[pt,je,am,sm,tm,cm,um],styles:[Dh],encapsulation:2,data:{animation:[Ui("animationState",[Qi(":leave",[jt({opacity:1,transform:"*"}),qi(500,jt({opacity:0,transform:"scale(0)"}))])])]},changeDetection:0})}}return t})();var Il=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe]}
8)}}return t})();var gm=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe]})}}return t})();var fm=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe]})}}return t})();var _m=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe]})}}return t})();var kl=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe]})}}return t})();var XS=2*Math.PI;var za=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe]})}}return t})(),xm=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe,za,kl]})}}return t})();var vm=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe]})}}return t})();var Cm=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe]})}}return t})();var ym=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe,za,Il]})}}return t})();function bm(){typeof SVGElement<"u"&&typeof SVGElement.prototype.contains>"u"&&(SVGElement.prototype.contains=HTMLDivElement.prototype.contains)}var Tm=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe]})}}return t})(),Dl=(()=>{class t{constructor(){bm()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Oe,pm,Il,gm,fm,_m,Tm,kl,xm,vm,za,Cm,ym]})}}return t})();var li=(function(t){return t.ENERO="01",t.FEBRERO="02",t.MARZO="03",t.ABRIL="04",t.MAYO="05",t.JUNIO="06",t.JULIO="07",t.AGOSTO="08",t.SEPTIEMBRE="09",t.OCTUBRE="10",t.NOVIEMBRE="11",t.DICIEMBRE="12",t.JANUARY="01",t.FEBRUARY="02",t.MARCH="03",t.APRIL="04",t.MAY="05",t.JUNE="06",t.JULY="07",t.AUGUST="08",t.SEPTEMBER="09",t.OCTOBER="10",t.NOVEMBER="11",t.DECEMBER="12",t})(li||{});var km=()=>({text:"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.EMPTY_REGISTERED_USERS"}),El=t=>({text:t}),Bl=(t,a)=>[t,a],Nl=t=>({type:"INFO",header:"ALERT_VALIDATION.INFO",msgInlineBlock:t}),Dm=()=>({text:"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.EMPTY_ACTIVE_USERS"}),Em=()=>({"border-radius":"4",height:"30px",width:"200px",margin:"0px"}),Bm=()=>({"border-radius":"4",height:"15px",width:"150px",margin:"0px"}),Nm=()=>[1,1],Mm=()=>({"border-radius":"4",height:"15px",width:"200px",margin:"0px"}),Fm=()=>({height:"24px",width:"24px",margin:"0px"});function Rm(t,a){t&1&&y(0,"div",7)}function Om(t,a){if(t&1){let e=E();l(0,"div",8)(1,"div",12)(2,"icons-component",13),k("click",function(n){w(e);let s=u(2);return I(s.exportRegisteredUsers(n))}),c()()()}t&2&&(o(),_("matTooltipPosition","above"),o(),_("type","downloadFileCircle")("width","24")("height","24"))}function Pm(t,a){if(t&1&&(l(0,"span")(1,"b"),p(2),c()()),t&2){let e=u().$implicit;o(2),C(e.id)}}function Vm(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"NO_DATA")," "))}function Gm(t,a){if(t&1&&(l(0,"span"),p(1),c()),t&2){let e=u().$implicit;o(),C(e.firstname)}}function Hm(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"NO_DATA")," "))}function Xm(t,a){if(t&1&&(l(0,"span"),p(1),c()),t&2){let e=u().$implicit;o(),C(e.lastname)}}function Ym(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"NO_DATA")," "))}function zm(t,a){if(t&1&&(l(0,"span"),p(1),c()),t&2){let e=u().$implicit;o(),C(e.username)}}function $m(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"NO_DATA")," "))}function Wm(t,a){if(t&1&&(l(0,"span"),p(1),g(2,"formatDate"),c()),t&2){let e=u().$implicit;o(),C(f(2,1,e.createdAt))}}function jm(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"NO_DATA")," "))}function Um(t,a){if(t&1&&(l(0,"div",21)(1,"div",22),b(2,Pm,3,1,"span")(3,Vm,3,3,"span",23),c(),l(4,"div",24),b(5,Gm,2,1,"span")(6,Hm,3,3,"span",23),c(),l(7,"div",24),b(8,Xm,2,1,"span")(9,Ym,3,3,"span",23),c(),l(10,"div",25),b(11,zm,2,1,"span")(12,$m,3,3,"span",23),c(),l(13,"div",26),$e(14),b(15,Wm,3,3,"span")(16,jm,3,3,"span",23),We(),c()()),t&2){let e=a.$implicit;o(2),T(e.id?2:3),o(3),T(e.firstname?5:6),o(3),T(e.lastname?8:9),o(3),T(e.username?11:12),o(4),T(e.createdAt?15:16)}}
8function qm(t,a){if(t&1&&(l(0,"div",14)(1,"div",15)(2,"div",16),p(3),g(4,"translate"),c(),l(5,"div",17),p(6),g(7,"translate"),c(),l(8,"div",17),p(9),g(10,"translate"),c(),l(11,"div",18),p(12),g(13,"translate"),c(),l(14,"div",19),p(15),g(16,"translate"),c()()(),l(17,"div",20),Ie(18,Um,17,5,"div",21,we),c()),t&2){let e=u(2);o(3),C(f(4,7,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.ID")),o(3),C(f(7,9,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.NAME")),o(3),C(f(10,11,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.SURNAME")),o(3),C(f(13,13,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.EMAIL")),o(3),C(f(16,15,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.REGISTRATION_DATE")),o(2),_("infiniteScrollDistance",1)("infiniteScrollThrottle",300),o(),ke(e.companyService.activeAndRegisteredUsers.registeredUsersList)}}function Qm(t,a){if(t&1&&y(0,"app-alert-component",10),t&2){let e=u(2);_("params",F(7,Nl,ce(4,Bl,G(1,km),F(2,El,e.params.month.name))))}}function Km(t,a){t&1&&y(0,"div",7)}function Zm(t,a){if(t&1){let e=E();l(0,"div",8)(1,"div",12)(2,"icons-component",13),k("click",function(n){w(e);let s=u(2);return I(s.exportActivatedUsers(n))}),c()()()}t&2&&(o(),_("matTooltipPosition","above"),o(),_("type","downloadFileCircle")("width","24")("height","24"))}function Jm(t,a){if(t&1&&(l(0,"span")(1,"b"),p(2),c()()),t&2){let e=u().$implicit;o(2),C(e.id)}}function eu(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"NO_DATA")," "))}function tu(t,a){if(t&1&&(l(0,"span"),p(1),c()),t&2){let e=u().$implicit;o(),C(e.firstname)}}function iu(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"NO_DATA")," "))}function nu(t,a){if(t&1&&(l(0,"span"),p(1),c()),t&2){let e=u().$implicit;o(),C(e.lastname)}}function au(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"NO_DATA")," "))}function su(t,a){if(t&1&&(l(0,"span"),p(1),c()),t&2){let e=u().$implicit;o(),C(e.username)}}function ou(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"NO_DATA")," "))}function ru(t,a){if(t&1&&(l(0,"span"),p(1),g(2,"formatDate"),c()),t&2){let e=u().$implicit;o(),C(f(2,1,e.createdAt))}}function lu(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"NO_DATA")," "))}function cu(t,a){if(t&1&&(l(0,"div",21)(1,"div",22),b(2,Jm,3,1,"span")(3,eu,3,3,"span",23),c(),l(4,"div",24),b(5,tu,2,1,"span")(6,iu,3,3,"span",23),c(),l(7,"div",24),b(8,nu,2,1,"span")(9,au,3,3,"span",23),c(),l(10,"div",25),b(11,su,2,1,"span")(12,ou,3,3,"span",23),c(),l(13,"div",26),$e(14),b(15,ru,3,3,"span")(16,lu,3,3,"span",23),We(),c()()),t&2){let e=a.$implicit;o(2),T(e.id?2:3),o(3),T(e.firstname?5:6),o(3),T(e.lastname?8:9),o(3),T(e.username?11:12),o(4),T(e.createdAt?15:16)}}function du(t,a){if(t&1&&(l(0,"div",14)(1,"div",15)(2,"div",16),p(3),g(4,"translate"),c(),l(5,"div",17),p(6),g(7,"translate"),c(),l(8,"div",17),p(9),g(10,"translate"),c(),l(11,"div",18),p(12),g(13,"translate"),c(),l(14,"div",19),p(15),g(16,"translate"),c()()(),l(17,"div",20),Ie(18,cu,17,5,"div",21,we),c()),t&2){let e=u(2);o(3),C(f(4,7,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.ID")),o(3),C(f(7,9,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.NAME")),o(3),C(f(10,11,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.SURNAME")),o(3),C(f(13,13,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.EMAIL")),o(3),C(f(16,15,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.REGISTRATION_DATE")),o(2),_("infiniteScrollDistance",1)("infiniteScrollThrottle",300),o(),ke(e.companyService.activeAndRegisteredUsers.activeUsersList)}}function pu(t,a){if(t&1&&y(0,"app-alert-component",10),t&2){let e=u(2);_("params",F(7,Nl,ce(4,Bl,G(1,Dm),F(2,El,e.params.month.name))))}}function hu(t,a){if(t&1&&(l(0,"div",0)(1,"p",1),p(2),g(3,"translate"),c(),l(4,"span"),p(5),c(),l(6,"div",2)(7,"mat-expansion-panel",3)(8,"mat-expansion-panel-header")(9,"div",4)(10,"div",5),p(11),g(12,"translate"),c(),l(13,"div",6),b(14,Rm,1,0,"div",7)(1
85,Om,3,4,"div",8),y(16,"icons-component",9),c()()(),b(17,qm,20,17)(18,Qm,1,9,"app-alert-component",10),c(),y(19,"div",11),l(20,"mat-expansion-panel",3)(21,"mat-expansion-panel-header")(22,"div",4)(23,"div",5),p(24),g(25,"translate"),c(),l(26,"div",6),b(27,Km,1,0,"div",7)(28,Zm,3,4,"div",8),y(29,"icons-component",9),c()()(),b(30,du,20,17)(31,pu,1,9,"app-alert-component",10),c()()()),t&2){let e=u();o(2),D(" ",f(3,14,"ADMIN.ACTIVITY.BILLING_DETAIL_MODAL.BILLING_DETAIL")," "),o(3),C(e.params.month.name),o(2),_("expanded",!0),o(4),V("",f(12,16,"ADMIN.ACTIVITY.REGISTERED_USERS")," (",e.companyService.activeAndRegisteredUsers.registeredUsersList.length,")"),o(3),T(e.downloadRegisteredUsersLoading?14:15),o(2),_("type","chevronRounded"),o(),T(e.companyService.activeAndRegisteredUsers.registeredUsersList.length?17:18),o(3),_("expanded",!0),o(4),V("",f(25,18,"ADMIN.ACTIVITY.ACTIVE_USERS")," (",e.companyService.activeAndRegisteredUsers.activeUsersList.length,")"),o(3),T(e.downloadActivatedUsersLoading?27:28),o(2),_("type","chevronRounded"),o(),T(e.companyService.activeAndRegisteredUsers.activeUsersList.length?30:31)}}function mu(t,a){t&1&&(l(0,"div",31)(1,"div",32)(2,"div",33),y(3,"ngx-skeleton-loader",27),c(),l(4,"div",34),y(5,"ngx-skeleton-loader",35),c()()()),t&2&&(o(3),_("theme",G(2,Mm)),o(2),_("theme",G(3,Fm)))}function uu(t,a){t&1&&(l(0,"div",0),y(1,"ngx-skeleton-loader",27)(2,"div",28)(3,"ngx-skeleton-loader",27)(4,"div",29),l(5,"div",30),Ie(6,mu,6,4,"div",31,we),c()()),t&2&&(o(),_("theme",G(2,Em)),o(2),_("theme",G(3,Bm)),o(3),ke(G(4,Nm)))}var Wa=(()=>{class t{constructor(e,i,n,s){this.stylingService=e,this.companyService=i,this.globalModalService=n,this.exportService=s,this.cdr=Q(U),this.downloadRegisteredUsersLoading=!1,this.downloadActivatedUsersLoading=!1}async ngOnInit(){this.loading=!0,this.cdr.markForCheck(),this.params=this.globalModalService.params,await this.setDates(),await this.companyService.getActiveAndRegisteredUsersForDate(this.filterDto),this.loading=!1,this.cdr.markForCheck()}async setDates(){let e=this.globalModalService.params.month.name.split(" "),i=e[0],n=e[1];i=this.getNumberMonth(i),this.filterDto={month:i,year:n};let r=`${n}-${i}-01`;this.exportActivityLogsDto={from:r}}getNumberMonth(e){return e=e.toUpperCase(),li[e]}async exportActivatedUsers(e){e.stopPropagation(),e.preventDefault(),this.downloadActivatedUsersLoading=!0,this.exportActivityLogsDto.type=2,await this.exportService.exportActivityLogs(this.exportActivityLogsDto),this.downloadActivatedUsersLoading=!1}async exportRegisteredUsers(e){e.stopPropagation(),e.preventDefault(),this.downloadRegisteredUsersLoading=!0,this.exportActivityLogsDto.type=1,await this.exportService.exportActivityLogs(this.exportActivityLogsDto),this.downloadRegisteredUsersLoading=!1}static{this.\u0275fac=function(i){return new(i||t)(S(fe),S(j),S(K),S(nn))}}static{this.\u0275cmp=O({type:t,selectors:[["app-billing-activity-info"]],standalone:!1,decls:2,vars:1,consts:[[1,"spActivity"],[1,"header-1"],[1,"activityDetails"],["hideToggle","",1,"expansion","section",3,"expanded"],[1,"headerExpansion"],[1,"left"],[1,"right"],[1,"spinner-b","show","setEnd"],[1,"percentDownload"],[1,"chevron",3,"type"],[3,"params"],[1,"space"],["tooltip","Descargar",3,"matTooltipPosition"],[1,"chevron","downloadBillFile","cursor-pointer",3,"click","type","width","height"],[1,"rGridList","headList","noSticky","noMargin"],[1,"gridItem","headerOptions"],[1,"gridCol","sp2"],[1,"gridCol","sp4"],[1,"gridCol","sp6"],[1,"gridCol","sp4","right"],["infiniteScroll","",1,"rGridList","noMargin",3,"infiniteScrollDistance","infiniteScrollThrottle"],[1,"gridItem","noBorder"],["isEllipsis","",1,"gridCol","sp2"],[1,"noData"],["isEllipsis","",1,"gridCol","sp4"],["isEllipsis","",1,"gridCol","sp6"],["isEllipsis","",1,"gridCol","sp4","right"],[3,"theme"],[1,"h-8"],[1,"h-24"],[1,"billingOptions"],[1,"activityDetails","skeleton","fullWidth"],[1,"expansionPanel","headerExpansion"],[1,"left","flex","ai-c","jc-c"],[1,"right","flex","ai-c","jc-c"],["count","1","appearance","circle",3,"theme"]],template:function(i,n){i&1&&b(0,hu,32,20,"div",0)(1,uu,8,5,"div",0),i&2&&T(n.loading?1:0)},dependencies:[Vs,en,Xs,Ys,tn,an,he,te,gt],encapsulation:2,changeDetection:0})}}return t})();var gu=["chartHost"],fu=t=>({"c-auto":t});function _u(t,a){t&1&&y(0,"div",33)}function xu(t,a){if(t&1){let e=E();l(0,"icons-component",35),g(1,"translate"),k("click",function(n){w(e);let s=u(2),r=s.$implicit,d=s.$index,m=u(2);return I(m.exportActivity(d,n,r.name,1))}),c()}t&2&&_("type","downloadFileCircle")("width","24")("height","24")("tooltipText",f(1,5,"TOOLTIP.DOWNLOAD_FILE"))("tooltipWidth","fit-content")}
8function vu(t,a){if(t&1&&b(0,xu,2,7,"icons-component",34),t&2){let e=u(),i=e.$index,n=e.$count;T(i!==n-1?0:-1)}}function Cu(t,a){t&1&&y(0,"div",33)}function yu(t,a){if(t&1){let e=E();l(0,"icons-component",35),g(1,"translate"),k("click",function(n){w(e);let s=u(2),r=s.$implicit,d=s.$index,m=u(2);return I(m.exportActivity(d,n,r.name,2))}),c()}t&2&&_("type","downloadFileCircle")("width","24")("height","24")("tooltipText",f(1,5,"TOOLTIP.DOWNLOAD_FILE"))("tooltipWidth","fit-content")}function bu(t,a){if(t&1&&b(0,yu,2,7,"icons-component",34),t&2){let e=u(),i=e.$index,n=e.$count;T(i!==n-1?0:-1)}}function Tu(t,a){if(t&1&&(l(0,"div",30)(1,"div",26)(2,"div"),p(3),c()(),l(4,"div",31)(5,"div",32)(6,"span"),p(7),c(),b(8,_u,1,0,"div",33)(9,vu,1,1),c()(),l(10,"div",31)(11,"div",32)(12,"span"),p(13),c(),b(14,Cu,1,0,"div",33)(15,bu,1,1),c()(),l(16,"div",28)(17,"span",11),p(18),c()()()),t&2){let e=a.$implicit,i=a.$index,n=a.$count,s=u(2);_("ngClass",F(7,fu,i===n-1)),o(3),C(e.activityRowDateLabel||e.name),o(4),C(e.series[0].value),o(),T(s.downloadLoading&&s.currentItem===i&&s.currentExportType===1?8:9),o(5),C(e.series[1].value),o(),T(s.downloadLoading&&s.currentItem===i&&s.currentExportType===2?14:15),o(4),D("",e.activePercent,"%")}}function Su(t,a){if(t&1){let e=E();l(0,"div",1)(1,"div",3)(2,"div",4)(3,"div",5),p(4),g(5,"translate"),c(),l(6,"div",6)(7,"span",7),p(8),g(9,"translate"),c(),l(10,"div",8)(11,"div",9),y(12,"span",10),l(13,"span",11),p(14),g(15,"translate"),c(),l(16,"span",12),p(17),c()(),l(18,"div",9),y(19,"span",13),l(20,"span",11),p(21),g(22,"translate"),c(),l(23,"span",12),p(24),c()()()()(),y(25,"div",14),l(26,"div",15)(27,"div",16),p(28),g(29,"translate"),c(),y(30,"div",17),l(31,"div",18,0),k("mousemove",function(n){w(e);let s=u();return I(s.onChartMouseMove(n))}),l(33,"ngx-charts-bar-vertical-2d",19),k("activate",function(n){w(e);let s=u();return I(s.showChartAdviser(n))})("deactivate",function(){w(e);let n=u();return I(n.hideChartAdviser())}),c()(),l(34,"div",20)(35,"div",9),y(36,"span",10),l(37,"span"),p(38),g(39,"translate"),c()(),l(40,"div",9),y(41,"span",13),l(42,"span"),p(43),g(44,"translate"),c()()()(),y(45,"div",14),l(46,"div",21)(47,"div",22),p(48),g(49,"translate"),c(),l(50,"div",23)(51,"div",24)(52,"div",25)(53,"div",26),p(54),g(55,"translate"),c(),l(56,"div",27),p(57),g(58,"translate"),c(),l(59,"div",27),p(60),g(61,"translate"),c(),l(62,"div",28),p(63),g(64,"translate"),c()()(),l(65,"div",29),Ie(66,Tu,19,9,"div",30,we),c()()()()()}if(t&2){let e=u();o(4),C(f(5,30,"ADMIN.BILLING.ACTIVITY")),o(4),D("",f(9,32,"ADMIN.ACTIVITY.CURRENT_MONTH"),":"),o(6),C(f(15,34,"ADMIN.ACTIVITY.REGISTERED_USERS")),o(3),C(e.registeredUsers),o(4),C(f(22,36,"ADMIN.ACTIVITY.ACTIVE_USERS")),o(3),C(e.activeUsers),o(4),C(f(29,38,"ADMIN.ACTIVITY.MONTHLY_ACTIVITY")),o(5),_("view",e.graphView)("results",e.activityGraph)("legend",!1)("scheme",e.graphSetting.colorScheme)("showXAxisLabel",!1)("showYAxisLabel",!1)("xAxis",!0)("yAxis",!0)("gradient",!1)("barPadding",e.chartBarPadding)("groupPadding",e.chartGroupPadding)("noBarWhenZero",!1)("roundDomains",!1)("roundEdges",!0)("trimXAxisTicks",!1)("tooltipDisabled",!0),o(5),C(f(39,40,"ADMIN.ACTIVITY.GRAPH.REGISTERED")),o(5),C(f(44,42,"ADMIN.ACTIVITY.GRAPH.ACTIVE")),o(5),C(f(49,44,"ADMIN.ACTIVITY.ACTIVITY_DETAIL")),o(6),C(f(55,46,"ADMIN.ACTIVITY.DATE")),o(3),C(f(58,48,"ADMIN.ACTIVITY.REGISTERED_USERS")),o(3),C(f(61,50,"ADMIN.ACTIVITY.ACTIVE_USERS")),o(3),C(f(64,52,"ADMIN.ACTIVITY.PERCENTAGE_USERS")),o(3),ke(e.activity)}}function Lu(t,a){t&1&&(l(0,"div",2),y(1,"app-billing-skeleton-component",36)(2,"div",14)(3,"app-billing-skeleton-component",37),c())}var Au=12,Hn=(()=>{class t{constructor(e,i,n,s,r,d,m,h,x){this.companyService=e,this.formBuilder=i,this.formValidationService=n,this.globalModalService=s,this.translate=r,this.stylingService=d,this.exportService=m,this.cdr=h,this.uiStateService=x,this.destroyRef=Q(us),this.filterDto={},this.enableClearFilterButton=!1,this.enableFilterButton=!1,this.loadingFilter=!0,this.downloadLoading=!1,this.currentExportType=null,this.showFilterMenu=!1,this.loading=!1,this.tooltipData={},this.mouseX=0,this.mouseY=0,this.registeredUsers=0,this.activeUsers=0,this.graphView=[600,260],this.graphSetting={series:[this.translate.instant("ADMIN.ACTIVITY.GRAPH.REGISTERED"),this.translate.instant("ADMIN.ACTIVITY.GRAPH.ACTIVE")],colorScheme:{domain:["#066BF1","#a2cdee"]}}}async ngOnInit(){this.loading=!0,this.cdr.markForCheck(),await this.getActivity(),this.loading=!1,this.cdr.markForCheck()}async ngAfterViewInit(){await this.loadFilter(),await this.ngOnChanges(),this.scheduleChartDimensionsUp
8date(),this.cdr.markForCheck()}async ngOnChanges(){this.filterForm&&this.filterForm.valueChanges.pipe(Is(this.destroyRef)).subscribe(e=>{(e.sinceDate!==null||e.untilDate!==null)&&(this.enableFilterButton=!0),this.cdr.markForCheck()})}ngOnDestroy(){this.teardownChartResizeObserver(),this.uiStateService.unsetAdviser()}async loadFilter(){this.loadingFilter=!0,this.cdr.markForCheck(),await this.createFilterForm(),this.loadingFilter=!1,this.cdr.markForCheck()}async createFilterForm(){this.filterForm=this.formBuilder.group({sinceDate:[null,[]],untilDate:[null,[]]})}async getActivity(){let e=this.buildActivityRequestFilters();await this.companyService.getActivity(e),this.setActivity(),this.setGraph(),this.setCurrentData(),this.scheduleChartDimensionsUpdate()}buildActivityRequestFilters(){return ze({},this.filterDto)}setActivity(){this.activity=structuredClone(this.companyService.activity),this.activity.forEach(e=>{let i=e.series[0]?.value??0,n=e.series[1]?.value??0;e.activePercent=i>0?Math.trunc(n/i*100):0;let s=e.name.indexOf(" "),r=e.name.substring(0,s),d=e.name.substring(s+1).trim(),m=li[r.toUpperCase()];m&&(e.activityRowDateLabel=`${m}/${d}`);let h=this.translate.instant(`ADMIN.ACTIVITY.GRAPH.${r}`);e.name=e.name.replace(r,h),e.series[0].name=this.translate.instant("ADMIN.ACTIVITY.GRAPH.REGISTERED"),e.series[1].name=this.translate.instant("ADMIN.ACTIVITY.GRAPH.ACTIVE")})}setGraph(){if(!this.activity?.length){this.activityGraph=[];return}let e=structuredClone(this.activity).slice(-Au);this.activityGraph=e,this.tooltipData={},this.activityGraph.forEach(i=>{let n=i.name.substring(0,i.name.indexOf(" ")),s=i.name.substring(i.name.indexOf(" "),i.name.length).trim(),r=n.slice(0,3)+s;this.tooltipData[r]={fullLabel:i.name,registered:i.series[0].value,active:i.series[1].value},i.name=r})}onChartMouseMove(e){this.mouseX=e.clientX,this.mouseY=e.clientY}showChartAdviser(e){let i=e?.value?.series;if(!i)return;let n=this.tooltipData[i];if(!n)return;let s=this.translate.instant("ADMIN.ACTIVITY.REGISTERED_USERS"),r=this.translate.instant("ADMIN.ACTIVITY.ACTIVE_USERS"),d=300,m=16,h=this.mouseX+m,x=!1;h+d>window.innerWidth&&(h=this.mouseX-m-d,x=!0);let v={text:`<div class="flex flex-col gap-8"> 9 <div class="bold">${n.fullLabel}</div> 10 <div class="bold flex items-center justify-between"> 11 <div class="flex items-center gap-8"> 12 <span class="inline-block h-14 w-14 shrink-0 rounded-full bg-blue"></span> 13 <span>${s}</span> 14 </div> 15 <span class="users text-black70">${n.registered}</span> 16 </div> 17 <div class="bold flex items-center justify-between"> 18 <div class="flex items-center gap-8"> 19 <span class="inline-block h-14 w-14 shrink-0 rounded-full bg-blue20"></span> 20 <span>${r}</span> 21 </div> 22 <span class="text-black70">${n.active}</span> 23 </div> 24 </div>`,positionX:h,positionY:this.mouseY-60,showAdviser:!0,isInContent:!1,openLeft:x,type:"help",adviserOnHover:!0,width:250};this.uiStateService.setAdviser(v)}hideChartAdviser(){this.uiStateService.unsetAdviser()}get chartBarPadding(){let e=this.activityGraph?.length??0;return e>=10?2:e>=6?4:8}get chartGroupPadding(){let e=this.activityGraph?.length??0;return e>=10?2:e>=6?4:8}scheduleChartDimensionsUpdate(){setTimeout(()=>{this.setupChartDimensions(),this.cdr.markForCheck()},0)}setupChartDimensions(){if(typeof ResizeObserver>"u")return;let e=this.chartHostRef?.nativeElement;e&&(this.teardownChartResizeObserver(),this.chartResizeObserver=new ResizeObserver(()=>{this.syncChartViewToHostSize(),this.cdr.markForCheck()}),this.chartResizeObserver.observe(e),this.syncChartViewToHostSize())}teardownChartResizeObserver(){this.chartResizeObserver?.disconnect(),this.chartResizeObserver=void 0}syncChartViewToHostSize(){let e=this.chartHostRef?.nativeElement;if(!e)return;let i=Math.max(1,Math.floor(e.clientWidth)),n=Math.max(1,Math.floor(e.clientHeight));(this.graphView[0]!==i||this.graphView[1]!==n)&&(this.graphView=[i,n])}async exportActivity(e,i,n,s){i.stopPropagation(),i.preventDefault(),this.downloadLoading=!0,this.currentExportType=s;try{let r=n.split(" "),d=r[0],m=r[1];d=this.getNumberMonth(d),this.currentItem=e;let v={from:`${m}-${d}-01`,type:s};await this.exportService.exportActivityLogs(v)}finally{this.downloadLoading=!1,this.currentItem="",this.currentExportType=null}}getNumberMonth(e){return e=e.toUpperCase(),li[e]}setCurrentData(){let e=this.activity[this.activity.length-1];e&&(this.registeredUsers=e.series[0].value,this.activeUsers=e.series[1].value)}showActivityDetail(e,i){i||(this.globalModalService.params={type:"sitePannelActivityDetail",styles:"modal-popUp widthActivity",month:e,component:Wa},this.globalModalService.showModal())}async filterActivity(){this.enableFilterButton=!1,this.enableClearFilterButton=!0,await this.setActivityFilter(),await this.getActivity()}async setActivityFilter(){this.filterForm.value.untilDate&&this.filterForm.value.sinceDate&&this.filterForm.value.untilDate<this.filterForm.value.sinceDate&&(this.filterForm.controls.sinceDate.setValue(this.filterForm.value.untilDate),this.filterForm.controls.untilDate.setValue(null)),this.filterDto={},this.filterForm.value.sinceDate&&(this.filterDto.since=this.formValidationService.validateDateFormat(this.filterForm.value.sinceDate)),this.filterForm.value.untilDate&&(this.filterDto.until=this.formValidationService.validateDateFormat(this.filterForm.value.untilDate))}async clearFilters(){this.filterDto={},this.filterForm.reset(),await this.filterActivity(),this.enableClearFilterButton=!1}static{this.\u0275fac=function(i){return new(i||t)(S(j),S(qt),S(Qs),S(K),S(ee),S(fe),S(nn),S(U),S(ht))}}static{this.\u0275cmp=O({type:t,selectors:[["app-activity"]],viewQuery:function(i,n){if(i&1&&De(gu,5),i&2){let s;
24Te(s=Se())&&(n.chartHostRef=s.first)}},standalone:!1,features:[ae],decls:2,vars:1,consts:[["chartHost",""],[1,"billingTabs"],[1,"activityContent"],[1,"activityContent","bg-white","pd-24","br-10"],[1,"flex","fd-r","ai-c","jc-sb","flex-wrap","gap-16","w-full"],[1,"big","text-blue","bold","m-0","leading-none"],[1,"flex","fd-r","ai-c","flex-wrap","gap-16","text-sm"],[1,"bold","text-black","shrink-0"],[1,"flex","fd-r","ai-c","flex-wrap","gap-16"],[1,"flex","fd-r","ai-c","gap-8"],[1,"inline-block","h-[15px]","w-[15px]","shrink-0","rounded-full","bg-blue"],[1,"text-black"],[1,"text-black60"],[1,"inline-block","h-[15px]","w-[15px]","shrink-0","rounded-full","bg-[#a2cdee]"],[1,"h-24"],[1,"border-2-s-clouds","br-10","pd-24","box-border","flex","h-[388px]","max-h-[388px]","flex-col","overflow-hidden"],[1,"big","shrink-0","text-blue","pd-0-tb"],[1,"h-16","shrink-0"],[1,"pos-r","min-h-0","min-w-0","w-full","flex-1","of-h",3,"mousemove"],[3,"activate","deactivate","view","results","legend","scheme","showXAxisLabel","showYAxisLabel","xAxis","yAxis","gradient","barPadding","groupPadding","noBarWhenZero","roundDomains","roundEdges","trimXAxisTicks","tooltipDisabled"],["role","group",1,"flex","shrink-0","flex-row","flex-wrap","items-center","justify-center","gap-24","pt-12","text-sm","text-black"],[1,"activityDetails"],[1,"big","text-blue","bold","m-0","mb-16"],[1,"border-2-s-clouds","br-10","box-bb","pd-24"],[1,"rGridList","headList","noSticky","noMargin"],[1,"gridItem","headerOptions"],[1,"gridCol","sp3"],[1,"gridCol","sp6","text-center"],[1,"gridCol","sp5","right"],[1,"rGridList","noMargin","activityData"],[1,"gridItem","noBorder","cursor-default",3,"ngClass"],[1,"gridCol","sp6"],[1,"flex","fd-r","ai-c","jc-c","gap-8"],[1,"spinner-b","show"],["data-activity-dl","","rgTooltip","",1,"chevron","cursor-pointer",3,"type","width","height","tooltipText","tooltipWidth"],["data-activity-dl","","rgTooltip","",1,"chevron","cursor-pointer",3,"click","type","width","height","tooltipText","tooltipWidth"],["skeletonType","graph"],["skeletonType","activityDetail"]],template:function(i,n){i&1&&b(0,Su,68,54,"div",1)(1,Lu,4,0,"div",2),i&2&&T(n.loading?1:0)},dependencies:[Ge,$s,so,he,wl,te],encapsulation:2,changeDetection:0})}}return t})();var Iu=(t,a)=>({value:t,class:"rindeButton-g",loading:a});function ku(t,a){if(t&1){let e=E();l(0,"div",0)(1,"div",1),y(2,"icons-component",2)(3,"div",3),l(4,"div",4),p(5),g(6,"translate"),c(),p(7),g(8,"translate"),y(9,"div",5),l(10,"btn-component",6),g(11,"translate"),k("click",function(){w(e);let n=u();return I(n.showAdviserPlan())}),c(),y(12,"div",7)(13,"div",8),g(14,"translate"),c()(),y(15,"div",3)}if(t&2){let e=u();o(2),_("type","endFreeTrial"),o(3),D(" ",f(6,5,"SELECT_COMPANY.FREE_TRIAL.END")," "),o(2),D(" ",f(8,7,"SELECT_COMPANY.FREE_TRIAL.SUBSCRIBE")," "),o(3),_("buttonObject",ce(13,Iu,f(11,9,"SELECT_COMPANY.FREE_TRIAL.SEE_PLANS"),e.loadingButton)),o(3),_("innerHTML",f(14,11,"SELECT_COMPANY.FREE_TRIAL.OVER"),le)}}function Du(t,a){t&1&&y(0,"app-simple-form-skeleton")}var qa=(()=>{class t{constructor(e,i,n,s){this.globalModalService=e,this.uiStateService=i,this.companyService=n,this.translate=s,this.cdr=Q(U),this.params=null,this.loading=!1,this.loadingButton=!1}async ngOnInit(){}showAdviserPlan(){this.closeModal(),setTimeout(()=>{let e;this.companyService.userCompany.relationship.roles.admin===1?e="admin":e="employee";let i={show:!0,title:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.TITLE"),subtitle:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.SUBTITLE"),greenText:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.GREEN_TEXT"),cancelText:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.CANCEL"),detailTitle:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.DETAIL_TITLE"),detailText:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.DETAIL_TEXT"),type:e,modalPlan:!0};this.uiStateService.showModalAdviser(i),this.cdr.markForCheck()},300)}closeModal(){this.globalModalService.forceVisibility=!1,this.globalModalService.closeModal()}static{this.\u0275fac=function(i){return new(i||t)(S(K),S(ht),S(j),S(ee))}}static{this.\u0275cmp=O({type:t,selectors:[["app-end-free-trial"]],standalone:!1,decls:2,vars:1,consts:[[1,"block","w-full","p-0"],[1,"block","w-full","p-0","flex","ff-c-nw","ai-c","ta-c"],[3,"type"],[1,"h-24"],[1,"header-1","text-blue"],[1,"h-32"],[3,"click","buttonObject"],[1,"h-12"],[1,"small",3,"innerHTML"]],template:function(i,n){i&1&&b(0,ku,16,16)(1,Du,1,0,"app-simple-form-skeleton"),i&2&&T(n.loading?1:0)},dependencies:[me,he,kt,te],encapsulation:2,changeDetection:0})}}return t})();var Eu=t=>({value:t,class:"rindeButton-b nM w-[356px] justify-center items-center"});function Bu(t,a){if(t&1){let e=E();l(0,"div",9),y(1,"div",11),g(2,"translate"),l(3,"div",12)(4,"video",13,0),k("c
24anplay",function(){w(e);let n=Z(5);return I(n.play())})("loadedmetadata",function(){w(e);let n=Z(5);return I(n.muted=!0)}),y(6,"source",14),c()(),y(7,"div",15),g(8,"translate"),c()}if(t&2){let e=u();o(),_("innerHTML",f(2,3,e.featureLabel),le),o(5),_("src",e.videoUrl),o(),_("innerHTML",f(8,5,e.description),le)}}var Xn=(()=>{class t{constructor(){this.cdr=Q(U),this.badgeText="BETA_ADVISER.NEW",this.title="",this.featureLabel="",this.description="",this.buttonText="BETA_ADVISER.GOT_IT",this.dismissed=new z,this.bottomOffset=100}ngAfterViewInit(){setTimeout(()=>this.calculatePosition(),500),this.cdr.markForCheck()}dismiss(){this.dismissed.emit()}calculatePosition(){let e=document.querySelector(".intercom-launcher-frame");if(e){let i=e.getBoundingClientRect();this.bottomOffset=window.innerHeight-i.top+24}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["app-feature-news-card"]],inputs:{badgeText:"badgeText",title:"title",featureLabel:"featureLabel",description:"description",buttonText:"buttonText",videoUrl:"videoUrl"},outputs:{dismissed:"dismissed"},decls:15,vars:15,consts:[["video",""],[1,"fixed","right-24","z-[1001]","flex","w-[408px]","max-w-[calc(100vw-48px)]","flex-col","items-start","gap-24","rounded-10","bg-white","p-24","shadow-soft"],[1,"flex","flex-col","gap-8","w-full"],[1,"flex","w-full","items-center","justify-between"],[1,"flex","items-center","gap-8"],[1,"big","bold","text-blue"],[1,"smaller","bold","bg-lemon","br-4","pd-4-tb","pd-10-sides","max-w-mc"],["type","closeMenuModal",1,"w-24","h-24","pointer",3,"click"],[1,"big",3,"innerHTML"],[1,"w-full","border-black20","box-border","border","rounded-10","flex","flex-col"],[3,"click","buttonObject"],[1,"p-16","bold","box-border",3,"innerHTML"],[1,"min-h-200","border-t","border-black20","border-b"],["loop","","muted","","autoplay","",1,"w-full","h-full","object-cover",3,"canplay","loadedmetadata"],["type","video/webm",3,"src"],[1,"bg-blueLight","p-16","box-border",3,"innerHTML"]],template:function(i,n){i&1&&(l(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5),p(5),g(6,"translate"),c(),l(7,"div",6),p(8),g(9,"translate"),c()(),l(10,"icons-component",7),k("click",function(){return n.dismiss()}),c()(),y(11,"div",8),g(12,"translate"),c(),b(13,Bu,9,7,"div",9),l(14,"btn-component",10),k("click",function(){return n.dismiss()}),c()()),i&2&&(Fe("bottom",n.bottomOffset,"px"),o(5),D(" ",f(6,7,"FEATURE_NEWS_CARD.HEADER")," "),o(3),D(" ",f(9,9,n.badgeText)," "),o(3),_("innerHTML",f(12,11,n.title),le),o(2),T(n.featureLabel?13:-1),o(),_("buttonObject",F(13,Eu,n.buttonText)))},dependencies:[he,me,te],encapsulation:2,changeDetection:0})}}return t})();var Ol=t=>({days:t}),Mu=t=>({date:t}),Fu=()=>({class:"rindeButton-g nM",value:"ADMIN.BILLING.SITEPANNEL_BILL.PAY_BILL"});function Ru(t,a){t&1&&(l(0,"div",10),p(1),g(2,"translate"),c()),t&2&&(o(),C(f(2,1,"ADMIN.BILLING.OVERDUE")))}function Ou(t,a){t&1&&(l(0,"div",11),p(1),g(2,"translate"),c()),t&2&&(o(),C(f(2,1,"ADMIN.BILLING.TO_BE_DUE")))}function Pu(t,a){t&1&&(l(0,"div",12),p(1),g(2,"translate"),c()),t&2&&(o(),C(f(2,1,"ADMIN.BILLING.PAID")))}function Vu(t,a){if(t&1&&(l(0,"div",13),p(1),g(2,"translate"),c()),t&2){let e=u();_("ngClass",(e.params.bill.billFiles==null?null:e.params.bill.billFiles.length)>0?"bg-blue10":"bg-red20"),o(),D(" ",Le(2,2,"ADMIN.BILLING.SITEPANNEL_BILL.EXPIRED_SINCE",F(5,Ol,e.daysDiff))," ")}}function Gu(t,a){if(t&1&&(l(0,"div",13),p(1),g(2,"translate"),c()),t&2){let e=u();_("ngClass",(e.params.bill.billFiles==null?null:e.params.bill.billFiles.length)>0?"bg-blue10":"bg-yellow20"),o(),D(" ",Le(2,2,"ADMIN.BILLING.SITEPANNEL_BILL.DUE_IN",F(5,Ol,e.daysDiff))," ")}}function Hu(t,a){if(t&1&&(l(0,"div",14),p(1),g(2,"formatDate"),g(3,"translate"),c()),t&2){let e=u();o(),D(" ",Le(3,3,"ADMIN.BILLING.SITEPANNEL_BILL.PAID_ON",F(6,Mu,f(2,1,e.params.bill.paymentDate)))," ")}}function Xu(t,a){if(t&1&&p(0),t&2){let e=u();D(" ",e.companyService.userCompany.billingInfo.biPContact," ")}}function Yu(t,a){t&1&&(l(0,"span",23),p(1),g(2,"translate"),c()),t&2&&(o(),C(f(2,1,"NO_DATA")))}function zu(t,a){if(t&1){let e=E();l(0,"div",26)(1,"btn-component",28),k("click",function(){w(e);let n=u();return I(n.navigate())}),c(),l(2,"div",29),p(3),g(4,"translate"),c()()}t&2&&(o(),_("buttonObject",G(4,Fu)),o(2),C(f(4,2,"ADMIN.BILLING.SITEPANNEL_BILL.REDIRECT_PAYMENT_OPTIONS")))}function $u(t,a){t&1&&(y(0,"div",27),g(1,"translate")),t&2&&_("innerHTML",f(1,1,"ADMIN.BILLING.SITEPANNEL_BILL.PROCESSING_INFO"),le)}var Qa=(()=>{class t{constructor(e,i,n,s,r,d){this.router=e,this.globalModalService=i,this.fileManagerService=n,this.stylingService=s,this.translate=r,this.companyService=d,this.cdr=Q(U),this.exportParameter={},this.loading=!1,this.loadingButton=!1,this.billState="pending",this.daysDiff=0}async ngOnInit(){this.loading=!0,this.cdr.markForCheck(),this.params=this.globalModalService.params,this.calculateBillState(),this.loading=!1,this.cdr.markForCheck()}calculateBillState(){let e=this.params.bill;if(e.expirationStatus===Ee.PAID?this.billState="paid":e.expirationStatus===Ee.EXPIRED?this.billState="expired":this.billState="pending",e.expirationDate){let i=new Date;i.setHours(0,0,0,0);let n=new Date(e.expirationDate);n.setHours(0,0,0,0);let s=n.getTime()-i.getTime();this.daysDiff=Math.abs(Math.round(s/(1e3*60*60*24)))}}displayCurrency(e){return e==="CLF"?"UF":e}navigate(){this.globalModalService.closeModal(),this.router.navigate(["/admin/billing/bill",this.params.bill.id])}static{this.\u0275fac=function(i){return new(i||t)(S(He),S(K),S(Kt),S(fe),S(ee),S(j))}}static{this.\u0275cmp=O({type:t,selectors:[["app-sitepannel-bill"]],standalone:!1,decls:73,vars:59,consts:[[1,"p-48","flex","flex-col","gap-24"],[1,"bg-blueLight","br-10"],[1,"flex","jc-sb","ai-c","p-24"],[1,"topLeft"],[1,"bold","big"],[1,"biggest","bold"],[1,"flex","flex-col","gap-14","ai-fe"],[1,"downloadBillFile",3,"matTooltip"],["target","_blank",1,"inline-block","w-fit","m-auto",3,"href"],[3,"type"],[1,"rgChip-static-r","text-red"],[1,"rgChip-static-y","text-yellow"],[1,"rgChip-static-g","text-green"],[1,"w-full","bold","text-center","py-8",3,"ngClass"],[1,"w-full","bg-green20","bold","text-center","py-8"],[1,"flex","justify-between","gap-8","p-24"],[1,"bold"],[1,"text-black70"],[1,"bg-blueLight","br-10","py-32","px-24","flex","flex-col","gap-40"],[1,"flex","flex-col","gap-32"],[1,"flex","justify-between","gap-8"],[1,"gridCol","bold","sp10"],[1,"grayDark"],[1,"n
24oData"],[1,"flex","flex-col","gap-8"],[1,""],[1,"flex","fd-c","fw-nw","ai-c","jc-c"],[1,"text-center","small","lh-140",3,"innerHTML"],[3,"click","buttonObject"],[1,"small","lh-140"]],template:function(i,n){i&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),p(5),g(6,"translate"),c(),l(7,"div",5),p(8),g(9,"formatNumber"),c()(),l(10,"div",6)(11,"div",7),g(12,"translate"),l(13,"a",8),y(14,"icons-component",9),c()(),b(15,Ru,3,3,"div",10),b(16,Ou,3,3,"div",11),b(17,Pu,3,3,"div",12),c()(),b(18,Vu,3,7,"div",13),b(19,Gu,3,7,"div",13),b(20,Hu,4,8,"div",14),l(21,"div",15)(22,"div")(23,"div",16),p(24),g(25,"translate"),c(),l(26,"div",17),p(27),g(28,"formatDate"),c()(),l(29,"div")(30,"div",16),p(31),g(32,"translate"),c(),l(33,"div",17),p(34),g(35,"formatDate"),c()(),l(36,"div")(37,"div",16),p(38),g(39,"translate"),c(),l(40,"div",17),p(41),g(42,"translate"),c()()()(),l(43,"div",18)(44,"div",19)(45,"div",20)(46,"div",21),p(47),g(48,"translate"),c(),l(49,"div",22),b(50,Xu,1,1)(51,Yu,3,3,"span",23),c()(),l(52,"div",20)(53,"div",21),p(54),g(55,"translate"),c(),l(56,"div",22),p(57,"Rindegastos Spa"),c()(),l(58,"div",20)(59,"div",21),p(60),g(61,"translate"),c(),l(62,"div",22),p(63),g(64,"translate"),c()()(),l(65,"div",24)(66,"div",16),p(67),g(68,"translate"),c(),l(69,"div",25),p(70),c()()(),b(71,zu,5,5,"div",26),b(72,$u,2,3,"div",27),c()),i&2&&(o(5),V("",f(6,30,"FISCAL.MODAL.ASSIGN_BILL.BILL")," #",n.params.bill.invoiceNumber),o(3),V("",Le(9,32,n.params.bill.total,n.params.bill.currency)," ",n.displayCurrency(n.params.bill.currency)),o(3),_("matTooltip",f(12,35,"TOOLTIP.DOWNLOAD_FILE")),o(2),_("href",n.params.bill.file,zt),o(),_("type","downloadBill"),o(),T(n.billState==="expired"?15:-1),o(),T(n.billState==="pending"?16:-1),o(),T(n.billState==="paid"?17:-1),o(),T(n.billState==="expired"?18:-1),o(),T(n.billState==="pending"?19:-1),o(),T(n.billState==="paid"?20:-1),o(4),C(f(25,37,"ADMIN.BILLING.SITEPANNEL_BILL.ISSUANCE")),o(3),C(f(28,39,n.params.bill.documentDate)),o(4),C(f(32,41,"ADMIN.BILLING.SITEPANNEL_BILL.EXPIRATION")),o(3),C(f(35,43,n.params.bill.expirationDate)),o(4),C(f(39,45,"ADMIN.BILLING.SITEPANNEL_BILL.PAYMENT_DEADLINE")),o(3),V("",n.params.bill.paymentTerm," ",f(42,47,"ADMIN.BILLING.SITEPANNEL_BILL.DAYS")),o(6),C(f(48,49,"ADMIN.BILLING.SITEPANNEL_BILL.RECEIVER")),o(3),T(!(n.companyService.userCompany==null||n.companyService.userCompany.billingInfo==null)&&n.companyService.userCompany.billingInfo.biPContact?50:51),o(4),C(f(55,51,"ADMIN.BILLING.SITEPANNEL_BILL.TRANSMITTER")),o(6),C(f(61,53,"ADMIN.BILLING.SITEPANNEL_BILL.PAYMENT_DEADLINE")),o(3),V("",n.params.bill.paymentTerm," ",f(64,55,"ADMIN.BILLING.SITEPANNEL_BILL.DAYS")),o(4),C(f(68,57,"ADMIN.BILLING.SITEPANNEL_BILL.DESCRIPTION")),o(3),C(n.params.bill.detail),o(),T((n.billState==="expired"||n.billState==="pending")&&!((n.params.bill.billFiles==null?null:n.params.bill.billFiles.length)>0)?71:-1),o(),T((n.params.bill.billFiles==null?null:n.params.bill.billFiles.length)>0&&n.billState!=="paid"?72:-1))},dependencies:[Ge,zs,me,he,te,Qt,gt],encapsulation:2,changeDetection:0})}}return t})();var At=(()=>{class t{constructor(e,i){this.axiosService=e,this.translate=i,this.paymentsMicroservice="/payments",this.expenses=[],this.draftExpenses=[],this.createdMultipleExpenses=[],this.multipleExpenses=[],this.expensesUpdatedAt=null,this.warningAlert={},this.scanitsCreated=[]}async createSubscription(e){let n=this.paymentsMicroservice+"/createSubscriptionKushki",s=await this.axiosService.postMicroserviceSecure(n,e);return s.ok?s.data:!1}async getCardSubscriptionToken(e){return await this.axiosService.postKushkiSecure("/subscriptions/v1/card/tokens",e)}async disableSubscriptionKushki(){let i=this.paymentsMicroservice+"/disableSubscriptionKushki",n=await this.axiosService.postMicroserviceSecure(i);if(n.ok)return n.data}async registeredCreditCard(e){let n=this.paymentsMicroservice+"/registeredCreditCard"+"?companyId="+e,s=await this.axiosService.getMicroserviceSecure(n);if(s.ok)return s.data}async billList(e){let n=this.paymentsMicroservice+"/billList"+"?companyId="+e,s=await this.axiosService.getMicroserviceSecure(n);if(s.ok)return s.data}static{this.\u0275fac=function(i){return new(i||t)(pe(mt),pe(ee))}}static{this.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ke=(function(t){return t.BILLING_CARD_ADDED="BILLING_CARD_ADDED",t.BILLING_CARD_UPDATED="BILLING_CARD_UPDATED",t.BILLING_CARD_REMOVED="BILLING_CARD_REMOVED",t.BILLING_BILL_PAID="BILLING_BILL_PAID",t})(Ke||{});var ci=(()=>{class t{constructor(e,i,n){this.axiosService=e,this.translate=i,this.companyService=n,this.paymentsMicroservice="/payments",this.expenses=[],this.draftExpenses=[],this.createdMultipleExpenses=[],this.multipleExpenses=[],this.expensesUpdatedAt=null,this.warningAlert={},this.scanitsCreated=[]}async createSubscription(e){let n=this.paymentsMicroservice+"/createSubscriptionMercadoPago";return await this.axiosService.postMicroserviceSecure(n,e)}async getCardSubscriptionToken(e){return await this.axiosService.postKushkiSecure("/subscriptions/v1/card/tokens",e)}async disableSubscriptionMercadoPago(){let i=this.paymentsMicroservice+"/disableSubscriptionMercadoPago",n=await this.axiosService.postMicroserviceSecure(i);if(n.ok)return this.companyService.getUserCompany(this.companyService.userCompany.companyId),n.data}async registeredCreditCard(e){let n=this.paymentsMicroservice+"/registeredCreditCard"+"?companyId="+e,s=await this.axiosService.getMicroserviceSecure(n);if(s.ok)return s.data}async billList(e){let n=this.paymentsMicroservice+"/billList"+"?companyId="+e,s=await this.axiosService.getMicroserviceSecure(n);if(s.ok)return s.data}static{this.\u0275fac=function(i){return new(i||t)(pe(mt),pe(ee),pe(j))}}static{this.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var di=(()=>{class t{constructor(e,i){this.axiosService=e,this.companyService=i,this.paymentsMicroservice="/payments"}async createSubscription(e){let n=this.paymentsMicroservice+"/createSubscriptionRebill",s=await this.axiosService.postMicroserviceSecure(n,e);return s.ok&&await this.companyService.getUserCompany(this.companyService.userCompany.companyId),s}async chargeCustomer(e){let n=this.paymentsMicroservice+"/chargeCustomerRebill",s=await this.axiosService.postMicroserviceSecure(n,e);return s.ok?s.data:!1}async apmCheckout(e){let n=this.paymentsMicroservice+"/apmCheckoutRebill",s=await this.axiosService.postMicroserviceSecure(n,e);return s.ok?s.data:!1}async disableSubscription(){let i=this.paymentsMicroservice+"/disableSubscriptionRebill",n=await this.axiosService.postMicroserviceSecure(i);return n.ok?(await this.companyService.getUserCompany(this.companyService.userCompany.companyId),n.data):!1}
24async getRebillCard(){let i=this.paymentsMicroservice+"/rebillCard",n=await this.axiosService.getMicroserviceSecure(i);return n.ok?n.data:null}async createCardUpdateLink(){let i=this.paymentsMicroservice+"/createCardUpdateLinkRebill",n=await this.axiosService.postMicroserviceSecure(i);return n.ok?n.data:!1}static{this.\u0275fac=function(i){return new(i||t)(pe(mt),pe(j))}}static{this.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var tt=(function(t){return t.VISA="Visa",t.MASTERCARD="MasterCard",t.AMEX="AMEX",t.DISCOVER="Discover",t})(tt||{});var pi=(()=>{class t{detectBrand(e){if(!e)return null;let i=e.replace(/\D/g,"");return/^4/.test(i)?tt.VISA:/^5[1-5]/.test(i)?tt.MASTERCARD:/^3[47]/.test(i)?tt.AMEX:/^6(?:011|5)/.test(i)?tt.DISCOVER:null}cvvLength(e){return e===tt.AMEX?4:3}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Wu="https://sdk.mercadopago.com/js/v2",ju="mercadopago-sdk",Pl=(()=>{class t{constructor(){this.scriptPromises=new Map}loadScript(e,i,n=!1){if(!i)return Promise.reject(new Error(`No hay URL configurada para el SDK "${e}"`));let s=this.scriptPromises.get(e);if(s)return s;let r=new Promise((d,m)=>{if(document.getElementById(e)){d();return}let x=document.createElement("script");x.id=e,x.src=i,x.async=!0,n&&(x.type="module"),x.onload=()=>d(),x.onerror=()=>m(new Error(`No se pudo cargar el SDK "${e}"`)),document.body.appendChild(x)});return this.scriptPromises.set(e,r),r}async loadMercadoPagoSdk(){await this.loadScript(ju,Wu)}async loadRebillSdk(){let{defineCustomElements:e}=await import("./chunk-KABL4NGC.js");await e(window)}async tokenizeMercadoPagoCard(e){if(await this.loadMercadoPagoSdk(),!window.MercadoPago)throw new Error("MercadoPago SDK no disponible");return new window.MercadoPago(Ut.MERCADOPAGO_PUBLIC_KEY,{locale:"es-CL"}).createCardToken(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Zu=["rebillSaveCardHost"],Ju=t=>({"flex flex-col max-h-[70vh]":t}),e0=t=>({"flex-1 min-h-0 overflow-y-auto overflow-x-hidden":t}),t0=()=>({value:"ADMIN.BILLING.MODAL_BILLING_INFO.CANCEL",class:"rindeButton-o-t nM"}),Me=t=>({restrictive:t}),i0=(t,a,e)=>({visa:t,americanExpress:a,masterCard:e}),n0=t=>({value:"ADMIN.BILLING.CREDIT_CARD_MODAL.SAVE_CARD",class:"rindeButton-g nM",loading:t});function a0(t,a){t&1&&y(0,"div",8,0)}function s0(t,a){if(t&1&&(l(0,"div",17)(1,"div",18),p(2),g(3,"translate"),c(),l(4,"div",22),y(5,"input",41),g(6,"translate"),c()(),y(7,"div",6)),t&2){let e=u(3);
24_("ngClass",F(7,Me,e.creditCardForm.controls.id.invalid&&e.checkFieldsRequired)),o(2),D(" ",f(3,3,"ADMIN.BILLING.CREDIT_CARD_MODAL.RUT")," "),o(3),_("placeholder",f(6,5,"ADMIN.BILLING.CREDIT_CARD_MODAL.RUT_PLACEHOLDER"))}}function o0(t,a){if(t&1){let e=E();l(0,"div",42),p(1),g(2,"translate"),c(),l(3,"div",17)(4,"div",18),p(5),g(6,"translate"),c(),l(7,"div",22),y(8,"input",43),g(9,"translate"),c()(),y(10,"div",6),l(11,"div",17)(12,"div",18),p(13),g(14,"translate"),c(),l(15,"div",22),y(16,"input",44),g(17,"translate"),c()(),y(18,"div",6),l(19,"div",17)(20,"div",18),p(21),g(22,"translate"),c(),l(23,"div",22)(24,"ng-select",45),g(25,"translate"),k("change",function(n){w(e);let s=u(3);return I(s.onIdentificationTypeChange(n))}),c()()(),y(26,"div",6),l(27,"div",17)(28,"div",18),p(29),g(30,"translate"),c(),l(31,"div",22)(32,"input",46),g(33,"translate"),k("keypress",function(n){w(e);let s=u(3);return I(s.stylingService.keyPressNumbers(n))}),c()()(),y(34,"div",6)}if(t&2){let e=u(3);o(),C(f(2,16,"ADMIN.BILLING.CREDIT_CARD_MODAL.PERSONAL_INFO")),o(2),_("ngClass",F(34,Me,(e.creditCardForm.controls.firstName==null?null:e.creditCardForm.controls.firstName.invalid)&&e.checkFieldsRequired)),o(2),C(f(6,18,"ADMIN.BILLING.CREDIT_CARD_MODAL.FIRST_NAME")),o(3),_("placeholder",f(9,20,"ADMIN.BILLING.CREDIT_CARD_MODAL.FIRST_NAME_PLACEHOLDER")),o(3),_("ngClass",F(36,Me,(e.creditCardForm.controls.lastName==null?null:e.creditCardForm.controls.lastName.invalid)&&e.checkFieldsRequired)),o(2),C(f(14,22,"ADMIN.BILLING.CREDIT_CARD_MODAL.LAST_NAME")),o(3),_("placeholder",f(17,24,"ADMIN.BILLING.CREDIT_CARD_MODAL.LAST_NAME_PLACEHOLDER")),o(3),_("ngClass",F(38,Me,(e.creditCardForm.controls.identificationType==null?null:e.creditCardForm.controls.identificationType.invalid)&&e.checkFieldsRequired)),o(2),C(f(22,26,"ADMIN.BILLING.CREDIT_CARD_MODAL.IDENTIFICATION_TYPE")),o(3),_("items",e.rebillIdentificationTypes)("clearable",!1)("placeholder",f(25,28,"ADMIN.BILLING.CREDIT_CARD_MODAL.IDENTIFICATION_TYPE_PLACEHOLDER")),o(3),_("ngClass",F(40,Me,(e.creditCardForm.controls.identificationValue==null?null:e.creditCardForm.controls.identificationValue.invalid)&&e.checkFieldsRequired)),o(2),C(f(30,30,"ADMIN.BILLING.CREDIT_CARD_MODAL.IDENTIFICATION_NUMBER")),o(3),_("placeholder",f(33,32,"ADMIN.BILLING.CREDIT_CARD_MODAL.IDENTIFICATION_NUMBER_PLACEHOLDER"))("maxlength",e.identificationValueMaxLength)}}function r0(t,a){if(t&1){let e=E();y(0,"div",6),l(1,"div",47),p(2),g(3,"translate"),c(),l(4,"div",48)(5,"div",49),y(6,"input",50),c(),l(7,"div",51)(8,"div",22)(9,"input",52),g(10,"translate"),k("keypress",function(n){w(e);let s=u(3);return I(s.stylingService.keyPressNumbers(n))}),c()()()(),y(11,"div",6),l(12,"div",42),p(13),g(14,"translate"),c(),l(15,"div",53)(16,"div",18),p(17),g(18,"translate"),c(),l(19,"div",54),y(20,"input",55),c()(),y(21,"div",6),l(22,"div",17)(23,"div",18),p(24),g(25,"translate"),c(),l(26,"div",22),y(27,"input",56),g(28,"translate"),c()(),y(29,"div",6),l(30,"div",17)(31,"div",18),p(32),g(33,"translate"),c(),l(34,"div",22),y(35,"input",57),g(36,"translate"),c()(),y(37,"div",6),l(38,"div",17)(39,"div",18),p(40),g(41,"translate"),c(),l(42,"div",22),y(43,"input",58),g(44,"translate"),c()(),y(45,"div",6),l(46,"div",17)(47,"div",18),p(48),g(49,"translate"),c(),l(50,"div",22),y(51,"input",59),g(52,"translate"),c()(),y(53,"div",6),l(54,"div",53)(55,"div",18),p(56),g(57,"translate"),c(),l(58,"div",22),y(59,"input",60),g(60,"translate"),c()()}if(t&2){let e=u(3);o(2),C(f(3,19,"ADMIN.BILLING.CREDIT_CARD_MODAL.PHONE_NUMBER")),o(5),_("ngClass",F(47,Me,(e.creditCardForm.controls.phoneNumber==null?null:e.creditCardForm.controls.phoneNumber.invalid)&&e.checkFieldsRequired)),o(2),_("placeholder",f(10,21,"ADMIN.BILLING.CREDIT_CARD_MODAL.PHONE_NUMBER_PLACEHOLDER")),o(4),C(f(14,23,"ADMIN.BILLING.CREDIT_CARD_MODAL.ADDRESS")),o(4),C(f(18,25,"ADMIN.BILLING.CREDIT_CARD_MODAL.COUNTRY")),o(5),_("ngClass",F(49,Me,(e.creditCardForm.controls.state==null?null:e.creditCardForm.controls.state.invalid)&&e.checkFieldsRequired)),o(2),C(f(25,27,"ADMIN.BILLING.CREDIT_CARD_MODAL.STATE")),o(3),_("placeholder",f(28,29,"ADMIN.BILLING.CREDIT_CARD_MODAL.STATE_PLACEHOLDER")),o(3),_("ngClass",F(51,Me,(e.creditCardForm.controls.city==null?null:e.creditCardForm.controls.city.invalid)&&e.checkFieldsRequired)),o(2),C(f(33,31,"ADMIN.BILLING.CREDIT_CARD_MODAL.CITY")),o(3),_("placeholder",f(36,33,"ADMIN.BILLING.CREDIT_CARD_MODAL.CITY_PLACEHOLDER")),o(3),_("ngClass",F(53,Me,(e.creditCardForm.controls.zipCode==null?null:e.creditCardForm.controls.zipCode.invalid)&&e.checkFieldsRequired)),o(2),C(f(41,35,"ADMIN.BILLING.CREDIT_CARD_MODAL.ZIP_CODE")),o(3),_("placeholder",f(44,37,"ADMIN.BILLING.CREDIT_CARD_MODAL.ZIP_CODE_PLACEHOLDER")),o(3),_("ngClass",F(55,Me,(e.creditCardForm.controls.addressLine1==null?null:e.creditCardForm.controls.addressLine1.invalid)&&e.checkFieldsRequired)),o(2),C(f(49,39,"ADMIN.BILLING.CREDIT_CARD_MODAL.ADDRESS_LINE_1")),o(3),_("placeholder",f(52,41,"ADMIN.BILLING.CREDIT_CARD_MODAL.ADDRESS_LINE_1_PLACEHOLDER")),o(5),C(f(57,43,"ADMIN.BILLING.CREDIT_CARD_MODAL.ADDRESS_LINE_2")),o(3),_("placeholder",f(60,45,"ADMIN.BILLING.CREDIT_CARD_MODAL.ADDRESS_LINE_2_PLACEHOLDER"))}}function l0(t,a){t&1&&y(0,"icons-component",35),t&2&&_("type","credit
24CardIcon")}function c0(t,a){if(t&1&&(l(0,"div")(1,"div",40),p(2),c()()),t&2){let e=u(3);o(2),C(e.expireCard)}}function d0(t,a){if(t&1&&(l(0,"div",40),p(1),c()),t&2){let e=u(3);o(),C(e.expireCard)}}function p0(t,a){if(t&1){let e=E();l(0,"div",9)(1,"div",14)(2,"form",15)(3,"div",16),b(4,s0,8,9),b(5,o0,35,42),l(6,"div",17)(7,"div",18),p(8),g(9,"translate"),c(),l(10,"div",19)(11,"input",20),k("input",function(n){w(e);let s=u(2);return I(s.onCardNumberInput(n))}),c(),y(12,"icons-component",21),c()(),y(13,"div",6),l(14,"div",17)(15,"div",18),p(16),g(17,"translate"),c(),l(18,"div",22),y(19,"input",23),g(20,"translate"),c()(),y(21,"div",6),l(22,"div",24)(23,"div",25)(24,"div",26)(25,"div",18),p(26),g(27,"translate"),c(),l(28,"div",27,1),k("mouseover",function(){w(e);let n=Z(29),s=u(2);return I(s.showAdviser(n,"expirationDate"))})("mouseleave",function(){w(e);let n=u(2);return I(n.closeAdviser())}),y(30,"icons-component",28),c()(),l(31,"div",29)(32,"div",22)(33,"input",30),k("input",function(n){w(e);let s=u(2);return I(s.onExpirationInput(n))}),c()()()(),l(34,"div",31)(35,"div",26)(36,"div",18),p(37),g(38,"translate"),c(),l(39,"div",27,2),k("mouseover",function(){w(e);let n=Z(40),s=u(2);return I(s.showAdviser(n,"cvv"))})("mouseleave",function(){w(e);let n=u(2);return I(n.closeAdviser())}),y(41,"icons-component",28),c()(),l(42,"div",29)(43,"div",22)(44,"input",32),k("keypress",function(n){w(e);let s=u(2);return I(s.stylingService.keyPressNumbers(n))}),c()()()()(),b(45,r0,61,57),c()()(),l(46,"div",33)(47,"div",34),b(48,l0,1,1,"icons-component",35),l(49,"div",36)(50,"div",37),p(51),c(),l(52,"div",38),p(53),g(54,"uppercase"),c(),l(55,"div",39),b(56,c0,3,1,"div")(57,d0,2,1,"div",40),l(58,"div",40),p(59),c()()()()()()}if(t&2){let e=u(2);o(2),_("formGroup",e.creditCardForm),o(2),T(e.creditCardForm.controls.id&&!e.isRebill?4:-1),o(),T(e.isRebill?5:-1),o(),_("ngClass",F(36,Me,e.credit
24CardForm.controls.cardNumber.invalid&&e.checkFieldsRequired)),o(2),D(" ",f(9,24,"ADMIN.BILLING.CREDIT_CARD_MODAL.CARD_NUMBER")," "),o(4),_("type","inputCard"),o(2),_("ngClass",F(38,Me,e.creditCardForm.controls.cardName.invalid&&e.checkFieldsRequired)),o(2),D(" ",f(17,26,"ADMIN.BILLING.CREDIT_CARD_MODAL.OWNER_NAME")," "),o(3),_("placeholder",f(20,28,"ADMIN.BILLING.CREDIT_CARD_MODAL.OWNER_NAME_PLACEHOLDER")),o(7),D(" ",f(27,30,"ADMIN.BILLING.CREDIT_CARD_MODAL.EXPIRATION_DATE")," "),o(4),_("type","helpInfo"),o(),_("ngClass",F(40,Me,e.creditCardForm.controls.expirationMonth.invalid&&e.checkFieldsRequired)),o(6),D(" ",f(38,32,"CVV")," "),o(4),_("type","helpInfo"),o(),_("ngClass",F(42,Me,e.creditCardForm.controls.cvv.invalid&&e.checkFieldsRequired)),o(2),_("type",e.cvvHidden?"password":"text")("maxlength",e.maxCVV),o(),T(e.isRebill?45:-1),o(2),_("ngClass",hi(44,i0,e.cardType==="Visa",e.cardType==="AMEX",e.cardType==="MasterCard")),o(),T(e.cardType===null?48:-1),o(3),C(e.cardNumber),o(2),C(f(54,34,e.cardName)),o(3),T(e.creditCardForm.controls.expirationMonth.value?56:57),o(3),C(e.cvv)}}function h0(t,a){if(t&1){let e=E();l(0,"btn-component",12),k("click",function(){w(e);let n=u(2);return I(n.addCreditCard())}),c()}if(t&2){let e=u(2);_("buttonObject",F(1,n0,e.loadingButton))}}function m0(t,a){if(t&1){let e=E();l(0,"div",3)(1,"div",4)(2,"div",5),p(3),g(4,"translate"),c(),y(5,"div",6),l(6,"div"),p(7),g(8,"translate"),c(),y(9,"div",7),c(),l(10,"div",3),b(11,a0,2,0,"div",8)(12,p0,60,48,"div",9),c(),l(13,"div",10)(14,"div",11)(15,"btn-component",12),k("click",function(){w(e);let n=u();return I(n.cancel())}),c(),b(16,h0,1,3,"btn-component",13),c()()()}if(t&2){let e=u();_("ngClass",F(11,Ju,e.isRebill)),o(3),D(" ",f(4,7,"ADMIN.BILLING.CREDIT_CARD_MODAL.ADD_BANK_CARD")," "),o(4),C(f(8,9,"ADMIN.BILLING.CREDIT_CARD_MODAL.ADD_CARD_DATA")),o(3),_("ngClass",F(13,e0,e.isRebill)),o(),T(e.showRebillHostedFields?11:12),o(4),_("buttonObject",G(15,t0)),o(),T(e.showRebillHostedFields?-1:16)}}function u0(t,a){t&1&&y(0,"app-simple-form-skeleton")}var is=(()=>{class t{constructor(e,i,n,s,r,d,m,h,x,v,L,A,B,N,P,re,ve,ye,ge){this.formBuilder=e,this._DomSanitizer=i,this.globalModalService=n,this.stylingService=s,this.uiStateService=r,this.userService=d,this.companyService=m,this.auth=h,this.geolocationService=x,this.kushkiService=v,this.translate=L,this.snackService=A,this.mercadopagoService=B,this.rebillService=N,this.authService=P,this.cardBrandService=re,this.exclusionService=ve,this.cardTokenizationService=ye,this.logsManagementService=ge,this.cdr=Q(U),this.loading=!1,this.loadingButton=!1,this.cardNumber="XXXX XXXX XXXX XXXX",this.cardName="",this.expireCard="MM/AAAA",this.cvv="123",this.cardType=null,this.maxCVV=3,this.cvvHidden=!0,this.checkFieldsRequired=!1,this.useCardTokenization=!1,this.useMercadoPagoTokenization=!1,this.rebillPublicKey=Ut.REBILL_KEY,this.rebillDisplayConfig=JSON.stringify({logo:!1,footer:!1,sandboxMode:!1,phoneNumber:!0,billingAddress:!0,documentId:!0}),this.rebillListenersAttached=!1,this.rebillSubmittedForm=null,this.cardAlreadyRegistered=!1,this.defaultPhoneCountryCode="+54",this.rebillIdentificationTypes=["CUIT","CUIL","DNI"],this.CountryPlans=$,this.phoneNumberLength={min:6,max:15}}set rebillSaveCardHost(e){e?.nativeElement&&!this.rebillListenersAttached&&this.mountRebillSaveCard(e.nativeElement)}async ngOnInit(){this.loading=!0,this.cdr.markForCheck(),this.cardName=this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.FULLNAME"),this.params=this.globalModalService.params,this.cardAlreadyRegistered=this.hasRegisteredCard(),this.useCardTokenization=this.exclusionService.isPciCardTokenizationEnabled(this.companyService.userCompany),this.useMercadoPagoTokenization=this.exclusionService.isMercadoPagoCardTokenizationEnabled(this.companyService.userCompany),this.showRebillHostedFields&&await this.cardTokenizationService.loadRebillSdk().catch(()=>this.showTokenizationError()),await this.createCreditCardFormForm(),await this.ngOnChanges(),this.loading=!1,this.cdr.markForCheck()}async ngOnChanges(){this.creditCardForm&&this.creditCardForm.valueChanges.subscribe(e=>{if(e.cardNumber&&e.cardNumber.length>0){let i=e.cardNumber.replace(/\s/g,"");this.cardNumber=`XXXX XXXX XXXX ${i.substr(i.length-4,4)}`}else this.cardNumber="XXXX XXXX XXXX XXXX";e.expirationMonth?this.expireCard=e.expirationMonth:this.expireCard="MM/AAAA",e.cardName?this.cardName=e.cardName:this.cardName=this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.FULLNAME"),e.cvv&&this.cvvHidden?e.cvv.length===4?this.cvv="****":this.cvv="***":this.cvv=e.cvv,this.cdr.markForCheck()})}get isRebill(){return this.paymentProvider==="rebill"}get showRebillHostedFields(){return this.isRebill&&this.useCardTokenization}get rebillCustomerInformation(){return JSON.stringify(this.buildRebillCustomerInformation())}async createCreditCardFormForm(){if(this.creditCardForm=this.formBuilder.group({cardName:[null,[q.required]],c
24ardNumber:[null,[q.required,q.minLength(17),q.maxLength(19)]],expirationMonth:[null,[q.minLength(5)]],cvv:[null,[q.minLength(3),q.maxLength(4)]]}),this.enableRut&&!this.isRebill&&this.creditCardForm.addControl("id",this.formBuilder.control(null,[q.required])),this.isRebill){let e=this.companyService.userCompany?.billingInfo,i=e?.contactUser;this.creditCardForm.addControl("firstName",this.formBuilder.control(i?.firstname||null,[q.required])),this.creditCardForm.addControl("lastName",this.formBuilder.control(i?.lastname||null,[q.required]));let n=e?.biRut?.replace(/\D/g,"")||null,s=n?.length===11?"CUIT":null;this.creditCardForm.addControl("identificationType",this.formBuilder.control(s,[q.required]));let r=this.identificationValueValidators(s);this.creditCardForm.addControl("identificationValue",this.formBuilder.control(n,r)),this.creditCardForm.addControl("country",this.formBuilder.control({value:"Argentina",disabled:!0},[q.required])),this.creditCardForm.addControl("state",this.formBuilder.control(e?.biComuna||null,[q.required])),this.creditCardForm.addControl("city",this.formBuilder.control(e?.biCity||null,[q.required])),this.creditCardForm.addControl("zipCode",this.formBuilder.control(e?.biZipCode||null,[q.required])),this.creditCardForm.addControl("addressLine1",this.formBuilder.control(e?.biAddress||null,[q.required])),this.creditCardForm.addControl("addressLine2",this.formBuilder.control(null));let d=this.formBuilder.control({value:this.defaultPhoneCountryCode,disabled:!0});this.creditCardForm.addControl("phoneCountryCode",d);let m=[q.required,q.minLength(this.phoneNumberLength.min),q.maxLength(this.phoneNumberLength.max)];this.creditCardForm.addControl("phoneNumber",this.formBuilder.control(null,m))}}identificationValueValidators(e){let i=e==="DNI"?{min:7,max:8}:{min:11,max:11};return[q.required,q.minLength(i.min),q.maxLength(i.max)]}get identificationValueMaxLength(){return this.creditCardForm?.value?.identificationType==="DNI"?8:11}onIdentificationTypeChange(e){let i=this.creditCardForm.controls.identificationValue;i.setValidators(this.identificationValueValidators(e)),i.updateValueAndValidity()}get cardNumberValid(){if(this.creditCardForm.controls.cardNumber.value)return this.creditCardForm.controls.cardNumber.errors?.validateCard}cancel(){this.globalModalService.closeModal()}async addCreditCard(){if(this.loadingButton=!0,this.cdr.markForCheck(),this.creditCardForm.invalid){this.loadingButton=!1,this.cdr.markForCheck(),this.checkFieldsRequired=!0;let d={message:this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.TO_CONTINUE"),type:"error"};this.snackService.showSnackNotification(d);return}let e,i=this.creditCardForm.value.cardNumber.toString().replace(/\s/g,""),n=this.creditCardForm.value.expirationMonth.toString(),[s,r]=n.includes("/")?n.split("/"):[n,""];if(this.isRebill){if(this.useCardTokenization){this.loadingButton=!1;return}let d=this.sanitizePhoneNumber(this.creditCardForm.value.phoneNumber);if(!this.isValidPhoneNumber(d)){this.checkFieldsRequired=!0,this.showInvalidPhoneError();return}let m=r.length===2?`20${r}`:r,h={card:{name:this.creditCardForm.value.cardName,number:i,expiryMonth:s,expiryYear:m,cvv:this.creditCardForm.value.cvv.toString()},email:this.companyService.userCompany?.billingInfo?.contactUser?.username||this.authService.user.username,firstName:this.creditCardForm.value.firstName,lastName:this.creditCardForm.value.lastName,identification:{type:this.creditCardForm.value.identificationType,value:this.creditCardForm.value.identificationValue},phone:{countryCode:this.defaultPhoneCountryCode.replace(/\D/g,""),number:d},address:{country:"AR",state:this.creditCardForm.value.state,city:this.creditCardForm.value.city,zipCode:this.creditCardForm.value.zipCode,lineOne:this.creditCardForm.value.addressLine1,lineTwo:this.creditCardForm.value.addressLine2||void 0}};await this.registerRebill(h)}else if(this.enableRut){let d=r.length===2?`20${r}`:r;if(this.useMercadoPagoTokenization){try{let m=await this.cardTokenizationService.tokenizeMercadoPagoCard({cardNumber:i,cardholderName:this.creditCardForm.value.cardName,cardExpirationMonth:s,cardExpirationYear:d,securityCode:this.creditCardForm.value.cvv.toString(),identificationType:"RUT",identificationNumber:this.creditCardForm.value.id?.toString()});await this.registerMercadoPago({cardToken:m.id,email:this.authService.user.username})}catch{this.showTokenizationError()}this.loadingButton=!1,this.cdr.markForCheck();return}e={card:{name:this.creditCardForm.value.cardName,number:i,expiryMonth:s,expiryYear:d,cvv:this.creditCardForm.value.cvv.toString(),id:this.creditCardForm.value.id.toString()},email:this.authService.user.username},await this.registerMercadoPago(e)}else e={card:{name:this.creditCardForm.value.cardName,number:i,expiryMonth:s,expiryYear:r,cvv:this.creditCardForm.value.cvv.toString()}},await this.registerKushkiSubscription(e);this.loadingButton=!1,this.cdr.markForCheck()}hasRegisteredCard(){let e=this.companyService.userCompany?.paymentPlan;return e?.kushkiInfo?.isKushki===1||!!e?.subscriptionId||e?.mercadoPagoInfo?.isMercadoPago===1}registerCardLog(){let e=this.cardAlreadyRegistered?Ke.BILLING_CARD_UPDATED:Ke.BILLING_CARD_ADDED;this.logsManagementService.registerCompanyLog(e,{brand:this.cardType})}async registerMercadoPago(e){if((await this.mercadopagoService.createSubscription(e))?.ok){this.registerCardLog();let n={message:this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.SAVE_SUCCESS"),type:"success"};this.companyService.getUserCompany(this.companyService.userCompany.companyId),this.snackService.showSnackNotification(n),this.globalModalService.closeModal()}else{let n={message:this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.SAVE_ERROR"),type:"error"};this.snackService.showSnackNotification(n)}}async registerKushkiSubscription(e){let i=await this.kushkiService.getCardSubscriptionToken(e);if(!i.data.token){let x={message:this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.SAVE_ERROR"),type:"error"};this.snackService.showSnackNotification(x),this.loadingButton=!1,this.cdr.markForCheck();return}let n=i.data.token,s=this.creditCardForm.value.cardNumber.replace(/\s/g,""),r=s.substr(s.length-4,4),d=this.cardType,m={kushkiToken:n,digits:r,brand:d};if(await this.kushkiService.createSubscription(m)){this.registerCardLog();let x={message:this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.SAVE_SUCCESS"),type:"success"};this.companyService.getUserCompany(this.companyService.userCompany.companyId),this.snackService.showSnackNotification(x),this.globalModalService.closeModal()}else{let x={message:this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.SAVE_ERROR"),type:"error"};this.snackService.showSnackNotification(x)}}async registerRebill(e){let i=await this.rebillService.createSubscription(e);if(i?.ok){this.registerCardLog();let n={message:this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.SAVE_SUCCESS"),type:"success"};this.snackService.showSnackNotification(n),this.globalModalService.loadEventsFromModals$.emit({type:"rebillCardUpdated"}),this.globalModalService.closeModal()}else{let n=i?.message,r={message:typeof n=="string"&&n?n:Array.isArray(n)?n.join(". "):this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.SAVE_ERROR"),type:"error"};this.snackService.showSnackNotification(r)}}mountRebillSaveCard(e){this.rebillListenersAttached=!0;let i=document.createElement("rebill-save-card");i.setAttribute("public-key",this.rebillPublicKey),i.setAttribute("processing-country","AR"),i.setAttribute("language","es"),i.display=this.rebillDisplayConfig,i.customerInformation=this.rebillCustomerInformation,this.attachRebillListeners(i),e.appendChild(i)}attachRebillListeners(e){e.addEventListener("submit",i=>{this.captureRebillFormData(i)}),e.addEventListener("change",i=>{this.captureRebillFormData(i)}),e.addEventListener("success",i=>{let n=i.detail,s=this.extractRebillId(n,"card"),r=this.extractRebillId(n,"customer");if(s){let d=this.buildCreateSubscriptionFromRebill(s,r);
24d&&this.registerRebill(d)}else console.error("Rebill save-card success sin cardId"),this.showTokenizationError()}),e.addEventListener("error",i=>{let{error:n}=i.detail??{error:null};console.error("Rebill save-card error",n),this.showTokenizationError()})}captureRebillFormData(e){let i=e.detail;this.isRebillFormPayload(i)&&(this.rebillSubmittedForm=i)}isRebillFormPayload(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let i=e;return typeof i.fullName=="string"||typeof i.phoneNumber=="string"||typeof i["billing-address"]=="string"||typeof i.email=="string"}sanitizePhoneNumber(e){if(e==null)return"";let i=typeof e=="number"?e.toString():String(e).trim();if(/[eE]/.test(i)){let n=Number(i);return!Number.isFinite(n)||!Number.isInteger(n)?"":BigInt(n).toString().replace(/\D/g,"")}return i.includes(".")||i.includes(",")?"":i.replace(/\D/g,"")}isValidPhoneNumber(e){return/^\d+$/.test(e)&&e.length>=this.phoneNumberLength.min&&e.length<=this.phoneNumberLength.max}showInvalidPhoneError(){this.loadingButton=!1,this.snackService.showSnackNotification({message:this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.INVALID_PHONE"),type:"error"})}readRebillFormValue(e,i){if(!e)return"";let n=e[i];return typeof n!="string"?"":n.trim()}extractRebillId(e,i){return[e?.[i]?.id,e?.data?.[i]?.id,e?.[`${i}Id`]].find(s=>typeof s=="string"&&s.trim().length>0)}buildCreateSubscriptionFromRebill(e,i){let n=this.rebillSubmittedForm,s=this.readRebillFormValue(n,"fullName"),[r,...d]=s.split(" "),m=d.join(" ")||r,h=this.readRebillFormValue(n,"email")||this.authService.user.username,x=this.readRebillFormValue(n,"phoneNumber"),v=this.sanitizePhoneNumber(x),L=this.readRebillFormValue(n,"countryCodePhoneNumber").replace(/\D/g,""),A=this.readRebillFormValue(n,"documentType"),B=this.readRebillFormValue(n,"documentNumber"),N=this.readRebillFormValue(n,"billing-country"),P=this.readRebillFormValue(n,"billing-state"),re=this.readRebillFormValue(n,"billing-city"),ve=this.readRebillFormValue(n,"billing-zip"),ye=this.readRebillFormValue(n,"billing-address"),ge=this.readRebillFormValue(n,"billing-addInformation"),Ce={cardId:e,email:h};return i&&(Ce.customerId=i),r&&(Ce.firstName=r,Ce.lastName=m),A&&B&&(Ce.identification={type:A,value:B}),x&&!this.isValidPhoneNumber(v)?(this.showInvalidPhoneError(),null):(v&&(Ce.phone={countryCode:L,number:v}),(ye||re||P||ve)&&(Ce.address={country:N,state:P,city:re,zipCode:ve,lineOne:ye},ge&&(Ce.address.lineTwo=ge)),Ce)}buildRebillCustomerInformation(){return{email:this.authService.user.username,countryCodePhoneNumber:"AR",billingAddress:{country:"AR"}}}showTokenizationError(){this.loadingButton=!1,this.cdr.markForCheck(),this.snackService.showSnackNotification({message:this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.SAVE_ERROR"),type:"error"})}onCardNumberInput(e){let i=e.target,n=i.selectionStart||0,s=i.value,r=s.substring(0,n).replace(/\D/g,"").length,d=s.replace(/\D/g,"").substring(0,16),m=d.replace(/(\d{4})(?=\d)/g,"$1 ");m!==s&&this.creditCardForm.get("cardNumber").setValue(m,{emitEvent:!0});let h=0,x=0;for(let v=0;v<m.length&&h<r;v++)x=v+1,m[v]!==" "&&h++;i.setSelectionRange(x,x),this.getCardType(d)}onExpirationInput(e){let i=e.target,n=i.selectionStart||0,s=i.value,r=s.substring(0,n).replace(/\D/g,"").length,d=s.replace(/\D/g,"").substring(0,4),m=d;d.length>2&&(m=`${d.substring(0,2)}/${d.substring(2)}`),m!==s&&this.creditCardForm.get("expirationMonth").setValue(m,{emitEvent:!0});let h=0,x=0;for(let v=0;v<m.length&&h<r;v++)x=v+1,m[v]!=="/"&&h++;i.setSelectionRange(x,x)}getCardType(e){this.cardType=this.cardBrandService.detectBrand(e),this.maxCVV=this.cardBrandService.cvvLength(this.cardType),this.creditCardForm.get("cvv").setValidators([q.minLength(this.maxCVV)])}getCvvDigits(e){return this.cardBrandService.cvvLength(e)}showAdviser(e,i){let n=e.getBoundingClientRect(),s,r,d;i==="cvv"?(s=this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.WHAT_CVV"),r=this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.CVV_IS"),d="/assets/adviser-animations/cvv.webm"):i==="rut"?(s=this.translate.instant("Formato de rut"),r=this.translate.instant("El rut debe ser ingresado sin puntos ni guiones, incluyendo digito verificador.")):(s=this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.EXPIRATION_DATE"),r=this.translate.instant("ADMIN.BILLING.CREDIT_CARD_MODAL.EXPIRATION_DATE_IS"),d="/assets/adviser-animations/expirationDate.webm");let m={header:s,text:r,url:d,positionX:n.x+n.width+32,positionY:n.y-24,showAdviser:!0,isInContent:!1,type:"help",typePreview:"video"};this.uiStateService.setAdviser(m)}async closeAdviser(){this.uiStateService.fadeOutHelper(),setTimeout(()=>{this.uiStateService.unsetAdviser(),this.cdr.markForCheck()},300)}async toggleHideCvv(){this.cvvHidden=!this.cvvHidden,this.cvvHidden?this.cvv="***":this.cvv=this.creditCardForm.controls.cvv.value}static{this.\u0275fac=function(i){return new(i||t)(S(qt),S(Wt),S(K),S(fe),S(ht),S(Ji),S(j),S(ut),S(sn),S(At),S(ee),S(Ue),S(ci),S(di),S(ut),S(pi),S(Ki),S(Pl),S(ot))}}static{this.\u0275cmp=O({type:t,selectors:[["app-new-credit-card"]],viewQuery:function(i,n){if(i&1&&De(Zu,5),i&2){let s;
24Te(s=Se())&&(n.rebillSaveCardHost=s.first)}},inputs:{enableRut:"enableRut",paymentProvider:"paymentProvider"},standalone:!1,features:[ae],decls:2,vars:1,consts:[["rebillSaveCardHost",""],["helperExpirationDate",""],["helper",""],[3,"ngClass"],[1,"flex-shrink-0"],[1,"header-1","noMargin","text-blue"],[1,"h-24"],[1,"h-40"],[1,"rebill-save-card-host"],[1,"creditCardModal"],[1,"flex-shrink-0","pt-10"],[1,"flex","jc-fe","c-g-24"],[3,"click","buttonObject"],[3,"buttonObject"],[1,"left"],[3,"formGroup"],[1,"v-form"],[1,"v-form-group","n-1-1","noSpaceBottom","max-w-[282px]",3,"ngClass"],[1,"label-3"],[1,"input-container","input-icon","br-8"],["width","50%","type","text","placeholder","XXXX XXXX XXXX XXXX","formControlName","cardNumber","minLength","17","maxlength","19","required","",1,"input-text",3,"input"],[1,"card","absolute",3,"type"],[1,"input-container","br-8"],["width","50%","type","text","formControlName","cardName","required","","maxlength","20",1,"input-text",3,"placeholder"],[1,"flex","gap-16"],[1,"w-[190px]","shrink-0"],[1,"flex","fd-r","gap-8","mb-8"],[1,"cursor-p",3,"mouseover","mouseleave"],["width","22","height","22",3,"type"],[1,"v-form-group","n-1-1","noSpaceBottom",3,"ngClass"],["type","text","placeholder","MM/AA","formControlName","expirationMonth","maxlength","5","required","",1,"input-text",3,"input"],[1,"w-[76px]","shrink-0"],["placeholder","123","formControlName","cvv","required","",1,"input-text",3,"keypress","type","maxlength"],[1,"right","m-0"],[1,"creditCard",3,"ngClass"],[1,"flex","jc-fe",3,"type"],[1,"detailCard"],[1,"creditCardNumber"],[1,"small"],[1,"flex","jc-sb","ai-c"],[1,"smaller"],["width","50%","type","text","formControlName","id","required","",1,"input-text",3,"placeholder"],[1,"text-blue","font-bold","mb-16"],["type","text","formControlName","firstName","required","",1,"input-text",3,"placeholder"],["type","text","formControlName","lastName","required","",1,"input-text",3,"placeholder"],["formControlName","identificationType",3,"change","items","clearable","placeholder"],["type","text","formControlName","identificationValue","required","",1,"input-text",3,"keypress","placeholder","maxlength"],[1,"label-3","mb-8"],[1,"flex","gap-16","max-w-[282px]"],[1,"input-container","br-8","bg-disabledInput","w-[80px]","shrink-0"],["type","text","formControlName","phoneCountryCode","disabled","",1,"input-text"],[1,"v-form-group","n-1-1","noSpaceBottom","flex-1",3,"ngClass"],["type","text","formControlName","phoneNumber","maxlength","15","required","",1,"input-text",3,"keypress","placeholder"],[1,"v-form-group","n-1-1","noSpaceBottom","max-w-[282px]"],[1,"input-container","br-8","bg-disabledInput"],["type","text","formControlName","country","disabled","",1,"input-text"],["type","text","formControlName","state","required","",1,"input-text",3,"placeholder"],["type","text","formControlName","city","required","",1,"input-text",3,"placeholder"],["type","text","formControlName","zipCode","required","",1,"input-text",3,"placeholder"],["type","text","formControlName","addressLine1","required","",1,"input-text",3,"placeholder"],["type","text","formControlName","addressLine2",1,"input-text",3,"placeholder"]],template:function(i,n){i&1&&b(0,m0,17,16,"div",3)(1,u0,1,0,"app-simple-form-skeleton"),i&2&&T(n.loading?1:0)},dependencies:[Ge,Ns,Ds,Es,Bs,Rs,Os,Fs,Ms,Ps,me,he,kt,te,As],encapsulation:2,changeDetection:0})}}return t})();function f0(t,a){if(t&1&&y(0,"app-new-credit-card",0),t&2){let e=u();_("enableRut",e.enabledRut)("paymentProvider",e.params==null?null:e.params.paymentProvider)}}function _0(t,a){t&1&&y(0,"app-simple-form-skeleton")}var Hi=(()=>{class t{constructor(e,i,n,s,r,d,m,h,x,v,L,A){this.formBuilder=e,this._DomSanitizer=i,this.globalModalService=n,this.stylingService=s,this.userService=r,this.companyService=d,this.auth=m,this.geolocationService=h,this.kushkiService=x,this.translate=v,this.snackService=L,this.billingService=A,this.cdr=Q(U),this.loading=!1,this.loadingButton=!1,this.checkFieldsRequired=!1,this.enabledRut=!1,this.paymenthMethods=[]}async ngOnInit(){this.loading=!0,this.cdr.markForCheck(),this.params=this.globalModalService.params,this.enabledRut=this.params?.paymentProvider!=="rebill",await this.billingService.setPaymentMethodsSteps(ia.ADD_CARD),this.loading=!1,this.cdr.markForCheck()}setAvailablePaymentMethods(){this.companyService.userCompany.countryId===$.CHILE&&this.paymenthMethods.push({value:"mercadoPago",image:"../../../../../../assets/images/mercadoPago.png"})}async createPaymentMethodForm(){this.paymentMethodForm=this.formBuilder.group({paymentMethod:[null,[q.required]]})}cancel(){this.globalModalService.closeModal()}async paymentMethodNextStep(){if(this.loadingButton=!0,this.cdr.markForCheck(),this.paymentMethodForm.invali
24d){this.loadingButton=!1,this.cdr.markForCheck(),this.checkFieldsRequired=!0;let e={type:"error",message:this.translate.instant("ADMIN.BILLING.PAYMENT_METHOD_MODAL.TO_CONTINUE")};this.snackService.showSnackNotification(e),this.loadingButton=!1,this.cdr.markForCheck();return}setTimeout(()=>{this.billingService.setPaymentMethodsSteps(ia.ADD_CARD),this.selectedPayment==="kushki"?this.enabledRut=!1:this.enabledRut=!0,this.loadingButton=!1,this.cdr.markForCheck()},1e3)}selectPaymentMethod(e){this.selectedPayment=e}static{this.\u0275fac=function(i){return new(i||t)(S(qt),S(Wt),S(K),S(fe),S(Ji),S(j),S(ut),S(sn),S(At),S(ee),S(Ue),S(ft))}}static{this.\u0275cmp=O({type:t,selectors:[["app-new-payment-method"]],standalone:!1,decls:2,vars:1,consts:[[3,"enableRut","paymentProvider"]],template:function(i,n){i&1&&b(0,f0,1,2,"app-new-credit-card",0)(1,_0,1,0,"app-simple-form-skeleton"),i&2&&T(n.loading?1:0)},dependencies:[kt,is],encapsulation:2,changeDetection:0})}}return t})();var x0=(t,a)=>({class:"rindeButton-b nM",value:t,disabled:a});function v0(t,a){if(t&1&&(l(0,"div",10)(1,"div",16),p(2),g(3,"translate"),c(),l(4,"div"),p(5),c()()),t&2){let e=a.$implicit;o(2),C(f(3,2,e.labelKey)),o(3),C(e.value)}}function C0(t,a){t&1&&(l(0,"div",14),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"ADMIN.BILLING.TRANSFER_DATA_INFO_BEFORE_UPLOAD")," "))}function y0(t,a){t&1&&(y(0,"div",15),g(1,"translate")),t&2&&_("innerHTML",f(1,1,"ADMIN.BILLING.TRANSFER_DATA_INFO_AFTER_UPLOAD"),le)}var $n=(()=>{class t{constructor(e,i,n,s,r){this.globalModalService=e,this.billingService=i,this.companyService=n,this.translate=s,this.snackService=r,this.cdr=Q(U),this.loading=!1,this.receiptUploaded=!1,this.uploadingReceipt=!1,this.bankData=[]}ngOnInit(){this.params=this.globalModalService.params,this.params?.bills?.every(e=>e.billFiles?.length)&&(this.receiptUploaded=!0),this.setBankData()}setBankData(){switch(this.companyService.userCompany?.countryId){case $.CHILE:this.bankData=[{labelKey:"ADMIN.BILLING.TRANSFER_DATA_NAME",value:"Rindegastos SpA."},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_TAX_ID",value:"76271948-7"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_CURRENCY",value:"CLP"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_BANK",value:"Banco de Cr\xE9dito e Inversiones"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_ACCOUNT_TYPE",value:this.translate.instant("ADMIN.BILLING.ACCOUNT_TYPE_CHECKING")},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_ACCOUNT_NUMBER",value:"70082987"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_SEND_RECEIPT",value:"[email protected]"}];break;case $.PERU:this.bankData=[{labelKey:"ADMIN.BILLING.TRANSFER_DATA_COMPANY",value:"Rindegastos Per\xFA S.A.C."},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_RUC",value:"0604204969"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_CURRENCY",value:"PEN"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_BANK",value:"Scotiabank"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_ACCOUNT_NUMBER",value:"0007439423"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_CCI",value:"009-045-000007439423-60"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_SEND_RECEIPT",value:"[email protected]"}];break;case $.COLOMBIA:this.bankData=[{labelKey:"ADMIN.BILLING.TRANSFER_DATA_COMPANY",value:"Rindegastos Colombia SAS"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_NIT",value:"901609691-3"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_CURRENCY",value:"COP"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_BANK",value:"Bancolombia"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_ACCOUNT_TYPE",value:this.translate.instant("ADMIN.BILLING.ACCOUNT_TYPE_SAVINGS")},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_ACCOUNT_NUMBER",value:"915000002638"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_SEND_RECEIPT",value:"[email protected]"}];break;case $.ARGENTINA:this.bankData=[{labelKey:"ADMIN.BILLING.TRANSFER_DATA_COMPANY",value:"Rindegastos Argentina SRL"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_CUIT",value:"30-71822500-7"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_CURRENCY",value:"ARS"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_BANK",value:"BBVA"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_CURRENT_ACCOUNT",value:"099723826/0"}
24,{labelKey:"ADMIN.BILLING.TRANSFER_DATA_CBU",value:"0170099220000072382602"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_SEND_RECEIPT",value:"[email protected]"}];break;case $.MEXICO:this.bankData=[{labelKey:"ADMIN.BILLING.TRANSFER_DATA_COMPANY",value:"Rindegastos Mexico, S. DE R.L. DE C.V."},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_RFC",value:"RME2110049A3"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_CURRENCY",value:"MXN"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_BANK",value:"BBVA"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_ACCOUNT_NUMBER",value:"00740812940118547645"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_CLABE",value:"012180001185476453"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_SEND_RECEIPT",value:"[email protected]"}];break;default:this.bankData=[{labelKey:"ADMIN.BILLING.TRANSFER_DATA_BENEFICIARY_NAME",value:"Rindegastos SPA"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_BENEFICIARY_ADDRESS",value:"Apoquindo 5950, oficina 1701, Las Condes, Santiago de Chile"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_BANK",value:"Banco Credito e Inversiones"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_ADDRESS",value:"El Golf #125, Las Condes, 7550077, Santiago, Chile"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_SWIFT",value:"CREDCLRM"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_BENEFICIARY_ACCOUNT",value:"18598862"},{labelKey:"ADMIN.BILLING.TRANSFER_DATA_SEND_RECEIPT",value:"[email protected]"}];break}}copyBankData(){let e=this.bankData.map(i=>`${this.translate.instant(i.labelKey)}: ${i.value}`).join(` 25`);navigator.clipboard.writeText(e).then(()=>{let i={type:"success",message:this.translate.instant("ADMIN.BILLING.TRANSFER_DATA_COPIED")};this.snackService.showSnackNotification(i)})}async onTransferReceiptSelected(e){let i=e.target;if(!i.files||i.files.length===0)return;let n=i.files[0],s=this.params?.bills?.map(d=>d.id)||[];if(s.length===0)return;this.uploadingReceipt=!0;let r=await this.billingService.uploadBillTransferReceipt(s,n);if(this.uploadingReceipt=!1,r){this.receiptUploaded=!0,this.globalModalService.loadEventsFromModals$.emit({type:"receiptUploaded"});let d={type:"success",message:this.translate.instant("ADMIN.BILLING.TRANSFER_DATA_RECEIPT_SENT")};this.snackService.showSnackNotification(d)}else{let d={type:"error",message:this.translate.instant("ADMIN.BILLING.TRANSFER_DATA_RECEIPT_ERROR")};this.snackService.showSnackNotification(d)}this.cdr.markForCheck(),i.value=""}static{this.\u0275fac=function(i){return new(i||t)(S(K),S(ft),S(j),S(ee),S(Ue))}}static{this.\u0275cmp=O({type:t,selectors:[["app-sidepanel-transfer-data"]],decls:26,vars:18,consts:[["receiptInput",""],[1,"p-48","flex","flex-col","gap-24"],[1,"bold","big","text-blue"],[1,"mt-8"],[1,"bg-blueLight","br-10","p-24","flex","flex-col","gap-16"],[1,"flex","jc-sb","ai-c"],[1,"bold","text-blue"],[1,"flex","ai-c","gap-8","text-blue","cursor-pointer",3,"click"],["type","copyBlueIcon"],[1,"flex","flex-wrap","gap-y-16"],[1,"w-1/2"],[1,"flex","flex-col","ai-c","gap-16"],[3,"click","buttonObject"],["type","file","accept",".pdf,.png,.jpg,.jpeg",2,"display","none",3,"change"],[1,"text-center","small","lh-140"],[1,"text-center","small","lh-140",3,"innerHTML"],[1,"bold"]],template:function(i,n){if(i&1){let s=E();l(0,"div",1)(1,"div")(2,"div",2),p(3),g(4,"translate"),c(),l(5,"div",3),p(6),g(7,"translate"),c()(),l(8,"div",4)(9,"div",5)(10,"div",6),p(11),g(12,"translate"),c(),l(13,"div",7),k("click",function(){return n.copyBankData()}),p(14),g(15,"translate"),y(16,"icons-component",8),c()(),l(17,"div",9),Ie(18,v0,6,4,"div",10,we),c()(),l(20,"div",11)(21,"btn-component",12),k("click",function(){w(s);let d=Z(23);return I(d.click())}),c(),l(22,"input",13,0),k("change",function(d){return n.onTransferReceiptSelected(d)}),c(),b(24,C0,3,3,"div",14),b(25,y0,2,3,"div",15),c()()}i&2&&(o(3),C(f(4,7,"ADMIN.BILLING.TRANSFER_DATA_TITLE")),o(3),C(f(7,9,"ADMIN.BILLING.TRANSFER_DATA_SUBTITLE")),o(5),C(f(12,11,"ADMIN.BILLING.TRANSFER_DATA_BANK_DATA")),o(3),D(" ",f(15,13,"ADMIN.BILLING.TRANSFER_DATA_COPY_DATA")," "),o(4),ke(n.bankData),o(3),_("buttonObject",ce(15,x0,n.uploadingReceipt?"ADMIN.BILLING.TRANSFER_DATA_UPLOADING":"ADMIN.BILLING.TRANSFER_DATA_UPLOAD_RECEIPT",n.uploadingReceipt||n.receiptUploaded)),o(3),T(n.receiptUploaded?-1:24),o(),T(n.receiptUploaded?25:-1))},dependencies:[on,me,he,te],encapsulation:2,changeDetection:0})}}return t})();var as=(function(t){return t[t.NOT_MANAGED=0]="NOT_MANAGED",t[t.TO_INVOICE=1]="TO_INVOICE",t[t.MANAGE_OC=2]="MANAGE_OC",t[t.OC_REQUESTED=3]="OC_REQUESTED",t[t.MANUAL_INVOICE=4]="MANUAL_INVOICE",t[t.SPECIAL_CASES=5]="SPECIAL_CASES",t[t.INVOICED=10]="INVOICED",t[t.FREE_MONTH=11]="FREE_MONTH",t[t.NOT_INVOICED=12]="NOT_INVOICED",t[t.IN_LAUNCH=13]="IN_LAUNCH",t})(as||{});var T0=["transferReceiptInput"],S0=()=>({class:"rindeButton-b-s nM tiny",value:"USERS.USER.EDIT"}),L0=()=>({value:"ADMIN.BILLING.UPGRADE_PLAN",class:"rindeButton-b nM flex fd-rr"}),A0=()=>({value:"ADMIN.BILLING.SEE_PLANS",class:"rindeButton-b nM flex fd-rr"}),w0=()=>({class:"rindeButton-o-t nM tiny",value:"ADMIN.BILLING.REMOVE_CARD"}),I0=()=>({class:"rindeButton-b-s nM tiny",value:"ADMIN.BILLING.EDIT_CARD"}),k0=()=>({class:"rindeButton-b-s nM tiny",value:"ADMIN.BILLING.ADD_PAYMENT_CARD"}),Gl=()=>({class:"rindeButton-b-s nM tiny",value:"ADMIN.BILLING.VIEW_TRANSFER_DATA"}),D0=()=>({class:"rindeButton-b-s nM tiny",value:"ADMIN.BILLING.PAY"}),E0=(t,a)=>({class:"rindeButton-b-s nM tiny flex fd-rr",value:t,disabled:a}),B0=t=>({class:"rindeButton-b-s nM tiny",value:"FILTER.APPLY_LAST_FILTERS",disabled:t}),N0=t=>({shadow:t}),M0=()=>({class:"rindeButton-b nM tiny",value:"ADMIN.BILLING.PAY"}),F0=()=>({class:"rindeButton-b-s nM tiny",value:"ADMIN.BILLING.DOWNLOAD_BILL"}),R0=()=>({title:"EMPTY_FILTERS_GLOBAL.SEARCH",subtitle:"EMPTY_FILTERS_GLOBAL.SEARCH_NO_MATCH",suggest:"EMPTY_VIEW.SUGGEST",sug_detail:"EMPTY_FILTERS_GLOBAL.SUG_DETAIL",sug_detail2:"EMPTY_FILTERS_GLOBAL.SUG_DETAIL2"}),O0=t=>({value:"EMPTY_FILTERS_GLOBAL.CLEAR_FILTERS",class:"rindeButton-o-t nM",loading:t});function P0(t,a){if(t&1){let e=E();l(0,"div")(1,"btn-component",28),k("click",function(){w(e);let n=u(2);return I(n.showAdviserPlan())}),y(2,"icons-component",38),c()()}t&2&&(o(),_("buttonObject",G(2,L0)),o(),_("type","crownUpdatePlanLarge"))}function V0(t,a){t&1&&(p(0),g(1,"translate")),t&2&&D(" ",f(1,1,"ADMIN.BILLING.FREE_TRIAL_TITLE")," ")}function G0(t,a){if(t&1&&p(0),t&2){let e=u(2);D(" ",e.companyService.companyPlan," ")}}function H0(t,a){if(t&1&&(l(0,"div",13)(1,"span"),p(2),g(3,"translate"),c(),y(4,"icons-component",38),c()),t&2){let e=u(2);o(2),Zn("",e.trialDaysElapsed,"/",e.trialTotalDays," ",f(3,4,"ADMIN.BILLING.DAYS")),o(2),_("type","crownBlueCircle")}}function X0(t,a){if(t&1&&(l(0,"div",14),p(1),g(2,"formatNumber"),c()),t&2){let e=u(2);o(),V("",e.pricingService.currency," ",f(2,2,e.getPlanPrice()))}}function Y0(t,a){t&1&&(l(0,"div",16),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"ADMIN.BILLING.ACCOUNT_ACTIVE")," "))}function z0(t,a){t&1&&(l(0,"div",17),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"ADMIN.BILLING.ACCOUNT_SUSPENDED")," "))}function $0(t,a){if(t&1&&(l(0,"div",18),y(1,"icons-component",19),l(2,"span",20),p(3),g(4,"formatNumber"),g(5,"translate"),c()()),t&2){let e=u(2);o(3),Zn(" ",e.pricingService.currency," ",f(4,3,e.getPlanPrice())," ",f(5,5,"ADMIN.BILLING.MONTHLY_PER_USER")," ")}}function W0(t,a){if(t&1&&(l(0,"div",18),y(1,"icons-component",19),l(2,"span",20),p(3),g(4,"translate"),g(5,"formatDate"),c()()),t&2){let e=u(2);o(3),V(" ",f(4,2,"ADMIN.BILLING.TRIAL_EXPIRED_ON")," ",f(5,4,(e.companyService.userCompany.paymentPlan==null?null:e.companyService.userCompany.paymentPlan.expirationDate)||e.companyService.userCompany.trialEndDate)," ")}}function j0(t,a){if(t&1){let e=E();l(0,"div")(1,"a",39),k("click",function(){w(e);let n=u(2);return I(n.showAdviserPlan())}),p(2),g(3,"translate"),c()()}t&2&&(o(2),C(f(3,1,"ADMIN.BILLING.VIEW_PLAN_DETAILS")))}function U0(t,a){if(t&1){let e=E();l(0,"div")(1,"btn-component",28),k("click",function(){w(e);let n=u(2);return I(n.showAdviserPlan())}),y(2,"icons-component",38),c()()}
25t&2&&(o(),_("buttonObject",G(2,A0)),o(),_("type","crownUpdatePlanLarge"))}function q0(t,a){if(t&1&&y(0,"icons-component",38),t&2){let e=u(3);_("type",e.cardIcon)}}function Q0(t,a){if(t&1&&(l(0,"div",23),b(1,q0,1,1,"icons-component",38),l(2,"span",32),p(3),c()()),t&2){let e=u(2);o(),T(e.cardIcon?1:-1),o(2),C(e.cardLastDigits)}}function K0(t,a){if(t&1&&(l(0,"div"),p(1),g(2,"translate"),g(3,"formatDate"),c()),t&2){let e=u(2);o(),V("",f(2,2,"ADMIN.BILLING.INVOICE_OVERDUE_SINCE")," ",f(3,4,e.overdueSinceDate||e.getNextBillingDate()))}}function Z0(t,a){if(t&1&&(l(0,"div"),p(1),g(2,"translate"),g(3,"formatDate"),c()),t&2){let e=u(2);o(),V("",f(2,2,"ADMIN.BILLING.INVOICE_DUE_DATE")," ",f(3,4,e.getNextBillingDate()))}}function J0(t,a){t&1&&(l(0,"div"),p(1),g(2,"translate"),c()),t&2&&(o(),C(f(2,1,"ADMIN.BILLING.NO_PENDING_PAYMENTS")))}function eg(t,a){if(t&1){let e=E();l(0,"btn-component",28),k("click",function(){w(e);let n=u(4);return I(n.removeCard())}),c(),l(1,"btn-component",28),k("click",function(){w(e);let n=u(4);return I(n.addPaymentMethod())}),y(2,"icons-component",29),c()}t&2&&(_("buttonObject",G(2,w0)),o(),_("buttonObject",G(3,I0)))}function tg(t,a){if(t&1){let e=E();l(0,"btn-component",28),k("click",function(){w(e);let n=u(4);return I(n.addPaymentMethod())}),c()}t&2&&_("buttonObject",G(1,k0))}function ig(t,a){if(t&1&&b(0,eg,3,4)(1,tg,1,2,"btn-component",40),t&2){let e=u(3);T(e.hasRegisteredCard?0:1)}}function ng(t,a){if(t&1&&b(0,ig,2,1),t&2){let e=u(2);T(!e.isTrialOrFree&&e.supportsCardPayment?0:-1)}}function ag(t,a){t&1&&at(0)}function sg(t,a){t&1&&(y(0,"div",46),g(1,"translate")),t&2&&_("innerHTML",f(1,1,"ADMIN.BILLING.PROCESSING_MESSAGE"),le)}function og(t,a){if(t&1){let e=E();l(0,"div",41)(1,"div",10)(2,"div",32),p(3),g(4,"translate"),c(),l(5,"div",42),p(6),g(7,"formatNumber"),c()(),l(8,"div",43)(9,"div"),p(10),g(11,"translate"),c(),l(12,"div",17),p(13),g(14,"translate"),c()()(),l(15,"div",44),R(16,ag,1,0,"ng-container",45),l(17,"btn-component",28),k("click",function(){w(e);let n=u(2);return I(n.showTransferData(n.unpaidBillsList))}),c()(),b(18,sg,2,3,"div",46)}if(t&2){u();let e=Z(38),i=u();o(3),C(f(4,10,"ADMIN.BILLING.TOTAL_TO_PAY")),o(3),V("",Le(7,12,i.totalPending,i.pendingCurrency)," ",i.displayCurrency(i.pendingCurrency)),o(4),V("",i.pendingBills," ",f(11,15,"ADMIN.BILLING.PENDING_BILLS")),o(3),V("",i.overdueBills," ",f(14,17,"ADMIN.BILLING.OVERDUE")),o(3),_("ngTemplateOutlet",e),o(),_("buttonObject",G(19,Gl)),o(),T(i.hasAnyBillWithReceipt?18:-1)}}function rg(t,a){t&1&&at(0)}function lg(t,a){t&1&&(y(0,"div",50),g(1,"translate")),t&2&&_("innerHTML",f(1,1,"ADMIN.BILLING.PROCESSING_MESSAGE"),le)}function cg(t,a){if(t&1){let e=E();l(0,"div",47)(1,"div",10)(2,"div",32),p(3),g(4,"translate"),c(),l(5,"div",48),p(6),g(7,"formatNumber"),c()(),l(8,"div",43)(9,"div"),p(10),g(11,"translate"),c(),l(12,"div",49),p(13),g(14,"translate"),c()()(),l(15,"div",44),R(16,rg,1,0,"ng-container",45),l(17,"btn-component",28),k("click",function(){w(e);let n=u(2);return I(n.billPayment(n.billingService.companyBills[0]))}),c(),l(18,"btn-component",28),k("click",function(){w(e);let n=u(2);return I(n.showTransferData(n.unpaidBillsList))}),c()(),b(19,lg,2,3,"div",50)}if(t&2){u();let e=Z(38),i=u();o(3),C(f(4,10,"ADMIN.BILLING.TOTAL_TO_PAY")),o(3),V("",Le(7,12,i.totalPending,i.pendingCurrency)," ",i.displayCurrency(i.pendingCurrency)),o(4),V("",i.pendingBills," ",f(11,15,"ADMIN.BILLING.BILLS_TO_BE_DUE")),o(3),C(f(14,17,"ADMIN.BILLING.TO_BE_DUE")),o(3),_("ngTemplateOutlet",e),o(),_("buttonObject",G(19,D0)),o(),_("buttonObject",G(20,Gl)),o(),T(i.hasAnyBillWithReceipt?19:-1)}}function dg(t,a){t&1&&at(0)}function pg(t,a){if(t&1){let e=E();l(0,"div",51)(1,"div",10)(2,"div",32),p(3),g(4,"translate"),c(),l(5,"div",52),p(6),c()(),l(7,"div",53),p(8),g(9,"translate"),c()(),l(10,"div",54),y(11,"icons-component",55),l(12,"div",56),p(13),g(14,"translate"),c()(),l(15,"div",44),R(16,dg,1,0,"ng-container",45),l(17,"btn-component",28),k("click",function(){w(e),u();let n=Z(110);return I(n.click())}),y(18,"icons-component",57),c()()}if(t&2){u();let e=Z(38),i=u();o(3),C(f(4,6,"ADMIN.BILLING.PREFACTURATION_MONTH")),o(3),C(i.getPreBillMonth()),o(2),C(f(9,8,"ADMIN.BILLING.PREFACTURATION")),o(5),C(f(14,10,"ADMIN.BILLING.PREFACTURATION_WARNING")),o(3),_("ngTemplateOutlet",e),o(),_("buttonObject",ce(12,E0,i.prebillingService.uploadingPurchaseOrder?"ADMIN.BILLING.SENDING":"ADMIN.BILLING.UPLOAD_DOCUMENTS",i.prebillingService.uploadingPurchaseOrder))}}function hg(t,a){t&1&&at(0)}function mg(t,a){if(t&1&&(l(0,"div",41)(1,"div",10)(2,"div",32),p(3),g(4,"translate"),c(),l(5,"div",58),p(6),c()(),l(7,"div",59),p(8),g(9,"translate"),c()(),l(10,"div",54),y(11,"icons-component",55),l(12,"div",56),p(13),g(14,"translate"),c()(),y(15,"div",50),g(16,"translate"),l(17,"div",44),R(18,hg,1,0,"ng-container",45),c()),t&2){u();let e=Z(38),i=u();o(3),C(f(4,6,"ADMIN.BILLING.PREFACTURATION_MONTH")),o(3),C(i.getPreBillMonth()),o(2),C(f(9,8,"ADMIN.BILLING.PREFACTURATION")),o(5),C(f(14,10,"ADMIN.BILLING.PREFACTURATION_WARNING")),o(2),_("innerHTML",f(16,12,"ADMIN.BILLING.PREFACTURATION_REVIEW"),le),o(3),_("ngTemplateOutlet",e)}}function ug(t,a){t&1&&at(0)}function gg(t,a){if(t&1&&(l(0,"div",60)(1,"div",32),p(2),g(3,"translate"),c(),l(4,"div",61),p(5),c()(),l(6,"div",44),R(7,ug,1,0,"ng-container",45),c()),t&2){u();let e=Z(38),i=u();o(2),C(f(3,3,"ADMIN.BILLING.TOTAL_TO_PAY")),o(3),D("0 ",i.displayCurrency((i.companyService.userCompany.paymentPlan==null?null:i.companyService.userCompany.paymentPlan.
25currency)||"UF")),o(2),_("ngTemplateOutlet",e)}}function fg(t,a){if(t&1&&p(0),t&2){let e=u(2);D(" ",e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null?null:e.companyService.userCompany.billingInfo.biRut," ")}}function _g(t,a){t&1&&(l(0,"div",34)(1,"span",62),p(2),g(3,"translate"),c()()),t&2&&(o(2),D(" ",f(3,1,"NO_DATA")," "))}function xg(t,a){if(t&1&&p(0),t&2){let e=u(2);D(" ",e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null?null:e.companyService.userCompany.billingInfo.biRazonSocial," ")}}function vg(t,a){t&1&&(l(0,"div",34)(1,"span",62),p(2),g(3,"translate"),c()()),t&2&&(o(2),D(" ",f(3,1,"NO_DATA")," "))}function Cg(t,a){if(t&1&&p(0),t&2){let e=u(2);D(" ",e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null?null:e.companyService.userCompany.billingInfo.biPhone," ")}}function yg(t,a){t&1&&(l(0,"div",34)(1,"span",62),p(2),g(3,"translate"),c()()),t&2&&(o(2),D(" ",f(3,1,"NO_DATA")," "))}function bg(t,a){if(t&1&&p(0),t&2){let e=u(2);D(" ",e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null?null:e.companyService.userCompany.billingInfo.biAddress," ")}}function Tg(t,a){t&1&&(l(0,"div",34)(1,"span",62),p(2),g(3,"translate"),c()()),t&2&&(o(2),D(" ",f(3,1,"NO_DATA")," "))}function Sg(t,a){if(t&1&&p(0),t&2){let e=u(2);D(" ",(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null?null:e.companyService.userCompany.billingInfo.contactUser.firstname)+" "+(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null?null:e.companyService.userCompany.billingInfo.contactUser.lastname)," ")}}function Lg(t,a){t&1&&(l(0,"div",34)(1,"span",62),p(2),g(3,"translate"),c()()),t&2&&(o(2),D(" ",f(3,1,"NO_DATA")," "))}function Ag(t,a){if(t&1&&p(0),t&2){let e=u(2);D(" ",e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null?null:e.companyService.userCompany.billingInfo.contactUser.username," ")}}function wg(t,a){t&1&&(l(0,"div",34)(1,"span",62),p(2),g(3,"translate"),c()()),t&2&&(o(2),D(" ",f(3,1,"NO_DATA")," "))}function Ig(t,a){if(t&1&&p(0),t&2){let e=u(3);D(" ",e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null?null:e.companyService.userCompany.billingInfo.aditionalBillingContact," ")}}function kg(t,a){t&1&&(l(0,"div",34)(1,"span",62),p(2),g(3,"translate"),c()()),t&2&&(o(2),D(" ",f(3,1,"NO_DATA")," "))}function Dg(t,a){if(t&1&&(y(0,"div",30),l(1,"div",31)(2,"div",26)(3,"div",32),p(4),g(5,"translate"),c(),l(6,"div",33),b(7,Ig,1,1)(8,kg,4,3,"div",34),c()()()),t&2){let e=u(2);o(4),C(f(5,2,"ADMIN.BILLING.ADDITIONAL_CONTACT")),o(3),T(!(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null)&&e.companyService.userCompany.billingInfo.aditionalBillingContact?7:8)}}function Eg(t,a){if(t&1){let e=E();l(0,"btn-component",28),k("click",function(){w(e);let n=u(5);return I(n.retrieveLastFilterDto())}),c()}if(t&2){let e=u(5);_("buttonObject",F(1,B0,e.loading))}}function Bg(t,a){if(t&1&&(l(0,"div",70)(1,"div",71),b(2,Eg,1,3,"btn-component",40),c()()),t&2){let e=u(4);o(2),T(e.filterService.isRestoringFilterOn?2:-1)}}function Ng(t,a){if(t&1){let e=E();l(0,"div",65)(1,"app-filter",69),k("filterElementsOutput",function(n){w(e);let s=u(3);return I(s.filterElements(n))}),b(2,Bg,3,1,"div",70),c()()}if(t&2){let e=u(3);o(),_("componentFilterParameters",e.filterParameters),o(),T(e.billingService.companyBills.length>0?2:-1)}}function Mg(t,a){if(t&1&&(l(0,"span",80),p(1),c()),t&2){let e=u().$implicit;o(),C(e.siiNumber)}}function Fg(t,a){if(t&1&&(l(0,"span",80),p(1),c()),t&2){let e=u().$implicit;o(),C(e.invoiceNumber)}}function Rg(t,a){t&1&&(l(0,"div",17),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"ADMIN.BILLING.OVERDUE")," "))}function Og(t,a){t&1&&(l(0,"div",49),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"ADMIN.BILLING.TO_BE_DUE")," "))}function Pg(t,a){t&1&&(l(0,"div",16),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"ADMIN.BILLING.PAID")," "))}function Vg(t,a){if(t&1&&(l(0,"div",82),p(1),g(2,"formatDate"),c()),t&2){let e=u().$implicit;o(),C(f(2,1,e.expirationDate))}}function Gg(t,a){if(t&1&&(l(0,"div",83),p(1),g(2,"formatDate"),c()),t&2){let e=u().$implicit;o(),C(f(2,1,e.expirationDate))}}
25function Hg(t,a){if(t&1&&(l(0,"div"),p(1),g(2,"formatDate"),c()),t&2){let e=u().$implicit;o(),C(f(2,1,e.paymentDate))}}function Xg(t,a){if(t&1){let e=E();l(0,"btn-component",28),k("click",function(){w(e);let n=u().$implicit,s=u(5);return I(s.billPayment(n))}),c()}t&2&&_("buttonObject",G(1,M0))}function Yg(t,a){if(t&1&&(l(0,"a",86),y(1,"btn-component",40),c()),t&2){let e=u().$implicit;_("href",e.file,zt),o(),_("buttonObject",G(2,F0))}}function zg(t,a){if(t&1){let e=E();l(0,"div",79),k("click",function(){let n=w(e).$implicit,s=u(5);return I(s.showBill(n))}),l(1,"div",74),b(2,Mg,2,1,"span",80)(3,Fg,2,1,"span",80),c(),l(4,"div",74)(5,"div",81),b(6,Rg,3,3,"div",17),b(7,Og,3,3,"div",49),b(8,Pg,3,3,"div",16),c()(),l(9,"div",74),p(10),g(11,"formatDate"),c(),l(12,"div",74),b(13,Vg,3,3,"div",82),b(14,Gg,3,3,"div",83),b(15,Hg,3,3,"div"),c(),l(16,"div",75)(17,"span",84),p(18),g(19,"formatNumber"),c()(),l(20,"div",85),k("click",function(n){w(e);let s=u(5);return I(s.stylingService.stopPropagation(n))}),b(21,Xg,1,2,"btn-component",40),b(22,Yg,2,3,"a",86),c()()}if(t&2){let e=a.$implicit,i=u(5);o(2),T(e.siiNumber>0?2:3),o(4),T(e.expirationStatus==="EXPIRED"?6:-1),o(),T(e.expirationStatus==="PENDING"?7:-1),o(),T(e.expirationStatus==="PAID"?8:-1),o(2),D(" ",f(11,12,e.documentDate)," "),o(3),T(e.expirationStatus==="EXPIRED"?13:-1),o(),T(e.expirationStatus==="PENDING"?14:-1),o(),T(e.expirationStatus==="PAID"?15:-1),o(3),V("",Le(19,14,e.total,e.currency)," ",i.displayCurrency(e.currency)),o(3),T(e.expirationStatus==="PENDING"||e.expirationStatus==="EXPIRED"?21:-1),o(),T(e.expirationStatus==="PAID"?22:-1)}}function $g(t,a){if(t&1){let e=E();l(0,"div",72)(1,"div",73)(2,"div",74),p(3),g(4,"translate"),c(),l(5,"div",74),p(6),g(7,"translate"),c(),l(8,"div",74),p(9),g(10,"translate"),c(),l(11,"div",74),p(12),g(13,"translate"),c(),l(14,"div",75),p(15),g(16,"translate"),c(),l(17,"div",76),p(18),g(19,"translate"),c()()(),l(20,"div",77),k("scrolled",function(){w(e);let n=u(4);return I(n.onScroll())}),Ie(21,zg,23,17,"div",78,we),c()}if(t&2){let e=u(4);_("ngClass",F(21,N0,e.stylingService.shadowStickyTop)),o(3),C(f(4,9,"ADMIN.BILLING.NUMBER")),o(3),C(f(7,11,"ADMIN.BILLING.STATUS")),o(3),C(f(10,13,"ADMIN.BILLING.ISSUE_DATE")),o(3),C(f(13,15,"ADMIN.BILLING.EXPIRATION_DATE")),o(3),C(f(16,17,"ADMIN.BILLING.AMOUNT")),o(3),C(f(19,19,"ADMIN.BILLING.ACTIONS")),o(2),_("infiniteScrollDistance",1)("infiniteScrollThrottle",300),o(),ke(e.billingService.companyBills)}}function Wg(t,a){t&1&&(l(0,"div",87),y(1,"icons-component",38),l(2,"div",89),p(3),g(4,"translate"),c()()),t&2&&(o(),_("type","emptyBills"),o(2),C(f(4,2,"ADMIN.BILLING.EMPTY_BILLS_TITLE")))}function jg(t,a){if(t&1){let e=E();l(0,"div",88),y(1,"div",90),l(2,"app-empty-views",91),y(3,"icons-component",38),c(),l(4,"div",92)(5,"btn-component",28),k("click",function(){w(e);let n=u(5);return n.filterService.resetAll(),I(n.filterElements({}))}),c()()()}if(t&2){let e=u(5);o(2),_("emptyViewObject",G(3,R0)),o(),_("type","noResults"),o(2),_("buttonObject",F(4,O0,e.loading))}}function Ug(t,a){if(t&1&&b(0,Wg,5,4,"div",87)(1,jg,6,6,"div",88),t&2){let e=u(4);T(e.companyBillsEmpty?0:1)}}function qg(t,a){if(t&1&&(l(0,"div",66),b(1,$g,23,23)(2,Ug,2,1),c()),t&2){let e=u(3);o(),T(e.billingService.companyBills.length>0?1:2)}}function Qg(t,a){t&1&&y(0,"app-filter-and-list",67)}function Kg(t,a){t&1&&(l(0,"div",68),y(1,"div",93),c())}function Zg(t,a){if(t&1&&(l(0,"div",63)(1,"div",64),p(2),g(3,"translate"),c(),l(4,"div"),p(5),g(6,"translate"),c()(),b(7,Ng,3,2,"div",65),b(8,qg,3,1,"div",66)(9,Qg,1,0,"app-filter-and-list",67),b(10,Kg,2,0,"div",68)),t&2){let e=u(2);o(2),C(f(3,5,"ADMIN.BILLING.BILLS")),o(3),C(f(6,7,"ADMIN.BILLING.BILLS_SUBTITLE")),o(2),T(!e.loadingFilterComponent&&!e.companyBillsEmpty?7:-1),o(),T(e.loading?9:8),o(2),T(e.loadingScroll?10:-1)}}function Jg(t,a){if(t&1){let e=E();$e(0,5),l(1,"div",6)(2,"div",7),p(3),g(4,"translate"),c(),b(5,P0,3,3,"div"),c(),l(6,"div",8)(7,"div",9)(8,"div",10)(9,"div",11)(10,"div",12),b(11,V0,2,3)(12,G0,1,1),c(),b(13,H0,5,6,"div",13),c(),b(14,X0,3,4,"div",14),c(),l(15,"div",15),b(16,Y0,3,3,"div",16),b(17,z0,3,3,"div",17),l(18,"div",18),y(19,"icons-component",19),l(20,"span",20),p(21),g(22,"translate"),c()(),b(23,$0,6,7,"div",18),b(24,W0,6,6,"div",18),c(),b(25,j0,4,3,"div"),b(26,U0,3,3,"div"),c(),l(27,"div",21)(28,"div",22)(29,"div",11)(30,"div",12),p(31),g(32,"translate"),c(),b(33,Q0,4,2,"div",23),c(),b(34,K0,4,6,"div"),b(35,Z0,4,6,"div"),b(36,J0,3,3,"div"),c(),R(37,ng,1,1,"ng-template",null,0,It),b(39,og,19,20),b(40,cg,20,21),b(41,pg,19,15),b(42,mg,19,14),b(43,gg,8,5),c()(),l(44,"div",24)(45,"div",25)(46,"div",11)(47,"div",26)(48,"div",27),p(49),g(50,"translate"),c(),l(51,"div"),p(52),g(53,"translate"),c()(),l(54,"btn-component",28),k("click",function(){w(e);let n=u();return I(n.showBillingInfo())}),y(55,"icons-component",29),c()(),y(56,"div",30),l(57,"div",31)(58,"div",26)(59,"div",32),p(60),g(61,"translate"),c(),l(62,"div",33),b(63,fg,1,1)(64,_g,4,3,"div",34),c()(),l(65,"div",26)(66,"div",32),p(67),g(68,"translate"),c(),l(69,"div",33),b(70,xg,1,1)(71,vg,4,3,"div",34),c()(),l(72,"div",26)(73,"div",32),p(74),g(75,"translate"),c(),l(76,"div",33),b(77,Cg,1,1)(78,yg,4,3,"div",34),c()(),l(79,"div",26)(80,"div",32),p(81),g(82,"translate"),c(),l(83,"div",33),b(84,bg,1,1)(85,Tg,4,3,"div",34),c()()(),y(86,"div",30)(87,"div",35)(88,"div",30),l(89,"div",27),p(90),g(91,"translate"),c(),y(92,"div",30),l(93,"div",31)(94,"div",26)(95,"div",32),p(96),g(97,"translate"),c(),l(98,"div",33),b(99,Sg,1,1)(100,Lg,4,3,"div",34),c()(),l(101,"div",26)(102,"div",32),p(103),g(104,"translate"),c(),l(105,"div",33),b(106,Ag,1,1)(107,wg,4,3,"div",34),c()()(),b(108,Dg,9,4),c(),l(109,"input",36,1),k("change",function(n){w(e);let s=u();return I(s.onPurchaseOrderSelected(n))}),c(),l(111,"input",37,2),k("change",function(n){w(e);let s=u();return I(s.onTransferReceiptSelected(n))}),c(),b(113,Zg,11,9),c(),We()}if(t&2){let e=u();o(3),C(f(4,41,"ADMIN.BILLING.BILLING")),o(2),T(!e.isTrialOrFree&&e.companyService.companyPlanId!==4&&e.companyService.companyPlanId!==-1?5:-1),o(6),T(e.companyService.userCompany.isTrial===1?11:12),o(2),T(e.companyService.userCompany.isTrial===1?13:-1),o(),T(e.companyService.companyPlanId!==4&&e.companyService.companyPlanId!==-1&&!e.isTrialOrFree?14:-1),o(2),T(e.companyService.userCompany.isActive===1?16:-1),o(),T(e.companyService.userCompany.isActive===0?17:-1),o(4),V("",e.numberOfUsers," ",f(22,43,"ADMIN.BILLING.USERS_COUNT")),o(2),T(e.isTrialOrFree?-1:23),o(),T(e.isTrialOrFree&&(e.companyService.userCompany.paymentPlan!=null&&e.companyService.userCompany.paymentPlan.expirationDate||e.companyService.userCompany.trialEndDate)?24:-1),o(),T(e.isTrialOrFree?-1:25),o(),T(e.isTrialOrFree?26:-1),o(5),C(f(32,45,"ADMIN.BILLING.UPCOMING_PAYMENTS")),o(2),T(e.hasRegisteredCard&&e.supportsCardPayment?33:-1),o(),T(e.nextPaymentState==="suspended"?34:-1),o(),T(e.nextPaymentState==="aboutToDue"?35:-1),o(),T(e.nextPaymentState==="noPayments"&&!e.isTrialOrFree?36:-1),o(3),T(e.nextPaymentState==="suspended"?39:-1),o(),T(e.nextPaymentState==="aboutToDue"?40:-1),o(),T(e.nextPaymentState==="preBillingPending"?41:-1),o(),T(e.nextPaymentState==="preBillingReview"?42:-1),o(),T(e.nextPaymentState==="noPayments"?43:-1),o(6),C(f(50,47,"ADMIN.BILLING.BILLING_INFO")),o(3),C(f(53,49,"ADMIN.BILLING.BILLING_INFO_SUBTITLE")),o(2),_("buttonObject",G(65,S0)),o(6),C(f(61,51,"ADMIN.BILLING.TAX_ID")),o(3),T(!(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null)&&e.companyService.userCompany.billingInfo.biRut?63:64),o(4),C(f(68,53,"ADMIN.BILLING.COMPANY")),o(3),T(!(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null)&&e.companyService.userCompany.billingInfo.biRazonSocial?70:71),o(4),C(f(75,55,"ADMIN.BILLING.PHONE")),o(3),T(!(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null)&&e.companyService.userCompany.billingInfo.biPhone?77:78),o(4),C(f(82,57,"ADMIN.BILLING.ADDRESS")),o(3),T(!(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null)&&e.companyService.userCompany.billingInfo.biAddress?84:85),o(6),C(f(91,59,"ADMIN.BILLING.BILLING_CONTACT")),o(6),C(f(97,61,"ADMIN.BILLING.CONTACT")),o(3),T(!(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null||e.companyService.userCompany.billingInfo.contactUser==null)&&e.companyService.userCompany.billingInfo.contactUser.firstname&&(!(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null||e.companyService.userCompany.billingInfo.contactUser==null)&&e.companyService.userCompany.billingInfo.contactUser.lastname)?99:100),o(4),C(f(104,63,"ADMIN.BILLING.EMAIL")),o(3),T(!(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null||e.companyService.userCompany.billingInfo.contactUser==null)&&e.companyService.userCompany.billingInfo.contactUser.username?106:107),o(2),T(!(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null)&&e.companyService.userCompany.billingInfo.aditionalBillingContact?108:-1),o(5),T(e.isTrialOrFree?-1:113)}}function ef(t,a){t&1&&y(0,"app-bills-skeleton-component")}var Wn=(()=>{class t{constructor(e,i,n,s,r,d,m,h,x,v,L,A,B,N,P,re,ve,ye,ge,Ce){this.translate=e,this.stylingService=i,this.uiStateService=n,this.companyService=s,this.globalModalService=r,this.fileManagerService=d,this.eRef=m,this._DomSanitizer=h,this.selectControllerService=x,this.pricingService=v,this.billingService=L,this.alertService=A,this.mercadopagoService=B,this.kushkiService=N,this.rebillService=P,this.router=re,this.prebillingService=ve,this.filterService=ye,this.cardBrandService=ge,this.logsManagementService=Ce,this.cdr=Q(U),this.offset=0,this.limit=10,this.filterDto={},this.append=!1,this.loading=!1,this.initialLoading=!0,this.loadingScroll=!1,this.loadingFilterComponent=!0,this.companyBillsEmpty=!1,this.numberOfUsers=1,this.allowedKushkiCountries=["CL","US"],this.showTransference=!1,this.warningAlert={},this.cardType=null,this.rebillCardData=null,this.loadingRebillCard=!1,this.CountryPlans=$,this.PreBillStatus=as,this.filterParameters=[],this.nextPaymentState="noPayments",this.totalPending=0,this.pendingCurrency="",this.pendingBills=0,this.overdueBills=0,this.overdueSinceDate="",this.unpaidBillsList=[],this.ocUploadedLocally=!1,this.isTrialOrFree=!1,this.trialDaysElapsed=0,this.trialTotalDays=0,this.transferReceiptBillId=null}clickout(e){if(e.target.id==="body-mod"||e.target.classList[0]==="mat-calendar-body-cell"||e.target.classList[0]==="cdk-overlay-backdrop"||e.target.classList[0]==="mat-calendar-body-cell-content")return!1}async ngOnInit(){this.initialLoading=!0,this.companyService.getCompanyPlan(),this.pricingService.pricingConfig(),this.pricingService.pricingTableContent(),this.numberOfUsers=await this.companyService.getNumberOfUsers(),this.modalEventsSub=this.globalModalService.loadEventsFromModals$.subscribe(async e=>{e?.type==="receiptUploaded"&&await this.refreshBillsAndState(),e?.type==="rebillCardUpdated"&&await this.loadRebillCard(),this.cdr.markForCheck()}),await this.getCompanyBills(),await this.prebillingService.getCompanyPreBill(),this.billingService.companyBills.length==0&&(this.companyBillsEmpty=!0),await this.pricingService.getPricing(),this.calculateNextPaymentState(),this.isTrialOrFree=this.companyService.userCompany.isTrial===1||this.companyService.companyPlanId===0,this.companyService.userCompany.isTrial===1&&this.calculateTrialDays(),this.userCompanyLocal={userCompany:this.companyService.userCompany},this.detectCardType(),await this.loadRebillCard(),await this.loadFilterComponent(),this.initialLoading=!1}async getCompanyBills(){await this.billingService.getCompanyBills(this.offset,this.limit,this.append,this.filterDto)}async loadFilterComponent(){this.loadingFilterComponent=!0,this.cdr.markForCheck(),await this.selectControllerService.setBillsStatusOptions(),this.filterParameters=[{items:null,type:"main",dtoName:"invoiceNumber",label:"ADMIN.BILLING.FILTER_BILLS.NUMBER_PLACEHOLDER",placeholder:"ADMIN.BILLING.FILTER_BILLS.NUMBER_PLACEHOLDER"},{items:this.selectControllerService.billsStatusOptions,type:"select",dtoName:"paymentStatus",label:"ADMIN.BILLING.FILTER_BILLS.STATUS",placeholder:"ADMIN.BILLING.FILTER_BILLS.STATUS_PLACEHOLDER"},{items:null,type:"date",dtoName:"",label:"ADMIN.BILLING.FILTER_BILLS.ISSUE_DATE",placeholder:"ADMIN.BILLING.FILTER_BILLS.ISSUE_DATE"}],this.filterService.setFilterByComponent(Jn.BILLING,!1),this.filterService.filterType=Jn.BILLING,this.filterService.checkIfFilterStored(),this.filterService.filterActive=!0,this.loadingFilterComponent=!1,this.cdr.markForCheck()}async filterElements(e){this.loading||(this.loading=!0,this.cdr.markForCheck(),this.filterDto=ze({},e),this.offset=0,this.limit=15,this.append=!1,await this.getCompanyBills(),this.billingService.companyBills.length===0&&Object.keys(this.filterDto).length===0?this.companyBillsEmpty=!0:this.companyBillsEmpty=!1,this.loading=!1,this.cdr.markForCheck(),this.filterService.storeFilter())}retrieveLastFilterDto(){this.loading||(this.filterService.retrieveLastFilterDto(),this.filterElements(this.filterService.filterDto))}checkInput(e){this.isChecked=e.target.id}async onScroll(){this.append=!0,this.limit=10;let e=this.offset;this.offset=this.billingService.companyBills.length,e!==this.offset&&(this.loadingScroll=!0,this.cdr.markForCheck(),await this.getCompanyBills(),this.loadingScroll=!1,this.cdr.markForCheck())}get showRebill(){return this.companyService.userCompany?.countryId===$.ARGENTINA}get supportsCardPayment(){let e=this.companyService.userCompany?.countryId;return e===$.CHILE||e===$.ARGENTINA}async loadRebillCard(){if(this.showRebill){this.loadingRebillCard=!0,this.cdr.markForCheck();
25try{let e=await this.rebillService.getRebillCard();e?.card&&(this.rebillCardData={last4:e.card.lastFour||"****",brand:e.card.brand||"Card"},this.detectCardType())}catch{this.rebillCardData=null}finally{this.loadingRebillCard=!1,this.cdr.markForCheck()}}}detectCardType(){if(this.rebillCardData){this.cardType=this.rebillCardData.brand;return}let e=this.companyService.userCompany?.paymentPlan,i=e?.kushkiInfo;if(i?.isKushki===1&&i?.cardLastDigits){this.cardType=i.cardType||null;return}if(e?.mercadoPagoInfo?.isMercadoPago===1){let s=e?.qvoInfo;if(s?.cardType){this.cardType=s.cardType;return}if(i?.cardLastDigits){this.cardType=null;return}}}get hasRegisteredCard(){if(this.rebillCardData)return!0;let e=this.companyService.userCompany?.paymentPlan,i=e?.kushkiInfo;return!!(e?.mercadoPagoInfo?.isMercadoPago===1&&i?.cardLastDigits||i?.isKushki===1&&i?.cardLastDigits)}get cardIcon(){let e=(this.cardType||"").toLowerCase();return e==="master card"||e==="mastercard"?"miniMastercardIcon":e==="visa"?"miniVisaIcon":e==="amex"||e==="american express"?"logoAmexTiny":null}get cardLastDigits(){if(this.rebillCardData)return this.rebillCardData.last4;let e=this.companyService.userCompany?.paymentPlan,i=e?.kushkiInfo;return e?.mercadoPagoInfo?.isMercadoPago===1&&i?.cardLastDigits||i?.isKushki===1&&i?.cardLastDigits?i.cardLastDigits:""}addPaymentMethod(){this.globalModalService.params={type:"paymentMethod",styles:"modal-background",component:Hi,paymentProvider:this.showRebill?"rebill":void 0},this.globalModalService.showModal()}showBillingInfo(){this.globalModalService.params={type:"billingInfo",styles:"modal-background",component:rn},this.globalModalService.showModal()}showBill(e){this.globalModalService.params={type:"sitepannelBill",styles:"modal-popUp widthAdd",bill:e,component:Qa},this.globalModalService.showModal()}showTransferData(e){this.globalModalService.params={type:"sidepanelTransferData",styles:"modal-popUp widthAdd",bills:e,component:$n},this.globalModalService.showModal()}openContactModal(){this.globalModalService.params={type:"updatePlan",styles:"modal-background",component:gi,width:1048},this.globalModalService.showModal()}async ngAfterViewInit(){await this.ngOnChanges(),this.cdr.markForCheck()}async ngOnChanges(){}showAdviserPlan(){let e;this.companyService.userCompany.relationship.roles.admin===1?e="admin":e="employee";let i={show:!0,title:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.TITLE"),subtitle:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.SUBTITLE"),greenText:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.GREEN_TEXT"),cancelText:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.CANCEL"),detailTitle:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.DETAIL_TITLE"),detailText:this.translate.instant("ADMIN.BILLING.MODAL_SEE_PLANS.DETAIL_TEXT"),type:e,modalPlan:!0};this.uiStateService.showModalAdviser(i)}showHelpModal(){this.globalModalService.params={type:"helpModal",styles:"modal-background",component:Js,width:948,contentType:"billingHelp"},this.globalModalService.showModal()}isRebillCard(){return!!this.rebillCardData}isMercadoPagoCard(){return this.companyService.userCompany?.paymentPlan?.mercadoPagoInfo?.isMercadoPago===1}async removeCard(){this.warningAlert.title=this.translate.instant("ADMIN.API.TOGGLE_COMPANY_API.WARNING_TITLE"),this.isMercadoPagoCard()&&!this.isRebillCard()?this.warningAlert.message=this.translate.instant("\xBFEstas seguro de ")+"<b>"+this.translate.instant("remover la tarjeta asociada a Mercado Pago")+"</b> ?":this.warningAlert.message=this.translate.instant("\xBFEstas seguro de ")+"<b>"+this.translate.instant("remover la tarjeta terminada en ")+" "+this.cardLastDigits+"</b> ?",this.warningAlert.confirmButton=this.translate.instant("Remover tarjeta"),this.warningAlert.cancelButton=this.translate.instant("MESSAGE_ALERT.CANCEL_BUTTON"),await this.alertService.warning(this.warningAlert),this.alertService.confirmedAlert&&(this.isRebillCard()?(await this.rebillService.disableSubscription(),this.rebillCardData=null):this.isMercadoPagoCard()?await this.mercadopagoService.disableSubscriptionMercadoPago():await this.kushkiService.disableSubscriptionKushki(),this.cardType=null,await this.companyService.getUserCompany(this.companyService.userCompany.id),await this.loadRebillCard(),this.detectCardType(),this.logsManagementService.registerCompanyLog(Ke.BILLING_CARD_REMOVED,{}))}setCardTypeFromNumber(e){this.cardType=this.cardBrandService.detectBrand(e)}async getCardType(e){this.setCardTypeFromNumber(e)}async billPayment(e){this.globalModalService.params={bill:e},this.router.navigate(["/admin/billing/bill",e.id])}triggerTransferReceiptUpload(e){this.transferReceiptBillId=e,this.transferReceiptInput.nativeElement.click()}async onTransferReceiptSelected(e){let i=e.target;if(!i.files||i.files.length===0)return;let n=i.files[0],s=this.transferReceiptBillId;if(!s)return;await this.billingService.uploadBillTransferReceipt([s],n)?(await this.refreshBillsAndState(),this.alertService.success({title:"Comprobante enviado",message:"El comprobante de transferencia fue enviado correctamente."})):this.alertService.error({title:"Error",message:"No se pudo enviar el comprobante. Intente nuevamente."}),i.value="",this.transferReceiptBillId=null}calculateNextPaymentState(){let e=this.billingService.companyBills||[],i=this.prebillingService.companyPreBill;if(i)if(i.requiresOC&&!i.prebillFiles&&!this.ocUploadedLocally){this.nextPaymentState="preBillingPending";return}else{this.nextPaymentState="preBillingReview";return}let n=e.filter(r=>r.expirationStatus===Ee.EXPIRED||r.expirationStatus===Ee.PENDING);this.unpaidBillsList=n,this.overdueBills=e.filter(r=>r.expirationStatus===Ee.EXPIRED).length,this.pendingBills=n.length,this.totalPending=n.reduce((r,d)=>r+(parseFloat(d.total)||0),0);let s=n.filter(r=>r.expirationStatus===Ee.EXPIRED&&!!r.expirationDate);if(this.overdueSinceDate=s.length?s.reduce((r,d)=>d.expirationDate<r.expirationDate?d:r).expirationDate:"",this.pendingCurrency=n.length>0?n[0].currency:this.companyService.userCompany.paymentPlan?.currency||"",this.companyService.userCompany.isActive===0&&this.overdueBills>0){this.nextPaymentState="suspended";return}if(this.pendingBills>0){this.nextPaymentState="aboutToDue";return}this.nextPaymentState="noPayments"}get hasAnyBillWithReceipt(){return(this.billingService.companyBills||[]).some(e=>e.billFiles?.length>0&&e.expirationStatus!==Ee.PAID)}getPreBillMonth(){let e=this.prebillingService.companyPreBill;if(!e?.startPaymentPeriod)return"";let i=new Date(e.startPaymentPeriod),n=["CHART.MONTHS.JAN","CHART.MONTHS.FEB","CHART.MONTHS.MAR","CHART.MONTHS.APR","CHART.MONTHS.MAY","CHART.MONTHS.JUN","CHART.MONTHS.JUL","CHART.MONTHS.AUG","CHART.MONTHS.SEP","CHART.MONTHS.OCT","CHART.MONTHS.NOV","CHART.MONTHS.DEC"];return`${this.translate.instant(n[i.getMonth()+1])} ${i.getFullYear()}`}getNextBillingDate(){let e=this.companyService.userCompany?.paymentPlan?.nextBillingDate;return e?e+"T12:00:00":""}getPlanPrice(){let e=this.companyService.userCompany.paymentPlan;if(e?.changedPlanDate)return e.activeUserPricing||"0";let i=this.companyService.companyPlanId;return i===1?this.pricingService.monthlyPriceStarter?.toString()||"0":i===2?this.pricingService.monthlyPriceBusiness?.toString()||"0":(i===3||i===4)&&e?.normalUserPricing||"0"}getUserDiscount(){let e=this.companyService.userCompany?.paymentPlan,n=parseFloat(e?.normalUserPricing||"0")===0?e?.activeUserDiscount:e?.normalUserDiscount;return Math.trunc(parseFloat(n||"0"))}displayCurrency(e){return e==="CLF"?"UF":e}calculateTrialDays(){let e=this.companyService.userCompany?.paymentPlan,i=e?.expirationDate||this.companyService.userCompany?.trialEndDate,n=e?.creationDate||this.companyService.userCompany?.createdAt;if(!n||!i)return;let s=new Date(n),r=new Date(i),d=new Date,m=1e3*60*60*24,h=v=>new Date(v.getFullYear(),v.getMonth(),v.getDate()),x=(v,L)=>Math.floor((h(L).getTime()-h(v).getTime())/m);this.trialTotalDays=x(s,r)+1,this.trialDaysElapsed=Math.max(1,Math.min(x(s,d)+1,this.trialTotalDays))}async onPurchaseOrderSelected(e){let i=e.target;if(!i.files||i.files.length===0)return;let n=this.prebillingService.companyPreBill?.id;if(!n)return;let s=Array.from(i.files);await this.prebillingService.uploadPurchaseOrders(n,s)?(this.ocUploadedLocally=!0,this.calculateNextPaymentState()):this.alertService.error({title:"Error",message:"No se pudo enviar la orden de compra. Intente nuevamente."}),i.value=""}async refreshBillsAndState(){this.offset=0,this.limit=50,this.append=!1,await this.getCompanyBills(),this.calculateNextPaymentState()}ngOnDestroy(){this.modalEventsSub&&this.modalEventsSub.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)(S(ee),S(fe),S(ht),S(j),S(K),S(Kt),S(nt),S(Wt),S(qs),S(ro),S(ft),S(Zi),S(ci),S(At),S(di),S(He),S(oo),S(Ks),S(pi),S(ot))}}static{this.\u0275cmp=O({type:t,selectors:[["app-billing"]],viewQuery:function(i,n){if(i&1&&De(T0,5),i&2){let s;
25Te(s=Se())&&(n.transferReceiptInput=s.first)}},hostBindings:function(i,n){i&1&&k("click",function(r){return n.clickout(r)},fs)},standalone:!1,features:[ae],decls:4,vars:1,consts:[["cardButtons",""],["purchaseOrderInput",""],["transferReceiptInput",""],[1,"billingTabs"],[1,"appBilling","bg-white","pd-24","br-10-tab1st"],[1,"billingContent"],[1,"flex","justify-between","items-center","w-full"],[1,"text-blue","bold","bigger"],[1,"flex","gap-24","w-full"],[1,"w-2/5","rounded-10","p-24","border-2-s-clouds","flex","flex-col","gap-16","justify-between"],[1,"flex","flex-col","gap-4"],[1,"flex","jc-sb","ai-c"],[1,"text-blue","big","bold"],[1,"flex","ai-c","gap-8","text-black70"],[1,"bold","big"],[1,"flex","flex-col","gap-16"],[1,"rgChip-static-g"],[1,"rgChip-static-r"],[1,"flex","items-center","gap-8"],["type","checkCircleGray"],[1,"text-black70"],[1,"w-3/5","rounded-10","p-24","border-2-s-clouds","flex","flex-col","gap-24"],[1,"flex","flex-col","gap-8"],[1,"flex","items-center","gap-8","bg-blueLight","p-8","rounded-[4px]"],[1,"billingOptions"],[1,"border-2-s-clouds","br-10","pd-24","w-full","box-border"],[1,"flex","fd-c","gap-4"],[1,"text-blue","bold"],[3,"click","buttonObject"],["type","miniPencil"],[1,"h-24"],[1,"flex","gap-48"],[1,"bold"],[1,"grayDark"],[1,"itemField"],[1,"borderGroup"],["type","file","multiple","","accept",".pdf,.png,.jpg,.jpeg",2,"display","none",3,"change"],["type","file","accept",".pdf,.png,.jpg,.jpeg",2,"display","none",3,"change"],[3,"type"],[1,"text-blue","cursor-pointer","underline",3,"click"],[3,"buttonObject"],[1,"bg-gray-50","rounded-lg","p-16","flex","jc-sb"],[1,"text-red-500","bold","big"],[1,"flex","flex-col","items-end","gap-4"],[1,"flex","jc-fe","gap-16","ai-c"],[4,"ngTemplateOutlet"],[1,"small","text-gray-400","lh-140",3,"innerHTML"],[1,"bg-yellow10","rounded-lg","p-16","flex","jc-sb"],[1,"text-yellowDark","bold","big"],[1,"rgChip-static-y"],[1,"small","text-black70",3,"innerHTML"],[1,"bg-orange20","rounded-lg","p-16","flex","jc-sb"],[1,"text-orange","bold","big"],[1,"rgChip-noBg-o-white"],[1,"flex","gap-8","items-start","justify-start"],["type","redAlert22"],[1,"small"],["type","uploadFile"],[1,"text-black70","bold","big"],[1,"rgChip-static-o"],[1,"bg-green10","rounded-lg","p-16"],[1,"text-green","bold","big"],[1,"noData"],[1,"flex","fd-c","gap-8","mt-16"],[1,"bold","bigger","text-blue"],[1,"border-2-s-clouds","br-10","min-w-full"],[1,"bg-white","br-10-tab1st","w-full"],["type","list",1,"w-full"],[1,"block","w-full","px-[34px]","ta-c"],[3,"filterElementsOutput","componentFilterParameters"],["changeDisplay","",1,"changeDisplay"],[1,"flex","ai-c","gap-24","mg-1-t"],[1,"rGridList","headList","noFilterTop","br-10-t","noMargin","mg-2-t",3,"ngClass"],[1,"gridItem","head","br-10-t","noMargin","border-2-s-clouds"],["isEllipsis","",1,"gridCol","sp3"],["isEllipsis","",1,"gridCol","sp3","right"],["isEllipsis","",1,"gridCol","sp5","right"],["infiniteScroll","",1,"rGridList","bodyList","noMargin","noChildMargin","of-h",3,"scrolled","infiniteScrollDistance","infiniteScrollThrottle"],[1,"gridItem","border-2-s-clouds-b","border-2-s-clouds-l","border-2-s-clouds-r"],[1,"gridItem","border-2-s-clouds-b","border-2-s-clouds-l","border-2-s-clouds-r",3,"click"],[1,""],[1,"chipGroup","flex","fw-w"],[1,"errorExpire"],[1,"warningExpire"],[1,"bold","text-blue"],[1,"gridCol","sp5","right","noHide","flex","jc-fe",3,"click"],["target","_blank",1,"no-underline",3,"href"],[1,"flex","flex-col","items-center","justify-center","rounded-10","border-2-s-clouds","h-[500px]","fadeIn"],[1,"fullEmptyComponent","fadeIn"],[1,"bold","big","mt-16"],[1,"h-48"],[3,"emptyViewObject"],[1,"flex"],[1,"spinner-b","abs","big","inline"]],template:function(i,n){i&1&&(l(0,"div",3)(1,"div",4),b(2,Jg,114,66,"ng-container",5)(3,ef,1,0,"app-bills-skeleton-component"),c()()),i&2&&(o(2),T(n.initialLoading?3:2))},dependencies:[Ge,Wi,en,tn,Us,Zs,io,ao,me,he,te,Qt,gt],encapsulation:2,changeDetection:0})}}return t})();var Hl=t=>({"active blue-imp":t});function af(t,a){t&1&&(l(0,"div",7),y(1,"app-billing"),c())}function sf(t,a){t&1&&(l(0,"div",8),y(1,"app-activity"),c())}
25function of(t,a){if(t&1){let e=E();l(0,"div",0)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6),k("click",function(){w(e);let n=u();return I(n.changeMenu("billing"))}),p(5),g(6,"translate"),c(),l(7,"div",6),k("click",function(){w(e);let n=u();return I(n.changeMenu("activity"))}),p(8),g(9,"translate"),c()()(),b(10,af,2,0,"div",7),b(11,sf,2,0,"div",8),c()()}if(t&2){let e=u();o(4),_("ngClass",F(10,Hl,e.contentDisplayId==="billing")),o(),D(" ",f(6,6,"ADMIN.BILLING.BILLING")," "),o(2),_("ngClass",F(12,Hl,e.contentDisplayId==="activity")),o(),D(" ",f(9,8,"ADMIN.BILLING.ACTIVITY")," "),o(2),T(e.contentDisplayId==="billing"?10:-1),o(),T(e.contentDisplayId==="activity"?11:-1)}}function rf(t,a){t&1&&y(0,"app-mini-menu-skeleton",1),t&2&&_("typeSkeleton","complete")}function lf(t,a){if(t&1){let e=E();l(0,"app-feature-news-card",9),k("dismissed",function(){w(e);let n=u();return I(n.dismissNewsCard())}),c()}t&2&&_("title","ADMIN.BILLING.NEWS_CARD.TITLE")("featureLabel","ADMIN.BILLING.NEWS_CARD.FEATURE_LABEL")("description","ADMIN.BILLING.NEWS_CARD.DESCRIPTION")("buttonText","ADMIN.BILLING.NEWS_CARD.GOT_IT")("videoUrl","../../../../assets/animations/facturacion-web.webm")}var Xl=(()=>{class t{constructor(e,i,n,s,r){this.stylingService=e,this.router=i,this.globalModalService=n,this.companyService=s,this.configUiService=r,this.cdr=Q(U),this.contentDisplayId="billing",this.showNewsCard=!1,this.newsCardConfig={flag:eo.ADVISERS,reference:Ws.BILLING,name:"billing_upload_receipt_news",seen:!1,lastSeen:new Date().toString(),count:1,maxCount:9999},i.url==="/admin/billing/activity"?this.contentDisplayId="activity":this.contentDisplayId="billing"}onWindowScroll(){this.stylingService.getFilterNavbar(window)}ngOnInit(){this.loading=!0,this.cdr.markForCheck(),this.companyService.userCompany.planConfiguration.plan==="TRIAL"&&this.companyService.userCompany.isActive===0&&this.openEndFreeTrialModal(),this.loading=!1,this.cdr.markForCheck(),this.showNewsCard=this.configUiService.checkUserConfigAndShow(this.newsCardConfig)}dismissNewsCard(){this.showNewsCard=!1,this.configUiService.updateUserConfig(this.newsCardConfig,!0)}changeMenu(e){this.contentDisplayId=e,e==="activity"?this.router.navigate(["/admin/billing/activity"]):this.router.navigate(["/admin/billing"])}async openEndFreeTrialModal(){this.globalModalService.params={type:"endFreeTrial",styles:"modal-background",component:qa},this.globalModalService.showModal()}static{this.\u0275fac=function(i){return new(i||t)(S(fe),S(He),S(K),S(j),S(to))}}static{this.\u0275cmp=O({type:t,selectors:[["app-billing-module"]],hostBindings:function(i,n){i&1&&k("scroll",function(){return n.onWindowScroll()},$i)},standalone:!1,decls:4,vars:2,consts:[[1,"container-rg","transparent","flexInfo"],[3,"typeSkeleton"],[3,"title","featureLabel","description","buttonText","videoUrl"],[1,"block","w-full","p-0","mb-[34px]","w-[650px]","mx-auto","rounded-10","gw",2,"--gw","948px"],[1,"bankDetails"],[1,"flex"],[1,"innerTabs","asbestos",3,"click","ngClass"],[1,"billingContent","bg-white","br-10-tab1st"],[1,"billingContent","bg-white","br-10"],[3,"dismissed","title","featureLabel","description","buttonText","videoUrl"]],template:function(i,n){i&1&&(y(0,"app-breadcrumbs"),b(1,of,12,14,"div",0)(2,rf,1,1,"app-mini-menu-skeleton",1),b(3,lf,1,5,"app-feature-news-card",2)),i&2&&(o(),T(n.loading?2:1),o(2),T(n.showNewsCard?3:-1))},dependencies:[Zt,Xn,Ge,no,Hn,Wn,te],encapsulation:2,changeDetection:0})}}return t})();function cf(t,a){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&a.indexOf(i)<0&&(e[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)a.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(e[i[n]]=t[i[n]]);return e}function df(t,a){var e=document.querySelector('script[src="'.concat(t,'"]'));if(e===null)return null;var i=zl(t,a),n=e.cloneNode();if(delete n.dataset.uidAuto,Object.keys(n.dataset).length!==Object.keys(i.dataset).length)return null;var s=!0;return Object.keys(n.dataset).forEach(function(r){n.dataset[r]!==i.dataset[r]&&(s=!1)}),s?e:null}function pf(t){var a=t.url,e=t.attributes,i=t.onSuccess,n=t.onError,s=zl(a,e);s.onerror=n,s.onload=i,document.head.insertBefore(s,document.head.firstElementChild)}function hf(t){var a=t.sdkBaseUrl,e=t.environment,i=cf(t,["sdkBaseUrl","environment"]),n=a||gf(e),s=i,r=Object.keys(s).filter(function(h){return typeof s[h]<"u"&&s[h]!==null&&s[h]!==""}).reduce(function(h,x){var v=s[x].toString();return x=mf(x),x.substring(0,4)==="data"||x==="crossorigin"?h.attributes[x]=v:h.queryParams[x]=v,h},{queryParams:{},attributes:{}}),d=r.queryParams,m=r.attributes;return d["merchant-id"]&&d["merchant-id"].indexOf(",")!==-1&&(m["data-merchant-id"]=d["merchant-id"],d["merchant-id"]="*"),{url:"".concat(n,"?").concat(uf(d)),attributes:m}}function mf(t){var a=function(e,i){return(i?"-":"")+e.toLowerCase()};return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,a)}function uf(t){var a="";return Object.keys(t).forEach(function(e){a.length!==0&&(a+="&"),a+=e+"="+t[e]}),a}function gf(t){return t==="sandbox"?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}function zl(t,a){a===void 0&&(a={});var e=document.createElement("script");
25return e.src=t,Object.keys(a).forEach(function(i){e.setAttribute(i,a[i]),i==="data-csp-nonce"&&e.setAttribute("nonce",a["data-csp-nonce"])}),e}function $l(t,a){if(a===void 0&&(a=Promise),Wl(t,a),typeof document>"u")return a.resolve(null);var e=hf(t),i=e.url,n=e.attributes,s=n["data-namespace"]||"paypal",r=Yl(s);return n["data-js-sdk-library"]||(n["data-js-sdk-library"]="paypal-js"),df(i,n)&&r?a.resolve(r):ff({url:i,attributes:n},a).then(function(){var d=Yl(s);if(d)return d;throw new Error("The window.".concat(s," global variable is not available."))})}function ff(t,a){a===void 0&&(a=Promise),Wl(t,a);var e=t.url,i=t.attributes;if(typeof e!="string"||e.length===0)throw new Error("Invalid url.");if(typeof i<"u"&&typeof i!="object")throw new Error("Expected attributes to be an object.");return new a(function(n,s){if(typeof document>"u")return n();pf({url:e,attributes:i,onSuccess:function(){return n()},onError:function(){var r=new Error('The script "'.concat(e,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return s(r)}})})}function Yl(t){return window[t]}function Wl(t,a){if(typeof t!="object"||t===null)throw new Error("Expected an options object.");var e=t.environment;if(e&&e!=="production"&&e!=="sandbox")throw new Error('The `environment` option must be either "production" or "sandbox".');if(typeof a<"u"&&typeof a!="function")throw new Error("Expected PromisePonyfill to be a function.")}var ss=(()=>{class t{constructor(e,i,n){this.axiosService=e,this.router=i,this.authService=n,this.userMicroservice="/core/user",this.user=null,this.paymentsMicroservice="/payments"}async payBillEbanxNew(e){let n=this.paymentsMicroservice+"/payBillEbanx";return await this.axiosService.postMicroserviceSecure(n,e)}async finishPayPalPayments(e){let n=this.paymentsMicroservice+"/finishPayPalPayment";return await this.axiosService.postMicroserviceSecure(n,e)}static{this.\u0275fac=function(i){return new(i||t)(pe(mt),pe(He),pe(ut))}}static{this.\u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var xf=()=>({value:"ADMIN.BILLING.MODAL_BILLING_INFO.CANCEL",class:"rindeButton-o-t nM"}),jn=(()=>{class t{constructor(e,i,n,s,r,d,m,h){this.globalModalService=e,this.companyService=i,this.oldRindegastosService=n,this.childModalGlobalService=s,this.router=r,this.snackService=d,this.translate=m,this.logsManagementService=h,this.cdr=Q(U)}async ngOnInit(){this.params=this.globalModalService.params,this.company=this.companyService.currentCompany,this.bill=this.params.bill,await this.paypalPayment(),this.cdr.markForCheck()}async paypalPayment(){let e=this.oldRindegastosService,i=this.globalModalService,n=this.router,s=this.snackService,r=this.translate,d=this.logsManagementService,m=this.bill,h=this.company;$l({clientId:Ut.PAYPAL}).then(x=>{x.Buttons({createOrder:function(v,L){return L.order.create({intent:"CAPTURE",purchase_units:[{description:"Factura #"+m.invoiceNumber+" (ID "+m.id+") - "+h.name,amount:{currency_code:m.currency,value:m.total,breakdown:{item_total:{currency_code:m.currency,value:m.total}}},items:[{name:"Rindegastos.com",description:"Factura #"+m.invoiceNumber+" (ID "+m.id+") - "+h.name,sku:m.id,unit_amount:{currency_code:m.currency,value:m.total},quantity:"1",category:"DIGITAL_GOODS"}]}]})},onApprove:function(v,L){return L.order.capture().then(function(A){if(A.status=="COMPLETED"){let B=document.getElementById("paypal-button-container");B.style.display="none";let N=document.getElementById("paypal-button-container-loading");N.style.display="block";let P={txn:A.id,i:m.id,e:A.payer.email_address,c:h.id};e.finishPayPalPayments(P).then(function(re){re.ok&&(d.registerCompanyLog(Ke.BILLING_BILL_PAID,{invoiceNumber:m.invoiceNumber}),i.closeModal(),n.navigate(["/admin/billing"]))})}else{let B={type:"error",message:r.instant("Payment NOT completed successfully. Status:"+A.status)};s.showSnackNotification(B)}})}}).render("#paypal-button-container")}).catch(x=>{console.error("failed to load the PayPal JS SDK script",x)})}cancel(){this.globalModalService.closeModal()}openContactModal(){this.childModalGlobalService.params={type:"contactUs",styles:"modal-background",component:gi,width:1048},this.childModalGlobalService.showModal()}payment(){let e={txn:"details.id",i:"bill.id",e:"details.payer.email_address",c:this.company.id},i=this.globalModalService,n=this.router;this.oldRindegastosService.finishPayPalPayments(e).then(function(s){s.ok&&(i.closeModal(),n.navigate(["/admin/billing"]))})}static{this.\u0275fac=function(i){return new(i||t)(S(K),S(j),S(ss),S(ea),S(He),S(Ue),S(ee),S(ot))}}static{this.\u0275cmp=O({type:t,selectors:[["app-paypal-payment"]],standalone:!1,decls:40,vars:16,consts:[["paypalDiv",""],[1,"header-1","noMargin","text-blue"],[1,"h-24"],[1,"h-60"],["id","md-paypal"],[1,"flex","jc-c","wp-100"],["id","paypal-button-container",1,"wp-60"],["id","paypal-button-container-loading",1,"flex","jc-fs","wp-60","hidden"],[1,"spinner-b","show"],[1,"h-40"],[1,"ta-c","smaller","mg-10","gray"],[1,"hrDivider"],[1,"curs
25or-pointer",3,"click"],[1,"flex","jc-c"],["src","//ppstatic.rindegastos.com/expenses/images/tarjetas-paypal.png"],[1,"flex","jc-fe","c-g-24"],[3,"click","buttonObject"]],template:function(i,n){i&1&&(l(0,"div",1),p(1),g(2,"translate"),c(),y(3,"div",2),l(4,"div"),p(5),g(6,"translate"),c(),y(7,"div",2),l(8,"div"),p(9),g(10,"translate"),l(11,"b"),p(12),c(),p(13," , total: "),l(14,"b"),p(15),g(16,"currency"),c(),p(17,` . 26`),c(),y(18,"div",3),l(19,"div",4)(20,"div",5,0),y(22,"div",6),l(23,"div",7),y(24,"div",8),c()(),y(25,"div",9),l(26,"div",10),y(27,"div",11)(28,"div",2),p(29," Al completar el pago usted acepta los T\xE9rminos y Condiciones de Uso y la Pol\xEDtica de Privacidad de RindeGastos. "),y(30,"br"),p(31," Si tienes dudas o necesitas ayuda "),l(32,"a",12),k("click",function(){return n.openContactModal()}),p(33,"puede contactarnos aqu\xED."),c()(),y(34,"div",9),l(35,"div",13),y(36,"img",14),c()(),y(37,"div",9),l(38,"div",15)(39,"btn-component",16),k("click",function(){return n.cancel()}),c()()),i&2&&(o(),D(" ",f(2,6,"Pagar con PayPal"),` 27`),o(4),D(" ",f(6,8,"A continuaci\xF3n puedes pagar mediante PayPal usando diversos medios de pago seg\xFAn tu pa\xEDs de residencia."),` 28`),o(4),D(" ",f(10,10,"Se cobrar\xE1 la factura con n\xFAmero ")," "),o(3),C(n.bill.invoiceNumber),o(3),C(Le(16,12,n.bill.total,n.bill.currency)),o(24),_("buttonObject",G(15,xf)))},dependencies:[me,te,ws],encapsulation:2,changeDetection:0})}}return t})();var Cf=["bankDataRef"],os=(t,a)=>({"border-blue border-2":t,"border-gray-300":a}),yf=(t,a)=>({class:"rindeButton-b nM",value:"ADMIN.BILLING.BILL.UPLOAD_RECEIPT",disabled:t,loading:a}),bf=()=>({text:"ADMIN.BILLING.BILL.ALERT_TRANSFER_INT"}),Ul=t=>[t],ql=t=>({type:"INFO",start:!0,msg:t}),Tf=()=>({text:"ADMIN.BILLING.BILL.ALERT_TRANSFER_INT2"}),Ql=()=>({class:"rindeButton-b nM",value:"ADMIN.BILLING.BILL.ADD_CARD"}),Sf=()=>({class:"rindeButton-outline nM",value:"ADMIN.BILLING.EDIT_CARD"}),Lf=t=>({class:"rindeButton-outline nM",value:t}),Af=(t,a,e,i)=>({"border-blue border-2":t,"border-gray-300":a,"opacity-50 pointer-events-none":e,"cursor-pointer":i}),wf=(t,a)=>({"border-blue":t,"border-gray-400":a}),If=()=>({class:"rindeButton-b nM",value:"ADMIN.BILLING.BILL.PAYPAL_PAY"}),kf=(t,a,e)=>({"bg-yellow10":t,"bg-blueLight":a,"bg-red10":e}),Kl=()=>({class:"rindeButton-b-s nM",value:"ADMIN.BILLING.BILL.DOWNLOAD_INVOICE"}),Df=t=>({"bg-blueLight":t}),Ef=(t,a)=>({"border-blue border-2":t,"border border-black20":a}),Bf=(t,a)=>({"bg-yellow10":t,"bg-red10":a}),Nf=t=>({"rotate-180":t});function Mf(t,a){t&1&&(l(0,"div",2),y(1,"div",4),c())}function Ff(t,a){t&1&&(p(0),g(1,"translate")),t&2&&D(" ",f(1,1,"ADMIN.BILLING.BILL.PAY_BILL_TITLE")," ")}function Rf(t,a){t&1&&(p(0),g(1,"translate")),t&2&&D(" ",f(1,1,"ADMIN.BILLING.BILL.RECEIPT_SENT_TITLE")," ")}function Of(t,a){t&1&&(p(0),g(1,"translate")),t&2&&D(" ",f(1,1,"ADMIN.BILLING.BILL.SELECT_METHOD_AND_BILLS")," ")}function Pf(t,a){t&1&&(p(0),g(1,"translate")),t&2&&D(" ",f(1,1,"ADMIN.BILLING.BILL.SELECT_PAYMENT_METHOD")," ")}function Vf(t,a){if(t&1&&(l(0,"div",7),b(1,Of,2,3),b(2,Pf,2,3),c()),t&2){let e=u(2);o(),T(e.isMultiInvoice?1:-1),o(),T(e.isSingleInvoice?2:-1)}}function Gf(t,a){if(t&1&&(l(0,"div",29)(1,"div",15),p(2),c(),l(3,"div",35),p(4),c()()),t&2){let e=a.$implicit;o(2),C(e.label),o(2),C(e.value)}}function Hf(t,a){if(t&1){let e=E();l(0,"div",36),k("click",function(n){w(e);let s=u(3);return I(s.stylingService.stopPropagation(n))}),l(1,"div",24)(2,"div",25),p(3),g(4,"translate"),c(),l(5,"div",26),k("click",function(){w(e);let n=u(3);return I(n.copyIntermediaryBankData())}),p(6),g(7,"translate"),y(8,"icons-component",27),c()(),l(9,"div",28)(10,"div",29)(11,"div",15),p(12),g(13,"translate"),c(),l(14,"div",35),p(15,"Rindegastos S.P.A."),c()(),l(16,"div",29)(17,"div",15),p(18,"RUT"),c(),l(19,"div",35),p(20,"76.271.948-7"),c()(),l(21,"div",29)(22,"div",15),p(23),g(24,"translate"),c(),l(25,"div",35),p(26,"Chile"),c()(),l(27,"div",29)(28,"div",15),p(29,"Regi\xF3n"),c(),l(30,"div",35),p(31,"Metropolitana"),c()(),l(32,"div",37)(33,"div",15),p(34),g(35,"translate"),c(),l(36,"div",35),p(37,"Av. Apoquindo 4501 OF 801 Las Condes"),c()()()()}t&2&&(o(3),C(f(4,5,"ADMIN.BILLING.BILL.OWNER")),o(3),D(" ",f(7,7,"ADMIN.BILLING.BILL.COPY_DATA")," "),o(6),C(f(13,9,"ADMIN.BILLING.BILL.COMPANY")),o(11),C(f(24,11,"ADMIN.BILLING.BILL.COUNTRY")),o(11),C(f(35,13,"ADMIN.BILLING.BILL.ADDRESS")))}function Xf(t,a){if(t&1&&(l(0,"div",29)(1,"div",15),p(2),c(),l(3,"div",35),p(4),c()()),t&2){let e=a.$implicit;o(2),C(e.label),o(2),C(e.value)}}function Yf(t,a){if(t&1){let e=E();l(0,"div",36),k("click",function(n){w(e);let s=u(3);return I(s.stylingService.stopPropagation(n))}),l(1,"div",24)(2,"div",25),p(3),g(4,"translate"),c(),l(5,"div",26),k("click",function(){w(e);let n=u(3);return I(n.copyIntermediaryBankData())}),p(6),g(7,"translate"),y(8,"icons-component",27),c()(),l(9,"div",28),Ie(10,Xf,5,2,"div",29,we),c()(),l(12,"div",38),k("click",function(n){w(e);let s=u(3);return I(s.stylingService.stopPropagation(n))}),y(13,"app-alert-component",39),c(),l(14,"div",40),k("click",function(n){w(e);let s=u(3);return I(s.stylingService.stopPropagation(n))}),y(15,"app-alert-component",39),c()}if(t&2){let e=u(3);o(3),C(f(4,4,"ADMIN.BILLING.BILL.INTERMEDIARY_BANK")),o(3),D(" ",f(7,6,"ADMIN.BILLING.BILL.COPY_DATA")," "),o(4),ke(e.getIntermediaryBankData()),o(3),_("params",F(11,ql,F(9,Ul,G(8,bf)))),o(2),_("params",F(16,ql,F(14,Ul,G(13,Tf))))}}function zf(t,a){if(t&1){let e=E();l(0,"div",23),k("click",function(n){w(e);let s=u(2);return I(s.stylingService.stopPropagation(n))}),l(1,"div",24)(2,"div",25),p(3),g(4,"translate"),c(),l(5,"div",26),k("click",function(){w(e);let n=u(2);return I(n.copyBankData())}),p(6),g(7,"translate"),y(8,"icons-component",27),c()(),l(9,"div",28,0),Ie(11,Gf,5,2,"div",29,we),c()(),b(13,Hf,38,15,"div",30),b(14,Yf,16,18),l(15,"div",31),k("click",function(n){w(e);let s=u(2);return I(s.stylingService.stopPropagation(n))}),l(16,"btn-component",32),k("click",function(){w(e);let n=Z(18);return I(n.click())}),c(),l(17,"input",33,1),k("change",function(n){w(e);let s=u(2);return I(s.onTransferReceiptSelected(n))}),c(),y(19,"div",34),g(20,"translate"),c()}if(t&2){let e=u(2);o(3),C(f(4,6,"ADMIN.BILLING.BILL.BANK_DATA")),o(3),D(" ",f(7,8,"ADMIN.BILLING.BILL.COPY_DATA")," "),o(5),ke(e.bankData),o(2),T((e.companyService.userCompany==null?null:e.companyService.userCompany.countryId)===e.CountryPlans.CHILE?13:-1),o(),T(e.isInternational()?14:-1),o(2),_("buttonObject",ce(12,yf,e.uploadingReceipt||e.hasUploadedReceipt||e.isMultiInvoice&&e.selectedBillIds.size===0,e.uploadingReceipt)),o(3),_("innerHTML",f(20,10,"ADMIN.BILLING.BILL.TRANSFER_DEPOSIT_MESSAGE"),le)}}function $f(t,a){if(t&1){let e=E();l(0,"div",45)(1,"btn-component",32),k("click",function(){w(e);let n=u(4);return I(n.addPaymentMethod())}),c()()}t&2&&(o(),_("buttonObject",G(1,Ql)))}function Wf(t,a){if(t&1){let e=E();l(0,"div",46)(1,"div",47),y(2,"img",48),l(3,"div",41)(4,"div",15),p(5),g(6,"translate"),c(),l(7,"div",49),p(8),g(9,"translate"),c()(),l(10,"div",47)(11,"span",50),k("click",function(){w(e);let n=u(4);return I(n.removeCard())}),p(12),g(13,"translate"),c(),l(14,"btn-component",32),k("click",function(){w(e);let n=u(4);return I(n.editCard())}),c()()()(),l(15,"div",51),p(16),g(17,"translate"),c()}if(t&2){let e=u(4);
28o(5),V("",f(6,7,"ADMIN.BILLING.BILL.CARD")," ",e.getCardBrand()),o(3),V("",f(9,9,"ADMIN.BILLING.ENDED")," ",e.getCardLastDigits()),o(4),C(f(13,11,"ADMIN.BILLING.REMOVE_CARD")),o(2),_("buttonObject",G(15,Sf)),o(2),D(" ",f(17,13,"ADMIN.BILLING.BILL.CARD_AUTO_PAY")," ")}}function jf(t,a){if(t&1){let e=E();l(0,"div",44),k("click",function(n){w(e);let s=u(3);return I(s.stylingService.stopPropagation(n))}),b(1,$f,2,2,"div",45),b(2,Wf,18,16),c()}if(t&2){let e=u(3);o(),T(e.hasRegisteredCard()?-1:1),o(),T(e.hasRegisteredCard()?2:-1)}}function Uf(t,a){if(t&1){let e=E();l(0,"div",10),k("click",function(){w(e);let n=u(2);return I(n.selectPaymentMethod("card"))}),l(1,"div",11)(2,"div",12),y(3,"input",13)(4,"span",14),c(),l(5,"div",41)(6,"div",15),p(7),g(8,"translate"),c(),l(9,"div",16),p(10),g(11,"translate"),c()()(),l(12,"div",42),y(13,"img",43),c(),b(14,jf,3,2,"div"),c()}if(t&2){let e=u(2);_("ngClass",ce(9,os,e.selectedPaymentMethod==="card",e.selectedPaymentMethod!=="card")),o(3),_("checked",e.selectedPaymentMethod==="card"),o(4),C(f(8,5,"ADMIN.BILLING.BILL.CARD_PAYMENT")),o(3),C(f(11,7,"ADMIN.BILLING.BILL.CARD_PAYMENT_DESC")),o(4),T(e.selectedPaymentMethod==="card"?14:-1)}}function qf(t,a){t&1&&(l(0,"div",53)(1,"span",54),p(2),g(3,"translate"),c()()),t&2&&(o(2),C(f(3,1,"ADMIN.BILLING.BILL.REBILL_LOADING_CARD")))}function Qf(t,a){if(t&1){let e=E();l(0,"div",45)(1,"btn-component",32),k("click",function(){w(e);let n=u(4);return I(n.addPaymentMethod())}),c()()}t&2&&(o(),_("buttonObject",G(1,Ql)))}function Kf(t,a){if(t&1){let e=E();l(0,"div",46)(1,"div",47),y(2,"img",55),l(3,"div",41)(4,"div",15),p(5),g(6,"translate"),c(),l(7,"div",49),p(8),g(9,"translate"),c()(),l(10,"div",47)(11,"span",50),k("click",function(){w(e);let n=u(4);return I(n.removeCard())}),p(12),g(13,"translate"),c(),l(14,"btn-component",56),k("click",function(){w(e);let n=u(4);return I(n.editCard())}),c()()()(),l(15,"div",51),p(16),g(17,"translate"),c()}if(t&2){let e=u(4);o(5),V("",f(6,8,"ADMIN.BILLING.BILL.CARD")," ",e.getCardBrand()),o(3),V("",f(9,10,"ADMIN.BILLING.ENDED")," ",e.getCardLastDigits()),o(4),C(f(13,12,"ADMIN.BILLING.REMOVE_CARD")),o(2),_("disabled",e.loadingCardUpdateLink)("buttonObject",F(16,Lf,e.loadingCardUpdateLink?"ADMIN.BILLING.BILL.REBILL_UPDATE_LINK_LOADING":"ADMIN.BILLING.EDIT_CARD")),o(2),D(" ",f(17,14,"ADMIN.BILLING.BILL.CARD_AUTO_PAY")," ")}}function Zf(t,a){if(t&1){let e=E();l(0,"div",44),k("click",function(n){w(e);let s=u(3);return I(s.stylingService.stopPropagation(n))}),b(1,qf,4,3,"div",53),b(2,Qf,2,2,"div",45),b(3,Kf,18,18),c()}if(t&2){let e=u(3);o(),T(e.loadingRebillCard?1:-1),o(),T(!e.loadingRebillCard&&!e.hasRegisteredCard()?2:-1),o(),T(!e.loadingRebillCard&&e.hasRegisteredCard()?3:-1)}}function Jf(t,a){if(t&1){let e=E();l(0,"div",10),k("click",function(){w(e);let n=u(2);return I(n.selectPaymentMethod("card"))}),l(1,"div",11)(2,"div",12),y(3,"input",13)(4,"span",14),c(),l(5,"div",41)(6,"div",15),p(7),g(8,"translate"),c(),l(9,"div",16),p(10),g(11,"translate"),c()()(),l(12,"div",42),y(13,"img",52),c(),b(14,Zf,4,3,"div"),c()}if(t&2){let e=u(2);_("ngClass",ce(9,os,e.selectedPaymentMethod==="card",e.selectedPaymentMethod!=="card")),o(3),_("checked",e.selectedPaymentMethod==="card"),o(4),C(f(8,5,"ADMIN.BILLING.BILL.CARD_PAYMENT")),o(3),C(f(11,7,"ADMIN.BILLING.BILL.CARD_PAYMENT_DESC")),o(4),T(e.selectedPaymentMethod==="card"?14:-1)}}function e_(t,a){t&1&&y(0,"div",59)}function t_(t,a){if(t&1){let e=E();l(0,"div",61),k("click",function(n){w(e);let s=u(3);return I(s.stylingService.stopPropagation(n))}),l(1,"btn-component",32),k("click",function(){w(e);let n=u(3);return I(n.openPaypalModal())}),c()()}t&2&&(o(),_("buttonObject",G(1,If)))}function i_(t,a){if(t&1){let e=E();l(0,"div",57),k("click",function(){w(e);let n=u(2);return I(!n.isPaypalBlocked&&n.selectPaymentMethod("paypal"))}),l(1,"div",11)(2,"div",7)(3,"div",58),b(4,e_,1,0,"div",59),c()(),l(5,"div",41)(6,"div",15),p(7),g(8,"translate"),c(),l(9,"div",16),p(10),g(11,"translate"),c()()(),l(12,"div",42),y(13,"img",60),c(),b(14,t_,2,2,"div",45),c()}if(t&2){let e=u(2);_("ngClass",Ls(10,Af,e.selectedPaymentMethod==="paypal",e.selectedPaymentMethod!=="paypal",e.isPaypalBlocked,!e.isPaypalBlocked)),o(3),_("ngClass",ce(15,wf,e.selectedPaymentMethod==="paypal",e.selectedPaymentMethod!=="paypal")),o(),T(e.selectedPaymentMethod==="paypal"?4:-1),o(3),C(f(8,6,"ADMIN.BILLING.BILL.PAYPAL_PAYMENT")),o(3),C(f(11,8,"ADMIN.BILLING.BILL.PAYPAL_PAYMENT_DESC")),o(4),T(e.selectedPaymentMethod==="paypal"?14:-1)}}function n_(t,a){if(t&1&&(p(0),g(1,"translate")),t&2){let e=u(3);V(" ",f(1,2,"ADMIN.BILLING.INVOICE_LABEL")," #",e.bill.siiNumber," ")}}function a_(t,a){if(t&1&&(p(0),g(1,"translate")),t&2){let e=u(3);V(" ",f(1,2,"ADMIN.BILLING.INVOICE_LABEL")," #",e.bill.invoiceNumber," ")}}function s_(t,a){if(t&1&&(p(0),g(1,"translate"),g(2,"formatDate")),t&2){let e=u(3);V(" ",f(1,2,"ADMIN.BILLING.EXPIRED_ON"),": ",f(2,4,e.bill.expirationDate)," ")}}function o_(t,a){if(t&1&&(p(0),g(1,"translate"),g(2,"formatDate")),t&2){let e=u(3);V(" ",f(1,2,"ADMIN.BILLING.DUE_ON"),": ",f(2,4,e.bill.expirationDate)," ")}}function r_(t,a){t&1&&(l(0,"div",66),p(1),g(2,"translate"),c()),t&2&&(o(),C(f(2,1,"ADMIN.BILLING.OVERDUE")))}function l_(t,a){t&1&&(l(0,"div",67),p(1),g(2,"translate"),c()),t&2&&(o(),C(f(2,1,"ADMIN.BILLING.TO_BE_DUE")))}function c_(t,a){if(t&1&&(y(0,"div",68),g(1,"translate")),t&2){let e=u(3);_("ngClass",F(4,Df,!!e.bill.billFiles))("innerHTML",f(1,2,"ADMIN.BILLING.PROCESSING_MESSAGE"),le)}}function d_(t,a){if(t&1&&(l(0,"div",22)(1,"div",62)(2,"div")(3,"div",63),b(4,n_,2,4),b(5,a_,2,4),c(),l(6,"div",16),b(7,s_,3,6),b(8,o_,3,6),c()(),l(9,"div",64)(10,"div",65),p(11),g(12,"formatNumber"),c(),b(13,r_,3,3,"div",66),b(14,l_,3,3,"div",67),c()(),b(15,c_,2,6,"div",68),l(16,"div",3)(17,"div",69)(18,"div",70)(19,"span",49),p(20),g(21,"translate"),c(),l(22,"span",15),p(23),g(24,"formatDate"),c()(),l(25,"div",70)(26,"span",49),p(27),g(28,"translate"),c(),l(29,"span",15),p(30),g(31,"translate"),c()(),y(32,"div",71),l(33,"div",70)(34,"span",49),p(35),g(36,"translate"),c(),l(37,"span",15),p(38),c()(),l(39,"div",70)(40,"span",49),p(41),g(42,"translate"),c(),l(43,"span",15),p(44,"Rindegastos Spa"),c()(),l(45,"a",72),y(46,"btn-component",73),c()()()()),t&2){let e=u(2);o(),_("ngClass",hi(35,kf,e.bill.expirationStatus==="PENDING"&&!e.bill.billFiles,!!e.bill.billFiles,e.bill.expirationStatus==="EXPIRED")),o(3),T(e.bill.siiNumber>0?4:-1),o(),T(!e.bill.siiNumber||e.bill.siiNumber<=0?5:-1),o(2),T(e.bill.expirationStatus==="EXPIRED"?7:-1),o(),T(e.bill.expirationStatus==="PENDING"?8:-1),o(3),V("",Le(12,20,e.bill.total,e.bill.currency)," ",e.displayCurrency(e.bill.currency)),o(2),T(e.bill.expirationStatus==="EXPIRED"?13:-1),o(),T(e.bill.expirationStatus==="PENDING"?14:-1),o(),T(e.bill.billFiles?15:-1),o(5),C(f(21,23,"ADMIN.BILLING.SITEPANNEL_BILL.ISSUANCE")),o(3),C(f(24,25,e.bill.documentDate)),o(4),C(f(28,27,"ADMIN.BILLING.BILL.PAYMENT_TERM")),o(3),V("",e.bill.paymentTerm," ",f(31,29,"ADMIN.BILLING.SITEPANNEL_BILL.DAYS")),o(5),C(f(36,31,"ADMIN.BILLING.SITEPANNEL_BILL.RECEIVER")),o(3),C(e.companyService.userCompany==null||e.companyService.userCompany.billingInfo==null?null:e.companyService.userCompany.billingInfo.biPContact),o(3),C(f(42,33,"ADMIN.BILLING.SITEPANNEL_BILL.TRANSMITTER")),o(4),_("href",e.bill.file,zt),o(),_("buttonObject",G(39,Kl))}}function p_(t,a){if(t&1&&(p(0),g(1,"translate")),t&2){let e=u().$implicit;V(" ",f(1,2,"ADMIN.BILLING.INVOICE_LABEL")," #",e.siiNumber," ")}}function h_(t,a){if(t&1&&(p(0),g(1,"translate")),t&2){let e=u().$implicit;V(" ",f(1,2,"ADMIN.BILLING.INVOICE_LABEL")," #",e.invoiceNumber," ")}}
28function m_(t,a){if(t&1&&(p(0),g(1,"translate"),g(2,"formatDate")),t&2){let e=u().$implicit;V(" ",f(1,2,"ADMIN.BILLING.EXPIRED_ON"),": ",f(2,4,e.expirationDate)," ")}}function u_(t,a){if(t&1&&(p(0),g(1,"translate"),g(2,"formatDate")),t&2){let e=u().$implicit;V(" ",f(1,2,"ADMIN.BILLING.DUE_ON"),": ",f(2,4,e.expirationDate)," ")}}function g_(t,a){t&1&&(l(0,"div",66),p(1),g(2,"translate"),c()),t&2&&(o(),C(f(2,1,"ADMIN.BILLING.OVERDUE")))}function f_(t,a){t&1&&(l(0,"div",67),p(1),g(2,"translate"),c()),t&2&&(o(),D(" ",f(2,1,"ADMIN.BILLING.TO_BE_DUE")," "))}function __(t,a){if(t&1){let e=E();l(0,"div",87)(1,"div",70)(2,"span",49),p(3),g(4,"translate"),c(),l(5,"span",15),p(6),g(7,"formatDate"),c()(),l(8,"div",70)(9,"span",49),p(10),g(11,"translate"),c(),l(12,"span",15),p(13),g(14,"translate"),c()(),y(15,"div",71),l(16,"div",70)(17,"span",49),p(18),g(19,"translate"),c(),l(20,"span",15),p(21),c()(),l(22,"div",70)(23,"span",49),p(24),g(25,"translate"),c(),l(26,"span",15),p(27,"Rindegastos Spa"),c()(),l(28,"btn-component",88),k("click",function(){w(e);let n=u().$implicit,s=u(3);return I(s.downloadBill(n))}),c()()}if(t&2){let e=u().$implicit,i=u(3);o(3),C(f(4,9,"ADMIN.BILLING.SITEPANNEL_BILL.ISSUANCE")),o(3),C(f(7,11,e.documentDate)),o(4),C(f(11,13,"ADMIN.BILLING.BILL.PAYMENT_TERM")),o(3),V("",e.paymentTerm," ",f(14,15,"ADMIN.BILLING.SITEPANNEL_BILL.DAYS")),o(5),C(f(19,17,"ADMIN.BILLING.SITEPANNEL_BILL.RECEIVER")),o(3),C(i.companyService.userCompany==null||i.companyService.userCompany.billingInfo==null?null:i.companyService.userCompany.billingInfo.biPContact),o(3),C(f(25,19,"ADMIN.BILLING.SITEPANNEL_BILL.TRANSMITTER")),o(4),_("buttonObject",G(21,Kl))}}function x_(t,a){if(t&1){let e=E();l(0,"div",76)(1,"div",77)(2,"div",78),k("click",function(n){let s=w(e).$implicit,r=u(3);return r.toggleBillSelection(s.id),I(r.stylingService.stopPropagation(n))}),y(3,"input",13)(4,"span",79),c(),l(5,"div",41)(6,"div",80)(7,"div",81)(8,"div",75),b(9,p_,2,4),b(10,h_,2,4),c(),l(11,"div",82),b(12,m_,3,6),b(13,u_,3,6),c()(),l(14,"div",64)(15,"div",65),p(16),g(17,"formatNumber"),c(),b(18,g_,3,3,"div",66),b(19,f_,3,3,"div",67),c()()()(),l(20,"div",83),k("click",function(){let n=w(e).$implicit,s=u(3);return I(s.toggleBillExpanded(n.id))}),l(21,"span",84),p(22),g(23,"translate"),g(24,"translate"),c(),l(25,"span",85),y(26,"icons-component",86),c()(),b(27,__,29,22,"div",87),c()}if(t&2){let e=a.$implicit,i=u(3);_("ngClass",ce(22,Ef,i.isBillSelected(e.id),!i.isBillSelected(e.id))),o(),_("ngClass",ce(25,Bf,e.expirationStatus==="PENDING",e.expirationStatus==="EXPIRED")),o(2),_("checked",i.isBillSelected(e.id)),o(6),T(e.siiNumber>0?9:-1),o(),T(!e.siiNumber||e.siiNumber<=0?10:-1),o(2),T(e.expirationStatus==="EXPIRED"?12:-1),o(),T(e.expirationStatus==="PENDING"?13:-1),o(3),V(" ",Le(17,15,e.total,e.currency)," ",i.displayCurrency(e.currency)," "),o(2),T(e.expirationStatus==="EXPIRED"?18:-1),o(),T(e.expirationStatus==="PENDING"?19:-1),o(3),D(" ",i.isBillExpanded(e.id)?f(23,18,"ADMIN.BILLING.BILL.VIEW_LESS_DATA"):f(24,20,"ADMIN.BILLING.BILL.VIEW_MORE_DATA")," "),o(3),_("ngClass",F(28,Nf,i.isBillExpanded(e.id))),o(),_("type","chevronDown"),o(),T(i.isBillExpanded(e.id)?27:-1)}}function v_(t,a){if(t&1&&(l(0,"div",74)(1,"div",75),p(2),g(3,"translate"),c(),l(4,"div",75),p(5),g(6,"formatNumber"),c()(),l(7,"div",69),Ie(8,x_,28,30,"div",76,we),c()),t&2){let e=u(2);o(2),V("",f(3,4,"ADMIN.BILLING.BILL.SELECTED_BILLS")," (",e.selectedBillIds.size,")"),o(3),V("",Le(6,6,e.getSelectedTotal(),e.getSelectedCurrency())," ",e.getSelectedCurrency()),o(3),ke(e.unpaidBills)}}function C_(t,a){if(t&1){let e=E();l(0,"div",3)(1,"div",5)(2,"div",6),b(3,Ff,2,3),b(4,Rf,2,3),c(),b(5,Vf,3,2,"div",7),l(6,"div",8)(7,"div",9)(8,"div",10),k("click",function(){w(e);let n=u();return I(n.selectPaymentMethod("transfer"))}),l(9,"div",11)(10,"div",12),y(11,"input",13)(12,"span",14),c(),l(13,"div")(14,"div",15),p(15),g(16,"translate"),c(),l(17,"div",16),p(18),g(19,"translate"),c()()(),b(20,zf,21,15),c(),b(21,Uf,15,12,"div",17),b(22,Jf,15,12,"div",17),b(23,i_,15,18,"div",18),l(24,"div",19),p(25),g(26,"translate"),l(27,"a",20),p(28,"[email protected]"),c()()(),l(29,"div",21),b(30,d_,47,40,"div",22),b(31,v_,10,9),c()()()()}if(t&2){let e=u();o(3),T(e.hasUploadedReceipt?-1:3),o(),T(e.hasUploadedReceipt?4:-1),o(),T(e.hasUploadedReceipt?-1:5
28),o(3),_("ngClass",ce(20,os,e.selectedPaymentMethod==="transfer",e.selectedPaymentMethod!=="transfer")),o(3),_("checked",e.selectedPaymentMethod==="transfer"),o(4),C(f(16,14,"ADMIN.BILLING.BILL.BANK_TRANSFER")),o(3),C(f(19,16,"ADMIN.BILLING.BILL.BANK_TRANSFER_DESC")),o(2),T(e.selectedPaymentMethod==="transfer"?20:-1),o(),T(e.showMercadoPago?21:-1),o(),T(e.showRebill?22:-1),o(),T(e.showPaypal?23:-1),o(2),D(" ",f(26,18,"ADMIN.BILLING.BILL.HELP_TEXT")," "),o(5),T(e.isSingleInvoice&&e.bill?30:-1),o(),T(e.isMultiInvoice?31:-1)}}var Zl=(()=>{class t{constructor(e,i,n,s,r,d,m,h,x,v,L,A,B,N,P,re){this.translate=e,this.snackService=i,this.router=n,this.route=s,this.stylingService=r,this.fileManagerService=d,this.companyService=m,this.globalModalService=h,this.alertService=x,this.billingService=v,this.mercadopagoService=L,this.kushkiService=A,this.rebillService=B,this.cardBrandService=N,this.logsManagementService=P,this.exclusionService=re,this.cdr=Q(U),this.CountryPlans=$,this.selectedPaymentMethod=null,this.uploadingReceipt=!1,this.loadingCardUpdateLink=!1,this.loadingRebillCard=!1,this.cardType=null,this.rebillCardData=null,this.isSingleInvoice=!1,this.isMultiInvoice=!1,this.unpaidBills=[],this.selectedBillIds=new Set,this.expandedBillId=null,this.warningAlert={},this.bankData=[],this.loading=!1}async ngOnInit(){if(this.params=this.globalModalService.params,this.bill=this.params?.bill,!this.bill){this.loading=!0,this.cdr.markForCheck();let e=this.route.snapshot.params.id;e&&(this.billingService.companyBills?.length||await this.billingService.getCompanyBills(0,100,!1),this.bill=this.billingService.companyBills.find(i=>i.id===e||Number(i.id)===+e)),this.loading=!1,this.cdr.markForCheck()}this.unpaidBills=(this.billingService.companyBills||[]).filter(e=>e.expirationStatus===Ee.EXPIRED||e.expirationStatus===Ee.PENDING),this.unpaidBills.length<=1?(this.isSingleInvoice=!0,this.unpaidBills.length===0&&this.bill&&(this.unpaidBills=[this.bill])):this.isMultiInvoice=!0,this.isSingleInvoice&&this.bill?.billFiles?.length>0&&(this.selectedPaymentMethod="transfer"),this.setBankData(),this.detectCardType(),this.loadRebillCard(),this.modalEventsSub=this.globalModalService.loadEventsFromModals$.subscribe(e=>{e?.type==="rebillCardUpdated"&&this.loadRebillCard(),this.cdr.markForCheck()})}ngOnDestroy(){this.modalEventsSub?.unsubscribe()}async loadRebillCard(){if(this.showRebill){this.loadingRebillCard=!0,this.cdr.markForCheck();try{let e=await this.rebillService.getRebillCard();e?.card&&(this.rebillCardData={last4:e.card.lastFour||"****",brand:e.card.brand||"Card"},this.detectCardType())}catch{this.rebillCardData=null}finally{this.loadingRebillCard=!1,this.cdr.markForCheck()}}}syncUnpaidBillsFromService(){if(this.unpaidBills=(this.billingService.companyBills||[]).filter(e=>e.expirationStatus===Ee.EXPIRED||e.expirationStatus===Ee.PENDING),this.bill?.id){let e=this.billingService.companyBills.find(i=>i.id===this.bill.id);e&&(this.bill=e)}}async refreshUnpaidBills(){await this.billingService.getCompanyBills(0,100,!1),this.syncUnpaidBillsFromService()}get hasUploadedReceipt(){return this.isSingleInvoice?this.bill?.billFiles?.length>0:this.isMultiInvoice&&this.selectedBillIds.size>0?this.unpaidBills.filter(i=>this.selectedBillIds.has(i.id)).some(i=>i.billFiles?.length>0):!1}goToBilling(){this.router.navigate(["/admin/billing"])}get showMercadoPago(){let e=this.companyService.userCompany?.paymentPlan?.currency,i=this.companyService.userCompany?.countryId;return(e==="CLP"||e==="CLF")&&i===$.CHILE}get showRebill(){return this.companyService.userCompany?.countryId===$.ARGENTINA}get showPaypal(){let e=this.companyService.userCompany;if(this.exclusionService.isPaypalAlwaysVisible(e?.id))return!0;let i=this.bill?.currency,n=e?.countryId;return i==="USD"&&n!==$.ARGENTINA}get isPaypalAlwaysEnabled(){return this.exclusionService.isPaypalAlwaysVisible(this.companyService.userCompany?.id)}get isPaypalDisabled(){return this.isMultiInvoice?this.isPaypalAlwaysEnabled?this.selectedBillIds.size>1:this.selectedBillIds.size!==1:!1}get isPaypalBlocked(){return this.isPaypalDisabled||!this.isPaypalAlwaysEnabled&&this.hasUploadedReceipt}selectPaymentMethod(e){this.selectedPaymentMethod=e}setBankData(){switch(this.companyService.userCompany?.countryId){case $.CHILE:this.bankData=[{label:this.translate.instant("ADMIN.BILLING.BILL.NAME"),value:"Rindegastos SpA."},{label:"RUT",value:"76271948-7"},{label:this.translate.instant("ADMIN.BILLING.BILL.CURRENCY"),value:"CLP"},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK"),value:"Banco de Cr\xE9dito e Inversiones"},{label:this.translate.instant("ADMIN.BILLING.BILL.TYPE_ACCOUNT"),value:this.translate.instant("ADMIN.BILLING.ACCOUNT_TYPE_CHECKING")},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK_ACCOUNT_NUMBER"),value:"70082987"},{label:this.translate.instant("ADMIN.BILLING.BILL.CONFIRMATION_EMAIL"),value:"[email protected]"}];break;case $.PERU:this.bankData=[{label:this.translate.instant("ADMIN.BILLING.BILL.COMPANY"),value:"Rindegastos Per\xFA S.A.C."}
28,{label:"RUC",value:"0604204969"},{label:this.translate.instant("ADMIN.BILLING.BILL.CURRENCY"),value:"PEN"},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK"),value:"Scotiabank"},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK_ACCOUNT_NUMBER"),value:"0007439423"},{label:"CCI",value:"009-045-000007439423-60"},{label:this.translate.instant("ADMIN.BILLING.BILL.CONFIRMATION_EMAIL"),value:"[email protected]"}];break;case $.COLOMBIA:this.bankData=[{label:this.translate.instant("ADMIN.BILLING.BILL.COMPANY"),value:"Rindegastos Colombia SAS"},{label:"NIT",value:"901609691-3"},{label:this.translate.instant("ADMIN.BILLING.BILL.CURRENCY"),value:"COP"},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK"),value:"Bancolombia"},{label:this.translate.instant("ADMIN.BILLING.BILL.TYPE_ACCOUNT"),value:this.translate.instant("ADMIN.BILLING.ACCOUNT_TYPE_SAVINGS")},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK_ACCOUNT_NUMBER"),value:"915000002638"},{label:this.translate.instant("ADMIN.BILLING.BILL.CONFIRMATION_EMAIL"),value:"[email protected]"}];break;case $.ARGENTINA:this.bankData=[{label:this.translate.instant("ADMIN.BILLING.BILL.COMPANY"),value:"Rindegastos Argentina SRL"},{label:"CUIT",value:"30-71822500-7"},{label:this.translate.instant("ADMIN.BILLING.BILL.CURRENCY"),value:"ARS"},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK"),value:"BBVA"},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK_CURRENT_ACCOUNT"),value:"099723826/0"},{label:"CBU",value:"0170099220000072382602"},{label:this.translate.instant("ADMIN.BILLING.BILL.CONFIRMATION_EMAIL"),value:"[email protected]"}];break;case $.MEXICO:this.bankData=[{label:this.translate.instant("ADMIN.BILLING.BILL.COMPANY"),value:"Rindegastos Mexico, S. DE R.L. DE C.V."},{label:"RFC",value:"RME2110049A3"},{label:this.translate.instant("ADMIN.BILLING.BILL.CURRENCY"),value:"MXN"},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK"),value:"BBVA"},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK_ACCOUNT_NUMBER"),value:"00740812940118547645"},{label:this.translate.instant("ADMIN.BILLING.BILL.CLABE_ACCOUNT_NUMBER"),value:"012180001185476453"},{label:this.translate.instant("ADMIN.BILLING.BILL.CONFIRMATION_EMAIL"),value:"[email protected]"}];break;default:this.bankData=[{label:this.translate.instant("ADMIN.BILLING.BILL.BENEFICIARY_NAME"),value:"Rindegastos SPA"},{label:this.translate.instant("ADMIN.BILLING.BILL.BENEFICIARY_ADDRESS"),value:"Apoquindo 5950, oficina 1701, Las Condes, Santiago de Chile"},{label:this.translate.instant("ADMIN.BILLING.BILL.BANK"),value:"Banco Credito e Inversiones"},{label:this.translate.instant("ADMIN.BILLING.BILL.ADDRESS"),value:"El Golf #125, Las Condes, 7550077, Santiago, Chile"},{label:"Swift",value:"CREDCLRM"},{label:this.translate.instant("ADMIN.BILLING.BILL.BENEFICIARY_ACCOUNT_NUMBER"),value:"18598862"},{label:this.translate.instant("ADMIN.BILLING.BILL.CONFIRMATION_EMAIL"),value:"[email protected]"}];break}}getIntermediaryBankData(){return[{label:this.translate.instant("ADMIN.BILLING.BILL.BANK"),value:"Wells Fargo Bank"},{label:this.translate.instant("ADMIN.BILLING.BILL.ADDRESS"),value:"New York, USA"},{label:"Swift",value:"PNBPUS3NNY"},{label:"ABA",value:"C026005092"},{label:this.translate.instant("ADMIN.BILLING.BILL.ACCOUNT"),value:"20000192291712"}]}isInternational(){let e=this.companyService.userCompany?.countryId;return e!==$.CHILE&&e!==$.PERU&&e!==$.COLOMBIA&&e!==$.ARGENTINA&&e!==$.MEXICO}copyBankData(){let e=this.bankData.map(i=>`${i.label}: ${i.value}`).join(` 29`);navigator.clipboard.writeText(e).then(()=>{let i={type:"success",message:this.translate.instant("ADMIN.BILLING.BILL.COPY_MESSAGE_SUCCES")};this.snackService.showSnackNotification(i)}).catch(()=>{let i={type:"error",message:this.translate.instant("ADMIN.BILLING.BILL.COPY_MESSAGE_ERROR")};this.snackService.showSnackNotification(i)})}copyIntermediaryBankData(){let i=this.getIntermediaryBankData().map(n=>`${n.label}: ${n.value}`).join(` 30`);navigator.clipboard.writeText(i).then(()=>{let n={type:"success",message:this.translate.instant("ADMIN.BILLING.BILL.COPY_MESSAGE_SUCCES")};this.snackService.showSnackNotification(n)}).catch(()=>{let n={type:"error",message:this.translate.instant("ADMIN.BILLING.BILL.COPY_MESSAGE_ERROR")};this.snackService.showSnackNotification(n)})}async onTransferReceiptSelected(e){let i=e.target;if(!i.files||i.files.length===0)return;let n=i.files[0],s=this.isMultiInvoice?Array.from(this.selectedBillIds):this.bill?.id?[this.bill.id]:[];if(s.length===0)return;this.uploadingReceipt=!0;let r=await this.billingService.uploadBillTransferReceipt(s,n);if(this.uploadingReceipt=!1,r)await this.refreshUnpaidBills(),await this.alertService.info({title:this.translate.instant("ADMIN.BILLING.BILL.UPLOAD_SUCCESS_TITLE"),message:this.translate.instant("ADMIN.BILLING.BILL.UPLOAD_SUCCESS_MESSAGE"),confirmButton:this.translate.instant("ADMIN.BILLING.BILL.UNDERSTOOD"),showDenyButton:!1});else{let d={type:"error",message:this.translate.instant("ADMIN.BILLING.BILL.UPLOAD_ERROR")};this.snackService.showSnackNotification(d)}i.value=""}addPaymentMethod(){this.globalModalService.params={type:"paymentMethod",styles:"modal-background",component:Hi,paymentProvider:this.showRebill?"rebill":"mercadopago"},this.globalModalService.showModal()}
30detectCardType(){if(this.rebillCardData){this.cardType=this.rebillCardData.brand;return}let i=this.companyService.userCompany?.paymentPlan?.kushkiInfo;i?.isKushki===1&&i?.cardLastDigits&&(this.cardType=this.cardBrandService.detectBrand(i.cardLastDigits)??tt.MASTERCARD)}hasRegisteredCard(){if(this.rebillCardData)return!0;let e=this.companyService.userCompany?.paymentPlan;return e?.kushkiInfo?.isKushki===1||!!e?.subscriptionId}getCardLastDigits(){return this.rebillCardData?this.rebillCardData.last4:this.companyService.userCompany?.paymentPlan?.kushkiInfo?.cardLastDigits||"****"}getCardBrand(){return this.cardType||tt.MASTERCARD}isRebillCard(){return!!this.rebillCardData}isMercadoPagoCard(){return!!this.companyService.userCompany?.paymentPlan?.subscriptionId}async removeCard(){if(this.warningAlert.title=this.translate.instant("ADMIN.BILLING.BILL.REMOVE_CARD_WARNING_TITLE"),this.warningAlert.message=this.translate.instant("ADMIN.BILLING.BILL.REMOVE_CARD_WARNING_MESSAGE"),this.warningAlert.confirmButton=this.translate.instant("ADMIN.BILLING.BILL.REMOVE_CARD_CONFIRM"),this.warningAlert.cancelButton=this.translate.instant("MESSAGE_ALERT.CANCEL_BUTTON"),await this.alertService.warning(this.warningAlert),this.alertService.confirmedAlert)try{this.isRebillCard()?(await this.rebillService.disableSubscription(),this.rebillCardData=null):this.isMercadoPagoCard()?await this.mercadopagoService.disableSubscriptionMercadoPago():await this.kushkiService.disableSubscriptionKushki(),await this.companyService.getUserCompany(this.companyService.userCompany.id),this.detectCardType(),this.logsManagementService.registerCompanyLog(Ke.BILLING_CARD_REMOVED,{});let e={type:"success",message:this.translate.instant("ADMIN.BILLING.BILL.REMOVE_CARD_SUCCESS")};this.snackService.showSnackNotification(e)}catch{let e={type:"error",message:this.translate.instant("ADMIN.BILLING.BILL.REMOVE_CARD_ERROR")};this.snackService.showSnackNotification(e)}}async editCard(){if(this.isRebillCard()){this.loadingCardUpdateLink=!0,this.cdr.markForCheck();try{let e=await this.rebillService.createCardUpdateLink();if(this.loadingCardUpdateLink=!1,this.cdr.markForCheck(),e?.url)ta(e.url,"_blank");else{let i={type:"error",message:this.translate.instant("ADMIN.BILLING.BILL.REBILL_UPDATE_LINK_ERROR")};this.snackService.showSnackNotification(i)}}catch{this.loadingCardUpdateLink=!1,this.cdr.markForCheck();let e={type:"error",message:this.translate.instant("ADMIN.BILLING.BILL.REBILL_UPDATE_LINK_ERROR")};this.snackService.showSnackNotification(e)}}else this.addPaymentMethod()}downloadBill(e){let i=e||this.bill;i?.file&&(i.file.includes("https://web.rindegastos.com/download/")?ta(i.file,"_blank"):this.fileManagerService.downloadFile(i.file))}openPaypalModal(){let e=this.bill;this.isMultiInvoice&&this.selectedBillIds.size===1&&(e=this.unpaidBills.find(i=>this.selectedBillIds.has(i.id))),e&&(this.globalModalService.params={type:"paypalPayment",styles:"modal-background",component:jn,bill:e},this.globalModalService.showModal())}toggleBillSelection(e){this.selectedBillIds.has(e)?this.selectedBillIds.delete(e):this.selectedBillIds.add(e),this.selectedPaymentMethod==="paypal"&&this.isPaypalDisabled&&(this.selectedPaymentMethod=null)}isBillSelected(e){return this.selectedBillIds.has(e)}getSelectedTotal(){return this.unpaidBills.filter(e=>this.selectedBillIds.has(e.id)).reduce((e,i)=>e+(Number(i.total)||0),0)}getSelectedCurrency(){return this.unpaidBills.find(i=>this.selectedBillIds.has(i.id))?.currency||this.unpaidBills[0]?.currency||"CLP"}displayCurrency(e){return e==="CLF"?"UF":e}toggleBillExpanded(e){this.expandedBillId=this.expandedBillId===e?null:e}isBillExpanded(e){return this.expandedBillId===e}generateMailTo(e){let n="#"+(this.bill?.siiNumber||this.bill?.invoiceNumber||"")+"-"+this.translate.instant("ADMIN.BILLING.BILL.VOUCHER");window.location.href=js(e,{subject:n})}static{this.\u0275fac=function(i){return new(i||t)(S(ee),S(Ue),S(He),S(ks),S(fe),S(Kt),S(j),S(K),S(Zi),S(ft),S(ci),S(At),S(di),S(pi),S(ot),S(Ki))}}static{this.\u0275cmp=O({type:t,selectors:[["app-bill"]],viewQuery:function(i,n){if(i&1&&De(Cf,5),i&2){let s;
30Te(s=Se())&&(n.bankDataRef=s.first)}},standalone:!1,decls:3,vars:2,consts:[["bankDataRef",""],["receiptInput",""],[1,"flex","justify-center","items-center","py-48"],[1,"p-24"],[1,"spinner-b","abs","big","inline"],[1,"bg-white","rounded-10","p-24"],[1,"text-blue","bigger","font-bold"],[1,"mt-1"],[1,"flex","gap-24","mt-24"],[1,"flex-[6]","flex","flex-col","gap-24"],[1,"border","rounded-10","p-24","cursor-pointer","transition-all",3,"click","ngClass"],[1,"flex","items-start","gap-3"],[1,"checkCircle","mt-1"],["type","checkbox","hidden","",3,"checked"],[1,"checkmarkCircle"],[1,"font-bold"],[1,"text-gray-500","mt-1"],[1,"border","rounded-10","p-24","cursor-pointer","transition-all",3,"ngClass"],[1,"border","rounded-10","p-24","transition-all",3,"ngClass"],[1,"text-gray-500","text-center","mt-2"],["href","mailto:[email protected]",1,"text-blue"],[1,"flex-[4]"],[1,"border","rounded-10"],[1,"mt-5","border","rounded-10","p-24","bg-blueLight",3,"click"],[1,"flex","justify-between","items-center"],[1,"text-blue","font-bold"],[1,"flex","items-center","gap-10","text-blue","cursor-pointer",3,"click"],["type","copyBlueIcon"],[1,"flex","flex-wrap","gap-y-24","mt-24"],[1,"w-1/2"],[1,"mt-24","border","rounded-10","p-24","bg-blueLight"],[1,"flex","flex-col","items-center","mt-5","gap-3",3,"click"],[3,"click","buttonObject"],["type","file","accept",".pdf,.png,.jpg,.jpeg",2,"display","none",3,"change"],[1,"text-center","text-[12px]","text-gray-400","lh-140","px-6",3,"innerHTML"],[1,""],[1,"mt-24","border","rounded-10","p-24","bg-blueLight",3,"click"],[1,"w-full"],[1,"mt-4",3,"click"],[3,"params"],[1,"mt-3",3,"click"],[1,"flex-1"],[1,"bg-blueLight","rounded-10","flex","justify-center","items-center","py-3","mt-3"],["src","../../../../../../assets/images/mercadoPago.png","alt","Mercado Pago",1,"h-24"],[3,"click"],[1,"mt-24","flex","justify-center","items-center"],[1,"mt-24","border","rounded-10","p-24","bg-white"],[1,"flex","items-center","gap-10"],["src","../../../../../../assets/svg-icons/masterCardIcon.svg","alt","Card",1,"w-10","h-10"],[1,"text-gray-500"],[1,"text-red","cursor-pointer","font-bold",3,"click"],[1,"small","text-gray-400","text-center","mt-24","lh-140"],["src","../../../../../../assets/images/rebill.png","alt","Rebill",1,"h-24"],[1,"mt-24","flex","justify-center","items-center","py-4"],[1,"text-gray-400"],["src","../../../../../../assets/images/rebill.png","alt","Rebill",1,"w-10","h-10"],[3,"click","disabled","buttonObject"],[1,"border","rounded-10","p-24","transition-all",3,"click","ngClass"],[1,"w-5","h-5","rounded-full","border-2","flex","items-center","justify-center",3,"ngClass"],[1,"w-3","h-3","rounded-full","bg-blue"],["src","../../../../../../assets/images/paypal.png","alt","PayPal",1,"h-24"],[1,"mt-24","flex","justify-center","items-center",3,"click"],[1,"p-24","flex","justify-between","items-start","rounded-t-10",3,"ngClass"],[1,"text-blue","font-bold","big"],[1,"text-right"],[1,"font-bold","text-blue","big"],[1,"rgChip-static-r","mt-1"],[1,"rgChip-static-y","mt-1"],[1,"small","text-black70","text-center","border-t","p-24",3,"ngClass","innerHTML"],[1,"flex","flex-col","gap-24"],[1,"flex","justify-between"],[1,"hrDivider"],["target","_blank",1,"inline-block","w-fit","m-auto",3,"href"],[1,"m-auto",3,"buttonObject"],[1,"flex","justify-between","items-center","mb-24"],[1,"text-blue","big","font-bold"],[1,"rounded-10","overflow-hidden","transition-all",3,"ngClass"],[1,"p-24","flex","items-center","gap-24",3,"ngClass"],[1,"checkCircle","flex","items-center",2,"width","24px","height","24px",3,"click"],[1,"checkmarkCircle","rounded-[4px]",2,"width","20px","height","20px"],[1,"flex","justify-between","items-start"],[1,"flex","flex-col","gap-8"],[1,"small","mt-1"],[1,"px-24","py-8","border-t","flex","justify-between","items-center","cursor-pointer","bg-blueLight",3,"click"],[1,"text-blue"],[3,"ngClass"],[3,"type"],[1,"p-24","bg-white","border-t","flex","flex-col","gap-24"],[1,"m-auto",3,"click","buttonObject"]],template:function(i,n){i&1&&(y(0,"app-breadcrumbs"),b(1,Mf,2,0,"div",2),b(2,C_,32,23,"div",3)),i&2&&(o(),T(n.loading?1:-1),o(),T(n.loading?-1:2))},dependencies:[Zt,Ge,me,an,he,te,Qt,gt],encapsulation:2,changeDetection:0})}}return t})();var y_=[{path:"",component:Xl,data:{breadcrumb:"ADMIN.BILLING.BILLING"},children:[{path:"",component:Wn},{path:"activity",component:Hn,data:{breadcrumb:[{label:"ADMIN.BILLING.BILLING",url:"/admin/billing"},{label:"ADMIN.BILLING.ACTIVITY"}]}}]},{path:"bill/:id",component:Zl,data:{moduleName:"billing",breadcrumb:[{label:"ADMIN.BILLING.BILLING",url:"/admin/billing"},{label:"ADMIN.BILLING.BILL.PAYMENT"}]}},{path:"",redirectTo:"/admin/billing",pathMatch:"full"},{path:"*",redirectTo:"/admin/billing",pathMatch:"full"}],Jl=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[ui.forChild(y_),ui]})}}return t})();var S_=[rn,$n],OA=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=ne({imports:[Zt,Xn,Jl,on,Dl,ui,S_]})}}return t})();export{OA as BillingModuleModule};
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.