bs-ad-calendar-react 1.2.1 → 1.3.0

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 d, jsxs as b, Fragment as pe } from "react/jsx-runtime";
2
+ import { useMemo as $t, useState as N, useEffect as Yt, useRef as xt } from "react";
3
+ const tt = [1943, 4, 14], Lt = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], be = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], P = [[[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 366], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365], [[31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 366], [[31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30], 365], [[31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], 365], [[31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30], 365]];
4
+ let Rt = class extends Error {
5
+ 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 _t = () => tt[0] + 1, jt = () => tt[0] + P.length - 1, Pt = () => 2e3, Wt = () => 2e3 + P.length - 1, ft = (e) => e % 400 === 0 || e % 4 === 0 && e % 100 !== 0, kt = (e) => ft(e) ? be : Lt, Se = (e, t, n) => !(e < _t() || e > jt() || t < 1 || t > 12 || n < 1 || n > kt(e)[t - 1]), Ft = (e, t, n) => {
10
+ let a = e * 365 + n;
11
+ for (let s = 0; s < t - 1; s++) a += Lt[s];
12
+ return t <= 2 && (e -= 1), a += Math.floor(e / 4) - Math.floor(e / 100) + Math.floor(e / 400), a;
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, n) {
15
+ const a = t + 1;
16
+ if (!Se(e, a, n)) throw new Rt("Date out of range");
17
+ let s = 2e3, r = 1, o = 1, u = Math.abs(Ft(e, a, n) - Ft(...tt)), i = 0;
18
+ for (; u >= P[i][1]; ) u -= P[i][1], s += 1, i += 1;
19
+ let c = 0;
20
+ for (; u >= P[i][0][c]; ) u -= P[i][0][c], r += 1, c += 1;
21
+ return o += u, [s, 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) => {
634
- 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];
638
- 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);
23
+ const we = (e, t, n) => !(e < Pt() || e > Wt() || t < 1 || t > 12 || n < 1 || n > P[e - 2e3][0][t - 1]), Ye = (e, t, n) => {
24
+ let a = n - 1;
25
+ const s = e - 2e3;
26
+ for (let r = 0; r < t - 1; r++) a += P[s][0][r];
27
+ for (let r = 0; r < s; r++) a += P[r][1];
28
+ return a;
29
+ }, ke = (e, t, n) => {
30
+ const a = t + 1;
31
+ if (!we(e, a, n)) throw new Rt("Date out of range");
32
+ let [s, r, o] = [tt[0], 1, 1];
33
+ const u = kt(s).slice(0, tt[1] - 1).reduce((g, m) => g + m, 0) + tt[2] - 1;
34
+ let i = Math.abs(Ye(e, a, n) + u);
35
+ for (; i >= 366 && ft(s) || i >= 365 && !ft(s); ) i -= ft(s) ? 366 : 365, s += 1;
36
+ const c = kt(s);
647
37
  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("|")})`;
666
- 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;
38
+ for (; i >= c[h]; ) i -= c[h], r += 1, h += 1;
39
+ return o += i, [s, r - 1, o];
40
+ }, W = { enMinYear: _t, enMaxYear: jt, npMinYear: Pt, npMaxYear: Wt, englishToNepali: Ee, nepaliToEnglish: ke }, Vt = "en", L = "ne", Ut = 207e5, Jt = 198e5, Ce = 5049018e5, Ae = new Date(1986, 0, 1, 0, 15), Mt = ["Baisakh", "Jestha", "Asar", "Shrawan", "Bhadra", "Aswin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Ct = ["Bai", "Jes", "Asa", "Shr", "Bhd", "Asw", "Kar", "Man", "Pou", "Mag", "Fal", "Cha"], Kt = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "आश्विन", "कार्तिक", "मंसिर", "पौष", "माघ", "फाल्गुण", "चैत्र"], ve = ["बै", "जे", "अ", "श्रा", "भा", "आ", "का", "मं", "पौ", "मा", "फा", "चै"], At = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], vt = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], $e = ["जनवरी", "फेब्रुअरी", "मार्च", "अप्रिल", "मे", "जुन", "जुलाई", "अगस्ट", "सेप्टेम्बर", "अक्टोबर", "नोभेम्बर", "डिसेम्बर"], xe = ["जन", "फेब", "मार", "अप्रि", "मे", "जुन", "जुला", "अग", "सेप", "अक्टो", "नोभे", "डिसे"], Gt = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], et = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], pt = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], zt = ["आइत", "सोम", "मंगल", "बुध", "बिहि", "शुक्र", "शनि"], qt = ["आइतबार", "सोमबार", "मंगलबार", "बुधबार", "बिहिबार", "शुक्रबार", "शनिबार"], Fe = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DD?|ddd?d?|do?|YYYY|YY|y{2,4}|yo?|a|A|hh?|HH?|mm?|ss?|SSS|x|X|.)/g, Oe = (e) => {
41
+ const t = e.getTime(), n = t < Ce ? Jt : Ut, a = new Date(t + n), s = a.getUTCFullYear(), r = a.getUTCMonth(), o = a.getUTCDate(), u = a.getUTCHours(), i = a.getUTCMinutes(), c = a.getUTCSeconds(), h = a.getUTCMilliseconds(), g = a.getUTCDay();
42
+ return { year: s, month0: r, day: o, hour: u, minute: i, second: c, ms: h, weekDay: g };
43
+ }, Ot = (e, t, n, a, s, r, o) => {
44
+ const u = new Date(e, t, n, a, s, r, o);
45
+ let i = u < Ae ? Jt : Ut;
46
+ const c = -1 * u.getTimezoneOffset() * 60 * 1e3;
47
+ return new Date(u.getTime() - i + c);
48
+ }, bt = (e) => {
49
+ const t = e.match(Fe);
50
+ return t ? t.map((n) => n.startsWith("[") && n.endsWith("]") ? n.slice(1, -1) : n) : [];
51
+ }, j = (e) => {
52
+ if (e.length === 0) return new RegExp("");
53
+ let t = [...e];
54
+ if (t = t.sort((a, s) => s.length - a.length), t[0] === "") return new RegExp("");
55
+ const n = `(${t.join("|")})`;
56
+ return new RegExp(n);
57
+ }, x = (e) => e.toString().padStart(2, "0"), Xt = (e) => e.toString().padStart(3, "0"), Te = (e) => e.split("").map((t) => Gt[t.charCodeAt(0) - 48]).join(""), p = (e, t) => {
58
+ const n = typeof e == "string" ? e : String(e);
59
+ return t !== L ? n : Te(n);
60
+ }, He = (e, t) => p(e.getYear(), t).substring(2), Ne = (e, t) => p(e.getYear(), t), Be = (e, t) => p(e.getEnglishYear(), t).substring(2), Ie = (e, t) => p(e.getEnglishYear(), t), Le = (e, t) => p(e.getMonth() + 1, t), Re = (e, t) => p(x(e.getMonth() + 1), t), _e = (e, t) => t === L ? ve[e.getMonth()] : Ct[e.getMonth()], je = (e, t) => t === L ? Kt[e.getMonth()] : Mt[e.getMonth()], Pe = (e, t) => p(e.getEnglishMonth() + 1, t), We = (e, t) => p(x(e.getEnglishMonth() + 1), t), Ve = (e, t) => t === L ? xe[e.getEnglishMonth()] : vt[e.getEnglishMonth()], Ue = (e, t) => t === L ? $e[e.getEnglishMonth()] : At[e.getEnglishMonth()], Je = (e, t) => p(e.getDate(), t), Ke = (e, t) => p(x(e.getDate()), t), Ge = (e, t) => p(e.getEnglishDate(), t), ze = (e, t) => p(x(e.getEnglishDate()), t), Zt = (e, t) => p(e.getDay(), t), yt = (e, t) => t === L ? zt[e.getDay()] : et[e.getDay()], Qt = (e, t) => t === L ? qt[e.getDay()] : pt[e.getDay()], te = (e, t) => p(e.getHours(), t), ee = (e, t) => p(x(e.getHours()), t), ne = (e, t) => {
61
+ const n = e.getHours(), a = n > 12 ? n - 12 : n;
62
+ return p(a, t);
63
+ }, se = (e, t) => {
64
+ const n = e.getHours(), a = n > 12 ? n - 12 : n;
65
+ return p(x(a), t);
66
+ }, ae = (e, t) => p(e.getMinutes(), t), re = (e, t) => p(x(e.getMinutes()), t), oe = (e, t) => p(e.getSeconds(), t), ie = (e, t) => p(x(e.getSeconds()), t), ue = (e, t) => p(Xt(e.getMilliseconds()), t), ce = (e, t) => t === L ? e.getHours() >= 12 ? "पिम" : "एम" : e.getHours() >= 12 ? "PM" : "AM", he = (e, t) => t === L ? e.getHours() >= 12 ? "पिम" : "एम" : e.getHours() >= 12 ? "pm" : "am", Tt = { YY: He, YYYY: Ne, M: Le, MM: Re, MMM: _e, MMMM: je, D: Je, DD: Ke, d: Zt, dd: yt, ddd: yt, dddd: Qt, H: te, HH: ee, h: ne, hh: se, m: ae, mm: re, s: oe, ss: ie, SSS: ue, A: ce, a: he }, le = (e, t, n) => {
67
+ const a = bt(t), s = (r) => r in Tt ? Tt[r](e, n) : r;
68
+ return a.map(s).join("");
69
+ }, qe = (e, t) => le(e, t, Vt), Xe = (e, t) => le(e, t, L), Ze = (e) => {
70
+ const t = x(e.getYear()), n = x(e.getMonth() + 1), a = x(e.getDate()), s = x(e.getHours()), r = x(e.getMinutes()), o = x(e.getSeconds()), u = e.getMilliseconds(), i = u === 0 ? "" : `.${Xt(u)}`;
71
+ return `${t}-${n}-${a} ${s}:${r}:${o}${i}`;
72
+ }, Ht = { YY: Be, YYYY: Ie, M: Pe, MM: We, MMM: Ve, MMMM: Ue, D: Ge, DD: ze, d: Zt, dd: yt, ddd: yt, dddd: Qt, H: te, HH: ee, h: ne, hh: se, m: ae, mm: re, s: oe, ss: ie, SSS: ue, A: ce, a: he }, de = (e, t, n) => {
73
+ const a = bt(t), s = (r) => r in Ht ? Ht[r](e, n) : r;
74
+ return a.map(s).join("");
75
+ }, Qe = (e, t) => de(e, t, Vt), t3 = (e, t) => de(e, t, L);
76
+ function e3(e) {
77
+ const t = e.split(/[-./]/, 3), [n, a = 1, s = 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 [n, a - 1, s];
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, n = "0"] = e.split(".", 2), a = t.split(":", 3), [s, r = 0, o = 0] = a.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(n, 10);
92
+ return Number.isNaN(u) && (u = 0), [s, 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 s3(e) {
95
+ const [t, n] = e.split(" ", 2), [a, s, r] = e3(t), [o, u, i, c] = n3(n);
96
+ return [a, s, 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, "\\$&"));
712
- const s = a.join("");
713
- return { dateTokens: e, regex: new RegExp(`^${s}$`) };
98
+ const Nt = { 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: j(Mt), MMM: j(Ct), dddd: j(pt), ddd: j(et), dd: j(et), d: /([0-6])/ };
99
+ function a3(e) {
100
+ const t = [], n = [];
101
+ for (const s of e) s in Nt ? (t.push(s), n.push(Nt[s].source)) : n.push(s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
102
+ const a = n.join("");
103
+ return { dateTokens: t, regex: new RegExp(`^${a}$`) };
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 [n, a, s, r, o, u, i, c] = [0, 1, 1, 0, 0, 0, 0, 0], h = !1, g = !1;
107
+ for (let m = 0; m < e.length; m++) {
108
+ const S = e[m], f = parseInt(t[m + 1]);
109
+ switch (S) {
720
110
  case "YYYY":
721
- a = S;
111
+ n = f;
722
112
  break;
723
113
  case "YY":
724
- a = 2e3 + parseInt(e[y]);
114
+ n = 2e3 + parseInt(t[m]);
725
115
  break;
726
116
  case "MM":
727
117
  case "M":
728
- s = S;
118
+ a = f;
729
119
  break;
730
120
  case "MMMM":
731
- s = Le.indexOf(e[y + 1]) + 1;
121
+ a = Mt.indexOf(t[m + 1]) + 1;
732
122
  break;
733
123
  case "MMM":
734
- s = Qe.indexOf(e[y + 1]) + 1;
124
+ a = Ct.indexOf(t[m + 1]) + 1;
735
125
  break;
736
126
  case "DD":
737
127
  case "D":
738
- r = S;
128
+ s = f;
739
129
  break;
740
130
  case "HH":
741
131
  case "H":
742
- o = S;
132
+ r = f;
743
133
  break;
744
134
  case "hh":
745
135
  case "h":
746
- i = S, m = !0;
136
+ o = f, g = !0;
747
137
  break;
748
138
  case "mm":
749
139
  case "m":
750
- l = S;
140
+ u = f;
751
141
  break;
752
142
  case "ss":
753
143
  case "s":
754
- c = S;
144
+ i = f;
755
145
  break;
756
146
  case "SSS":
757
- d = S;
147
+ c = f;
758
148
  break;
759
149
  case "A":
760
150
  case "a":
761
- h = e[y + 1].toLowerCase() === "pm";
151
+ h = t[m + 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 g && (r = o + (h ? 12 : 0)), { year: n, month0: a - 1, day: s, 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 ge(e, t) {
157
+ const n = bt(t), { dateTokens: a, regex: s } = a3(n), r = RegExp(s).exec(e);
158
+ if (!r) throw new Error("Invalid date format");
159
+ const { year: o, month0: u, day: i, hour: c, minute: h, second: g, ms: m } = r3(a, r);
160
+ return [o, u, i, c, h, g, m];
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, "\\$&"));
776
- const s = a.join("");
777
- return { dateTokens: e, regex: new RegExp(`^${s}$`) };
162
+ const Bt = { YY: /(\d\d)/, YYYY: /(\d\d\d\d)/, M: /(1[0-2]|0[1-9]|[1-9])/, MM: /(1[0-2]|0[1-9]|[1-9])/, D: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, DD: /(3[0-2]|[1-2]\d|0[1-9]|[1-9]| [1-9])/, H: /(2[0-3]|[0-1]\d|\d)/, HH: /(2[0-3]|[0-1]\d|\d)/, hh: /(1[0-2]|0[1-9]|[1-9])/, mm: /([0-5]\d|\d)/, ss: /([0-5]\d|\d)/, SSS: /(\d\d\d)/, A: /(AM|PM)/, a: /(am|pm)/, MMMM: j(At), MMM: j(vt), dddd: j(pt), ddd: j(et), dd: j(et), d: /([0-6])/ };
163
+ function o3(e) {
164
+ const t = [], n = [];
165
+ for (const s of e) s in Bt ? (t.push(s), n.push(Bt[s].source)) : n.push(s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
166
+ const a = n.join("");
167
+ return { dateTokens: t, regex: new RegExp(`^${a}$`) };
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 [n, a, s, r, o, u, i, c] = [0, 1, 1, 0, 0, 0, 0, 0], h = !1, g = !1;
171
+ for (let m = 0; m < e.length; m++) {
172
+ const S = e[m], f = parseInt(t[m + 1]);
173
+ switch (S) {
784
174
  case "YYYY":
785
- a = S;
175
+ n = f;
786
176
  break;
787
177
  case "YY":
788
- a = 2e3 + parseInt(e[y]);
178
+ n = 2e3 + parseInt(t[m]);
789
179
  break;
790
180
  case "MM":
791
181
  case "M":
792
- s = S;
182
+ a = f;
793
183
  break;
794
184
  case "MMMM":
795
- s = et.indexOf(e[y + 1]) + 1;
185
+ a = At.indexOf(t[m + 1]) + 1;
796
186
  break;
797
187
  case "MMM":
798
- s = tt.indexOf(e[y + 1]) + 1;
188
+ a = vt.indexOf(t[m + 1]) + 1;
799
189
  break;
800
190
  case "DD":
801
191
  case "D":
802
- r = S;
192
+ s = f;
803
193
  break;
804
194
  case "HH":
805
195
  case "H":
806
- o = S;
196
+ r = f;
807
197
  break;
808
198
  case "hh":
809
199
  case "h":
810
- i = S, m = !0;
200
+ o = f, g = !0;
811
201
  break;
812
202
  case "mm":
813
203
  case "m":
814
- l = S;
204
+ u = f;
815
205
  break;
816
206
  case "ss":
817
207
  case "s":
818
- c = S;
208
+ i = f;
819
209
  break;
820
210
  case "SSS":
821
- d = S;
211
+ c = f;
822
212
  break;
823
213
  case "A":
824
214
  case "a":
825
- h = e[y + 1].toLowerCase() === "pm";
215
+ h = t[m + 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 g && (r = o + (h ? 12 : 0)), { year: n, month0: a - 1, day: s, 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 n = bt(t), { dateTokens: a, regex: s } = o3(n), r = RegExp(s).exec(e);
222
+ if (!r) throw new Error("Invalid date format");
223
+ const { year: o, month0: u, day: i, hour: c, minute: h, second: g, ms: m } = i3(a, r);
224
+ return [o, u, i, c, h, g, m];
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
+ Kt.forEach((a, s) => t[a] = Mt[s]), qt.forEach((a, s) => t[a] = pt[s]), zt.forEach((a, s) => t[a] = et[s]), Gt.forEach((a, s) => t[a] = String(s));
229
+ const n = new RegExp(Object.keys(t).join("|"), "g");
230
+ return e.replace(n, (a) => t[a]);
841
231
  }
842
- function _r(t, e) {
843
- const a = Mr(t);
844
- return an(a, e);
232
+ function h3(e, t) {
233
+ const n = c3(e);
234
+ return ge(n, t);
845
235
  }
846
- class Ue extends Error {
847
- constructor(e) {
848
- super(e), this.name = "ValidationError";
236
+ class St 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 l3 = (e) => {
242
+ if (e < 0 || e > 23) throw new St("Hour should be in the range 0-23");
243
+ }, d3 = (e) => {
244
+ if (e < 0 || e > 59) throw new St("Minute should be in the range 0-59");
245
+ }, g3 = (e) => {
246
+ if (e < 0 || e > 59) throw new St("Second should be in the range 0-59");
247
+ }, m3 = (e) => {
248
+ if (e < 0 || e > 999) throw new St("Millisecond should be in the range 0-999");
249
+ }, D3 = (e, t, n, a) => {
250
+ l3(e), d3(t), g3(n), m3(a);
861
251
  };
862
- class I {
252
+ class Y {
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 Y) 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((n) => typeof n == "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);
894
- this.set(a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
282
+ parseFromString(t) {
283
+ const n = s3(t);
284
+ this.set(n[0], n[1], n[2], n[3], n[4], n[5], n[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);
901
- this.set(s[0], s[1], s[2], s[3], s[4], s[5], s[6]);
289
+ parseFromStringWithFormat(t, n) {
290
+ const a = ge(t, n);
291
+ this.set(a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
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, n = !0) {
297
+ this.timestamp = t;
298
+ const { year: a, month0: s, day: r, hour: o, minute: u, weekDay: i } = Oe(t);
299
+ if (this.yearEn = a, this.monthEn = s, this.dayEn = r, this.hour = o, this.minute = u, this.weekDay = i, n) {
300
+ const [c, h, g] = W.englishToNepali(a, s, r);
301
+ this.year = c, this.month = h, this.day = g;
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, n, a, s, r, o, u) {
368
+ D3(s, r, o, u);
369
+ const [i, c, h] = W.nepaliToEnglish(t, n, a);
370
+ this.year = t, this.month = n, this.day = a, this._setDateObject(Ot(i, c, h, s, 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 qe(this, t);
987
377
  }
988
- formatNepali(e) {
989
- return dr(this, e);
378
+ formatNepali(t) {
379
+ return Xe(this, t);
990
380
  }
991
381
  toString() {
992
- return hr(this);
382
+ return Ze(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, n, a, s = 0, r = 0, o = 0, u = 0) {
391
+ const i = Ot(t, n, a, s, r, o, u);
392
+ return new Y(i);
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, n) {
395
+ const [a, s, r, o, u, i, c] = h3(t, n);
396
+ return new Y(a, s, 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, n) {
399
+ const [a, s, r, o, u, i, c] = u3(t, n);
400
+ return Y.fromEnglishDate(a, s, 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");
1014
- if (a < 0 || a > 11) throw new Error("Month out of range");
1015
- return ae[e - se.npMinYear()][0][a];
402
+ static getDaysOfMonth(t, n) {
403
+ if (t < W.npMinYear() || t > W.npMaxYear()) throw new Error("Year out of range");
404
+ if (n < 0 || n > 11) throw new Error("Month out of range");
405
+ return P[t - W.npMinYear()][0][n];
1016
406
  }
1017
407
  static minSupportedDate() {
1018
- return I.fromEnglishDate(se.enMinYear(), 0, 1).getDateObject();
408
+ return Y.fromEnglishDate(W.enMinYear(), 0, 1).getDateObject();
1019
409
  }
1020
410
  static maxSupportedDate() {
1021
- return I.fromEnglishDate(se.enMaxYear(), 11, 31).getDateObject();
411
+ return Y.fromEnglishDate(W.enMaxYear(), 11, 31).getDateObject();
1022
412
  }
1023
413
  static minSupportedNepaliDate() {
1024
- return new I(se.npMinYear(), 0, 1);
414
+ return new Y(W.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 = W.npMaxYear();
418
+ return new Y(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
+ ], me = [
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
+ ], y3 = [
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"], b3 = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], O3 = {
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
+ }, J = (e) => e.toString().split("").map((t) => b3[parseInt(t)]).join(""), De = (e, t, n) => {
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 a = n === 11 ? new Y(t + 1, 0, 1) : new Y(t, n + 1, 1);
491
+ return new Y(a.getTime() - 1440 * 60 * 1e3).getDate();
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, n + 1, 0).getDate();
496
+ }, S3 = (e, t, n) => {
497
+ if (e === "BS")
1108
498
  try {
1109
- return new I(e, a, 1).getDay() || 0;
499
+ return new Y(t, n, 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, n, 1).getDay();
504
+ }, T = (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());
1119
- return { year: a.getYear(), month: a.getMonth(), day: a.getDate() };
508
+ const n = Y.fromEnglishDate(t.getFullYear(), t.getMonth(), t.getDate());
509
+ return { year: n.getYear(), month: n.getMonth(), day: n.getDate() };
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
+ }, wt = (e, t, n, a, s) => {
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 Y(t, n, a), 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(n + 1).padStart(2, "0")}-${String(a).padStart(2, "0")}`,
524
+ ad: u,
1135
525
  formatted: {
1136
- bs: `${r[a]} ${s}, ${e}`,
526
+ bs: `${s[n]} ${a}, ${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(n + 1).padStart(2, "0")}-${String(a).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: `${s[n]} ${a}, ${t}`,
541
+ ad: `${s[n]} ${a}, ${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, n, a), 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 = Y.fromEnglishDate(t, n, a), 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: `${me[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
+ }, T3 = (e, t, n) => {
577
+ const a = new Date(e.year, e.month, e.day).getTime(), s = new Date(t.year, t.month, t.day).getTime(), r = new Date(n.year, n.month, n.day).getTime();
578
+ return a >= s && a <= r;
579
+ }, It = (e) => {
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, n, a] = e.split("-").map(Number);
582
+ return !t || !n || !a ? null : { year: t, month: n - 1, day: a };
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
+ }, nt = (e, t, n) => {
587
+ if (!t && !n) return !1;
588
+ const a = new Date(e.year, e.month, e.day).getTime();
589
+ if (t) {
590
+ const s = It(t);
591
+ if (s) {
592
+ const r = new Date(s.year, s.month, s.day).getTime();
593
+ if (a < r) return !0;
1204
594
  }
1205
595
  }
1206
- 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;
596
+ if (n) {
597
+ const s = It(n);
598
+ if (s) {
599
+ const r = new Date(s.year, s.month, s.day).getTime();
600
+ if (a > r) return !0;
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
+ }, E3 = (e = "AD") => {
605
+ const t = $t(() => T(e), [e]), [n, a] = N(t.year), [s, r] = N(t.month), [o, u] = N(null), [i, c] = N(null), [h, g] = N(null);
606
+ Yt(() => {
607
+ a(t.year), r(t.month);
608
+ }, [t.year, t.month]);
609
+ const m = $t(() => {
610
+ const w = De(e, n, s), F = S3(e, n, s), M = [];
611
+ for (let k = 0; k < F; k++)
612
+ M.push(null);
613
+ for (let k = 1; k <= w; k++)
614
+ M.push(k);
615
+ return M;
616
+ }, [n, s, e]);
1227
617
  return {
1228
618
  // State
1229
- currentYear: a,
1230
- currentMonth: r,
1231
- selectedDate: i,
1232
- rangeStart: c,
619
+ currentYear: n,
620
+ currentMonth: s,
621
+ selectedDate: o,
622
+ rangeStart: i,
1233
623
  rangeEnd: h,
1234
- today: e,
1235
- calendarDays: y,
624
+ today: t,
625
+ calendarDays: m,
1236
626
  // Actions
1237
- setCurrentYear: s,
1238
- setCurrentMonth: o,
1239
- setSelectedDate: l,
1240
- setRangeStart: d,
1241
- 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);
627
+ setCurrentYear: a,
628
+ setCurrentMonth: r,
629
+ setSelectedDate: u,
630
+ setRangeStart: c,
631
+ setRangeEnd: g,
632
+ navigateMonth: (w) => {
633
+ let M = s + w, k = n;
634
+ for (; M > 11; )
635
+ M -= 12, k += 1;
636
+ for (; M < 0; )
637
+ M += 12, k -= 1;
638
+ r(M), a(k);
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) => n === t.year && s === t.month && w === t.day,
642
+ isSelected: (w, F = "single") => F === "range" ? !!(i && i.year === n && i.month === s && i.day === w) || !!(h && h.year === n && h.month === s && h.day === w) : !!(o && o.year === n && o.month === s && o.day === w),
643
+ isInRange: (w) => {
644
+ if (!i || !h) return !1;
645
+ const F = new Date(n, s, w).getTime(), M = new Date(i.year, i.month, i.day).getTime(), k = new Date(h.year, h.month, h.day).getTime();
646
+ return F >= M && F <= k;
1257
647
  }
1258
648
  };
1259
- }, ke = (t, e, a) => {
1260
- if (a === "BS")
649
+ }, Q = (e, t, n) => {
650
+ if (n === "BS")
1261
651
  try {
1262
- const s = new I(t.year, t.month, t.day), r = new Date(
1263
- s.getEnglishYear(),
1264
- s.getEnglishMonth(),
1265
- s.getEnglishDate()
652
+ const a = new Y(e.year, e.month, e.day), s = new Date(
653
+ a.getEnglishYear(),
654
+ a.getEnglishMonth(),
655
+ a.getEnglishDate()
1266
656
  );
1267
- r.setDate(r.getDate() + e);
1268
- const o = I.fromEnglishDate(
1269
- r.getFullYear(),
1270
- r.getMonth(),
1271
- r.getDate()
657
+ s.setDate(s.getDate() + t);
658
+ const r = Y.fromEnglishDate(
659
+ s.getFullYear(),
660
+ s.getMonth(),
661
+ s.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 a = new Date(e.year, e.month, e.day);
669
+ return a.setDate(a.getDate() + t), { year: a.getFullYear(), month: a.getMonth(), day: a.getDate() };
1280
670
  }
1281
- }, Fe = (t, e, a) => {
1282
- if (a === "BS")
671
+ }, dt = (e, t, n) => {
672
+ if (n === "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 a = e.year, s = e.month + t;
675
+ for (; s < 0; )
676
+ a -= 1, s += 12;
677
+ for (; s >= 12; )
678
+ a += 1, s -= 12;
679
+ const r = De("BS", a, s), o = Math.min(e.day, r);
680
+ return { year: a, month: s, day: o };
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 a = new Date(e.year, e.month, e.day);
686
+ return a.setMonth(a.getMonth() + t), { year: a.getFullYear(), month: a.getMonth(), day: a.getDate() };
1297
687
  }
1298
- }, ve = (t) => ({ year: t.year, month: t.month, day: 1 }), Ir = (t, e) => {
1299
- if (e === "BS")
688
+ }, q = (e) => ({ year: e.year, month: e.month, day: 1 }), w3 = (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 a = new Y(e.year, e.month, e.day).getDay();
692
+ return Q(e, -a, "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();
1308
- return a.setDate(a.getDate() - s), { year: a.getFullYear(), month: a.getMonth(), day: a.getDate() };
697
+ const n = new Date(e.year, e.month, e.day), a = n.getDay();
698
+ return n.setDate(n.getDate() - a), { year: n.getFullYear(), month: n.getMonth(), day: n.getDate() };
1309
699
  }
1310
- }, Da = {
700
+ }, H3 = {
1311
701
  TODAY: "today",
1312
702
  YESTERDAY: "yesterday",
1313
703
  THIS_WEEK: "thisWeek",
@@ -1320,644 +710,544 @@ const jr = [
1320
710
  LAST_180_DAYS: "last180days",
1321
711
  LAST_9_MONTHS: "last9months",
1322
712
  LAST_YEAR: "lastYear"
1323
- }, Br = (t, e) => {
1324
- const a = [
713
+ }, Y3 = (e, t) => {
714
+ const n = [
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: (s) => {
719
+ const r = T(s);
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: (s) => {
727
+ const r = T(s), o = Q(r, -1, s);
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: (s) => {
735
+ const r = T(s);
736
+ return { start: w3(r, s), 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: (s) => {
743
+ const r = T(s);
744
+ return { start: Q(r, -6, s), 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: (s) => {
751
+ const r = T(s);
752
+ return { start: Q(r, -29, s), 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: (s) => {
759
+ const r = T(s);
760
+ return { start: q(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: (s) => {
767
+ const r = T(s), o = Q(q(r), -1, s);
768
+ return { start: q(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: (s) => {
775
+ const r = T(s), o = dt(r, -2, s);
776
+ return { start: q(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: (s) => {
783
+ const r = T(s), o = dt(r, -5, s);
784
+ return { start: q(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: (s) => {
791
+ const r = T(s);
792
+ return { start: Q(r, -179, s), 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: (s) => {
799
+ const r = T(s), o = dt(r, -8, s);
800
+ return { start: q(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: (s) => {
807
+ const r = T(s), o = dt(r, -11, s);
808
+ return { start: q(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,
1450
- months: a,
1451
- onYearChange: s,
1452
- onMonthChange: r,
1453
- onClose: o,
1454
- showNepaliNumbers: i = !1,
1455
- convertToNepaliNumber: l = (d) => d.toString(),
1456
- calendarType: c
811
+ ], a = e ? n.filter((s) => e.includes(s.key)) : n;
812
+ return t ? a.map((s) => ({ ...s, label: t[s.key] || s.label })) : a;
813
+ }, k3 = ({
814
+ currentYear: e,
815
+ currentMonth: t,
816
+ months: n,
817
+ onYearChange: a,
818
+ onMonthChange: s,
819
+ onClose: r,
820
+ showNepaliNumbers: o = !1,
821
+ convertToNepaliNumber: u = (c) => c.toString(),
822
+ calendarType: i
1457
823
  }) => {
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: "×" })
824
+ const [c, h] = N(Math.floor(e / 12) * 12), g = i === "BS" ? 2e3 : 1944, m = i === "BS" ? 2100 : 2043;
825
+ return /* @__PURE__ */ d("div", { className: "bsac-picker-overlay", onClick: r, children: /* @__PURE__ */ b("div", { className: "bsac-picker-content", onClick: (S) => S.stopPropagation(), children: [
826
+ /* @__PURE__ */ b("div", { className: "bsac-picker-header", children: [
827
+ /* @__PURE__ */ d("h3", { children: "Select Month & Year" }),
828
+ /* @__PURE__ */ d("button", { className: "bsac-close-btn", onClick: r, children: "×" })
1463
829
  ] }),
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(
1470
- "button",
1471
- {
1472
- onClick: () => h(Math.max(m, d - 12)),
1473
- disabled: d <= m,
1474
- children: "«"
1475
- }
1476
- ),
1477
- /* @__PURE__ */ g.jsxs("span", { children: [
1478
- i ? l(d) : d,
1479
- " -",
1480
- " ",
1481
- i ? l(d + 11) : d + 11
830
+ /* @__PURE__ */ b("div", { className: "bsac-picker-body", children: [
831
+ /* @__PURE__ */ b("div", { className: "bsac-picker-section", children: [
832
+ /* @__PURE__ */ b("div", { className: "bsac-picker-section-header", children: [
833
+ /* @__PURE__ */ d("label", { children: "Year" }),
834
+ /* @__PURE__ */ b("div", { className: "bsac-year-nav", children: [
835
+ /* @__PURE__ */ d("button", { onClick: () => h(Math.max(g, c - 12)), disabled: c <= g, children: "«" }),
836
+ /* @__PURE__ */ b("span", { children: [
837
+ o ? u(c) : c,
838
+ " ",
839
+ o ? u(c + 11) : c + 11
1482
840
  ] }),
1483
- /* @__PURE__ */ g.jsx(
1484
- "button",
1485
- {
1486
- onClick: () => h(Math.min(y - 11, d + 12)),
1487
- disabled: d + 11 >= y,
1488
- children: "»"
1489
- }
1490
- )
841
+ /* @__PURE__ */ d("button", { onClick: () => h(Math.min(m - 11, c + 12)), disabled: c + 11 >= m, children: "»" })
1491
842
  ] })
1492
843
  ] }),
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(
844
+ /* @__PURE__ */ d("div", { className: "bsac-year-grid", children: Array.from({ length: 12 }, (S, f) => {
845
+ const C = c + f;
846
+ return C > m ? null : /* @__PURE__ */ d(
1496
847
  "button",
1497
848
  {
1498
- onClick: () => s(N),
1499
- className: N === t ? M.selected : "",
1500
- children: i ? l(N) : N
849
+ onClick: () => a(C),
850
+ className: C === e ? "bsac-selected" : "",
851
+ children: o ? u(C) : C
1501
852
  },
1502
- N
853
+ C
1503
854
  );
1504
855
  }) })
1505
856
  ] }),
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(
857
+ /* @__PURE__ */ b("div", { className: "bsac-picker-section", children: [
858
+ /* @__PURE__ */ d("label", { children: "Month" }),
859
+ /* @__PURE__ */ d("div", { className: "bsac-month-grid", children: n.map((S, f) => /* @__PURE__ */ d(
1509
860
  "button",
1510
861
  {
1511
862
  onClick: () => {
1512
- r(S), o();
863
+ s(f), r();
1513
864
  },
1514
- className: S === e ? M.selected : "",
1515
- children: j
865
+ className: f === t ? "bsac-selected" : "",
866
+ children: S
1516
867
  },
1517
- S
868
+ f
1518
869
  )) })
1519
870
  ] })
1520
871
  ] })
1521
872
  ] }) });
1522
- }, $e = ({
1523
- currentMonth: t,
1524
- currentYear: e,
1525
- months: a,
1526
- onNavigateMonth: s,
1527
- onYearChange: r,
1528
- onMonthChange: o,
1529
- disabled: i = !1,
1530
- showNepaliNumbers: l = !1,
1531
- convertToNepaliNumber: c,
1532
- calendarType: d
873
+ }, gt = ({
874
+ currentMonth: e,
875
+ currentYear: t,
876
+ months: n,
877
+ onNavigateMonth: a,
878
+ onYearChange: s,
879
+ onMonthChange: r,
880
+ disabled: o = !1,
881
+ showNepaliNumbers: u = !1,
882
+ convertToNepaliNumber: i,
883
+ calendarType: c
1533
884
  }) => {
1534
- const [h, m] = te(!1);
1535
- return /* @__PURE__ */ g.jsxs("div", { className: M.header, children: [
1536
- /* @__PURE__ */ g.jsx(
1537
- "button",
1538
- {
1539
- className: M.navButton,
1540
- onClick: () => s(-12),
1541
- disabled: i,
1542
- "aria-label": "Previous year",
1543
- title: "Previous year",
1544
- children: "«"
1545
- }
1546
- ),
1547
- /* @__PURE__ */ g.jsx(
1548
- "button",
1549
- {
1550
- className: M.navButton,
1551
- onClick: () => s(-1),
1552
- disabled: i,
1553
- "aria-label": "Previous month",
1554
- children: "‹"
1555
- }
1556
- ),
1557
- /* @__PURE__ */ g.jsxs("button", { className: M.monthYear, onClick: () => m(!0), disabled: i, children: [
1558
- a[t],
885
+ const [h, g] = N(!1);
886
+ return /* @__PURE__ */ b("div", { className: "bsac-header", children: [
887
+ /* @__PURE__ */ d("button", { className: "bsac-nav-btn", onClick: () => a(-12), disabled: o, "aria-label": "Previous year", children: "«" }),
888
+ /* @__PURE__ */ d("button", { className: "bsac-nav-btn", onClick: () => a(-1), disabled: o, "aria-label": "Previous month", children: "‹" }),
889
+ /* @__PURE__ */ b("button", { className: "bsac-month-year-btn", onClick: () => g(!0), disabled: o, children: [
890
+ n[e],
1559
891
  " ",
1560
- l ? c(e) : e
892
+ u ? i(t) : t
1561
893
  ] }),
1562
- /* @__PURE__ */ g.jsx(
1563
- "button",
894
+ /* @__PURE__ */ d("button", { className: "bsac-nav-btn", onClick: () => a(1), disabled: o, "aria-label": "Next month", children: "›" }),
895
+ /* @__PURE__ */ d("button", { className: "bsac-nav-btn", onClick: () => a(12), disabled: o, "aria-label": "Next year", children: "»" }),
896
+ h && /* @__PURE__ */ d(
897
+ k3,
1564
898
  {
1565
- className: M.navButton,
1566
- onClick: () => s(1),
1567
- disabled: i,
1568
- "aria-label": "Next month",
1569
- children: "›"
1570
- }
1571
- ),
1572
- /* @__PURE__ */ g.jsx(
1573
- "button",
1574
- {
1575
- className: M.navButton,
1576
- onClick: () => s(12),
1577
- disabled: i,
1578
- "aria-label": "Next year",
1579
- title: "Next year",
1580
- children: "»"
1581
- }
1582
- ),
1583
- h && /* @__PURE__ */ g.jsx(
1584
- ca,
1585
- {
1586
- currentYear: e,
1587
- currentMonth: t,
1588
- months: a,
1589
- onYearChange: r,
1590
- onMonthChange: o,
1591
- onClose: () => m(!1),
1592
- showNepaliNumbers: l,
1593
- convertToNepaliNumber: c,
1594
- calendarType: d
899
+ currentYear: t,
900
+ currentMonth: e,
901
+ months: n,
902
+ onYearChange: s,
903
+ onMonthChange: r,
904
+ onClose: () => g(!1),
905
+ showNepaliNumbers: u,
906
+ convertToNepaliNumber: i,
907
+ calendarType: c
1595
908
  }
1596
909
  )
1597
910
  ] });
1598
- }, Pe = ({
1599
- calendarDays: t,
1600
- days: e,
1601
- onDateSelect: a,
1602
- 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(
911
+ }, mt = ({
912
+ calendarDays: e,
913
+ days: t,
914
+ onDateSelect: n,
915
+ isSelected: a,
916
+ isInRange: s,
917
+ isToday: r,
918
+ isDisabled: o,
919
+ disabled: u = !1,
920
+ showNepaliNumbers: i = !1,
921
+ convertToNepaliNumber: c
922
+ }) => /* @__PURE__ */ b("div", { className: "bsac-grid", children: [
923
+ t.map((h) => /* @__PURE__ */ d("div", { className: "bsac-day-header", children: h }, h)),
924
+ e.map((h, g) => {
925
+ const m = h ? o?.(h) || u : !1, S = h ? a(h) : !1, f = h ? s(h) : !1, C = h ? r(h) : !1, A = [
926
+ "bsac-day",
927
+ h ? m ? "bsac-day-disabled" : S ? "bsac-day-selected" : f ? "bsac-day-in-range" : C ? "bsac-day-today" : "" : "bsac-day-empty"
928
+ ].filter(Boolean).join(" ");
929
+ return /* @__PURE__ */ d(
1614
930
  "div",
1615
931
  {
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 : ""
932
+ className: A,
933
+ onClick: () => h && !m && n(h),
934
+ children: h ? i ? c(h) : h : ""
1619
935
  },
1620
- m
936
+ g
1621
937
  );
1622
938
  })
1623
- ] }), Ie = ({
1624
- presets: t,
1625
- calendarType: e,
1626
- onPresetSelect: a,
1627
- activePreset: s,
1628
- position: r = "top"
939
+ ] }), Dt = ({
940
+ presets: e,
941
+ calendarType: t,
942
+ onPresetSelect: n,
943
+ activePreset: a,
944
+ position: s = "top"
1629
945
  }) => {
1630
- const o = (i) => {
1631
- const l = i.getValue(e);
1632
- a(i, l);
946
+ const r = (o) => {
947
+ const u = o.getValue(t);
948
+ n(o, u);
1633
949
  };
1634
- return /* @__PURE__ */ g.jsx(
1635
- "div",
950
+ return /* @__PURE__ */ d("div", { className: `bsac-presets bsac-presets--${s}`, children: e.map((o) => /* @__PURE__ */ d(
951
+ "button",
1636
952
  {
1637
- style: {
1638
- display: "flex",
1639
- flexDirection: r === "left" || r === "right" ? "column" : "row",
1640
- flexWrap: r === "top" || r === "bottom" ? "wrap" : "nowrap",
1641
- gap: "8px",
1642
- marginBottom: r === "top" ? "16px" : 0,
1643
- marginTop: r === "bottom" ? "16px" : 0,
1644
- padding: "12px",
1645
- backgroundColor: "#f8f9fa",
1646
- borderRadius: "6px",
1647
- border: "1px solid #e9ecef",
1648
- minWidth: r === "left" || r === "right" ? "150px" : "auto",
1649
- maxWidth: r === "left" || r === "right" ? "180px" : "none",
1650
- flexShrink: 0
1651
- },
1652
- children: t.map((i) => /* @__PURE__ */ g.jsx(
1653
- "button",
1654
- {
1655
- onClick: () => o(i),
1656
- style: {
1657
- padding: "6px 12px",
1658
- fontSize: "12px",
1659
- border: "1px solid #dee2e6",
1660
- borderRadius: "4px",
1661
- backgroundColor: s === i.key ? "#007bff" : "#ffffff",
1662
- color: s === i.key ? "#ffffff" : "#495057",
1663
- cursor: "pointer",
1664
- transition: "all 0.2s"
1665
- },
1666
- children: i.label
1667
- },
1668
- i.key
1669
- ))
1670
- }
1671
- );
1672
- }, la = ({
1673
- calendarType: t = "AD",
1674
- value: e,
1675
- onChange: a,
1676
- className: s = "",
1677
- showToday: r = !0,
1678
- disabled: o = !1,
1679
- outputFormat: i = "both",
1680
- onDateSelect: l,
1681
- mode: c = "single",
1682
- onRangeSelect: d,
953
+ onClick: () => r(o),
954
+ className: `bsac-preset-btn${a === o.key ? " bsac-preset-btn--active" : ""}`,
955
+ children: o.label
956
+ },
957
+ o.key
958
+ )) });
959
+ }, C3 = ({
960
+ calendarType: e = "AD",
961
+ value: t,
962
+ onChange: n,
963
+ className: a = "",
964
+ showToday: s = !0,
965
+ disabled: r = !1,
966
+ outputFormat: o = "both",
967
+ onDateSelect: u,
968
+ mode: i = "single",
969
+ onRangeSelect: c,
1683
970
  showRangePresets: h = !1,
1684
- 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
971
+ rangePresetsPosition: g = "top",
972
+ predefinedRanges: m,
973
+ presetKeys: S,
974
+ presetLabels: f,
975
+ onPresetSelect: C,
976
+ renderPresets: A,
977
+ showNepaliMonths: w = !1,
978
+ showNepaliDays: F = !1,
979
+ showNepaliNumbers: M = !1,
980
+ theme: k = "light",
981
+ colors: V,
982
+ minDate: K,
983
+ maxDate: G
1697
984
  }) => {
1698
985
  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);
986
+ currentYear: O,
987
+ currentMonth: B,
988
+ rangeStart: D,
989
+ rangeEnd: v,
990
+ calendarDays: I,
991
+ setSelectedDate: E,
992
+ setRangeStart: $,
993
+ setRangeEnd: R,
994
+ setCurrentYear: _,
995
+ setCurrentMonth: U,
996
+ navigateMonth: H,
997
+ isToday: st,
998
+ isSelected: at,
999
+ isInRange: rt
1000
+ } = E3(e), [ot, Et] = N(), it = m || Y3(S, f), ut = (l, y) => ({
1001
+ start: wt(e, l.year, l.month, l.day, z),
1002
+ end: wt(e, y.year, y.month, y.day, z)
1003
+ }), z = e === "BS" && w ? f3 : e === "BS" ? me : y3, ct = e === "BS" && F ? M3 : p3, ht = (l, y) => {
1004
+ y.start && y.end && ($(y.start), R(y.end), _(y.start.year), U(y.start.month), Et(l.key), C?.(l, y), c?.(ut(y.start, y.end)));
1005
+ }, fe = (l, y) => {
1006
+ $(l), R(y), Et(void 0), c?.(ut(l, y));
1007
+ }, lt = (l) => {
1008
+ if (r) return;
1009
+ const y = { year: O, month: B, day: l };
1010
+ if (nt(y, K, G)) return;
1011
+ if (i === "range") {
1012
+ if (Et(void 0), !D || D && v)
1013
+ $(y), R(null);
1724
1014
  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 }));
1015
+ const Z = new Date(D.year, D.month, D.day).getTime();
1016
+ new Date(y.year, y.month, y.day).getTime() < Z ? ($(y), R(D), c?.(ut(y, D))) : (R(y), c?.(ut(D, y)));
1727
1017
  }
1728
1018
  return;
1729
1019
  }
1730
- K(k);
1731
- const ee = $r(t, B, $, v, ye);
1732
- if (l?.(ee), a) {
1733
- let X;
1734
- switch (i) {
1020
+ E(y);
1021
+ const X = wt(e, O, B, l, z);
1022
+ if (u?.(X), n) {
1023
+ let Z;
1024
+ switch (o) {
1735
1025
  case "iso":
1736
- X = ee.ad;
1026
+ Z = X.ad;
1737
1027
  break;
1738
1028
  case "object":
1739
- X = JSON.stringify(ee);
1029
+ Z = JSON.stringify(X);
1740
1030
  break;
1741
1031
  default:
1742
- X = JSON.stringify(ee);
1032
+ Z = JSON.stringify(X);
1743
1033
  break;
1744
1034
  }
1745
- a(X);
1035
+ n(Z);
1746
1036
  }
1747
- }, Me = (v) => {
1748
- if (!o) {
1749
- switch (v.key) {
1037
+ }, ye = (l) => {
1038
+ if (!r) {
1039
+ switch (l.key) {
1750
1040
  case "ArrowLeft":
1751
- W(-1);
1041
+ H(-1);
1752
1042
  break;
1753
1043
  case "ArrowRight":
1754
- W(1);
1044
+ H(1);
1755
1045
  break;
1756
1046
  case "ArrowUp":
1757
- W(-12);
1047
+ H(-12);
1758
1048
  break;
1759
1049
  case "ArrowDown":
1760
- W(12);
1050
+ H(12);
1761
1051
  break;
1762
1052
  case "PageUp":
1763
- v.shiftKey ? W(-12) : W(-1);
1053
+ l.shiftKey ? H(-12) : H(-1);
1764
1054
  break;
1765
1055
  case "PageDown":
1766
- v.shiftKey ? W(12) : W(1);
1056
+ l.shiftKey ? H(12) : H(1);
1767
1057
  break;
1768
1058
  default:
1769
1059
  return;
1770
1060
  }
1771
- v.preventDefault();
1061
+ l.preventDefault();
1772
1062
  }
1773
- }, Te = {
1774
- ...De ? Object.entries(De).reduce(
1775
- (v, [k, ee]) => (v[`--calendar-${k}`] = ee, v),
1063
+ }, Me = {
1064
+ ...V ? Object.entries(V).reduce(
1065
+ (l, [y, X]) => (l[`--calendar-${y}`] = X, l),
1776
1066
  {}
1777
1067
  ) : {}
1778
1068
  };
1779
- return /* @__PURE__ */ g.jsxs(
1069
+ return /* @__PURE__ */ b(
1780
1070
  "div",
1781
1071
  {
1782
- className: `${M.calendar} ${s}`,
1783
- style: Te,
1784
- "data-theme": F,
1785
- onKeyDown: Me,
1072
+ className: `bsac-calendar ${a}`,
1073
+ style: Me,
1074
+ "data-theme": k,
1075
+ onKeyDown: ye,
1786
1076
  tabIndex: 0,
1787
1077
  role: "application",
1788
1078
  "aria-label": "Calendar",
1789
1079
  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,
1080
+ i === "range" && A && /* @__PURE__ */ b("div", { style: { display: "flex", gap: "16px" }, children: [
1081
+ /* @__PURE__ */ d("div", { children: A({ onRangeChange: fe }) }),
1082
+ /* @__PURE__ */ b("div", { style: { flex: 1 }, children: [
1083
+ /* @__PURE__ */ d(
1084
+ gt,
1795
1085
  {
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
1086
+ currentMonth: B,
1087
+ currentYear: O,
1088
+ months: z,
1089
+ onNavigateMonth: H,
1090
+ onYearChange: _,
1091
+ onMonthChange: U,
1092
+ disabled: r,
1093
+ showNepaliNumbers: M,
1094
+ convertToNepaliNumber: J,
1095
+ calendarType: e
1806
1096
  }
1807
1097
  ),
1808
- /* @__PURE__ */ g.jsx(
1809
- Pe,
1098
+ /* @__PURE__ */ d(
1099
+ mt,
1810
1100
  {
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
1101
+ calendarDays: I,
1102
+ days: ct,
1103
+ onDateSelect: lt,
1104
+ isSelected: (l) => at(l, i),
1105
+ isInRange: rt,
1106
+ isToday: (l) => s && st(l),
1107
+ isDisabled: (l) => nt({ year: O, month: B, day: l }, K, G),
1108
+ disabled: r,
1109
+ showNepaliNumbers: M,
1110
+ convertToNepaliNumber: J
1821
1111
  }
1822
1112
  )
1823
1113
  ] })
1824
1114
  ] }),
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,
1115
+ i === "range" && h && g === "left" && !A && /* @__PURE__ */ b("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1116
+ /* @__PURE__ */ d(
1117
+ Dt,
1828
1118
  {
1829
- presets: Se,
1830
- calendarType: t,
1831
- onPresetSelect: ce,
1832
- activePreset: me,
1119
+ presets: it,
1120
+ calendarType: e,
1121
+ onPresetSelect: ht,
1122
+ activePreset: ot,
1833
1123
  position: "left"
1834
1124
  }
1835
1125
  ),
1836
- /* @__PURE__ */ g.jsxs("div", { children: [
1837
- /* @__PURE__ */ g.jsx(
1838
- $e,
1126
+ /* @__PURE__ */ b("div", { children: [
1127
+ /* @__PURE__ */ d(
1128
+ gt,
1839
1129
  {
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
1130
+ currentMonth: B,
1131
+ currentYear: O,
1132
+ months: z,
1133
+ onNavigateMonth: H,
1134
+ onYearChange: _,
1135
+ onMonthChange: U,
1136
+ disabled: r,
1137
+ showNepaliNumbers: M,
1138
+ convertToNepaliNumber: J,
1139
+ calendarType: e
1850
1140
  }
1851
1141
  ),
1852
- /* @__PURE__ */ g.jsx(
1853
- Pe,
1142
+ /* @__PURE__ */ d(
1143
+ mt,
1854
1144
  {
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
1145
+ calendarDays: I,
1146
+ days: ct,
1147
+ onDateSelect: lt,
1148
+ isSelected: (l) => at(l, i),
1149
+ isInRange: rt,
1150
+ isToday: (l) => s && st(l),
1151
+ isDisabled: (l) => nt({ year: O, month: B, day: l }, K, G),
1152
+ disabled: r,
1153
+ showNepaliNumbers: M,
1154
+ convertToNepaliNumber: J
1865
1155
  }
1866
1156
  )
1867
1157
  ] })
1868
1158
  ] }),
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,
1159
+ i === "range" && h && g === "right" && !A && /* @__PURE__ */ b("div", { style: { display: "flex", gap: "16px", flexWrap: "nowrap" }, children: [
1160
+ /* @__PURE__ */ b("div", { children: [
1161
+ /* @__PURE__ */ d(
1162
+ gt,
1873
1163
  {
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
1164
+ currentMonth: B,
1165
+ currentYear: O,
1166
+ months: z,
1167
+ onNavigateMonth: H,
1168
+ onYearChange: _,
1169
+ onMonthChange: U,
1170
+ disabled: r,
1171
+ showNepaliNumbers: M,
1172
+ convertToNepaliNumber: J,
1173
+ calendarType: e
1884
1174
  }
1885
1175
  ),
1886
- /* @__PURE__ */ g.jsx(
1887
- Pe,
1176
+ /* @__PURE__ */ d(
1177
+ mt,
1888
1178
  {
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
1179
+ calendarDays: I,
1180
+ days: ct,
1181
+ onDateSelect: lt,
1182
+ isSelected: (l) => at(l, i),
1183
+ isInRange: rt,
1184
+ isToday: (l) => s && st(l),
1185
+ isDisabled: (l) => nt({ year: O, month: B, day: l }, K, G),
1186
+ disabled: r,
1187
+ showNepaliNumbers: M,
1188
+ convertToNepaliNumber: J
1899
1189
  }
1900
1190
  )
1901
1191
  ] }),
1902
- /* @__PURE__ */ g.jsx(
1903
- Ie,
1192
+ /* @__PURE__ */ d(
1193
+ Dt,
1904
1194
  {
1905
- presets: Se,
1906
- calendarType: t,
1907
- onPresetSelect: ce,
1908
- activePreset: me,
1195
+ presets: it,
1196
+ calendarType: e,
1197
+ onPresetSelect: ht,
1198
+ activePreset: ot,
1909
1199
  position: "right"
1910
1200
  }
1911
1201
  )
1912
1202
  ] }),
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,
1203
+ (!i || i === "single" || !h && !A || g === "top" || g === "bottom") && /* @__PURE__ */ b(pe, { children: [
1204
+ i === "range" && h && g === "top" && /* @__PURE__ */ d(
1205
+ Dt,
1916
1206
  {
1917
- presets: Se,
1918
- calendarType: t,
1919
- onPresetSelect: ce,
1920
- activePreset: me,
1207
+ presets: it,
1208
+ calendarType: e,
1209
+ onPresetSelect: ht,
1210
+ activePreset: ot,
1921
1211
  position: "top"
1922
1212
  }
1923
1213
  ),
1924
- /* @__PURE__ */ g.jsx(
1925
- $e,
1214
+ /* @__PURE__ */ d(
1215
+ gt,
1926
1216
  {
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
1217
+ currentMonth: B,
1218
+ currentYear: O,
1219
+ months: z,
1220
+ onNavigateMonth: H,
1221
+ onYearChange: _,
1222
+ onMonthChange: U,
1223
+ disabled: r,
1224
+ showNepaliNumbers: M,
1225
+ convertToNepaliNumber: J,
1226
+ calendarType: e
1937
1227
  }
1938
1228
  ),
1939
- /* @__PURE__ */ g.jsx(
1940
- Pe,
1229
+ /* @__PURE__ */ d(
1230
+ mt,
1941
1231
  {
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
1232
+ calendarDays: I,
1233
+ days: ct,
1234
+ onDateSelect: lt,
1235
+ isSelected: (l) => at(l, i),
1236
+ isInRange: rt,
1237
+ isToday: (l) => s && st(l),
1238
+ isDisabled: (l) => nt({ year: O, month: B, day: l }, K, G),
1239
+ disabled: r,
1240
+ showNepaliNumbers: M,
1241
+ convertToNepaliNumber: J
1952
1242
  }
1953
1243
  ),
1954
- c === "range" && h && m === "bottom" && /* @__PURE__ */ g.jsx(
1955
- Ie,
1244
+ i === "range" && h && g === "bottom" && /* @__PURE__ */ d(
1245
+ Dt,
1956
1246
  {
1957
- presets: Se,
1958
- calendarType: t,
1959
- onPresetSelect: ce,
1960
- activePreset: me,
1247
+ presets: it,
1248
+ calendarType: e,
1249
+ onPresetSelect: ht,
1250
+ activePreset: ot,
1961
1251
  position: "bottom"
1962
1252
  }
1963
1253
  )
@@ -1965,154 +1255,129 @@ const jr = [
1965
1255
  ]
1966
1256
  }
1967
1257
  );
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",
1976
- onDateSelect: a,
1977
- inputClassName: s = "",
1978
- popupClassName: r = "",
1979
- style: o,
1980
- inputStyle: i,
1981
- icon: l,
1982
- showIcon: c = !0,
1983
- calendarType: d = "AD",
1258
+ }, N3 = ({
1259
+ placeholder: e = "Select date",
1260
+ format: t = "YYYY-MM-DD",
1261
+ onDateSelect: n,
1262
+ inputClassName: a = "",
1263
+ popupClassName: s = "",
1264
+ style: r,
1265
+ inputStyle: o,
1266
+ icon: u,
1267
+ showIcon: i = !0,
1268
+ calendarType: c = "AD",
1984
1269
  ...h
1985
1270
  }) => {
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);
1990
- };
1991
- return m && document.addEventListener("mousedown", x), () => {
1992
- document.removeEventListener("mousedown", x);
1271
+ const [g, m] = N(!1), [S, f] = N(null), [C, A] = N(""), w = xt(null), F = xt(null), [M, k] = N({ visibility: "hidden" }), V = () => {
1272
+ if (!w.current) return;
1273
+ const D = w.current.getBoundingClientRect(), v = F.current?.offsetHeight || 360, I = F.current?.offsetWidth || 280, E = window.innerHeight - D.bottom, $ = window.innerWidth - D.left, R = E >= v + 8 ? D.bottom + 8 : Math.max(8, D.top - v - 8), _ = $ >= I ? D.left : Math.max(8, D.right - I);
1274
+ k({ top: R, left: _, visibility: "visible" });
1275
+ };
1276
+ Yt(() => (g && (requestAnimationFrame(V), window.addEventListener("scroll", V, !0), window.addEventListener("resize", V)), () => {
1277
+ window.removeEventListener("scroll", V, !0), window.removeEventListener("resize", V);
1278
+ }), [g]), Yt(() => {
1279
+ const D = (v) => {
1280
+ w.current && !w.current.contains(v.target) && m(!1);
1993
1281
  };
1994
- }, [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("");
1282
+ return g && document.addEventListener("mousedown", D), () => document.removeEventListener("mousedown", D);
1283
+ }, [g]);
1284
+ const K = (D) => {
1285
+ f(D), A(c === "BS" ? D.bs : D.ad), m(!1), n?.(D);
1286
+ }, G = (D) => {
1287
+ const v = D.target.value;
1288
+ if (v === "") {
1289
+ A("");
2003
1290
  return;
2004
1291
  }
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);
1292
+ if ((D.target.selectionStart || 0) === v.length && v.length > C.length) {
1293
+ const E = v.replace(/[^0-9]/g, "");
1294
+ let $ = E;
1295
+ E.length > 4 && E.length <= 6 ? $ = E.slice(0, 4) + "-" + E.slice(4) : E.length > 6 && ($ = E.slice(0, 4) + "-" + E.slice(4, 6) + "-" + E.slice(6, 8)), A($);
2009
1296
  } else {
2010
- const P = O.replace(/[^0-9-]/g, "");
2011
- P.length <= 10 && H(P);
1297
+ const E = v.replace(/[^0-9-]/g, "");
1298
+ E.length <= 10 && A(E);
2012
1299
  }
2013
- }, F = () => {
2014
- const x = N.trim();
2015
- if (!x) {
2016
- S(null);
1300
+ }, O = () => {
1301
+ const D = C.trim();
1302
+ if (!D) {
1303
+ f(null);
2017
1304
  return;
2018
1305
  }
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 : ""
2025
- );
1306
+ const v = D.match(/^(\d{4})-(\d{2})-(\d{2})$/);
1307
+ if (v) {
1308
+ const [, I, E, $] = v, R = parseInt(E), _ = parseInt($);
1309
+ if (R < 1 || R > 12 || _ < 1 || _ > 32) {
1310
+ A(S ? c === "BS" ? S.bs : S.ad : "");
2026
1311
  return;
2027
1312
  }
2028
- const K = {
2029
- bs: d === "BS" ? `${B}-${$}-${L}` : "",
2030
- ad: d === "AD" ? `${B}-${$}-${L}` : "",
1313
+ const U = {
1314
+ bs: c === "BS" ? `${I}-${E}-${$}` : "",
1315
+ ad: c === "AD" ? `${I}-${E}-${$}` : "",
2031
1316
  formatted: {
2032
- bs: d === "BS" ? x : "",
2033
- ad: d === "AD" ? x : ""
1317
+ bs: c === "BS" ? D : "",
1318
+ ad: c === "AD" ? D : ""
2034
1319
  }
2035
1320
  };
2036
- S(K), a?.(K);
2037
- } else x.length < 10 && H(
2038
- j ? d === "BS" ? j.formatted.bs : j.formatted.ad : ""
2039
- );
2040
- }, De = (x) => {
2041
- x.key === "Enter" ? (F(), y(!1)) : x.key === "Escape" && y(!1);
1321
+ f(U), n?.(U);
1322
+ } else D.length < 10 && A(S ? c === "BS" ? S.bs : S.ad : "");
2042
1323
  };
2043
- return /* @__PURE__ */ g.jsxs("div", { className: `${Be.datePicker} ${s}`, ref: C, style: o, children: [
2044
- /* @__PURE__ */ g.jsx(
1324
+ return /* @__PURE__ */ b("div", { className: "bsac-datepicker", ref: w, style: r, children: [
1325
+ /* @__PURE__ */ d(
2045
1326
  "input",
2046
1327
  {
2047
1328
  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,
1329
+ value: C,
1330
+ placeholder: e,
1331
+ onChange: G,
1332
+ onBlur: O,
1333
+ onKeyDown: (D) => {
1334
+ D.key === "Enter" ? (O(), m(!1)) : D.key === "Escape" && m(!1);
1335
+ },
1336
+ className: `bsac-input ${a}`,
1337
+ style: o,
2055
1338
  "aria-label": "Date picker input",
2056
1339
  "aria-haspopup": "dialog",
2057
- "aria-expanded": m,
1340
+ "aria-expanded": g,
2058
1341
  maxLength: 10
2059
1342
  }
2060
1343
  ),
2061
- /* @__PURE__ */ g.jsx(
1344
+ /* @__PURE__ */ d(
2062
1345
  "button",
2063
1346
  {
2064
1347
  type: "button",
2065
- className: Be.iconButton,
2066
- onClick: () => y(!m),
1348
+ className: "bsac-icon-btn",
1349
+ onClick: () => m(!g),
2067
1350
  "aria-label": "Toggle calendar",
2068
- style: { display: c ? "flex" : "none" },
2069
- children: l || /* @__PURE__ */ g.jsxs(
2070
- "svg",
2071
- {
2072
- width: "18",
2073
- height: "18",
2074
- viewBox: "0 0 24 24",
2075
- fill: "none",
2076
- stroke: "currentColor",
2077
- strokeWidth: "2",
2078
- 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" })
2083
- ]
2084
- }
2085
- )
1351
+ style: { display: i ? "flex" : "none" },
1352
+ children: u || /* @__PURE__ */ b("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
1353
+ /* @__PURE__ */ d("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
1354
+ /* @__PURE__ */ d("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
1355
+ /* @__PURE__ */ d("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
1356
+ /* @__PURE__ */ d("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
1357
+ ] })
2086
1358
  }
2087
1359
  ),
2088
- m && /* @__PURE__ */ g.jsx("div", { className: `${Be.popup} ${r}`, children: /* @__PURE__ */ g.jsx(
2089
- la,
2090
- {
2091
- calendarType: d,
2092
- onDateSelect: _,
2093
- ...h
2094
- }
2095
- ) })
1360
+ g && /* @__PURE__ */ d("div", { ref: F, className: `bsac-popup ${s}`, style: M, children: /* @__PURE__ */ d(C3, { calendarType: c, onDateSelect: K, ...h }) })
2096
1361
  ] });
2097
1362
  };
2098
1363
  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
1364
+ C3 as Calendar,
1365
+ N3 as CalendarInput,
1366
+ O3 as DEFAULT_COLORS,
1367
+ N3 as DatePicker,
1368
+ p3 as ENGLISH_DAYS,
1369
+ y3 as ENGLISH_MONTHS_AD,
1370
+ me as ENGLISH_MONTHS_BS,
1371
+ M3 as NEPALI_DAYS,
1372
+ b3 as NEPALI_DIGITS,
1373
+ f3 as NEPALI_MONTHS,
1374
+ H3 as PRESET_KEYS,
1375
+ J as convertToNepaliNumber,
1376
+ wt as createDateOutput,
1377
+ Y3 as createPredefinedRanges,
1378
+ De as getDaysInMonth,
1379
+ S3 as getFirstDayOfMonth,
1380
+ T as getTodayDate,
1381
+ T3 as isDateInRange,
1382
+ E3 as useCalendar
2118
1383
  };