bs-ad-calendar-react 1.2.0 → 1.2.2

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,865 +1,255 @@
1
- import wt, { useMemo as yt, useState as te, useEffect as Ct, useRef as jn } from "react";
2
- var Ae = { exports: {} }, Ye = {};
3
- var pt;
4
- function Rn() {
5
- if (pt) return Ye;
6
- pt = 1;
7
- var t = wt, e = /* @__PURE__ */ Symbol.for("react.element"), a = /* @__PURE__ */ Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
8
- function i(l, c, d) {
9
- var h, m = {}, y = null, j = null;
10
- d !== void 0 && (y = "" + d), c.key !== void 0 && (y = "" + c.key), c.ref !== void 0 && (j = c.ref);
11
- for (h in c) s.call(c, h) && !o.hasOwnProperty(h) && (m[h] = c[h]);
12
- if (l && l.defaultProps) for (h in c = l.defaultProps, c) m[h] === void 0 && (m[h] = c[h]);
13
- return { $$typeof: e, type: l, key: y, ref: j, props: m, _owner: r.current };
14
- }
15
- return Ye.Fragment = a, Ye.jsx = i, Ye.jsxs = i, Ye;
16
- }
17
- var je = {};
18
- var vt;
19
- function Tn() {
20
- return vt || (vt = 1, process.env.NODE_ENV !== "production" && (function() {
21
- var t = wt, e = /* @__PURE__ */ Symbol.for("react.element"), a = /* @__PURE__ */ Symbol.for("react.portal"), s = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), o = /* @__PURE__ */ Symbol.for("react.profiler"), i = /* @__PURE__ */ Symbol.for("react.provider"), l = /* @__PURE__ */ Symbol.for("react.context"), c = /* @__PURE__ */ Symbol.for("react.forward_ref"), d = /* @__PURE__ */ Symbol.for("react.suspense"), h = /* @__PURE__ */ Symbol.for("react.suspense_list"), m = /* @__PURE__ */ Symbol.for("react.memo"), y = /* @__PURE__ */ Symbol.for("react.lazy"), j = /* @__PURE__ */ Symbol.for("react.offscreen"), S = Symbol.iterator, N = "@@iterator";
22
- function H(n) {
23
- if (n === null || typeof n != "object")
24
- return null;
25
- var u = S && n[S] || n[N];
26
- return typeof u == "function" ? u : null;
27
- }
28
- var C = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
29
- function _(n) {
30
- {
31
- for (var u = arguments.length, f = new Array(u > 1 ? u - 1 : 0), p = 1; p < u; p++)
32
- f[p - 1] = arguments[p];
33
- Y("error", n, f);
34
- }
35
- }
36
- function Y(n, u, f) {
37
- {
38
- var p = C.ReactDebugCurrentFrame, E = p.getStackAddendum();
39
- E !== "" && (u += "%s", f = f.concat([E]));
40
- var w = f.map(function(b) {
41
- return String(b);
42
- });
43
- w.unshift("Warning: " + u), Function.prototype.apply.call(console[n], console, w);
44
- }
45
- }
46
- var F = !1, De = !1, x = !1, O = !1, B = !1, $;
47
- $ = /* @__PURE__ */ Symbol.for("react.module.reference");
48
- function L(n) {
49
- return !!(typeof n == "string" || typeof n == "function" || n === s || n === o || B || n === r || n === d || n === h || O || n === j || F || De || x || typeof n == "object" && n !== null && (n.$$typeof === y || n.$$typeof === m || n.$$typeof === i || n.$$typeof === l || n.$$typeof === c || // This needs to include all possible module reference object
50
- // types supported by any Flight configuration anywhere since
51
- // we don't know which Flight build this will end up being used
52
- // with.
53
- n.$$typeof === $ || n.getModuleId !== void 0));
54
- }
55
- function P(n, u, f) {
56
- var p = n.displayName;
57
- if (p)
58
- return p;
59
- var E = u.displayName || u.name || "";
60
- return E !== "" ? f + "(" + E + ")" : f;
61
- }
62
- function U(n) {
63
- return n.displayName || "Context";
64
- }
65
- function K(n) {
66
- if (n == null)
67
- return null;
68
- if (typeof n.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof n == "function")
69
- return n.displayName || n.name || null;
70
- if (typeof n == "string")
71
- return n;
72
- switch (n) {
73
- case s:
74
- return "Fragment";
75
- case a:
76
- return "Portal";
77
- case o:
78
- return "Profiler";
79
- case r:
80
- return "StrictMode";
81
- case d:
82
- return "Suspense";
83
- case h:
84
- return "SuspenseList";
85
- }
86
- if (typeof n == "object")
87
- switch (n.$$typeof) {
88
- case l:
89
- var u = n;
90
- return U(u) + ".Consumer";
91
- case i:
92
- var f = n;
93
- return U(f._context) + ".Provider";
94
- case c:
95
- return P(n, n.render, "ForwardRef");
96
- case m:
97
- var p = n.displayName || null;
98
- return p !== null ? p : K(n.type) || "Memo";
99
- case y: {
100
- var E = n, w = E._payload, b = E._init;
101
- try {
102
- return K(b(w));
103
- } catch {
104
- return null;
105
- }
106
- }
107
- }
108
- return null;
109
- }
110
- var q = Object.assign, Q = 0, oe, ie, W, he, fe, ge, me;
111
- function be() {
112
- }
113
- be.__reactDisabledLog = !0;
114
- function Se() {
115
- {
116
- if (Q === 0) {
117
- oe = console.log, ie = console.info, W = console.warn, he = console.error, fe = console.group, ge = console.groupCollapsed, me = console.groupEnd;
118
- var n = {
119
- configurable: !0,
120
- enumerable: !0,
121
- value: be,
122
- writable: !0
123
- };
124
- Object.defineProperties(console, {
125
- info: n,
126
- log: n,
127
- warn: n,
128
- error: n,
129
- group: n,
130
- groupCollapsed: n,
131
- groupEnd: n
132
- });
133
- }
134
- Q++;
135
- }
136
- }
137
- function ye() {
138
- {
139
- if (Q--, Q === 0) {
140
- var n = {
141
- configurable: !0,
142
- enumerable: !0,
143
- writable: !0
144
- };
145
- Object.defineProperties(console, {
146
- log: q({}, n, {
147
- value: oe
148
- }),
149
- info: q({}, n, {
150
- value: ie
151
- }),
152
- warn: q({}, n, {
153
- value: W
154
- }),
155
- error: q({}, n, {
156
- value: he
157
- }),
158
- group: q({}, n, {
159
- value: fe
160
- }),
161
- groupCollapsed: q({}, n, {
162
- value: ge
163
- }),
164
- groupEnd: q({}, n, {
165
- value: me
166
- })
167
- });
168
- }
169
- Q < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
170
- }
171
- }
172
- var ue = C.ReactCurrentDispatcher, ce;
173
- function Ee(n, u, f) {
174
- {
175
- if (ce === void 0)
176
- try {
177
- throw Error();
178
- } catch (E) {
179
- var p = E.stack.trim().match(/\n( *(at )?)/);
180
- ce = p && p[1] || "";
181
- }
182
- return `
183
- ` + ce + n;
184
- }
185
- }
186
- var le = !1, Me;
187
- {
188
- var nt = typeof WeakMap == "function" ? WeakMap : Map;
189
- Me = new nt();
190
- }
191
- function Te(n, u) {
192
- if (!n || le)
193
- return "";
194
- {
195
- var f = Me.get(n);
196
- if (f !== void 0)
197
- return f;
198
- }
199
- var p;
200
- le = !0;
201
- var E = Error.prepareStackTrace;
202
- Error.prepareStackTrace = void 0;
203
- var w;
204
- w = ue.current, ue.current = null, Se();
205
- try {
206
- if (u) {
207
- var b = function() {
208
- throw Error();
209
- };
210
- if (Object.defineProperty(b.prototype, "props", {
211
- set: function() {
212
- throw Error();
213
- }
214
- }), typeof Reflect == "object" && Reflect.construct) {
215
- try {
216
- Reflect.construct(b, []);
217
- } catch (J) {
218
- p = J;
219
- }
220
- Reflect.construct(n, [], b);
221
- } else {
222
- try {
223
- b.call();
224
- } catch (J) {
225
- p = J;
226
- }
227
- n.call(b.prototype);
228
- }
229
- } else {
230
- try {
231
- throw Error();
232
- } catch (J) {
233
- p = J;
234
- }
235
- n();
236
- }
237
- } catch (J) {
238
- if (J && p && typeof J.stack == "string") {
239
- for (var D = J.stack.split(`
240
- `), V = p.stack.split(`
241
- `), T = D.length - 1, A = V.length - 1; T >= 1 && A >= 0 && D[T] !== V[A]; )
242
- A--;
243
- for (; T >= 1 && A >= 0; T--, A--)
244
- if (D[T] !== V[A]) {
245
- if (T !== 1 || A !== 1)
246
- do
247
- if (T--, A--, A < 0 || D[T] !== V[A]) {
248
- var Z = `
249
- ` + D[T].replace(" at new ", " at ");
250
- return n.displayName && Z.includes("<anonymous>") && (Z = Z.replace("<anonymous>", n.displayName)), typeof n == "function" && Me.set(n, Z), Z;
251
- }
252
- while (T >= 1 && A >= 0);
253
- break;
254
- }
255
- }
256
- } finally {
257
- le = !1, ue.current = w, ye(), Error.prepareStackTrace = E;
258
- }
259
- var xe = n ? n.displayName || n.name : "", pe = xe ? Ee(xe) : "";
260
- return typeof n == "function" && Me.set(n, pe), pe;
261
- }
262
- function v(n, u, f) {
263
- return Te(n, !1);
264
- }
265
- function k(n) {
266
- var u = n.prototype;
267
- return !!(u && u.isReactComponent);
268
- }
269
- function ee(n, u, f) {
270
- if (n == null)
271
- return "";
272
- if (typeof n == "function")
273
- return Te(n, k(n));
274
- if (typeof n == "string")
275
- return Ee(n);
276
- switch (n) {
277
- case d:
278
- return Ee("Suspense");
279
- case h:
280
- return Ee("SuspenseList");
281
- }
282
- if (typeof n == "object")
283
- switch (n.$$typeof) {
284
- case c:
285
- return v(n.render);
286
- case m:
287
- return ee(n.type, u, f);
288
- case y: {
289
- var p = n, E = p._payload, w = p._init;
290
- try {
291
- return ee(w(E), u, f);
292
- } catch {
293
- }
294
- }
295
- }
296
- return "";
297
- }
298
- var X = Object.prototype.hasOwnProperty, Je = {}, rt = C.ReactDebugCurrentFrame;
299
- function Oe(n) {
300
- if (n) {
301
- var u = n._owner, f = ee(n.type, n._source, u ? u.type : null);
302
- rt.setExtraStackFrame(f);
303
- } else
304
- rt.setExtraStackFrame(null);
305
- }
306
- function un(n, u, f, p, E) {
307
- {
308
- var w = Function.call.bind(X);
309
- for (var b in n)
310
- if (w(n, b)) {
311
- var D = void 0;
312
- try {
313
- if (typeof n[b] != "function") {
314
- var V = Error((p || "React class") + ": " + f + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
315
- throw V.name = "Invariant Violation", V;
316
- }
317
- D = n[b](u, b, p, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
318
- } catch (T) {
319
- D = T;
320
- }
321
- D && !(D instanceof Error) && (Oe(E), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", f, b, typeof D), Oe(null)), D instanceof Error && !(D.message in Je) && (Je[D.message] = !0, Oe(E), _("Failed %s type: %s", f, D.message), Oe(null));
322
- }
323
- }
324
- }
325
- var cn = Array.isArray;
326
- function Ge(n) {
327
- return cn(n);
328
- }
329
- function ln(n) {
330
- {
331
- var u = typeof Symbol == "function" && Symbol.toStringTag, f = u && n[Symbol.toStringTag] || n.constructor.name || "Object";
332
- return f;
333
- }
334
- }
335
- function dn(n) {
336
- try {
337
- return at(n), !1;
338
- } catch {
339
- return !0;
340
- }
341
- }
342
- function at(n) {
343
- return "" + n;
344
- }
345
- function st(n) {
346
- if (dn(n))
347
- return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ln(n)), at(n);
348
- }
349
- var ot = C.ReactCurrentOwner, hn = {
350
- key: !0,
351
- ref: !0,
352
- __self: !0,
353
- __source: !0
354
- }, it, ut;
355
- function fn(n) {
356
- if (X.call(n, "ref")) {
357
- var u = Object.getOwnPropertyDescriptor(n, "ref").get;
358
- if (u && u.isReactWarning)
359
- return !1;
360
- }
361
- return n.ref !== void 0;
362
- }
363
- function gn(n) {
364
- if (X.call(n, "key")) {
365
- var u = Object.getOwnPropertyDescriptor(n, "key").get;
366
- if (u && u.isReactWarning)
367
- return !1;
368
- }
369
- return n.key !== void 0;
370
- }
371
- function mn(n, u) {
372
- typeof n.ref == "string" && ot.current;
373
- }
374
- function yn(n, u) {
375
- {
376
- var f = function() {
377
- it || (it = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", u));
378
- };
379
- f.isReactWarning = !0, Object.defineProperty(n, "key", {
380
- get: f,
381
- configurable: !0
382
- });
383
- }
384
- }
385
- function pn(n, u) {
386
- {
387
- var f = function() {
388
- ut || (ut = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", u));
389
- };
390
- f.isReactWarning = !0, Object.defineProperty(n, "ref", {
391
- get: f,
392
- configurable: !0
393
- });
394
- }
395
- }
396
- var vn = function(n, u, f, p, E, w, b) {
397
- var D = {
398
- // This tag allows us to uniquely identify this as a React Element
399
- $$typeof: e,
400
- // Built-in properties that belong on the element
401
- type: n,
402
- key: u,
403
- ref: f,
404
- props: b,
405
- // Record the component responsible for creating this element.
406
- _owner: w
407
- };
408
- return D._store = {}, Object.defineProperty(D._store, "validated", {
409
- configurable: !1,
410
- enumerable: !1,
411
- writable: !0,
412
- value: !1
413
- }), Object.defineProperty(D, "_self", {
414
- configurable: !1,
415
- enumerable: !1,
416
- writable: !1,
417
- value: p
418
- }), Object.defineProperty(D, "_source", {
419
- configurable: !1,
420
- enumerable: !1,
421
- writable: !1,
422
- value: E
423
- }), Object.freeze && (Object.freeze(D.props), Object.freeze(D)), D;
424
- };
425
- function Dn(n, u, f, p, E) {
426
- {
427
- var w, b = {}, D = null, V = null;
428
- f !== void 0 && (st(f), D = "" + f), gn(u) && (st(u.key), D = "" + u.key), fn(u) && (V = u.ref, mn(u, E));
429
- for (w in u)
430
- X.call(u, w) && !hn.hasOwnProperty(w) && (b[w] = u[w]);
431
- if (n && n.defaultProps) {
432
- var T = n.defaultProps;
433
- for (w in T)
434
- b[w] === void 0 && (b[w] = T[w]);
435
- }
436
- if (D || V) {
437
- var A = typeof n == "function" ? n.displayName || n.name || "Unknown" : n;
438
- D && yn(b, A), V && pn(b, A);
439
- }
440
- return vn(n, D, V, E, p, ot.current, b);
441
- }
442
- }
443
- var Ke = C.ReactCurrentOwner, ct = C.ReactDebugCurrentFrame;
444
- function _e(n) {
445
- if (n) {
446
- var u = n._owner, f = ee(n.type, n._source, u ? u.type : null);
447
- ct.setExtraStackFrame(f);
448
- } else
449
- ct.setExtraStackFrame(null);
450
- }
451
- var ze;
452
- ze = !1;
453
- function qe(n) {
454
- return typeof n == "object" && n !== null && n.$$typeof === e;
455
- }
456
- function lt() {
457
- {
458
- if (Ke.current) {
459
- var n = K(Ke.current.type);
460
- if (n)
461
- return `
462
-
463
- Check the render method of \`` + n + "`.";
464
- }
465
- return "";
466
- }
467
- }
468
- function bn(n) {
469
- return "";
470
- }
471
- var dt = {};
472
- function Sn(n) {
473
- {
474
- var u = lt();
475
- if (!u) {
476
- var f = typeof n == "string" ? n : n.displayName || n.name;
477
- f && (u = `
478
-
479
- Check the top-level render call using <` + f + ">.");
480
- }
481
- return u;
482
- }
483
- }
484
- function ht(n, u) {
485
- {
486
- if (!n._store || n._store.validated || n.key != null)
487
- return;
488
- n._store.validated = !0;
489
- var f = Sn(u);
490
- if (dt[f])
491
- return;
492
- dt[f] = !0;
493
- var p = "";
494
- n && n._owner && n._owner !== Ke.current && (p = " It was passed a child from " + K(n._owner.type) + "."), _e(n), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, p), _e(null);
495
- }
496
- }
497
- function ft(n, u) {
498
- {
499
- if (typeof n != "object")
500
- return;
501
- if (Ge(n))
502
- for (var f = 0; f < n.length; f++) {
503
- var p = n[f];
504
- qe(p) && ht(p, u);
505
- }
506
- else if (qe(n))
507
- n._store && (n._store.validated = !0);
508
- else if (n) {
509
- var E = H(n);
510
- if (typeof E == "function" && E !== n.entries)
511
- for (var w = E.call(n), b; !(b = w.next()).done; )
512
- qe(b.value) && ht(b.value, u);
513
- }
514
- }
515
- }
516
- function En(n) {
517
- {
518
- var u = n.type;
519
- if (u == null || typeof u == "string")
520
- return;
521
- var f;
522
- if (typeof u == "function")
523
- f = u.propTypes;
524
- else if (typeof u == "object" && (u.$$typeof === c || // Note: Memo only checks outer props here.
525
- // Inner props are checked in the reconciler.
526
- u.$$typeof === m))
527
- f = u.propTypes;
528
- else
529
- return;
530
- if (f) {
531
- var p = K(u);
532
- un(f, n.props, "prop", p, n);
533
- } else if (u.PropTypes !== void 0 && !ze) {
534
- ze = !0;
535
- var E = K(u);
536
- _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", E || "Unknown");
537
- }
538
- typeof u.getDefaultProps == "function" && !u.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
539
- }
540
- }
541
- function Mn(n) {
542
- {
543
- for (var u = Object.keys(n.props), f = 0; f < u.length; f++) {
544
- var p = u[f];
545
- if (p !== "children" && p !== "key") {
546
- _e(n), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), _e(null);
547
- break;
548
- }
549
- }
550
- n.ref !== null && (_e(n), _("Invalid attribute `ref` supplied to `React.Fragment`."), _e(null));
551
- }
552
- }
553
- var gt = {};
554
- function mt(n, u, f, p, E, w) {
555
- {
556
- var b = L(n);
557
- if (!b) {
558
- var D = "";
559
- (n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (D += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
560
- var V = bn();
561
- V ? D += V : D += lt();
562
- var T;
563
- n === null ? T = "null" : Ge(n) ? T = "array" : n !== void 0 && n.$$typeof === e ? (T = "<" + (K(n.type) || "Unknown") + " />", D = " Did you accidentally export a JSX literal instead of a component?") : T = typeof n, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, D);
564
- }
565
- var A = Dn(n, u, f, E, w);
566
- if (A == null)
567
- return A;
568
- if (b) {
569
- var Z = u.children;
570
- if (Z !== void 0)
571
- if (p)
572
- if (Ge(Z)) {
573
- for (var xe = 0; xe < Z.length; xe++)
574
- ft(Z[xe], n);
575
- Object.freeze && Object.freeze(Z);
576
- } else
577
- _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
578
- else
579
- ft(Z, n);
580
- }
581
- if (X.call(u, "key")) {
582
- var pe = K(n), J = Object.keys(u).filter(function(Yn) {
583
- return Yn !== "key";
584
- }), Xe = J.length > 0 ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}";
585
- if (!gt[pe + Xe]) {
586
- var Cn = J.length > 0 ? "{" + J.join(": ..., ") + ": ...}" : "{}";
587
- _(`A props object containing a "key" prop is being spread into JSX:
588
- let props = %s;
589
- <%s {...props} />
590
- React keys must be passed directly to JSX without using spread:
591
- let props = %s;
592
- <%s key={someKey} {...props} />`, Xe, pe, Cn, pe), gt[pe + Xe] = !0;
593
- }
594
- }
595
- return n === s ? Mn(A) : En(A), A;
596
- }
597
- }
598
- function _n(n, u, f) {
599
- return mt(n, u, f, !0);
600
- }
601
- function xn(n, u, f) {
602
- return mt(n, u, f, !1);
603
- }
604
- var kn = xn, wn = _n;
605
- je.Fragment = s, je.jsx = kn, je.jsxs = wn;
606
- })()), je;
607
- }
608
- var Dt;
609
- function On() {
610
- return Dt || (Dt = 1, process.env.NODE_ENV === "production" ? Ae.exports = Rn() : Ae.exports = Tn()), Ae.exports;
611
- }
612
- var g = On();
613
- const we = [1943, 4, 14], Yt = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], An = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ae = [[[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]];
614
- let jt = class extends Error {
615
- constructor(e) {
616
- super(e), this.name = "DateOutOfRangeError";
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 {
5
+ constructor(t) {
6
+ super(t), this.name = "DateOutOfRangeError";
617
7
  }
618
8
  };
619
- const Rt = () => we[0] + 1, Tt = () => we[0] + ae.length - 1, Ot = () => 2e3, At = () => 2e3 + ae.length - 1, Ne = (t) => t % 400 === 0 || t % 4 === 0 && t % 100 !== 0, Ze = (t) => Ne(t) ? An : Yt, Fn = (t, e, a) => !(t < Rt() || t > Tt() || e < 1 || e > 12 || a < 1 || a > Ze(t)[e - 1]), bt = (t, e, a) => {
620
- let s = t * 365 + a;
621
- for (let r = 0; r < e - 1; r++) s += Yt[r];
622
- return e <= 2 && (t -= 1), s += Math.floor(t / 4) - Math.floor(t / 100) + Math.floor(t / 400), s;
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;
623
13
  };
624
- function $n(t, e, a) {
625
- const s = e + 1;
626
- if (!Fn(t, s, a)) throw new jt("Date out of range");
627
- let r = 2e3, o = 1, i = 1, l = Math.abs(bt(t, s, a) - bt(...we)), c = 0;
628
- for (; l >= ae[c][1]; ) l -= ae[c][1], r += 1, c += 1;
629
- let d = 0;
630
- for (; l >= ae[c][0][d]; ) l -= ae[c][0][d], o += 1, d += 1;
631
- return i += l, [r, o - 1, i];
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];
632
22
  }
633
- const Pn = (t, e, a) => !(t < Ot() || t > At() || e < 1 || e > 12 || a < 1 || a > ae[t - 2e3][0][e - 1]), In = (t, e, a) => {
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) => {
634
24
  let s = a - 1;
635
- const r = t - 2e3;
636
- for (let o = 0; o < e - 1; o++) s += ae[r][0][o];
637
- for (let o = 0; o < r; o++) s += ae[o][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];
638
28
  return s;
639
- }, Bn = (t, e, a) => {
640
- const s = e + 1;
641
- if (!Pn(t, s, a)) throw new jt("Date out of range");
642
- let [r, o, i] = [we[0], 1, 1];
643
- const l = Ze(r).slice(0, we[1] - 1).reduce((m, y) => m + y, 0) + we[2] - 1;
644
- let c = Math.abs(In(t, s, a) + l);
645
- for (; c >= 366 && Ne(r) || c >= 365 && !Ne(r); ) c -= Ne(r) ? 366 : 365, r += 1;
646
- const d = Ze(r);
647
- let h = 0;
648
- for (; c >= d[h]; ) c -= d[h], o += 1, h += 1;
649
- return i += c, [r, o - 1, i];
650
- }, se = { enMinYear: Rt, enMaxYear: Tt, npMinYear: Ot, npMaxYear: At, englishToNepali: $n, nepaliToEnglish: Bn }, Ft = "en", ne = "ne", $t = 207e5, Pt = 198e5, Nn = 5049018e5, Hn = new Date(1986, 0, 1, 0, 15), Le = ["Baisakh", "Jestha", "Asar", "Shrawan", "Bhadra", "Aswin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Qe = ["Bai", "Jes", "Asa", "Shr", "Bhd", "Asw", "Kar", "Man", "Pou", "Mag", "Fal", "Cha"], It = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "आश्विन", "कार्तिक", "मंसिर", "पौष", "माघ", "फाल्गुण", "चैत्र"], Ln = ["बै", "जे", "अ", "श्रा", "भा", "आ", "का", "मं", "पौ", "मा", "फा", "चै"], et = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], tt = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], Wn = ["जनवरी", "फेब्रुअरी", "मार्च", "अप्रिल", "मे", "जुन", "जुलाई", "अगस्ट", "सेप्टेम्बर", "अक्टोबर", "नोभेम्बर", "डिसेम्बर"], Vn = ["जन", "फेब", "मार", "अप्रि", "मे", "जुन", "जुला", "अग", "सेप", "अक्टो", "नोभे", "डिसे"], Bt = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], Ce = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], We = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], Nt = ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"], Ht = ["आइतबार", "सोमबार", "मंगलबार", "बुधबार", "बिहिबार", "शुक्रबार", "शनिबार"], Un = /(\[[^\[]*\])|(\\)?([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, Jn = (t) => {
651
- const e = t.getTime(), a = e < Nn ? Pt : $t, s = new Date(e + a), r = s.getUTCFullYear(), o = s.getUTCMonth(), i = s.getUTCDate(), l = s.getUTCHours(), c = s.getUTCMinutes(), d = s.getUTCSeconds(), h = s.getUTCMilliseconds(), m = s.getUTCDay();
652
- return { year: r, month0: o, day: i, hour: l, minute: c, second: d, ms: h, weekDay: m };
653
- }, St = (t, e, a, s, r, o, i) => {
654
- const l = new Date(t, e, a, s, r, o, i);
655
- let c = l < Hn ? Pt : $t;
656
- const d = -1 * l.getTimezoneOffset() * 60 * 1e3;
657
- return new Date(l.getTime() - c + d);
658
- }, Ve = (t) => {
659
- const e = t.match(Un);
660
- return e ? e.map((a) => a.startsWith("[") && a.endsWith("]") ? a.slice(1, -1) : a) : [];
661
- }, re = (t) => {
662
- if (t.length === 0) return new RegExp("");
663
- let e = [...t];
664
- if (e = e.sort((s, r) => r.length - s.length), e[0] === "") return new RegExp("");
665
- const a = `(${e.join("|")})`;
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);
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) => {
52
+ if (e.length === 0) return new RegExp("");
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("|")})`;
666
56
  return new RegExp(a);
667
- }, G = (t) => t.toString().padStart(2, "0"), Lt = (t) => t.toString().padStart(3, "0"), Gn = (t) => t.split("").map((e) => Bt[e.charCodeAt(0) - 48]).join(""), R = (t, e) => {
668
- const a = typeof t == "string" ? t : String(t);
669
- return e !== ne ? a : Gn(a);
670
- }, Kn = (t, e) => R(t.getYear(), e).substring(2), zn = (t, e) => R(t.getYear(), e), qn = (t, e) => R(t.getEnglishYear(), e).substring(2), Xn = (t, e) => R(t.getEnglishYear(), e), Zn = (t, e) => R(t.getMonth() + 1, e), Qn = (t, e) => R(G(t.getMonth() + 1), e), er = (t, e) => e === ne ? Ln[t.getMonth()] : Qe[t.getMonth()], tr = (t, e) => e === ne ? It[t.getMonth()] : Le[t.getMonth()], nr = (t, e) => R(t.getEnglishMonth() + 1, e), rr = (t, e) => R(G(t.getEnglishMonth() + 1), e), ar = (t, e) => e === ne ? Vn[t.getEnglishMonth()] : tt[t.getEnglishMonth()], sr = (t, e) => e === ne ? Wn[t.getEnglishMonth()] : et[t.getEnglishMonth()], or = (t, e) => R(t.getDate(), e), ir = (t, e) => R(G(t.getDate()), e), ur = (t, e) => R(t.getEnglishDate(), e), cr = (t, e) => R(G(t.getEnglishDate()), e), Wt = (t, e) => R(t.getDay(), e), He = (t, e) => e === ne ? Nt[t.getDay()] : Ce[t.getDay()], Vt = (t, e) => e === ne ? Ht[t.getDay()] : We[t.getDay()], Ut = (t, e) => R(t.getHours(), e), Jt = (t, e) => R(G(t.getHours()), e), Gt = (t, e) => {
671
- const a = t.getHours(), s = a > 12 ? a - 12 : a;
672
- return R(s, e);
673
- }, Kt = (t, e) => {
674
- const a = t.getHours(), s = a > 12 ? a - 12 : a;
675
- return R(G(s), e);
676
- }, zt = (t, e) => R(t.getMinutes(), e), qt = (t, e) => R(G(t.getMinutes()), e), Xt = (t, e) => R(t.getSeconds(), e), Zt = (t, e) => R(G(t.getSeconds()), e), Qt = (t, e) => R(Lt(t.getMilliseconds()), e), en = (t, e) => e === ne ? t.getHours() >= 12 ? "पिम" : "एम" : t.getHours() >= 12 ? "PM" : "AM", tn = (t, e) => e === ne ? t.getHours() >= 12 ? "पिम" : "एम" : t.getHours() >= 12 ? "pm" : "am", Et = { YY: Kn, YYYY: zn, M: Zn, MM: Qn, MMM: er, MMMM: tr, D: or, DD: ir, d: Wt, dd: He, ddd: He, dddd: Vt, H: Ut, HH: Jt, h: Gt, hh: Kt, m: zt, mm: qt, s: Xt, ss: Zt, SSS: Qt, A: en, a: tn }, nn = (t, e, a) => {
677
- const s = Ve(e), r = (o) => o in Et ? Et[o](t, a) : o;
678
- return s.map(r).join("");
679
- }, lr = (t, e) => nn(t, e, Ft), dr = (t, e) => nn(t, e, ne), hr = (t) => {
680
- const e = G(t.getYear()), a = G(t.getMonth() + 1), s = G(t.getDate()), r = G(t.getHours()), o = G(t.getMinutes()), i = G(t.getSeconds()), l = t.getMilliseconds(), c = l === 0 ? "" : `.${Lt(l)}`;
681
- return `${e}-${a}-${s} ${r}:${o}:${i}${c}`;
682
- }, Mt = { YY: qn, YYYY: Xn, M: nr, MM: rr, MMM: ar, MMMM: sr, D: ur, DD: cr, d: Wt, dd: He, ddd: He, dddd: Vt, H: Ut, HH: Jt, h: Gt, hh: Kt, m: zt, mm: qt, s: Xt, ss: Zt, SSS: Qt, A: en, a: tn }, rn = (t, e, a) => {
683
- const s = Ve(e), r = (o) => o in Mt ? Mt[o](t, a) : o;
684
- return s.map(r).join("");
685
- }, fr = (t, e) => rn(t, e, Ft), gr = (t, e) => rn(t, e, ne);
686
- function mr(t) {
687
- const e = t.split(/[-./]/, 3), [a, s = 1, r = 1] = e.map((o) => {
688
- const i = parseInt(o, 10);
689
- if (Number.isNaN(i)) throw new Error("Invalid date");
690
- return i;
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);
76
+ function e3(e) {
77
+ const t = e.split(/[-./]/, 3), [a, s = 1, n = 1] = t.map((r) => {
78
+ const o = parseInt(r, 10);
79
+ if (Number.isNaN(o)) throw new Error("Invalid date");
80
+ return o;
691
81
  });
692
- return [a, s - 1, r];
82
+ return [a, s - 1, n];
693
83
  }
694
- function yr(t) {
695
- if (!t) return [0, 0, 0, 0];
696
- const [e, a = "0"] = t.split(".", 2), s = e.split(":", 3), [r, o = 0, i = 0] = s.map((c) => {
697
- const d = parseInt(c, 10);
698
- if (Number.isNaN(d)) throw new Error("Invalid time");
699
- return d;
84
+ function n3(e) {
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;
700
90
  });
701
- let l = parseInt(a, 10);
702
- return Number.isNaN(l) && (l = 0), [r, o, i, l];
91
+ let u = parseInt(a, 10);
92
+ return Number.isNaN(u) && (u = 0), [n, r, o, u];
703
93
  }
704
- function pr(t) {
705
- const [e, a] = t.split(" ", 2), [s, r, o] = mr(e), [i, l, c, d] = yr(a);
706
- return [s, r, o, i, l, c, d];
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];
707
97
  }
708
- const _t = { 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: re(Le), MMM: re(Qe), dddd: re(We), ddd: re(Ce), dd: re(Ce), d: /([0-6])/ };
709
- function vr(t) {
710
- const e = [], a = [];
711
- for (const r of t) r in _t ? (e.push(r), a.push(_t[r].source)) : a.push(r.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
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
+ 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, "\\$&"));
712
102
  const s = a.join("");
713
- return { dateTokens: e, regex: new RegExp(`^${s}$`) };
103
+ return { dateTokens: t, regex: new RegExp(`^${s}$`) };
714
104
  }
715
- function Dr(t, e) {
716
- let [a, s, r, o, i, l, c, d] = [0, 1, 1, 0, 0, 0, 0, 0], h = !1, m = !1;
717
- for (let y = 0; y < t.length; y++) {
718
- const j = t[y], S = parseInt(e[y + 1]);
719
- switch (j) {
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;
107
+ for (let d = 0; d < e.length; d++) {
108
+ const k = e[d], y = parseInt(t[d + 1]);
109
+ switch (k) {
720
110
  case "YYYY":
721
- a = S;
111
+ a = y;
722
112
  break;
723
113
  case "YY":
724
- a = 2e3 + parseInt(e[y]);
114
+ a = 2e3 + parseInt(t[d]);
725
115
  break;
726
116
  case "MM":
727
117
  case "M":
728
- s = S;
118
+ s = y;
729
119
  break;
730
120
  case "MMMM":
731
- s = Le.indexOf(e[y + 1]) + 1;
121
+ s = pt.indexOf(t[d + 1]) + 1;
732
122
  break;
733
123
  case "MMM":
734
- s = Qe.indexOf(e[y + 1]) + 1;
124
+ s = wt.indexOf(t[d + 1]) + 1;
735
125
  break;
736
126
  case "DD":
737
127
  case "D":
738
- r = S;
128
+ n = y;
739
129
  break;
740
130
  case "HH":
741
131
  case "H":
742
- o = S;
132
+ r = y;
743
133
  break;
744
134
  case "hh":
745
135
  case "h":
746
- i = S, m = !0;
136
+ o = y, m = !0;
747
137
  break;
748
138
  case "mm":
749
139
  case "m":
750
- l = S;
140
+ u = y;
751
141
  break;
752
142
  case "ss":
753
143
  case "s":
754
- c = S;
144
+ i = y;
755
145
  break;
756
146
  case "SSS":
757
- d = S;
147
+ c = y;
758
148
  break;
759
149
  case "A":
760
150
  case "a":
761
- h = e[y + 1].toLowerCase() === "pm";
151
+ l = t[d + 1].toLowerCase() === "pm";
762
152
  }
763
153
  }
764
- return m && (o = i + (h ? 12 : 0)), { year: a, month0: s - 1, day: r, hour: o, minute: l, second: c, ms: d };
154
+ return m && (r = o + (l ? 12 : 0)), { year: a, month0: s - 1, day: n, hour: r, minute: u, second: i, ms: c };
765
155
  }
766
- function an(t, e) {
767
- const a = Ve(e), { dateTokens: s, regex: r } = vr(a), o = RegExp(r).exec(t);
768
- if (!o) throw new Error("Invalid date format");
769
- const { year: i, month0: l, day: c, hour: d, minute: h, second: m, ms: y } = Dr(s, o);
770
- return [i, l, c, d, h, m, y];
156
+ function de(e, t) {
157
+ const a = bt(t), { dateTokens: s, regex: n } = s3(a), r = RegExp(n).exec(e);
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];
771
161
  }
772
- const xt = { 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: re(et), MMM: re(tt), dddd: re(We), ddd: re(Ce), dd: re(Ce), d: /([0-6])/ };
773
- function br(t) {
774
- const e = [], a = [];
775
- for (const r of t) r in xt ? (e.push(r), a.push(xt[r].source)) : a.push(r.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
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])/ };
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, "\\$&"));
776
166
  const s = a.join("");
777
- return { dateTokens: e, regex: new RegExp(`^${s}$`) };
167
+ return { dateTokens: t, regex: new RegExp(`^${s}$`) };
778
168
  }
779
- function Sr(t, e) {
780
- let [a, s, r, o, i, l, c, d] = [0, 1, 1, 0, 0, 0, 0, 0], h = !1, m = !1;
781
- for (let y = 0; y < t.length; y++) {
782
- const j = t[y], S = parseInt(e[y + 1]);
783
- switch (j) {
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;
171
+ for (let d = 0; d < e.length; d++) {
172
+ const k = e[d], y = parseInt(t[d + 1]);
173
+ switch (k) {
784
174
  case "YYYY":
785
- a = S;
175
+ a = y;
786
176
  break;
787
177
  case "YY":
788
- a = 2e3 + parseInt(e[y]);
178
+ a = 2e3 + parseInt(t[d]);
789
179
  break;
790
180
  case "MM":
791
181
  case "M":
792
- s = S;
182
+ s = y;
793
183
  break;
794
184
  case "MMMM":
795
- s = et.indexOf(e[y + 1]) + 1;
185
+ s = _t.indexOf(t[d + 1]) + 1;
796
186
  break;
797
187
  case "MMM":
798
- s = tt.indexOf(e[y + 1]) + 1;
188
+ s = vt.indexOf(t[d + 1]) + 1;
799
189
  break;
800
190
  case "DD":
801
191
  case "D":
802
- r = S;
192
+ n = y;
803
193
  break;
804
194
  case "HH":
805
195
  case "H":
806
- o = S;
196
+ r = y;
807
197
  break;
808
198
  case "hh":
809
199
  case "h":
810
- i = S, m = !0;
200
+ o = y, m = !0;
811
201
  break;
812
202
  case "mm":
813
203
  case "m":
814
- l = S;
204
+ u = y;
815
205
  break;
816
206
  case "ss":
817
207
  case "s":
818
- c = S;
208
+ i = y;
819
209
  break;
820
210
  case "SSS":
821
- d = S;
211
+ c = y;
822
212
  break;
823
213
  case "A":
824
214
  case "a":
825
- h = e[y + 1].toLowerCase() === "pm";
215
+ l = t[d + 1].toLowerCase() === "pm";
826
216
  }
827
217
  }
828
- return m && (o = i + (h ? 12 : 0)), { year: a, month0: s - 1, day: r, hour: o, minute: l, second: c, ms: d };
218
+ return m && (r = o + (l ? 12 : 0)), { year: a, month0: s - 1, day: n, hour: r, minute: u, second: i, ms: c };
829
219
  }
830
- function Er(t, e) {
831
- const a = Ve(e), { dateTokens: s, regex: r } = br(a), o = RegExp(r).exec(t);
832
- if (!o) throw new Error("Invalid date format");
833
- const { year: i, month0: l, day: c, hour: d, minute: h, second: m, ms: y } = Sr(s, o);
834
- return [i, l, c, d, h, m, y];
220
+ function u3(e, t) {
221
+ const a = bt(t), { dateTokens: s, regex: n } = o3(a), r = RegExp(n).exec(e);
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];
835
225
  }
836
- function Mr(t) {
837
- const e = { एम: "AM", पिम: "PM" };
838
- It.forEach((s, r) => e[s] = Le[r]), Ht.forEach((s, r) => e[s] = We[r]), Nt.forEach((s, r) => e[s] = Ce[r]), Bt.forEach((s, r) => e[s] = String(r));
839
- const a = new RegExp(Object.keys(e).join("|"), "g");
840
- return t.replace(a, (s) => e[s]);
226
+ function c3(e) {
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]);
841
231
  }
842
- function _r(t, e) {
843
- const a = Mr(t);
844
- return an(a, e);
232
+ function l3(e, t) {
233
+ const a = c3(e);
234
+ return de(a, t);
845
235
  }
846
- class Ue extends Error {
847
- constructor(e) {
848
- super(e), this.name = "ValidationError";
236
+ class Et extends Error {
237
+ constructor(t) {
238
+ super(t), this.name = "ValidationError";
849
239
  }
850
240
  }
851
- const xr = (t) => {
852
- if (t < 0 || t > 23) throw new Ue("Hour should be in the range 0-23");
853
- }, kr = (t) => {
854
- if (t < 0 || t > 59) throw new Ue("Minute should be in the range 0-59");
855
- }, wr = (t) => {
856
- if (t < 0 || t > 59) throw new Ue("Second should be in the range 0-59");
857
- }, Cr = (t) => {
858
- if (t < 0 || t > 999) throw new Ue("Millisecond should be in the range 0-999");
859
- }, Yr = (t, e, a, s) => {
860
- xr(t), kr(e), wr(a), Cr(s);
241
+ const h3 = (e) => {
242
+ if (e < 0 || e > 23) throw new Et("Hour should be in the range 0-23");
243
+ }, d3 = (e) => {
244
+ if (e < 0 || e > 59) throw new Et("Minute should be in the range 0-59");
245
+ }, g3 = (e) => {
246
+ if (e < 0 || e > 59) throw new Et("Second should be in the range 0-59");
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);
861
251
  };
862
- class I {
252
+ class E {
863
253
  timestamp;
864
254
  year;
865
255
  yearEn;
@@ -870,45 +260,45 @@ class I {
870
260
  hour;
871
261
  minute;
872
262
  weekDay;
873
- constructor(...e) {
874
- if (e.length === 0) this.initFromCurrentDate();
875
- else if (e.length === 1 && e[0] instanceof Date) this.initFromEnglishDate(e[0]);
876
- else if (e.length === 1 && e[0] instanceof I) this.initFromNepaliDate(e[0]);
877
- else if (e.length === 1 && typeof e[0] == "string") this.parseFromString(e[0]);
878
- else if (e.length === 1 && typeof e[0] == "number") this.initFromTimestamp(e[0]);
879
- else if (e.length === 2 && typeof e[0] == "string" && typeof e[1] == "string") this.parseFromStringWithFormat(e[0], e[1]);
880
- else if (e.length >= 2 && e.length <= 8 && e.every((a) => typeof a == "number")) this.initFromComponents(e);
263
+ constructor(...t) {
264
+ if (t.length === 0) this.initFromCurrentDate();
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]);
267
+ else if (t.length === 1 && typeof t[0] == "string") this.parseFromString(t[0]);
268
+ else if (t.length === 1 && typeof t[0] == "number") this.initFromTimestamp(t[0]);
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);
881
271
  else throw new Error("Invalid date argument");
882
272
  }
883
273
  initFromCurrentDate() {
884
274
  this._setDateObject(/* @__PURE__ */ new Date());
885
275
  }
886
- initFromEnglishDate(e) {
887
- this._setDateObject(e);
276
+ initFromEnglishDate(t) {
277
+ this._setDateObject(t);
888
278
  }
889
- initFromNepaliDate(e) {
890
- this.set(e.year, e.month, e.day, e.hour, e.minute, e.getSeconds(), e.getMilliseconds());
279
+ initFromNepaliDate(t) {
280
+ this.set(t.year, t.month, t.day, t.hour, t.minute, t.getSeconds(), t.getMilliseconds());
891
281
  }
892
- parseFromString(e) {
893
- const a = pr(e);
282
+ parseFromString(t) {
283
+ const a = a3(t);
894
284
  this.set(a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
895
285
  }
896
- initFromTimestamp(e) {
897
- this._setDateObject(new Date(e));
286
+ initFromTimestamp(t) {
287
+ this._setDateObject(new Date(t));
898
288
  }
899
- parseFromStringWithFormat(e, a) {
900
- const s = an(e, a);
289
+ parseFromStringWithFormat(t, a) {
290
+ const s = de(t, a);
901
291
  this.set(s[0], s[1], s[2], s[3], s[4], s[5], s[6]);
902
292
  }
903
- initFromComponents(e) {
904
- this.set(e[0], e[1], e[2] ?? 1, e[3] ?? 0, e[4] ?? 0, e[5] ?? 0, e[6] ?? 0);
293
+ initFromComponents(t) {
294
+ this.set(t[0], t[1], t[2] ?? 1, t[3] ?? 0, t[4] ?? 0, t[5] ?? 0, t[6] ?? 0);
905
295
  }
906
- _setDateObject(e, a = !0) {
907
- this.timestamp = e;
908
- const { year: s, month0: r, day: o, hour: i, minute: l, weekDay: c } = Jn(e);
909
- if (this.yearEn = s, this.monthEn = r, this.dayEn = o, this.hour = i, this.minute = l, this.weekDay = c, a) {
910
- const [d, h, m] = se.englishToNepali(s, r, o);
911
- this.year = d, this.month = h, this.day = m;
296
+ _setDateObject(t, a = !0) {
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;
912
302
  }
913
303
  }
914
304
  getDateObject() {
@@ -950,82 +340,82 @@ class I {
950
340
  getTime() {
951
341
  return this.timestamp.getTime();
952
342
  }
953
- setYear(e) {
954
- this.set(e, this.month, this.day, this.hour, this.minute, this.timestamp.getSeconds(), this.timestamp.getMilliseconds());
343
+ setYear(t) {
344
+ this.set(t, this.month, this.day, this.hour, this.minute, this.timestamp.getSeconds(), this.timestamp.getMilliseconds());
955
345
  }
956
- setMonth(e) {
957
- this.set(this.year, e, this.day, this.hour, this.minute, this.timestamp.getSeconds(), this.timestamp.getMilliseconds());
346
+ setMonth(t) {
347
+ this.set(this.year, t, this.day, this.hour, this.minute, this.timestamp.getSeconds(), this.timestamp.getMilliseconds());
958
348
  }
959
- setDate(e) {
960
- this.set(this.year, this.month, e, this.hour, this.minute, this.timestamp.getSeconds(), this.timestamp.getMilliseconds());
349
+ setDate(t) {
350
+ this.set(this.year, this.month, t, this.hour, this.minute, this.timestamp.getSeconds(), this.timestamp.getMilliseconds());
961
351
  }
962
- setHours(e) {
963
- this.set(this.year, this.month, this.day, e, this.minute, this.timestamp.getSeconds(), this.timestamp.getMilliseconds());
352
+ setHours(t) {
353
+ this.set(this.year, this.month, this.day, t, this.minute, this.timestamp.getSeconds(), this.timestamp.getMilliseconds());
964
354
  }
965
- setMinutes(e) {
966
- this.set(this.year, this.month, this.day, this.hour, e, this.timestamp.getSeconds(), this.timestamp.getMilliseconds());
355
+ setMinutes(t) {
356
+ this.set(this.year, this.month, this.day, this.hour, t, this.timestamp.getSeconds(), this.timestamp.getMilliseconds());
967
357
  }
968
- setSeconds(e) {
969
- this.set(this.year, this.month, this.day, this.hour, this.minute, e, this.timestamp.getMilliseconds());
358
+ setSeconds(t) {
359
+ this.set(this.year, this.month, this.day, this.hour, this.minute, t, this.timestamp.getMilliseconds());
970
360
  }
971
- setMilliseconds(e) {
972
- this.set(this.year, this.month, this.day, this.hour, this.minute, this.timestamp.getSeconds(), e);
361
+ setMilliseconds(t) {
362
+ this.set(this.year, this.month, this.day, this.hour, this.minute, this.timestamp.getSeconds(), t);
973
363
  }
974
- setTime(e) {
975
- this._setDateObject(new Date(e));
364
+ setTime(t) {
365
+ this._setDateObject(new Date(t));
976
366
  }
977
- set(e, a, s, r, o, i, l) {
978
- Yr(r, o, i, l);
979
- const [c, d, h] = se.nepaliToEnglish(e, a, s);
980
- this.year = e, this.month = a, this.day = s, this._setDateObject(St(c, d, h, r, o, i, l), !1);
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);
981
371
  }
982
- setDateObject(e) {
983
- this._setDateObject(e, !0);
372
+ setDateObject(t) {
373
+ this._setDateObject(t, !0);
984
374
  }
985
- format(e) {
986
- return lr(this, e);
375
+ format(t) {
376
+ return Xe(this, t);
987
377
  }
988
- formatNepali(e) {
989
- return dr(this, e);
378
+ formatNepali(t) {
379
+ return Ze(this, t);
990
380
  }
991
381
  toString() {
992
- return hr(this);
382
+ return qe(this);
993
383
  }
994
- formatEnglishDate(e) {
995
- return fr(this, e);
384
+ formatEnglishDate(t) {
385
+ return Qe(this, t);
996
386
  }
997
- formatEnglishDateInNepali(e) {
998
- return gr(this, e);
387
+ formatEnglishDateInNepali(t) {
388
+ return t3(this, t);
999
389
  }
1000
- static fromEnglishDate(e, a, s, r = 0, o = 0, i = 0, l = 0) {
1001
- const c = St(e, a, s, r, o, i, l);
1002
- return new I(c);
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);
1003
393
  }
1004
- static parseNepaliFormat(e, a) {
1005
- const [s, r, o, i, l, c, d] = _r(e, a);
1006
- return new I(s, r, o, i, l, c, d);
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);
1007
397
  }
1008
- static parseEnglishDate(e, a) {
1009
- const [s, r, o, i, l, c, d] = Er(e, a);
1010
- return I.fromEnglishDate(s, r, o, i, l, c, d);
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);
1011
401
  }
1012
- static getDaysOfMonth(e, a) {
1013
- if (e < se.npMinYear() || e > se.npMaxYear()) throw new Error("Year out of range");
402
+ static getDaysOfMonth(t, a) {
403
+ if (t < P.npMinYear() || t > P.npMaxYear()) throw new Error("Year out of range");
1014
404
  if (a < 0 || a > 11) throw new Error("Month out of range");
1015
- return ae[e - se.npMinYear()][0][a];
405
+ return j[t - P.npMinYear()][0][a];
1016
406
  }
1017
407
  static minSupportedDate() {
1018
- return I.fromEnglishDate(se.enMinYear(), 0, 1).getDateObject();
408
+ return E.fromEnglishDate(P.enMinYear(), 0, 1).getDateObject();
1019
409
  }
1020
410
  static maxSupportedDate() {
1021
- return I.fromEnglishDate(se.enMaxYear(), 11, 31).getDateObject();
411
+ return E.fromEnglishDate(P.enMaxYear(), 11, 31).getDateObject();
1022
412
  }
1023
413
  static minSupportedNepaliDate() {
1024
- return new I(se.npMinYear(), 0, 1);
414
+ return new E(P.npMinYear(), 0, 1);
1025
415
  }
1026
416
  static maxSupportedNepaliDate() {
1027
- const e = se.npMaxYear();
1028
- return new I(e, 11, this.getDaysOfMonth(e, 11));
417
+ const t = P.npMaxYear();
418
+ return new E(t, 11, this.getDaysOfMonth(t, 11));
1029
419
  }
1030
420
  static minimum() {
1031
421
  return console.warn("`NepaliDate.minimum()` is deprecated and will be removed in a future version. Please use `NepaliDate.minSupportedDate()` instead."), this.minSupportedDate();
@@ -1034,7 +424,7 @@ class I {
1034
424
  return console.warn("`NepaliDate.maximum()` is deprecated and will be removed in a future version. Please use `NepaliDate.maxSupportedDate()` instead."), this.maxSupportedDate();
1035
425
  }
1036
426
  }
1037
- const jr = [
427
+ const f3 = [
1038
428
  "बैशाख",
1039
429
  "जेठ",
1040
430
  "आषाढ",
@@ -1047,7 +437,7 @@ const jr = [
1047
437
  "माघ",
1048
438
  "फाल्गुन",
1049
439
  "चैत्र"
1050
- ], sn = [
440
+ ], ge = [
1051
441
  "Baishakh",
1052
442
  "Jestha",
1053
443
  "Ashadh",
@@ -1060,7 +450,7 @@ const jr = [
1060
450
  "Magh",
1061
451
  "Falgun",
1062
452
  "Chaitra"
1063
- ], Rr = [
453
+ ], D3 = [
1064
454
  "January",
1065
455
  "February",
1066
456
  "March",
@@ -1073,7 +463,7 @@ const jr = [
1073
463
  "October",
1074
464
  "November",
1075
465
  "December"
1076
- ], Tr = ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"], Or = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Ar = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], pa = {
466
+ ], M3 = ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"], p3 = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], S3 = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], on = {
1077
467
  light: {
1078
468
  primary: "#3b82f6",
1079
469
  background: "#ffffff",
@@ -1094,220 +484,220 @@ const jr = [
1094
484
  today: "#1e40af",
1095
485
  disabled: "#6b7280"
1096
486
  }
1097
- }, de = (t) => t.toString().split("").map((e) => Ar[parseInt(e)]).join(""), on = (t, e, a) => {
1098
- if (t === "BS")
487
+ }, W = (e) => e.toString().split("").map((t) => S3[parseInt(t)]).join(""), me = (e, t, a) => {
488
+ if (e === "BS")
1099
489
  try {
1100
- const s = a === 11 ? new I(e + 1, 0, 1) : new I(e, a + 1, 1);
1101
- return new I(s.getTime() - 1440 * 60 * 1e3).getDate();
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();
1102
492
  } catch {
1103
493
  return 30;
1104
494
  }
1105
- return new Date(e, a + 1, 0).getDate();
1106
- }, Fr = (t, e, a) => {
1107
- if (t === "BS")
495
+ return new Date(t, a + 1, 0).getDate();
496
+ }, b3 = (e, t, a) => {
497
+ if (e === "BS")
1108
498
  try {
1109
- return new I(e, a, 1).getDay() || 0;
499
+ return new E(t, a, 1).getDay() || 0;
1110
500
  } catch {
1111
501
  return 0;
1112
502
  }
1113
- return new Date(e, a, 1).getDay();
1114
- }, z = (t) => {
1115
- const e = /* @__PURE__ */ new Date();
1116
- if (t === "BS")
503
+ return new Date(t, a, 1).getDay();
504
+ }, H = (e) => {
505
+ const t = /* @__PURE__ */ new Date();
506
+ if (e === "BS")
1117
507
  try {
1118
- const a = I.fromEnglishDate(e.getFullYear(), e.getMonth(), e.getDate());
508
+ const a = E.fromEnglishDate(t.getFullYear(), t.getMonth(), t.getDate());
1119
509
  return { year: a.getYear(), month: a.getMonth(), day: a.getDate() };
1120
510
  } catch {
1121
511
  return { year: 2081, month: 0, day: 1 };
1122
512
  }
1123
- return { year: e.getFullYear(), month: e.getMonth(), day: e.getDate() };
1124
- }, $r = (t, e, a, s, r) => {
1125
- if (t === "BS")
513
+ return { year: t.getFullYear(), month: t.getMonth(), day: t.getDate() };
514
+ }, E3 = (e, t, a, s, n) => {
515
+ if (e === "BS")
1126
516
  try {
1127
- const o = new I(e, a, s), l = new Date(
1128
- o.getEnglishYear(),
1129
- o.getEnglishMonth(),
1130
- o.getEnglishDate()
517
+ const r = new E(t, a, s), u = new Date(
518
+ r.getEnglishYear(),
519
+ r.getEnglishMonth(),
520
+ r.getEnglishDate()
1131
521
  ).toISOString().split("T")[0];
1132
522
  return {
1133
- bs: `${e}-${String(a + 1).padStart(2, "0")}-${String(s).padStart(2, "0")}`,
1134
- ad: l,
523
+ bs: `${t}-${String(a + 1).padStart(2, "0")}-${String(s).padStart(2, "0")}`,
524
+ ad: u,
1135
525
  formatted: {
1136
- bs: `${r[a]} ${s}, ${e}`,
526
+ bs: `${n[a]} ${s}, ${t}`,
1137
527
  ad: new Date(
1138
- o.getEnglishYear(),
1139
- o.getEnglishMonth(),
1140
- o.getEnglishDate()
528
+ r.getEnglishYear(),
529
+ r.getEnglishMonth(),
530
+ r.getEnglishDate()
1141
531
  ).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric" })
1142
532
  }
1143
533
  };
1144
534
  } catch {
1145
- const o = `${e}-${String(a + 1).padStart(2, "0")}-${String(s).padStart(2, "0")}`;
535
+ const r = `${t}-${String(a + 1).padStart(2, "0")}-${String(s).padStart(2, "0")}`;
1146
536
  return {
1147
- bs: o,
1148
- ad: o,
537
+ bs: r,
538
+ ad: r,
1149
539
  formatted: {
1150
- bs: `${r[a]} ${s}, ${e}`,
1151
- ad: `${r[a]} ${s}, ${e}`
540
+ bs: `${n[a]} ${s}, ${t}`,
541
+ ad: `${n[a]} ${s}, ${t}`
1152
542
  }
1153
543
  };
1154
544
  }
1155
545
  else {
1156
- const o = new Date(e, a, s), i = o.toISOString().split("T")[0];
546
+ const r = new Date(t, a, s), o = r.toISOString().split("T")[0];
1157
547
  try {
1158
- const l = I.fromEnglishDate(e, a, s), c = `${l.getYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}`;
548
+ const u = E.fromEnglishDate(t, a, s), i = `${u.getYear()}-${String(u.getMonth() + 1).padStart(2, "0")}-${String(u.getDate()).padStart(2, "0")}`;
1159
549
  return {
1160
- ad: i,
1161
- bs: c,
550
+ ad: o,
551
+ bs: i,
1162
552
  formatted: {
1163
- ad: o.toLocaleDateString("en-US", {
553
+ ad: r.toLocaleDateString("en-US", {
1164
554
  year: "numeric",
1165
555
  month: "long",
1166
556
  day: "numeric"
1167
557
  }),
1168
- bs: `${sn[l.getMonth()]} ${l.getDate()}, ${l.getYear()}`
558
+ bs: `${ge[u.getMonth()]} ${u.getDate()}, ${u.getYear()}`
1169
559
  }
1170
560
  };
1171
561
  } catch {
1172
562
  return {
1173
- ad: i,
1174
- bs: i,
563
+ ad: o,
564
+ bs: o,
1175
565
  formatted: {
1176
- ad: o.toLocaleDateString("en-US", {
566
+ ad: r.toLocaleDateString("en-US", {
1177
567
  year: "numeric",
1178
568
  month: "long",
1179
569
  day: "numeric"
1180
570
  }),
1181
- bs: o.toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric" })
571
+ bs: r.toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric" })
1182
572
  }
1183
573
  };
1184
574
  }
1185
575
  }
1186
- }, va = (t, e, a) => {
1187
- const s = new Date(t.year, t.month, t.day).getTime(), r = new Date(e.year, e.month, e.day).getTime(), o = new Date(a.year, a.month, a.day).getTime();
1188
- return s >= r && s <= o;
1189
- }, kt = (t) => {
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) => {
1190
580
  try {
1191
- const [e, a, s] = t.split("-").map(Number);
1192
- return !e || !a || !s ? null : { year: e, month: a - 1, day: s };
581
+ const [t, a, s] = e.split("-").map(Number);
582
+ return !t || !a || !s ? null : { year: t, month: a - 1, day: s };
1193
583
  } catch {
1194
584
  return null;
1195
585
  }
1196
- }, Re = (t, e, a) => {
1197
- if (!e && !a) return !1;
1198
- const s = new Date(t.year, t.month, t.day).getTime();
1199
- if (e) {
1200
- const r = kt(e);
1201
- if (r) {
1202
- const o = new Date(r.year, r.month, r.day).getTime();
1203
- if (s < o) return !0;
586
+ }, tt = (e, t, a) => {
587
+ if (!t && !a) return !1;
588
+ const s = new Date(e.year, e.month, e.day).getTime();
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;
1204
594
  }
1205
595
  }
1206
596
  if (a) {
1207
- const r = kt(a);
1208
- if (r) {
1209
- const o = new Date(r.year, r.month, r.day).getTime();
1210
- if (s > o) return !0;
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;
1211
601
  }
1212
602
  }
1213
603
  return !1;
1214
- }, Pr = (t = "AD") => {
1215
- const e = yt(() => z(t), [t]), [a, s] = te(e.year), [r, o] = te(e.month), [i, l] = te(null), [c, d] = te(null), [h, m] = te(null);
1216
- Ct(() => {
1217
- s(e.year), o(e.month);
1218
- }, [e.year, e.month]);
1219
- const y = yt(() => {
1220
- const C = on(t, a, r), _ = Fr(t, a, r), Y = [];
1221
- for (let F = 0; F < _; F++)
1222
- Y.push(null);
1223
- for (let F = 1; F <= C; F++)
1224
- Y.push(F);
1225
- return Y;
1226
- }, [a, r, t]);
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);
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; _++)
612
+ p.push(null);
613
+ for (let _ = 1; _ <= w; _++)
614
+ p.push(_);
615
+ return p;
616
+ }, [a, n, e]);
1227
617
  return {
1228
618
  // State
1229
619
  currentYear: a,
1230
- currentMonth: r,
1231
- selectedDate: i,
1232
- rangeStart: c,
1233
- rangeEnd: h,
1234
- today: e,
1235
- calendarDays: y,
620
+ currentMonth: n,
621
+ selectedDate: o,
622
+ rangeStart: i,
623
+ rangeEnd: l,
624
+ today: t,
625
+ calendarDays: d,
1236
626
  // Actions
1237
627
  setCurrentYear: s,
1238
- setCurrentMonth: o,
1239
- setSelectedDate: l,
1240
- setRangeStart: d,
628
+ setCurrentMonth: r,
629
+ setSelectedDate: u,
630
+ setRangeStart: c,
1241
631
  setRangeEnd: m,
1242
- navigateMonth: (C) => {
1243
- let Y = r + C, F = a;
1244
- for (; Y > 11; )
1245
- Y -= 12, F += 1;
1246
- for (; Y < 0; )
1247
- Y += 12, F -= 1;
1248
- o(Y), s(F);
632
+ navigateMonth: (w) => {
633
+ let p = n + w, _ = a;
634
+ for (; p > 11; )
635
+ p -= 12, _ += 1;
636
+ for (; p < 0; )
637
+ p += 12, _ -= 1;
638
+ r(p), s(_);
1249
639
  },
1250
640
  // Helpers
1251
- isToday: (C) => a === e.year && r === e.month && C === e.day,
1252
- isSelected: (C, _ = "single") => _ === "range" ? !!(c && c.year === a && c.month === r && c.day === C) || !!(h && h.year === a && h.month === r && h.day === C) : !!(i && i.year === a && i.month === r && i.day === C),
1253
- isInRange: (C) => {
1254
- if (!c || !h) return !1;
1255
- const _ = new Date(a, r, C).getTime(), Y = new Date(c.year, c.month, c.day).getTime(), F = new Date(h.year, h.month, h.day).getTime();
1256
- return _ >= Y && _ <= F;
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 <= _;
1257
647
  }
1258
648
  };
1259
- }, ke = (t, e, a) => {
649
+ }, G = (e, t, a) => {
1260
650
  if (a === "BS")
1261
651
  try {
1262
- const s = new I(t.year, t.month, t.day), r = new Date(
652
+ const s = new E(e.year, e.month, e.day), n = new Date(
1263
653
  s.getEnglishYear(),
1264
654
  s.getEnglishMonth(),
1265
655
  s.getEnglishDate()
1266
656
  );
1267
- r.setDate(r.getDate() + e);
1268
- const o = I.fromEnglishDate(
1269
- r.getFullYear(),
1270
- r.getMonth(),
1271
- r.getDate()
657
+ n.setDate(n.getDate() + t);
658
+ const r = E.fromEnglishDate(
659
+ n.getFullYear(),
660
+ n.getMonth(),
661
+ n.getDate()
1272
662
  );
1273
- return { year: o.getYear(), month: o.getMonth(), day: o.getDate() };
663
+ return { year: r.getYear(), month: r.getMonth(), day: r.getDate() };
1274
664
  } catch {
1275
- return t;
665
+ return e;
1276
666
  }
1277
667
  else {
1278
- const s = new Date(t.year, t.month, t.day);
1279
- return s.setDate(s.getDate() + e), { year: s.getFullYear(), month: s.getMonth(), day: s.getDate() };
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() };
1280
670
  }
1281
- }, Fe = (t, e, a) => {
671
+ }, dt = (e, t, a) => {
1282
672
  if (a === "BS")
1283
673
  try {
1284
- let s = t.year, r = t.month + e;
1285
- for (; r < 0; )
1286
- s -= 1, r += 12;
1287
- for (; r >= 12; )
1288
- s += 1, r -= 12;
1289
- const o = on("BS", s, r), i = Math.min(t.day, o);
1290
- return { year: s, month: r, day: i };
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 };
1291
681
  } catch {
1292
- return t;
682
+ return e;
1293
683
  }
1294
684
  else {
1295
- const s = new Date(t.year, t.month, t.day);
1296
- return s.setMonth(s.getMonth() + e), { year: s.getFullYear(), month: s.getMonth(), day: s.getDate() };
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() };
1297
687
  }
1298
- }, ve = (t) => ({ year: t.year, month: t.month, day: 1 }), Ir = (t, e) => {
1299
- if (e === "BS")
688
+ }, V = (e) => ({ year: e.year, month: e.month, day: 1 }), Y3 = (e, t) => {
689
+ if (t === "BS")
1300
690
  try {
1301
- const s = new I(t.year, t.month, t.day).getDay();
1302
- return ke(t, -s, "BS");
691
+ const s = new E(e.year, e.month, e.day).getDay();
692
+ return G(e, -s, "BS");
1303
693
  } catch {
1304
- return t;
694
+ return e;
1305
695
  }
1306
696
  else {
1307
- const a = new Date(t.year, t.month, t.day), s = a.getDay();
697
+ const a = new Date(e.year, e.month, e.day), s = a.getDay();
1308
698
  return a.setDate(a.getDate() - s), { year: a.getFullYear(), month: a.getMonth(), day: a.getDate() };
1309
699
  }
1310
- }, Da = {
700
+ }, cn = {
1311
701
  TODAY: "today",
1312
702
  YESTERDAY: "yesterday",
1313
703
  THIS_WEEK: "thisWeek",
@@ -1320,644 +710,644 @@ const jr = [
1320
710
  LAST_180_DAYS: "last180days",
1321
711
  LAST_9_MONTHS: "last9months",
1322
712
  LAST_YEAR: "lastYear"
1323
- }, Br = (t, e) => {
713
+ }, w3 = (e, t) => {
1324
714
  const a = [
1325
715
  {
1326
716
  key: "today",
1327
717
  label: "Today",
1328
- getValue: (r) => {
1329
- const o = z(r);
1330
- return { start: o, end: o };
718
+ getValue: (n) => {
719
+ const r = H(n);
720
+ return { start: r, end: r };
1331
721
  }
1332
722
  },
1333
723
  {
1334
724
  key: "yesterday",
1335
725
  label: "Yesterday",
1336
- getValue: (r) => {
1337
- const o = z(r), i = ke(o, -1, r);
1338
- return { start: i, end: i };
726
+ getValue: (n) => {
727
+ const r = H(n), o = G(r, -1, n);
728
+ return { start: o, end: o };
1339
729
  }
1340
730
  },
1341
731
  {
1342
732
  key: "thisWeek",
1343
733
  label: "This Week",
1344
- getValue: (r) => {
1345
- const o = z(r);
1346
- return { start: Ir(o, r), end: o };
734
+ getValue: (n) => {
735
+ const r = H(n);
736
+ return { start: Y3(r, n), end: r };
1347
737
  }
1348
738
  },
1349
739
  {
1350
740
  key: "last7days",
1351
741
  label: "Last 7 Days",
1352
- getValue: (r) => {
1353
- const o = z(r);
1354
- return { start: ke(o, -6, r), end: o };
742
+ getValue: (n) => {
743
+ const r = H(n);
744
+ return { start: G(r, -6, n), end: r };
1355
745
  }
1356
746
  },
1357
747
  {
1358
748
  key: "last30days",
1359
749
  label: "Last 30 Days",
1360
- getValue: (r) => {
1361
- const o = z(r);
1362
- return { start: ke(o, -29, r), end: o };
750
+ getValue: (n) => {
751
+ const r = H(n);
752
+ return { start: G(r, -29, n), end: r };
1363
753
  }
1364
754
  },
1365
755
  {
1366
756
  key: "thisMonth",
1367
757
  label: "This Month",
1368
- getValue: (r) => {
1369
- const o = z(r);
1370
- return { start: ve(o), end: o };
758
+ getValue: (n) => {
759
+ const r = H(n);
760
+ return { start: V(r), end: r };
1371
761
  }
1372
762
  },
1373
763
  {
1374
764
  key: "lastMonth",
1375
765
  label: "Last Month",
1376
- getValue: (r) => {
1377
- const o = z(r), i = ke(ve(o), -1, r);
1378
- return { start: ve(i), end: i };
766
+ getValue: (n) => {
767
+ const r = H(n), o = G(V(r), -1, n);
768
+ return { start: V(o), end: o };
1379
769
  }
1380
770
  },
1381
771
  {
1382
772
  key: "last3months",
1383
773
  label: "Last 3 Months",
1384
- getValue: (r) => {
1385
- const o = z(r), i = Fe(o, -2, r);
1386
- return { start: ve(i), end: o };
774
+ getValue: (n) => {
775
+ const r = H(n), o = dt(r, -2, n);
776
+ return { start: V(o), end: r };
1387
777
  }
1388
778
  },
1389
779
  {
1390
780
  key: "last6months",
1391
781
  label: "Last 6 Months",
1392
- getValue: (r) => {
1393
- const o = z(r), i = Fe(o, -5, r);
1394
- return { start: ve(i), end: o };
782
+ getValue: (n) => {
783
+ const r = H(n), o = dt(r, -5, n);
784
+ return { start: V(o), end: r };
1395
785
  }
1396
786
  },
1397
787
  {
1398
788
  key: "last180days",
1399
789
  label: "Last 180 Days",
1400
- getValue: (r) => {
1401
- const o = z(r);
1402
- return { start: ke(o, -179, r), end: o };
790
+ getValue: (n) => {
791
+ const r = H(n);
792
+ return { start: G(r, -179, n), end: r };
1403
793
  }
1404
794
  },
1405
795
  {
1406
796
  key: "last9months",
1407
797
  label: "Last 9 Months",
1408
- getValue: (r) => {
1409
- const o = z(r), i = Fe(o, -8, r);
1410
- return { start: ve(i), end: o };
798
+ getValue: (n) => {
799
+ const r = H(n), o = dt(r, -8, n);
800
+ return { start: V(o), end: r };
1411
801
  }
1412
802
  },
1413
803
  {
1414
804
  key: "lastYear",
1415
805
  label: "Last Year",
1416
- getValue: (r) => {
1417
- const o = z(r), i = Fe(o, -11, r);
1418
- return { start: ve(i), end: o };
806
+ getValue: (n) => {
807
+ const r = H(n), o = dt(r, -11, n);
808
+ return { start: V(o), end: r };
1419
809
  }
1420
810
  }
1421
- ], s = t ? a.filter((r) => t.includes(r.key)) : a;
1422
- return e ? s.map((r) => ({ ...r, label: e[r.key] || r.label })) : s;
1423
- }, Nr = "_calendar_lve6c_1", Hr = "_grid_lve6c_14", Lr = "_header_lve6c_25", Wr = "_navButton_lve6c_32", Vr = "_monthYear_lve6c_58", Ur = "_pickerOverlay_lve6c_78", Jr = "_pickerContent_lve6c_88", Gr = "_pickerHeader_lve6c_98", Kr = "_closeButton_lve6c_112", zr = "_pickerBody_lve6c_131", qr = "_pickerSection_lve6c_135", Xr = "_pickerSectionHeader_lve6c_151", Zr = "_yearNav_lve6c_162", Qr = "_yearGrid_lve6c_194", ea = "_selected_lve6c_214", ta = "_monthGrid_lve6c_220", na = "_dayHeader_lve6c_252", ra = "_day_lve6c_252", aa = "_dayDisabled_lve6c_273", sa = "_dayOtherMonth_lve6c_273", oa = "_daySelected_lve6c_277", ia = "_dayToday_lve6c_282", ua = "_dayInRange_lve6c_288", M = {
1424
- calendar: Nr,
1425
- grid: Hr,
1426
- header: Lr,
1427
- navButton: Wr,
1428
- monthYear: Vr,
1429
- pickerOverlay: Ur,
1430
- pickerContent: Jr,
1431
- pickerHeader: Gr,
1432
- closeButton: Kr,
1433
- pickerBody: zr,
1434
- pickerSection: qr,
1435
- pickerSectionHeader: Xr,
1436
- yearNav: Zr,
1437
- yearGrid: Qr,
1438
- selected: ea,
1439
- monthGrid: ta,
1440
- dayHeader: na,
1441
- day: ra,
1442
- dayDisabled: aa,
1443
- dayOtherMonth: sa,
1444
- daySelected: oa,
1445
- dayToday: ia,
1446
- dayInRange: ua
1447
- }, ca = ({
1448
- currentYear: t,
1449
- currentMonth: e,
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 = ({
838
+ currentYear: e,
839
+ currentMonth: t,
1450
840
  months: a,
1451
841
  onYearChange: s,
1452
- onMonthChange: r,
1453
- onClose: o,
1454
- showNepaliNumbers: i = !1,
1455
- convertToNepaliNumber: l = (d) => d.toString(),
1456
- calendarType: c
842
+ onMonthChange: n,
843
+ onClose: r,
844
+ showNepaliNumbers: o = !1,
845
+ convertToNepaliNumber: u = (c) => c.toString(),
846
+ calendarType: i
1457
847
  }) => {
1458
- const [d, h] = te(Math.floor(t / 12) * 12), m = c === "BS" ? 2e3 : 1944, y = c === "BS" ? 2100 : 2043;
1459
- return /* @__PURE__ */ g.jsx("div", { className: M.pickerOverlay, onClick: o, children: /* @__PURE__ */ g.jsxs("div", { className: M.pickerContent, onClick: (j) => j.stopPropagation(), children: [
1460
- /* @__PURE__ */ g.jsxs("div", { className: M.pickerHeader, children: [
1461
- /* @__PURE__ */ g.jsx("h3", { children: "Select Month & Year" }),
1462
- /* @__PURE__ */ g.jsx("button", { onClick: o, className: M.closeButton, children: "×" })
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: "×" })
1463
853
  ] }),
1464
- /* @__PURE__ */ g.jsxs("div", { className: M.pickerBody, children: [
1465
- /* @__PURE__ */ g.jsxs("div", { className: M.pickerSection, children: [
1466
- /* @__PURE__ */ g.jsxs("div", { className: M.pickerSectionHeader, children: [
1467
- /* @__PURE__ */ g.jsx("label", { children: "Year" }),
1468
- /* @__PURE__ */ g.jsxs("div", { className: M.yearNav, children: [
1469
- /* @__PURE__ */ g.jsx(
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(
1470
860
  "button",
1471
861
  {
1472
- onClick: () => h(Math.max(m, d - 12)),
1473
- disabled: d <= m,
862
+ onClick: () => l(Math.max(m, c - 12)),
863
+ disabled: c <= m,
1474
864
  children: "«"
1475
865
  }
1476
866
  ),
1477
- /* @__PURE__ */ g.jsxs("span", { children: [
1478
- i ? l(d) : d,
867
+ /* @__PURE__ */ b("span", { children: [
868
+ o ? u(c) : c,
1479
869
  " -",
1480
870
  " ",
1481
- i ? l(d + 11) : d + 11
871
+ o ? u(c + 11) : c + 11
1482
872
  ] }),
1483
- /* @__PURE__ */ g.jsx(
873
+ /* @__PURE__ */ h(
1484
874
  "button",
1485
875
  {
1486
- onClick: () => h(Math.min(y - 11, d + 12)),
1487
- disabled: d + 11 >= y,
876
+ onClick: () => l(Math.min(d - 11, c + 12)),
877
+ disabled: c + 11 >= d,
1488
878
  children: "»"
1489
879
  }
1490
880
  )
1491
881
  ] })
1492
882
  ] }),
1493
- /* @__PURE__ */ g.jsx("div", { className: M.yearGrid, children: Array.from({ length: 12 }, (j, S) => {
1494
- const N = d + S;
1495
- return N > y ? null : /* @__PURE__ */ g.jsx(
883
+ /* @__PURE__ */ h("div", { className: f.yearGrid, children: Array.from({ length: 12 }, (k, y) => {
884
+ const $ = c + y;
885
+ return $ > d ? null : /* @__PURE__ */ h(
1496
886
  "button",
1497
887
  {
1498
- onClick: () => s(N),
1499
- className: N === t ? M.selected : "",
1500
- children: i ? l(N) : N
888
+ onClick: () => s($),
889
+ className: $ === e ? f.selected : "",
890
+ children: o ? u($) : $
1501
891
  },
1502
- N
892
+ $
1503
893
  );
1504
894
  }) })
1505
895
  ] }),
1506
- /* @__PURE__ */ g.jsxs("div", { className: M.pickerSection, children: [
1507
- /* @__PURE__ */ g.jsx("label", { children: "Month" }),
1508
- /* @__PURE__ */ g.jsx("div", { className: M.monthGrid, children: a.map((j, S) => /* @__PURE__ */ g.jsx(
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(
1509
899
  "button",
1510
900
  {
1511
901
  onClick: () => {
1512
- r(S), o();
902
+ n(y), r();
1513
903
  },
1514
- className: S === e ? M.selected : "",
1515
- children: j
904
+ className: y === t ? f.selected : "",
905
+ children: k
1516
906
  },
1517
- S
907
+ y
1518
908
  )) })
1519
909
  ] })
1520
910
  ] })
1521
911
  ] }) });
1522
- }, $e = ({
1523
- currentMonth: t,
1524
- currentYear: e,
912
+ }, gt = ({
913
+ currentMonth: e,
914
+ currentYear: t,
1525
915
  months: a,
1526
916
  onNavigateMonth: s,
1527
- onYearChange: r,
1528
- onMonthChange: o,
1529
- disabled: i = !1,
1530
- showNepaliNumbers: l = !1,
1531
- convertToNepaliNumber: c,
1532
- calendarType: d
917
+ onYearChange: n,
918
+ onMonthChange: r,
919
+ disabled: o = !1,
920
+ showNepaliNumbers: u = !1,
921
+ convertToNepaliNumber: i,
922
+ calendarType: c
1533
923
  }) => {
1534
- const [h, m] = te(!1);
1535
- return /* @__PURE__ */ g.jsxs("div", { className: M.header, children: [
1536
- /* @__PURE__ */ g.jsx(
924
+ const [l, m] = I(!1);
925
+ return /* @__PURE__ */ b("div", { className: f.header, children: [
926
+ /* @__PURE__ */ h(
1537
927
  "button",
1538
928
  {
1539
- className: M.navButton,
929
+ className: f.navButton,
1540
930
  onClick: () => s(-12),
1541
- disabled: i,
931
+ disabled: o,
1542
932
  "aria-label": "Previous year",
1543
933
  title: "Previous year",
1544
934
  children: "«"
1545
935
  }
1546
936
  ),
1547
- /* @__PURE__ */ g.jsx(
937
+ /* @__PURE__ */ h(
1548
938
  "button",
1549
939
  {
1550
- className: M.navButton,
940
+ className: f.navButton,
1551
941
  onClick: () => s(-1),
1552
- disabled: i,
942
+ disabled: o,
1553
943
  "aria-label": "Previous month",
1554
944
  children: "‹"
1555
945
  }
1556
946
  ),
1557
- /* @__PURE__ */ g.jsxs("button", { className: M.monthYear, onClick: () => m(!0), disabled: i, children: [
1558
- a[t],
947
+ /* @__PURE__ */ b("button", { className: f.monthYear, onClick: () => m(!0), disabled: o, children: [
948
+ a[e],
1559
949
  " ",
1560
- l ? c(e) : e
950
+ u ? i(t) : t
1561
951
  ] }),
1562
- /* @__PURE__ */ g.jsx(
952
+ /* @__PURE__ */ h(
1563
953
  "button",
1564
954
  {
1565
- className: M.navButton,
955
+ className: f.navButton,
1566
956
  onClick: () => s(1),
1567
- disabled: i,
957
+ disabled: o,
1568
958
  "aria-label": "Next month",
1569
959
  children: "›"
1570
960
  }
1571
961
  ),
1572
- /* @__PURE__ */ g.jsx(
962
+ /* @__PURE__ */ h(
1573
963
  "button",
1574
964
  {
1575
- className: M.navButton,
965
+ className: f.navButton,
1576
966
  onClick: () => s(12),
1577
- disabled: i,
967
+ disabled: o,
1578
968
  "aria-label": "Next year",
1579
969
  title: "Next year",
1580
970
  children: "»"
1581
971
  }
1582
972
  ),
1583
- h && /* @__PURE__ */ g.jsx(
1584
- ca,
973
+ l && /* @__PURE__ */ h(
974
+ z3,
1585
975
  {
1586
- currentYear: e,
1587
- currentMonth: t,
976
+ currentYear: t,
977
+ currentMonth: e,
1588
978
  months: a,
1589
- onYearChange: r,
1590
- onMonthChange: o,
979
+ onYearChange: n,
980
+ onMonthChange: r,
1591
981
  onClose: () => m(!1),
1592
- showNepaliNumbers: l,
1593
- convertToNepaliNumber: c,
1594
- calendarType: d
982
+ showNepaliNumbers: u,
983
+ convertToNepaliNumber: i,
984
+ calendarType: c
1595
985
  }
1596
986
  )
1597
987
  ] });
1598
- }, Pe = ({
1599
- calendarDays: t,
1600
- days: e,
988
+ }, mt = ({
989
+ calendarDays: e,
990
+ days: t,
1601
991
  onDateSelect: a,
1602
992
  isSelected: s,
1603
- isInRange: r,
1604
- isToday: o,
1605
- isDisabled: i,
1606
- disabled: l = !1,
1607
- showNepaliNumbers: c = !1,
1608
- convertToNepaliNumber: d
1609
- }) => /* @__PURE__ */ g.jsxs("div", { className: M.grid, children: [
1610
- e.map((h) => /* @__PURE__ */ g.jsx("div", { className: M.dayHeader, children: h }, h)),
1611
- t.map((h, m) => {
1612
- const y = h ? i?.(h) || l : !1;
1613
- return /* @__PURE__ */ g.jsx(
993
+ isInRange: n,
994
+ isToday: r,
995
+ isDisabled: o,
996
+ disabled: u = !1,
997
+ 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(
1614
1004
  "div",
1615
1005
  {
1616
- className: `${M.day} ${h === null ? M.dayOtherMonth : y ? M.dayDisabled : s(h) ? M.daySelected : r(h) ? M.dayInRange : o(h) ? M.dayToday : ""}`,
1617
- onClick: () => h && !y && a(h),
1618
- children: h ? c ? d(h) : h : ""
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 : ""
1619
1009
  },
1620
1010
  m
1621
1011
  );
1622
1012
  })
1623
- ] }), Ie = ({
1624
- presets: t,
1625
- calendarType: e,
1013
+ ] }), yt = ({
1014
+ presets: e,
1015
+ calendarType: t,
1626
1016
  onPresetSelect: a,
1627
1017
  activePreset: s,
1628
- position: r = "top"
1018
+ position: n = "top"
1629
1019
  }) => {
1630
- const o = (i) => {
1631
- const l = i.getValue(e);
1632
- a(i, l);
1020
+ const r = (o) => {
1021
+ const u = o.getValue(t);
1022
+ a(o, u);
1633
1023
  };
1634
- return /* @__PURE__ */ g.jsx(
1024
+ return /* @__PURE__ */ h(
1635
1025
  "div",
1636
1026
  {
1637
1027
  style: {
1638
1028
  display: "flex",
1639
- flexDirection: r === "left" || r === "right" ? "column" : "row",
1640
- flexWrap: r === "top" || r === "bottom" ? "wrap" : "nowrap",
1029
+ flexDirection: n === "left" || n === "right" ? "column" : "row",
1030
+ flexWrap: n === "top" || n === "bottom" ? "wrap" : "nowrap",
1641
1031
  gap: "8px",
1642
- marginBottom: r === "top" ? "16px" : 0,
1643
- marginTop: r === "bottom" ? "16px" : 0,
1032
+ marginBottom: n === "top" ? "16px" : 0,
1033
+ marginTop: n === "bottom" ? "16px" : 0,
1644
1034
  padding: "12px",
1645
1035
  backgroundColor: "#f8f9fa",
1646
1036
  borderRadius: "6px",
1647
1037
  border: "1px solid #e9ecef",
1648
- minWidth: r === "left" || r === "right" ? "150px" : "auto",
1649
- maxWidth: r === "left" || r === "right" ? "180px" : "none",
1038
+ minWidth: n === "left" || n === "right" ? "150px" : "auto",
1039
+ maxWidth: n === "left" || n === "right" ? "180px" : "none",
1650
1040
  flexShrink: 0
1651
1041
  },
1652
- children: t.map((i) => /* @__PURE__ */ g.jsx(
1042
+ children: e.map((o) => /* @__PURE__ */ h(
1653
1043
  "button",
1654
1044
  {
1655
- onClick: () => o(i),
1045
+ onClick: () => r(o),
1656
1046
  style: {
1657
1047
  padding: "6px 12px",
1658
1048
  fontSize: "12px",
1659
1049
  border: "1px solid #dee2e6",
1660
1050
  borderRadius: "4px",
1661
- backgroundColor: s === i.key ? "#007bff" : "#ffffff",
1662
- color: s === i.key ? "#ffffff" : "#495057",
1051
+ backgroundColor: s === o.key ? "#007bff" : "#ffffff",
1052
+ color: s === o.key ? "#ffffff" : "#495057",
1663
1053
  cursor: "pointer",
1664
1054
  transition: "all 0.2s"
1665
1055
  },
1666
- children: i.label
1056
+ children: o.label
1667
1057
  },
1668
- i.key
1058
+ o.key
1669
1059
  ))
1670
1060
  }
1671
1061
  );
1672
- }, la = ({
1673
- calendarType: t = "AD",
1674
- value: e,
1062
+ }, X3 = ({
1063
+ calendarType: e = "AD",
1064
+ value: t,
1675
1065
  onChange: a,
1676
1066
  className: s = "",
1677
- showToday: r = !0,
1678
- disabled: o = !1,
1679
- outputFormat: i = "both",
1680
- onDateSelect: l,
1681
- mode: c = "single",
1682
- onRangeSelect: d,
1683
- showRangePresets: h = !1,
1067
+ showToday: n = !0,
1068
+ disabled: r = !1,
1069
+ outputFormat: o = "both",
1070
+ onDateSelect: u,
1071
+ mode: i = "single",
1072
+ onRangeSelect: c,
1073
+ showRangePresets: l = !1,
1684
1074
  rangePresetsPosition: m = "top",
1685
- predefinedRanges: y,
1686
- presetKeys: j,
1687
- presetLabels: S,
1688
- onPresetSelect: N,
1689
- renderPresets: H,
1690
- showNepaliMonths: C = !1,
1691
- showNepaliDays: _ = !1,
1692
- showNepaliNumbers: Y = !1,
1693
- theme: F = "light",
1694
- colors: De,
1695
- minDate: x,
1696
- maxDate: O
1075
+ predefinedRanges: d,
1076
+ presetKeys: k,
1077
+ presetLabels: y,
1078
+ onPresetSelect: $,
1079
+ renderPresets: F,
1080
+ showNepaliMonths: w = !1,
1081
+ showNepaliDays: T = !1,
1082
+ showNepaliNumbers: p = !1,
1083
+ theme: _ = "light",
1084
+ colors: et,
1085
+ minDate: D,
1086
+ maxDate: Y
1697
1087
  }) => {
1698
1088
  const {
1699
- currentYear: B,
1700
- currentMonth: $,
1701
- rangeStart: L,
1702
- rangeEnd: P,
1703
- calendarDays: U,
1704
- setSelectedDate: K,
1705
- setRangeStart: q,
1706
- setRangeEnd: Q,
1707
- setCurrentYear: oe,
1708
- setCurrentMonth: ie,
1709
- navigateMonth: W,
1710
- isToday: he,
1711
- isSelected: fe,
1712
- isInRange: ge
1713
- } = Pr(t), [me, be] = te(), Se = y || Br(j, S), ye = t === "BS" && C ? jr : t === "BS" ? sn : Rr, ue = t === "BS" && _ ? Tr : Or, ce = (v, k) => {
1714
- k.start && k.end && (q(k.start), Q(k.end), oe(k.start.year), ie(k.start.month), be(v.key), N?.(v, k), d?.({ start: k.start, end: k.end }));
1715
- }, Ee = (v, k) => {
1716
- q(v), Q(k), be(void 0), d?.({ start: v, end: k });
1717
- }, le = (v) => {
1718
- if (o) return;
1719
- const k = { year: B, month: $, day: v };
1720
- if (Re(k, x, O)) return;
1721
- if (c === "range") {
1722
- if (be(void 0), !L || L && P)
1723
- q(k), Q(null);
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,
1100
+ 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) => {
1108
+ if (r) return;
1109
+ const M = { year: x, month: C, day: g };
1110
+ if (tt(M, D, Y)) return;
1111
+ if (i === "range") {
1112
+ if (kt(void 0), !B || B && v)
1113
+ at(M), X(null);
1724
1114
  else {
1725
- const X = new Date(L.year, L.month, L.day).getTime();
1726
- new Date(k.year, k.month, k.day).getTime() < X ? (q(k), Q(L), d?.({ start: k, end: L })) : (Q(k), d?.({ start: L, end: k }));
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 }));
1727
1117
  }
1728
1118
  return;
1729
1119
  }
1730
- K(k);
1731
- const ee = $r(t, B, $, v, ye);
1732
- if (l?.(ee), a) {
1733
- let X;
1734
- switch (i) {
1120
+ nt(M);
1121
+ const U = E3(e, x, C, g, Q);
1122
+ if (u?.(U), a) {
1123
+ let J;
1124
+ switch (o) {
1735
1125
  case "iso":
1736
- X = ee.ad;
1126
+ J = U.ad;
1737
1127
  break;
1738
1128
  case "object":
1739
- X = JSON.stringify(ee);
1129
+ J = JSON.stringify(U);
1740
1130
  break;
1741
1131
  default:
1742
- X = JSON.stringify(ee);
1132
+ J = JSON.stringify(U);
1743
1133
  break;
1744
1134
  }
1745
- a(X);
1135
+ a(J);
1746
1136
  }
1747
- }, Me = (v) => {
1748
- if (!o) {
1749
- switch (v.key) {
1137
+ }, fe = (g) => {
1138
+ if (!r) {
1139
+ switch (g.key) {
1750
1140
  case "ArrowLeft":
1751
- W(-1);
1141
+ O(-1);
1752
1142
  break;
1753
1143
  case "ArrowRight":
1754
- W(1);
1144
+ O(1);
1755
1145
  break;
1756
1146
  case "ArrowUp":
1757
- W(-12);
1147
+ O(-12);
1758
1148
  break;
1759
1149
  case "ArrowDown":
1760
- W(12);
1150
+ O(12);
1761
1151
  break;
1762
1152
  case "PageUp":
1763
- v.shiftKey ? W(-12) : W(-1);
1153
+ g.shiftKey ? O(-12) : O(-1);
1764
1154
  break;
1765
1155
  case "PageDown":
1766
- v.shiftKey ? W(12) : W(1);
1156
+ g.shiftKey ? O(12) : O(1);
1767
1157
  break;
1768
1158
  default:
1769
1159
  return;
1770
1160
  }
1771
- v.preventDefault();
1161
+ g.preventDefault();
1772
1162
  }
1773
- }, Te = {
1774
- ...De ? Object.entries(De).reduce(
1775
- (v, [k, ee]) => (v[`--calendar-${k}`] = ee, v),
1163
+ }, De = {
1164
+ ...et ? Object.entries(et).reduce(
1165
+ (g, [M, U]) => (g[`--calendar-${M}`] = U, g),
1776
1166
  {}
1777
1167
  ) : {}
1778
1168
  };
1779
- return /* @__PURE__ */ g.jsxs(
1169
+ return /* @__PURE__ */ b(
1780
1170
  "div",
1781
1171
  {
1782
- className: `${M.calendar} ${s}`,
1783
- style: Te,
1784
- "data-theme": F,
1785
- onKeyDown: Me,
1172
+ className: `${f.calendar} ${s}`,
1173
+ style: De,
1174
+ "data-theme": _,
1175
+ onKeyDown: fe,
1786
1176
  tabIndex: 0,
1787
1177
  role: "application",
1788
1178
  "aria-label": "Calendar",
1789
1179
  children: [
1790
- c === "range" && H && /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", gap: "16px" }, children: [
1791
- /* @__PURE__ */ g.jsx("div", { children: H({ onRangeChange: Ee }) }),
1792
- /* @__PURE__ */ g.jsxs("div", { style: { flex: 1 }, children: [
1793
- /* @__PURE__ */ g.jsx(
1794
- $e,
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(
1184
+ gt,
1795
1185
  {
1796
- currentMonth: $,
1797
- currentYear: B,
1798
- months: ye,
1799
- onNavigateMonth: W,
1800
- onYearChange: oe,
1801
- onMonthChange: ie,
1802
- disabled: o,
1803
- showNepaliNumbers: Y,
1804
- convertToNepaliNumber: de,
1805
- calendarType: t
1186
+ currentMonth: C,
1187
+ currentYear: x,
1188
+ months: Q,
1189
+ onNavigateMonth: O,
1190
+ onYearChange: Z,
1191
+ onMonthChange: q,
1192
+ disabled: r,
1193
+ showNepaliNumbers: p,
1194
+ convertToNepaliNumber: W,
1195
+ calendarType: e
1806
1196
  }
1807
1197
  ),
1808
- /* @__PURE__ */ g.jsx(
1809
- Pe,
1198
+ /* @__PURE__ */ h(
1199
+ mt,
1810
1200
  {
1811
- calendarDays: U,
1812
- days: ue,
1813
- onDateSelect: le,
1814
- isSelected: (v) => fe(v, c),
1815
- isInRange: ge,
1816
- isToday: (v) => r && he(v),
1817
- isDisabled: (v) => Re({ year: B, month: $, day: v }, x, O),
1818
- disabled: o,
1819
- showNepaliNumbers: Y,
1820
- convertToNepaliNumber: de
1201
+ calendarDays: N,
1202
+ 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),
1208
+ disabled: r,
1209
+ showNepaliNumbers: p,
1210
+ convertToNepaliNumber: W
1821
1211
  }
1822
1212
  )
1823
1213
  ] })
1824
1214
  ] }),
1825
- c === "range" && h && m === "left" && !H && /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1826
- /* @__PURE__ */ g.jsx(
1827
- Ie,
1215
+ i === "range" && l && m === "left" && !F && /* @__PURE__ */ b("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1216
+ /* @__PURE__ */ h(
1217
+ yt,
1828
1218
  {
1829
- presets: Se,
1830
- calendarType: t,
1831
- onPresetSelect: ce,
1832
- activePreset: me,
1219
+ presets: ut,
1220
+ calendarType: e,
1221
+ onPresetSelect: lt,
1222
+ activePreset: it,
1833
1223
  position: "left"
1834
1224
  }
1835
1225
  ),
1836
- /* @__PURE__ */ g.jsxs("div", { children: [
1837
- /* @__PURE__ */ g.jsx(
1838
- $e,
1226
+ /* @__PURE__ */ b("div", { children: [
1227
+ /* @__PURE__ */ h(
1228
+ gt,
1839
1229
  {
1840
- currentMonth: $,
1841
- currentYear: B,
1842
- months: ye,
1843
- onNavigateMonth: W,
1844
- onYearChange: oe,
1845
- onMonthChange: ie,
1846
- disabled: o,
1847
- showNepaliNumbers: Y,
1848
- convertToNepaliNumber: de,
1849
- calendarType: t
1230
+ currentMonth: C,
1231
+ currentYear: x,
1232
+ months: Q,
1233
+ onNavigateMonth: O,
1234
+ onYearChange: Z,
1235
+ onMonthChange: q,
1236
+ disabled: r,
1237
+ showNepaliNumbers: p,
1238
+ convertToNepaliNumber: W,
1239
+ calendarType: e
1850
1240
  }
1851
1241
  ),
1852
- /* @__PURE__ */ g.jsx(
1853
- Pe,
1242
+ /* @__PURE__ */ h(
1243
+ mt,
1854
1244
  {
1855
- calendarDays: U,
1856
- days: ue,
1857
- onDateSelect: le,
1858
- isSelected: (v) => fe(v, c),
1859
- isInRange: ge,
1860
- isToday: (v) => r && he(v),
1861
- isDisabled: (v) => Re({ year: B, month: $, day: v }, x, O),
1862
- disabled: o,
1863
- showNepaliNumbers: Y,
1864
- convertToNepaliNumber: de
1245
+ calendarDays: N,
1246
+ 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),
1252
+ disabled: r,
1253
+ showNepaliNumbers: p,
1254
+ convertToNepaliNumber: W
1865
1255
  }
1866
1256
  )
1867
1257
  ] })
1868
1258
  ] }),
1869
- c === "range" && h && m === "right" && !H && /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1870
- /* @__PURE__ */ g.jsxs("div", { children: [
1871
- /* @__PURE__ */ g.jsx(
1872
- $e,
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(
1262
+ gt,
1873
1263
  {
1874
- currentMonth: $,
1875
- currentYear: B,
1876
- months: ye,
1877
- onNavigateMonth: W,
1878
- onYearChange: oe,
1879
- onMonthChange: ie,
1880
- disabled: o,
1881
- showNepaliNumbers: Y,
1882
- convertToNepaliNumber: de,
1883
- calendarType: t
1264
+ currentMonth: C,
1265
+ currentYear: x,
1266
+ months: Q,
1267
+ onNavigateMonth: O,
1268
+ onYearChange: Z,
1269
+ onMonthChange: q,
1270
+ disabled: r,
1271
+ showNepaliNumbers: p,
1272
+ convertToNepaliNumber: W,
1273
+ calendarType: e
1884
1274
  }
1885
1275
  ),
1886
- /* @__PURE__ */ g.jsx(
1887
- Pe,
1276
+ /* @__PURE__ */ h(
1277
+ mt,
1888
1278
  {
1889
- calendarDays: U,
1890
- days: ue,
1891
- onDateSelect: le,
1892
- isSelected: (v) => fe(v, c),
1893
- isInRange: ge,
1894
- isToday: (v) => r && he(v),
1895
- isDisabled: (v) => Re({ year: B, month: $, day: v }, x, O),
1896
- disabled: o,
1897
- showNepaliNumbers: Y,
1898
- convertToNepaliNumber: de
1279
+ calendarDays: N,
1280
+ 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),
1286
+ disabled: r,
1287
+ showNepaliNumbers: p,
1288
+ convertToNepaliNumber: W
1899
1289
  }
1900
1290
  )
1901
1291
  ] }),
1902
- /* @__PURE__ */ g.jsx(
1903
- Ie,
1292
+ /* @__PURE__ */ h(
1293
+ yt,
1904
1294
  {
1905
- presets: Se,
1906
- calendarType: t,
1907
- onPresetSelect: ce,
1908
- activePreset: me,
1295
+ presets: ut,
1296
+ calendarType: e,
1297
+ onPresetSelect: lt,
1298
+ activePreset: it,
1909
1299
  position: "right"
1910
1300
  }
1911
1301
  )
1912
1302
  ] }),
1913
- (!c || c === "single" || !h && !H || m === "top" || m === "bottom") && /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
1914
- c === "range" && h && m === "top" && /* @__PURE__ */ g.jsx(
1915
- Ie,
1303
+ (!i || i === "single" || !l && !F || m === "top" || m === "bottom") && /* @__PURE__ */ b(Me, { children: [
1304
+ i === "range" && l && m === "top" && /* @__PURE__ */ h(
1305
+ yt,
1916
1306
  {
1917
- presets: Se,
1918
- calendarType: t,
1919
- onPresetSelect: ce,
1920
- activePreset: me,
1307
+ presets: ut,
1308
+ calendarType: e,
1309
+ onPresetSelect: lt,
1310
+ activePreset: it,
1921
1311
  position: "top"
1922
1312
  }
1923
1313
  ),
1924
- /* @__PURE__ */ g.jsx(
1925
- $e,
1314
+ /* @__PURE__ */ h(
1315
+ gt,
1926
1316
  {
1927
- currentMonth: $,
1928
- currentYear: B,
1929
- months: ye,
1930
- onNavigateMonth: W,
1931
- onYearChange: oe,
1932
- onMonthChange: ie,
1933
- disabled: o,
1934
- showNepaliNumbers: Y,
1935
- convertToNepaliNumber: de,
1936
- calendarType: t
1317
+ currentMonth: C,
1318
+ currentYear: x,
1319
+ months: Q,
1320
+ onNavigateMonth: O,
1321
+ onYearChange: Z,
1322
+ onMonthChange: q,
1323
+ disabled: r,
1324
+ showNepaliNumbers: p,
1325
+ convertToNepaliNumber: W,
1326
+ calendarType: e
1937
1327
  }
1938
1328
  ),
1939
- /* @__PURE__ */ g.jsx(
1940
- Pe,
1329
+ /* @__PURE__ */ h(
1330
+ mt,
1941
1331
  {
1942
- calendarDays: U,
1943
- days: ue,
1944
- onDateSelect: le,
1945
- isSelected: (v) => fe(v, c),
1946
- isInRange: ge,
1947
- isToday: (v) => r && he(v),
1948
- isDisabled: (v) => Re({ year: B, month: $, day: v }, x, O),
1949
- disabled: o,
1950
- showNepaliNumbers: Y,
1951
- convertToNepaliNumber: de
1332
+ calendarDays: N,
1333
+ 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),
1339
+ disabled: r,
1340
+ showNepaliNumbers: p,
1341
+ convertToNepaliNumber: W
1952
1342
  }
1953
1343
  ),
1954
- c === "range" && h && m === "bottom" && /* @__PURE__ */ g.jsx(
1955
- Ie,
1344
+ i === "range" && l && m === "bottom" && /* @__PURE__ */ h(
1345
+ yt,
1956
1346
  {
1957
- presets: Se,
1958
- calendarType: t,
1959
- onPresetSelect: ce,
1960
- activePreset: me,
1347
+ presets: ut,
1348
+ calendarType: e,
1349
+ onPresetSelect: lt,
1350
+ activePreset: it,
1961
1351
  position: "bottom"
1962
1352
  }
1963
1353
  )
@@ -1965,108 +1355,108 @@ const jr = [
1965
1355
  ]
1966
1356
  }
1967
1357
  );
1968
- }, da = "_datePicker_z7mc2_1", ha = "_input_z7mc2_7", fa = "_iconButton_z7mc2_38", ga = "_popup_z7mc2_64", Be = {
1969
- datePicker: da,
1970
- input: ha,
1971
- iconButton: fa,
1972
- popup: ga
1973
- }, ba = ({
1974
- placeholder: t = "Select date",
1975
- format: e = "YYYY-MM-DD",
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 = ({
1364
+ placeholder: e = "Select date",
1365
+ format: t = "YYYY-MM-DD",
1976
1366
  onDateSelect: a,
1977
1367
  inputClassName: s = "",
1978
- popupClassName: r = "",
1979
- style: o,
1980
- inputStyle: i,
1981
- icon: l,
1982
- showIcon: c = !0,
1983
- calendarType: d = "AD",
1984
- ...h
1368
+ popupClassName: n = "",
1369
+ style: r,
1370
+ inputStyle: o,
1371
+ icon: u,
1372
+ showIcon: i = !0,
1373
+ calendarType: c = "AD",
1374
+ ...l
1985
1375
  }) => {
1986
- const [m, y] = te(!1), [j, S] = te(null), [N, H] = te(""), C = jn(null);
1987
- Ct(() => {
1988
- const x = (O) => {
1989
- C.current && !C.current.contains(O.target) && y(!1);
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);
1990
1380
  };
1991
- return m && document.addEventListener("mousedown", x), () => {
1992
- document.removeEventListener("mousedown", x);
1381
+ return m && document.addEventListener("mousedown", D), () => {
1382
+ document.removeEventListener("mousedown", D);
1993
1383
  };
1994
1384
  }, [m]);
1995
- const _ = (x) => {
1996
- S(x);
1997
- const O = d === "BS" ? x.bs : x.ad;
1998
- H(O), y(!1), a?.(x);
1999
- }, Y = (x) => {
2000
- const O = x.target.value, B = x.target.selectionStart || 0, $ = N.length;
2001
- if (O === "") {
2002
- H("");
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("");
2003
1393
  return;
2004
1394
  }
2005
- if (B === O.length && O.length > $) {
2006
- const P = O.replace(/[^0-9]/g, "");
2007
- let U = P;
2008
- P.length > 4 && P.length <= 6 ? U = P.slice(0, 4) + "-" + P.slice(4) : P.length > 6 && (U = P.slice(0, 4) + "-" + P.slice(4, 6) + "-" + P.slice(6, 8)), H(U);
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);
2009
1399
  } else {
2010
- const P = O.replace(/[^0-9-]/g, "");
2011
- P.length <= 10 && H(P);
1400
+ const v = Y.replace(/[^0-9-]/g, "");
1401
+ v.length <= 10 && F(v);
2012
1402
  }
2013
- }, F = () => {
2014
- const x = N.trim();
2015
- if (!x) {
2016
- S(null);
1403
+ }, _ = () => {
1404
+ const D = $.trim();
1405
+ if (!D) {
1406
+ y(null);
2017
1407
  return;
2018
1408
  }
2019
- const O = x.match(/^(\d{4})-(\d{2})-(\d{2})$/);
2020
- if (O) {
2021
- const [, B, $, L] = O, P = parseInt($), U = parseInt(L);
2022
- if (P < 1 || P > 12 || U < 1 || U > 32) {
2023
- H(
2024
- j ? d === "BS" ? j.formatted.bs : j.formatted.ad : ""
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 : ""
2025
1415
  );
2026
1416
  return;
2027
1417
  }
2028
- const K = {
2029
- bs: d === "BS" ? `${B}-${$}-${L}` : "",
2030
- ad: d === "AD" ? `${B}-${$}-${L}` : "",
1418
+ const nt = {
1419
+ bs: c === "BS" ? `${x}-${C}-${B}` : "",
1420
+ ad: c === "AD" ? `${x}-${C}-${B}` : "",
2031
1421
  formatted: {
2032
- bs: d === "BS" ? x : "",
2033
- ad: d === "AD" ? x : ""
1422
+ bs: c === "BS" ? D : "",
1423
+ ad: c === "AD" ? D : ""
2034
1424
  }
2035
1425
  };
2036
- S(K), a?.(K);
2037
- } else x.length < 10 && H(
2038
- j ? d === "BS" ? j.formatted.bs : j.formatted.ad : ""
1426
+ y(nt), a?.(nt);
1427
+ } else D.length < 10 && F(
1428
+ k ? c === "BS" ? k.formatted.bs : k.formatted.ad : ""
2039
1429
  );
2040
- }, De = (x) => {
2041
- x.key === "Enter" ? (F(), y(!1)) : x.key === "Escape" && y(!1);
1430
+ }, et = (D) => {
1431
+ D.key === "Enter" ? (_(), d(!1)) : D.key === "Escape" && d(!1);
2042
1432
  };
2043
- return /* @__PURE__ */ g.jsxs("div", { className: `${Be.datePicker} ${s}`, ref: C, style: o, children: [
2044
- /* @__PURE__ */ g.jsx(
1433
+ return /* @__PURE__ */ b("div", { className: `${ft.datePicker} ${s}`, ref: w, style: r, children: [
1434
+ /* @__PURE__ */ h(
2045
1435
  "input",
2046
1436
  {
2047
1437
  type: "text",
2048
- value: N,
2049
- placeholder: t || "YYYY-MM-DD",
2050
- onChange: Y,
2051
- onBlur: F,
2052
- onKeyDown: De,
2053
- className: Be.input,
2054
- style: i,
1438
+ value: $,
1439
+ placeholder: e || "YYYY-MM-DD",
1440
+ onChange: p,
1441
+ onBlur: _,
1442
+ onKeyDown: et,
1443
+ className: ft.input,
1444
+ style: o,
2055
1445
  "aria-label": "Date picker input",
2056
1446
  "aria-haspopup": "dialog",
2057
1447
  "aria-expanded": m,
2058
1448
  maxLength: 10
2059
1449
  }
2060
1450
  ),
2061
- /* @__PURE__ */ g.jsx(
1451
+ /* @__PURE__ */ h(
2062
1452
  "button",
2063
1453
  {
2064
1454
  type: "button",
2065
- className: Be.iconButton,
2066
- onClick: () => y(!m),
1455
+ className: ft.iconButton,
1456
+ onClick: () => d(!m),
2067
1457
  "aria-label": "Toggle calendar",
2068
- style: { display: c ? "flex" : "none" },
2069
- children: l || /* @__PURE__ */ g.jsxs(
1458
+ style: { display: i ? "flex" : "none" },
1459
+ children: u || /* @__PURE__ */ b(
2070
1460
  "svg",
2071
1461
  {
2072
1462
  width: "18",
@@ -2076,43 +1466,43 @@ const jr = [
2076
1466
  stroke: "currentColor",
2077
1467
  strokeWidth: "2",
2078
1468
  children: [
2079
- /* @__PURE__ */ g.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
2080
- /* @__PURE__ */ g.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
2081
- /* @__PURE__ */ g.jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
2082
- /* @__PURE__ */ g.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
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" })
2083
1473
  ]
2084
1474
  }
2085
1475
  )
2086
1476
  }
2087
1477
  ),
2088
- m && /* @__PURE__ */ g.jsx("div", { className: `${Be.popup} ${r}`, children: /* @__PURE__ */ g.jsx(
2089
- la,
1478
+ m && /* @__PURE__ */ h("div", { className: `${ft.popup} ${n}`, children: /* @__PURE__ */ h(
1479
+ X3,
2090
1480
  {
2091
- calendarType: d,
2092
- onDateSelect: _,
2093
- ...h
1481
+ calendarType: c,
1482
+ onDateSelect: T,
1483
+ ...l
2094
1484
  }
2095
1485
  ) })
2096
1486
  ] });
2097
1487
  };
2098
1488
  export {
2099
- la as Calendar,
2100
- ba as CalendarInput,
2101
- pa as DEFAULT_COLORS,
2102
- ba as DatePicker,
2103
- Or as ENGLISH_DAYS,
2104
- Rr as ENGLISH_MONTHS_AD,
2105
- sn as ENGLISH_MONTHS_BS,
2106
- Tr as NEPALI_DAYS,
2107
- Ar as NEPALI_DIGITS,
2108
- jr as NEPALI_MONTHS,
2109
- Da as PRESET_KEYS,
2110
- de as convertToNepaliNumber,
2111
- $r as createDateOutput,
2112
- Br as createPredefinedRanges,
2113
- on as getDaysInMonth,
2114
- Fr as getFirstDayOfMonth,
2115
- z as getTodayDate,
2116
- va as isDateInRange,
2117
- Pr as useCalendar
1489
+ X3 as Calendar,
1490
+ ln as CalendarInput,
1491
+ on as DEFAULT_COLORS,
1492
+ ln as DatePicker,
1493
+ p3 as ENGLISH_DAYS,
1494
+ D3 as ENGLISH_MONTHS_AD,
1495
+ ge as ENGLISH_MONTHS_BS,
1496
+ 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
2118
1508
  };