import{c as J}from"./chunk-OQMWV4LA.js";import{e as L,f as N,g as P,h as I,i as V,j as O,k as H,l as z,m as M}from"./chunk-R3DFB5VD.js";import{a as b,b as S,c as A,d as j}from"./chunk-2D4XBF6C.js";import{c as G}from"./chunk-J63OB27M.js";import{b as R,c as E}from"./chunk-MPN57TB5.js";import{b as q}from"./chunk-KBZZ7PX4.js";import{d as F,g as B}from"./chunk-VYA2NFJ5.js";import{E as x}from"./chunk-MDIMQ3H3.js";import{Bb as _,Bc as Y,Db as k,Ib as l,Jb as d,Kb as p,Lb as v,Ub as D,Xb as f,Xc as T,Yc as n,Za as o,Zb as w,hc as u,ib as C,ic as y,mc as h,va as c,wa as s}from"./chunk-GJDGQISV.js";function K(r,U){if(r&1){let e=D();d(0,"mat-date-range-picker-actions")(1,"button",6),h(2,"Cancel"),p(),d(3,"button",7),f("click",function(){c(e);let a=w();return s(a.onSelectDate())}),h(4,"Search"),p()()}}var Q={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},ce=(()=>{class r{constructor(){this.placeholder=n(),this.displayToggle=n(),this.minDate=n(),this.maxDate=n(),this.showButtonConfirm=n(!1),this.width=n(),this.dateChange=T()}fromDateChange(e){if(e){let t=e instanceof Date?e:e.toDate();t.setHours(0,0,0,0),this.from=t}}toDateChange(e){if(e){let t=e instanceof Date?e:e.toDate();t.setHours(0,0,0,0),this.to=t,this.showButtonConfirm()||this.emitDateChange()}}emitDateChange(){this.dateChange.emit({from:this.from,to:this.to})}onSelectDate(){this.emitDateChange()}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275cmp=C({type:r,selectors:[["app-datepicker-range"]],inputs:{placeholder:[1,"placeholder"],displayToggle:[1,"displayToggle"],minDate:[1,"minDate"],maxDate:[1,"maxDate"],showButtonConfirm:[1,"showButtonConfirm"],width:[1,"width"],from:"from",to:"to"},outputs:{dateChange:"dateChange"},features:[Y([{provide:S,useClass:J,deps:[b]},{provide:A,useValue:Q},M])],decls:8,vars:9,consts:[["picker",""],["appearance","outline",1,"p-0","date-range"],["id","dates",3,"min","max","rangePicker"],["matStartDate","","placeholder","Start date",3,"dateChange","click","value"],["matEndDate","","placeholder","End date",3,"dateChange","click","value"],["matSuffix","",3,"for"],["mat-button","","matDateRangePickerCancel",""],["mat-raised-button","","color","primary","matDateRangePickerApply","",3,"click"]],template:function(t,a){if(t&1){let m=D();d(0,"mat-form-field",1)(1,"mat-date-range-input",2)(2,"input",3),f("dateChange",function(i){return a.fromDateChange(i.value)})("click",function(){c(m);let i=u(6);return s(i.open())}),p(),d(3,"input",4),f("dateChange",function(i){return a.toDateChange(i.value)})("click",function(){c(m);let i=u(6);return s(i.open())}),p()(),v(4,"mat-datepicker-toggle",5),d(5,"mat-date-range-picker",null,0),_(7,K,5,0,"mat-date-range-picker-actions"),p()()}if(t&2){let m=u(6);y("width",a.width()||100,"%"),o(),l("min",a.minDate())("max",a.maxDate())("rangePicker",m),o(),l("value",a.from),o(),l("value",a.to),o(),l("for",m),o(3),k(a.showButtonConfirm()?7:-1)}},dependencies:[j,M,L,N,P,I,V,z,H,O,q,B,F,G,x,E,R],styles:[`mat-form-field.date-range>div.mat-mdc-form-field-wrapper{padding-bottom:0!important}mat-form-field.date-range .mat-mdc-text-field-wrapper.mdc-text-field{padding-left:14px!important}mat-form-field.date-range .mat-mdc-form-field-icon-prefix{padding:0!important}mat-form-field.date-range .mat-date-range-input-container{margin-top:6px;font-size:11px}mat-form-field.date-range .mat-mdc-form-field-icon-suffix{padding:0!important}
`],encapsulation:2})}}return r})();export{ce as a};
