"use strict";const t=require("react/jsx-runtime"),d=require("../lite.cjs"),n=require("react"),R=require("../tools/icons.cjs"),m=require("../tools/tools.cjs"),v=new Date,o=p=>p.toString().padStart(2,"0"),N=function(k){const{as:M="div",className:x,dropOldClass:h,onDateClick:a,selectedDate:H,style:g,variables:y,...I}=k,s=H??v,[c,f]=n.useState(o(s.getHours())),[r,C]=n.useState(o(s.getMinutes())),[i,D]=n.useState(o(s.getSeconds())),K=n.useMemo(()=>{const e=m.classx(!h&&"card card-body border-0 p-0",x),u=m.stylex((S,b)=>({tKey:m.convertBsKeyToVar(b)}),y,g);return{className:e,style:u}},[x,h,g,y]),j=n.useCallback(()=>{const e=parseInt(c,10)||0,u=parseInt(r,10)||0,S=parseInt(i,10)||0,P={date:d.setSeconds(d.setMinutes(d.setHours(v,e),u),S)};a==null||a(P)},[c,r,a,i]),T=e=>{f(e.target.value.trim())},q=e=>{C(e.target.value.trim())},w=e=>{D(e.target.value.trim())},l=e=>{e.key==="Enter"&&j()};return n.useEffect(()=>{f(o(s.getHours())),C(o(s.getMinutes())),D(o(s.getSeconds()))},[s]),t.jsxs(M,{...I,...K,children:[t.jsxs("div",{className:"input-group",children:[t.jsx("input",{className:"form-control",onChange:T,onKeyDown:l,placeholder:"HH",type:"text",value:c}),t.jsx("span",{className:"input-group-text text-secondary",children:":"}),t.jsx("input",{className:"form-control",onChange:q,onKeyDown:l,placeholder:"MM",type:"text",value:r}),t.jsx("span",{className:"input-group-text text-secondary",children:":"}),t.jsx("input",{className:"form-control",onChange:w,onKeyDown:l,placeholder:"SS",type:"text",value:i})]}),t.jsxs("button",{className:"btn btn-outline-primary btn-sm mt-4 mb-1 d-flex justify-content-center align-items-center gap-1",onClick:j,type:"button",children:[t.jsx("span",{className:"d-inline-flex",children:t.jsx(R.BiClock,{})}),t.jsx("span",{children:"Confirm"})]})]})};N.displayName="BRL.DatePickerTime";exports.DatePickerTime=N;
//# sourceMappingURL=date-picker-time.cjs.map
