import{a as x,b as I}from"./chunk-77FLT7QI.js";import{C as D,a as N,g as O,n as B}from"./chunk-UVFMJH3U.js";import{Bb as f,Cc as w,Ec as y,Fc as m,Fe as P,Ge as S,La as l,Oc as T,X as d,Yb as b,Zb as M,_b as C,aa as g,ec as v,gb as s,gc as _,hb as c,ib as h,wc as k,xc as n}from"./chunk-HJJWL6RD.js";import{i as p}from"./chunk-H2BCKOF6.js";var E=a=>({"with-border":a}),G=(()=>{let i=class i{changeDetector=g(y);maxTimestamp=n(void 0);timestamp=w(void 0);disabled=n(!1,{transform:m});enableBorder=n(!1,{transform:m});inputName=n(void 0);mask=n("99:99:99");formatter=n(e=>S({seconds:e,format:"full",symbol:":"}));parser=n(e=>P(e));inputBlur=k();timestampString;ngOnInit(){this.writeValue(this.timestamp()||0)}propagateChange=e=>{};writeValue(e){this.timestamp.set(e),this.timestampString=this.formatter()(this.timestamp())}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}onModelChange(){this.timestamp.set(this.parser()(this.timestampString)),this.propagateChange(this.timestamp())}onBlur(){let e=this.maxTimestamp();e&&this.timestamp()>e&&(this.writeValue(e),this.changeDetector.detectChanges(),this.propagateChange(this.timestamp())),this.inputBlur.emit()}};p(i,"\u0275fac",function(o){return new(o||i)}),p(i,"\u0275cmp",l({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:N,useExisting:d(()=>i),multi:!0}])],decls:1,vars:7,consts:[["slotChar","0",3,"ngModelChange","onBlur","disabled","ngModel","ngClass","mask","inputId"]],template:function(o,t){o&1&&(c(0,"p-inputMask",0),C("ngModelChange",function(r){return M(t.timestampString,r)||(t.timestampString=r),r}),f("onBlur",function(){return t.onBlur()})("ngModelChange",function(){return t.onModelChange()}),h()),o&2&&(s("disabled",t.disabled()),b("ngModel",t.timestampString),s("ngClass",_(5,E,t.enableBorder()))("mask",t.mask())("inputId",t.inputName()))},dependencies:[I,x,D,O,B,T],styles:[`p-inputmask.with-border[_ngcontent-%COMP%]{--input-border-color: var(--bg-secondary-500);--p-inputtext-hover-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-4TQ6ODSI.css.map */`]}));let a=i;return a})();export{G as a};
/**i18n:671d995daee9c68b73ac729b7ab2c3cf3be32c7f1a24d9dfa94e261c45ee5241*/
//# sourceMappingURL=chunk-7Q3H4OPH.js.map
