import{a as x,b as I}from"./chunk-R3RCTP7Y.js";import{C as D,a as T,g as B,n as O}from"./chunk-UR42IA56.js";import{Dc as w,De as P,Ec as y,Ee as S,Fc as m,Ka as g,Oc as N,Wb as b,X as d,Xb as M,Yb as C,aa as l,cc as _,eb as s,ec as v,fb as c,gb as h,xc as k,yc as n,zb as f}from"./chunk-CUA2BO3S.js";import{i as p}from"./chunk-75J4RO44.js";var A=a=>({"with-border":a}),G=(()=>{let i=class i{changeDetector=l(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",g({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:[_([{provide:T,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",v(5,A,t.enableBorder()))("mask",t.mask())("inputId",t.inputName()))},dependencies:[I,x,D,B,O,N],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-JER3BC2M.css.map */`]}));let a=i;return a})();export{G as a};
/**i18n:42440f0a8726af1836b15b193adfd3f46a3ecd983a1ed2a1e05982c4f600c8a1*/
//# sourceMappingURL=chunk-WQWKKHX2.js.map
