bs-date-picker-react
Version:
A customizable Nepali date picker for React supporting English and Nepali languages.
1,498 lines (1,494 loc) • 51 kB
JavaScript
import * as It from "react";
import it, { forwardRef as st, createElement as Oe, useState as Te } from "react";
import { Popover as Lt, PopoverTrigger as Ut, PopoverContent as Bt } from "@radix-ui/react-popover";
var Ne = { exports: {} }, ne = {};
/**
* @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 rt;
function Wt() {
if (rt)
return ne;
rt = 1;
var r = it, a = Symbol.for("react.element"), t = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, m = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
function _(g, w, O) {
var R, $ = {}, A = null, V = null;
O !== void 0 && (A = "" + O), w.key !== void 0 && (A = "" + w.key), w.ref !== void 0 && (V = w.ref);
for (R in w)
o.call(w, R) && !d.hasOwnProperty(R) && ($[R] = w[R]);
if (g && g.defaultProps)
for (R in w = g.defaultProps, w)
$[R] === void 0 && ($[R] = w[R]);
return { $$typeof: a, type: g, key: A, ref: V, props: $, _owner: m.current };
}
return ne.Fragment = t, ne.jsx = _, ne.jsxs = _, ne;
}
var ae = {};
/**
* @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 nt;
function Jt() {
return nt || (nt = 1, process.env.NODE_ENV !== "production" && function() {
var r = it, a = Symbol.for("react.element"), t = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), g = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), R = Symbol.for("react.suspense_list"), $ = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), V = Symbol.for("react.offscreen"), q = Symbol.iterator, ge = "@@iterator";
function ve(e) {
if (e === null || typeof e != "object")
return null;
var n = q && e[q] || e[ge];
return typeof n == "function" ? n : null;
}
var k = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function T(e) {
{
for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), u = 1; u < n; u++)
i[u - 1] = arguments[u];
K("error", e, i);
}
}
function K(e, n, i) {
{
var u = k.ReactDebugCurrentFrame, D = u.getStackAddendum();
D !== "" && (n += "%s", i = i.concat([D]));
var Y = i.map(function(y) {
return String(y);
});
Y.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, Y);
}
}
var N = !1, me = !1, ye = !1, De = !1, Ye = !1, s;
s = Symbol.for("react.module.reference");
function h(e) {
return !!(typeof e == "string" || typeof e == "function" || e === o || e === d || Ye || e === m || e === O || e === R || De || e === V || N || me || ye || typeof e == "object" && e !== null && (e.$$typeof === A || e.$$typeof === $ || e.$$typeof === _ || e.$$typeof === g || e.$$typeof === w || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === s || e.getModuleId !== void 0));
}
function f(e, n, i) {
var u = e.displayName;
if (u)
return u;
var D = n.displayName || n.name || "";
return D !== "" ? i + "(" + D + ")" : i;
}
function l(e) {
return e.displayName || "Context";
}
function c(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && T("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 o:
return "Fragment";
case t:
return "Portal";
case d:
return "Profiler";
case m:
return "StrictMode";
case O:
return "Suspense";
case R:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case g:
var n = e;
return l(n) + ".Consumer";
case _:
var i = e;
return l(i._context) + ".Provider";
case w:
return f(e, e.render, "ForwardRef");
case $:
var u = e.displayName || null;
return u !== null ? u : c(e.type) || "Memo";
case A: {
var D = e, Y = D._payload, y = D._init;
try {
return c(y(Y));
} catch {
return null;
}
}
}
return null;
}
var S = Object.assign, M = 0, P, z, U, ee, te, Ie, Le;
function Ue() {
}
Ue.__reactDisabledLog = !0;
function pt() {
{
if (M === 0) {
P = console.log, z = console.info, U = console.warn, ee = console.error, te = console.group, Ie = console.groupCollapsed, Le = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: Ue,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
M++;
}
}
function gt() {
{
if (M--, M === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: S({}, e, {
value: P
}),
info: S({}, e, {
value: z
}),
warn: S({}, e, {
value: U
}),
error: S({}, e, {
value: ee
}),
group: S({}, e, {
value: te
}),
groupCollapsed: S({}, e, {
value: Ie
}),
groupEnd: S({}, e, {
value: Le
})
});
}
M < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var we = k.ReactCurrentDispatcher, Me;
function ie(e, n, i) {
{
if (Me === void 0)
try {
throw Error();
} catch (D) {
var u = D.stack.trim().match(/\n( *(at )?)/);
Me = u && u[1] || "";
}
return `
` + Me + e;
}
}
var be = !1, se;
{
var vt = typeof WeakMap == "function" ? WeakMap : Map;
se = new vt();
}
function Be(e, n) {
if (!e || be)
return "";
{
var i = se.get(e);
if (i !== void 0)
return i;
}
var u;
be = !0;
var D = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var Y;
Y = we.current, we.current = null, pt();
try {
if (n) {
var y = function() {
throw Error();
};
if (Object.defineProperty(y.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(y, []);
} catch (F) {
u = F;
}
Reflect.construct(e, [], y);
} else {
try {
y.call();
} catch (F) {
u = F;
}
e.call(y.prototype);
}
} else {
try {
throw Error();
} catch (F) {
u = F;
}
e();
}
} catch (F) {
if (F && u && typeof F.stack == "string") {
for (var v = F.stack.split(`
`), j = u.stack.split(`
`), x = v.length - 1, E = j.length - 1; x >= 1 && E >= 0 && v[x] !== j[E]; )
E--;
for (; x >= 1 && E >= 0; x--, E--)
if (v[x] !== j[E]) {
if (x !== 1 || E !== 1)
do
if (x--, E--, E < 0 || v[x] !== j[E]) {
var C = `
` + v[x].replace(" at new ", " at ");
return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" && se.set(e, C), C;
}
while (x >= 1 && E >= 0);
break;
}
}
} finally {
be = !1, we.current = Y, gt(), Error.prepareStackTrace = D;
}
var X = e ? e.displayName || e.name : "", tt = X ? ie(X) : "";
return typeof e == "function" && se.set(e, tt), tt;
}
function mt(e, n, i) {
return Be(e, !1);
}
function yt(e) {
var n = e.prototype;
return !!(n && n.isReactComponent);
}
function ce(e, n, i) {
if (e == null)
return "";
if (typeof e == "function")
return Be(e, yt(e));
if (typeof e == "string")
return ie(e);
switch (e) {
case O:
return ie("Suspense");
case R:
return ie("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case w:
return mt(e.render);
case $:
return ce(e.type, n, i);
case A: {
var u = e, D = u._payload, Y = u._init;
try {
return ce(Y(D), n, i);
} catch {
}
}
}
return "";
}
var le = Object.prototype.hasOwnProperty, We = {}, Je = k.ReactDebugCurrentFrame;
function ue(e) {
if (e) {
var n = e._owner, i = ce(e.type, e._source, n ? n.type : null);
Je.setExtraStackFrame(i);
} else
Je.setExtraStackFrame(null);
}
function Dt(e, n, i, u, D) {
{
var Y = Function.call.bind(le);
for (var y in e)
if (Y(e, y)) {
var v = void 0;
try {
if (typeof e[y] != "function") {
var j = Error((u || "React class") + ": " + i + " type `" + y + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[y] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw j.name = "Invariant Violation", j;
}
v = e[y](n, y, u, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (x) {
v = x;
}
v && !(v instanceof Error) && (ue(D), T("%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).", u || "React class", i, y, typeof v), ue(null)), v instanceof Error && !(v.message in We) && (We[v.message] = !0, ue(D), T("Failed %s type: %s", i, v.message), ue(null));
}
}
}
var Yt = Array.isArray;
function Se(e) {
return Yt(e);
}
function wt(e) {
{
var n = typeof Symbol == "function" && Symbol.toStringTag, i = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
return i;
}
}
function Mt(e) {
try {
return Ge(e), !1;
} catch {
return !0;
}
}
function Ge(e) {
return "" + e;
}
function Ve(e) {
if (Mt(e))
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", wt(e)), Ge(e);
}
var re = k.ReactCurrentOwner, bt = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, qe, Ke, xe;
xe = {};
function St(e) {
if (le.call(e, "ref")) {
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
if (n && n.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function xt(e) {
if (le.call(e, "key")) {
var n = Object.getOwnPropertyDescriptor(e, "key").get;
if (n && n.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function Et(e, n) {
if (typeof e.ref == "string" && re.current && n && re.current.stateNode !== n) {
var i = c(re.current.type);
xe[i] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', c(re.current.type), e.ref), xe[i] = !0);
}
}
function _t(e, n) {
{
var i = function() {
qe || (qe = !0, T("%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)", n));
};
i.isReactWarning = !0, Object.defineProperty(e, "key", {
get: i,
configurable: !0
});
}
}
function Rt(e, n) {
{
var i = function() {
Ke || (Ke = !0, T("%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)", n));
};
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: i,
configurable: !0
});
}
}
var Tt = function(e, n, i, u, D, Y, y) {
var v = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: a,
// Built-in properties that belong on the element
type: e,
key: n,
ref: i,
props: y,
// Record the component responsible for creating this element.
_owner: Y
};
return v._store = {}, Object.defineProperty(v._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(v, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: u
}), Object.defineProperty(v, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: D
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
};
function $t(e, n, i, u, D) {
{
var Y, y = {}, v = null, j = null;
i !== void 0 && (Ve(i), v = "" + i), xt(n) && (Ve(n.key), v = "" + n.key), St(n) && (j = n.ref, Et(n, D));
for (Y in n)
le.call(n, Y) && !bt.hasOwnProperty(Y) && (y[Y] = n[Y]);
if (e && e.defaultProps) {
var x = e.defaultProps;
for (Y in x)
y[Y] === void 0 && (y[Y] = x[Y]);
}
if (v || j) {
var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
v && _t(y, E), j && Rt(y, E);
}
return Tt(e, v, j, D, u, re.current, y);
}
}
var Ee = k.ReactCurrentOwner, ze = k.ReactDebugCurrentFrame;
function H(e) {
if (e) {
var n = e._owner, i = ce(e.type, e._source, n ? n.type : null);
ze.setExtraStackFrame(i);
} else
ze.setExtraStackFrame(null);
}
var _e;
_e = !1;
function Re(e) {
return typeof e == "object" && e !== null && e.$$typeof === a;
}
function He() {
{
if (Ee.current) {
var e = c(Ee.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function jt(e) {
{
if (e !== void 0) {
var n = e.fileName.replace(/^.*[\\\/]/, ""), i = e.lineNumber;
return `
Check your code at ` + n + ":" + i + ".";
}
return "";
}
}
var Xe = {};
function Ct(e) {
{
var n = He();
if (!n) {
var i = typeof e == "string" ? e : e.displayName || e.name;
i && (n = `
Check the top-level render call using <` + i + ">.");
}
return n;
}
}
function Ze(e, n) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var i = Ct(n);
if (Xe[i])
return;
Xe[i] = !0;
var u = "";
e && e._owner && e._owner !== Ee.current && (u = " It was passed a child from " + c(e._owner.type) + "."), H(e), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, u), H(null);
}
}
function Qe(e, n) {
{
if (typeof e != "object")
return;
if (Se(e))
for (var i = 0; i < e.length; i++) {
var u = e[i];
Re(u) && Ze(u, n);
}
else if (Re(e))
e._store && (e._store.validated = !0);
else if (e) {
var D = ve(e);
if (typeof D == "function" && D !== e.entries)
for (var Y = D.call(e), y; !(y = Y.next()).done; )
Re(y.value) && Ze(y.value, n);
}
}
}
function Ot(e) {
{
var n = e.type;
if (n == null || typeof n == "string")
return;
var i;
if (typeof n == "function")
i = n.propTypes;
else if (typeof n == "object" && (n.$$typeof === w || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
n.$$typeof === $))
i = n.propTypes;
else
return;
if (i) {
var u = c(n);
Dt(i, e.props, "prop", u, e);
} else if (n.PropTypes !== void 0 && !_e) {
_e = !0;
var D = c(n);
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown");
}
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Nt(e) {
{
for (var n = Object.keys(e.props), i = 0; i < n.length; i++) {
var u = n[i];
if (u !== "children" && u !== "key") {
H(e), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), H(null);
break;
}
}
e.ref !== null && (H(e), T("Invalid attribute `ref` supplied to `React.Fragment`."), H(null));
}
}
function et(e, n, i, u, D, Y) {
{
var y = h(e);
if (!y) {
var v = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " 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 j = jt(D);
j ? v += j : v += He();
var x;
e === null ? x = "null" : Se(e) ? x = "array" : e !== void 0 && e.$$typeof === a ? (x = "<" + (c(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : x = typeof e, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", x, v);
}
var E = $t(e, n, i, D, Y);
if (E == null)
return E;
if (y) {
var C = n.children;
if (C !== void 0)
if (u)
if (Se(C)) {
for (var X = 0; X < C.length; X++)
Qe(C[X], e);
Object.freeze && Object.freeze(C);
} else
T("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
Qe(C, e);
}
return e === o ? Nt(E) : Ot(E), E;
}
}
function At(e, n, i) {
return et(e, n, i, !0);
}
function kt(e, n, i) {
return et(e, n, i, !1);
}
var Pt = kt, Ft = At;
ae.Fragment = o, ae.jsx = Pt, ae.jsxs = Ft;
}()), ae;
}
process.env.NODE_ENV === "production" ? Ne.exports = Wt() : Ne.exports = Jt();
var p = Ne.exports;
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Gt = (r) => r.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ct = (...r) => r.filter((a, t, o) => !!a && a.trim() !== "" && o.indexOf(a) === t).join(" ").trim();
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
var Vt = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
};
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const qt = st(
({
color: r = "currentColor",
size: a = 24,
strokeWidth: t = 2,
absoluteStrokeWidth: o,
className: m = "",
children: d,
iconNode: _,
...g
}, w) => Oe(
"svg",
{
ref: w,
...Vt,
width: a,
height: a,
stroke: r,
strokeWidth: o ? Number(t) * 24 / Number(a) : t,
className: ct("lucide", m),
...g
},
[
..._.map(([O, R]) => Oe(O, R)),
...Array.isArray(d) ? d : [d]
]
)
);
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const Kt = (r, a) => {
const t = st(
({ className: o, ...m }, d) => Oe(qt, {
ref: d,
iconNode: a,
className: ct(`lucide-${Gt(r)}`, o),
...m
})
);
return t.displayName = `${r}`, t;
};
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const zt = Kt("Calendar", [
["path", { d: "M8 2v4", key: "1cmpym" }],
["path", { d: "M16 2v4", key: "4m81vk" }],
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
["path", { d: "M3 10h18", key: "8toen8" }]
]);
var Q = function() {
return Q = Object.assign || function(a) {
for (var t, o = 1, m = arguments.length; o < m; o++) {
t = arguments[o];
for (var d in t)
Object.prototype.hasOwnProperty.call(t, d) && (a[d] = t[d]);
}
return a;
}, Q.apply(this, arguments);
}, Ae;
(function(r) {
r.np = "np", r.en = "en";
})(Ae || (Ae = {}));
var lt = [
[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
[31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
[31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
[31, 32, 31, 32, 30, 31, 30, 30, 29, 30, 30, 30],
[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
[31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30],
[30, 31, 32, 32, 30, 31, 30, 30, 29, 30, 30, 30],
[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30]
], ke = lt.map(function(r) {
var a = 0;
return r.map(function(t) {
var o = [t, a];
return a += t, o;
});
}, []), Pe = 0, he = lt.map(function(r) {
var a = r.reduce(function(o, m) {
return o + m;
}, 0), t = [a, Pe];
return Pe += a, t;
}), pe = 33238;
if (Pe !== pe)
throw new Error("Invalid constant initialization for Nepali Date.");
var Fe = 1;
function Ht(r) {
return r - ut;
}
function Xt(r) {
return r + ut;
}
var ut = 2e3, I = 1, at = 0;
function Zt(r, a) {
for (; a < 0; )
a += r;
return a % r;
}
var oe = {
en: {
day: {
short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
long: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
},
month: {
short: ["Bai", "Jes", "Asa", "Shr", "Bhd", "Asw", "Kar", "Man", "Pou", "Mag", "Fal", "Cha"],
long: [
"Baisakh",
"Jestha",
"Asar",
"Shrawan",
"Bhadra",
"Aswin",
"Kartik",
"Mangsir",
"Poush",
"Magh",
"Falgun",
"Chaitra"
]
},
date: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
},
np: {
day: {
short: ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"],
long: ["आइतबार", "सोमबार", "मंगलबार", "बुधबार", "बिहिबार", "शुक्रबार", "शनिबार"]
},
month: {
short: ["बै", "जे", "अ", "श्रा", "भा", "आ", "का", "मं", "पौ", "मा", "फा", "चै"],
long: [
"बैशाख",
"जेठ",
"असार",
"श्रावण",
"भाद्र",
"आश्विन",
"कार्तिक",
"मंसिर",
"पौष",
"माघ",
"फाल्गुण",
"चैत्र"
]
},
date: ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"]
}
}, $e = {
year: 1943,
month: 3,
date: 13,
day: 3
};
function Qt(r, a, t) {
try {
var o = Ht(r), m = he[o][I], d = Zt(12, a), _ = Math.floor(a / 12), g = he[o + _][I] - m + ke[o + _][d][I], w = m + g + t;
if (w < Fe || w > pe)
throw new Error();
return w;
} catch {
throw new Error("The date doesn't fall within 2000/01/01 - 2090/12/30");
}
}
function ft(r) {
if (r < Fe || r > pe)
throw new Error("The epoch difference is not within the boundaries ".concat(Fe, " - ").concat(pe));
var a = he.findIndex(function(d) {
return r > d[I] && r <= d[I] + d[at];
}), t = r - he[a][I], o = ke[a].findIndex(function(d) {
return t > d[I] && t <= d[I] + d[at];
}), m = t - ke[a][o][I];
return {
year: Xt(a),
month: o,
date: m
};
}
function er(r, a, t) {
var o = Math.abs(Date.UTC(r, a, t) - Date.UTC($e.year, $e.month, $e.date)), m = Math.ceil(o / (1e3 * 3600 * 24));
return m;
}
function dt(r) {
var a = new Date(Date.UTC(1943, 3, 13 + r));
return {
year: a.getUTCFullYear(),
month: a.getUTCMonth(),
date: a.getUTCDate(),
day: a.getUTCDay()
};
}
function tr(r) {
try {
var a = Qt(r.year, r.month, r.date), t = ft(a), o = dt(a);
return {
AD: o,
BS: Q(Q({}, t), { day: o.day })
};
} catch {
throw new Error("The date doesn't fall within 2000/01/01 - 2090/12/30");
}
}
function rr(r) {
try {
var a = er(r.getFullYear(), r.getMonth(), r.getDate()), t = ft(a), o = dt(a);
return {
AD: o,
BS: Q(Q({}, t), { day: o.day })
};
} catch {
throw new Error("The date doesn't fall within 2000/01/01 - 2090/12/30");
}
}
function L(r, a) {
return r.split("").map(function(t) {
return oe[a].date[parseInt(t, 10)];
}).join("");
}
function nr(r, a, t) {
return a.replace(/((\\[MDYd])|D{1,2}|M{1,4}|Y{2,4}|d{1,3})/g, function(o, m, d) {
var _;
switch (o) {
case "D":
return L(r.date.toString(), t);
case "DD":
return L(r.date.toString().padStart(2, "0"), t);
case "M":
return L((r.month + 1).toString(), t);
case "MM":
return L((r.month + 1).toString().padStart(2, "0"), t);
case "MMM":
return oe[t].month.short[r.month];
case "MMMM":
return oe[t].month.long[r.month];
case "YY":
return L(r.year.toString().slice(-2), t);
case "YYY":
return L(r.year.toString().slice(-3), t);
case "YYYY":
return L(r.year.toString(), t);
case "d":
return L(((_ = r.day) === null || _ === void 0 ? void 0 : _.toString()) || "0", t);
case "dd":
return oe[t].day.short[r.day || 0];
case "ddd":
return oe[t].day.long[r.day || 0];
default:
return d.replace("/", "");
}
}).replace(/\\/g, "");
}
function ot(r) {
var a = /(\d{4})\s*([/-]|\s+)\s*(\d{1,2})\s*([/-]|\s+)\s*(\d{1,2})/, t = /(\d{1,2})\s*([/-]|\s+)\s*(\d{1,2})\s*([/-]|\s+)\s*(\d{4})/, o;
if (o = r.match(a), o !== null)
return {
year: parseInt(o[1], 10),
month: parseInt(o[3], 10) - 1,
date: parseInt(o[5], 10)
};
if (o = r.match(t), o !== null)
return {
year: parseInt(o[5], 10),
month: parseInt(o[3], 10) - 1,
date: parseInt(o[1], 10)
};
throw new Error("Invalid date format");
}
var B = Symbol("Date"), je = Symbol("Day"), W = Symbol("Year"), J = Symbol("MonthIndex"), G = Symbol("JsDate"), fe = Symbol("convertToBS()"), Z = Symbol("convertToAD()"), Ce = Symbol("setADBS()"), de = Symbol("setDayYearMonth()"), b = (
/** @class */
function() {
function r() {
var a = new Error("Invalid constructor arguments");
if (arguments.length === 0)
this[fe](/* @__PURE__ */ new Date());
else if (arguments.length === 1) {
var t = arguments[0];
switch (typeof t) {
case "number":
this[fe](new Date(t));
break;
case "string":
var o = ot(t), m = o.date, d = o.year, _ = o.month;
this[de](d, _, m), this[Z]();
break;
case "object":
if (t instanceof Date)
this[fe](t);
else
throw a;
break;
default:
throw a;
}
} else if (arguments.length <= 3)
this[de](arguments[0], arguments[1], arguments[2]), this[Z]();
else
throw a;
}
return r.prototype[de] = function(a, t, o, m) {
t === void 0 && (t = 0), o === void 0 && (o = 1), m === void 0 && (m = 0), this[W] = a, this[J] = t, this[B] = o, this[je] = m;
}, r.prototype.toJsDate = function() {
return this[G];
}, r.prototype.getDate = function() {
return this[B];
}, r.prototype.getYear = function() {
return this[W];
}, r.prototype.getDay = function() {
return this[je];
}, r.prototype.getMonth = function() {
return this[J];
}, r.prototype.getDateObject = function() {
return {
BS: this.getBS(),
AD: this.getAD()
};
}, r.prototype.getBS = function() {
return {
year: this[W],
month: this[J],
date: this[B],
day: this[je]
};
}, r.prototype.getAD = function() {
return {
year: this[G].getFullYear(),
month: this[G].getMonth(),
date: this[G].getDate(),
day: this[G].getDay()
};
}, r.prototype.setDate = function(a) {
var t = this[B];
try {
this[B] = a, this[Z]();
} catch (o) {
throw this[B] = t, o;
}
}, r.prototype.setMonth = function(a) {
var t = this[J];
try {
this[J] = a, this[Z]();
} catch (o) {
throw this[J] = t, o;
}
}, r.prototype.setYear = function(a) {
var t = this[W];
try {
this[W] = a, this[Z]();
} catch (o) {
throw this[W] = t, o;
}
}, r.prototype.format = function(a, t) {
return t === void 0 && (t = r.language), nr(this.getBS(), a, t);
}, r.parse = function(a) {
var t = ot(a), o = t.date, m = t.year, d = t.month;
return new r(m, d, o);
}, r.now = function() {
return new r();
}, r.fromAD = function(a) {
return new r(a);
}, r.prototype[fe] = function(a) {
var t = rr(a), o = t.AD, m = t.BS;
this[Ce](o, m);
}, r.prototype[Ce] = function(a, t) {
this[de](t.year, t.month, t.date, t.day), this[G] = new Date(a.year, a.month, a.date);
}, r.prototype[Z] = function() {
var a = tr({
year: this[W],
month: this[J],
date: this[B]
}), t = a.AD, o = a.BS;
this[Ce](t, o);
}, r.prototype.valueOf = function() {
return this[G].getTime();
}, r.prototype.toString = function() {
return this.format("ddd DD, MMMM YYYY");
}, r.language = Ae.en, r;
}()
);
const ht = It.forwardRef(
({ className: r, type: a, ...t }, o) => /* @__PURE__ */ p.jsx("input", { type: a, className: "cutom-input", ref: o, ...t })
);
ht.displayName = "Input";
function ir({
onDateChange: r,
defaultValue: a,
language: t,
format: o,
...m
}) {
const [d, _] = Te(
a ? t === "np" ? new b(a) : new Date(a) : null
), [g, w] = Te(() => {
if (a) {
const s = new b(a), h = new Date(a);
return {
nepali: t === "np" ? s : new b(h),
gregorian: t === "en" ? h : s.toJsDate()
};
} else {
const s = b.now(), h = /* @__PURE__ */ new Date();
return {
nepali: t === "np" ? s : new b(h),
gregorian: t === "en" ? h : s.toJsDate()
};
}
}), [O, R] = Te(!1), $ = {
en: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
np: [
"बैशाख",
"जेठ",
"असार",
"सावन",
"भदौ",
"असोज",
"कार्तिक",
"मंसिर",
"पौष",
"माघ",
"फागुन",
"चैत"
]
}, A = {
en: ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"],
np: ["आईत", "सोम", "मंगल", "बुध", "बिही", "शुक्र", "शनि"]
}, V = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], q = (s, h, f) => {
if (!s)
return "";
if (h === "en") {
const l = s instanceof Date ? s : s.toJsDate();
return ge(l, f);
} else {
const l = s instanceof b ? s.getYear() : new b(s).getYear(), c = s.getMonth(), S = s.getDate();
return ve(
l,
c,
S,
f
);
}
}, ge = (s, h) => {
const f = (s.getMonth() + 1).toString().padStart(2, "0"), l = s.getDate().toString().padStart(2, "0"), c = s.getFullYear(), S = {
"MM/DD/YYYY": `${f}/${l}/${c}`,
"DD/MM/YYYY": `${l}/${f}/${c}`,
"YYYY/MM/DD": `${c}/${f}/${l}`,
"YYYY-MM-DD": `${c}-${f}-${l}`,
"MM-DD-YYYY": `${f}-${l}-${c}`,
"DD-MM-YYYY": `${l}-${f}-${c}`,
"MMM DD, YYYY": s.toLocaleDateString("en-US", {
month: "short",
day: "2-digit",
year: "numeric"
}),
"DD MMM YYYY": s.toLocaleDateString("en-US", {
day: "2-digit",
month: "short",
year: "numeric"
}),
"MMMM DD, YYYY": s.toLocaleDateString("en-US", {
month: "long",
day: "2-digit",
year: "numeric"
}),
"DDth MMMM, YYYY": `${s.getDate()}${k(
s.getDate()
)} ${s.toLocaleDateString("en-US", {
month: "long"
})}, ${c}`
};
return S[h] || S["YYYY-MM-DD"];
}, ve = (s, h, f, l) => {
const c = N(s).padStart(2, "०"), S = N(h).padStart(2, "०"), M = N(f).padStart(2, "०"), P = $.np[h], z = `${M}${k(f)}`, U = {
"YYYY/MM/DD": `${c}/${S}/${M}`,
"DD/MM/YYYY": `${M}/${S}/${c}`,
"MM/DD/YYYY": `${S}/${M}/${c}`,
"YYYY-MM-DD": `${c}-${S}-${M}`,
"MM-DD-YYYY": `${S}-${M}-${c}`,
"DD-MM-YYYY": `${M}-${S}-${c}`,
"MMM DD, YYYY": `${P} ${M}, ${c}`,
"DD MMM YYYY": `${M} ${P} ${c}`,
"MMMM DD, YYYY": `${P} ${M}, ${c}`,
"DDth MMMM, YYYY": `${z} ${P}, ${c}`
};
return U[l] || U["YYYY-MM-DD"];
}, k = (s) => {
const h = ["th", "st", "nd", "rd"], f = s % 100;
return h[(f - 20) % 10] || h[f] || h[0];
}, T = (s) => {
const h = new b(
g.nepali.getYear(),
g.nepali.getMonth(),
s
), f = new Date(
g.gregorian.getFullYear(),
g.gregorian.getMonth(),
s
);
_(t === "np" ? h : f), r && r({
english: q(f, "en", o),
nepali: q(h, "np", o)
}), R(!1);
}, K = (s) => {
w((h) => {
let f = h.nepali.getYear(), l = h.nepali.getMonth() + s;
l > 11 ? (f += Math.floor(l / 12), l %= 12) : l < 0 && (f += Math.floor(l / 12), l = (l % 12 + 12) % 12);
const c = t === "np" ? (d == null ? void 0 : d.getDate()) ?? 1 : d ? d.getDate() : 1, S = new b(
f,
l + 1,
0
).getDate(), M = new Date(
h.gregorian.getFullYear(),
h.gregorian.getMonth() + s,
1
), P = new Date(
M.getFullYear(),
M.getMonth() + 1,
0
).getDate(), z = Math.min(c, S), U = Math.min(c, P), ee = new b(
f,
l,
z
), te = new Date(
M.getFullYear(),
M.getMonth(),
U
);
return _(
t === "np" ? ee : te
), {
nepali: ee,
gregorian: te
};
});
}, N = (s) => s.toString().split("").map((h) => V[parseInt(h)]).join(""), me = (s) => {
const h = new b(
s.getYear(),
s.getMonth(),
1
), f = new b(
s.getYear(),
s.getMonth() + 1,
0
), l = h.toJsDate().toLocaleString("en-US", {
month: "short"
}), c = f.toJsDate().toLocaleString("en-US", {
month: "short"
});
return l === c ? l : `${l}/${c}`;
}, ye = (s) => {
const h = new b(
s.getYear(),
s.getMonth(),
1
), f = new b(
s.getYear(),
s.getMonth() + 1,
0
), l = h.toJsDate().getFullYear(), c = f.toJsDate().getFullYear();
return l === c ? l.toString() : `${l}-${c}`;
}, De = (s) => {
const h = new b(s.getYear(), s.getMonth(), 1).getBS(), f = new b(
s.getYear(),
s.getMonth() + 2,
0
).getBS(), l = h.month, c = f.month;
return l === c ? $.np[l] : `${$.np[l]}/${$.np[c]}`;
}, Ye = (s) => {
const h = new b(s.getYear(), s.getMonth(), 1).getBS(), f = new b(
s.getYear(),
s.getMonth() + 2,
0
).getBS(), l = h.year, c = f.year;
return l === c ? N(l) : `${N(l)}-${N(
c
)}`;
};
return /* @__PURE__ */ p.jsx("div", { className: "flex gap-2", ...m, children: /* @__PURE__ */ p.jsxs(Lt, { open: O, onOpenChange: R, children: [
/* @__PURE__ */ p.jsx(Ut, { asChild: !0, children: /* @__PURE__ */ p.jsxs("div", { className: "relative", children: [
/* @__PURE__ */ p.jsx(
ht,
{
value: d ? q(d, t, o) : "",
placeholder: o,
className: "w-[100px] pr-8",
readOnly: !0
}
),
/* @__PURE__ */ p.jsx(
zt,
{
stroke: "#1a1a1a",
className: "absolute right-0 top-2.5 h-2 w-2 opacity-50"
}
)
] }) }),
/* @__PURE__ */ p.jsx(
Bt,
{
className: "w-auto p-0",
align: "start",
sideOffset: 4,
style: {
zIndex: 9999
},
children: /* @__PURE__ */ p.jsxs(
"div",
{
style: { backgroundColor: "var(--secondary-color)" },
className: "mt-1 p-2 pb-0 rounded-md bg-white box-shadow-md",
children: [
/* @__PURE__ */ p.jsx(
"div",
{
style: { backgroundColor: "var(--primary-color)" },
className: "text-white p-2 rounded-md mb-2",
children: /* @__PURE__ */ p.jsxs("div", { className: "flex justify-between items-center", children: [
/* @__PURE__ */ p.jsxs("div", { className: "flex gap-1", children: [
/* @__PURE__ */ p.jsx(
"button",
{
onClick: () => K(-12),
className: "hover:bg-white/10 px-1 rounded",
children: "<<"
}
),
/* @__PURE__ */ p.jsx(
"button",
{
onClick: () => K(-1),
className: "hover:bg-white/10 px-1 rounded",
children: "<"
}
)
] }),
/* @__PURE__ */ p.jsx("div", { className: "text-center flex flex-col", children: t === "np" ? /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
/* @__PURE__ */ p.jsx("div", { className: "font-bold text-lg", children: `${$[t][g.nepali.getMonth()]} ${N(g.nepali.getYear())}` }),
/* @__PURE__ */ p.jsxs("div", { className: "text-sm", children: [
me(g.nepali),
" ",
ye(g.nepali)
] })
] }) : /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
/* @__PURE__ */ p.jsx("div", { className: "font-bold text-lg", children: `${$[t][g.gregorian.getMonth()]} ${g.gregorian.getFullYear()}` }),
/* @__PURE__ */ p.jsxs("div", { className: "text-sm", children: [
De(g.nepali),
" ",
Ye(g.nepali)
] })
] }) }),
/* @__PURE__ */ p.jsxs("div", { className: "flex gap-1", children: [
/* @__PURE__ */ p.jsx(
"button",
{
onClick: () => K(1),
className: "hover:bg-white/10 px-1 rounded",
children: ">"
}
),
/* @__PURE__ */ p.jsx(
"button",
{
onClick: () => K(12),
className: "hover:bg-white/10 px-1 rounded",
children: ">>"
}
)
] })
] })
}
),
/* @__PURE__ */ p.jsxs("div", { className: "grid grid-cols-7 gap-2 text-black p-3", children: [
A[t].map((s) => /* @__PURE__ */ p.jsx("div", { className: "text-center text-xs font-medium p-1", children: s }, s)),
Array.from({
length: t === "np" ? new b(
g.nepali.getYear(),
g.nepali.getMonth(),
1
).getDay() : new Date(
g.gregorian.getFullYear(),
g.gregorian.getMonth(),
1
).getDay()
}).map((s, h) => /* @__PURE__ */ p.jsx("div", { className: "h-8" }, `empty-${h}`)),
Array.from({
length: t === "np" ? new b(
g.nepali.getYear(),
g.nepali.getMonth() + 1,
0
).getDate() : new Date(
g.gregorian.getFullYear(),
g.gregorian.getMonth() + 1,
0
).getDate()
}).map((s, h) => {
const f = h + 1;
let l, c;
return t === "np" ? (l = new b(
g.nepali.getYear(),
g.nepali.getMonth(),
f
), c = l.toJsDate()) : (c = new Date(
g.gregorian.getFullYear(),
g.gregorian.getMonth(),
f
), l = new b(c)), /* @__PURE__ */ p.jsx(
"button",
{
className: `date h-8 w-8 rounded text-sm relative p-1 hover:bg-gray-100
${(d == null ? void 0 : d.getDate()) === f ? "date-selected rounded bg-primary text-white hover:text-primary" : ""}`,
onClick: () => T(f),
children: t === "np" ? /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
/* @__PURE__ */ p.jsx(
"span",
{
className: `absolute top-0 ${f.toString().length === 1 ? "right-3" : "right-2"} text-md`,
children: N(f)
}
),
/* @__PURE__ */ p.jsx(
"span",
{
className: `absolute bottom-1 ${c.getDate().toString().length === 1 ? "right-1" : "right-0"} text-sm`,
children: c.getDate()
}
)
] }) : /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
/* @__PURE__ */ p.jsx(
"span",
{
className: `absolute top-0 ${f.toString().length === 1 ? "right-3" : "right-2"} text-md`,
children: f
}
),
/* @__PURE__ */ p.jsx(
"span",