import{a as N,b as D}from"./chunk-MC2ISO42.js";import{C as S,a as T,g as B,n as P}from"./chunk-AWFGIQSJ.js";import{Cb as M,Gc as O,Ra as c,Sa as h,Wb as b,X as d,Xb as _,Yb as k,aa as l,ac as v,cc as w,eb as s,ob as f,pb as C,sa as g,sc as y,ta as n,tc as m,ue as I,ve as x}from"./chunk-GKQGDBUU.js";import{i as p}from"./chunk-QVFSZZWQ.js";var E=a=>({"with-border":a}),G=(()=>{let i=class i{changeDetector=l(y);maxTimestamp=n(void 0);timestamp=c(void 0);disabled=n(!1,{transform:m});enableBorder=n(!1,{transform:m});inputName=n(void 0);mask=n("99:99:99");formatter=n(t=>x({seconds:t,format:"full",symbol:":"}));parser=n(t=>I(t));inputBlur=g();timestampString;ngOnInit(){this.writeValue(this.timestamp()||0)}propagateChange=t=>{};writeValue(t){this.timestamp.set(t),this.timestampString=this.formatter()(this.timestamp())}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}onModelChange(){this.timestamp.set(this.parser()(this.timestampString)),this.propagateChange(this.timestamp())}onBlur(){let t=this.maxTimestamp();t&&this.timestamp()>t&&(this.writeValue(t),this.changeDetector.detectChanges(),this.propagateChange(this.timestamp())),this.inputBlur.emit()}};p(i,"\u0275fac",function(r){return new(r||i)}),p(i,"\u0275cmp",h({type:i,selectors:[["my-timestamp-input"]],inputs:{maxTimestamp:[1,"maxTimestamp"],timestamp:[1,"timestamp"],disabled:[1,"disabled"],enableBorder:[1,"enableBorder"],inputName:[1,"inputName"],mask:[1,"mask"],formatter:[1,"formatter"],parser:[1,"parser"]},outputs:{timestamp:"timestampChange",inputBlur:"inputBlur"},features:[v([{provide:T,useExisting:d(()=>i),multi:!0}])],decls:1,vars:7,consts:[["slotChar","0",3,"ngModelChange","onBlur","disabled","ngModel","ngClass","mask","inputId"]],template:function(r,e){r&1&&(f(0,"p-inputMask",0),k("ngModelChange",function(o){return _(e.timestampString,o)||(e.timestampString=o),o}),M("onBlur",function(){return e.onBlur()})("ngModelChange",function(){return e.onModelChange()}),C()),r&2&&(s("disabled",e.disabled()),b("ngModel",e.timestampString),s("ngClass",w(5,E,e.enableBorder()))("mask",e.mask())("inputId",e.inputName()))},dependencies:[D,N,S,B,P,O],styles:[`p-inputmask.with-border[_ngcontent-%COMP%]{--input-border-color: var(--bg-secondary-500)}p-inputmask[_ngcontent-%COMP%]     input{text-align:center;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:100%;max-width:100%;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}p-inputmask[_ngcontent-%COMP%]     input::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}p-inputmask[_ngcontent-%COMP%]     input[readonly]{color:var(--fg-300)}p-inputmask[_ngcontent-%COMP%]     input:focus, p-inputmask[_ngcontent-%COMP%]     input:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}p-inputmask[_ngcontent-%COMP%]     input[disabled]{color:var(--fg-300);opacity:.8}@media screen and (max-width: calc(100% + 40px)){p-inputmask[_ngcontent-%COMP%]     input{width:100%}}p-inputmask[_ngcontent-%COMP%]     input:focus-within, p-inputmask[_ngcontent-%COMP%]     input:focus{box-shadow:0 0 0 .2rem var(--fg-100)}p-inputmask[_ngcontent-%COMP%]     input:disabled{background:var(--bg);opacity:.5}
/*# sourceMappingURL=timestamp-input.component-DEBUVO5A.css.map */`]}));let a=i;return a})();export{G as a};
/**i18n:42345378061bf3c93df67acfa161b751a7b03cc91f3ede7c1f1cdf2bba62fe26*/
//# sourceMappingURL=chunk-H57GK6SM.js.map
