import{a as ht}from"./chunk-A5D23SNU.js";import{a as D,b as w,d as ot,f as q,g as F,h as _,i as U,m as lt,n as W,p as M,s as Z,u as dt,v as ct}from"./chunk-JNXLVPIF.js";import{Ea as st,e as G,l as it,vb as nt}from"./chunk-YSQLW2JA.js";import{ra as St}from"./chunk-NVJ2ZZFT.js";import{Aa as N,Dc as y,Qf as et,_a as H,bb as K,cd as Q,dd as tt,g as Nt,gg as at,hg as rt,wa as J,ya as Y}from"./chunk-SKPDQO4E.js";var pt=`<div class="view-container">
    <div class="row">
        <div class="col-xl-12">
            <armon-date-picker [options]="datePickerOptions" (selectionChanged)="onDateSelectionChanged($event)"
                #datePicker></armon-date-picker>
        </div>
    </div>
    <div class="row" *ngIf="visibleComponent">
        <div class="col-12 col-sm-12 col-md-6 col-lg-4">
            <div class="analysis-pie-chart-container">
                <div class="info-area">
                    <span class="title">{{'ANALYZE.VISITOR_PRE_REGISTRATION_RATIO'|translate}}</span>
                    <span class="count">{{registrationRatioChartData.values[0]}}</span>
                    <span class="count-label mb-3">{{'ANALYZE.VISITOR_PRE_REGISTRATION_COUNTS'|translate}}</span>
                    <span class="count">{{registrationRatioChartData.values[1]}}</span>
                    <span class="count-label">{{'ANALYZE.VISITOR_NO_PRE_REGISTRATION_COUNTS'|translate}}</span>
                </div>
                <div class="chart-area">
                    <d3-pie-chart [chartData]="registrationRatioChartData" [chartLabels]="registrationRatioChartLabels"
                        [chartColors]="registrationRatioChartColors" [chartOptions]="pieChartOptions"
                        (valueClicked)="onValueClicked($event)"></d3-pie-chart>
                </div>
            </div>
        </div>
        <div class="col-12 col-sm-12 col-md-6 col-lg-4">
            <div class="analysis-pie-chart-container">
                <div class="info-area">
                    <span class="title">{{'ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_RATIO'|translate}}</span>
                    <span class="count">{{preRegistrationRatioChartData.values[0]}}</span>
                    <span
                        class="count-label mb-3">{{'ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_COUNTS'|translate}}</span>
                    <span class="count">{{preRegistrationRatioChartData.values[1]}}</span>
                    <span class="count-label">{{'ANALYZE.VISITOR_PRE_REGISTRATION_EXPIRED_COUNTS'|translate}}</span>
                </div>
                <div class="chart-area">
                    <d3-pie-chart [chartData]="preRegistrationRatioChartData"
                        [chartLabels]="preRegistrationRatioChartLabels" [chartColors]="preRegistrationRatioChartColors"
                        [chartOptions]="pieChartOptions" (valueClicked)="onValueClicked($event)"></d3-pie-chart>
                </div>
            </div>
        </div>
        <div class="col-12 col-sm-12 col-md-6 col-lg-4">
            <div class="analysis-pie-chart-container">
                <div class="info-area">
                    <span class="title">{{'ANALYZE.VISITOR_PRE_REGISTRATION_OWNER_RATIO'|translate}}</span>
                    <span class="count">{{ownerPreRegistrationRatioChartData.values[0]}}</span>
                    <span
                        class="count-label mb-3">{{'ANALYZE.VISITOR_PRE_REGISTRATION_PERSONNEL_COUNTS'|translate}}</span>
                    <span class="count">{{ownerPreRegistrationRatioChartData.values[1]}}</span>
                    <span class="count-label">{{'ANALYZE.VISITOR_PRE_REGISTRATION_SECURITY_COUNTS'|translate}}</span>
                </div>
                <div class="chart-area">
                    <d3-pie-chart [chartData]="ownerPreRegistrationRatioChartData"
                        [chartLabels]="ownerPreRegistrationRatioChartLabels"
                        [chartColors]="ownerPreRegistrationRatioChartColors" [chartOptions]="pieChartOptions"
                        (valueClicked)="onValueClicked($event)"></d3-pie-chart>
                </div>
            </div>
        </div>
    </div>
    <div class="row d-sm-none">
        <div class="col-xl-12">
            <div class="analysis-direction-container">
                <cds-icon class="analysis-direction-icon" shape="rotate_landscape" size="xxl"></cds-icon>
                <div class="analysis-direction-label">{{'ANALYZE.MOBILE_LANDSCAPE_DIRECTION'|translate}}</div>
            </div>
        </div>
    </div>
    <div class="row d-none d-sm-block" *ngIf="request">
        <div class="col-12">
            <div class="analysis-segment-area">
                <cds-icon shape="bar-chart" class="me-2" size=16></cds-icon>
                <div class="btn-group btn-group-sm filter-button-group">
                    <button class="btn"
                        [ngClass]="{'btn-primary': request.segmentType==1, 'btn-outline-primary': request.segmentType!=1}"
                        (click)="onSegmentChanged(1)">{{'REPORT.TEMPLATE_INTERVAL_DAILY' | translate}}</button>
                    <button class="btn"
                        [ngClass]="{'btn-primary': request.segmentType==2, 'btn-outline-primary': request.segmentType!=2}"
                        (click)="onSegmentChanged(2)">{{'REPORT.TEMPLATE_INTERVAL_WEEKLY' | translate}}</button>
                    <button class="btn"
                        [ngClass]="{'btn-primary': request.segmentType==3, 'btn-outline-primary': request.segmentType!=3}"
                        (click)="onSegmentChanged(3)">{{'REPORT.TEMPLATE_INTERVAL_MONTHLY' | translate}}</button>
                </div>
            </div>
        </div>
    </div>
    <div class="row d-none d-sm-block" *ngIf="visibleComponent">
        <div class="col-12">
            <div class="analysis-bar-chart-container">
                <div class="header-area">
                    <span class="title">{{'ANALYZE.VISITOR_PRE_REGISTRATION_RATIO'|translate}}</span>
                </div>
                <div class="chart-area">
                    <d3-grouped-bar-chart [chartData]="registrationChartData" [chartColors]="registrationChartColors"
                        [chartLabels]="registrationChartLabels" [chartOptions]="barChartOptions"
                        [groupingElement]="registrationGroupingElement">
                    </d3-grouped-bar-chart>
                </div>
            </div>
        </div>
    </div>
    <div class="row d-none d-sm-block" *ngIf="visibleComponent">
        <div class="col-12">
            <div class="analysis-bar-chart-container">
                <div class="header-area">
                    <span class="title">{{'ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_RATIO'|translate}}</span>
                </div>
                <div class="chart-area">
                    <d3-grouped-bar-chart [chartData]="preRegistrationChartData" [legendLabelWidth]="165"
                        [chartColors]="preRegistrationChartColors" [chartLabels]="preRegistrationChartLabels"
                        [chartOptions]="barChartOptions" [groupingElement]="registrationGroupingElement">
                    </d3-grouped-bar-chart>
                </div>
            </div>
        </div>
    </div>
    <div class="row d-none d-sm-block" *ngIf="visibleComponent">
        <div class="col-12">
            <div class="analysis-bar-chart-container">
                <div class="header-area">
                    <span class="title">{{'ANALYZE.VISITOR_PRE_REGISTRATION_OWNER_RATIO'|translate}}</span>
                </div>
                <div class="chart-area">
                    <d3-grouped-bar-chart [chartData]="ownerPreRegistrationChartData" [legendLabelWidth]="155"
                        [chartColors]="ownerPreRegistrationChartColors" [chartLabels]="ownerPreRegistrationChartLabels"
                        [chartOptions]="barChartOptions" [groupingElement]="registrationGroupingElement">
                    </d3-grouped-bar-chart>
                </div>
            </div>
        </div>
    </div>
</div>`;var gt=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}
`;var Rt='<div #container class="chart-container"></div>';var ut=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}:host{width:100%;height:100%}:host .chart-container{width:100%;height:100%}:host::ng-deep .axis-x .tick text{font-size:.32rem}:host::ng-deep .mean{stroke-width:2px;stroke-dasharray:2}:host::ng-deep .line{fill:none;stroke:#3b3b3b;stroke-width:2}:host::ng-deep .dot{fill:#3b3b3b;stroke:#bfbfbf}
`;var mt=Nt(St());var Dt=function(b,t,i,l){var d=arguments.length,s=d<3?t:l===null?l=Object.getOwnPropertyDescriptor(t,i):l,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(b,t,i,l);else for(var o=b.length-1;o>=0;o--)(n=b[o])&&(s=(d<3?n(s):d>3?n(t,i,s):n(t,i))||s);return d>3&&s&&Object.defineProperty(t,i,s),s},j=class extends ct{interactionService;xTickFunction;averageValue;margin;groupingElement;trendlineActive=!1;yLabelTextOptions;legendLabelWidth=90;defaultChartOptions={type:D.GroupedBarChart,drawAfterResize:!0,marginTop:20,marginBottom:50,marginLeft:40,marginRight:20,legendWidth:130,legendAnimationDuration:300,tooltipAnimationDuration:300};constructor(t){super(t),this.interactionService=t,this.chart=this}onInit(){}onDestroy(){}onDataUpdated(){this.drawChart()}onColorsUpdated(){this.drawChart()}onLabelsUpdated(){this.drawChart()}onOptionsUpdated(){this.drawChart()}onAfterViewInit(){this.drawChart()}onResized(){this.drawChart()}drawChart(){let t=this.chartData;if(!t||!t.data||t.keys.length==0)return;this.host.html("");let i={top:this.defaultChartOptions.marginTop,right:this.defaultChartOptions.marginRight,bottom:this.defaultChartOptions.marginBottom,left:this.defaultChartOptions.marginLeft},l=25;this.svg=this.host.append("svg").attr("width","100%").attr("height","100%");var d=this.host.node().getBoundingClientRect();let s=d.width-i.left-i.right-this.defaultChartOptions.legendWidth,n=d.height-i.top-i.bottom,o;_("body").select(".tooltip-d3-chart").empty()?o=_("body").append("div").attr("class","tooltip-d3-chart"):o=_("body").select(".tooltip-d3-chart"),o.style("opacity",0);let C=this.svg.append("g").attr("transform","translate("+i.left+","+i.top+")"),g=W().rangeRound([0,s]).paddingInner(.1),E=W().padding(.05),m=M().rangeRound([n,0]),T=lt().range(this.chartColors.colors),c=t.data,R=t.keys,Ct=this.chartColors.colors,h=(e,a)=>Array.isArray(this.chartColors.colors)?this.chartColors.colors[a]:this.chartColors.colors;g.domain(c.map(e=>e[this.groupingElement])),E.domain(R).rangeRound([0,g.bandwidth()]),m.domain([0,w(c,e=>w(R,a=>e[a]))]);let u,I,v=U(),S=U(),A=this.chartLabels;if(C.append("g").selectAll("g").data(c).enter().append("g").each(function(e,a){v.set(this,a)}).on("mouseover",function(e,a){let p=v.get(this);if(u==null)return;let r=p*t.keys.length+u,O=A&&A.labels&&A.labels[u]?A.labels[u]+": ":"";I&&_(I).style("fill",(0,mt.default)(h(a,u)).lighten(.05)),o.html(O+t.tooltips[r]).style("opacity",1).style("border-left-color",h(a,u)).style("left",e.pageX+15+"px").style("top",e.pageY-15+"px")}).on("mouseout",function(e,a){let p=v.get(this);if(u==null)return;let r=p*t.keys.length+u;o.style("opacity",0),I&&_(I).style("fill",h(a,u)),u=null,I=null}).attr("class","bar").attr("transform",e=>"translate("+g(e[this.groupingElement])+",0)").selectAll("rect").data(e=>R.map(a=>({key:a,value:e[a]}))).enter().append("rect").each(function(e,a){S.set(this,a)}).attr("x",e=>E(e.key)).attr("y",e=>m(e.value)).attr("width",E.bandwidth()).attr("height",e=>n-m(e.value)).attr("fill",e=>T(e.key)).attr("class","bar").on("mouseover",function(e){u=S.get(this),I=e.currentTarget}).on("mouseout",(e,a)=>{}),this.yLabelTextOptions?C.append("g").attr("class","axis").attr("transform","translate(0,"+n+")").call(q(g).tickFormat(this.xTickFunction)).selectAll("text").style("font-size",this.yLabelTextOptions.fontSize).attr("x",this.yLabelTextOptions.x).attr("y",this.yLabelTextOptions.y).attr("transform","rotate("+this.yLabelTextOptions.rotation+")").style("text-anchor","start"):C.append("g").attr("class","axis").attr("transform","translate(0,"+n+")").call(q(g).tickFormat(this.xTickFunction)).selectAll("text").attr("x",-35).attr("text-anchor","start").attr("transform","rotate(-45)"),C.append("g").attr("class","y axis").call(F(m)).append("text").attr("x",2).attr("y",m(m.ticks().pop())+.5).attr("dy","0.32em").attr("fill","#000").attr("font-weight","bold").attr("text-anchor","start").text(""),t.lineData){var L=M().domain([0,t.lineData.length-1]).range([0,s]),X=M().domain([0,100]).range([n,0]),Ot=Z().x((a,p)=>g(c[p][this.groupingElement])+g.bandwidth()/2).y(a=>X(a)).curve(dt);C.append("path").datum(t.lineData).attr("class","line").attr("d",Ot);let e=U();C.selectAll(".dot").data(t.lineData).enter().append("circle").each(function(a,p){e.set(this,p)}).attr("class","dot").attr("cx",(a,p)=>g(c[p][this.groupingElement])+g.bandwidth()/2).attr("cy",a=>X(a)).attr("r",5).on("mouseover",function(a){let p=e.get(this);_(a.currentTarget).attr("r","8"),o.html(t.lineTooltips&&t.lineTooltips[p]?t.lineTooltips[p]:t.lineData[p]).style("opacity",1).style("left",a.pageX+15+"px").style("top",a.pageY-15+"px")}).on("mouseout",function(a){_(a.currentTarget).attr("r","5"),o.style("opacity",0)})}var z=C.append("g").attr("font-size",10).attr("text-anchor","end").attr("transform",`translate(${s+this.defaultChartOptions.legendWidth},0)`).selectAll("g").data(R.slice()).enter().append("g").attr("transform",(e,a)=>`translate(0,${a*16})`);z.append("rect").attr("x",-12).attr("width",12).attr("height",12).attr("fill",T).attr("stroke",T).attr("stroke-width",2).style("cursor","pointer").on("click",e=>{f.indexOf(e)==-1?(f.push(e),f.length==R.length&&(f=[])):f.splice(f.indexOf(e),1);let a=[];R.forEach(r=>{f.indexOf(r)==-1&&a.push(r)}),E.domain(a).rangeRound([0,g.bandwidth()]),m.domain([0,w(c,r=>w(R,O=>{if(f.indexOf(O)==-1)return r[O]}))]),this.svg.select(".y").transition().call(F(m)).duration(500);var p=this.svg.selectAll(".bar").selectAll("rect").data(r=>R.map(O=>({key:O,value:r[O]})));p.filter(r=>f.indexOf(r.key)>-1).transition().attr("x",r=>+_("rect").attr("x")+ +_("rect").attr("width")/2).attr("height",0).attr("width",0).attr("y",r=>n).duration(500),p.filter(r=>f.indexOf(r.key)==-1).transition().attr("x",r=>E(r.key)).attr("y",r=>m(r.value)).attr("height",r=>n-m(r.value)).attr("width",E.bandwidth()).attr("fill",r=>T(r.key)).duration(500),z.selectAll("rect").transition().attr("fill",r=>f.length?f.indexOf(r)==-1?T(r):"white":T(r)).duration(100),R.forEach((r,O)=>{this.svg.selectAll("[avgline]").remove(),this.svg.selectAll("[trendline]").remove()}),a.forEach((r,O)=>{let x;x=Z().x((P,B)=>g(c[B][this.groupingElement])+B+i.left).y((P,B)=>m(this.averageValue[r][0])+i.top);let ft=c.map(P=>Number(P[r]));this.svg.append("path").datum(ft).attr("class","mean").attr("d",x).attr("style","stroke:"+this.averageValue[r][1]).attr("id",r).attr("avgline","");let k=c.map(P=>P[this.groupingElement]),$=ot(1,k.length+1),Et=c.map(P=>P[r]),V=this.leastSquares($,Et),It=k[0],_t=V[0]+V[1],bt=k[k.length-1],At=V[0]*$.length+V[1],vt=[[It,_t,bt,At]],kt=this.svg.selectAll("."+r).data(vt)})}),z.append("text").attr("x",-20).attr("y",6).attr("dy","0.32em").text((e,a)=>this.chartLabels&&this.chartLabels.labels&&this.chartLabels.labels[a]?this.chartLabels.labels[a]:e);let f=[];R.forEach((e,a)=>{if(this.averageValue&&this.averageValue[e]){let p;p=Z().x((O,x)=>g(c[x][this.groupingElement])+x+i.left).y((O,x)=>m(this.averageValue[e][0])+i.top);let r=c.map(O=>Number(O[e]));this.svg.append("path").datum(r).attr("class","mean").attr("d",p).attr("style","stroke:"+this.averageValue[e][1]).attr("id",e).attr("avgline","")}})}leastSquares(t,i){let l=function(T,c){return T+c},d=t.reduce(l)*1/t.length,s=i.reduce(l)*1/i.length,n=t.map(function(T){return Math.pow(T-d,2)}).reduce(l),o=i.map(function(T){return Math.pow(T-s,2)}).reduce(l),C=t.map(function(T,c){return(T-d)*(i[c]-s)}).reduce(l),g=C/n,E=s-d*g,m=Math.pow(C,2)/(n*o);return[g,E,m]}static ctorParameters=()=>[{type:et}];static propDecorators={xTickFunction:[{type:N}],averageValue:[{type:N}],margin:[{type:N}],groupingElement:[{type:N}],trendlineActive:[{type:N}],yLabelTextOptions:[{type:N}],legendLabelWidth:[{type:N}]}};j=Dt([Y({selector:"d3-grouped-bar-chart",template:Rt,standalone:!0,styles:[ut]})],j);var wt=function(b,t,i,l){var d=arguments.length,s=d<3?t:l===null?l=Object.getOwnPropertyDescriptor(t,i):l,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(b,t,i,l);else for(var o=b.length-1;o>=0;o--)(n=b[o])&&(s=(d<3?n(s):d>3?n(t,i,s):n(t,i))||s);return d>3&&s&&Object.defineProperty(t,i,s),s},Tt=class{translate;visitorService;request;visibleComponent=!1;translated;datePicker;datePickerOptions=new rt;pieChartOptions={type:D.PieChart,animationDuration:300,drawAfterResize:!1,margin:18,innerRadiusRatio:.8};registrationRatioChartData;registrationRatioChartColors;registrationRatioChartLabels;preRegistrationRatioChartData;preRegistrationRatioChartColors;preRegistrationRatioChartLabels;ownerPreRegistrationRatioChartData;ownerPreRegistrationRatioChartColors;ownerPreRegistrationRatioChartLabels;barChartOptions={type:D.GroupedBarChart};registrationGroupingElement="period";registrationChartData;registrationChartColors;registrationChartLabels;preRegistrationChartData;preRegistrationChartColors;preRegistrationChartLabels;ownerPreRegistrationChartData;ownerPreRegistrationChartColors;ownerPreRegistrationChartLabels;constructor(t,i){this.translate=t,this.visitorService=i}ngOnInit(){this.request=st.getEmptyModel(),this.datePickerOptions.items=[{type:at.Custom,selected:!0}]}ngAfterViewInit(){this.setDateSelection(this.datePicker.setPickerItemAndDate(0,[y.local().minus({days:30}).startOf("day").toJSDate(),y.local().endOf("day").toJSDate()])),this.getTranslations()}ngOnDestroy(){}onDateSelectionChanged(t){this.setDateSelection(t),this.getData()}setDateSelection(t){this.request.startDate=t.startDate,this.request.endDate=t.endDate}getTranslations(){this.translate.get(["COMMON.TOTAL","ANALYZE.VISITOR_PRE_REGISTRATION_COUNTS","ANALYZE.VISITOR_NO_PRE_REGISTRATION_COUNTS","ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_COUNTS","ANALYZE.VISITOR_PRE_REGISTRATION_EXPIRED_COUNTS","ANALYZE.VISITOR_PRE_REGISTRATION_PERSONNEL_COUNTS","ANALYZE.VISITOR_PRE_REGISTRATION_SECURITY_COUNTS"]).subscribe(t=>{this.translated=t,this.getData()})}getData(){this.visitorService.getPreRegisterAnalysis(this.request).subscribe(t=>{this.setData(t)})}getPeriodLabel(t,i){switch(this.request.segmentType){case G.Daily:return y.fromJSDate(t).toFormat("d MMM");case G.Weekly:return y.fromJSDate(t).toFormat("d MMM");case G.Monthly:return y.fromJSDate(t).toFormat("MMMM")}}setData(t){this.registrationRatioChartData={values:[t.periodTotalVisitFromPreregistration,t.periodTotalVisitWithoutPreregistration],tooltips:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COUNTS"],this.translated["ANALYZE.VISITOR_NO_PRE_REGISTRATION_COUNTS"]]},this.registrationRatioChartLabels={labels:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COUNTS"],this.translated["ANALYZE.VISITOR_NO_PRE_REGISTRATION_COUNTS"]]},this.registrationRatioChartColors={colors:["#254A81","#759AD1"]},this.preRegistrationRatioChartData={values:[t.periodTurnedIntoVisit,t.periodExpiredPreregistrations],tooltips:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_COUNTS"],this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_EXPIRED_COUNTS"]]},this.preRegistrationRatioChartLabels={labels:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_COUNTS"],this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_EXPIRED_COUNTS"]]},this.preRegistrationRatioChartColors={colors:["#D97D0D","#F2AB27"]},this.ownerPreRegistrationRatioChartData={values:[t.periodSelfPreregistered,t.periodSecurityPreregistered],tooltips:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_PERSONNEL_COUNTS"],this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_SECURITY_COUNTS"]]},this.ownerPreRegistrationRatioChartLabels={labels:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_PERSONNEL_COUNTS"],this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_SECURITY_COUNTS"]]},this.ownerPreRegistrationRatioChartColors={colors:["#025930","#04BF8A"]};let i=[],l=[],d=[],s=[],n=[],o=[],C=[],g=[],E=[],m=[],T=[],c=[];t.items.forEach((R,Ct)=>{let h=R.data[0],u={period:this.getPeriodLabel(R.startDate,R.endDate),preRegister:h.totalVisitFromPreregistration,notPreRegistered:h.totalVisitWithoutPreregistration,total:h.totalVisit};l.push(u.preRegister,u.notPreRegistered,h.totalVisit);let I=Math.round(100*u.preRegister/h.totalVisit);Number.isNaN(I)&&(I=0),d.push(I),s.push(this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COUNTS"]+" %"+I),i.push(u);let v={period:this.getPeriodLabel(R.startDate,R.endDate),turnedIntoVisit:h.turnedIntoVisit,expiredPreregistrations:h.expiredPreregistrations,total:h.totalPreregistered};o.push(v.turnedIntoVisit,v.expiredPreregistrations,h.totalPreregistered);let S=Math.round(100*v.turnedIntoVisit/h.totalPreregistered);Number.isNaN(S)&&(S=0),C.push(S),g.push(this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_COUNTS"]+" %"+S),n.push(v);let A={period:this.getPeriodLabel(R.startDate,R.endDate),selfPreregistered:h.selfPreregistered,securityPreregistered:h.securityPreregistered,total:h.totalPreregistered};m.push(A.selfPreregistered,A.securityPreregistered,h.totalPreregistered);let L=Math.round(100*A.selfPreregistered/h.totalPreregistered);Number.isNaN(L)&&(L=0),T.push(L),c.push(this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_PERSONNEL_COUNTS"]+" %"+L),E.push(A)}),this.registrationChartData={data:i,keys:["preRegister","notPreRegistered","total"],tooltips:l,lineData:d,lineTooltips:s},this.registrationChartColors={colors:["#254A81","#759AD1","#d3def0"]},this.registrationChartLabels={labels:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COUNTS"],this.translated["ANALYZE.VISITOR_NO_PRE_REGISTRATION_COUNTS"],this.translated["COMMON.TOTAL"]]},this.preRegistrationChartData={data:n,keys:["turnedIntoVisit","expiredPreregistrations","total"],tooltips:o,lineData:C,lineTooltips:g},this.preRegistrationChartColors={colors:["#D97D0D","#F2AB27","#f0c692"]},this.preRegistrationChartLabels={labels:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_COMPLETE_COUNTS"],this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_EXPIRED_COUNTS"],this.translated["COMMON.TOTAL"]]},this.ownerPreRegistrationChartData={data:E,keys:["selfPreregistered","securityPreregistered","total"],tooltips:m,lineData:T,lineTooltips:c},this.ownerPreRegistrationChartColors={colors:["#025930","#04BF8A","#91b8a5"]},this.ownerPreRegistrationChartLabels={labels:[this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_PERSONNEL_COUNTS"],this.translated["ANALYZE.VISITOR_PRE_REGISTRATION_SECURITY_COUNTS"],this.translated["COMMON.TOTAL"]]},this.visibleComponent=!0}onSegmentChanged(t){this.request.segmentType=t,this.getData()}static ctorParameters=()=>[{type:Q},{type:nt}];static propDecorators={datePicker:[{type:J,args:["datePicker",{static:!0}]}]}};Tt=wt([Y({selector:"armon-analysis-visitor-registration",template:pt,standalone:!0,imports:[it,K,ht,H,j,tt],styles:[gt]})],Tt);export{Tt as AnalysisVisitorRegistrationComponent};
