UNPKG

nepali-patro-datepicker-react

Version:
32 lines (29 loc) 25.6 kB
(function(F,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],S):(F=typeof globalThis<"u"?globalThis:F||self,S(F.ReactNepaliDatepicker={},F.React))})(this,function(F,S){"use strict";var ie=document.createElement("style");ie.textContent=`@import"https://fonts.googleapis.com/css2?family=Mulish:ital@0;1&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap";.nepali-date-picker-container{font-family:Mulish,sans-serif;position:relative}.nepali-date-picker-button{border-radius:4px;border:1px solid black;outline:none;min-width:200px;min-height:28px;padding:0 10px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;background-color:#fff!important}.nepali-calendar{margin-top:5px;padding:5px;border:1px solid #ccc;display:block;position:absolute;background-color:#fff!important}.nepali-calendar-inner{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px;cursor:pointer}.nepali-calendar-month{font-weight:700;border:1px solid #bdbdbd;cursor:pointer}.nepali-calendar-month-dropdown{font-weight:700;outline:none;border:none;padding:4px 2px;width:65px;text-align:center}.nepali-calendar-month select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;cursor:pointer;font-size:13px;color:#6b6b6b}.nepali-calendar-next-button,.nepali-calendar-prev-button{padding:0 4px;background-color:transparent;border:none;cursor:pointer}.nepali-calendar-week{font-weight:700;margin-bottom:5px;color:#6b6b6b}.prev-next-month-days{width:25px;height:25px;display:flex;align-items:center;justify-content:center;color:#aaa;-webkit-user-select:none;user-select:none;cursor:default}.current-month-days{width:25px;height:25px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;-webkit-user-select:none;user-select:none}.nepali-calendar-render{display:grid;grid-template-columns:repeat(7,1fr);row-gap:8px;column-gap:1px;font-size:12px;text-align:center;margin-bottom:4px} /*$vite$:1*/`,document.head.appendChild(ie);var U={exports:{}},W={};/** * @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 se;function Ne(){if(se)return W;se=1;var t=S,o=Symbol.for("react.element"),d=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,g=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(E,p,C){var R,_={},w=null,V=null;C!==void 0&&(w=""+C),p.key!==void 0&&(w=""+p.key),p.ref!==void 0&&(V=p.ref);for(R in p)y.call(p,R)&&!i.hasOwnProperty(R)&&(_[R]=p[R]);if(E&&E.defaultProps)for(R in p=E.defaultProps,p)_[R]===void 0&&(_[R]=p[R]);return{$$typeof:o,type:E,key:w,ref:V,props:_,_owner:g.current}}return W.Fragment=d,W.jsx=u,W.jsxs=u,W}var Y={};/** * @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 Ie(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var t=S,o=Symbol.for("react.element"),d=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),E=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),L=Symbol.iterator,H="@@iterator";function h(e){if(e===null||typeof e!="object")return null;var r=L&&e[L]||e[H];return typeof r=="function"?r:null}var O=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];q("error",e,n)}}function q(e,r,n){{var a=O.ReactDebugCurrentFrame,l=a.getStackAddendum();l!==""&&(r+="%s",n=n.concat([l]));var f=n.map(function(c){return String(c)});f.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,f)}}var qe=!1,Ze=!1,Qe=!1,e3=!1,r3=!1,le;le=Symbol.for("react.module.reference");function n3(e){return!!(typeof e=="string"||typeof e=="function"||e===y||e===i||r3||e===g||e===C||e===R||e3||e===V||qe||Ze||Qe||typeof e=="object"&&e!==null&&(e.$$typeof===w||e.$$typeof===_||e.$$typeof===u||e.$$typeof===E||e.$$typeof===p||e.$$typeof===le||e.getModuleId!==void 0))}function t3(e,r,n){var a=e.displayName;if(a)return a;var l=r.displayName||r.name||"";return l!==""?n+"("+l+")":n}function fe(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&b("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 y:return"Fragment";case d:return"Portal";case i:return"Profiler";case g:return"StrictMode";case C:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E:var r=e;return fe(r)+".Consumer";case u:var n=e;return fe(n._context)+".Provider";case p:return t3(e,e.render,"ForwardRef");case _:var a=e.displayName||null;return a!==null?a:P(e.type)||"Memo";case w:{var l=e,f=l._payload,c=l._init;try{return P(c(f))}catch{return null}}}return null}var A=Object.assign,$=0,de,pe,ve,he,me,ye,ge;function be(){}be.__reactDisabledLog=!0;function a3(){{if($===0){de=console.log,pe=console.info,ve=console.warn,he=console.error,me=console.group,ye=console.groupCollapsed,ge=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}$++}}function o3(){{if($--,$===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:de}),info:A({},e,{value:pe}),warn:A({},e,{value:ve}),error:A({},e,{value:he}),group:A({},e,{value:me}),groupCollapsed:A({},e,{value:ye}),groupEnd:A({},e,{value:ge})})}$<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=O.ReactCurrentDispatcher,Q;function J(e,r,n){{if(Q===void 0)try{throw Error()}catch(l){var a=l.stack.trim().match(/\n( *(at )?)/);Q=a&&a[1]||""}return` `+Q+e}}var ee=!1,K;{var i3=typeof WeakMap=="function"?WeakMap:Map;K=new i3}function xe(e,r){if(!e||ee)return"";{var n=K.get(e);if(n!==void 0)return n}var a;ee=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=Z.current,Z.current=null,a3();try{if(r){var c=function(){throw Error()};if(Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(j){a=j}Reflect.construct(e,[],c)}else{try{c.call()}catch(j){a=j}e.call(c.prototype)}}else{try{throw Error()}catch(j){a=j}e()}}catch(j){if(j&&a&&typeof j.stack=="string"){for(var s=j.stack.split(` `),k=a.stack.split(` `),m=s.length-1,x=k.length-1;m>=1&&x>=0&&s[m]!==k[x];)x--;for(;m>=1&&x>=0;m--,x--)if(s[m]!==k[x]){if(m!==1||x!==1)do if(m--,x--,x<0||s[m]!==k[x]){var T=` `+s[m].replace(" at new "," at ");return e.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,T),T}while(m>=1&&x>=0);break}}}finally{ee=!1,Z.current=f,o3(),Error.prepareStackTrace=l}var M=e?e.displayName||e.name:"",D=M?J(M):"";return typeof e=="function"&&K.set(e,D),D}function s3(e,r,n){return xe(e,!1)}function c3(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function z(e,r,n){if(e==null)return"";if(typeof e=="function")return xe(e,c3(e));if(typeof e=="string")return J(e);switch(e){case C:return J("Suspense");case R:return J("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return s3(e.render);case _:return z(e.type,r,n);case w:{var a=e,l=a._payload,f=a._init;try{return z(f(l),r,n)}catch{}}}return""}var B=Object.prototype.hasOwnProperty,Ee={},_e=O.ReactDebugCurrentFrame;function G(e){if(e){var r=e._owner,n=z(e.type,e._source,r?r.type:null);_e.setExtraStackFrame(n)}else _e.setExtraStackFrame(null)}function u3(e,r,n,a,l){{var f=Function.call.bind(B);for(var c in e)if(f(e,c)){var s=void 0;try{if(typeof e[c]!="function"){var k=Error((a||"React class")+": "+n+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw k.name="Invariant Violation",k}s=e[c](r,c,a,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){s=m}s&&!(s instanceof Error)&&(G(l),b("%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).",a||"React class",n,c,typeof s),G(null)),s instanceof Error&&!(s.message in Ee)&&(Ee[s.message]=!0,G(l),b("Failed %s type: %s",n,s.message),G(null))}}}var l3=Array.isArray;function re(e){return l3(e)}function f3(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function d3(e){try{return Re(e),!1}catch{return!0}}function Re(e){return""+e}function we(e){if(d3(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",f3(e)),Re(e)}var Ce=O.ReactCurrentOwner,p3={key:!0,ref:!0,__self:!0,__source:!0},ke,je;function v3(e){if(B.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function h3(e){if(B.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function m3(e,r){typeof e.ref=="string"&&Ce.current}function y3(e,r){{var n=function(){ke||(ke=!0,b("%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)",r))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function g3(e,r){{var n=function(){je||(je=!0,b("%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)",r))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var b3=function(e,r,n,a,l,f,c){var s={$$typeof:o,type:e,key:r,ref:n,props:c,_owner:f};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function x3(e,r,n,a,l){{var f,c={},s=null,k=null;n!==void 0&&(we(n),s=""+n),h3(r)&&(we(r.key),s=""+r.key),v3(r)&&(k=r.ref,m3(r,l));for(f in r)B.call(r,f)&&!p3.hasOwnProperty(f)&&(c[f]=r[f]);if(e&&e.defaultProps){var m=e.defaultProps;for(f in m)c[f]===void 0&&(c[f]=m[f])}if(s||k){var x=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&y3(c,x),k&&g3(c,x)}return b3(e,s,k,l,a,Ce.current,c)}}var ne=O.ReactCurrentOwner,Te=O.ReactDebugCurrentFrame;function I(e){if(e){var r=e._owner,n=z(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(n)}else Te.setExtraStackFrame(null)}var te;te=!1;function ae(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function Se(){{if(ne.current){var e=P(ne.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function E3(e){return""}var Oe={};function _3(e){{var r=Se();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=` Check the top-level render call using <`+n+">.")}return r}}function Pe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=_3(r);if(Oe[n])return;Oe[n]=!0;var a="";e&&e._owner&&e._owner!==ne.current&&(a=" It was passed a child from "+P(e._owner.type)+"."),I(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,a),I(null)}}function Fe(e,r){{if(typeof e!="object")return;if(re(e))for(var n=0;n<e.length;n++){var a=e[n];ae(a)&&Pe(a,r)}else if(ae(e))e._store&&(e._store.validated=!0);else if(e){var l=h(e);if(typeof l=="function"&&l!==e.entries)for(var f=l.call(e),c;!(c=f.next()).done;)ae(c.value)&&Pe(c.value,r)}}}function R3(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===p||r.$$typeof===_))n=r.propTypes;else return;if(n){var a=P(r);u3(n,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!te){te=!0;var l=P(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",l||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function w3(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var a=r[n];if(a!=="children"&&a!=="key"){I(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),I(null);break}}e.ref!==null&&(I(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}var Ae={};function De(e,r,n,a,l,f){{var c=n3(e);if(!c){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" 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 k=E3();k?s+=k:s+=Se();var m;e===null?m="null":re(e)?m="array":e!==void 0&&e.$$typeof===o?(m="<"+(P(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,s)}var x=x3(e,r,n,l,f);if(x==null)return x;if(c){var T=r.children;if(T!==void 0)if(a)if(re(T)){for(var M=0;M<T.length;M++)Fe(T[M],e);Object.freeze&&Object.freeze(T)}else b("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 Fe(T,e)}if(B.call(r,"key")){var D=P(e),j=Object.keys(r).filter(function(O3){return O3!=="key"}),oe=j.length>0?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}";if(!Ae[D+oe]){var S3=j.length>0?"{"+j.join(": ..., ")+": ...}":"{}";b(`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} />`,oe,D,S3,D),Ae[D+oe]=!0}}return e===y?w3(x):R3(x),x}}function C3(e,r,n){return De(e,r,n,!0)}function k3(e,r,n){return De(e,r,n,!1)}var j3=k3,T3=C3;Y.Fragment=y,Y.jsx=j3,Y.jsxs=T3}()),Y}var ue;function Me(){return ue||(ue=1,process.env.NODE_ENV==="production"?U.exports=Ne():U.exports=Ie()),U.exports}var v=Me();const We=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ye=["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Poush","Magh","Falgun","Chaitra"],N={2e3:[30,32,31,32,31,30,30,30,29,30,29,31],2001:[31,31,32,31,31,31,30,29,30,29,30,30],2002:[31,31,32,32,31,30,30,29,30,29,30,30],2003:[31,32,31,32,31,30,30,30,29,29,30,31],2004:[30,32,31,32,31,30,30,30,29,30,29,31],2005:[31,31,32,31,31,31,30,29,30,29,30,30],2006:[31,31,32,32,31,30,30,29,30,29,30,30],2007:[31,32,31,32,31,30,30,30,29,29,30,31],2008:[31,31,31,32,31,31,29,30,30,29,29,31],2009:[31,31,32,31,31,31,30,29,30,29,30,30],2010:[31,31,32,32,31,30,30,29,30,29,30,30],2011:[31,32,31,32,31,30,30,30,29,29,30,31],2012:[31,31,31,32,31,31,29,30,30,29,30,30],2013:[31,31,32,31,31,31,30,29,30,29,30,30],2014:[31,31,32,32,31,30,30,29,30,29,30,30],2015:[31,32,31,32,31,30,30,30,29,29,30,31],2016:[31,31,31,32,31,31,29,30,30,29,30,30],2017:[31,31,32,31,31,31,30,29,30,29,30,30],2018:[31,32,31,32,31,30,30,29,30,29,30,30],2019:[31,32,31,32,31,30,30,30,29,30,29,31],2020:[31,31,31,32,31,31,30,29,30,29,30,30],2021:[31,31,32,31,31,31,30,29,30,29,30,30],2022:[31,32,31,32,31,30,30,30,29,29,30,30],2023:[31,32,31,32,31,30,30,30,29,30,29,31],2024:[31,31,31,32,31,31,30,29,30,29,30,30],2025:[31,31,32,31,31,31,30,29,30,29,30,30],2026:[31,32,31,32,31,30,30,30,29,29,30,31],2027:[30,32,31,32,31,30,30,30,29,30,29,31],2028:[31,31,32,31,31,31,30,29,30,29,30,30],2029:[31,31,32,31,32,30,30,29,30,29,30,30],2030:[31,32,31,32,31,30,30,30,29,29,30,31],2031:[30,32,31,32,31,30,30,30,29,30,29,31],2032:[31,31,32,31,31,31,30,29,30,29,30,30],2033:[31,31,32,32,31,30,30,29,30,29,30,30],2034:[31,32,31,32,31,30,30,30,29,29,30,31],2035:[30,32,31,32,31,31,29,30,30,29,29,31],2036:[31,31,32,31,31,31,30,29,30,29,30,30],2037:[31,31,32,32,31,30,30,29,30,29,30,30],2038:[31,32,31,32,31,30,30,30,29,29,30,31],2039:[31,31,31,32,31,31,29,30,30,29,30,30],2040:[31,31,32,31,31,31,30,29,30,29,30,30],2041:[31,31,32,32,31,30,30,29,30,29,30,30],2042:[31,32,31,32,31,30,30,30,29,29,30,31],2043:[31,31,31,32,31,31,29,30,30,29,30,30],2044:[31,31,32,31,31,31,30,29,30,29,30,30],2045:[31,32,31,32,31,30,30,29,30,29,30,30],2046:[31,32,31,32,31,30,30,30,29,29,30,31],2047:[31,31,31,32,31,31,30,29,30,29,30,30],2048:[31,31,32,31,31,31,30,29,30,29,30,30],2049:[31,32,31,32,31,30,30,30,29,29,30,30],2050:[31,32,31,32,31,30,30,30,29,30,29,31],2051:[31,31,31,32,31,31,30,29,30,29,30,30],2052:[31,31,32,31,31,31,30,29,30,29,30,30],2053:[31,32,31,32,31,30,30,30,29,29,30,30],2054:[31,32,31,32,31,30,30,30,29,30,29,31],2055:[31,31,32,31,31,31,30,29,30,29,30,30],2056:[31,31,32,31,32,30,30,29,30,29,30,30],2057:[31,32,31,32,31,30,30,30,29,29,30,31],2058:[30,32,31,32,31,30,30,30,29,30,29,31],2059:[31,31,32,31,31,31,30,29,30,29,30,30],2060:[31,31,32,32,31,30,30,29,30,29,30,30],2061:[31,32,31,32,31,30,30,30,29,29,30,31],2062:[31,31,31,32,31,31,29,30,29,30,29,31],2063:[31,31,32,31,31,31,30,29,30,29,30,30],2064:[31,31,32,32,31,30,30,29,30,29,30,30],2065:[31,32,31,32,31,30,30,30,29,29,30,31],2066:[31,31,31,32,31,31,29,30,30,29,29,31],2067:[31,31,32,31,31,31,30,29,30,29,30,30],2068:[31,31,32,32,31,30,30,29,30,29,30,30],2069:[31,32,31,32,31,30,30,30,29,29,30,31],2070:[31,31,31,32,31,31,29,30,30,29,30,30],2071:[31,31,32,31,31,31,30,29,30,29,30,30],2072:[31,32,31,32,31,30,30,29,30,29,30,30],2073:[31,32,31,32,31,30,30,30,29,29,30,31],2074:[31,31,31,32,31,31,30,29,30,29,30,30],2075:[31,31,32,31,31,31,30,29,30,29,30,30],2076:[31,32,31,32,31,30,30,30,29,29,30,30],2077:[31,32,31,32,31,30,30,30,29,30,29,31],2078:[31,31,31,32,31,31,30,29,30,29,30,30],2079:[31,31,32,31,31,31,30,29,30,29,30,30],2080:[31,32,31,32,31,30,30,30,29,29,30,30],2081:[31,32,31,32,31,30,30,30,29,30,29,31],2082:[31,31,32,31,31,31,30,29,30,29,30,30],2083:[31,31,32,31,31,30,30,30,29,30,30,30],2084:[31,31,32,31,31,30,30,30,29,30,30,30],2085:[31,32,31,32,30,31,30,30,29,30,30,30],2086:[30,32,31,32,31,30,30,30,29,30,30,30],2087:[31,31,32,31,31,31,30,30,30,30,30,30],2088:[30,31,32,32,30,31,30,30,29,30,30,30],2089:[30,32,31,32,31,30,30,30,29,30,30,30],2090:[30,32,31,32,31,30,30,30,29,30,30,30],2091:[31,31,32,31,31,31,30,30,29,30,30,30],2092:[30,31,32,32,31,30,30,30,29,30,30,30],2093:[30,32,31,32,31,30,30,30,29,30,30,30],2094:[31,31,32,31,31,30,30,30,29,30,30,30],2095:[31,31,32,31,31,31,30,29,30,30,30,30],2096:[30,31,32,32,31,30,30,29,30,29,30,30],2097:[31,32,31,31,31,30,30,30,29,30,30,30],2098:[31,31,32,31,31,31,29,30,29,30,29,31],2099:[31,32,31,32,31,30,30,30,29,29,30,31]},X={2e3:3},Ve=2e3,Le=2099;for(let t=Ve+1;t<=Le;t++){const o=t-1,d=X[o],y=(N[o]??[]).reduce((g,i)=>g+i,0);if(typeof d=="number"){const g=(d+y)%7;X[t]=g}else console.warn(`Missing weekday for year ${o}`)}function $e({selectedDate:t,setSelectedDate:o,handleSelectedValue:d}){const y=()=>{var p;let{year:i,month:u}=t;u-=1,u<1&&(u=12,i-=1);const E=((p=N[i])==null?void 0:p[u-1])||30;o(C=>({year:i,month:u,day:Math.min(C.day,E)}))},g=()=>{var p;let{year:i,month:u}=t;u+=1,u>12&&(u=1,i+=1);const E=((p=N[i])==null?void 0:p[u-1])||30;o(C=>({year:i,month:u,day:Math.min(C.day,E)}))};return v.jsxs("div",{className:"nepali-calendar-inner",children:[v.jsx("button",{onClick:y,className:"nepali-calendar-prev-button",type:"button",children:"◀"}),v.jsxs("div",{className:"nepali-calendar-month",children:[v.jsx("select",{value:t.month-1,onChange:i=>{const u=parseInt(i.target.value,10)+1;o(E=>({...E,month:u})),d({...t,month:u})},className:"nepali-calendar-month-dropdown",children:Ye.map((i,u)=>v.jsx("option",{value:u,children:i},u))}),v.jsx("select",{value:t.year,onChange:i=>{const u=parseInt(i.target.value,10);o(E=>({...E,year:u})),d({...t,year:u})},className:"nepali-calendar-month-dropdown",children:Object.keys(N).map(i=>v.jsx("option",{value:i,children:i},i))})]}),v.jsx("button",{onClick:g,className:"nepali-calendar-next-button",type:"button",children:"▶"})]})}function Be(t,o){return t.year<o.year||t.year===o.year&&t.month<o.month||t.year===o.year&&t.month===o.month&&t.day<o.day}function Ue(t,o){return t.year>o.year||t.year===o.year&&t.month>o.month||t.year===o.year&&t.month===o.month&&t.day>o.day}const He=({date:t,selected:o,minDate:d,maxDate:y,onSelect:g})=>{const i=Be(t,d)||Ue(t,y);return v.jsx("div",{onClick:()=>!i&&g(t),style:{cursor:i?"not-allowed":"pointer",backgroundColor:o?"#3b82f6":"",color:i?"#ccc":o?"#fff":"rgb(107, 107, 107)"},className:"current-month-days",children:t.day})},Je=({selectedDate:t,setSelectedDate:o,handleSelectedValue:d,minDate:y,maxDate:g})=>{var H;const i=N[t.year],u=(i==null?void 0:i[t.month-1])??30,E=()=>{const h=X[t.year]??0,O=(i==null?void 0:i.slice(0,t.month-1).reduce((b,q)=>b+q,0))||0;return(h+O)%7},p=t.month===1?12:t.month-1,C=t.month===1?t.year-1:t.year,R=((H=N[C])==null?void 0:H[p-1])||30,_=E(),w=[];for(let h=_-1;h>=0;h--)w.push(v.jsx("div",{className:"prev-next-month-days",children:R-h},`p-${h}`));for(let h=1;h<=u;h++){const O={...t,day:h};w.push(v.jsx(He,{date:O,selected:t.day===h,minDate:y,maxDate:g,onSelect:b=>{o(b),d(b)}},h))}const L=w.length%7;for(let h=1;h<=(L?7-L:0);h++)w.push(v.jsx("div",{className:"prev-next-month-days",children:h},`n-${h}`));return v.jsxs("div",{className:"nepali-calendar-render",children:[We.map(h=>v.jsx("div",{className:"nepali-calendar-week",children:h},h)),w]})},Ke=({selectedDate:t,setSelectedDate:o,handleSelectedValue:d,minDate:y,maxDate:g})=>v.jsxs("div",{className:"nepali-calendar",children:[v.jsx($e,{selectedDate:t,setSelectedDate:o,handleSelectedValue:d}),v.jsx(Je,{selectedDate:t,setSelectedDate:o,handleSelectedValue:d,minDate:y,maxDate:g})]}),ze="data:image/svg+xml,%3csvg%20width='14'%20height='16'%20viewBox='0%200%2020%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.75002%2021.2917C2.20276%2021.2917%201.73954%2021.1021%201.36038%2020.7229C0.981209%2020.3438%200.791626%2019.8806%200.791626%2019.3333V4.83341C0.791626%204.28615%200.981209%203.82293%201.36038%203.44377C1.73954%203.0646%202.20276%202.87502%202.75002%202.87502H4.2499V0.583496H5.91661V2.87502H14.125V0.583496H15.75V2.87502H17.2499C17.7972%202.87502%2018.2604%203.0646%2018.6395%203.44377C19.0187%203.82293%2019.2083%204.28615%2019.2083%204.83341V19.3333C19.2083%2019.8806%2019.0187%2020.3438%2018.6395%2020.7229C18.2604%2021.1021%2017.7972%2021.2917%2017.2499%2021.2917H2.75002ZM2.75002%2019.6667H17.2499C17.3333%2019.6667%2017.4097%2019.6319%2017.479%2019.5624C17.5485%2019.4931%2017.5833%2019.4167%2017.5833%2019.3333V9.16675H2.41663V19.3333C2.41663%2019.4167%202.45138%2019.4931%202.5209%2019.5624C2.59023%2019.6319%202.6666%2019.6667%202.75002%2019.6667ZM2.41663%207.54175H17.5833V4.83341C17.5833%204.75%2017.5485%204.67362%2017.479%204.60429C17.4097%204.53477%2017.3333%204.50002%2017.2499%204.50002H2.75002C2.6666%204.50002%202.59023%204.53477%202.5209%204.60429C2.45138%204.67362%202.41663%204.75%202.41663%204.83341V7.54175Z'%20fill='%231C1B1F'/%3e%3c/svg%3e",Ge=t=>{const{selectedDate:o,setShowDatepicker:d}=t;return v.jsxs("button",{className:"nepali-date-picker-button",onClick:()=>d(y=>!y),type:"button",children:[v.jsxs("span",{children:[o.year,"-",String(o.month).padStart(2,"0"),"-",String(o.day).padStart(2,"0")]}),v.jsx("img",{src:ze,alt:"DatepickerIcon"})]})},Xe=({value:t,onChange:o})=>{const d=t.split("-"),[y,g]=S.useState(!1),[i,u]=S.useState({year:Number(d[0]),month:Number(d[1]),day:Number(d[2])});S.useEffect(()=>{t&&u({year:Number(d[0]),month:Number(d[1]),day:Number(d[2])})},[t]);const E={},p={},C=S.useRef(null);S.useEffect(()=>{const _=w=>{C.current&&!C.current.contains(w.target)&&g(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]);const R=_=>{const w=`${_.year}-${_.month}-${_.day}`;o(w),g(!1)};return v.jsxs("div",{className:"nepali-date-picker-container",ref:C,children:[v.jsx(Ge,{selectedDate:i,setShowDatepicker:g}),y&&v.jsx(Ke,{selectedDate:i,setSelectedDate:u,handleSelectedValue:R,minDate:E,maxDate:p})]})};F.Datepicker=Xe,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});