crisli-picker
Version:
A modern, customizable date and time picker library for React applications with configurable time intervals and booking system support
3 lines (2 loc) • 39.8 kB
JavaScript
import e,{useRef as t,useState as r,useEffect as o}from"react";import{format as n,addMonths as l,startOfWeek as i,addDays as a,startOfMonth as u,endOfMonth as d,endOfWeek as c,isSameMonth as s,isSameDay as g}from"date-fns";function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function f(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)({}).hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},p.apply(null,arguments)}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,l,i,a=[],u=!0,d=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(o=l.call(r)).done)&&(a.push(o.value),a.length!==t);u=!0);}catch(e){d=!0,n=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(d)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var C=function(n){var l=n.items,i=n.value,a=n.onChange,u=n.itemHeight,d=void 0===u?40:u,c=n.fontSize,s=void 0===c?"16px":c,g=n.fontWeight,h=void 0===g?"400":g,f=n.textColor,p=void 0===f?"#666":f,m=n.selectedTextColor,v=void 0===m?"#000":m,C=n.highlightColor,b=void 0===C?"rgba(0, 0, 0, 0.05)":C,y=n.highlightBorderColor,w=void 0===y?"rgba(0, 0, 0, 0.1)":y,E=t(null),M=x(r(0),2),S=M[0],k=M[1],B=x(r(0),2),T=B[0],D=B[1],A=x(r(!1),2),H=A[0],z=A[1],P=x(r(0),2),j=P[0],R=P[1],Y=x(r(0),2),N=Y[0],F=Y[1],O=x(r(!1),2),L=O[0],I=O[1];o((function(){var e=l.findIndex((function(e){return e.value===i}));-1!==e&&(k(e),D(-e*d))}),[l,i,d]);var W=t({accumulator:0,lastScrollTime:0,velocity:0,lastY:0,continuousTimeout:null,isContinuousScrolling:!1,targetPosition:0,animationFrame:null}),q=function(e){e.preventDefault(),W.current.animationFrame&&(cancelAnimationFrame(W.current.animationFrame),W.current.animationFrame=null),W.current.continuousTimeout&&clearTimeout(W.current.continuousTimeout);var t=e.deltaY||e.detail||e.wheelDelta,r=Date.now();Math.abs(t)>1&&(U.current=t>0?1:-1),W.current.accumulator+=t;var o=r-W.current.lastScrollTime;if(o>0){var n=t/o;W.current.velocity=.7*W.current.velocity+.3*n}W.current.lastScrollTime=r;var i=Math.abs(t)<10,a=i?5:2;if(!(Math.abs(W.current.accumulator)<a)){var u=W.current.accumulator/(i?5:8),c=T-u;D(c);var s=Math.round(-c/d),g=Math.max(0,Math.min(l.length-1,s));g!==S&&k(g);var h=W.current.accumulator>0?1:-1;W.current.accumulator=5*h,W.current.lastY=c,W.current.continuousTimeout=setTimeout((function(){G()}),100)}},U=t(0),$=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null===(t=l[e])||void 0===t||!t.disabled)return e;for(var o=e,n=e,i=1;i<l.length;i++){var a,u,d,c;if(o=e-i,n=e+i,r<=0&&o>=0&&(null===(a=l[o])||void 0===a||!a.disabled))return o;if(r>=0&&n<l.length&&(null===(u=l[n])||void 0===u||!u.disabled))return n;if(r>0&&o>=0&&(null===(d=l[o])||void 0===d||!d.disabled))return o;if(r<0&&n<l.length&&(null===(c=l[n])||void 0===c||!c.disabled))return n}return e},G=function(){var e,t=Math.round(-T/d),r=W.current.velocity,o=800*r;Math.abs(r)>.01&&(U.current=r>0?1:-1);var n,u=T+o,c=Math.round(-u/d);Math.abs(r)<.05?n=t:n=U.current>0&&c<t||U.current<0&&c>t?t:c;var s,g=Math.max(0,Math.min(l.length-1,n)),h=$(g,U.current),f=Math.abs(h-S),p=Math.min(300,150+30*f);(V(h,p),(null===(e=l[h])||void 0===e?void 0:e.value)!==i)&&a(null===(s=l[h])||void 0===s?void 0:s.value);W.current.velocity=0},J=function(e){if(!L){var t=e.touches?e.touches[0].clientY:e.clientY;z(!0),R(t),F(T),K.current={lastY:T,lastTime:Date.now(),velocity:0},e.touches||e.preventDefault()}},K=t({lastY:0,lastTime:0,velocity:0}),Q=function(e){var t=Date.now(),r=t-K.current.lastTime;if(r>0){var o=e-K.current.lastY;K.current.velocity=o/r,K.current.lastY=e,K.current.lastTime=t}},V=function(e,t){if(!(e===S&&Math.abs(T- -e*d)<2)){I(!0);var r=-e*d,o=T,n=r-o,u=Math.min(300,150+30*Math.abs(e-S)),c=t||u,s=Date.now(),g=function(){var t,u,d=Date.now()-s,h=Math.min(d/c,1),f=1-Math.pow(1-h,2);(D(o+n*f),h>.3&&e!==S)&&(k(e),(null===(t=l[e])||void 0===t?void 0:t.value)!==i&&a(null===(u=l[e])||void 0===u?void 0:u.value));h<1?requestAnimationFrame(g):(D(r),k(e),I(!1))};requestAnimationFrame(g)}};o((function(){var e=E.current;if(e){e.addEventListener("wheel",q,{passive:!1}),e.addEventListener("mousedown",J),e.addEventListener("touchstart",J,{passive:!0});var t=function(e){return function(e){if(H){e.preventDefault();var t=e.touches?e.touches[0].clientY:e.clientY,r=N+(t-j),o=-(l.length-1)*d;r>0?r=0+.5*(r-0):r<o&&(r=o+.5*(r-o)),Q(r),D(r);var n=Math.round(-r/d),i=Math.max(0,Math.min(l.length-1,n));i!==S&&k(i)}}(e)},r=function(){return function(){var e;if(H){z(!1);var t,r,o=K.current.velocity,n=T+600*o,u=Math.round(-n/d),c=Math.max(0,Math.min(l.length-1,u)),s=$(c,o>0?1:-1),g=Math.abs(s-S),h=1e3*Math.abs(o);t=g<=1?300:Math.min(500,Math.max(300,300+50*g-.2*h)),V(s,t),(null===(e=l[s])||void 0===e?void 0:e.value)!==i&&a(null===(r=l[s])||void 0===r?void 0:r.value),K.current.velocity=0}}()};return document.addEventListener("mousemove",t),document.addEventListener("touchmove",t,{passive:!1}),document.addEventListener("mouseup",r),document.addEventListener("touchend",r),function(){e.removeEventListener("wheel",q),e.removeEventListener("mousedown",J),e.removeEventListener("touchstart",J),document.removeEventListener("mousemove",t),document.removeEventListener("touchmove",t),document.removeEventListener("mouseup",r),document.removeEventListener("touchend",r)}}}),[H,T,S,L,d,l.length]);return e.createElement("div",{ref:E,className:"crisli-wheel-container",style:{height:5*d,overflow:"hidden",position:"relative",cursor:H?"grabbing":"grab",touchAction:"none"}},e.createElement("div",{className:"crisli-wheel-highlight",style:{position:"absolute",top:"50%",transform:"translateY(-50%)",height:d,width:"100%",backgroundColor:b,borderTop:"1px solid ".concat(w),borderBottom:"1px solid ".concat(w),pointerEvents:"none",zIndex:1,borderRadius:"4px"}}),e.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,height:2*d,background:"#ffffff"===v?"linear-gradient(to bottom, rgba(30,30,30,0.95) 0%, rgba(30,30,30,0) 100%)":"linear-gradient(to bottom, rgba(245,245,245,0.95) 0%, rgba(245,245,245,0) 100%)",pointerEvents:"none",zIndex:2,borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}}),e.createElement("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:2*d,background:"#ffffff"===v?"linear-gradient(to top, rgba(30,30,30,0.95) 0%, rgba(30,30,30,0) 100%)":"linear-gradient(to top, rgba(245,245,245,0.95) 0%, rgba(245,245,245,0) 100%)",pointerEvents:"none",zIndex:2,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"}}),e.createElement("div",{style:{position:"relative",height:"100%",transform:"translateY(".concat(2*d,"px)")}},l.map((function(t,r){var o=T+r*d;if(o<3*-d||o>8*d)return null;var n=r===S,i=t.disabled,a=Math.abs(r-S),u=Math.max(.3,1-.2*a);return i&&(u=Math.min(u,.3)),e.createElement("div",{key:r,onClick:function(){return function(e){var t;L||null!==(t=l[e])&&void 0!==t&&t.disabled||V(e)}(r)},style:{position:"absolute",top:0,left:0,width:"100%",height:d,transform:"translateY(".concat(o,"px)"),display:"flex",alignItems:"center",justifyContent:"center",fontSize:n?s:"14px",fontWeight:n?"600":h,color:i?"#ccc":n?v:p,opacity:u,cursor:i?"not-allowed":"pointer",textDecoration:i?"line-through":"none",userSelect:"none",textAlign:"center",paddingLeft:"10px",paddingRight:"10px",boxSizing:"border-box",transition:H?"none":"transform 0.15s ease-out, opacity 0.15s ease-out"}},t.label)}))))},b=function(t){var l=t.value,i=void 0===l?new Date:l,a=t.onChange,u=t.showTime,d=void 0===u||u,c=t.use24Hours,s=void 0===c||c,g=t.disablePast,h=void 0!==g&&g,f=t.minuteStep,m=void 0===f?1:f,b=t.hourStep,y=void 0===b?1:b,w=t.wheelProps,E=void 0===w?{}:w,M=t.theme,S=void 0===M?"light":M,k=function(e){return e>=12?"PM":"AM"},B=e.useCallback((function(e,t){return"AM"===t?12===e?0:e:12===e?12:e+12}),[]),T=e.useCallback((function(e,t,r){if(t<=1)return e;var o=Math.round(e/t)*t;return Math.min(o,r)}),[]),D=e.useCallback((function(e){return T(e,m,59)}),[m,T]),A=e.useCallback((function(e){return T(e,y,s?23:12)}),[y,s,T]),H=e.useMemo((function(){return new Date}),[]),z=e.useMemo((function(){return new Date(H.getFullYear(),H.getMonth(),H.getDate())}),[H]),P=e.useCallback((function(e,t,r){return!!h&&new Date(e,t,r)<z}),[h,z]),j=e.useCallback((function(e,t,r,o,n){return!(!h||!d)&&(new Date(e,t,r).getTime()===z.getTime()&&new Date(e,t,r,o,n)<=H)}),[h,d,z,H]),R=e.useCallback((function(e,t){var r=new Date(e,t,0).getDate();return Array.from({length:r},(function(r,o){var n=o+1,l=P(e,t-1,n);return{value:n,label:"".concat(n),disabled:l}}))}),[h,P]),Y=e.useCallback((function(e){return Array.from({length:12},(function(t,r){var o=h&&e===H.getFullYear()&&r<H.getMonth();return{value:r,label:n(new Date(2e3,r,1),"MMMM"),disabled:o}}))}),[h,H]),N=(new Date).getFullYear(),F=Array.from({length:21},(function(e,t){var r=N-10+t,o=h&&r<N;return{value:r,label:"".concat(r),disabled:o}})),O=e.useCallback((function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(s){for(var n=[],l=0;l<24;l+=y){var i=j(e,t,r,l,0);n.push({value:l,label:l.toString().padStart(2,"0"),disabled:i})}return n}for(var a=[],u=1;u<=12;u+=y){var d=u,c=o?B(d,o):d,g=j(e,t,r,c,0);a.push({value:d,label:d.toString(),disabled:g})}return a}),[s,h,B,j,y]),L=e.useCallback((function(e,t,r,o){for(var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,l=[],i=0;i<60;i+=m){var a=s?o:B(o,n),u=j(e,t,r,a,i);l.push({value:i,label:i.toString().padStart(2,"0"),disabled:u})}return l}),[s,h,B,j,m]),I=x(r((function(){var e,t=i||new Date,r=s?t.getHours():0===(e=t.getHours())?12:e>12?e-12:e,o=t.getMinutes();return{day:t.getDate(),month:t.getMonth(),year:t.getFullYear(),hour:A(r),minute:D(o),period:k(t.getHours())}})),2),W=I[0],q=I[1],U=x(r((function(){return R(W.year,W.month+1)})),2),$=U[0],G=U[1],J=x(r((function(){return Y(W.year)})),2),K=J[0],Q=J[1],V=x(r((function(){return O(W.year,W.month,W.day,W.period)})),2),X=V[0],Z=V[1],_=x(r((function(){return L(W.year,W.month,W.day,W.hour,W.period)})),2),ee=_[0],te=_[1];o((function(){G(R(W.year,W.month+1)),Q(Y(W.year)),d&&(Z(O(W.year,W.month,W.day,W.period)),te(L(W.year,W.month,W.day,W.hour,W.period)));var e=new Date(W.year,W.month+1,0).getDate();W.day>e&&q((function(t){return v(v({},t),{},{day:e})}))}),[W.month,W.year,W.day,W.hour,W.period,d,h,R,Y,O,L]),o((function(){var e=s?W.hour:B(W.hour,W.period),t=new Date(W.year,W.month,W.day,e,W.minute),r=i||new Date;t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()&&t.getDate()===r.getDate()&&t.getHours()===r.getHours()&&t.getMinutes()===r.getMinutes()||a(t)}),[W,a,i,s,B]);var re={light:{backgroundColor:"#ffffff",textColor:"#666666",selectedTextColor:"#000000",highlightColor:"rgba(0, 0, 0, 0.05)",highlightBorderColor:"rgba(0, 0, 0, 0.1)",labelColor:"#999999"},dark:{backgroundColor:"#1e1e1e",textColor:"#a0a0a0",selectedTextColor:"#ffffff",highlightColor:"rgba(255, 255, 255, 0.1)",highlightBorderColor:"rgba(255, 255, 255, 0.2)",labelColor:"#777777"}},oe=re[S]||re.light;return e.createElement("div",{className:"crisli-datetime-picker",style:{backgroundColor:oe.backgroundColor,borderRadius:"12px",padding:"20px 10px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.1)"}},e.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"space-between",marginBottom:"10px",paddingLeft:"10px",paddingRight:"10px"}},e.createElement("div",{style:{flex:1,textAlign:"center",color:oe.labelColor,fontSize:"12px"}},"Day"),e.createElement("div",{style:{flex:1.5,textAlign:"center",color:oe.labelColor,fontSize:"12px"}},"Month"),e.createElement("div",{style:{flex:1,textAlign:"center",color:oe.labelColor,fontSize:"12px"}},"Year"),d&&e.createElement(e.Fragment,null,e.createElement("div",{style:{flex:1,textAlign:"center",color:oe.labelColor,fontSize:"12px"}},"Hour"),e.createElement("div",{style:{flex:1,textAlign:"center",color:oe.labelColor,fontSize:"12px"}},"Min"),!s&&e.createElement("div",{style:{flex:1,textAlign:"center",color:oe.labelColor,fontSize:"12px"}},"AM/PM"))),e.createElement("div",{className:"crisli-wheels-container",style:{display:"flex",width:"100%",justifyContent:"space-between",gap:"5px"}},e.createElement("div",{style:{flex:1}},e.createElement(C,p({items:$,value:W.day,onChange:function(e){h&&P(W.year,W.month,e)||q((function(t){return v(v({},t),{},{day:e})}))},textColor:oe.textColor,selectedTextColor:oe.selectedTextColor,highlightColor:oe.highlightColor,highlightBorderColor:oe.highlightBorderColor,fontSize:"14px"},E))),e.createElement("div",{style:{flex:1.5}},e.createElement(C,p({items:K,value:W.month,onChange:function(e){h&&W.year===H.getFullYear()&&e<H.getMonth()||q((function(t){return v(v({},t),{},{month:e})}))},textColor:oe.textColor,selectedTextColor:oe.selectedTextColor,highlightColor:oe.highlightColor,highlightBorderColor:oe.highlightBorderColor,fontSize:"14px"},E))),e.createElement("div",{style:{flex:1}},e.createElement(C,p({items:F,value:W.year,onChange:function(e){h&&e<H.getFullYear()||q((function(t){return v(v({},t),{},{year:e})}))},textColor:oe.textColor,selectedTextColor:oe.selectedTextColor,highlightColor:oe.highlightColor,highlightBorderColor:oe.highlightBorderColor,fontSize:"14px"},E))),d&&e.createElement(e.Fragment,null,e.createElement("div",{style:{flex:1}},e.createElement(C,p({items:X,value:W.hour,onChange:function(e){var t=s?e:B(e,W.period);h&&j(W.year,W.month,W.day,t,W.minute)||q((function(t){return v(v({},t),{},{hour:e})}))},textColor:oe.textColor,selectedTextColor:oe.selectedTextColor,highlightColor:oe.highlightColor,highlightBorderColor:oe.highlightBorderColor,fontSize:"14px"},E))),e.createElement("div",{style:{flex:1}},e.createElement(C,p({items:ee,value:W.minute,onChange:function(e){var t=s?W.hour:B(W.hour,W.period);h&&j(W.year,W.month,W.day,t,e)||q((function(t){return v(v({},t),{},{minute:e})}))},textColor:oe.textColor,selectedTextColor:oe.selectedTextColor,highlightColor:oe.highlightColor,highlightBorderColor:oe.highlightBorderColor,fontSize:"14px"},E))),!s&&e.createElement("div",{style:{flex:1}},e.createElement(C,p({items:[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],value:W.period,onChange:function(e){var t=B(W.hour,e);h&&j(W.year,W.month,W.day,t,W.minute)||q((function(t){return v(v({},t),{},{period:e})}))},textColor:oe.textColor,selectedTextColor:oe.selectedTextColor,highlightColor:oe.highlightColor,highlightBorderColor:oe.highlightBorderColor,fontSize:"14px"},E))))))},y=function(t){var n=t.value,l=void 0===n?new Date:n,i=t.onChange,a=t.use24Hours,u=void 0===a||a,d=t.disablePast,c=void 0!==d&&d,s=t.minuteStep,g=void 0===s?1:s,h=t.hourStep,f=void 0===h?1:h,m=t.wheelProps,b=void 0===m?{}:m,y=t.theme,w=void 0===y?"light":y,E=function(e){return e>=12?"PM":"AM"},M=e.useCallback((function(e,t){return"AM"===t?12===e?0:e:12===e?12:e+12}),[]),S=e.useCallback((function(e,t,r){if(t<=1)return e;var o=Math.round(e/t)*t;return Math.min(o,r)}),[]),k=e.useCallback((function(e){return S(e,g,59)}),[g,S]),B=e.useCallback((function(e){return S(e,f,u?23:12)}),[f,u,S]),T=e.useCallback((function(e,t){if(!c)return!1;var r=new Date;r.setHours(e,t,0,0);var o=new Date;return o.setSeconds(0,0),r<=o}),[c]),D=e.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(u){for(var t=[],r=0;r<24;r+=f){var o=T(r,0);t.push({value:r,label:r.toString().padStart(2,"0"),disabled:o})}return t}for(var n=[],l=1;l<=12;l+=f){var i=l,a=e?M(i,e):i,d=T(a,0);n.push({value:i,label:i.toString(),disabled:d})}return n}),[u,c,M,T,f]),A=e.useCallback((function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=[],o=0;o<60;o+=g){var n=u?e:M(e,t),l=T(n,o);r.push({value:o,label:o.toString().padStart(2,"0"),disabled:l})}return r}),[u,c,M,T,g]),H=x(r((function(){var e,t=l||new Date,r=u?t.getHours():0===(e=t.getHours())?12:e>12?e-12:e,o=t.getMinutes();return{hour:B(r),minute:k(o),period:E(t.getHours())}})),2),z=H[0],P=H[1],j=x(r((function(){return D(z.period)})),2),R=j[0],Y=j[1],N=x(r((function(){return A(z.hour,z.period)})),2),F=N[0],O=N[1];o((function(){Y(D(z.period)),O(A(z.hour,z.period))}),[z.hour,z.period,c,D,A]),o((function(){var e=l||new Date,t=new Date(e);u?t.setHours(z.hour):t.setHours(M(z.hour,z.period)),t.setMinutes(z.minute),t.setSeconds(0),t.getHours()===e.getHours()&&t.getMinutes()===e.getMinutes()||i(t)}),[z,i,l,u,M]);var L={light:{backgroundColor:"#ffffff",textColor:"#666666",selectedTextColor:"#000000",highlightColor:"rgba(0, 0, 0, 0.05)",highlightBorderColor:"rgba(0, 0, 0, 0.1)",labelColor:"#999999"},dark:{backgroundColor:"#1e1e1e",textColor:"#a0a0a0",selectedTextColor:"#ffffff",highlightColor:"rgba(255, 255, 255, 0.1)",highlightBorderColor:"rgba(255, 255, 255, 0.2)",labelColor:"#777777"}},I=L[w]||L.light;return e.createElement("div",{className:"crisli-time-picker",style:{backgroundColor:I.backgroundColor,borderRadius:"12px",padding:"20px 10px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.1)"}},e.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"space-between",marginBottom:"10px",paddingLeft:"10px",paddingRight:"10px"}},e.createElement("div",{style:{flex:1,textAlign:"center",color:I.labelColor,fontSize:"12px"}},"Hour"),e.createElement("div",{style:{flex:1,textAlign:"center",color:I.labelColor,fontSize:"12px"}},"Minute"),!u&&e.createElement("div",{style:{flex:1,textAlign:"center",color:I.labelColor,fontSize:"12px"}},"AM/PM")),e.createElement("div",{className:"crisli-wheels-container",style:{display:"flex",width:"100%",justifyContent:"space-between",gap:"5px"}},e.createElement("div",{style:{flex:1}},e.createElement(C,p({items:R,value:z.hour,onChange:function(e){var t=u?e:M(e,z.period);c&&T(t,z.minute)||P((function(t){return v(v({},t),{},{hour:e})}))},textColor:I.textColor,selectedTextColor:I.selectedTextColor,highlightColor:I.highlightColor,highlightBorderColor:I.highlightBorderColor,fontSize:"14px"},b))),e.createElement("div",{style:{flex:1}},e.createElement(C,p({items:F,value:z.minute,onChange:function(e){var t=u?z.hour:M(z.hour,z.period);c&&T(t,e)||P((function(t){return v(v({},t),{},{minute:e})}))},textColor:I.textColor,selectedTextColor:I.selectedTextColor,highlightColor:I.highlightColor,highlightBorderColor:I.highlightBorderColor,fontSize:"14px"},b))),!u&&e.createElement("div",{style:{flex:1}},e.createElement(C,p({items:[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],value:z.period,onChange:function(e){var t=M(z.hour,e);c&&T(t,z.minute)||P((function(t){return v(v({},t),{},{period:e})}))},textColor:I.textColor,selectedTextColor:I.selectedTextColor,highlightColor:I.highlightColor,highlightBorderColor:I.highlightBorderColor,fontSize:"14px"},b)))))},w=function(t){var r=t.items,o=void 0===r?[]:r,n=t.value,l=t.onChange,i=t.label,a=t.wheelProps,u=void 0===a?{}:a,d=t.theme,c={light:{backgroundColor:"#ffffff",textColor:"#666666",selectedTextColor:"#000000",highlightColor:"rgba(0, 0, 0, 0.05)",highlightBorderColor:"rgba(0, 0, 0, 0.1)",labelColor:"#999999"},dark:{backgroundColor:"#1e1e1e",textColor:"#a0a0a0",selectedTextColor:"#ffffff",highlightColor:"rgba(255, 255, 255, 0.1)",highlightBorderColor:"rgba(255, 255, 255, 0.2)",labelColor:"#777777"}},s=c[void 0===d?"light":d]||c.light;return e.createElement("div",{className:"crisli-wheel-picker",style:{backgroundColor:s.backgroundColor,borderRadius:"12px",padding:"20px 10px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.1)"}},i&&e.createElement("div",{style:{textAlign:"center",marginBottom:"10px",color:s.labelColor,fontSize:"12px"}},i),e.createElement(C,p({items:o,value:n,onChange:l,textColor:s.textColor,selectedTextColor:s.selectedTextColor,highlightColor:s.highlightColor,highlightBorderColor:s.highlightBorderColor},u)))},E=function(t){var h=t.value,f=void 0===h?new Date:h,m=t.onChange,b=t.showTime,y=void 0===b||b,w=t.use24Hours,E=void 0===w||w,M=t.disablePast,S=void 0!==M&&M,k=t.minuteStep,B=void 0===k?1:k,T=t.hourStep,D=void 0===T?1:T,A=t.wheelProps,H=void 0===A?{}:A,z=t.theme,P=void 0===z?"light":z,j=function(e){return e>=12?"PM":"AM"},R=e.useCallback((function(e,t){return"AM"===t?12===e?0:e:12===e?12:e+12}),[]),Y=e.useCallback((function(e,t,r){if(t<=1)return e;var o=Math.round(e/t)*t;return Math.min(o,r)}),[]),N=e.useCallback((function(e){return Y(e,B,59)}),[B,Y]),F=e.useCallback((function(e){return Y(e,D,E?23:12)}),[D,E,Y]),O=e.useMemo((function(){return new Date}),[]),L=e.useMemo((function(){return new Date(O.getFullYear(),O.getMonth(),O.getDate())}),[O]),I=e.useCallback((function(e){return!!S&&new Date(e.getFullYear(),e.getMonth(),e.getDate())<L}),[S,L]),W=e.useCallback((function(e,t,r){return!(!S||!y)&&(new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()===L.getTime()&&new Date(e.getFullYear(),e.getMonth(),e.getDate(),t,r)<=O)}),[S,y,L,O]),q=x(r(new Date(f||new Date)),2),U=q[0],$=q[1],G=x(r(new Date(f||new Date)),2),J=G[0],K=G[1],Q=e.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(E){for(var r=[],o=0;o<24;o+=D){var n=W(e,o,0);r.push({value:o,label:o.toString().padStart(2,"0"),disabled:n})}return r}for(var l=[],i=1;i<=12;i+=D){var a=i,u=t?R(a,t):a,d=W(e,u,0);l.push({value:a,label:a.toString(),disabled:d})}return l}),[E,S,R,W,D]),V=e.useCallback((function(e,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=[],n=0;n<60;n+=B){var l=E?t:R(t,r),i=W(e,l,n);o.push({value:n,label:n.toString().padStart(2,"0"),disabled:i})}return o}),[E,S,R,W,B]),X=x(r((function(){var e,t=f||new Date,r=E?t.getHours():0===(e=t.getHours())?12:e>12?e-12:e,o=t.getMinutes();return{hour:F(r),minute:N(o),period:j(t.getHours())}})),2),Z=X[0],_=X[1],ee=x(r((function(){return Q(J,Z.period)})),2),te=ee[0],re=ee[1],oe=x(r((function(){return V(J,Z.hour,Z.period)})),2),ne=oe[0],le=oe[1];o((function(){y&&(re(Q(J,Z.period)),le(V(J,Z.hour,Z.period)))}),[J,Z.hour,Z.period,y,S,Q,V]),o((function(){var e=E?Z.hour:R(Z.hour,Z.period),t=new Date(J);t.setHours(e),t.setMinutes(Z.minute);var r=f||new Date;t.getTime()!==r.getTime()&&m(t)}),[J,Z,m,f,E,R]);var ie=function(e){S&&I(e)||K(e)},ae={light:{backgroundColor:"#ffffff",textColor:"#666666",selectedTextColor:"#000000",highlightColor:"rgba(0, 0, 0, 0.05)",highlightBorderColor:"rgba(0, 0, 0, 0.1)",labelColor:"#999999",calendarHeaderBg:"#f8f8f8",todayBg:"#f0f0f0",selectedBg:"#4a90e2",selectedText:"#ffffff",dayHoverBg:"#f5f5f5"},dark:{backgroundColor:"#1e1e1e",textColor:"#a0a0a0",selectedTextColor:"#ffffff",highlightColor:"rgba(255, 255, 255, 0.1)",highlightBorderColor:"rgba(255, 255, 255, 0.2)",labelColor:"#777777",calendarHeaderBg:"#2a2a2a",todayBg:"#333333",selectedBg:"#4a90e2",selectedText:"#ffffff",dayHoverBg:"#2c2c2c"}},ue=ae[P]||ae.light;return e.createElement("div",{className:"crisli-calendar-time-picker",style:{backgroundColor:ue.backgroundColor,borderRadius:"12px",padding:"20px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.1)",width:"100%",maxWidth:"350px"}},e.createElement("div",{className:"calendar-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"15px",padding:"5px 10px",backgroundColor:ue.calendarHeaderBg,borderRadius:"8px"}},e.createElement("div",{className:"prev-month",onClick:function(){$(l(U,-1))},style:{cursor:"pointer",padding:"5px 10px",fontSize:"18px"}},"‹"),e.createElement("div",{style:{fontWeight:"bold",color:ue.textColor}},n(U,"MMMM yyyy")),e.createElement("div",{className:"next-month",onClick:function(){$(l(U,1))},style:{cursor:"pointer",padding:"5px 10px",fontSize:"18px"}},"›")),e.createElement("div",{className:"calendar",style:{marginBottom:y?"20px":"0"}},function(){for(var t=[],r=i(new Date),o=0;o<7;o++)t.push(e.createElement("div",{className:"day-name",key:o,style:{textAlign:"center",padding:"8px 0",fontWeight:"bold",color:ue.labelColor}},n(a(r,o),"EEE")));return e.createElement("div",{className:"days",style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},t)}(),function(){for(var t=u(U),r=d(t),o=i(t),l=c(r),h=[],f=[],p=o;p<=l;){for(var m=function(){var r=new Date(p),o=I(r),l=!s(p,t)||o;f.push(e.createElement("div",{className:"day ".concat(l?"disabled":""," ").concat(g(p,J)?"selected":""," ").concat(g(p,new Date)?"today":""),key:p.toString(),onClick:function(){return ie(r)},style:{padding:"8px 0",textAlign:"center",cursor:l?"not-allowed":"pointer",borderRadius:"50%",margin:"2px",backgroundColor:g(p,J)?ue.selectedBg:g(p,new Date)?ue.todayBg:"transparent",color:g(p,J)?ue.selectedText:l?"#ccc":ue.textColor,opacity:l?.4:1,textDecoration:o?"line-through":"none",":hover":{backgroundColor:l?"transparent":ue.dayHoverBg}}},n(p,"d"))),p=a(p,1)},v=0;v<7;v++)m();h.push(e.createElement("div",{className:"row",key:p.toString(),style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},f)),f=[]}return e.createElement("div",{className:"calendar-body"},h)}()),y&&e.createElement("div",null,e.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"center",marginBottom:"10px",marginTop:"20px"}},e.createElement("div",{style:{textAlign:"center",color:ue.labelColor,fontSize:"14px",fontWeight:"bold"}},"Time: ",Z.hour.toString().padStart(2,"0"),":",Z.minute.toString().padStart(2,"0"),E?"":" ".concat(Z.period))),e.createElement("div",{className:"time-wheels-container",style:{display:"flex",width:"100%",justifyContent:"center",gap:"10px"}},e.createElement("div",{style:{width:"80px"}},e.createElement(C,p({items:te,value:Z.hour,onChange:function(e){var t=E?e:R(e,Z.period);S&&W(J,t,Z.minute)||_((function(t){return v(v({},t),{},{hour:e})}))},textColor:ue.textColor,selectedTextColor:ue.selectedTextColor,highlightColor:ue.highlightColor,highlightBorderColor:ue.highlightBorderColor,fontSize:"16px"},H))),e.createElement("div",{style:{width:"80px"}},e.createElement(C,p({items:ne,value:Z.minute,onChange:function(e){var t=E?Z.hour:R(Z.hour,Z.period);S&&W(J,t,e)||_((function(t){return v(v({},t),{},{minute:e})}))},textColor:ue.textColor,selectedTextColor:ue.selectedTextColor,highlightColor:ue.highlightColor,highlightBorderColor:ue.highlightBorderColor,fontSize:"16px"},H))),!E&&e.createElement("div",{style:{width:"60px"}},e.createElement(C,p({items:[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],value:Z.period,onChange:function(e){var t=R(Z.hour,e);S&&W(J,t,Z.minute)||_((function(t){return v(v({},t),{},{period:e})}))},textColor:ue.textColor,selectedTextColor:ue.selectedTextColor,highlightColor:ue.highlightColor,highlightBorderColor:ue.highlightBorderColor,fontSize:"16px"},H))))))},M=function(t){var h=t.value,f=void 0===h?new Date:h,m=t.onChange,b=t.showTime,y=void 0===b||b,w=t.wheelProps,E=void 0===w?{}:w,M=t.theme,S=void 0===M?"light":M,k=t.className,B=void 0===k?"":k,T=t.style,D=void 0===T?{}:T,A=t.use24Hour,H=void 0===A||A,z=t.disablePast,P=void 0!==z&&z,j=t.minuteStep,R=void 0===j?1:j,Y=t.hourStep,N=void 0===Y?1:Y;t.timeFormat;var F=function(e){return e>=12?"PM":"AM"},O=e.useCallback((function(e,t){return"AM"===t?12===e?0:e:12===e?12:e+12}),[]),L=e.useCallback((function(e,t,r){if(t<=1)return e;var o=Math.round(e/t)*t;return Math.min(o,r)}),[]),I=e.useCallback((function(e){return L(e,R,59)}),[R,L]),W=e.useCallback((function(e){return L(e,N,H?23:12)}),[N,H,L]),q=e.useMemo((function(){return new Date}),[]),U=e.useMemo((function(){return new Date(q.getFullYear(),q.getMonth(),q.getDate())}),[q]),$=e.useCallback((function(e){return!!P&&new Date(e.getFullYear(),e.getMonth(),e.getDate())<U}),[P,U]),G=e.useCallback((function(e,t,r){return!(!P||!y)&&(new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()===U.getTime()&&new Date(e.getFullYear(),e.getMonth(),e.getDate(),t,r)<=q)}),[P,y,U,q]),J=x(r(new Date(f||new Date)),2),K=J[0],Q=J[1],V=x(r(new Date(f||new Date)),2),X=V[0],Z=V[1],_=x(r((function(){var e,t=f||new Date,r=H?t.getHours():0===(e=t.getHours())?12:e>12?e-12:e,o=t.getMinutes();return{hour:W(r),minute:I(o),period:F(t.getHours())}})),2),ee=_[0],te=_[1],re=e.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(H){for(var r=[],o=0;o<24;o+=N){var n=G(e,o,0);r.push({value:o,label:o.toString().padStart(2,"0"),disabled:n})}return r}for(var l=[],i=1;i<=12;i+=N){var a=i,u=t?O(a,t):a,d=G(e,u,0);l.push({value:a,label:a.toString(),disabled:d})}return l}),[H,P,O,G,N]),oe=e.useCallback((function(e,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=[],n=0;n<60;n+=R){var l=H?t:O(t,r),i=G(e,l,n);o.push({value:n,label:n.toString().padStart(2,"0"),disabled:i})}return o}),[H,P,O,G,R]),ne=[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],le=x(r((function(){return re(X,ee.period)})),2),ie=le[0],ae=le[1],ue=x(r((function(){return oe(X,ee.hour,ee.period)})),2),de=ue[0],ce=ue[1];o((function(){y&&(ae(re(X,ee.period)),ce(oe(X,ee.hour,ee.period)))}),[X,ee.hour,ee.period,y,P,re,oe]),o((function(){var e=H?ee.hour:O(ee.hour,ee.period),t=new Date(X);t.setHours(e),t.setMinutes(ee.minute);var r=f||new Date;t.getTime()!==r.getTime()&&m(t)}),[X,ee,m,f,H,O]);var se=function(e){var t=H?e:O(e,ee.period);P&&G(X,t,ee.minute)||te((function(t){return v(v({},t),{},{hour:e})}))},ge=function(e){var t=H?ee.hour:O(ee.hour,ee.period);P&&G(X,t,e)||te((function(t){return v(v({},t),{},{minute:e})}))},he=function(e){var t=O(ee.hour,e);P&&G(X,t,ee.minute)||te((function(t){return v(v({},t),{},{period:e})}))},fe=function(e){P&&$(e)||Z(e)},pe={light:{backgroundColor:"#ffffff",textColor:"#666666",selectedTextColor:"#000000",highlightColor:"rgba(59, 130, 246, 0.1)",highlightBorderColor:"rgba(59, 130, 246, 0.3)",labelColor:"#999999",calendarHeaderBg:"#f8f8f8",todayBg:"#f0f0f0",selectedBg:"#3b82f6",selectedText:"#ffffff",dayHoverBg:"#f5f5f5",dividerColor:"#e0e0e0",timeHeaderBg:"#f8f8f8",wheelBg:"#f5f5f5"},dark:{backgroundColor:"#1e1e1e",textColor:"#a0a0a0",selectedTextColor:"#ffffff",highlightColor:"rgba(239, 68, 68, 0.2)",highlightBorderColor:"rgba(239, 68, 68, 0.4)",labelColor:"#777777",calendarHeaderBg:"#2a2a2a",todayBg:"#333333",selectedBg:"#ef4444",selectedText:"#ffffff",dayHoverBg:"#2c2c2c",dividerColor:"#333333",timeHeaderBg:"#2a2a2a",wheelBg:"#252525"},crisis:{backgroundColor:"#1e1e1e",textColor:"#a0a0a0",selectedTextColor:"#ffffff",highlightColor:"rgba(185, 28, 28, 0.2)",highlightBorderColor:"rgba(185, 28, 28, 0.4)",labelColor:"#777777",calendarHeaderBg:"#2a2a2a",todayBg:"#333333",selectedBg:"#b91c1c",selectedText:"#ffffff",dayHoverBg:"#2c2c2c",dividerColor:"#333333",timeHeaderBg:"#2a2a2a",wheelBg:"#252525"}},me=pe[S]||pe.light,ve=x(r((function(){return"undefined"!=typeof window&&window.innerWidth<768})),2),xe=ve[0],Ce=ve[1];return o((function(){var e=function(){Ce(window.innerWidth<768)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),e.createElement("div",{className:"crisli-horizontal-calendar-time-picker ".concat(B),style:v({backgroundColor:me.backgroundColor,borderRadius:"12px",padding:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.1)",width:"100%"},D)},e.createElement("div",{style:{display:"flex",flexDirection:xe?"column":"row",borderRadius:"8px",alignItems:xe?"stretch":"flex-start",width:"100%"}},e.createElement("div",{style:{flex:xe?"1 1 auto":"2.5",marginRight:"0",marginBottom:y&&xe?"15px":"0",padding:"5px",width:xe?"100%":"auto"}},e.createElement("div",{className:"calendar-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px",padding:"4px 6px",backgroundColor:me.timeHeaderBg,borderRadius:"6px",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.05)",height:"28px"}},e.createElement("div",{className:"prev-month",onClick:function(){Q(l(K,-1))},style:{cursor:"pointer",padding:"2px 6px",fontSize:"16px",color:me.textColor,borderRadius:"4px",transition:"background-color 0.2s",":hover":{backgroundColor:me.highlightColor}}},"‹"),e.createElement("div",{style:{fontWeight:"bold",color:me.selectedTextColor,fontSize:"14px",display:"flex",alignItems:"center",justifyContent:"center",flex:1}},n(K,"MMMM yyyy")),e.createElement("div",{className:"next-month",onClick:function(){Q(l(K,1))},style:{cursor:"pointer",padding:"2px 6px",fontSize:"16px",color:me.textColor,borderRadius:"4px",transition:"background-color 0.2s",":hover":{backgroundColor:me.highlightColor}}},"›")),e.createElement("div",{className:"calendar",style:{borderRadius:"8px",overflow:"hidden"}},function(){for(var t=[],r=i(new Date),o="undefined"!=typeof window&&window.innerWidth<480,l=o?28:30,u=o?"10px":"11px",d=0;d<7;d++){var c=n(a(r,d),o?"EEEEE":"EEE"),s=0===d||6===d;t.push(e.createElement("div",{className:"day-name",key:d,style:{textAlign:"center",padding:o?"8px 0":"10px 0",fontWeight:"600",fontSize:u,color:s?me.selectedBg:me.labelColor,borderBottom:"1px solid ".concat(me.dividerColor),width:"".concat(l,"px"),margin:"0 auto"}},c))}return e.createElement("div",{className:"days",style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"}},t)}(),function(){for(var t=u(K),r=d(t),o=i(t),l=c(r),h="undefined"!=typeof window&&window.innerWidth<480,f=h?28:30,p=h?"11px":"12px",m=[],v=[],x=o;x<=l;){for(var C=function(){var r=new Date(x),o=g(x,new Date),l=g(x,X),i=s(x,t),u=$(r),d=!i||u;v.push(e.createElement("div",{className:"day ".concat(d?"disabled":""," ").concat(l?"selected":""," ").concat(o?"today":""),key:x.toString(),onClick:function(){return fe(r)},style:{padding:"0",textAlign:"center",cursor:d?"not-allowed":"pointer",borderRadius:"50%",margin:h?"1px":"2px",width:"".concat(f,"px"),height:"".concat(f,"px"),display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",backgroundColor:l?me.selectedBg:o?me.todayBg:"transparent",color:l?me.selectedText:d?"#ccc":me.textColor,opacity:d?.4:1,fontWeight:o||l?"bold":"normal",fontSize:p,textDecoration:u?"line-through":"none",boxShadow:l?"0 2px 4px rgba(0, 0, 0, 0.1)":"none",":hover":{backgroundColor:d?"transparent":l?me.selectedBg:me.dayHoverBg,transform:d?"none":"scale(1.05)"}}},n(x,"d"))),x=a(x,1)},b=0;b<7;b++)C();m.push(e.createElement("div",{className:"row",key:x.toString(),style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",justifyItems:"center"}},v)),v=[]}return e.createElement("div",{className:"calendar-body"},m)}())),y&&e.createElement("div",{style:{flex:xe?"1 1 auto":"1.5",borderLeft:xe?"none":"1px solid ".concat(me.dividerColor),borderTop:xe?"1px solid ".concat(me.dividerColor):"none",padding:xe?"10px 5px 5px":"5px 5px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"dark"===S?"rgba(30, 30, 30, 0.2)":"rgba(245, 245, 245, 0.5)",borderRadius:"8px",width:xe?"100%":"auto"}},function(){if(!y)return null;var t;if(H)t="".concat(ee.hour.toString().padStart(2,"0"),":").concat(ee.minute.toString().padStart(2,"0"));else{var r=ee.hour%12||12,o=ee.hour>=12?"PM":"AM";t="".concat(r.toString().padStart(2,"0"),":").concat(ee.minute.toString().padStart(2,"0")," ").concat(o)}"undefined"!=typeof window&&window.innerWidth;return e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",padding:"0 5px",width:"100%"}},e.createElement("div",{style:{textAlign:"center",color:me.selectedTextColor,fontSize:"14px",fontWeight:"bold",marginBottom:"6px",backgroundColor:me.timeHeaderBg,padding:"4px 6px",borderRadius:"6px",width:"100%",height:"28px",display:"flex",alignItems:"center",justifyContent:"center"}},t),e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"10px",width:"100%",justifyContent:"center",padding:"0 10px"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"1"}},e.createElement("div",{style:{fontSize:"11px",color:me.labelColor,marginBottom:"3px",fontWeight:"500"}},"Hour"),e.createElement("div",{style:{width:xe?"60px":"50px",backgroundColor:"dark"===S?"rgba(30, 30, 30, 0.8)":"rgba(245, 245, 245, 0.9)",borderRadius:"8px",padding:"2px 0",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"}},e.createElement(C,p({items:ie,value:ee.hour,onChange:se,textColor:me.textColor,selectedTextColor:me.selectedTextColor,highlightColor:me.highlightColor,highlightBorderColor:me.highlightBorderColor,fontSize:"13px",itemHeight:28},E)))),e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"1"}},e.createElement("div",{style:{fontSize:"11px",color:me.labelColor,marginBottom:"3px",fontWeight:"500"}},"Minute"),e.createElement("div",{style:{width:xe?"60px":"50px",backgroundColor:"dark"===S?"rgba(30, 30, 30, 0.8)":"rgba(245, 245, 245, 0.9)",borderRadius:"8px",padding:"2px 0",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"}},e.createElement(C,p({items:de,value:ee.minute,onChange:ge,textColor:me.textColor,selectedTextColor:me.selectedTextColor,highlightColor:me.highlightColor,highlightBorderColor:me.highlightBorderColor,fontSize:"13px",itemHeight:28},E)))),!H&&e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"0.8"}},e.createElement("div",{style:{fontSize:"11px",color:me.labelColor,marginBottom:"3px",fontWeight:"500"}},"Period"),e.createElement("div",{style:{width:xe?"50px":"40px",backgroundColor:"dark"===S?"rgba(30, 30, 30, 0.8)":"rgba(245, 245, 245, 0.9)",borderRadius:"8px",padding:"2px 0",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"}},e.createElement(C,p({items:ne,value:ee.period,onChange:he,textColor:me.textColor,selectedTextColor:me.selectedTextColor,highlightColor:me.highlightColor,highlightBorderColor:me.highlightBorderColor,fontSize:"13px",itemHeight:28},E))))))}())),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",padding:"8px 10px",borderTop:"1px solid ".concat(me.dividerColor),marginTop:"8px"}},e.createElement("button",{onClick:function(){Z(new Date),te({hour:H?0:12,minute:0,period:"AM"}),m(null)},style:{background:"transparent",border:"none",padding:"6px 10px",borderRadius:"4px",cursor:"pointer",fontSize:"13px",color:"crisis"===S?"#ef4444":me.textColor,transition:"color 0.2s",":hover":{color:"crisis"===S?"#dc2626":me.selectedBg}}},"Clear"),e.createElement("button",{onClick:function(){},style:{background:me.selectedBg,border:"none",padding:"6px 14px",borderRadius:"4px",cursor:"pointer",fontSize:"13px",fontWeight:"600",color:"#ffffff",transition:"opacity 0.2s",":hover":{opacity:.9}}},"Set")))};export{E as CalendarTimePicker,b as DateTimePicker,M as HorizontalCalendarTimePicker,y as TimePicker,C as Wheel,w as WheelPicker};
//# sourceMappingURL=index.esm.js.map