bs-ad-calendar-react 1.2.2 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,255 +1,255 @@
1
- import { jsx as h, jsxs as b, Fragment as Me } from "react/jsx-runtime";
2
- import { useMemo as Ct, useState as I, useEffect as Tt, useRef as pe } from "react";
3
- const K = [1943, 4, 14], Nt = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Se = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], j = [[[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365]];
4
- let It = class extends Error {
1
+ import { jsx as g, jsxs as S, Fragment as pe } from "react/jsx-runtime";
2
+ import { useMemo as $t, useState as B, useEffect as Yt, useRef as xt } from "react";
3
+ const Q = [1943, 4, 14], Lt = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], be = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], W = [[[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365]];
4
+ let Rt = class extends Error {
5
5
  constructor(t) {
6
6
  super(t), this.name = "DateOutOfRangeError";
7
7
  }
8
8
  };
9
- const Lt = () => K[0] + 1, Rt = () => K[0] + j.length - 1, jt = () => 2e3, Pt = () => 2e3 + j.length - 1, Dt = (e) => e % 400 === 0 || e % 4 === 0 && e % 100 !== 0, Yt = (e) => Dt(e) ? Se : Nt, be = (e, t, a) => !(e < Lt() || e > Rt() || t < 1 || t > 12 || a < 1 || a > Yt(e)[t - 1]), xt = (e, t, a) => {
10
- let s = e * 365 + a;
11
- for (let n = 0; n < t - 1; n++) s += Nt[n];
12
- return t <= 2 && (e -= 1), s += Math.floor(e / 4) - Math.floor(e / 100) + Math.floor(e / 400), s;
9
+ const _t = () => Q[0] + 1, jt = () => Q[0] + W.length - 1, Pt = () => 2e3, Wt = () => 2e3 + W.length - 1, yt = (e) => e % 400 === 0 || e % 4 === 0 && e % 100 !== 0, kt = (e) => yt(e) ? be : Lt, Se = (e, t, n) => !(e < _t() || e > jt() || t < 1 || t > 12 || n < 1 || n > kt(e)[t - 1]), Ft = (e, t, n) => {
10
+ let a = e * 365 + n;
11
+ for (let s = 0; s < t - 1; s++) a += Lt[s];
12
+ return t <= 2 && (e -= 1), a += Math.floor(e / 4) - Math.floor(e / 100) + Math.floor(e / 400), a;
13
13
  };
14
- function Ee(e, t, a) {
15
- const s = t + 1;
16
- if (!be(e, s, a)) throw new It("Date out of range");
17
- let n = 2e3, r = 1, o = 1, u = Math.abs(xt(e, s, a) - xt(...K)), i = 0;
18
- for (; u >= j[i][1]; ) u -= j[i][1], n += 1, i += 1;
19
- let c = 0;
20
- for (; u >= j[i][0][c]; ) u -= j[i][0][c], r += 1, c += 1;
21
- return o += u, [n, r - 1, o];
14
+ function Ee(e, t, n) {
15
+ const a = t + 1;
16
+ if (!Se(e, a, n)) throw new Rt("Date out of range");
17
+ let s = 2e3, r = 1, o = 1, u = Math.abs(Ft(e, a, n) - Ft(...Q)), i = 0;
18
+ for (; u >= W[i][1]; ) u -= W[i][1], s += 1, i += 1;
19
+ let h = 0;
20
+ for (; u >= W[i][0][h]; ) u -= W[i][0][h], r += 1, h += 1;
21
+ return o += u, [s, r - 1, o];
22
22
  }
23
- const ke = (e, t, a) => !(e < jt() || e > Pt() || t < 1 || t > 12 || a < 1 || a > j[e - 2e3][0][t - 1]), Ye = (e, t, a) => {
24
- let s = a - 1;
25
- const n = e - 2e3;
26
- for (let r = 0; r < t - 1; r++) s += j[n][0][r];
27
- for (let r = 0; r < n; r++) s += j[r][1];
28
- return s;
29
- }, we = (e, t, a) => {
30
- const s = t + 1;
31
- if (!ke(e, s, a)) throw new It("Date out of range");
32
- let [n, r, o] = [K[0], 1, 1];
33
- const u = Yt(n).slice(0, K[1] - 1).reduce((m, d) => m + d, 0) + K[2] - 1;
34
- let i = Math.abs(Ye(e, s, a) + u);
35
- for (; i >= 366 && Dt(n) || i >= 365 && !Dt(n); ) i -= Dt(n) ? 366 : 365, n += 1;
36
- const c = Yt(n);
37
- let l = 0;
38
- for (; i >= c[l]; ) i -= c[l], r += 1, l += 1;
39
- return o += i, [n, r - 1, o];
40
- }, P = { enMinYear: Lt, enMaxYear: Rt, npMinYear: jt, npMaxYear: Pt, englishToNepali: Ee, nepaliToEnglish: we }, Wt = "en", L = "ne", Vt = 207e5, Ut = 198e5, _e = 5049018e5, ve = new Date(1986, 0, 1, 0, 15), pt = ["Baisakh", "Jestha", "Asar", "Shrawan", "Bhadra", "Aswin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], wt = ["Bai", "Jes", "Asa", "Shr", "Bhd", "Asw", "Kar", "Man", "Pou", "Mag", "Fal", "Cha"], Jt = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "आश्विन", "कार्तिक", "मंसिर", "पौष", "माघ", "फाल्गुण", "चैत्र"], Ce = ["बै", "जे", "अ", "श्रा", "भा", "आ", "का", "मं", "पौ", "मा", "फा", "चै"], _t = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], vt = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], xe = ["जनवरी", "फेब्रुअरी", "मार्च", "अप्रिल", "मे", "जुन", "जुलाई", "अगस्ट", "सेप्टेम्बर", "अक्टोबर", "नोभेम्बर", "डिसेम्बर"], Ae = ["जन", "फेब", "मार", "अप्रि", "मे", "जुन", "जुला", "अग", "सेप", "अक्टो", "नोभे", "डिसे"], Gt = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], z = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], St = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], Kt = ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"], zt = ["आइतबार", "सोमबार", "मंगलबार", "बुधबार", "बिहिबार", "शुक्रबार", "शनिबार"], $e = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DD?|ddd?d?|do?|YYYY|YY|y{2,4}|yo?|a|A|hh?|HH?|mm?|ss?|SSS|x|X|.)/g, Fe = (e) => {
41
- const t = e.getTime(), a = t < _e ? Ut : Vt, s = new Date(t + a), n = s.getUTCFullYear(), r = s.getUTCMonth(), o = s.getUTCDate(), u = s.getUTCHours(), i = s.getUTCMinutes(), c = s.getUTCSeconds(), l = s.getUTCMilliseconds(), m = s.getUTCDay();
42
- return { year: n, month0: r, day: o, hour: u, minute: i, second: c, ms: l, weekDay: m };
43
- }, At = (e, t, a, s, n, r, o) => {
44
- const u = new Date(e, t, a, s, n, r, o);
45
- let i = u < ve ? Ut : Vt;
46
- const c = -1 * u.getTimezoneOffset() * 60 * 1e3;
47
- return new Date(u.getTime() - i + c);
23
+ const we = (e, t, n) => !(e < Pt() || e > Wt() || t < 1 || t > 12 || n < 1 || n > W[e - 2e3][0][t - 1]), Ye = (e, t, n) => {
24
+ let a = n - 1;
25
+ const s = e - 2e3;
26
+ for (let r = 0; r < t - 1; r++) a += W[s][0][r];
27
+ for (let r = 0; r < s; r++) a += W[r][1];
28
+ return a;
29
+ }, ke = (e, t, n) => {
30
+ const a = t + 1;
31
+ if (!we(e, a, n)) throw new Rt("Date out of range");
32
+ let [s, r, o] = [Q[0], 1, 1];
33
+ const u = kt(s).slice(0, Q[1] - 1).reduce((D, d) => D + d, 0) + Q[2] - 1;
34
+ let i = Math.abs(Ye(e, a, n) + u);
35
+ for (; i >= 366 && yt(s) || i >= 365 && !yt(s); ) i -= yt(s) ? 366 : 365, s += 1;
36
+ const h = kt(s);
37
+ let c = 0;
38
+ for (; i >= h[c]; ) i -= h[c], r += 1, c += 1;
39
+ return o += i, [s, r - 1, o];
40
+ }, J = { enMinYear: _t, enMaxYear: jt, npMinYear: Pt, npMaxYear: Wt, englishToNepali: Ee, nepaliToEnglish: ke }, Ut = "en", L = "ne", Jt = 207e5, Vt = 198e5, Ce = 5049018e5, Ae = new Date(1986, 0, 1, 0, 15), Mt = ["Baisakh", "Jestha", "Asar", "Shrawan", "Bhadra", "Aswin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Ct = ["Bai", "Jes", "Asa", "Shr", "Bhd", "Asw", "Kar", "Man", "Pou", "Mag", "Fal", "Cha"], Kt = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "आश्विन", "कार्तिक", "मंसिर", "पौष", "माघ", "फाल्गुण", "चैत्र"], ve = ["बै", "जे", "अ", "श्रा", "भा", "आ", "का", "मं", "पौ", "मा", "फा", "चै"], At = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], vt = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], $e = ["जनवरी", "फेब्रुअरी", "मार्च", "अप्रिल", "मे", "जुन", "जुलाई", "अगस्ट", "सेप्टेम्बर", "अक्टोबर", "नोभेम्बर", "डिसेम्बर"], xe = ["जन", "फेब", "मार", "अप्रि", "मे", "जुन", "जुला", "अग", "सेप", "अक्टो", "नोभे", "डिसे"], Gt = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], tt = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], pt = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], zt = ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"], qt = ["आइतबार", "सोमबार", "मंगलबार", "बुधबार", "बिहिबार", "शुक्रबार", "शनिबार"], Fe = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DD?|ddd?d?|do?|YYYY|YY|y{2,4}|yo?|a|A|hh?|HH?|mm?|ss?|SSS|x|X|.)/g, Oe = (e) => {
41
+ const t = e.getTime(), n = t < Ce ? Vt : Jt, a = new Date(t + n), s = a.getUTCFullYear(), r = a.getUTCMonth(), o = a.getUTCDate(), u = a.getUTCHours(), i = a.getUTCMinutes(), h = a.getUTCSeconds(), c = a.getUTCMilliseconds(), D = a.getUTCDay();
42
+ return { year: s, month0: r, day: o, hour: u, minute: i, second: h, ms: c, weekDay: D };
43
+ }, Ot = (e, t, n, a, s, r, o) => {
44
+ const u = new Date(e, t, n, a, s, r, o);
45
+ let i = u < Ae ? Vt : Jt;
46
+ const h = -1 * u.getTimezoneOffset() * 60 * 1e3;
47
+ return new Date(u.getTime() - i + h);
48
48
  }, bt = (e) => {
49
- const t = e.match($e);
50
- return t ? t.map((a) => a.startsWith("[") && a.endsWith("]") ? a.slice(1, -1) : a) : [];
51
- }, R = (e) => {
49
+ const t = e.match(Fe);
50
+ return t ? t.map((n) => n.startsWith("[") && n.endsWith("]") ? n.slice(1, -1) : n) : [];
51
+ }, P = (e) => {
52
52
  if (e.length === 0) return new RegExp("");
53
53
  let t = [...e];
54
- if (t = t.sort((s, n) => n.length - s.length), t[0] === "") return new RegExp("");
55
- const a = `(${t.join("|")})`;
56
- return new RegExp(a);
57
- }, A = (e) => e.toString().padStart(2, "0"), Xt = (e) => e.toString().padStart(3, "0"), Be = (e) => e.split("").map((t) => Gt[t.charCodeAt(0) - 48]).join(""), S = (e, t) => {
58
- const a = typeof e == "string" ? e : String(e);
59
- return t !== L ? a : Be(a);
60
- }, He = (e, t) => S(e.getYear(), t).substring(2), Oe = (e, t) => S(e.getYear(), t), Te = (e, t) => S(e.getEnglishYear(), t).substring(2), Ne = (e, t) => S(e.getEnglishYear(), t), Ie = (e, t) => S(e.getMonth() + 1, t), Le = (e, t) => S(A(e.getMonth() + 1), t), Re = (e, t) => t === L ? Ce[e.getMonth()] : wt[e.getMonth()], je = (e, t) => t === L ? Jt[e.getMonth()] : pt[e.getMonth()], Pe = (e, t) => S(e.getEnglishMonth() + 1, t), We = (e, t) => S(A(e.getEnglishMonth() + 1), t), Ve = (e, t) => t === L ? Ae[e.getEnglishMonth()] : vt[e.getEnglishMonth()], Ue = (e, t) => t === L ? xe[e.getEnglishMonth()] : _t[e.getEnglishMonth()], Je = (e, t) => S(e.getDate(), t), Ge = (e, t) => S(A(e.getDate()), t), Ke = (e, t) => S(e.getEnglishDate(), t), ze = (e, t) => S(A(e.getEnglishDate()), t), Zt = (e, t) => S(e.getDay(), t), Mt = (e, t) => t === L ? Kt[e.getDay()] : z[e.getDay()], qt = (e, t) => t === L ? zt[e.getDay()] : St[e.getDay()], Qt = (e, t) => S(e.getHours(), t), te = (e, t) => S(A(e.getHours()), t), ee = (e, t) => {
61
- const a = e.getHours(), s = a > 12 ? a - 12 : a;
62
- return S(s, t);
63
- }, ne = (e, t) => {
64
- const a = e.getHours(), s = a > 12 ? a - 12 : a;
65
- return S(A(s), t);
66
- }, ae = (e, t) => S(e.getMinutes(), t), se = (e, t) => S(A(e.getMinutes()), t), re = (e, t) => S(e.getSeconds(), t), oe = (e, t) => S(A(e.getSeconds()), t), ie = (e, t) => S(Xt(e.getMilliseconds()), t), ue = (e, t) => t === L ? e.getHours() >= 12 ? "पिम" : "एम" : e.getHours() >= 12 ? "PM" : "AM", ce = (e, t) => t === L ? e.getHours() >= 12 ? "पिम" : "एम" : e.getHours() >= 12 ? "pm" : "am", $t = { YY: He, YYYY: Oe, M: Ie, MM: Le, MMM: Re, MMMM: je, D: Je, DD: Ge, d: Zt, dd: Mt, ddd: Mt, dddd: qt, H: Qt, HH: te, h: ee, hh: ne, m: ae, mm: se, s: re, ss: oe, SSS: ie, A: ue, a: ce }, le = (e, t, a) => {
67
- const s = bt(t), n = (r) => r in $t ? $t[r](e, a) : r;
68
- return s.map(n).join("");
69
- }, Xe = (e, t) => le(e, t, Wt), Ze = (e, t) => le(e, t, L), qe = (e) => {
70
- const t = A(e.getYear()), a = A(e.getMonth() + 1), s = A(e.getDate()), n = A(e.getHours()), r = A(e.getMinutes()), o = A(e.getSeconds()), u = e.getMilliseconds(), i = u === 0 ? "" : `.${Xt(u)}`;
71
- return `${t}-${a}-${s} ${n}:${r}:${o}${i}`;
72
- }, Ft = { YY: Te, YYYY: Ne, M: Pe, MM: We, MMM: Ve, MMMM: Ue, D: Ke, DD: ze, d: Zt, dd: Mt, ddd: Mt, dddd: qt, H: Qt, HH: te, h: ee, hh: ne, m: ae, mm: se, s: re, ss: oe, SSS: ie, A: ue, a: ce }, he = (e, t, a) => {
73
- const s = bt(t), n = (r) => r in Ft ? Ft[r](e, a) : r;
74
- return s.map(n).join("");
75
- }, Qe = (e, t) => he(e, t, Wt), t3 = (e, t) => he(e, t, L);
54
+ if (t = t.sort((a, s) => s.length - a.length), t[0] === "") return new RegExp("");
55
+ const n = `(${t.join("|")})`;
56
+ return new RegExp(n);
57
+ }, F = (e) => e.toString().padStart(2, "0"), Xt = (e) => e.toString().padStart(3, "0"), Ne = (e) => e.split("").map((t) => Gt[t.charCodeAt(0) - 48]).join(""), b = (e, t) => {
58
+ const n = typeof e == "string" ? e : String(e);
59
+ return t !== L ? n : Ne(n);
60
+ }, Te = (e, t) => b(e.getYear(), t).substring(2), He = (e, t) => b(e.getYear(), t), Be = (e, t) => b(e.getEnglishYear(), t).substring(2), Ie = (e, t) => b(e.getEnglishYear(), t), Le = (e, t) => b(e.getMonth() + 1, t), Re = (e, t) => b(F(e.getMonth() + 1), t), _e = (e, t) => t === L ? ve[e.getMonth()] : Ct[e.getMonth()], je = (e, t) => t === L ? Kt[e.getMonth()] : Mt[e.getMonth()], Pe = (e, t) => b(e.getEnglishMonth() + 1, t), We = (e, t) => b(F(e.getEnglishMonth() + 1), t), Ue = (e, t) => t === L ? xe[e.getEnglishMonth()] : vt[e.getEnglishMonth()], Je = (e, t) => t === L ? $e[e.getEnglishMonth()] : At[e.getEnglishMonth()], Ve = (e, t) => b(e.getDate(), t), Ke = (e, t) => b(F(e.getDate()), t), Ge = (e, t) => b(e.getEnglishDate(), t), ze = (e, t) => b(F(e.getEnglishDate()), t), Zt = (e, t) => b(e.getDay(), t), ft = (e, t) => t === L ? zt[e.getDay()] : tt[e.getDay()], Qt = (e, t) => t === L ? qt[e.getDay()] : pt[e.getDay()], te = (e, t) => b(e.getHours(), t), ee = (e, t) => b(F(e.getHours()), t), ne = (e, t) => {
61
+ const n = e.getHours(), a = n > 12 ? n - 12 : n;
62
+ return b(a, t);
63
+ }, se = (e, t) => {
64
+ const n = e.getHours(), a = n > 12 ? n - 12 : n;
65
+ return b(F(a), t);
66
+ }, ae = (e, t) => b(e.getMinutes(), t), re = (e, t) => b(F(e.getMinutes()), t), oe = (e, t) => b(e.getSeconds(), t), ie = (e, t) => b(F(e.getSeconds()), t), ue = (e, t) => b(Xt(e.getMilliseconds()), t), ce = (e, t) => t === L ? e.getHours() >= 12 ? "पिम" : "एम" : e.getHours() >= 12 ? "PM" : "AM", he = (e, t) => t === L ? e.getHours() >= 12 ? "पिम" : "एम" : e.getHours() >= 12 ? "pm" : "am", Nt = { YY: Te, YYYY: He, M: Le, MM: Re, MMM: _e, MMMM: je, D: Ve, DD: Ke, d: Zt, dd: ft, ddd: ft, dddd: Qt, H: te, HH: ee, h: ne, hh: se, m: ae, mm: re, s: oe, ss: ie, SSS: ue, A: ce, a: he }, le = (e, t, n) => {
67
+ const a = bt(t), s = (r) => r in Nt ? Nt[r](e, n) : r;
68
+ return a.map(s).join("");
69
+ }, qe = (e, t) => le(e, t, Ut), Xe = (e, t) => le(e, t, L), Ze = (e) => {
70
+ const t = F(e.getYear()), n = F(e.getMonth() + 1), a = F(e.getDate()), s = F(e.getHours()), r = F(e.getMinutes()), o = F(e.getSeconds()), u = e.getMilliseconds(), i = u === 0 ? "" : `.${Xt(u)}`;
71
+ return `${t}-${n}-${a} ${s}:${r}:${o}${i}`;
72
+ }, Tt = { YY: Be, YYYY: Ie, M: Pe, MM: We, MMM: Ue, MMMM: Je, D: Ge, DD: ze, d: Zt, dd: ft, ddd: ft, dddd: Qt, H: te, HH: ee, h: ne, hh: se, m: ae, mm: re, s: oe, ss: ie, SSS: ue, A: ce, a: he }, de = (e, t, n) => {
73
+ const a = bt(t), s = (r) => r in Tt ? Tt[r](e, n) : r;
74
+ return a.map(s).join("");
75
+ }, Qe = (e, t) => de(e, t, Ut), t3 = (e, t) => de(e, t, L);
76
76
  function e3(e) {
77
- const t = e.split(/[-./]/, 3), [a, s = 1, n = 1] = t.map((r) => {
77
+ const t = e.split(/[-./]/, 3), [n, a = 1, s = 1] = t.map((r) => {
78
78
  const o = parseInt(r, 10);
79
79
  if (Number.isNaN(o)) throw new Error("Invalid date");
80
80
  return o;
81
81
  });
82
- return [a, s - 1, n];
82
+ return [n, a - 1, s];
83
83
  }
84
84
  function n3(e) {
85
85
  if (!e) return [0, 0, 0, 0];
86
- const [t, a = "0"] = e.split(".", 2), s = t.split(":", 3), [n, r = 0, o = 0] = s.map((i) => {
87
- const c = parseInt(i, 10);
88
- if (Number.isNaN(c)) throw new Error("Invalid time");
89
- return c;
86
+ const [t, n = "0"] = e.split(".", 2), a = t.split(":", 3), [s, r = 0, o = 0] = a.map((i) => {
87
+ const h = parseInt(i, 10);
88
+ if (Number.isNaN(h)) throw new Error("Invalid time");
89
+ return h;
90
90
  });
91
- let u = parseInt(a, 10);
92
- return Number.isNaN(u) && (u = 0), [n, r, o, u];
93
- }
94
- function a3(e) {
95
- const [t, a] = e.split(" ", 2), [s, n, r] = e3(t), [o, u, i, c] = n3(a);
96
- return [s, n, r, o, u, i, c];
91
+ let u = parseInt(n, 10);
92
+ return Number.isNaN(u) && (u = 0), [s, r, o, u];
97
93
  }
98
- const Bt = { YY: /(\d\d)/, YYYY: /(\d\d\d\d)/, M: /(1[0-2]|0[1-9]|[1-9])/, MM: /(1[0-2]|0[1-9]|[1-9])/, D: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, DD: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, H: /(2[0-3]|[0-1]\d|\d)/, HH: /(2[0-3]|[0-1]\d|\d)/, hh: /(1[0-2]|0[1-9]|[1-9])/, mm: /([0-5]\d|\d)/, ss: /([0-5]\d|\d)/, SSS: /(\d\d\d)/, A: /(AM|PM)/, a: /(am|pm)/, MMMM: R(pt), MMM: R(wt), dddd: R(St), ddd: R(z), dd: R(z), d: /([0-6])/ };
99
94
  function s3(e) {
100
- const t = [], a = [];
101
- for (const n of e) n in Bt ? (t.push(n), a.push(Bt[n].source)) : a.push(n.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
102
- const s = a.join("");
103
- return { dateTokens: t, regex: new RegExp(`^${s}$`) };
95
+ const [t, n] = e.split(" ", 2), [a, s, r] = e3(t), [o, u, i, h] = n3(n);
96
+ return [a, s, r, o, u, i, h];
97
+ }
98
+ const Ht = { YY: /(\d\d)/, YYYY: /(\d\d\d\d)/, M: /(1[0-2]|0[1-9]|[1-9])/, MM: /(1[0-2]|0[1-9]|[1-9])/, D: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, DD: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, H: /(2[0-3]|[0-1]\d|\d)/, HH: /(2[0-3]|[0-1]\d|\d)/, hh: /(1[0-2]|0[1-9]|[1-9])/, mm: /([0-5]\d|\d)/, ss: /([0-5]\d|\d)/, SSS: /(\d\d\d)/, A: /(AM|PM)/, a: /(am|pm)/, MMMM: P(Mt), MMM: P(Ct), dddd: P(pt), ddd: P(tt), dd: P(tt), d: /([0-6])/ };
99
+ function a3(e) {
100
+ const t = [], n = [];
101
+ for (const s of e) s in Ht ? (t.push(s), n.push(Ht[s].source)) : n.push(s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
102
+ const a = n.join("");
103
+ return { dateTokens: t, regex: new RegExp(`^${a}$`) };
104
104
  }
105
105
  function r3(e, t) {
106
- let [a, s, n, r, o, u, i, c] = [0, 1, 1, 0, 0, 0, 0, 0], l = !1, m = !1;
106
+ let [n, a, s, r, o, u, i, h] = [0, 1, 1, 0, 0, 0, 0, 0], c = !1, D = !1;
107
107
  for (let d = 0; d < e.length; d++) {
108
- const k = e[d], y = parseInt(t[d + 1]);
108
+ const k = e[d], m = parseInt(t[d + 1]);
109
109
  switch (k) {
110
110
  case "YYYY":
111
- a = y;
111
+ n = m;
112
112
  break;
113
113
  case "YY":
114
- a = 2e3 + parseInt(t[d]);
114
+ n = 2e3 + parseInt(t[d]);
115
115
  break;
116
116
  case "MM":
117
117
  case "M":
118
- s = y;
118
+ a = m;
119
119
  break;
120
120
  case "MMMM":
121
- s = pt.indexOf(t[d + 1]) + 1;
121
+ a = Mt.indexOf(t[d + 1]) + 1;
122
122
  break;
123
123
  case "MMM":
124
- s = wt.indexOf(t[d + 1]) + 1;
124
+ a = Ct.indexOf(t[d + 1]) + 1;
125
125
  break;
126
126
  case "DD":
127
127
  case "D":
128
- n = y;
128
+ s = m;
129
129
  break;
130
130
  case "HH":
131
131
  case "H":
132
- r = y;
132
+ r = m;
133
133
  break;
134
134
  case "hh":
135
135
  case "h":
136
- o = y, m = !0;
136
+ o = m, D = !0;
137
137
  break;
138
138
  case "mm":
139
139
  case "m":
140
- u = y;
140
+ u = m;
141
141
  break;
142
142
  case "ss":
143
143
  case "s":
144
- i = y;
144
+ i = m;
145
145
  break;
146
146
  case "SSS":
147
- c = y;
147
+ h = m;
148
148
  break;
149
149
  case "A":
150
150
  case "a":
151
- l = t[d + 1].toLowerCase() === "pm";
151
+ c = t[d + 1].toLowerCase() === "pm";
152
152
  }
153
153
  }
154
- return m && (r = o + (l ? 12 : 0)), { year: a, month0: s - 1, day: n, hour: r, minute: u, second: i, ms: c };
154
+ return D && (r = o + (c ? 12 : 0)), { year: n, month0: a - 1, day: s, hour: r, minute: u, second: i, ms: h };
155
155
  }
156
- function de(e, t) {
157
- const a = bt(t), { dateTokens: s, regex: n } = s3(a), r = RegExp(n).exec(e);
156
+ function ge(e, t) {
157
+ const n = bt(t), { dateTokens: a, regex: s } = a3(n), r = RegExp(s).exec(e);
158
158
  if (!r) throw new Error("Invalid date format");
159
- const { year: o, month0: u, day: i, hour: c, minute: l, second: m, ms: d } = r3(s, r);
160
- return [o, u, i, c, l, m, d];
159
+ const { year: o, month0: u, day: i, hour: h, minute: c, second: D, ms: d } = r3(a, r);
160
+ return [o, u, i, h, c, D, d];
161
161
  }
162
- const Ht = { YY: /(\d\d)/, YYYY: /(\d\d\d\d)/, M: /(1[0-2]|0[1-9]|[1-9])/, MM: /(1[0-2]|0[1-9]|[1-9])/, D: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, DD: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, H: /(2[0-3]|[0-1]\d|\d)/, HH: /(2[0-3]|[0-1]\d|\d)/, hh: /(1[0-2]|0[1-9]|[1-9])/, mm: /([0-5]\d|\d)/, ss: /([0-5]\d|\d)/, SSS: /(\d\d\d)/, A: /(AM|PM)/, a: /(am|pm)/, MMMM: R(_t), MMM: R(vt), dddd: R(St), ddd: R(z), dd: R(z), d: /([0-6])/ };
162
+ const Bt = { YY: /(\d\d)/, YYYY: /(\d\d\d\d)/, M: /(1[0-2]|0[1-9]|[1-9])/, MM: /(1[0-2]|0[1-9]|[1-9])/, D: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, DD: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, H: /(2[0-3]|[0-1]\d|\d)/, HH: /(2[0-3]|[0-1]\d|\d)/, hh: /(1[0-2]|0[1-9]|[1-9])/, mm: /([0-5]\d|\d)/, ss: /([0-5]\d|\d)/, SSS: /(\d\d\d)/, A: /(AM|PM)/, a: /(am|pm)/, MMMM: P(At), MMM: P(vt), dddd: P(pt), ddd: P(tt), dd: P(tt), d: /([0-6])/ };
163
163
  function o3(e) {
164
- const t = [], a = [];
165
- for (const n of e) n in Ht ? (t.push(n), a.push(Ht[n].source)) : a.push(n.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
166
- const s = a.join("");
167
- return { dateTokens: t, regex: new RegExp(`^${s}$`) };
164
+ const t = [], n = [];
165
+ for (const s of e) s in Bt ? (t.push(s), n.push(Bt[s].source)) : n.push(s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
166
+ const a = n.join("");
167
+ return { dateTokens: t, regex: new RegExp(`^${a}$`) };
168
168
  }
169
169
  function i3(e, t) {
170
- let [a, s, n, r, o, u, i, c] = [0, 1, 1, 0, 0, 0, 0, 0], l = !1, m = !1;
170
+ let [n, a, s, r, o, u, i, h] = [0, 1, 1, 0, 0, 0, 0, 0], c = !1, D = !1;
171
171
  for (let d = 0; d < e.length; d++) {
172
- const k = e[d], y = parseInt(t[d + 1]);
172
+ const k = e[d], m = parseInt(t[d + 1]);
173
173
  switch (k) {
174
174
  case "YYYY":
175
- a = y;
175
+ n = m;
176
176
  break;
177
177
  case "YY":
178
- a = 2e3 + parseInt(t[d]);
178
+ n = 2e3 + parseInt(t[d]);
179
179
  break;
180
180
  case "MM":
181
181
  case "M":
182
- s = y;
182
+ a = m;
183
183
  break;
184
184
  case "MMMM":
185
- s = _t.indexOf(t[d + 1]) + 1;
185
+ a = At.indexOf(t[d + 1]) + 1;
186
186
  break;
187
187
  case "MMM":
188
- s = vt.indexOf(t[d + 1]) + 1;
188
+ a = vt.indexOf(t[d + 1]) + 1;
189
189
  break;
190
190
  case "DD":
191
191
  case "D":
192
- n = y;
192
+ s = m;
193
193
  break;
194
194
  case "HH":
195
195
  case "H":
196
- r = y;
196
+ r = m;
197
197
  break;
198
198
  case "hh":
199
199
  case "h":
200
- o = y, m = !0;
200
+ o = m, D = !0;
201
201
  break;
202
202
  case "mm":
203
203
  case "m":
204
- u = y;
204
+ u = m;
205
205
  break;
206
206
  case "ss":
207
207
  case "s":
208
- i = y;
208
+ i = m;
209
209
  break;
210
210
  case "SSS":
211
- c = y;
211
+ h = m;
212
212
  break;
213
213
  case "A":
214
214
  case "a":
215
- l = t[d + 1].toLowerCase() === "pm";
215
+ c = t[d + 1].toLowerCase() === "pm";
216
216
  }
217
217
  }
218
- return m && (r = o + (l ? 12 : 0)), { year: a, month0: s - 1, day: n, hour: r, minute: u, second: i, ms: c };
218
+ return D && (r = o + (c ? 12 : 0)), { year: n, month0: a - 1, day: s, hour: r, minute: u, second: i, ms: h };
219
219
  }
220
220
  function u3(e, t) {
221
- const a = bt(t), { dateTokens: s, regex: n } = o3(a), r = RegExp(n).exec(e);
221
+ const n = bt(t), { dateTokens: a, regex: s } = o3(n), r = RegExp(s).exec(e);
222
222
  if (!r) throw new Error("Invalid date format");
223
- const { year: o, month0: u, day: i, hour: c, minute: l, second: m, ms: d } = i3(s, r);
224
- return [o, u, i, c, l, m, d];
223
+ const { year: o, month0: u, day: i, hour: h, minute: c, second: D, ms: d } = i3(a, r);
224
+ return [o, u, i, h, c, D, d];
225
225
  }
226
226
  function c3(e) {
227
227
  const t = { एम: "AM", पिम: "PM" };
228
- Jt.forEach((s, n) => t[s] = pt[n]), zt.forEach((s, n) => t[s] = St[n]), Kt.forEach((s, n) => t[s] = z[n]), Gt.forEach((s, n) => t[s] = String(n));
229
- const a = new RegExp(Object.keys(t).join("|"), "g");
230
- return e.replace(a, (s) => t[s]);
228
+ Kt.forEach((a, s) => t[a] = Mt[s]), qt.forEach((a, s) => t[a] = pt[s]), zt.forEach((a, s) => t[a] = tt[s]), Gt.forEach((a, s) => t[a] = String(s));
229
+ const n = new RegExp(Object.keys(t).join("|"), "g");
230
+ return e.replace(n, (a) => t[a]);
231
231
  }
232
- function l3(e, t) {
233
- const a = c3(e);
234
- return de(a, t);
232
+ function h3(e, t) {
233
+ const n = c3(e);
234
+ return ge(n, t);
235
235
  }
236
- class Et extends Error {
236
+ class St extends Error {
237
237
  constructor(t) {
238
238
  super(t), this.name = "ValidationError";
239
239
  }
240
240
  }
241
- const h3 = (e) => {
242
- if (e < 0 || e > 23) throw new Et("Hour should be in the range 0-23");
241
+ const l3 = (e) => {
242
+ if (e < 0 || e > 23) throw new St("Hour should be in the range 0-23");
243
243
  }, d3 = (e) => {
244
- if (e < 0 || e > 59) throw new Et("Minute should be in the range 0-59");
244
+ if (e < 0 || e > 59) throw new St("Minute should be in the range 0-59");
245
245
  }, g3 = (e) => {
246
- if (e < 0 || e > 59) throw new Et("Second should be in the range 0-59");
246
+ if (e < 0 || e > 59) throw new St("Second should be in the range 0-59");
247
247
  }, m3 = (e) => {
248
- if (e < 0 || e > 999) throw new Et("Millisecond should be in the range 0-999");
249
- }, y3 = (e, t, a, s) => {
250
- h3(e), d3(t), g3(a), m3(s);
248
+ if (e < 0 || e > 999) throw new St("Millisecond should be in the range 0-999");
249
+ }, D3 = (e, t, n, a) => {
250
+ l3(e), d3(t), g3(n), m3(a);
251
251
  };
252
- class E {
252
+ class Y {
253
253
  timestamp;
254
254
  year;
255
255
  yearEn;
@@ -263,11 +263,11 @@ class E {
263
263
  constructor(...t) {
264
264
  if (t.length === 0) this.initFromCurrentDate();
265
265
  else if (t.length === 1 && t[0] instanceof Date) this.initFromEnglishDate(t[0]);
266
- else if (t.length === 1 && t[0] instanceof E) this.initFromNepaliDate(t[0]);
266
+ else if (t.length === 1 && t[0] instanceof Y) this.initFromNepaliDate(t[0]);
267
267
  else if (t.length === 1 && typeof t[0] == "string") this.parseFromString(t[0]);
268
268
  else if (t.length === 1 && typeof t[0] == "number") this.initFromTimestamp(t[0]);
269
269
  else if (t.length === 2 && typeof t[0] == "string" && typeof t[1] == "string") this.parseFromStringWithFormat(t[0], t[1]);
270
- else if (t.length >= 2 && t.length <= 8 && t.every((a) => typeof a == "number")) this.initFromComponents(t);
270
+ else if (t.length >= 2 && t.length <= 8 && t.every((n) => typeof n == "number")) this.initFromComponents(t);
271
271
  else throw new Error("Invalid date argument");
272
272
  }
273
273
  initFromCurrentDate() {
@@ -280,25 +280,25 @@ class E {
280
280
  this.set(t.year, t.month, t.day, t.hour, t.minute, t.getSeconds(), t.getMilliseconds());
281
281
  }
282
282
  parseFromString(t) {
283
- const a = a3(t);
284
- this.set(a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
283
+ const n = s3(t);
284
+ this.set(n[0], n[1], n[2], n[3], n[4], n[5], n[6]);
285
285
  }
286
286
  initFromTimestamp(t) {
287
287
  this._setDateObject(new Date(t));
288
288
  }
289
- parseFromStringWithFormat(t, a) {
290
- const s = de(t, a);
291
- this.set(s[0], s[1], s[2], s[3], s[4], s[5], s[6]);
289
+ parseFromStringWithFormat(t, n) {
290
+ const a = ge(t, n);
291
+ this.set(a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
292
292
  }
293
293
  initFromComponents(t) {
294
294
  this.set(t[0], t[1], t[2] ?? 1, t[3] ?? 0, t[4] ?? 0, t[5] ?? 0, t[6] ?? 0);
295
295
  }
296
- _setDateObject(t, a = !0) {
296
+ _setDateObject(t, n = !0) {
297
297
  this.timestamp = t;
298
- const { year: s, month0: n, day: r, hour: o, minute: u, weekDay: i } = Fe(t);
299
- if (this.yearEn = s, this.monthEn = n, this.dayEn = r, this.hour = o, this.minute = u, this.weekDay = i, a) {
300
- const [c, l, m] = P.englishToNepali(s, n, r);
301
- this.year = c, this.month = l, this.day = m;
298
+ const { year: a, month0: s, day: r, hour: o, minute: u, weekDay: i } = Oe(t);
299
+ if (this.yearEn = a, this.monthEn = s, this.dayEn = r, this.hour = o, this.minute = u, this.weekDay = i, n) {
300
+ const [h, c, D] = J.englishToNepali(a, s, r);
301
+ this.year = h, this.month = c, this.day = D;
302
302
  }
303
303
  }
304
304
  getDateObject() {
@@ -364,22 +364,22 @@ class E {
364
364
  setTime(t) {
365
365
  this._setDateObject(new Date(t));
366
366
  }
367
- set(t, a, s, n, r, o, u) {
368
- y3(n, r, o, u);
369
- const [i, c, l] = P.nepaliToEnglish(t, a, s);
370
- this.year = t, this.month = a, this.day = s, this._setDateObject(At(i, c, l, n, r, o, u), !1);
367
+ set(t, n, a, s, r, o, u) {
368
+ D3(s, r, o, u);
369
+ const [i, h, c] = J.nepaliToEnglish(t, n, a);
370
+ this.year = t, this.month = n, this.day = a, this._setDateObject(Ot(i, h, c, s, r, o, u), !1);
371
371
  }
372
372
  setDateObject(t) {
373
373
  this._setDateObject(t, !0);
374
374
  }
375
375
  format(t) {
376
- return Xe(this, t);
376
+ return qe(this, t);
377
377
  }
378
378
  formatNepali(t) {
379
- return Ze(this, t);
379
+ return Xe(this, t);
380
380
  }
381
381
  toString() {
382
- return qe(this);
382
+ return Ze(this);
383
383
  }
384
384
  formatEnglishDate(t) {
385
385
  return Qe(this, t);
@@ -387,35 +387,35 @@ class E {
387
387
  formatEnglishDateInNepali(t) {
388
388
  return t3(this, t);
389
389
  }
390
- static fromEnglishDate(t, a, s, n = 0, r = 0, o = 0, u = 0) {
391
- const i = At(t, a, s, n, r, o, u);
392
- return new E(i);
390
+ static fromEnglishDate(t, n, a, s = 0, r = 0, o = 0, u = 0) {
391
+ const i = Ot(t, n, a, s, r, o, u);
392
+ return new Y(i);
393
393
  }
394
- static parseNepaliFormat(t, a) {
395
- const [s, n, r, o, u, i, c] = l3(t, a);
396
- return new E(s, n, r, o, u, i, c);
394
+ static parseNepaliFormat(t, n) {
395
+ const [a, s, r, o, u, i, h] = h3(t, n);
396
+ return new Y(a, s, r, o, u, i, h);
397
397
  }
398
- static parseEnglishDate(t, a) {
399
- const [s, n, r, o, u, i, c] = u3(t, a);
400
- return E.fromEnglishDate(s, n, r, o, u, i, c);
398
+ static parseEnglishDate(t, n) {
399
+ const [a, s, r, o, u, i, h] = u3(t, n);
400
+ return Y.fromEnglishDate(a, s, r, o, u, i, h);
401
401
  }
402
- static getDaysOfMonth(t, a) {
403
- if (t < P.npMinYear() || t > P.npMaxYear()) throw new Error("Year out of range");
404
- if (a < 0 || a > 11) throw new Error("Month out of range");
405
- return j[t - P.npMinYear()][0][a];
402
+ static getDaysOfMonth(t, n) {
403
+ if (t < J.npMinYear() || t > J.npMaxYear()) throw new Error("Year out of range");
404
+ if (n < 0 || n > 11) throw new Error("Month out of range");
405
+ return W[t - J.npMinYear()][0][n];
406
406
  }
407
407
  static minSupportedDate() {
408
- return E.fromEnglishDate(P.enMinYear(), 0, 1).getDateObject();
408
+ return Y.fromEnglishDate(J.enMinYear(), 0, 1).getDateObject();
409
409
  }
410
410
  static maxSupportedDate() {
411
- return E.fromEnglishDate(P.enMaxYear(), 11, 31).getDateObject();
411
+ return Y.fromEnglishDate(J.enMaxYear(), 11, 31).getDateObject();
412
412
  }
413
413
  static minSupportedNepaliDate() {
414
- return new E(P.npMinYear(), 0, 1);
414
+ return new Y(J.npMinYear(), 0, 1);
415
415
  }
416
416
  static maxSupportedNepaliDate() {
417
- const t = P.npMaxYear();
418
- return new E(t, 11, this.getDaysOfMonth(t, 11));
417
+ const t = J.npMaxYear();
418
+ return new Y(t, 11, this.getDaysOfMonth(t, 11));
419
419
  }
420
420
  static minimum() {
421
421
  return console.warn("`NepaliDate.minimum()` is deprecated and will be removed in a future version. Please use `NepaliDate.minSupportedDate()` instead."), this.minSupportedDate();
@@ -424,7 +424,7 @@ class E {
424
424
  return console.warn("`NepaliDate.maximum()` is deprecated and will be removed in a future version. Please use `NepaliDate.maxSupportedDate()` instead."), this.maxSupportedDate();
425
425
  }
426
426
  }
427
- const f3 = [
427
+ const y3 = [
428
428
  "बैशाख",
429
429
  "जेठ",
430
430
  "आषाढ",
@@ -437,7 +437,7 @@ const f3 = [
437
437
  "माघ",
438
438
  "फाल्गुन",
439
439
  "चैत्र"
440
- ], ge = [
440
+ ], me = [
441
441
  "Baishakh",
442
442
  "Jestha",
443
443
  "Ashadh",
@@ -450,7 +450,7 @@ const f3 = [
450
450
  "Magh",
451
451
  "Falgun",
452
452
  "Chaitra"
453
- ], D3 = [
453
+ ], f3 = [
454
454
  "January",
455
455
  "February",
456
456
  "March",
@@ -463,7 +463,7 @@ const f3 = [
463
463
  "October",
464
464
  "November",
465
465
  "December"
466
- ], M3 = ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"], p3 = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], S3 = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], on = {
466
+ ], M3 = ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"], p3 = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], b3 = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], O3 = {
467
467
  light: {
468
468
  primary: "#3b82f6",
469
469
  background: "#ffffff",
@@ -484,46 +484,46 @@ const f3 = [
484
484
  today: "#1e40af",
485
485
  disabled: "#6b7280"
486
486
  }
487
- }, W = (e) => e.toString().split("").map((t) => S3[parseInt(t)]).join(""), me = (e, t, a) => {
487
+ }, V = (e) => e.toString().split("").map((t) => b3[parseInt(t)]).join(""), De = (e, t, n) => {
488
488
  if (e === "BS")
489
489
  try {
490
- const s = a === 11 ? new E(t + 1, 0, 1) : new E(t, a + 1, 1);
491
- return new E(s.getTime() - 1440 * 60 * 1e3).getDate();
490
+ const a = n === 11 ? new Y(t + 1, 0, 1) : new Y(t, n + 1, 1);
491
+ return new Y(a.getTime() - 1440 * 60 * 1e3).getDate();
492
492
  } catch {
493
493
  return 30;
494
494
  }
495
- return new Date(t, a + 1, 0).getDate();
496
- }, b3 = (e, t, a) => {
495
+ return new Date(t, n + 1, 0).getDate();
496
+ }, S3 = (e, t, n) => {
497
497
  if (e === "BS")
498
498
  try {
499
- return new E(t, a, 1).getDay() || 0;
499
+ return new Y(t, n, 1).getDay() || 0;
500
500
  } catch {
501
501
  return 0;
502
502
  }
503
- return new Date(t, a, 1).getDay();
504
- }, H = (e) => {
503
+ return new Date(t, n, 1).getDay();
504
+ }, N = (e) => {
505
505
  const t = /* @__PURE__ */ new Date();
506
506
  if (e === "BS")
507
507
  try {
508
- const a = E.fromEnglishDate(t.getFullYear(), t.getMonth(), t.getDate());
509
- return { year: a.getYear(), month: a.getMonth(), day: a.getDate() };
508
+ const n = Y.fromEnglishDate(t.getFullYear(), t.getMonth(), t.getDate());
509
+ return { year: n.getYear(), month: n.getMonth(), day: n.getDate() };
510
510
  } catch {
511
511
  return { year: 2081, month: 0, day: 1 };
512
512
  }
513
513
  return { year: t.getFullYear(), month: t.getMonth(), day: t.getDate() };
514
- }, E3 = (e, t, a, s, n) => {
514
+ }, wt = (e, t, n, a, s) => {
515
515
  if (e === "BS")
516
516
  try {
517
- const r = new E(t, a, s), u = new Date(
517
+ const r = new Y(t, n, a), u = new Date(
518
518
  r.getEnglishYear(),
519
519
  r.getEnglishMonth(),
520
520
  r.getEnglishDate()
521
521
  ).toISOString().split("T")[0];
522
522
  return {
523
- bs: `${t}-${String(a + 1).padStart(2, "0")}-${String(s).padStart(2, "0")}`,
523
+ bs: `${t}-${String(n + 1).padStart(2, "0")}-${String(a).padStart(2, "0")}`,
524
524
  ad: u,
525
525
  formatted: {
526
- bs: `${n[a]} ${s}, ${t}`,
526
+ bs: `${s[n]} ${a}, ${t}`,
527
527
  ad: new Date(
528
528
  r.getEnglishYear(),
529
529
  r.getEnglishMonth(),
@@ -532,20 +532,20 @@ const f3 = [
532
532
  }
533
533
  };
534
534
  } catch {
535
- const r = `${t}-${String(a + 1).padStart(2, "0")}-${String(s).padStart(2, "0")}`;
535
+ const r = `${t}-${String(n + 1).padStart(2, "0")}-${String(a).padStart(2, "0")}`;
536
536
  return {
537
537
  bs: r,
538
538
  ad: r,
539
539
  formatted: {
540
- bs: `${n[a]} ${s}, ${t}`,
541
- ad: `${n[a]} ${s}, ${t}`
540
+ bs: `${s[n]} ${a}, ${t}`,
541
+ ad: `${s[n]} ${a}, ${t}`
542
542
  }
543
543
  };
544
544
  }
545
545
  else {
546
- const r = new Date(t, a, s), o = r.toISOString().split("T")[0];
546
+ const r = new Date(t, n, a), o = r.toISOString().split("T")[0];
547
547
  try {
548
- const u = E.fromEnglishDate(t, a, s), i = `${u.getYear()}-${String(u.getMonth() + 1).padStart(2, "0")}-${String(u.getDate()).padStart(2, "0")}`;
548
+ const u = Y.fromEnglishDate(t, n, a), i = `${u.getYear()}-${String(u.getMonth() + 1).padStart(2, "0")}-${String(u.getDate()).padStart(2, "0")}`;
549
549
  return {
550
550
  ad: o,
551
551
  bs: i,
@@ -555,7 +555,7 @@ const f3 = [
555
555
  month: "long",
556
556
  day: "numeric"
557
557
  }),
558
- bs: `${ge[u.getMonth()]} ${u.getDate()}, ${u.getYear()}`
558
+ bs: `${me[u.getMonth()]} ${u.getDate()}, ${u.getYear()}`
559
559
  }
560
560
  };
561
561
  } catch {
@@ -573,131 +573,131 @@ const f3 = [
573
573
  };
574
574
  }
575
575
  }
576
- }, un = (e, t, a) => {
577
- const s = new Date(e.year, e.month, e.day).getTime(), n = new Date(t.year, t.month, t.day).getTime(), r = new Date(a.year, a.month, a.day).getTime();
578
- return s >= n && s <= r;
579
- }, Ot = (e) => {
576
+ }, N3 = (e, t, n) => {
577
+ const a = new Date(e.year, e.month, e.day).getTime(), s = new Date(t.year, t.month, t.day).getTime(), r = new Date(n.year, n.month, n.day).getTime();
578
+ return a >= s && a <= r;
579
+ }, It = (e) => {
580
580
  try {
581
- const [t, a, s] = e.split("-").map(Number);
582
- return !t || !a || !s ? null : { year: t, month: a - 1, day: s };
581
+ const [t, n, a] = e.split("-").map(Number);
582
+ return !t || !n || !a ? null : { year: t, month: n - 1, day: a };
583
583
  } catch {
584
584
  return null;
585
585
  }
586
- }, tt = (e, t, a) => {
587
- if (!t && !a) return !1;
588
- const s = new Date(e.year, e.month, e.day).getTime();
586
+ }, et = (e, t, n) => {
587
+ if (!t && !n) return !1;
588
+ const a = new Date(e.year, e.month, e.day).getTime();
589
589
  if (t) {
590
- const n = Ot(t);
591
- if (n) {
592
- const r = new Date(n.year, n.month, n.day).getTime();
593
- if (s < r) return !0;
590
+ const s = It(t);
591
+ if (s) {
592
+ const r = new Date(s.year, s.month, s.day).getTime();
593
+ if (a < r) return !0;
594
594
  }
595
595
  }
596
- if (a) {
597
- const n = Ot(a);
598
- if (n) {
599
- const r = new Date(n.year, n.month, n.day).getTime();
600
- if (s > r) return !0;
596
+ if (n) {
597
+ const s = It(n);
598
+ if (s) {
599
+ const r = new Date(s.year, s.month, s.day).getTime();
600
+ if (a > r) return !0;
601
601
  }
602
602
  }
603
603
  return !1;
604
- }, k3 = (e = "AD") => {
605
- const t = Ct(() => H(e), [e]), [a, s] = I(t.year), [n, r] = I(t.month), [o, u] = I(null), [i, c] = I(null), [l, m] = I(null);
606
- Tt(() => {
607
- s(t.year), r(t.month);
604
+ }, E3 = (e = "AD") => {
605
+ const t = $t(() => N(e), [e]), [n, a] = B(t.year), [s, r] = B(t.month), [o, u] = B(null), [i, h] = B(null), [c, D] = B(null);
606
+ Yt(() => {
607
+ a(t.year), r(t.month);
608
608
  }, [t.year, t.month]);
609
- const d = Ct(() => {
610
- const w = me(e, a, n), T = b3(e, a, n), p = [];
611
- for (let _ = 0; _ < T; _++)
609
+ const d = $t(() => {
610
+ const E = De(e, n, s), v = S3(e, n, s), p = [];
611
+ for (let C = 0; C < v; C++)
612
612
  p.push(null);
613
- for (let _ = 1; _ <= w; _++)
614
- p.push(_);
613
+ for (let C = 1; C <= E; C++)
614
+ p.push(C);
615
615
  return p;
616
- }, [a, n, e]);
616
+ }, [n, s, e]);
617
617
  return {
618
618
  // State
619
- currentYear: a,
620
- currentMonth: n,
619
+ currentYear: n,
620
+ currentMonth: s,
621
621
  selectedDate: o,
622
622
  rangeStart: i,
623
- rangeEnd: l,
623
+ rangeEnd: c,
624
624
  today: t,
625
625
  calendarDays: d,
626
626
  // Actions
627
- setCurrentYear: s,
627
+ setCurrentYear: a,
628
628
  setCurrentMonth: r,
629
629
  setSelectedDate: u,
630
- setRangeStart: c,
631
- setRangeEnd: m,
632
- navigateMonth: (w) => {
633
- let p = n + w, _ = a;
630
+ setRangeStart: h,
631
+ setRangeEnd: D,
632
+ navigateMonth: (E) => {
633
+ let p = s + E, C = n;
634
634
  for (; p > 11; )
635
- p -= 12, _ += 1;
635
+ p -= 12, C += 1;
636
636
  for (; p < 0; )
637
- p += 12, _ -= 1;
638
- r(p), s(_);
637
+ p += 12, C -= 1;
638
+ r(p), a(C);
639
639
  },
640
640
  // Helpers
641
- isToday: (w) => a === t.year && n === t.month && w === t.day,
642
- isSelected: (w, T = "single") => T === "range" ? !!(i && i.year === a && i.month === n && i.day === w) || !!(l && l.year === a && l.month === n && l.day === w) : !!(o && o.year === a && o.month === n && o.day === w),
643
- isInRange: (w) => {
644
- if (!i || !l) return !1;
645
- const T = new Date(a, n, w).getTime(), p = new Date(i.year, i.month, i.day).getTime(), _ = new Date(l.year, l.month, l.day).getTime();
646
- return T >= p && T <= _;
641
+ isToday: (E) => n === t.year && s === t.month && E === t.day,
642
+ isSelected: (E, v = "single") => v === "range" ? !!(i && i.year === n && i.month === s && i.day === E) || !!(c && c.year === n && c.month === s && c.day === E) : !!(o && o.year === n && o.month === s && o.day === E),
643
+ isInRange: (E) => {
644
+ if (!i || !c) return !1;
645
+ const v = new Date(n, s, E).getTime(), p = new Date(i.year, i.month, i.day).getTime(), C = new Date(c.year, c.month, c.day).getTime();
646
+ return v >= p && v <= C;
647
647
  }
648
648
  };
649
- }, G = (e, t, a) => {
650
- if (a === "BS")
649
+ }, Z = (e, t, n) => {
650
+ if (n === "BS")
651
651
  try {
652
- const s = new E(e.year, e.month, e.day), n = new Date(
653
- s.getEnglishYear(),
654
- s.getEnglishMonth(),
655
- s.getEnglishDate()
652
+ const a = new Y(e.year, e.month, e.day), s = new Date(
653
+ a.getEnglishYear(),
654
+ a.getEnglishMonth(),
655
+ a.getEnglishDate()
656
656
  );
657
- n.setDate(n.getDate() + t);
658
- const r = E.fromEnglishDate(
659
- n.getFullYear(),
660
- n.getMonth(),
661
- n.getDate()
657
+ s.setDate(s.getDate() + t);
658
+ const r = Y.fromEnglishDate(
659
+ s.getFullYear(),
660
+ s.getMonth(),
661
+ s.getDate()
662
662
  );
663
663
  return { year: r.getYear(), month: r.getMonth(), day: r.getDate() };
664
664
  } catch {
665
665
  return e;
666
666
  }
667
667
  else {
668
- const s = new Date(e.year, e.month, e.day);
669
- return s.setDate(s.getDate() + t), { year: s.getFullYear(), month: s.getMonth(), day: s.getDate() };
668
+ const a = new Date(e.year, e.month, e.day);
669
+ return a.setDate(a.getDate() + t), { year: a.getFullYear(), month: a.getMonth(), day: a.getDate() };
670
670
  }
671
- }, dt = (e, t, a) => {
672
- if (a === "BS")
671
+ }, dt = (e, t, n) => {
672
+ if (n === "BS")
673
673
  try {
674
- let s = e.year, n = e.month + t;
675
- for (; n < 0; )
676
- s -= 1, n += 12;
677
- for (; n >= 12; )
678
- s += 1, n -= 12;
679
- const r = me("BS", s, n), o = Math.min(e.day, r);
680
- return { year: s, month: n, day: o };
674
+ let a = e.year, s = e.month + t;
675
+ for (; s < 0; )
676
+ a -= 1, s += 12;
677
+ for (; s >= 12; )
678
+ a += 1, s -= 12;
679
+ const r = De("BS", a, s), o = Math.min(e.day, r);
680
+ return { year: a, month: s, day: o };
681
681
  } catch {
682
682
  return e;
683
683
  }
684
684
  else {
685
- const s = new Date(e.year, e.month, e.day);
686
- return s.setMonth(s.getMonth() + t), { year: s.getFullYear(), month: s.getMonth(), day: s.getDate() };
685
+ const a = new Date(e.year, e.month, e.day);
686
+ return a.setMonth(a.getMonth() + t), { year: a.getFullYear(), month: a.getMonth(), day: a.getDate() };
687
687
  }
688
- }, V = (e) => ({ year: e.year, month: e.month, day: 1 }), Y3 = (e, t) => {
688
+ }, z = (e) => ({ year: e.year, month: e.month, day: 1 }), w3 = (e, t) => {
689
689
  if (t === "BS")
690
690
  try {
691
- const s = new E(e.year, e.month, e.day).getDay();
692
- return G(e, -s, "BS");
691
+ const a = new Y(e.year, e.month, e.day).getDay();
692
+ return Z(e, -a, "BS");
693
693
  } catch {
694
694
  return e;
695
695
  }
696
696
  else {
697
- const a = new Date(e.year, e.month, e.day), s = a.getDay();
698
- return a.setDate(a.getDate() - s), { year: a.getFullYear(), month: a.getMonth(), day: a.getDate() };
697
+ const n = new Date(e.year, e.month, e.day), a = n.getDay();
698
+ return n.setDate(n.getDate() - a), { year: n.getFullYear(), month: n.getMonth(), day: n.getDate() };
699
699
  }
700
- }, cn = {
700
+ }, T3 = {
701
701
  TODAY: "today",
702
702
  YESTERDAY: "yesterday",
703
703
  THIS_WEEK: "thisWeek",
@@ -710,201 +710,162 @@ const f3 = [
710
710
  LAST_180_DAYS: "last180days",
711
711
  LAST_9_MONTHS: "last9months",
712
712
  LAST_YEAR: "lastYear"
713
- }, w3 = (e, t) => {
714
- const a = [
713
+ }, Y3 = (e, t) => {
714
+ const n = [
715
715
  {
716
716
  key: "today",
717
717
  label: "Today",
718
- getValue: (n) => {
719
- const r = H(n);
718
+ getValue: (s) => {
719
+ const r = N(s);
720
720
  return { start: r, end: r };
721
721
  }
722
722
  },
723
723
  {
724
724
  key: "yesterday",
725
725
  label: "Yesterday",
726
- getValue: (n) => {
727
- const r = H(n), o = G(r, -1, n);
726
+ getValue: (s) => {
727
+ const r = N(s), o = Z(r, -1, s);
728
728
  return { start: o, end: o };
729
729
  }
730
730
  },
731
731
  {
732
732
  key: "thisWeek",
733
733
  label: "This Week",
734
- getValue: (n) => {
735
- const r = H(n);
736
- return { start: Y3(r, n), end: r };
734
+ getValue: (s) => {
735
+ const r = N(s);
736
+ return { start: w3(r, s), end: r };
737
737
  }
738
738
  },
739
739
  {
740
740
  key: "last7days",
741
741
  label: "Last 7 Days",
742
- getValue: (n) => {
743
- const r = H(n);
744
- return { start: G(r, -6, n), end: r };
742
+ getValue: (s) => {
743
+ const r = N(s);
744
+ return { start: Z(r, -6, s), end: r };
745
745
  }
746
746
  },
747
747
  {
748
748
  key: "last30days",
749
749
  label: "Last 30 Days",
750
- getValue: (n) => {
751
- const r = H(n);
752
- return { start: G(r, -29, n), end: r };
750
+ getValue: (s) => {
751
+ const r = N(s);
752
+ return { start: Z(r, -29, s), end: r };
753
753
  }
754
754
  },
755
755
  {
756
756
  key: "thisMonth",
757
757
  label: "This Month",
758
- getValue: (n) => {
759
- const r = H(n);
760
- return { start: V(r), end: r };
758
+ getValue: (s) => {
759
+ const r = N(s);
760
+ return { start: z(r), end: r };
761
761
  }
762
762
  },
763
763
  {
764
764
  key: "lastMonth",
765
765
  label: "Last Month",
766
- getValue: (n) => {
767
- const r = H(n), o = G(V(r), -1, n);
768
- return { start: V(o), end: o };
766
+ getValue: (s) => {
767
+ const r = N(s), o = Z(z(r), -1, s);
768
+ return { start: z(o), end: o };
769
769
  }
770
770
  },
771
771
  {
772
772
  key: "last3months",
773
773
  label: "Last 3 Months",
774
- getValue: (n) => {
775
- const r = H(n), o = dt(r, -2, n);
776
- return { start: V(o), end: r };
774
+ getValue: (s) => {
775
+ const r = N(s), o = dt(r, -2, s);
776
+ return { start: z(o), end: r };
777
777
  }
778
778
  },
779
779
  {
780
780
  key: "last6months",
781
781
  label: "Last 6 Months",
782
- getValue: (n) => {
783
- const r = H(n), o = dt(r, -5, n);
784
- return { start: V(o), end: r };
782
+ getValue: (s) => {
783
+ const r = N(s), o = dt(r, -5, s);
784
+ return { start: z(o), end: r };
785
785
  }
786
786
  },
787
787
  {
788
788
  key: "last180days",
789
789
  label: "Last 180 Days",
790
- getValue: (n) => {
791
- const r = H(n);
792
- return { start: G(r, -179, n), end: r };
790
+ getValue: (s) => {
791
+ const r = N(s);
792
+ return { start: Z(r, -179, s), end: r };
793
793
  }
794
794
  },
795
795
  {
796
796
  key: "last9months",
797
797
  label: "Last 9 Months",
798
- getValue: (n) => {
799
- const r = H(n), o = dt(r, -8, n);
800
- return { start: V(o), end: r };
798
+ getValue: (s) => {
799
+ const r = N(s), o = dt(r, -8, s);
800
+ return { start: z(o), end: r };
801
801
  }
802
802
  },
803
803
  {
804
804
  key: "lastYear",
805
805
  label: "Last Year",
806
- getValue: (n) => {
807
- const r = H(n), o = dt(r, -11, n);
808
- return { start: V(o), end: r };
806
+ getValue: (s) => {
807
+ const r = N(s), o = dt(r, -11, s);
808
+ return { start: z(o), end: r };
809
809
  }
810
810
  }
811
- ], s = e ? a.filter((n) => e.includes(n.key)) : a;
812
- return t ? s.map((n) => ({ ...n, label: t[n.key] || n.label })) : s;
813
- }, _3 = "_calendar_lve6c_1", v3 = "_grid_lve6c_14", C3 = "_header_lve6c_25", x3 = "_navButton_lve6c_32", A3 = "_monthYear_lve6c_58", $3 = "_pickerOverlay_lve6c_78", F3 = "_pickerContent_lve6c_88", B3 = "_pickerHeader_lve6c_98", H3 = "_closeButton_lve6c_112", O3 = "_pickerBody_lve6c_131", T3 = "_pickerSection_lve6c_135", N3 = "_pickerSectionHeader_lve6c_151", I3 = "_yearNav_lve6c_162", L3 = "_yearGrid_lve6c_194", R3 = "_selected_lve6c_214", j3 = "_monthGrid_lve6c_220", P3 = "_dayHeader_lve6c_252", W3 = "_day_lve6c_252", V3 = "_dayDisabled_lve6c_273", U3 = "_dayOtherMonth_lve6c_273", J3 = "_daySelected_lve6c_277", G3 = "_dayToday_lve6c_282", K3 = "_dayInRange_lve6c_288", f = {
814
- calendar: _3,
815
- grid: v3,
816
- header: C3,
817
- navButton: x3,
818
- monthYear: A3,
819
- pickerOverlay: $3,
820
- pickerContent: F3,
821
- pickerHeader: B3,
822
- closeButton: H3,
823
- pickerBody: O3,
824
- pickerSection: T3,
825
- pickerSectionHeader: N3,
826
- yearNav: I3,
827
- yearGrid: L3,
828
- selected: R3,
829
- monthGrid: j3,
830
- dayHeader: P3,
831
- day: W3,
832
- dayDisabled: V3,
833
- dayOtherMonth: U3,
834
- daySelected: J3,
835
- dayToday: G3,
836
- dayInRange: K3
837
- }, z3 = ({
811
+ ], a = e ? n.filter((s) => e.includes(s.key)) : n;
812
+ return t ? a.map((s) => ({ ...s, label: t[s.key] || s.label })) : a;
813
+ }, k3 = ({
838
814
  currentYear: e,
839
815
  currentMonth: t,
840
- months: a,
841
- onYearChange: s,
842
- onMonthChange: n,
816
+ months: n,
817
+ onYearChange: a,
818
+ onMonthChange: s,
843
819
  onClose: r,
844
820
  showNepaliNumbers: o = !1,
845
- convertToNepaliNumber: u = (c) => c.toString(),
821
+ convertToNepaliNumber: u = (h) => h.toString(),
846
822
  calendarType: i
847
823
  }) => {
848
- const [c, l] = I(Math.floor(e / 12) * 12), m = i === "BS" ? 2e3 : 1944, d = i === "BS" ? 2100 : 2043;
849
- return /* @__PURE__ */ h("div", { className: f.pickerOverlay, onClick: r, children: /* @__PURE__ */ b("div", { className: f.pickerContent, onClick: (k) => k.stopPropagation(), children: [
850
- /* @__PURE__ */ b("div", { className: f.pickerHeader, children: [
851
- /* @__PURE__ */ h("h3", { children: "Select Month & Year" }),
852
- /* @__PURE__ */ h("button", { onClick: r, className: f.closeButton, children: "×" })
824
+ const [h, c] = B(Math.floor(e / 12) * 12), D = i === "BS" ? 2e3 : 1944, d = i === "BS" ? 2100 : 2043;
825
+ return /* @__PURE__ */ g("div", { className: "bsac-picker-overlay", onClick: r, children: /* @__PURE__ */ S("div", { className: "bsac-picker-content", onClick: (k) => k.stopPropagation(), children: [
826
+ /* @__PURE__ */ S("div", { className: "bsac-picker-header", children: [
827
+ /* @__PURE__ */ g("h3", { children: "Select Month & Year" }),
828
+ /* @__PURE__ */ g("button", { className: "bsac-close-btn", onClick: r, children: "×" })
853
829
  ] }),
854
- /* @__PURE__ */ b("div", { className: f.pickerBody, children: [
855
- /* @__PURE__ */ b("div", { className: f.pickerSection, children: [
856
- /* @__PURE__ */ b("div", { className: f.pickerSectionHeader, children: [
857
- /* @__PURE__ */ h("label", { children: "Year" }),
858
- /* @__PURE__ */ b("div", { className: f.yearNav, children: [
859
- /* @__PURE__ */ h(
860
- "button",
861
- {
862
- onClick: () => l(Math.max(m, c - 12)),
863
- disabled: c <= m,
864
- children: "«"
865
- }
866
- ),
867
- /* @__PURE__ */ b("span", { children: [
868
- o ? u(c) : c,
869
- " -",
870
- " ",
871
- o ? u(c + 11) : c + 11
830
+ /* @__PURE__ */ S("div", { className: "bsac-picker-body", children: [
831
+ /* @__PURE__ */ S("div", { className: "bsac-picker-section", children: [
832
+ /* @__PURE__ */ S("div", { className: "bsac-picker-section-header", children: [
833
+ /* @__PURE__ */ g("label", { children: "Year" }),
834
+ /* @__PURE__ */ S("div", { className: "bsac-year-nav", children: [
835
+ /* @__PURE__ */ g("button", { onClick: () => c(Math.max(D, h - 12)), disabled: h <= D, children: "«" }),
836
+ /* @__PURE__ */ S("span", { children: [
837
+ o ? u(h) : h,
838
+ " ",
839
+ o ? u(h + 11) : h + 11
872
840
  ] }),
873
- /* @__PURE__ */ h(
874
- "button",
875
- {
876
- onClick: () => l(Math.min(d - 11, c + 12)),
877
- disabled: c + 11 >= d,
878
- children: "»"
879
- }
880
- )
841
+ /* @__PURE__ */ g("button", { onClick: () => c(Math.min(d - 11, h + 12)), disabled: h + 11 >= d, children: "»" })
881
842
  ] })
882
843
  ] }),
883
- /* @__PURE__ */ h("div", { className: f.yearGrid, children: Array.from({ length: 12 }, (k, y) => {
884
- const $ = c + y;
885
- return $ > d ? null : /* @__PURE__ */ h(
844
+ /* @__PURE__ */ g("div", { className: "bsac-year-grid", children: Array.from({ length: 12 }, (k, m) => {
845
+ const A = h + m;
846
+ return A > d ? null : /* @__PURE__ */ g(
886
847
  "button",
887
848
  {
888
- onClick: () => s($),
889
- className: $ === e ? f.selected : "",
890
- children: o ? u($) : $
849
+ onClick: () => a(A),
850
+ className: A === e ? "bsac-selected" : "",
851
+ children: o ? u(A) : A
891
852
  },
892
- $
853
+ A
893
854
  );
894
855
  }) })
895
856
  ] }),
896
- /* @__PURE__ */ b("div", { className: f.pickerSection, children: [
897
- /* @__PURE__ */ h("label", { children: "Month" }),
898
- /* @__PURE__ */ h("div", { className: f.monthGrid, children: a.map((k, y) => /* @__PURE__ */ h(
857
+ /* @__PURE__ */ S("div", { className: "bsac-picker-section", children: [
858
+ /* @__PURE__ */ g("label", { children: "Month" }),
859
+ /* @__PURE__ */ g("div", { className: "bsac-month-grid", children: n.map((k, m) => /* @__PURE__ */ g(
899
860
  "button",
900
861
  {
901
862
  onClick: () => {
902
- n(y), r();
863
+ s(m), r();
903
864
  },
904
- className: y === t ? f.selected : "",
865
+ className: m === t ? "bsac-selected" : "",
905
866
  children: k
906
867
  },
907
- y
868
+ m
908
869
  )) })
909
870
  ] })
910
871
  ] })
@@ -912,442 +873,381 @@ const f3 = [
912
873
  }, gt = ({
913
874
  currentMonth: e,
914
875
  currentYear: t,
915
- months: a,
916
- onNavigateMonth: s,
917
- onYearChange: n,
876
+ months: n,
877
+ onNavigateMonth: a,
878
+ onYearChange: s,
918
879
  onMonthChange: r,
919
880
  disabled: o = !1,
920
881
  showNepaliNumbers: u = !1,
921
882
  convertToNepaliNumber: i,
922
- calendarType: c
883
+ calendarType: h
923
884
  }) => {
924
- const [l, m] = I(!1);
925
- return /* @__PURE__ */ b("div", { className: f.header, children: [
926
- /* @__PURE__ */ h(
927
- "button",
928
- {
929
- className: f.navButton,
930
- onClick: () => s(-12),
931
- disabled: o,
932
- "aria-label": "Previous year",
933
- title: "Previous year",
934
- children: "«"
935
- }
936
- ),
937
- /* @__PURE__ */ h(
938
- "button",
939
- {
940
- className: f.navButton,
941
- onClick: () => s(-1),
942
- disabled: o,
943
- "aria-label": "Previous month",
944
- children: "‹"
945
- }
946
- ),
947
- /* @__PURE__ */ b("button", { className: f.monthYear, onClick: () => m(!0), disabled: o, children: [
948
- a[e],
885
+ const [c, D] = B(!1);
886
+ return /* @__PURE__ */ S("div", { className: "bsac-header", children: [
887
+ /* @__PURE__ */ g("button", { className: "bsac-nav-btn", onClick: () => a(-12), disabled: o, "aria-label": "Previous year", children: "«" }),
888
+ /* @__PURE__ */ g("button", { className: "bsac-nav-btn", onClick: () => a(-1), disabled: o, "aria-label": "Previous month", children: "‹" }),
889
+ /* @__PURE__ */ S("button", { className: "bsac-month-year-btn", onClick: () => D(!0), disabled: o, children: [
890
+ n[e],
949
891
  " ",
950
892
  u ? i(t) : t
951
893
  ] }),
952
- /* @__PURE__ */ h(
953
- "button",
954
- {
955
- className: f.navButton,
956
- onClick: () => s(1),
957
- disabled: o,
958
- "aria-label": "Next month",
959
- children: "›"
960
- }
961
- ),
962
- /* @__PURE__ */ h(
963
- "button",
964
- {
965
- className: f.navButton,
966
- onClick: () => s(12),
967
- disabled: o,
968
- "aria-label": "Next year",
969
- title: "Next year",
970
- children: "»"
971
- }
972
- ),
973
- l && /* @__PURE__ */ h(
974
- z3,
894
+ /* @__PURE__ */ g("button", { className: "bsac-nav-btn", onClick: () => a(1), disabled: o, "aria-label": "Next month", children: "›" }),
895
+ /* @__PURE__ */ g("button", { className: "bsac-nav-btn", onClick: () => a(12), disabled: o, "aria-label": "Next year", children: "»" }),
896
+ c && /* @__PURE__ */ g(
897
+ k3,
975
898
  {
976
899
  currentYear: t,
977
900
  currentMonth: e,
978
- months: a,
979
- onYearChange: n,
901
+ months: n,
902
+ onYearChange: s,
980
903
  onMonthChange: r,
981
- onClose: () => m(!1),
904
+ onClose: () => D(!1),
982
905
  showNepaliNumbers: u,
983
906
  convertToNepaliNumber: i,
984
- calendarType: c
907
+ calendarType: h
985
908
  }
986
909
  )
987
910
  ] });
988
911
  }, mt = ({
989
912
  calendarDays: e,
990
913
  days: t,
991
- onDateSelect: a,
992
- isSelected: s,
993
- isInRange: n,
914
+ onDateSelect: n,
915
+ isSelected: a,
916
+ isInRange: s,
994
917
  isToday: r,
995
918
  isDisabled: o,
996
919
  disabled: u = !1,
997
920
  showNepaliNumbers: i = !1,
998
- convertToNepaliNumber: c
999
- }) => /* @__PURE__ */ b("div", { className: f.grid, children: [
1000
- t.map((l) => /* @__PURE__ */ h("div", { className: f.dayHeader, children: l }, l)),
1001
- e.map((l, m) => {
1002
- const d = l ? o?.(l) || u : !1;
1003
- return /* @__PURE__ */ h(
921
+ convertToNepaliNumber: h
922
+ }) => /* @__PURE__ */ S("div", { className: "bsac-grid", children: [
923
+ t.map((c) => /* @__PURE__ */ g("div", { className: "bsac-day-header", children: c }, c)),
924
+ e.map((c, D) => {
925
+ const d = c ? o?.(c) || u : !1, k = c ? a(c) : !1, m = c ? s(c) : !1, A = c ? r(c) : !1, T = [
926
+ "bsac-day",
927
+ c ? d ? "bsac-day-disabled" : k ? "bsac-day-selected" : m ? "bsac-day-in-range" : A ? "bsac-day-today" : "" : "bsac-day-empty"
928
+ ].filter(Boolean).join(" ");
929
+ return /* @__PURE__ */ g(
1004
930
  "div",
1005
931
  {
1006
- className: `${f.day} ${l === null ? f.dayOtherMonth : d ? f.dayDisabled : s(l) ? f.daySelected : n(l) ? f.dayInRange : r(l) ? f.dayToday : ""}`,
1007
- onClick: () => l && !d && a(l),
1008
- children: l ? i ? c(l) : l : ""
932
+ className: T,
933
+ onClick: () => c && !d && n(c),
934
+ children: c ? i ? h(c) : c : ""
1009
935
  },
1010
- m
936
+ D
1011
937
  );
1012
938
  })
1013
- ] }), yt = ({
939
+ ] }), Dt = ({
1014
940
  presets: e,
1015
941
  calendarType: t,
1016
- onPresetSelect: a,
1017
- activePreset: s,
1018
- position: n = "top"
942
+ onPresetSelect: n,
943
+ activePreset: a,
944
+ position: s = "top"
1019
945
  }) => {
1020
946
  const r = (o) => {
1021
947
  const u = o.getValue(t);
1022
- a(o, u);
948
+ n(o, u);
1023
949
  };
1024
- return /* @__PURE__ */ h(
1025
- "div",
950
+ return /* @__PURE__ */ g("div", { className: `bsac-presets bsac-presets--${s}`, children: e.map((o) => /* @__PURE__ */ g(
951
+ "button",
1026
952
  {
1027
- style: {
1028
- display: "flex",
1029
- flexDirection: n === "left" || n === "right" ? "column" : "row",
1030
- flexWrap: n === "top" || n === "bottom" ? "wrap" : "nowrap",
1031
- gap: "8px",
1032
- marginBottom: n === "top" ? "16px" : 0,
1033
- marginTop: n === "bottom" ? "16px" : 0,
1034
- padding: "12px",
1035
- backgroundColor: "#f8f9fa",
1036
- borderRadius: "6px",
1037
- border: "1px solid #e9ecef",
1038
- minWidth: n === "left" || n === "right" ? "150px" : "auto",
1039
- maxWidth: n === "left" || n === "right" ? "180px" : "none",
1040
- flexShrink: 0
1041
- },
1042
- children: e.map((o) => /* @__PURE__ */ h(
1043
- "button",
1044
- {
1045
- onClick: () => r(o),
1046
- style: {
1047
- padding: "6px 12px",
1048
- fontSize: "12px",
1049
- border: "1px solid #dee2e6",
1050
- borderRadius: "4px",
1051
- backgroundColor: s === o.key ? "#007bff" : "#ffffff",
1052
- color: s === o.key ? "#ffffff" : "#495057",
1053
- cursor: "pointer",
1054
- transition: "all 0.2s"
1055
- },
1056
- children: o.label
1057
- },
1058
- o.key
1059
- ))
1060
- }
1061
- );
1062
- }, X3 = ({
953
+ onClick: () => r(o),
954
+ className: `bsac-preset-btn${a === o.key ? " bsac-preset-btn--active" : ""}`,
955
+ children: o.label
956
+ },
957
+ o.key
958
+ )) });
959
+ }, C3 = ({
1063
960
  calendarType: e = "AD",
1064
961
  value: t,
1065
- onChange: a,
1066
- className: s = "",
1067
- showToday: n = !0,
962
+ onChange: n,
963
+ className: a = "",
964
+ showToday: s = !0,
1068
965
  disabled: r = !1,
1069
966
  outputFormat: o = "both",
1070
967
  onDateSelect: u,
1071
968
  mode: i = "single",
1072
- onRangeSelect: c,
1073
- showRangePresets: l = !1,
1074
- rangePresetsPosition: m = "top",
969
+ onRangeSelect: h,
970
+ showRangePresets: c = !1,
971
+ rangePresetsPosition: D = "top",
1075
972
  predefinedRanges: d,
1076
973
  presetKeys: k,
1077
- presetLabels: y,
1078
- onPresetSelect: $,
1079
- renderPresets: F,
1080
- showNepaliMonths: w = !1,
1081
- showNepaliDays: T = !1,
974
+ presetLabels: m,
975
+ onPresetSelect: A,
976
+ renderPresets: T,
977
+ showNepaliMonths: E = !1,
978
+ showNepaliDays: v = !1,
1082
979
  showNepaliNumbers: p = !1,
1083
- theme: _ = "light",
1084
- colors: et,
1085
- minDate: D,
1086
- maxDate: Y
980
+ theme: C = "light",
981
+ colors: nt,
982
+ minDate: I,
983
+ maxDate: K
1087
984
  }) => {
1088
985
  const {
1089
- currentYear: x,
1090
- currentMonth: C,
1091
- rangeStart: B,
1092
- rangeEnd: v,
1093
- calendarDays: N,
1094
- setSelectedDate: nt,
1095
- setRangeStart: at,
1096
- setRangeEnd: X,
1097
- setCurrentYear: Z,
1098
- setCurrentMonth: q,
1099
- navigateMonth: O,
986
+ currentYear: H,
987
+ currentMonth: O,
988
+ rangeStart: U,
989
+ rangeEnd: y,
990
+ calendarDays: w,
991
+ setSelectedDate: R,
992
+ setRangeStart: M,
993
+ setRangeEnd: $,
994
+ setCurrentYear: _,
995
+ setCurrentMonth: j,
996
+ navigateMonth: x,
1100
997
  isToday: st,
1101
- isSelected: rt,
1102
- isInRange: ot
1103
- } = k3(e), [it, kt] = I(), ut = d || w3(k, y), Q = e === "BS" && w ? f3 : e === "BS" ? ge : D3, ct = e === "BS" && T ? M3 : p3, lt = (g, M) => {
1104
- M.start && M.end && (at(M.start), X(M.end), Z(M.start.year), q(M.start.month), kt(g.key), $?.(g, M), c?.({ start: M.start, end: M.end }));
1105
- }, ye = (g, M) => {
1106
- at(g), X(M), kt(void 0), c?.({ start: g, end: M });
1107
- }, ht = (g) => {
998
+ isSelected: at,
999
+ isInRange: rt
1000
+ } = E3(e), [ot, Et] = B(), it = d || Y3(k, m), ut = (l, f) => ({
1001
+ start: wt(e, l.year, l.month, l.day, G),
1002
+ end: wt(e, f.year, f.month, f.day, G)
1003
+ }), G = e === "BS" && E ? y3 : e === "BS" ? me : f3, ct = e === "BS" && v ? M3 : p3, ht = (l, f) => {
1004
+ f.start && f.end && (M(f.start), $(f.end), _(f.start.year), j(f.start.month), Et(l.key), A?.(l, f), h?.(ut(f.start, f.end)));
1005
+ }, ye = (l, f) => {
1006
+ M(l), $(f), Et(void 0), h?.(ut(l, f));
1007
+ }, lt = (l) => {
1108
1008
  if (r) return;
1109
- const M = { year: x, month: C, day: g };
1110
- if (tt(M, D, Y)) return;
1009
+ const f = { year: H, month: O, day: l };
1010
+ if (et(f, I, K)) return;
1111
1011
  if (i === "range") {
1112
- if (kt(void 0), !B || B && v)
1113
- at(M), X(null);
1012
+ if (Et(void 0), !U || U && y)
1013
+ M(f), $(null);
1114
1014
  else {
1115
- const J = new Date(B.year, B.month, B.day).getTime();
1116
- new Date(M.year, M.month, M.day).getTime() < J ? (at(M), X(B), c?.({ start: M, end: B })) : (X(M), c?.({ start: B, end: M }));
1015
+ const X = new Date(U.year, U.month, U.day).getTime();
1016
+ new Date(f.year, f.month, f.day).getTime() < X ? (M(f), $(U), h?.(ut(f, U))) : ($(f), h?.(ut(U, f)));
1117
1017
  }
1118
1018
  return;
1119
1019
  }
1120
- nt(M);
1121
- const U = E3(e, x, C, g, Q);
1122
- if (u?.(U), a) {
1123
- let J;
1020
+ R(f);
1021
+ const q = wt(e, H, O, l, G);
1022
+ if (u?.(q), n) {
1023
+ let X;
1124
1024
  switch (o) {
1125
1025
  case "iso":
1126
- J = U.ad;
1026
+ X = q.ad;
1127
1027
  break;
1128
1028
  case "object":
1129
- J = JSON.stringify(U);
1029
+ X = JSON.stringify(q);
1130
1030
  break;
1131
1031
  default:
1132
- J = JSON.stringify(U);
1032
+ X = JSON.stringify(q);
1133
1033
  break;
1134
1034
  }
1135
- a(J);
1035
+ n(X);
1136
1036
  }
1137
- }, fe = (g) => {
1037
+ }, fe = (l) => {
1138
1038
  if (!r) {
1139
- switch (g.key) {
1039
+ switch (l.key) {
1140
1040
  case "ArrowLeft":
1141
- O(-1);
1041
+ x(-1);
1142
1042
  break;
1143
1043
  case "ArrowRight":
1144
- O(1);
1044
+ x(1);
1145
1045
  break;
1146
1046
  case "ArrowUp":
1147
- O(-12);
1047
+ x(-12);
1148
1048
  break;
1149
1049
  case "ArrowDown":
1150
- O(12);
1050
+ x(12);
1151
1051
  break;
1152
1052
  case "PageUp":
1153
- g.shiftKey ? O(-12) : O(-1);
1053
+ l.shiftKey ? x(-12) : x(-1);
1154
1054
  break;
1155
1055
  case "PageDown":
1156
- g.shiftKey ? O(12) : O(1);
1056
+ l.shiftKey ? x(12) : x(1);
1157
1057
  break;
1158
1058
  default:
1159
1059
  return;
1160
1060
  }
1161
- g.preventDefault();
1061
+ l.preventDefault();
1162
1062
  }
1163
- }, De = {
1164
- ...et ? Object.entries(et).reduce(
1165
- (g, [M, U]) => (g[`--calendar-${M}`] = U, g),
1063
+ }, Me = {
1064
+ ...nt ? Object.entries(nt).reduce(
1065
+ (l, [f, q]) => (l[`--calendar-${f}`] = q, l),
1166
1066
  {}
1167
1067
  ) : {}
1168
1068
  };
1169
- return /* @__PURE__ */ b(
1069
+ return /* @__PURE__ */ S(
1170
1070
  "div",
1171
1071
  {
1172
- className: `${f.calendar} ${s}`,
1173
- style: De,
1174
- "data-theme": _,
1072
+ className: `bsac-calendar ${a}`,
1073
+ style: Me,
1074
+ "data-theme": C,
1175
1075
  onKeyDown: fe,
1176
1076
  tabIndex: 0,
1177
1077
  role: "application",
1178
1078
  "aria-label": "Calendar",
1179
1079
  children: [
1180
- i === "range" && F && /* @__PURE__ */ b("div", { style: { display: "flex", gap: "16px" }, children: [
1181
- /* @__PURE__ */ h("div", { children: F({ onRangeChange: ye }) }),
1182
- /* @__PURE__ */ b("div", { style: { flex: 1 }, children: [
1183
- /* @__PURE__ */ h(
1080
+ i === "range" && T && /* @__PURE__ */ S("div", { style: { display: "flex", gap: "16px" }, children: [
1081
+ /* @__PURE__ */ g("div", { children: T({ onRangeChange: ye }) }),
1082
+ /* @__PURE__ */ S("div", { style: { flex: 1 }, children: [
1083
+ /* @__PURE__ */ g(
1184
1084
  gt,
1185
1085
  {
1186
- currentMonth: C,
1187
- currentYear: x,
1188
- months: Q,
1189
- onNavigateMonth: O,
1190
- onYearChange: Z,
1191
- onMonthChange: q,
1086
+ currentMonth: O,
1087
+ currentYear: H,
1088
+ months: G,
1089
+ onNavigateMonth: x,
1090
+ onYearChange: _,
1091
+ onMonthChange: j,
1192
1092
  disabled: r,
1193
1093
  showNepaliNumbers: p,
1194
- convertToNepaliNumber: W,
1094
+ convertToNepaliNumber: V,
1195
1095
  calendarType: e
1196
1096
  }
1197
1097
  ),
1198
- /* @__PURE__ */ h(
1098
+ /* @__PURE__ */ g(
1199
1099
  mt,
1200
1100
  {
1201
- calendarDays: N,
1101
+ calendarDays: w,
1202
1102
  days: ct,
1203
- onDateSelect: ht,
1204
- isSelected: (g) => rt(g, i),
1205
- isInRange: ot,
1206
- isToday: (g) => n && st(g),
1207
- isDisabled: (g) => tt({ year: x, month: C, day: g }, D, Y),
1103
+ onDateSelect: lt,
1104
+ isSelected: (l) => at(l, i),
1105
+ isInRange: rt,
1106
+ isToday: (l) => s && st(l),
1107
+ isDisabled: (l) => et({ year: H, month: O, day: l }, I, K),
1208
1108
  disabled: r,
1209
1109
  showNepaliNumbers: p,
1210
- convertToNepaliNumber: W
1110
+ convertToNepaliNumber: V
1211
1111
  }
1212
1112
  )
1213
1113
  ] })
1214
1114
  ] }),
1215
- i === "range" && l && m === "left" && !F && /* @__PURE__ */ b("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1216
- /* @__PURE__ */ h(
1217
- yt,
1115
+ i === "range" && c && D === "left" && !T && /* @__PURE__ */ S("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1116
+ /* @__PURE__ */ g(
1117
+ Dt,
1218
1118
  {
1219
- presets: ut,
1119
+ presets: it,
1220
1120
  calendarType: e,
1221
- onPresetSelect: lt,
1222
- activePreset: it,
1121
+ onPresetSelect: ht,
1122
+ activePreset: ot,
1223
1123
  position: "left"
1224
1124
  }
1225
1125
  ),
1226
- /* @__PURE__ */ b("div", { children: [
1227
- /* @__PURE__ */ h(
1126
+ /* @__PURE__ */ S("div", { children: [
1127
+ /* @__PURE__ */ g(
1228
1128
  gt,
1229
1129
  {
1230
- currentMonth: C,
1231
- currentYear: x,
1232
- months: Q,
1233
- onNavigateMonth: O,
1234
- onYearChange: Z,
1235
- onMonthChange: q,
1130
+ currentMonth: O,
1131
+ currentYear: H,
1132
+ months: G,
1133
+ onNavigateMonth: x,
1134
+ onYearChange: _,
1135
+ onMonthChange: j,
1236
1136
  disabled: r,
1237
1137
  showNepaliNumbers: p,
1238
- convertToNepaliNumber: W,
1138
+ convertToNepaliNumber: V,
1239
1139
  calendarType: e
1240
1140
  }
1241
1141
  ),
1242
- /* @__PURE__ */ h(
1142
+ /* @__PURE__ */ g(
1243
1143
  mt,
1244
1144
  {
1245
- calendarDays: N,
1145
+ calendarDays: w,
1246
1146
  days: ct,
1247
- onDateSelect: ht,
1248
- isSelected: (g) => rt(g, i),
1249
- isInRange: ot,
1250
- isToday: (g) => n && st(g),
1251
- isDisabled: (g) => tt({ year: x, month: C, day: g }, D, Y),
1147
+ onDateSelect: lt,
1148
+ isSelected: (l) => at(l, i),
1149
+ isInRange: rt,
1150
+ isToday: (l) => s && st(l),
1151
+ isDisabled: (l) => et({ year: H, month: O, day: l }, I, K),
1252
1152
  disabled: r,
1253
1153
  showNepaliNumbers: p,
1254
- convertToNepaliNumber: W
1154
+ convertToNepaliNumber: V
1255
1155
  }
1256
1156
  )
1257
1157
  ] })
1258
1158
  ] }),
1259
- i === "range" && l && m === "right" && !F && /* @__PURE__ */ b("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1260
- /* @__PURE__ */ b("div", { children: [
1261
- /* @__PURE__ */ h(
1159
+ i === "range" && c && D === "right" && !T && /* @__PURE__ */ S("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1160
+ /* @__PURE__ */ S("div", { children: [
1161
+ /* @__PURE__ */ g(
1262
1162
  gt,
1263
1163
  {
1264
- currentMonth: C,
1265
- currentYear: x,
1266
- months: Q,
1267
- onNavigateMonth: O,
1268
- onYearChange: Z,
1269
- onMonthChange: q,
1164
+ currentMonth: O,
1165
+ currentYear: H,
1166
+ months: G,
1167
+ onNavigateMonth: x,
1168
+ onYearChange: _,
1169
+ onMonthChange: j,
1270
1170
  disabled: r,
1271
1171
  showNepaliNumbers: p,
1272
- convertToNepaliNumber: W,
1172
+ convertToNepaliNumber: V,
1273
1173
  calendarType: e
1274
1174
  }
1275
1175
  ),
1276
- /* @__PURE__ */ h(
1176
+ /* @__PURE__ */ g(
1277
1177
  mt,
1278
1178
  {
1279
- calendarDays: N,
1179
+ calendarDays: w,
1280
1180
  days: ct,
1281
- onDateSelect: ht,
1282
- isSelected: (g) => rt(g, i),
1283
- isInRange: ot,
1284
- isToday: (g) => n && st(g),
1285
- isDisabled: (g) => tt({ year: x, month: C, day: g }, D, Y),
1181
+ onDateSelect: lt,
1182
+ isSelected: (l) => at(l, i),
1183
+ isInRange: rt,
1184
+ isToday: (l) => s && st(l),
1185
+ isDisabled: (l) => et({ year: H, month: O, day: l }, I, K),
1286
1186
  disabled: r,
1287
1187
  showNepaliNumbers: p,
1288
- convertToNepaliNumber: W
1188
+ convertToNepaliNumber: V
1289
1189
  }
1290
1190
  )
1291
1191
  ] }),
1292
- /* @__PURE__ */ h(
1293
- yt,
1192
+ /* @__PURE__ */ g(
1193
+ Dt,
1294
1194
  {
1295
- presets: ut,
1195
+ presets: it,
1296
1196
  calendarType: e,
1297
- onPresetSelect: lt,
1298
- activePreset: it,
1197
+ onPresetSelect: ht,
1198
+ activePreset: ot,
1299
1199
  position: "right"
1300
1200
  }
1301
1201
  )
1302
1202
  ] }),
1303
- (!i || i === "single" || !l && !F || m === "top" || m === "bottom") && /* @__PURE__ */ b(Me, { children: [
1304
- i === "range" && l && m === "top" && /* @__PURE__ */ h(
1305
- yt,
1203
+ (!i || i === "single" || !c && !T || D === "top" || D === "bottom") && /* @__PURE__ */ S(pe, { children: [
1204
+ i === "range" && c && D === "top" && /* @__PURE__ */ g(
1205
+ Dt,
1306
1206
  {
1307
- presets: ut,
1207
+ presets: it,
1308
1208
  calendarType: e,
1309
- onPresetSelect: lt,
1310
- activePreset: it,
1209
+ onPresetSelect: ht,
1210
+ activePreset: ot,
1311
1211
  position: "top"
1312
1212
  }
1313
1213
  ),
1314
- /* @__PURE__ */ h(
1214
+ /* @__PURE__ */ g(
1315
1215
  gt,
1316
1216
  {
1317
- currentMonth: C,
1318
- currentYear: x,
1319
- months: Q,
1320
- onNavigateMonth: O,
1321
- onYearChange: Z,
1322
- onMonthChange: q,
1217
+ currentMonth: O,
1218
+ currentYear: H,
1219
+ months: G,
1220
+ onNavigateMonth: x,
1221
+ onYearChange: _,
1222
+ onMonthChange: j,
1323
1223
  disabled: r,
1324
1224
  showNepaliNumbers: p,
1325
- convertToNepaliNumber: W,
1225
+ convertToNepaliNumber: V,
1326
1226
  calendarType: e
1327
1227
  }
1328
1228
  ),
1329
- /* @__PURE__ */ h(
1229
+ /* @__PURE__ */ g(
1330
1230
  mt,
1331
1231
  {
1332
- calendarDays: N,
1232
+ calendarDays: w,
1333
1233
  days: ct,
1334
- onDateSelect: ht,
1335
- isSelected: (g) => rt(g, i),
1336
- isInRange: ot,
1337
- isToday: (g) => n && st(g),
1338
- isDisabled: (g) => tt({ year: x, month: C, day: g }, D, Y),
1234
+ onDateSelect: lt,
1235
+ isSelected: (l) => at(l, i),
1236
+ isInRange: rt,
1237
+ isToday: (l) => s && st(l),
1238
+ isDisabled: (l) => et({ year: H, month: O, day: l }, I, K),
1339
1239
  disabled: r,
1340
1240
  showNepaliNumbers: p,
1341
- convertToNepaliNumber: W
1241
+ convertToNepaliNumber: V
1342
1242
  }
1343
1243
  ),
1344
- i === "range" && l && m === "bottom" && /* @__PURE__ */ h(
1345
- yt,
1244
+ i === "range" && c && D === "bottom" && /* @__PURE__ */ g(
1245
+ Dt,
1346
1246
  {
1347
- presets: ut,
1247
+ presets: it,
1348
1248
  calendarType: e,
1349
- onPresetSelect: lt,
1350
- activePreset: it,
1249
+ onPresetSelect: ht,
1250
+ activePreset: ot,
1351
1251
  position: "bottom"
1352
1252
  }
1353
1253
  )
@@ -1355,154 +1255,140 @@ const f3 = [
1355
1255
  ]
1356
1256
  }
1357
1257
  );
1358
- }, Z3 = "_datePicker_z7mc2_1", q3 = "_input_z7mc2_7", Q3 = "_iconButton_z7mc2_38", tn = "_popup_z7mc2_64", ft = {
1359
- datePicker: Z3,
1360
- input: q3,
1361
- iconButton: Q3,
1362
- popup: tn
1363
- }, ln = ({
1258
+ }, H3 = ({
1364
1259
  placeholder: e = "Select date",
1365
1260
  format: t = "YYYY-MM-DD",
1261
+ defaultValue: n,
1366
1262
  onDateSelect: a,
1367
1263
  inputClassName: s = "",
1368
- popupClassName: n = "",
1369
- style: r,
1370
- inputStyle: o,
1371
- icon: u,
1372
- showIcon: i = !0,
1264
+ popupClassName: r = "",
1265
+ style: o,
1266
+ inputStyle: u,
1267
+ icon: i,
1268
+ showIcon: h = !0,
1373
1269
  calendarType: c = "AD",
1374
- ...l
1270
+ ...D
1375
1271
  }) => {
1376
- const [m, d] = I(!1), [k, y] = I(null), [$, F] = I(""), w = pe(null);
1377
- Tt(() => {
1378
- const D = (Y) => {
1379
- w.current && !w.current.contains(Y.target) && d(!1);
1380
- };
1381
- return m && document.addEventListener("mousedown", D), () => {
1382
- document.removeEventListener("mousedown", D);
1272
+ const [d, k] = B(!1), [m, A] = B(null), [T, E] = B(() => {
1273
+ if (!n) return "";
1274
+ if (c === "BS")
1275
+ try {
1276
+ const [y, w, R] = n.split("-").map(Number), M = Y.fromEnglishDate(y, w - 1, R);
1277
+ return `${M.getYear()}-${String(M.getMonth() + 1).padStart(2, "0")}-${String(M.getDate()).padStart(2, "0")}`;
1278
+ } catch {
1279
+ return n;
1280
+ }
1281
+ return n;
1282
+ }), v = xt(null), p = xt(null), [C, nt] = B({ visibility: "hidden" }), I = () => {
1283
+ if (!v.current) return;
1284
+ const y = v.current.getBoundingClientRect(), w = p.current?.offsetHeight || 360, R = p.current?.offsetWidth || 280, M = window.innerHeight - y.bottom, $ = window.innerWidth - y.left, _ = M >= w + 8 ? y.bottom + 8 : Math.max(8, y.top - w - 8), j = $ >= R ? y.left : Math.max(8, y.right - R);
1285
+ nt({ top: _, left: j, visibility: "visible" });
1286
+ };
1287
+ Yt(() => (d && (requestAnimationFrame(I), window.addEventListener("scroll", I, !0), window.addEventListener("resize", I)), () => {
1288
+ window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
1289
+ }), [d]), Yt(() => {
1290
+ const y = (w) => {
1291
+ v.current && !v.current.contains(w.target) && k(!1);
1383
1292
  };
1384
- }, [m]);
1385
- const T = (D) => {
1386
- y(D);
1387
- const Y = c === "BS" ? D.bs : D.ad;
1388
- F(Y), d(!1), a?.(D);
1389
- }, p = (D) => {
1390
- const Y = D.target.value, x = D.target.selectionStart || 0, C = $.length;
1391
- if (Y === "") {
1392
- F("");
1293
+ return d && document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
1294
+ }, [d]);
1295
+ const K = (y) => {
1296
+ A(y), E(c === "BS" ? y.bs : y.ad), k(!1), a?.(y);
1297
+ }, H = (y) => {
1298
+ const w = y.target.value;
1299
+ if (w === "") {
1300
+ E("");
1393
1301
  return;
1394
1302
  }
1395
- if (x === Y.length && Y.length > C) {
1396
- const v = Y.replace(/[^0-9]/g, "");
1397
- let N = v;
1398
- v.length > 4 && v.length <= 6 ? N = v.slice(0, 4) + "-" + v.slice(4) : v.length > 6 && (N = v.slice(0, 4) + "-" + v.slice(4, 6) + "-" + v.slice(6, 8)), F(N);
1303
+ if ((y.target.selectionStart || 0) === w.length && w.length > T.length) {
1304
+ const M = w.replace(/[^0-9]/g, "");
1305
+ let $ = M;
1306
+ M.length > 4 && M.length <= 6 ? $ = M.slice(0, 4) + "-" + M.slice(4) : M.length > 6 && ($ = M.slice(0, 4) + "-" + M.slice(4, 6) + "-" + M.slice(6, 8)), E($);
1399
1307
  } else {
1400
- const v = Y.replace(/[^0-9-]/g, "");
1401
- v.length <= 10 && F(v);
1308
+ const M = w.replace(/[^0-9-]/g, "");
1309
+ M.length <= 10 && E(M);
1402
1310
  }
1403
- }, _ = () => {
1404
- const D = $.trim();
1405
- if (!D) {
1406
- y(null);
1311
+ }, O = () => {
1312
+ const y = T.trim();
1313
+ if (!y) {
1314
+ A(null);
1407
1315
  return;
1408
1316
  }
1409
- const Y = D.match(/^(\d{4})-(\d{2})-(\d{2})$/);
1410
- if (Y) {
1411
- const [, x, C, B] = Y, v = parseInt(C), N = parseInt(B);
1412
- if (v < 1 || v > 12 || N < 1 || N > 32) {
1413
- F(
1414
- k ? c === "BS" ? k.formatted.bs : k.formatted.ad : ""
1415
- );
1317
+ const w = y.match(/^(\d{4})-(\d{2})-(\d{2})$/);
1318
+ if (w) {
1319
+ const [, R, M, $] = w, _ = parseInt(M), j = parseInt($);
1320
+ if (_ < 1 || _ > 12 || j < 1 || j > 32) {
1321
+ E(m ? c === "BS" ? m.bs : m.ad : "");
1416
1322
  return;
1417
1323
  }
1418
- const nt = {
1419
- bs: c === "BS" ? `${x}-${C}-${B}` : "",
1420
- ad: c === "AD" ? `${x}-${C}-${B}` : "",
1324
+ const x = {
1325
+ bs: c === "BS" ? `${R}-${M}-${$}` : "",
1326
+ ad: c === "AD" ? `${R}-${M}-${$}` : "",
1421
1327
  formatted: {
1422
- bs: c === "BS" ? D : "",
1423
- ad: c === "AD" ? D : ""
1328
+ bs: c === "BS" ? y : "",
1329
+ ad: c === "AD" ? y : ""
1424
1330
  }
1425
1331
  };
1426
- y(nt), a?.(nt);
1427
- } else D.length < 10 && F(
1428
- k ? c === "BS" ? k.formatted.bs : k.formatted.ad : ""
1429
- );
1430
- }, et = (D) => {
1431
- D.key === "Enter" ? (_(), d(!1)) : D.key === "Escape" && d(!1);
1332
+ A(x), a?.(x);
1333
+ } else y.length < 10 && E(m ? c === "BS" ? m.bs : m.ad : "");
1432
1334
  };
1433
- return /* @__PURE__ */ b("div", { className: `${ft.datePicker} ${s}`, ref: w, style: r, children: [
1434
- /* @__PURE__ */ h(
1335
+ return /* @__PURE__ */ S("div", { className: "bsac-datepicker", ref: v, style: o, children: [
1336
+ /* @__PURE__ */ g(
1435
1337
  "input",
1436
1338
  {
1437
1339
  type: "text",
1438
- value: $,
1439
- placeholder: e || "YYYY-MM-DD",
1440
- onChange: p,
1441
- onBlur: _,
1442
- onKeyDown: et,
1443
- className: ft.input,
1444
- style: o,
1340
+ value: T,
1341
+ placeholder: e,
1342
+ onChange: H,
1343
+ onBlur: O,
1344
+ onKeyDown: (y) => {
1345
+ y.key === "Enter" ? (O(), k(!1)) : y.key === "Escape" && k(!1);
1346
+ },
1347
+ className: `bsac-input ${s}`,
1348
+ style: u,
1445
1349
  "aria-label": "Date picker input",
1446
1350
  "aria-haspopup": "dialog",
1447
- "aria-expanded": m,
1351
+ "aria-expanded": d,
1448
1352
  maxLength: 10
1449
1353
  }
1450
1354
  ),
1451
- /* @__PURE__ */ h(
1355
+ /* @__PURE__ */ g(
1452
1356
  "button",
1453
1357
  {
1454
1358
  type: "button",
1455
- className: ft.iconButton,
1456
- onClick: () => d(!m),
1359
+ className: "bsac-icon-btn",
1360
+ onClick: () => k(!d),
1457
1361
  "aria-label": "Toggle calendar",
1458
- style: { display: i ? "flex" : "none" },
1459
- children: u || /* @__PURE__ */ b(
1460
- "svg",
1461
- {
1462
- width: "18",
1463
- height: "18",
1464
- viewBox: "0 0 24 24",
1465
- fill: "none",
1466
- stroke: "currentColor",
1467
- strokeWidth: "2",
1468
- children: [
1469
- /* @__PURE__ */ h("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
1470
- /* @__PURE__ */ h("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
1471
- /* @__PURE__ */ h("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
1472
- /* @__PURE__ */ h("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
1473
- ]
1474
- }
1475
- )
1362
+ style: { display: h ? "flex" : "none" },
1363
+ children: i || /* @__PURE__ */ S("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
1364
+ /* @__PURE__ */ g("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
1365
+ /* @__PURE__ */ g("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
1366
+ /* @__PURE__ */ g("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
1367
+ /* @__PURE__ */ g("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
1368
+ ] })
1476
1369
  }
1477
1370
  ),
1478
- m && /* @__PURE__ */ h("div", { className: `${ft.popup} ${n}`, children: /* @__PURE__ */ h(
1479
- X3,
1480
- {
1481
- calendarType: c,
1482
- onDateSelect: T,
1483
- ...l
1484
- }
1485
- ) })
1371
+ d && /* @__PURE__ */ g("div", { ref: p, className: `bsac-popup ${r}`, style: C, children: /* @__PURE__ */ g(C3, { calendarType: c, onDateSelect: K, ...D }) })
1486
1372
  ] });
1487
1373
  };
1488
1374
  export {
1489
- X3 as Calendar,
1490
- ln as CalendarInput,
1491
- on as DEFAULT_COLORS,
1492
- ln as DatePicker,
1375
+ C3 as Calendar,
1376
+ H3 as CalendarInput,
1377
+ O3 as DEFAULT_COLORS,
1378
+ H3 as DatePicker,
1493
1379
  p3 as ENGLISH_DAYS,
1494
- D3 as ENGLISH_MONTHS_AD,
1495
- ge as ENGLISH_MONTHS_BS,
1380
+ f3 as ENGLISH_MONTHS_AD,
1381
+ me as ENGLISH_MONTHS_BS,
1496
1382
  M3 as NEPALI_DAYS,
1497
- S3 as NEPALI_DIGITS,
1498
- f3 as NEPALI_MONTHS,
1499
- cn as PRESET_KEYS,
1500
- W as convertToNepaliNumber,
1501
- E3 as createDateOutput,
1502
- w3 as createPredefinedRanges,
1503
- me as getDaysInMonth,
1504
- b3 as getFirstDayOfMonth,
1505
- H as getTodayDate,
1506
- un as isDateInRange,
1507
- k3 as useCalendar
1383
+ b3 as NEPALI_DIGITS,
1384
+ y3 as NEPALI_MONTHS,
1385
+ T3 as PRESET_KEYS,
1386
+ V as convertToNepaliNumber,
1387
+ wt as createDateOutput,
1388
+ Y3 as createPredefinedRanges,
1389
+ De as getDaysInMonth,
1390
+ S3 as getFirstDayOfMonth,
1391
+ N as getTodayDate,
1392
+ N3 as isDateInRange,
1393
+ E3 as useCalendar
1508
1394
  };