UNPKG

bme-calendar

Version:

Developed for [Book My Event](https://evently-book.vercel.app/).

38 lines (35 loc) 27.3 kB
(function(ue,q){typeof exports=="object"&&typeof module<"u"?q(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],q):(ue=typeof globalThis<"u"?globalThis:ue||self,q(ue["bme-calendar"]={},ue.React))})(this,function(ue,q){"use strict";var Te=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function je(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var $e={exports:{}},ye={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Oe;function Ze(){if(Oe)return ye;Oe=1;var p=q,k=Symbol.for("react.element"),x=Symbol.for("react.fragment"),j=Object.prototype.hasOwnProperty,$=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function D(u,c,b){var g,m={},N=null,W=null;b!==void 0&&(N=""+b),c.key!==void 0&&(N=""+c.key),c.ref!==void 0&&(W=c.ref);for(g in c)j.call(c,g)&&!h.hasOwnProperty(g)&&(m[g]=c[g]);if(u&&u.defaultProps)for(g in c=u.defaultProps,c)m[g]===void 0&&(m[g]=c[g]);return{$$typeof:k,type:u,key:N,ref:W,props:m,_owner:$.current}}return ye.Fragment=x,ye.jsx=D,ye.jsxs=D,ye}var ge={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ce;function Xe(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var p=q,k=Symbol.for("react.element"),x=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),M=Symbol.iterator,v="@@iterator";function U(e){if(e===null||typeof e!="object")return null;var t=M&&e[M]||e[v];return typeof t=="function"?t:null}var z=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(e){{for(var t=arguments.length,i=new Array(t>1?t-1:0),l=1;l<t;l++)i[l-1]=arguments[l];X("error",e,i)}}function X(e,t,i){{var l=z.ReactDebugCurrentFrame,E=l.getStackAddendum();E!==""&&(t+="%s",i=i.concat([E]));var T=i.map(function(_){return String(_)});T.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,T)}}var w=!1,H=!1,K=!1,ce=!1,se=!1,le;le=Symbol.for("react.module.reference");function F(e){return!!(typeof e=="string"||typeof e=="function"||e===j||e===h||se||e===$||e===b||e===g||ce||e===W||w||H||K||typeof e=="object"&&e!==null&&(e.$$typeof===N||e.$$typeof===m||e.$$typeof===D||e.$$typeof===u||e.$$typeof===c||e.$$typeof===le||e.getModuleId!==void 0))}function S(e,t,i){var l=e.displayName;if(l)return l;var E=t.displayName||t.name||"";return E!==""?i+"("+E+")":i}function fe(e){return e.displayName||"Context"}function Q(e){if(e==null)return null;if(typeof e.tag=="number"&&O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case x:return"Portal";case h:return"Profiler";case $:return"StrictMode";case b:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case u:var t=e;return fe(t)+".Consumer";case D:var i=e;return fe(i._context)+".Provider";case c:return S(e,e.render,"ForwardRef");case m:var l=e.displayName||null;return l!==null?l:Q(e.type)||"Memo";case N:{var E=e,T=E._payload,_=E._init;try{return Q(_(T))}catch{return null}}}return null}var o=Object.assign,n=0,r,s,a,f,d,R,C;function A(){}A.__reactDisabledLog=!0;function V(){{if(n===0){r=console.log,s=console.info,a=console.warn,f=console.error,d=console.group,R=console.groupCollapsed,C=console.groupEnd;var e={configurable:!0,enumerable:!0,value:A,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}n++}}function B(){{if(n--,n===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:o({},e,{value:r}),info:o({},e,{value:s}),warn:o({},e,{value:a}),error:o({},e,{value:f}),group:o({},e,{value:d}),groupCollapsed:o({},e,{value:R}),groupEnd:o({},e,{value:C})})}n<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=z.ReactCurrentDispatcher,ee;function ne(e,t,i){{if(ee===void 0)try{throw Error()}catch(E){var l=E.stack.trim().match(/\n( *(at )?)/);ee=l&&l[1]||""}return` `+ee+e}}var te=!1,L;{var ae=typeof WeakMap=="function"?WeakMap:Map;L=new ae}function oe(e,t){if(!e||te)return"";{var i=L.get(e);if(i!==void 0)return i}var l;te=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var T;T=re.current,re.current=null,V();try{if(t){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(J){l=J}Reflect.construct(e,[],_)}else{try{_.call()}catch(J){l=J}e.call(_.prototype)}}else{try{throw Error()}catch(J){l=J}e()}}catch(J){if(J&&l&&typeof J.stack=="string"){for(var y=J.stack.split(` `),G=l.stack.split(` `),I=y.length-1,Y=G.length-1;I>=1&&Y>=0&&y[I]!==G[Y];)Y--;for(;I>=1&&Y>=0;I--,Y--)if(y[I]!==G[Y]){if(I!==1||Y!==1)do if(I--,Y--,Y<0||y[I]!==G[Y]){var Z=` `+y[I].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,Z),Z}while(I>=1&&Y>=0);break}}}finally{te=!1,re.current=T,B(),Error.prepareStackTrace=E}var ve=e?e.displayName||e.name:"",de=ve?ne(ve):"";return typeof e=="function"&&L.set(e,de),de}function he(e,t,i){return oe(e,!1)}function pt(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function De(e,t,i){if(e==null)return"";if(typeof e=="function")return oe(e,pt(e));if(typeof e=="string")return ne(e);switch(e){case b:return ne("Suspense");case g:return ne("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return he(e.render);case m:return De(e.type,t,i);case N:{var l=e,E=l._payload,T=l._init;try{return De(T(E),t,i)}catch{}}}return""}var _e=Object.prototype.hasOwnProperty,Ie={},Fe=z.ReactDebugCurrentFrame;function we(e){if(e){var t=e._owner,i=De(e.type,e._source,t?t.type:null);Fe.setExtraStackFrame(i)}else Fe.setExtraStackFrame(null)}function vt(e,t,i,l,E){{var T=Function.call.bind(_e);for(var _ in e)if(T(e,_)){var y=void 0;try{if(typeof e[_]!="function"){var G=Error((l||"React class")+": "+i+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw G.name="Invariant Violation",G}y=e[_](t,_,l,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(I){y=I}y&&!(y instanceof Error)&&(we(E),O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",i,_,typeof y),we(null)),y instanceof Error&&!(y.message in Ie)&&(Ie[y.message]=!0,we(E),O("Failed %s type: %s",i,y.message),we(null))}}}var yt=Array.isArray;function Se(e){return yt(e)}function gt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,i=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function mt(e){try{return Ye(e),!1}catch{return!0}}function Ye(e){return""+e}function Ne(e){if(mt(e))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",gt(e)),Ye(e)}var Le=z.ReactCurrentOwner,_t={key:!0,ref:!0,__self:!0,__source:!0},Ue,Ve;function bt(e){if(_e.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Dt(e){if(_e.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function wt(e,t){typeof e.ref=="string"&&Le.current}function $t(e,t){{var i=function(){Ue||(Ue=!0,O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function St(e,t){{var i=function(){Ve||(Ve=!0,O("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var Et=function(e,t,i,l,E,T,_){var y={$$typeof:k,type:e,key:t,ref:i,props:_,_owner:T};return y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(y,"_self",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.defineProperty(y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y};function xt(e,t,i,l,E){{var T,_={},y=null,G=null;i!==void 0&&(Ne(i),y=""+i),Dt(t)&&(Ne(t.key),y=""+t.key),bt(t)&&(G=t.ref,wt(t,E));for(T in t)_e.call(t,T)&&!_t.hasOwnProperty(T)&&(_[T]=t[T]);if(e&&e.defaultProps){var I=e.defaultProps;for(T in I)_[T]===void 0&&(_[T]=I[T])}if(y||G){var Y=typeof e=="function"?e.displayName||e.name||"Unknown":e;y&&$t(_,Y),G&&St(_,Y)}return Et(e,y,G,E,l,Le.current,_)}}var Ee=z.ReactCurrentOwner,He=z.ReactDebugCurrentFrame;function pe(e){if(e){var t=e._owner,i=De(e.type,e._source,t?t.type:null);He.setExtraStackFrame(i)}else He.setExtraStackFrame(null)}var xe;xe=!1;function Re(e){return typeof e=="object"&&e!==null&&e.$$typeof===k}function Ge(){{if(Ee.current){var e=Q(Ee.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function Rt(e){return""}var Be={};function Mt(e){{var t=Ge();if(!t){var i=typeof e=="string"?e:e.displayName||e.name;i&&(t=` Check the top-level render call using <`+i+">.")}return t}}function Je(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=Mt(t);if(Be[i])return;Be[i]=!0;var l="";e&&e._owner&&e._owner!==Ee.current&&(l=" It was passed a child from "+Q(e._owner.type)+"."),pe(e),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,l),pe(null)}}function ze(e,t){{if(typeof e!="object")return;if(Se(e))for(var i=0;i<e.length;i++){var l=e[i];Re(l)&&Je(l,t)}else if(Re(e))e._store&&(e._store.validated=!0);else if(e){var E=U(e);if(typeof E=="function"&&E!==e.entries)for(var T=E.call(e),_;!(_=T.next()).done;)Re(_.value)&&Je(_.value,t)}}}function Tt(e){{var t=e.type;if(t==null||typeof t=="string")return;var i;if(typeof t=="function")i=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===c||t.$$typeof===m))i=t.propTypes;else return;if(i){var l=Q(t);vt(i,e.props,"prop",l,e)}else if(t.PropTypes!==void 0&&!xe){xe=!0;var E=Q(t);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jt(e){{for(var t=Object.keys(e.props),i=0;i<t.length;i++){var l=t[i];if(l!=="children"&&l!=="key"){pe(e),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",l),pe(null);break}}e.ref!==null&&(pe(e),O("Invalid attribute `ref` supplied to `React.Fragment`."),pe(null))}}var qe={};function Ke(e,t,i,l,E,T){{var _=F(e);if(!_){var y="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var G=Rt();G?y+=G:y+=Ge();var I;e===null?I="null":Se(e)?I="array":e!==void 0&&e.$$typeof===k?(I="<"+(Q(e.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):I=typeof e,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",I,y)}var Y=xt(e,t,i,E,T);if(Y==null)return Y;if(_){var Z=t.children;if(Z!==void 0)if(l)if(Se(Z)){for(var ve=0;ve<Z.length;ve++)ze(Z[ve],e);Object.freeze&&Object.freeze(Z)}else O("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ze(Z,e)}if(_e.call(t,"key")){var de=Q(e),J=Object.keys(t).filter(function(At){return At!=="key"}),Me=J.length>0?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}";if(!qe[de+Me]){var Wt=J.length>0?"{"+J.join(": ..., ")+": ...}":"{}";O(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,Me,de,Wt,de),qe[de+Me]=!0}}return e===j?jt(Y):Tt(Y),Y}}function Ot(e,t,i){return Ke(e,t,i,!0)}function Ct(e,t,i){return Ke(e,t,i,!1)}var kt=Ct,Pt=Ot;ge.Fragment=j,ge.jsx=kt,ge.jsxs=Pt}()),ge}process.env.NODE_ENV==="production"?$e.exports=Ze():$e.exports=Xe();var P=$e.exports;const Qe={calendar:"_calendar_1274d_1"};function et(){const[p,k]=q.useState(),[x,j]=q.useState(new Date),$=x.getFullYear(),h=(x.getMonth()+1).toString().padStart(2,"0"),D=new Intl.DateTimeFormat("uk-UK",{month:"long"}).format(x),u=new Date($,+h,0).getDate(),c=new Date(`${$}-${h}-01`).getDay(),g=(new Date($,Number(h)-2).getMonth()+1).toString().padStart(2,"0"),m=new Date($,+g,0).getDate(),N=(x.getMonth()+2).toString().padStart(2,"0"),W=()=>{const v=new Date(`${$}-${h}-01`),U=new Date(v.setDate(v.getDate()+u));j(U)},M=()=>{const v=new Date(`${$}-${h}-01`),U=new Date(v.setDate(v.getDate()-m));j(U)};return q.useEffect(()=>{const v=[];if(c!==0)for(let w=m;w>m-c+1;w--)v.push({id:`${$}-${g}-${w.toString().padStart(2,"0")}`,day:w,type:"prev"});else for(let w=m;w>m-6;w--)v.push({id:`${$}-${g}-${w.toString().padStart(2,"0")}`,day:w,type:"prev"});const U=[];for(let w=1;w<=u;w++)U.push({id:`${$}-${h}-${w.toString().padStart(2,"0")}`,day:w,type:"current"});const z=[...v.reverse(),...U],O=[];for(let w=0;w<=z.length;w+=7)O.push(z.slice(w,w+7));const X=O.length*7-O.flat().length;if(X!==7)for(let w=1;w<=X;w++)O[O.length-1].push({id:`${$}-${N}-${w.toString().padStart(2,"0")}`,day:w,type:"next"});k(O)},[u,c,h,N,m,g,$]),{finalDaysArray:p,currentMonthName:D,incrementMonth:W,decrementMonth:M}}const be={navigation:"_navigation_1spdz_1",button:"_button_1spdz_13",month:"_month_1spdz_37"};function ke({rotated:p=!1}){return P.jsx("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:p?"rotate(180deg)":""},children:P.jsx("path",{d:"M12.3906 10.276L18.1146 16L12.3906 21.724L14.276 23.6094L21.8853 16L14.276 8.39071L12.3906 10.276Z",fill:"#062341"})})}function tt({currentMonthName:p,incrementMonth:k,decrementMonth:x}){return P.jsxs("div",{className:be.navigation,children:[P.jsx("button",{type:"button",className:be.button,onClick:x,"aria-label":"previous month",children:P.jsx(ke,{rotated:!0})}),P.jsx("p",{className:be.month,children:p}),P.jsx("button",{type:"button",className:be.button,onClick:k,"aria-label":"next month",children:P.jsx(ke,{})})]})}const Pe={headWrapper:"_headWrapper_2fn57_1",text:"_text_2fn57_11"},rt=["пн","вт","ср","чт","пт","сб","нд"];function nt({daySizes:p}){return P.jsx("div",{className:Pe.headWrapper,style:{height:p.height},children:rt.map((k,x)=>P.jsx("p",{className:Pe.text,style:{width:p.width},children:k},x))})}const at={monthWrapper:"_monthWrapper_1u62r_1"},it={weekWrapper:"_weekWrapper_i076z_1"},ie={wrapper:"_wrapper_kseqj_1",isGapWrapper:"_isGapWrapper_kseqj_9",wrapperIsInRange:"_wrapperIsInRange_kseqj_17",firstDay:"_firstDay_kseqj_25",lastDay:"_lastDay_kseqj_35",container:"_container_kseqj_45",dayToday:"_dayToday_kseqj_77",selectedDay:"_selectedDay_kseqj_85",notInCurrentMonth:"_notInCurrentMonth_kseqj_97"};function st({dayItem:p,setUpSelectedDay:k,selectedDay:x,secondDay:j,slicedArray:$,range:h,daySizes:D,formattedDateToday:u}){const{id:c,type:b}=p,g=p.type==="gap",m=()=>{g||k(p)},N=$.some(v=>v.id===c),W=h==null?void 0:h.some((v,U)=>v===c&&U===0),M=h==null?void 0:h.some((v,U)=>v===c&&U===h.length-1);return P.jsx("div",{className:`${ie.wrapper} ${N?ie.wrapperIsInRange:""} ${g?ie.isGapWrapper:""} ${W?ie.firstDay:""} ${M?ie.lastDay:""} `,children:!g&&P.jsx("button",{type:"button","aria-label":"calendar day",style:{width:D.width,height:D.height},onClick:m,className:`${ie.container} ${u===c?ie.dayToday:""} ${x===c||j===c?ie.selectedDay:""}`,children:P.jsx("p",{className:b!=="current"?ie.notInCurrentMonth:"",children:p.day})})})}function ot({week:p,index:k,setUpSelectedDay:x,selectedDay:j,secondDay:$,range:h,daySizes:D,formattedDateToday:u}){const c=[{id:"1",type:"gap"},{id:"3",type:"gap"},{id:"5",type:"gap"},{id:"7",type:"gap"},{id:"9",type:"gap"},{id:"11",type:"gap"}],b=p.flatMap((M,v)=>v<c.length?[M,c[v]]:[M]),g=b.filter(M=>h==null?void 0:h.some(v=>v===M.id)),m=b.findIndex(M=>{var v;return M.id===((v=g[0])==null?void 0:v.id)}),N=b.findIndex(M=>{var v;return M.id===((v=g[g.length-1])==null?void 0:v.id)}),W=b.slice(m,N+1);return P.jsx("div",{className:it.weekWrapper,children:b.map((M,v)=>P.jsx(st,{dayItem:M,setUpSelectedDay:x,selectedDay:j,secondDay:$,slicedArray:W,range:h,daySizes:D,formattedDateToday:u},v))},k)}function ut({finalDaysArray:p,selectedDay:k,secondDay:x,setUpSelectedDay:j,range:$,daySizes:h}){const D=new Date().toISOString().slice(0,10);return P.jsx("div",{className:at.monthWrapper,children:p&&p.map((u,c)=>P.jsx(ot,{week:u,index:c,setUpSelectedDay:j,selectedDay:k,secondDay:x,range:$,daySizes:h,formattedDateToday:D},c))})}function ct(p){return p==="mobile"?{width:40,height:32}:{width:24,height:24}}var We={exports:{}};(function(p,k){(function(x,j){p.exports=j()})(Te,function(){var x=1e3,j=6e4,$=36e5,h="millisecond",D="second",u="minute",c="hour",b="day",g="week",m="month",N="quarter",W="year",M="date",v="Invalid Date",U=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(o){var n=["th","st","nd","rd"],r=o%100;return"["+o+(n[(r-20)%10]||n[r]||n[0])+"]"}},X=function(o,n,r){var s=String(o);return!s||s.length>=n?o:""+Array(n+1-s.length).join(r)+o},w={s:X,z:function(o){var n=-o.utcOffset(),r=Math.abs(n),s=Math.floor(r/60),a=r%60;return(n<=0?"+":"-")+X(s,2,"0")+":"+X(a,2,"0")},m:function o(n,r){if(n.date()<r.date())return-o(r,n);var s=12*(r.year()-n.year())+(r.month()-n.month()),a=n.clone().add(s,m),f=r-a<0,d=n.clone().add(s+(f?-1:1),m);return+(-(s+(r-a)/(f?a-d:d-a))||0)},a:function(o){return o<0?Math.ceil(o)||0:Math.floor(o)},p:function(o){return{M:m,y:W,w:g,d:b,D:M,h:c,m:u,s:D,ms:h,Q:N}[o]||String(o||"").toLowerCase().replace(/s$/,"")},u:function(o){return o===void 0}},H="en",K={};K[H]=O;var ce="$isDayjsObject",se=function(o){return o instanceof fe||!(!o||!o[ce])},le=function o(n,r,s){var a;if(!n)return H;if(typeof n=="string"){var f=n.toLowerCase();K[f]&&(a=f),r&&(K[f]=r,a=f);var d=n.split("-");if(!a&&d.length>1)return o(d[0])}else{var R=n.name;K[R]=n,a=R}return!s&&a&&(H=a),a||!s&&H},F=function(o,n){if(se(o))return o.clone();var r=typeof n=="object"?n:{};return r.date=o,r.args=arguments,new fe(r)},S=w;S.l=le,S.i=se,S.w=function(o,n){return F(o,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var fe=function(){function o(r){this.$L=le(r.locale,null,!0),this.parse(r),this.$x=this.$x||r.x||{},this[ce]=!0}var n=o.prototype;return n.parse=function(r){this.$d=function(s){var a=s.date,f=s.utc;if(a===null)return new Date(NaN);if(S.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var d=a.match(U);if(d){var R=d[2]-1||0,C=(d[7]||"0").substring(0,3);return f?new Date(Date.UTC(d[1],R,d[3]||1,d[4]||0,d[5]||0,d[6]||0,C)):new Date(d[1],R,d[3]||1,d[4]||0,d[5]||0,d[6]||0,C)}}return new Date(a)}(r),this.init()},n.init=function(){var r=this.$d;this.$y=r.getFullYear(),this.$M=r.getMonth(),this.$D=r.getDate(),this.$W=r.getDay(),this.$H=r.getHours(),this.$m=r.getMinutes(),this.$s=r.getSeconds(),this.$ms=r.getMilliseconds()},n.$utils=function(){return S},n.isValid=function(){return this.$d.toString()!==v},n.isSame=function(r,s){var a=F(r);return this.startOf(s)<=a&&a<=this.endOf(s)},n.isAfter=function(r,s){return F(r)<this.startOf(s)},n.isBefore=function(r,s){return this.endOf(s)<F(r)},n.$g=function(r,s,a){return S.u(r)?this[s]:this.set(a,r)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(r,s){var a=this,f=!!S.u(s)||s,d=S.p(r),R=function(te,L){var ae=S.w(a.$u?Date.UTC(a.$y,L,te):new Date(a.$y,L,te),a);return f?ae:ae.endOf(b)},C=function(te,L){return S.w(a.toDate()[te].apply(a.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(L)),a)},A=this.$W,V=this.$M,B=this.$D,re="set"+(this.$u?"UTC":"");switch(d){case W:return f?R(1,0):R(31,11);case m:return f?R(1,V):R(0,V+1);case g:var ee=this.$locale().weekStart||0,ne=(A<ee?A+7:A)-ee;return R(f?B-ne:B+(6-ne),V);case b:case M:return C(re+"Hours",0);case c:return C(re+"Minutes",1);case u:return C(re+"Seconds",2);case D:return C(re+"Milliseconds",3);default:return this.clone()}},n.endOf=function(r){return this.startOf(r,!1)},n.$set=function(r,s){var a,f=S.p(r),d="set"+(this.$u?"UTC":""),R=(a={},a[b]=d+"Date",a[M]=d+"Date",a[m]=d+"Month",a[W]=d+"FullYear",a[c]=d+"Hours",a[u]=d+"Minutes",a[D]=d+"Seconds",a[h]=d+"Milliseconds",a)[f],C=f===b?this.$D+(s-this.$W):s;if(f===m||f===W){var A=this.clone().set(M,1);A.$d[R](C),A.init(),this.$d=A.set(M,Math.min(this.$D,A.daysInMonth())).$d}else R&&this.$d[R](C);return this.init(),this},n.set=function(r,s){return this.clone().$set(r,s)},n.get=function(r){return this[S.p(r)]()},n.add=function(r,s){var a,f=this;r=Number(r);var d=S.p(s),R=function(V){var B=F(f);return S.w(B.date(B.date()+Math.round(V*r)),f)};if(d===m)return this.set(m,this.$M+r);if(d===W)return this.set(W,this.$y+r);if(d===b)return R(1);if(d===g)return R(7);var C=(a={},a[u]=j,a[c]=$,a[D]=x,a)[d]||1,A=this.$d.getTime()+r*C;return S.w(A,this)},n.subtract=function(r,s){return this.add(-1*r,s)},n.format=function(r){var s=this,a=this.$locale();if(!this.isValid())return a.invalidDate||v;var f=r||"YYYY-MM-DDTHH:mm:ssZ",d=S.z(this),R=this.$H,C=this.$m,A=this.$M,V=a.weekdays,B=a.months,re=a.meridiem,ee=function(L,ae,oe,he){return L&&(L[ae]||L(s,f))||oe[ae].slice(0,he)},ne=function(L){return S.s(R%12||12,L,"0")},te=re||function(L,ae,oe){var he=L<12?"AM":"PM";return oe?he.toLowerCase():he};return f.replace(z,function(L,ae){return ae||function(oe){switch(oe){case"YY":return String(s.$y).slice(-2);case"YYYY":return S.s(s.$y,4,"0");case"M":return A+1;case"MM":return S.s(A+1,2,"0");case"MMM":return ee(a.monthsShort,A,B,3);case"MMMM":return ee(B,A);case"D":return s.$D;case"DD":return S.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return ee(a.weekdaysMin,s.$W,V,2);case"ddd":return ee(a.weekdaysShort,s.$W,V,3);case"dddd":return V[s.$W];case"H":return String(R);case"HH":return S.s(R,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return te(R,C,!0);case"A":return te(R,C,!1);case"m":return String(C);case"mm":return S.s(C,2,"0");case"s":return String(s.$s);case"ss":return S.s(s.$s,2,"0");case"SSS":return S.s(s.$ms,3,"0");case"Z":return d}return null}(L)||d.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(r,s,a){var f,d=this,R=S.p(s),C=F(r),A=(C.utcOffset()-this.utcOffset())*j,V=this-C,B=function(){return S.m(d,C)};switch(R){case W:f=B()/12;break;case m:f=B();break;case N:f=B()/3;break;case g:f=(V-A)/6048e5;break;case b:f=(V-A)/864e5;break;case c:f=V/$;break;case u:f=V/j;break;case D:f=V/x;break;default:f=V}return a?f:S.a(f)},n.daysInMonth=function(){return this.endOf(m).$D},n.$locale=function(){return K[this.$L]},n.locale=function(r,s){if(!r)return this.$L;var a=this.clone(),f=le(r,s,!0);return f&&(a.$L=f),a},n.clone=function(){return S.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},o}(),Q=fe.prototype;return F.prototype=Q,[["$ms",h],["$s",D],["$m",u],["$H",c],["$W",b],["$M",m],["$y",W],["$D",M]].forEach(function(o){Q[o[1]]=function(n){return this.$g(n,o[0],o[1])}}),F.extend=function(o,n){return o.$i||(o(n,fe,F),o.$i=!0),F},F.locale=le,F.isDayjs=se,F.unix=function(o){return F(1e3*o)},F.en=K[H],F.Ls=K,F.p={},F})})(We);var lt=We.exports;const me=je(lt);var Ae={exports:{}};(function(p,k){(function(x,j){p.exports=j()})(Te,function(){return function(x,j,$){var h=function(D,u){if(!u||!u.length||u.length===1&&!u[0]||u.length===1&&Array.isArray(u[0])&&!u[0].length)return null;var c;u.length===1&&u[0].length>0&&(u=u[0]),c=(u=u.filter(function(g){return g}))[0];for(var b=1;b<u.length;b+=1)u[b].isValid()&&!u[b][D](c)||(c=u[b]);return c};$.max=function(){var D=[].slice.call(arguments,0);return h("isAfter",D)},$.min=function(){var D=[].slice.call(arguments,0);return h("isBefore",D)}}})})(Ae);var ft=Ae.exports;const dt=je(ft);me.extend(dt);function ht({type:p="calendar",setDay:k,setRange:x,range:j,daySize:$="desktop"}){const[h,D]=q.useState(),[u,c]=q.useState(),{finalDaysArray:b,currentMonthName:g,incrementMonth:m,decrementMonth:N}=et(),W=H=>{if(p==="calendar"&&k){D(H.id),k(H.id);return}p==="range"&&(h||D(H.id),h&&c(H.id),h&&u&&(D(H.id),c(void 0)))},M=me(h),v=me(u),U=me.min(M,v),z=me.max(M,v),O=U.format("YYYY-MM-DD"),X=z.diff(U,"day"),w=ct($);return q.useEffect(()=>{if(p==="range"&&x){if(h&&u){let H=U;const K=[O];for(let ce=0;ce<X;ce++){const se=H.add(1,"day");K.push(se.format("YYYY-MM-DD")),H=se}x(K)}u||x(void 0)}},[u,h,x,p,X]),P.jsxs("div",{className:Qe.calendar,children:[P.jsx(tt,{currentMonthName:g,incrementMonth:m,decrementMonth:N}),P.jsx(nt,{daySizes:w}),P.jsx(ut,{finalDaysArray:b,selectedDay:h,secondDay:u,setUpSelectedDay:W,range:j,daySizes:w})]})}ue.Calendar=ht,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})});