@himal_bhattarai/nepali-datepicker 1.1.3 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- import je, { useState as C, useRef as ce, useEffect as de, useCallback as _e } from "react";
2
- var Q = { exports: {} }, W = {};
3
- var pe;
4
- function Ee() {
5
- if (pe) return W;
6
- pe = 1;
7
- var n = /* @__PURE__ */ Symbol.for("react.transitional.element"), l = /* @__PURE__ */ Symbol.for("react.fragment");
1
+ import _e, { useState as M, useRef as pe, useEffect as ie, useCallback as Ee } from "react";
2
+ var K = { exports: {} }, V = {};
3
+ var ue;
4
+ function Se() {
5
+ if (ue) return V;
6
+ ue = 1;
7
+ var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), l = /* @__PURE__ */ Symbol.for("react.fragment");
8
8
  function g(c, d, i) {
9
9
  var x = null;
10
10
  if (i !== void 0 && (x = "" + i), d.key !== void 0 && (x = "" + d.key), "key" in d) {
@@ -13,57 +13,57 @@ function Ee() {
13
13
  a !== "key" && (i[a] = d[a]);
14
14
  } else i = d;
15
15
  return d = i.ref, {
16
- $$typeof: n,
16
+ $$typeof: t,
17
17
  type: c,
18
18
  key: x,
19
19
  ref: d !== void 0 ? d : null,
20
20
  props: i
21
21
  };
22
22
  }
23
- return W.Fragment = l, W.jsx = g, W.jsxs = g, W;
23
+ return V.Fragment = l, V.jsx = g, V.jsxs = g, V;
24
24
  }
25
- var V = {};
26
- var ue;
27
- function Se() {
28
- return ue || (ue = 1, process.env.NODE_ENV !== "production" && (function() {
29
- function n(e) {
25
+ var G = {};
26
+ var fe;
27
+ function Ne() {
28
+ return fe || (fe = 1, process.env.NODE_ENV !== "production" && (function() {
29
+ function t(e) {
30
30
  if (e == null) return null;
31
31
  if (typeof e == "function")
32
- return e.$$typeof === te ? null : e.displayName || e.name || null;
32
+ return e.$$typeof === oe ? null : e.displayName || e.name || null;
33
33
  if (typeof e == "string") return e;
34
34
  switch (e) {
35
- case w:
35
+ case k:
36
36
  return "Fragment";
37
37
  case b:
38
38
  return "Profiler";
39
- case D:
39
+ case R:
40
40
  return "StrictMode";
41
- case Y:
42
- return "Suspense";
43
41
  case $:
42
+ return "Suspense";
43
+ case B:
44
44
  return "SuspenseList";
45
- case ne:
45
+ case te:
46
46
  return "Activity";
47
47
  }
48
48
  if (typeof e == "object")
49
49
  switch (typeof e.tag == "number" && console.error(
50
50
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
51
51
  ), e.$$typeof) {
52
- case R:
52
+ case T:
53
53
  return "Portal";
54
54
  case h:
55
55
  return e.displayName || "Context";
56
- case N:
56
+ case D:
57
57
  return (e._context.displayName || "Context") + ".Consumer";
58
- case y:
58
+ case w:
59
59
  var o = e.render;
60
60
  return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
61
- case re:
62
- return o = e.displayName || null, o !== null ? o : n(e.type) || "Memo";
63
- case B:
61
+ case ne:
62
+ return o = e.displayName || null, o !== null ? o : t(e.type) || "Memo";
63
+ case L:
64
64
  o = e._payload, e = e._init;
65
65
  try {
66
- return n(e(o));
66
+ return t(e(o));
67
67
  } catch {
68
68
  }
69
69
  }
@@ -90,25 +90,25 @@ function Se() {
90
90
  }
91
91
  }
92
92
  function c(e) {
93
- if (e === w) return "<>";
94
- if (typeof e == "object" && e !== null && e.$$typeof === B)
93
+ if (e === k) return "<>";
94
+ if (typeof e == "object" && e !== null && e.$$typeof === L)
95
95
  return "<...>";
96
96
  try {
97
- var o = n(e);
97
+ var o = t(e);
98
98
  return o ? "<" + o + ">" : "<...>";
99
99
  } catch {
100
100
  return "<...>";
101
101
  }
102
102
  }
103
103
  function d() {
104
- var e = A.A;
104
+ var e = O.A;
105
105
  return e === null ? null : e.getOwner();
106
106
  }
107
107
  function i() {
108
108
  return Error("react-stack-top-frame");
109
109
  }
110
110
  function x(e) {
111
- if (O.call(e, "key")) {
111
+ if (P.call(e, "key")) {
112
112
  var o = Object.getOwnPropertyDescriptor(e, "key").get;
113
113
  if (o && o.isReactWarning) return !1;
114
114
  }
@@ -116,7 +116,7 @@ function Se() {
116
116
  }
117
117
  function a(e, o) {
118
118
  function s() {
119
- q || (q = !0, console.error(
119
+ J || (J = !0, console.error(
120
120
  "%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://react.dev/link/special-props)",
121
121
  o
122
122
  ));
@@ -127,15 +127,15 @@ function Se() {
127
127
  });
128
128
  }
129
129
  function f() {
130
- var e = n(this.type);
131
- return J[e] || (J[e] = !0, console.error(
130
+ var e = t(this.type);
131
+ return H[e] || (H[e] = !0, console.error(
132
132
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
133
133
  )), e = this.props.ref, e !== void 0 ? e : null;
134
134
  }
135
- function j(e, o, s, p, T, P) {
135
+ function _(e, o, s, p, A, C) {
136
136
  var u = s.ref;
137
137
  return e = {
138
- $$typeof: M,
138
+ $$typeof: Y,
139
139
  type: e,
140
140
  key: o,
141
141
  props: s,
@@ -157,33 +157,33 @@ function Se() {
157
157
  configurable: !1,
158
158
  enumerable: !1,
159
159
  writable: !0,
160
- value: T
160
+ value: A
161
161
  }), Object.defineProperty(e, "_debugTask", {
162
162
  configurable: !1,
163
163
  enumerable: !1,
164
164
  writable: !0,
165
- value: P
165
+ value: C
166
166
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
167
167
  }
168
- function _(e, o, s, p, T, P) {
168
+ function E(e, o, s, p, A, C) {
169
169
  var u = o.children;
170
170
  if (u !== void 0)
171
171
  if (p)
172
- if (oe(u)) {
172
+ if (ae(u)) {
173
173
  for (p = 0; p < u.length; p++)
174
- E(u[p]);
174
+ S(u[p]);
175
175
  Object.freeze && Object.freeze(u);
176
176
  } else
177
177
  console.error(
178
178
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
179
179
  );
180
- else E(u);
181
- if (O.call(o, "key")) {
182
- u = n(e);
183
- var k = Object.keys(o).filter(function(se) {
184
- return se !== "key";
180
+ else S(u);
181
+ if (P.call(o, "key")) {
182
+ u = t(e);
183
+ var j = Object.keys(o).filter(function(de) {
184
+ return de !== "key";
185
185
  });
186
- p = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", Z[u + p] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
186
+ p = 0 < j.length ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}", Q[u + p] || (j = 0 < j.length ? "{" + j.join(": ..., ") + ": ...}" : "{}", console.error(
187
187
  `A props object containing a "key" prop is being spread into JSX:
188
188
  let props = %s;
189
189
  <%s {...props} />
@@ -192,34 +192,34 @@ React keys must be passed directly to JSX without using spread:
192
192
  <%s key={someKey} {...props} />`,
193
193
  p,
194
194
  u,
195
- k,
195
+ j,
196
196
  u
197
- ), Z[u + p] = !0);
197
+ ), Q[u + p] = !0);
198
198
  }
199
199
  if (u = null, s !== void 0 && (g(s), u = "" + s), x(o) && (g(o.key), u = "" + o.key), "key" in o) {
200
200
  s = {};
201
- for (var z in o)
202
- z !== "key" && (s[z] = o[z]);
201
+ for (var F in o)
202
+ F !== "key" && (s[F] = o[F]);
203
203
  } else s = o;
204
204
  return u && a(
205
205
  s,
206
206
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
207
- ), j(
207
+ ), _(
208
208
  e,
209
209
  u,
210
210
  s,
211
211
  d(),
212
- T,
213
- P
212
+ A,
213
+ C
214
214
  );
215
215
  }
216
- function E(e) {
217
- S(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === B && (e._payload.status === "fulfilled" ? S(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
218
- }
219
216
  function S(e) {
220
- return typeof e == "object" && e !== null && e.$$typeof === M;
217
+ N(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === L && (e._payload.status === "fulfilled" ? N(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
221
218
  }
222
- var v = je, M = /* @__PURE__ */ Symbol.for("react.transitional.element"), R = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), D = /* @__PURE__ */ Symbol.for("react.strict_mode"), b = /* @__PURE__ */ Symbol.for("react.profiler"), N = /* @__PURE__ */ Symbol.for("react.consumer"), h = /* @__PURE__ */ Symbol.for("react.context"), y = /* @__PURE__ */ Symbol.for("react.forward_ref"), Y = /* @__PURE__ */ Symbol.for("react.suspense"), $ = /* @__PURE__ */ Symbol.for("react.suspense_list"), re = /* @__PURE__ */ Symbol.for("react.memo"), B = /* @__PURE__ */ Symbol.for("react.lazy"), ne = /* @__PURE__ */ Symbol.for("react.activity"), te = /* @__PURE__ */ Symbol.for("react.client.reference"), A = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, oe = Array.isArray, L = console.createTask ? console.createTask : function() {
219
+ function N(e) {
220
+ return typeof e == "object" && e !== null && e.$$typeof === Y;
221
+ }
222
+ var v = _e, Y = /* @__PURE__ */ Symbol.for("react.transitional.element"), T = /* @__PURE__ */ Symbol.for("react.portal"), k = /* @__PURE__ */ Symbol.for("react.fragment"), R = /* @__PURE__ */ Symbol.for("react.strict_mode"), b = /* @__PURE__ */ Symbol.for("react.profiler"), D = /* @__PURE__ */ Symbol.for("react.consumer"), h = /* @__PURE__ */ Symbol.for("react.context"), w = /* @__PURE__ */ Symbol.for("react.forward_ref"), $ = /* @__PURE__ */ Symbol.for("react.suspense"), B = /* @__PURE__ */ Symbol.for("react.suspense_list"), ne = /* @__PURE__ */ Symbol.for("react.memo"), L = /* @__PURE__ */ Symbol.for("react.lazy"), te = /* @__PURE__ */ Symbol.for("react.activity"), oe = /* @__PURE__ */ Symbol.for("react.client.reference"), O = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, P = Object.prototype.hasOwnProperty, ae = Array.isArray, z = console.createTask ? console.createTask : function() {
223
223
  return null;
224
224
  };
225
225
  v = {
@@ -227,39 +227,40 @@ React keys must be passed directly to JSX without using spread:
227
227
  return e();
228
228
  }
229
229
  };
230
- var q, J = {}, H = v.react_stack_bottom_frame.bind(
230
+ var J, H = {}, Z = v.react_stack_bottom_frame.bind(
231
231
  v,
232
232
  i
233
- )(), ae = L(c(i)), Z = {};
234
- V.Fragment = w, V.jsx = function(e, o, s) {
235
- var p = 1e4 > A.recentlyCreatedOwnerStacks++;
236
- return _(
233
+ )(), se = z(c(i)), Q = {};
234
+ G.Fragment = k, G.jsx = function(e, o, s) {
235
+ var p = 1e4 > O.recentlyCreatedOwnerStacks++;
236
+ return E(
237
237
  e,
238
238
  o,
239
239
  s,
240
240
  !1,
241
- p ? Error("react-stack-top-frame") : H,
242
- p ? L(c(e)) : ae
241
+ p ? Error("react-stack-top-frame") : Z,
242
+ p ? z(c(e)) : se
243
243
  );
244
- }, V.jsxs = function(e, o, s) {
245
- var p = 1e4 > A.recentlyCreatedOwnerStacks++;
246
- return _(
244
+ }, G.jsxs = function(e, o, s) {
245
+ var p = 1e4 > O.recentlyCreatedOwnerStacks++;
246
+ return E(
247
247
  e,
248
248
  o,
249
249
  s,
250
250
  !0,
251
- p ? Error("react-stack-top-frame") : H,
252
- p ? L(c(e)) : ae
251
+ p ? Error("react-stack-top-frame") : Z,
252
+ p ? z(c(e)) : se
253
253
  );
254
254
  };
255
- })()), V;
255
+ })()), G;
256
256
  }
257
- var fe;
258
- function Ne() {
259
- return fe || (fe = 1, process.env.NODE_ENV === "production" ? Q.exports = Ee() : Q.exports = Se()), Q.exports;
257
+ var me;
258
+ function Te() {
259
+ return me || (me = 1, process.env.NODE_ENV === "production" ? K.exports = Se() : K.exports = Ne()), K.exports;
260
260
  }
261
- var r = Ne();
262
- const X = {
261
+ var n = Te();
262
+ y;
263
+ const q = {
263
264
  2e3: [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
264
265
  2001: [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
265
266
  2002: [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
@@ -351,30 +352,30 @@ const X = {
351
352
  2088: [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
352
353
  2089: [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
353
354
  2090: [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30]
354
- }, ee = new Date(1943, 3, 14);
355
- function Te(n, l, g) {
355
+ }, re = new Date(1943, 3, 14);
356
+ function Re(t, l, g) {
356
357
  let c = 0;
357
- for (let i = 2e3; i < n; i++) {
358
- const x = X[i];
358
+ for (let i = 2e3; i < t; i++) {
359
+ const x = q[i];
359
360
  x && (c += x.reduce((a, f) => a + f, 0));
360
361
  }
361
- const d = X[n] || [];
362
+ const d = q[t] || [];
362
363
  for (let i = 0; i < l - 1; i++) c += d[i] || 30;
363
364
  return c + g - 1;
364
365
  }
365
- function U(n, l, g) {
366
- const c = new Date(ee);
367
- return c.setDate(c.getDate() + Te(n, l, g)), c;
366
+ function X(t, l, g) {
367
+ const c = new Date(re);
368
+ return c.setDate(c.getDate() + Re(t, l, g)), c;
368
369
  }
369
- function Re(n) {
370
- const l = new Date(n.getFullYear(), n.getMonth(), n.getDate()), g = new Date(ee.getFullYear(), ee.getMonth(), ee.getDate());
370
+ function De(t) {
371
+ const l = new Date(t.getFullYear(), t.getMonth(), t.getDate()), g = new Date(re.getFullYear(), re.getMonth(), re.getDate());
371
372
  let c = Math.round((l - g) / 864e5), d = 2e3;
372
373
  for (; d <= 2090; ) {
373
- const a = X[d], f = a ? a.reduce((j, _) => j + _, 0) : 365;
374
+ const a = q[d], f = a ? a.reduce((_, E) => _ + E, 0) : 365;
374
375
  if (c < f) break;
375
376
  c -= f, d++;
376
377
  }
377
- const i = X[d] || [];
378
+ const i = q[d] || [];
378
379
  let x = 1;
379
380
  for (let a = 0; a < 12; a++) {
380
381
  const f = i[a] || 30;
@@ -386,16 +387,16 @@ function Re(n) {
386
387
  }
387
388
  return { year: d, month: x, day: c + 1 };
388
389
  }
389
- function K() {
390
- return Re(/* @__PURE__ */ new Date());
390
+ function ee() {
391
+ return De(/* @__PURE__ */ new Date());
391
392
  }
392
- function me(n, l) {
393
- return (X[n] || [])[l - 1] || 30;
393
+ function he(t, l) {
394
+ return (q[t] || [])[l - 1] || 30;
394
395
  }
395
- function De(n, l) {
396
- return U(n, l, 1).getDay();
396
+ function Ae(t, l) {
397
+ return X(t, l, 1).getDay();
397
398
  }
398
- const he = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "असोज", "कार्तिक", "मङ्सिर", "पुष", "माघ", "फागुन", "चैत्र"], xe = ["Baisakh", "Jestha", "Ashadh", "Shrawan", "Bhadra", "Ashwin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Ae = ["आइत", "सोम", "मङ्गल", "बुध", "बिही", "शुक्र", "शनि"], Oe = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Pe = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], G = (n) => String(n).split("").map((l) => Pe[+l] ?? l).join(""), Ce = (n) => n ? n.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }) : "", Me = `
399
+ const xe = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "असोज", "कार्तिक", "मङ्सिर", "पुष", "माघ", "फागुन", "चैत्र"], be = ["Baisakh", "Jestha", "Ashadh", "Shrawan", "Bhadra", "Ashwin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Oe = ["आइत", "सोम", "मङ्गल", "बुध", "बिही", "शुक्र", "शनि"], Pe = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Ce = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], U = (t) => String(t).split("").map((l) => Ce[+l] ?? l).join(""), Me = (t) => t ? t.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }) : "", Ye = `
399
400
  @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');
400
401
 
401
402
  .ndp{
@@ -431,17 +432,27 @@ const he = ["बैशाख", "जेठ", "असार", "श्रावण"
431
432
  .ndp-icon{position:absolute;right:14px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--ndp-text-muted);transition:color .2s;}
432
433
  .ndp-input.open ~ .ndp-icon{color:var(--ndp-primary);}
433
434
 
434
- /* Popup */
435
+ /* Overlay */
436
+ .ndp-overlay{
437
+ position:fixed; inset:0; z-index:9998;
438
+ background:rgba(0,0,0,0.35);
439
+ display:flex; align-items:center; justify-content:center;
440
+ padding:16px;
441
+ animation:ndp-fade-in .15s ease;
442
+ }
443
+ @keyframes ndp-fade-in{from{opacity:0;}to{opacity:1;}}
444
+
445
+ /* Popup — centered modal */
435
446
  .ndp-popup{
436
- position:absolute; top:calc(100% + 9px); left:0; z-index:9999;
447
+ position:relative; z-index:9999;
437
448
  width:336px;
438
449
  background:var(--ndp-background); border-radius:var(--ndp-radius);
439
450
  box-shadow:var(--ndp-shadow); border:1px solid var(--ndp-border);
440
- overflow:hidden;
441
- animation:ndp-pop .18s cubic-bezier(.34,1.56,.64,1);
442
- transform-origin:top left;
451
+ overflow:visible;
452
+ animation:ndp-pop .2s cubic-bezier(.34,1.56,.64,1);
453
+ transform-origin:center center;
443
454
  }
444
- @keyframes ndp-pop{from{opacity:0;transform:scale(.93) translateY(-8px);}to{opacity:1;transform:none;}}
455
+ @keyframes ndp-pop{from{opacity:0;transform:scale(.93);}to{opacity:1;transform:none;}}
445
456
  @keyframes ndp-slide-left{from{opacity:0;transform:translateX(28px);}to{opacity:1;transform:translateX(0);}}
446
457
  @keyframes ndp-slide-right{from{opacity:0;transform:translateX(-28px);}to{opacity:1;transform:translateX(0);}}
447
458
  .ndp-slide-left{animation:ndp-slide-left .2s cubic-bezier(.25,.8,.25,1);}
@@ -559,6 +570,8 @@ const he = ["बैशाख", "जेठ", "असार", "श्रावण"
559
570
  .ndp-cell.today:not(.picked){
560
571
  background:var(--ndp-today-bg);
561
572
  font-weight:700;color:var(--ndp-primary);
573
+ outline:1.5px solid var(--ndp-primary);
574
+ outline-offset:-1px;
562
575
  }
563
576
  .ndp-cell.picked{
564
577
  background:var(--ndp-primary);color:#fff;font-weight:700;
@@ -587,15 +600,15 @@ const he = ["बैशाख", "जेठ", "असार", "श्रावण"
587
600
  }
588
601
  .ndp-today-btn:hover{background:#FDEECA;}
589
602
  `;
590
- let be = !1;
591
- function Ye() {
592
- if (!be && typeof document < "u") {
593
- const n = document.createElement("style");
594
- n.textContent = Me, document.head.appendChild(n), be = !0;
603
+ let ge = !1;
604
+ function $e() {
605
+ if (!ge && typeof document < "u") {
606
+ const t = document.createElement("style");
607
+ t.textContent = Ye, document.head.appendChild(t), ge = !0;
595
608
  }
596
609
  }
597
- function Le({
598
- value: n,
610
+ function ze({
611
+ value: t,
599
612
  onChange: l,
600
613
  language: g = "np",
601
614
  placeholder: c,
@@ -604,41 +617,41 @@ function Le({
604
617
  className: x = "",
605
618
  styles: a = {}
606
619
  }) {
607
- Ye();
608
- const f = g !== "en", j = K(), [_, E] = C(!1), [S, v] = C(null), [M, R] = C(!1), [w, D] = C(!1), [b, N] = C(() => n?.year ?? K().year), [h, y] = C(() => n?.month ?? K().month), Y = ce(null), $ = ce(null);
609
- de(() => {
610
- const t = (m) => {
611
- Y.current && !Y.current.contains(m.target) && (E(!1), R(!1), D(!1));
620
+ $e();
621
+ const f = g !== "en", _ = ee(), [E, S] = M(!1), [N, v] = M(null), [Y, T] = M(!1), [k, R] = M(!1), [b, D] = M(() => t?.year ?? ee().year), [h, w] = M(() => t?.month ?? ee().month), $ = pe(null), B = pe(null);
622
+ ie(() => {
623
+ const r = (m) => {
624
+ $.current && !$.current.contains(m.target) && (T(!1), R(!1));
612
625
  };
613
- return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
614
- }, []), de(() => {
615
- n && (N(n.year), y(n.month));
616
- }, [n]), de(() => {
617
- if (w && $.current) {
618
- const t = $.current.querySelector(".sel");
619
- t && t.scrollIntoView({ block: "center" });
626
+ return document.addEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
627
+ }, []), ie(() => {
628
+ t && (D(t.year), w(t.month));
629
+ }, [t]), ie(() => {
630
+ if (k && B.current) {
631
+ const r = B.current.querySelector(".sel");
632
+ r && r.scrollIntoView({ block: "center" });
620
633
  }
621
- }, [w]);
622
- const re = _e((t) => {
623
- if (!t) return;
624
- l?.({ year: b, month: h, day: t }, U(b, h, t)), E(!1);
625
- }, [b, h, l]), B = () => {
626
- v("right"), setTimeout(() => v(null), 200), h === 1 ? (y(12), N((t) => t - 1)) : y((t) => t - 1);
627
- }, ne = () => {
628
- v("left"), setTimeout(() => v(null), 200), h === 12 ? (y(1), N((t) => t + 1)) : y((t) => t + 1);
634
+ }, [k]);
635
+ const ne = Ee((r) => {
636
+ if (!r) return;
637
+ l?.({ year: b, month: h, day: r }, X(b, h, r)), S(!1);
638
+ }, [b, h, l]), L = () => {
639
+ v("right"), setTimeout(() => v(null), 200), h === 1 ? (w(12), D((r) => r - 1)) : w((r) => r - 1);
629
640
  }, te = () => {
630
- const t = K();
631
- N(t.year), y(t.month), l?.(t, U(t.year, t.month, t.day)), E(!1);
632
- }, A = me(b, h), O = De(b, h), oe = h === 1 ? 12 : h - 1, L = h === 1 ? b - 1 : b, q = me(L, oe), J = Array.from({ length: O }, (t, m) => ({
633
- day: q - O + 1 + m,
641
+ v("left"), setTimeout(() => v(null), 200), h === 12 ? (w(1), D((r) => r + 1)) : w((r) => r + 1);
642
+ }, oe = () => {
643
+ const r = ee();
644
+ D(r.year), w(r.month), l?.(r, X(r.year, r.month, r.day)), S(!1);
645
+ }, O = he(b, h), P = Ae(b, h), ae = h === 1 ? 12 : h - 1, z = h === 1 ? b - 1 : b, J = he(z, ae), H = Array.from({ length: P }, (r, m) => ({
646
+ day: J - P + 1 + m,
634
647
  overflow: "prev"
635
- })), H = Array.from({ length: A }, (t, m) => ({
648
+ })), Z = Array.from({ length: O }, (r, m) => ({
636
649
  day: m + 1,
637
650
  overflow: null
638
- })), Z = 42 - (O + A), e = Array.from({ length: Z }, (t, m) => ({
651
+ })), Q = 42 - (P + O), e = Array.from({ length: Q }, (r, m) => ({
639
652
  day: m + 1,
640
653
  overflow: "next"
641
- })), o = [...J, ...H, ...e], s = f ? he : xe, p = f ? Ae : Oe, T = s[h - 1], P = f ? G(b) : String(b), k = U(b, h, 1).toLocaleDateString("en-GB", { month: "short", year: "numeric" }), z = n ? f ? `${G(n.year)} ${he[n.month - 1]} ${G(n.day)}` : `${n.year} ${xe[n.month - 1]} ${n.day}` : "", se = f ? "मिति छान्नुहोस्" : "Select BS date", ie = n ? U(n.year, n.month, n.day) : null, ge = Array.from({ length: i - d + 1 }, (t, m) => d + m), ve = {
654
+ })), o = [...H, ...Z, ...e], s = f ? xe : be, p = f ? Oe : Pe, A = s[h - 1], C = f ? U(b) : String(b), j = X(b, h, 1).toLocaleDateString("en-GB", { month: "short", year: "numeric" }), F = t ? f ? `${U(t.year)} ${xe[t.month - 1]} ${U(t.day)}` : `${t.year} ${be[t.month - 1]} ${t.day}` : "", de = f ? "मिति छान्नुहोस्" : "Select BS date", le = t ? X(t.year, t.month, t.day) : null, ve = Array.from({ length: i - d + 1 }, (r, m) => d + m), ye = {
642
655
  ...a.primary && { "--ndp-primary": a.primary },
643
656
  ...a.primarySoft && { "--ndp-primary-soft": a.primarySoft },
644
657
  ...a.background && { "--ndp-background": a.background },
@@ -650,124 +663,129 @@ function Le({
650
663
  ...a.radius && { "--ndp-radius": a.radius },
651
664
  ...a.shadow && { "--ndp-shadow": a.shadow }
652
665
  };
653
- return /* @__PURE__ */ r.jsxs("div", { className: `ndp${x ? ` ${x}` : ""}`, ref: Y, style: ve, children: [
654
- /* @__PURE__ */ r.jsxs("div", { className: "ndp-wrap", onClick: () => E((t) => !t), children: [
655
- /* @__PURE__ */ r.jsx(
666
+ return /* @__PURE__ */ n.jsxs("div", { className: `ndp${x ? ` ${x}` : ""}`, ref: $, style: ye, children: [
667
+ /* @__PURE__ */ n.jsxs("div", { className: "ndp-wrap", onClick: () => S((r) => !r), children: [
668
+ /* @__PURE__ */ n.jsx(
656
669
  "input",
657
670
  {
658
671
  readOnly: !0,
659
- className: `ndp-input${_ ? " open" : ""}`,
660
- value: z,
661
- placeholder: c ?? se
672
+ className: `ndp-input${E ? " open" : ""}`,
673
+ value: F,
674
+ placeholder: c ?? de
662
675
  }
663
676
  ),
664
- /* @__PURE__ */ r.jsx("span", { className: "ndp-icon", children: /* @__PURE__ */ r.jsxs("svg", { width: "17", height: "17", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
665
- /* @__PURE__ */ r.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
666
- /* @__PURE__ */ r.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
667
- /* @__PURE__ */ r.jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
668
- /* @__PURE__ */ r.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
677
+ /* @__PURE__ */ n.jsx("span", { className: "ndp-icon", children: /* @__PURE__ */ n.jsxs("svg", { width: "17", height: "17", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
678
+ /* @__PURE__ */ n.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
679
+ /* @__PURE__ */ n.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
680
+ /* @__PURE__ */ n.jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
681
+ /* @__PURE__ */ n.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
669
682
  ] }) })
670
683
  ] }),
671
- _ && /* @__PURE__ */ r.jsxs("div", { className: "ndp-popup", children: [
672
- /* @__PURE__ */ r.jsx("div", { className: "ndp-hd", children: /* @__PURE__ */ r.jsxs("div", { className: "ndp-hd-row", children: [
673
- /* @__PURE__ */ r.jsx("button", { className: "ndp-nav", onClick: B, children: /* @__PURE__ */ r.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("path", { d: "m15 18-6-6 6-6" }) }) }),
674
- /* @__PURE__ */ r.jsxs("div", { className: `ndp-hd-center${S ? ` ndp-slide-${S}` : ""}`, children: [
675
- /* @__PURE__ */ r.jsx("div", { className: "ndp-hd-month", children: T }),
676
- /* @__PURE__ */ r.jsxs("div", { className: "ndp-hd-sub", children: [
677
- P,
684
+ E && /* @__PURE__ */ n.jsx("div", { className: "ndp-overlay", onMouseDown: (r) => {
685
+ r.target === r.currentTarget && (S(!1), T(!1), R(!1));
686
+ }, children: /* @__PURE__ */ n.jsxs("div", { className: "ndp-popup", children: [
687
+ /* @__PURE__ */ n.jsx("div", { className: "ndp-hd", children: /* @__PURE__ */ n.jsxs("div", { className: "ndp-hd-row", children: [
688
+ /* @__PURE__ */ n.jsx("button", { type: "button", className: "ndp-nav", onClick: L, children: /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n.jsx("path", { d: "m15 18-6-6 6-6" }) }) }),
689
+ /* @__PURE__ */ n.jsxs("div", { className: `ndp-hd-center${N ? ` ndp-slide-${N}` : ""}`, children: [
690
+ /* @__PURE__ */ n.jsx("div", { className: "ndp-hd-month", children: A }),
691
+ /* @__PURE__ */ n.jsxs("div", { className: "ndp-hd-sub", children: [
692
+ C,
678
693
  " BS · ",
679
- k
694
+ j
680
695
  ] })
681
696
  ] }),
682
- /* @__PURE__ */ r.jsx("button", { className: "ndp-nav", onClick: ne, children: /* @__PURE__ */ r.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("path", { d: "m9 18 6-6-6-6" }) }) })
697
+ /* @__PURE__ */ n.jsx("button", { type: "button", className: "ndp-nav", onClick: te, children: /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n.jsx("path", { d: "m9 18 6-6-6-6" }) }) })
683
698
  ] }) }),
684
- /* @__PURE__ */ r.jsxs("div", { className: "ndp-controls", children: [
685
- /* @__PURE__ */ r.jsxs("div", { className: "ndp-dd", children: [
686
- /* @__PURE__ */ r.jsxs(
699
+ /* @__PURE__ */ n.jsxs("div", { className: "ndp-controls", children: [
700
+ /* @__PURE__ */ n.jsxs("div", { className: "ndp-dd", children: [
701
+ /* @__PURE__ */ n.jsxs(
687
702
  "button",
688
703
  {
689
- className: `ndp-dd-trigger${M ? " active" : ""}`,
704
+ type: "button",
705
+ className: `ndp-dd-trigger${Y ? " active" : ""}`,
690
706
  onClick: () => {
691
- R((t) => !t), D(!1);
707
+ T((r) => !r), R(!1);
692
708
  },
693
709
  children: [
694
- /* @__PURE__ */ r.jsx("span", { children: T }),
695
- /* @__PURE__ */ r.jsx("span", { className: "ndp-dd-arrow", children: /* @__PURE__ */ r.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("path", { d: "m6 9 6 6 6-6" }) }) })
710
+ /* @__PURE__ */ n.jsx("span", { children: A }),
711
+ /* @__PURE__ */ n.jsx("span", { className: "ndp-dd-arrow", children: /* @__PURE__ */ n.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n.jsx("path", { d: "m6 9 6 6 6-6" }) }) })
696
712
  ]
697
713
  }
698
714
  ),
699
- M && /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-panel", children: /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-months", children: s.map((t, m) => /* @__PURE__ */ r.jsx(
715
+ Y && /* @__PURE__ */ n.jsx("div", { className: "ndp-dd-panel", children: /* @__PURE__ */ n.jsx("div", { className: "ndp-dd-months", children: s.map((r, m) => /* @__PURE__ */ n.jsx(
700
716
  "button",
701
717
  {
702
718
  className: `ndp-dd-month-item${h === m + 1 ? " sel" : ""}`,
703
719
  onClick: () => {
704
- v(m + 1 < h ? "right" : "left"), setTimeout(() => v(null), 200), y(m + 1), R(!1);
720
+ v(m + 1 < h ? "right" : "left"), setTimeout(() => v(null), 200), w(m + 1), T(!1);
705
721
  },
706
- children: t
722
+ children: r
707
723
  },
708
724
  m
709
725
  )) }) })
710
726
  ] }),
711
- /* @__PURE__ */ r.jsxs("div", { className: "ndp-dd", children: [
712
- /* @__PURE__ */ r.jsxs(
727
+ /* @__PURE__ */ n.jsxs("div", { className: "ndp-dd", children: [
728
+ /* @__PURE__ */ n.jsxs(
713
729
  "button",
714
730
  {
715
- className: `ndp-dd-trigger${w ? " active" : ""}`,
731
+ type: "button",
732
+ className: `ndp-dd-trigger${k ? " active" : ""}`,
716
733
  onClick: () => {
717
- D((t) => !t), R(!1);
734
+ R((r) => !r), T(!1);
718
735
  },
719
736
  children: [
720
- /* @__PURE__ */ r.jsx("span", { children: P }),
721
- /* @__PURE__ */ r.jsx("span", { className: "ndp-dd-arrow", children: /* @__PURE__ */ r.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r.jsx("path", { d: "m6 9 6 6 6-6" }) }) })
737
+ /* @__PURE__ */ n.jsx("span", { children: C }),
738
+ /* @__PURE__ */ n.jsx("span", { className: "ndp-dd-arrow", children: /* @__PURE__ */ n.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n.jsx("path", { d: "m6 9 6 6 6-6" }) }) })
722
739
  ]
723
740
  }
724
741
  ),
725
- w && /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-panel", children: /* @__PURE__ */ r.jsx("div", { className: "ndp-dd-years", ref: $, children: ge.map((t) => /* @__PURE__ */ r.jsx(
742
+ k && /* @__PURE__ */ n.jsx("div", { className: "ndp-dd-panel", children: /* @__PURE__ */ n.jsx("div", { className: "ndp-dd-years", ref: B, children: ve.map((r) => /* @__PURE__ */ n.jsx(
726
743
  "button",
727
744
  {
728
- className: `ndp-dd-year-item${b === t ? " sel" : ""}`,
745
+ className: `ndp-dd-year-item${b === r ? " sel" : ""}`,
729
746
  onClick: () => {
730
- N(t), D(!1);
747
+ D(r), R(!1);
731
748
  },
732
- children: f ? G(t) : t
749
+ children: f ? U(r) : r
733
750
  },
734
- t
751
+ r
735
752
  )) }) })
736
753
  ] })
737
754
  ] }),
738
- /* @__PURE__ */ r.jsxs("div", { className: "ndp-body", children: [
739
- /* @__PURE__ */ r.jsx("div", { className: "ndp-wdays", children: p.map((t, m) => /* @__PURE__ */ r.jsx("div", { className: "ndp-wday", children: t }, m)) }),
740
- /* @__PURE__ */ r.jsx("div", { className: `ndp-grid${S ? ` ndp-slide-${S}` : ""}`, children: o.map(({ day: t, overflow: m }, le) => {
741
- const ye = le % 7 === 6, F = m !== null, we = !F && t === j.day && h === j.month && b === j.year, ke = !F && n && t === n.day && h === n.month && b === n.year;
742
- let I = "ndp-cell";
743
- return F ? I += " overflow" : ye && (I += " wknd"), we && (I += " today"), ke && (I += " picked"), /* @__PURE__ */ r.jsx(
755
+ /* @__PURE__ */ n.jsxs("div", { className: "ndp-body", children: [
756
+ /* @__PURE__ */ n.jsx("div", { className: "ndp-wdays", children: p.map((r, m) => /* @__PURE__ */ n.jsx("div", { className: "ndp-wday", children: r }, m)) }),
757
+ /* @__PURE__ */ n.jsx("div", { className: `ndp-grid${N ? ` ndp-slide-${N}` : ""}`, children: o.map(({ day: r, overflow: m }, ce) => {
758
+ const we = ce % 7 === 6, I = m !== null, ke = !I && r === _.day && h === _.month && b === _.year, je = !I && t && r === t.day && h === t.month && b === t.year;
759
+ let W = "ndp-cell";
760
+ return I ? W += " overflow" : we && (W += " wknd"), ke && (W += " today"), je && (W += " picked"), /* @__PURE__ */ n.jsx(
744
761
  "button",
745
762
  {
746
- className: I,
747
- disabled: F,
748
- onClick: () => !F && re(t),
749
- children: f ? G(t) : t
763
+ type: "button",
764
+ className: W,
765
+ disabled: I,
766
+ onClick: () => !I && ne(r),
767
+ children: f ? U(r) : r
750
768
  },
751
- le
769
+ ce
752
770
  );
753
771
  }) })
754
772
  ] }),
755
- /* @__PURE__ */ r.jsxs("div", { className: "ndp-ft", children: [
756
- /* @__PURE__ */ r.jsx("span", { className: "ndp-ad", children: ie ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
757
- /* @__PURE__ */ r.jsx("b", { children: "AD:" }),
773
+ /* @__PURE__ */ n.jsxs("div", { className: "ndp-ft", children: [
774
+ /* @__PURE__ */ n.jsx("span", { className: "ndp-ad", children: le ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
775
+ /* @__PURE__ */ n.jsx("b", { children: "AD:" }),
758
776
  " ",
759
- Ce(ie)
760
- ] }) : /* @__PURE__ */ r.jsx("span", { style: { color: "var(--ndp-text-muted)", fontSize: 12 }, children: f ? "मिति छानिएको छैन" : "No date selected" }) }),
761
- /* @__PURE__ */ r.jsx("button", { className: "ndp-today-btn", onClick: te, children: f ? "आज" : "Today" })
777
+ Me(le)
778
+ ] }) : /* @__PURE__ */ n.jsx("span", { style: { color: "var(--ndp-text-muted)", fontSize: 12 }, children: f ? "मिति छानिएको छैन" : "No date selected" }) }),
779
+ /* @__PURE__ */ n.jsx("button", { type: "button", className: "ndp-today-btn", onClick: oe, children: f ? "आज" : "Today" })
762
780
  ] })
763
- ] })
781
+ ] }) })
764
782
  ] });
765
783
  }
766
784
  export {
767
- Le as NepaliDatePicker,
768
- Re as adToBs,
769
- U as bsToAd,
770
- me as getDaysInBSMonth,
771
- De as getFirstDayOfWeekBS,
772
- K as getTodayBS
785
+ ze as NepaliDatePicker,
786
+ De as adToBs,
787
+ X as bsToAd,
788
+ he as getDaysInBSMonth,
789
+ Ae as getFirstDayOfWeekBS,
790
+ ee as getTodayBS
773
791
  };
@@ -1,9 +1,9 @@
1
- (function(y,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(y=typeof globalThis<"u"?globalThis:y||self,x(y.NepaliDatePicker={},y.React))})(this,(function(y,x){"use strict";var Z={exports:{}},B={};var ce;function ve(){if(ce)return B;ce=1;var n=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function v(l,d,i){var b=null;if(i!==void 0&&(b=""+i),d.key!==void 0&&(b=""+d.key),"key"in d){i={};for(var a in d)a!=="key"&&(i[a]=d[a])}else i=d;return d=i.ref,{$$typeof:n,type:l,key:b,ref:d!==void 0?d:null,props:i}}return B.Fragment=c,B.jsx=v,B.jsxs=v,B}var L={};var le;function ye(){return le||(le=1,process.env.NODE_ENV!=="production"&&(function(){function n(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case g:return"Profiler";case P:return"StrictMode";case V:return"Suspense";case G:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case O:return"Portal";case h:return e.displayName||"Context";case R:return(e._context.displayName||"Context")+".Consumer";case k:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return o=e.displayName||null,o!==null?o:n(e.type)||"Memo";case U:o=e._payload,e=e._init;try{return n(e(o))}catch{}}return null}function c(e){return""+e}function v(e){try{c(e);var o=!1}catch{o=!0}if(o){o=console;var s=o.error,p=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",p),c(e)}}function l(e){if(e===j)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===U)return"<...>";try{var o=n(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function d(){var e=C.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function b(e){if(M.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function a(e,o){function s(){K||(K=!0,console.error("%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://react.dev/link/special-props)",o))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function f(){var e=n(this.type);return q[e]||(q[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function _(e,o,s,p,D,Y){var u=s.ref;return e={$$typeof:W,type:e,key:o,props:s,_owner:p},(u!==void 0?u:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:f}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function E(e,o,s,p,D,Y){var u=o.children;if(u!==void 0)if(p)if(se(u)){for(p=0;p<u.length;p++)N(u[p]);Object.freeze&&Object.freeze(u)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else N(u);if(M.call(o,"key")){u=n(e);var S=Object.keys(o).filter(function(ie){return ie!=="key"});p=0<S.length?"{key: someKey, "+S.join(": ..., ")+": ...}":"{key: someKey}",re[u+p]||(S=0<S.length?"{"+S.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(w,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(w=typeof globalThis<"u"?globalThis:w||self,x(w.NepaliDatePicker={},w.React))})(this,(function(w,x){"use strict";var Q={exports:{}},L={};var le;function ve(){if(le)return L;le=1;var t=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function v(l,d,i){var b=null;if(i!==void 0&&(b=""+i),d.key!==void 0&&(b=""+d.key),"key"in d){i={};for(var a in d)a!=="key"&&(i[a]=d[a])}else i=d;return d=i.ref,{$$typeof:t,type:l,key:b,ref:d!==void 0?d:null,props:i}}return L.Fragment=c,L.jsx=v,L.jsxs=v,L}var z={};var pe;function we(){return pe||(pe=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case g:return"Profiler";case A:return"StrictMode";case G:return"Suspense";case U:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case D:return"Portal";case h:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case j:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oe:return o=e.displayName||null,o!==null?o:t(e.type)||"Memo";case X:o=e._payload,e=e._init;try{return t(e(o))}catch{}}return null}function c(e){return""+e}function v(e){try{c(e);var o=!1}catch{o=!0}if(o){o=console;var s=o.error,p=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",p),c(e)}}function l(e){if(e===S)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===X)return"<...>";try{var o=t(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function d(){var e=M.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function b(e){if(Y.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function a(e,o){function s(){q||(q=!0,console.error("%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://react.dev/link/special-props)",o))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function f(){var e=t(this.type);return ee[e]||(ee[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function E(e,o,s,p,P,B){var u=s.ref;return e={$$typeof:V,type:e,key:o,props:s,_owner:p},(u!==void 0?u:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:f}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function N(e,o,s,p,P,B){var u=o.children;if(u!==void 0)if(p)if(de(u)){for(p=0;p<u.length;p++)T(u[p]);Object.freeze&&Object.freeze(u)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else T(u);if(Y.call(o,"key")){u=t(e);var _=Object.keys(o).filter(function(ce){return ce!=="key"});p=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",ne[u+p]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,p,u,S,u),re[u+p]=!0)}if(u=null,s!==void 0&&(v(s),u=""+s),b(o)&&(v(o.key),u=""+o.key),"key"in o){s={};for(var J in o)J!=="key"&&(s[J]=o[J])}else s=o;return u&&a(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),_(e,u,s,d(),D,Y)}function N(e){T(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===U&&(e._payload.status==="fulfilled"?T(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function T(e){return typeof e=="object"&&e!==null&&e.$$typeof===W}var w=x,W=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),h=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ae=Symbol.for("react.client.reference"),C=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,se=Array.isArray,X=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(e){return e()}};var K,q={},ee=w.react_stack_bottom_frame.bind(w,i)(),de=X(l(i)),re={};L.Fragment=j,L.jsx=function(e,o,s){var p=1e4>C.recentlyCreatedOwnerStacks++;return E(e,o,s,!1,p?Error("react-stack-top-frame"):ee,p?X(l(e)):de)},L.jsxs=function(e,o,s){var p=1e4>C.recentlyCreatedOwnerStacks++;return E(e,o,s,!0,p?Error("react-stack-top-frame"):ee,p?X(l(e)):de)}})()),L}var pe;function we(){return pe||(pe=1,process.env.NODE_ENV==="production"?Z.exports=ve():Z.exports=ye()),Z.exports}var r=we();const F={2e3:[30,32,31,32,31,30,30,30,29,30,29,31],2001:[31,31,32,31,31,31,30,29,30,29,30,30],2002:[31,31,32,32,31,30,30,29,30,29,30,30],2003:[31,32,31,32,31,30,30,30,29,29,30,31],2004:[30,32,31,32,31,30,30,30,29,30,29,31],2005:[31,31,32,31,31,31,30,29,30,29,30,30],2006:[31,31,32,32,31,30,30,29,30,29,30,30],2007:[31,32,31,32,31,30,30,30,29,29,30,31],2008:[31,31,31,32,31,31,29,30,30,29,29,31],2009:[31,31,32,31,31,31,30,29,30,29,30,30],2010:[31,31,32,32,31,30,30,29,30,29,30,30],2011:[31,32,31,32,31,30,30,30,29,29,30,31],2012:[31,31,31,32,31,31,29,30,30,29,30,30],2013:[31,31,32,31,31,31,30,29,30,29,30,30],2014:[31,31,32,32,31,30,30,29,30,29,30,30],2015:[31,32,31,32,31,30,30,30,29,29,30,31],2016:[31,31,31,32,31,31,29,30,30,29,30,30],2017:[31,31,32,31,31,31,30,29,30,29,30,30],2018:[31,31,32,32,31,30,30,29,30,29,30,30],2019:[31,32,31,32,31,30,30,30,29,29,30,31],2020:[31,31,31,32,31,31,30,29,30,29,30,30],2021:[31,31,32,31,31,31,30,29,30,29,30,30],2022:[31,31,32,32,31,30,30,29,30,29,30,30],2023:[31,32,31,32,31,30,30,30,29,29,30,31],2024:[31,31,31,32,31,31,30,29,30,29,30,30],2025:[31,31,32,31,31,31,30,29,30,29,30,30],2026:[31,31,32,32,31,30,30,29,30,29,30,30],2027:[31,32,31,32,31,30,30,30,29,29,30,32],2028:[30,32,31,32,31,30,30,30,29,30,29,31],2029:[31,31,32,31,31,31,30,29,30,29,30,30],2030:[31,31,32,32,31,30,30,29,30,29,30,30],2031:[31,32,31,32,31,30,30,30,29,29,30,31],2032:[30,32,31,32,31,30,30,30,29,30,29,31],2033:[31,31,32,31,31,31,30,29,30,29,30,30],2034:[31,31,32,32,31,30,30,29,30,29,30,30],2035:[31,32,31,32,31,30,30,30,29,29,30,31],2036:[30,32,31,32,31,31,29,30,30,29,29,31],2037:[31,31,32,31,31,31,30,29,30,29,30,30],2038:[31,31,32,32,31,30,30,29,30,29,30,30],2039:[31,32,31,32,31,30,30,30,29,29,30,31],2040:[31,31,31,32,31,31,29,30,30,29,30,30],2041:[31,31,32,31,31,31,30,29,30,29,30,30],2042:[31,31,32,32,31,30,30,29,30,29,30,31],2043:[31,32,31,32,31,30,30,30,29,29,30,30],2044:[31,31,31,32,31,31,29,30,30,29,30,30],2045:[31,31,32,31,31,31,30,29,30,29,30,30],2046:[31,31,32,32,31,30,30,29,30,29,30,30],2047:[31,32,31,32,31,30,30,30,29,29,30,31],2048:[30,32,31,32,31,30,30,30,29,30,29,31],2049:[31,31,32,31,31,31,30,29,30,29,30,30],2050:[31,31,32,32,31,30,30,29,30,29,30,30],2051:[31,32,31,32,31,30,30,30,29,29,30,31],2052:[31,31,31,32,31,31,29,30,30,29,30,30],2053:[31,31,32,31,31,31,30,29,30,29,30,30],2054:[31,31,32,32,31,30,30,29,30,29,30,30],2055:[31,32,31,32,31,30,30,30,29,29,30,31],2056:[31,31,31,32,31,31,30,29,30,29,30,30],2057:[31,31,32,31,31,31,30,29,30,29,30,30],2058:[31,31,32,32,31,30,30,29,30,29,30,30],2059:[31,32,31,32,31,30,30,30,29,29,30,31],2060:[31,31,31,32,31,31,30,29,30,29,30,30],2061:[31,31,32,31,31,31,30,29,30,29,30,30],2062:[31,31,32,32,31,30,30,29,30,29,30,30],2063:[31,32,31,32,31,30,30,30,29,29,30,31],2064:[31,31,31,32,31,31,29,30,29,30,29,31],2065:[31,31,32,31,31,31,30,29,30,29,30,30],2066:[31,31,32,32,31,30,30,29,30,29,30,30],2067:[31,32,31,32,31,30,30,30,29,29,30,31],2068:[31,31,31,32,31,31,29,30,30,29,30,30],2069:[31,31,32,31,31,31,30,29,30,29,30,30],2070:[31,31,32,32,31,30,30,29,30,29,30,30],2071:[31,32,31,32,31,30,30,30,29,29,30,31],2072:[31,31,31,32,31,31,29,30,30,29,30,30],2073:[31,31,32,31,31,31,30,29,30,29,30,30],2074:[31,31,32,32,31,30,30,29,30,29,30,30],2075:[31,32,31,32,31,30,30,30,29,29,30,31],2076:[31,31,31,32,31,31,30,29,30,29,30,30],2077:[31,31,32,31,31,31,30,29,30,29,30,30],2078:[31,31,32,32,31,30,30,29,30,29,30,30],2079:[31,32,31,32,31,30,30,30,29,29,30,31],2080:[31,31,31,32,31,31,30,29,30,29,30,30],2081:[31,31,32,31,31,31,30,29,30,29,30,30],2082:[31,32,31,32,31,30,30,29,30,29,30,30],2083:[31,32,31,32,31,30,30,30,29,30,29,31],2084:[31,31,31,32,31,31,30,29,30,29,30,30],2085:[31,31,32,31,31,31,30,29,30,29,30,30],2086:[31,32,31,32,31,30,30,29,30,29,30,30],2087:[31,32,31,32,31,30,30,30,29,29,30,31],2088:[30,32,31,32,31,30,30,30,29,30,29,31],2089:[31,31,32,31,31,31,30,29,30,29,30,30],2090:[31,31,32,32,31,30,30,29,30,29,30,30]},Q=new Date(1943,3,14);function ke(n,c,v){let l=0;for(let i=2e3;i<n;i++){const b=F[i];b&&(l+=b.reduce((a,f)=>a+f,0))}const d=F[n]||[];for(let i=0;i<c-1;i++)l+=d[i]||30;return l+v-1}function A(n,c,v){const l=new Date(Q);return l.setDate(l.getDate()+ke(n,c,v)),l}function ue(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate()),v=new Date(Q.getFullYear(),Q.getMonth(),Q.getDate());let l=Math.round((c-v)/864e5),d=2e3;for(;d<=2090;){const a=F[d],f=a?a.reduce((_,E)=>_+E,0):365;if(l<f)break;l-=f,d++}const i=F[d]||[];let b=1;for(let a=0;a<12;a++){const f=i[a]||30;if(l<f){b=a+1;break}l-=f,a===11&&(b=12)}return{year:d,month:b,day:l+1}}function z(){return ue(new Date)}function ne(n,c){return(F[n]||[])[c-1]||30}function fe(n,c){return A(n,c,1).getDay()}const me=["बैशाख","जेठ","असार","श्रावण","भाद्र","असोज","कार्तिक","मङ्सिर","पुष","माघ","फागुन","चैत्र"],he=["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Poush","Magh","Falgun","Chaitra"],je=["आइत","सोम","मङ्गल","बुध","बिही","शुक्र","शनि"],Se=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],_e=["०","१","२","३","४","५","६","७","८","९"],I=n=>String(n).split("").map(c=>_e[+c]??c).join(""),Ee=n=>n?n.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"",Ne=`
6
+ <%s key={someKey} {...props} />`,p,u,_,u),ne[u+p]=!0)}if(u=null,s!==void 0&&(v(s),u=""+s),b(o)&&(v(o.key),u=""+o.key),"key"in o){s={};for(var H in o)H!=="key"&&(s[H]=o[H])}else s=o;return u&&a(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),E(e,u,s,d(),P,B)}function T(e){R(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===X&&(e._payload.status==="fulfilled"?R(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function R(e){return typeof e=="object"&&e!==null&&e.$$typeof===V}var k=x,V=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),h=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),M=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,de=Array.isArray,J=console.createTask?console.createTask:function(){return null};k={react_stack_bottom_frame:function(e){return e()}};var q,ee={},re=k.react_stack_bottom_frame.bind(k,i)(),ie=J(l(i)),ne={};z.Fragment=S,z.jsx=function(e,o,s){var p=1e4>M.recentlyCreatedOwnerStacks++;return N(e,o,s,!1,p?Error("react-stack-top-frame"):re,p?J(l(e)):ie)},z.jsxs=function(e,o,s){var p=1e4>M.recentlyCreatedOwnerStacks++;return N(e,o,s,!0,p?Error("react-stack-top-frame"):re,p?J(l(e)):ie)}})()),z}var ue;function ke(){return ue||(ue=1,process.env.NODE_ENV==="production"?Q.exports=ve():Q.exports=we()),Q.exports}var r=ke();y;const F={2e3:[30,32,31,32,31,30,30,30,29,30,29,31],2001:[31,31,32,31,31,31,30,29,30,29,30,30],2002:[31,31,32,32,31,30,30,29,30,29,30,30],2003:[31,32,31,32,31,30,30,30,29,29,30,31],2004:[30,32,31,32,31,30,30,30,29,30,29,31],2005:[31,31,32,31,31,31,30,29,30,29,30,30],2006:[31,31,32,32,31,30,30,29,30,29,30,30],2007:[31,32,31,32,31,30,30,30,29,29,30,31],2008:[31,31,31,32,31,31,29,30,30,29,29,31],2009:[31,31,32,31,31,31,30,29,30,29,30,30],2010:[31,31,32,32,31,30,30,29,30,29,30,30],2011:[31,32,31,32,31,30,30,30,29,29,30,31],2012:[31,31,31,32,31,31,29,30,30,29,30,30],2013:[31,31,32,31,31,31,30,29,30,29,30,30],2014:[31,31,32,32,31,30,30,29,30,29,30,30],2015:[31,32,31,32,31,30,30,30,29,29,30,31],2016:[31,31,31,32,31,31,29,30,30,29,30,30],2017:[31,31,32,31,31,31,30,29,30,29,30,30],2018:[31,31,32,32,31,30,30,29,30,29,30,30],2019:[31,32,31,32,31,30,30,30,29,29,30,31],2020:[31,31,31,32,31,31,30,29,30,29,30,30],2021:[31,31,32,31,31,31,30,29,30,29,30,30],2022:[31,31,32,32,31,30,30,29,30,29,30,30],2023:[31,32,31,32,31,30,30,30,29,29,30,31],2024:[31,31,31,32,31,31,30,29,30,29,30,30],2025:[31,31,32,31,31,31,30,29,30,29,30,30],2026:[31,31,32,32,31,30,30,29,30,29,30,30],2027:[31,32,31,32,31,30,30,30,29,29,30,32],2028:[30,32,31,32,31,30,30,30,29,30,29,31],2029:[31,31,32,31,31,31,30,29,30,29,30,30],2030:[31,31,32,32,31,30,30,29,30,29,30,30],2031:[31,32,31,32,31,30,30,30,29,29,30,31],2032:[30,32,31,32,31,30,30,30,29,30,29,31],2033:[31,31,32,31,31,31,30,29,30,29,30,30],2034:[31,31,32,32,31,30,30,29,30,29,30,30],2035:[31,32,31,32,31,30,30,30,29,29,30,31],2036:[30,32,31,32,31,31,29,30,30,29,29,31],2037:[31,31,32,31,31,31,30,29,30,29,30,30],2038:[31,31,32,32,31,30,30,29,30,29,30,30],2039:[31,32,31,32,31,30,30,30,29,29,30,31],2040:[31,31,31,32,31,31,29,30,30,29,30,30],2041:[31,31,32,31,31,31,30,29,30,29,30,30],2042:[31,31,32,32,31,30,30,29,30,29,30,31],2043:[31,32,31,32,31,30,30,30,29,29,30,30],2044:[31,31,31,32,31,31,29,30,30,29,30,30],2045:[31,31,32,31,31,31,30,29,30,29,30,30],2046:[31,31,32,32,31,30,30,29,30,29,30,30],2047:[31,32,31,32,31,30,30,30,29,29,30,31],2048:[30,32,31,32,31,30,30,30,29,30,29,31],2049:[31,31,32,31,31,31,30,29,30,29,30,30],2050:[31,31,32,32,31,30,30,29,30,29,30,30],2051:[31,32,31,32,31,30,30,30,29,29,30,31],2052:[31,31,31,32,31,31,29,30,30,29,30,30],2053:[31,31,32,31,31,31,30,29,30,29,30,30],2054:[31,31,32,32,31,30,30,29,30,29,30,30],2055:[31,32,31,32,31,30,30,30,29,29,30,31],2056:[31,31,31,32,31,31,30,29,30,29,30,30],2057:[31,31,32,31,31,31,30,29,30,29,30,30],2058:[31,31,32,32,31,30,30,29,30,29,30,30],2059:[31,32,31,32,31,30,30,30,29,29,30,31],2060:[31,31,31,32,31,31,30,29,30,29,30,30],2061:[31,31,32,31,31,31,30,29,30,29,30,30],2062:[31,31,32,32,31,30,30,29,30,29,30,30],2063:[31,32,31,32,31,30,30,30,29,29,30,31],2064:[31,31,31,32,31,31,29,30,29,30,29,31],2065:[31,31,32,31,31,31,30,29,30,29,30,30],2066:[31,31,32,32,31,30,30,29,30,29,30,30],2067:[31,32,31,32,31,30,30,30,29,29,30,31],2068:[31,31,31,32,31,31,29,30,30,29,30,30],2069:[31,31,32,31,31,31,30,29,30,29,30,30],2070:[31,31,32,32,31,30,30,29,30,29,30,30],2071:[31,32,31,32,31,30,30,30,29,29,30,31],2072:[31,31,31,32,31,31,29,30,30,29,30,30],2073:[31,31,32,31,31,31,30,29,30,29,30,30],2074:[31,31,32,32,31,30,30,29,30,29,30,30],2075:[31,32,31,32,31,30,30,30,29,29,30,31],2076:[31,31,31,32,31,31,30,29,30,29,30,30],2077:[31,31,32,31,31,31,30,29,30,29,30,30],2078:[31,31,32,32,31,30,30,29,30,29,30,30],2079:[31,32,31,32,31,30,30,30,29,29,30,31],2080:[31,31,31,32,31,31,30,29,30,29,30,30],2081:[31,31,32,31,31,31,30,29,30,29,30,30],2082:[31,32,31,32,31,30,30,29,30,29,30,30],2083:[31,32,31,32,31,30,30,30,29,30,29,31],2084:[31,31,31,32,31,31,30,29,30,29,30,30],2085:[31,31,32,31,31,31,30,29,30,29,30,30],2086:[31,32,31,32,31,30,30,29,30,29,30,30],2087:[31,32,31,32,31,30,30,30,29,29,30,31],2088:[30,32,31,32,31,30,30,30,29,30,29,31],2089:[31,31,32,31,31,31,30,29,30,29,30,30],2090:[31,31,32,32,31,30,30,29,30,29,30,30]},K=new Date(1943,3,14);function je(t,c,v){let l=0;for(let i=2e3;i<t;i++){const b=F[i];b&&(l+=b.reduce((a,f)=>a+f,0))}const d=F[t]||[];for(let i=0;i<c-1;i++)l+=d[i]||30;return l+v-1}function C(t,c,v){const l=new Date(K);return l.setDate(l.getDate()+je(t,c,v)),l}function fe(t){const c=new Date(t.getFullYear(),t.getMonth(),t.getDate()),v=new Date(K.getFullYear(),K.getMonth(),K.getDate());let l=Math.round((c-v)/864e5),d=2e3;for(;d<=2090;){const a=F[d],f=a?a.reduce((E,N)=>E+N,0):365;if(l<f)break;l-=f,d++}const i=F[d]||[];let b=1;for(let a=0;a<12;a++){const f=i[a]||30;if(l<f){b=a+1;break}l-=f,a===11&&(b=12)}return{year:d,month:b,day:l+1}}function I(){return fe(new Date)}function te(t,c){return(F[t]||[])[c-1]||30}function me(t,c){return C(t,c,1).getDay()}const he=["बैशाख","जेठ","असार","श्रावण","भाद्र","असोज","कार्तिक","मङ्सिर","पुष","माघ","फागुन","चैत्र"],xe=["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Poush","Magh","Falgun","Chaitra"],Se=["आइत","सोम","मङ्गल","बुध","बिही","शुक्र","शनि"],_e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ee=["०","१","२","३","४","५","६","७","८","९"],W=t=>String(t).split("").map(c=>Ee[+c]??c).join(""),Ne=t=>t?t.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"",Te=`
7
7
  @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');
8
8
 
9
9
  .ndp{
@@ -39,17 +39,27 @@ React keys must be passed directly to JSX without using spread:
39
39
  .ndp-icon{position:absolute;right:14px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--ndp-text-muted);transition:color .2s;}
40
40
  .ndp-input.open ~ .ndp-icon{color:var(--ndp-primary);}
41
41
 
42
- /* Popup */
42
+ /* Overlay */
43
+ .ndp-overlay{
44
+ position:fixed; inset:0; z-index:9998;
45
+ background:rgba(0,0,0,0.35);
46
+ display:flex; align-items:center; justify-content:center;
47
+ padding:16px;
48
+ animation:ndp-fade-in .15s ease;
49
+ }
50
+ @keyframes ndp-fade-in{from{opacity:0;}to{opacity:1;}}
51
+
52
+ /* Popup — centered modal */
43
53
  .ndp-popup{
44
- position:absolute; top:calc(100% + 9px); left:0; z-index:9999;
54
+ position:relative; z-index:9999;
45
55
  width:336px;
46
56
  background:var(--ndp-background); border-radius:var(--ndp-radius);
47
57
  box-shadow:var(--ndp-shadow); border:1px solid var(--ndp-border);
48
- overflow:hidden;
49
- animation:ndp-pop .18s cubic-bezier(.34,1.56,.64,1);
50
- transform-origin:top left;
58
+ overflow:visible;
59
+ animation:ndp-pop .2s cubic-bezier(.34,1.56,.64,1);
60
+ transform-origin:center center;
51
61
  }
52
- @keyframes ndp-pop{from{opacity:0;transform:scale(.93) translateY(-8px);}to{opacity:1;transform:none;}}
62
+ @keyframes ndp-pop{from{opacity:0;transform:scale(.93);}to{opacity:1;transform:none;}}
53
63
  @keyframes ndp-slide-left{from{opacity:0;transform:translateX(28px);}to{opacity:1;transform:translateX(0);}}
54
64
  @keyframes ndp-slide-right{from{opacity:0;transform:translateX(-28px);}to{opacity:1;transform:translateX(0);}}
55
65
  .ndp-slide-left{animation:ndp-slide-left .2s cubic-bezier(.25,.8,.25,1);}
@@ -167,6 +177,8 @@ React keys must be passed directly to JSX without using spread:
167
177
  .ndp-cell.today:not(.picked){
168
178
  background:var(--ndp-today-bg);
169
179
  font-weight:700;color:var(--ndp-primary);
180
+ outline:1.5px solid var(--ndp-primary);
181
+ outline-offset:-1px;
170
182
  }
171
183
  .ndp-cell.picked{
172
184
  background:var(--ndp-primary);color:#fff;font-weight:700;
@@ -194,4 +206,4 @@ React keys must be passed directly to JSX without using spread:
194
206
  transition:background .15s;white-space:nowrap;
195
207
  }
196
208
  .ndp-today-btn:hover{background:#FDEECA;}
197
- `;let xe=!1;function Te(){if(!xe&&typeof document<"u"){const n=document.createElement("style");n.textContent=Ne,document.head.appendChild(n),xe=!0}}function Re({value:n,onChange:c,language:v="np",placeholder:l,minYear:d=2060,maxYear:i=2090,className:b="",styles:a={}}){Te();const f=v!=="en",_=z(),[E,N]=x.useState(!1),[T,w]=x.useState(null),[W,O]=x.useState(!1),[j,P]=x.useState(!1),[g,R]=x.useState(()=>n?.year??z().year),[h,k]=x.useState(()=>n?.month??z().month),V=x.useRef(null),G=x.useRef(null);x.useEffect(()=>{const t=m=>{V.current&&!V.current.contains(m.target)&&(N(!1),O(!1),P(!1))};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]),x.useEffect(()=>{n&&(R(n.year),k(n.month))},[n]),x.useEffect(()=>{if(j&&G.current){const t=G.current.querySelector(".sel");t&&t.scrollIntoView({block:"center"})}},[j]);const te=x.useCallback(t=>{if(!t)return;c?.({year:g,month:h,day:t},A(g,h,t)),N(!1)},[g,h,c]),U=()=>{w("right"),setTimeout(()=>w(null),200),h===1?(k(12),R(t=>t-1)):k(t=>t-1)},oe=()=>{w("left"),setTimeout(()=>w(null),200),h===12?(k(1),R(t=>t+1)):k(t=>t+1)},ae=()=>{const t=z();R(t.year),k(t.month),c?.(t,A(t.year,t.month,t.day)),N(!1)},C=ne(g,h),M=fe(g,h),se=h===1?12:h-1,X=h===1?g-1:g,K=ne(X,se),q=Array.from({length:M},(t,m)=>({day:K-M+1+m,overflow:"prev"})),ee=Array.from({length:C},(t,m)=>({day:m+1,overflow:null})),re=42-(M+C),e=Array.from({length:re},(t,m)=>({day:m+1,overflow:"next"})),o=[...q,...ee,...e],s=f?me:he,p=f?je:Se,D=s[h-1],Y=f?I(g):String(g),S=A(g,h,1).toLocaleDateString("en-GB",{month:"short",year:"numeric"}),J=n?f?`${I(n.year)} ${me[n.month-1]} ${I(n.day)}`:`${n.year} ${he[n.month-1]} ${n.day}`:"",ie=f?"मिति छान्नुहोस्":"Select BS date",be=n?A(n.year,n.month,n.day):null,De=Array.from({length:i-d+1},(t,m)=>d+m),Ae={...a.primary&&{"--ndp-primary":a.primary},...a.primarySoft&&{"--ndp-primary-soft":a.primarySoft},...a.background&&{"--ndp-background":a.background},...a.text&&{"--ndp-text":a.text},...a.textMuted&&{"--ndp-text-muted":a.textMuted},...a.border&&{"--ndp-border":a.border},...a.todayBg&&{"--ndp-today-bg":a.todayBg},...a.controlsBg&&{"--ndp-controls-bg":a.controlsBg},...a.radius&&{"--ndp-radius":a.radius},...a.shadow&&{"--ndp-shadow":a.shadow}};return r.jsxs("div",{className:`ndp${b?` ${b}`:""}`,ref:V,style:Ae,children:[r.jsxs("div",{className:"ndp-wrap",onClick:()=>N(t=>!t),children:[r.jsx("input",{readOnly:!0,className:`ndp-input${E?" open":""}`,value:J,placeholder:l??ie}),r.jsx("span",{className:"ndp-icon",children:r.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),r.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),r.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),r.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})})]}),E&&r.jsxs("div",{className:"ndp-popup",children:[r.jsx("div",{className:"ndp-hd",children:r.jsxs("div",{className:"ndp-hd-row",children:[r.jsx("button",{className:"ndp-nav",onClick:U,children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m15 18-6-6 6-6"})})}),r.jsxs("div",{className:`ndp-hd-center${T?` ndp-slide-${T}`:""}`,children:[r.jsx("div",{className:"ndp-hd-month",children:D}),r.jsxs("div",{className:"ndp-hd-sub",children:[Y," BS · ",S]})]}),r.jsx("button",{className:"ndp-nav",onClick:oe,children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m9 18 6-6-6-6"})})})]})}),r.jsxs("div",{className:"ndp-controls",children:[r.jsxs("div",{className:"ndp-dd",children:[r.jsxs("button",{className:`ndp-dd-trigger${W?" active":""}`,onClick:()=>{O(t=>!t),P(!1)},children:[r.jsx("span",{children:D}),r.jsx("span",{className:"ndp-dd-arrow",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),W&&r.jsx("div",{className:"ndp-dd-panel",children:r.jsx("div",{className:"ndp-dd-months",children:s.map((t,m)=>r.jsx("button",{className:`ndp-dd-month-item${h===m+1?" sel":""}`,onClick:()=>{w(m+1<h?"right":"left"),setTimeout(()=>w(null),200),k(m+1),O(!1)},children:t},m))})})]}),r.jsxs("div",{className:"ndp-dd",children:[r.jsxs("button",{className:`ndp-dd-trigger${j?" active":""}`,onClick:()=>{P(t=>!t),O(!1)},children:[r.jsx("span",{children:Y}),r.jsx("span",{className:"ndp-dd-arrow",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),j&&r.jsx("div",{className:"ndp-dd-panel",children:r.jsx("div",{className:"ndp-dd-years",ref:G,children:De.map(t=>r.jsx("button",{className:`ndp-dd-year-item${g===t?" sel":""}`,onClick:()=>{R(t),P(!1)},children:f?I(t):t},t))})})]})]}),r.jsxs("div",{className:"ndp-body",children:[r.jsx("div",{className:"ndp-wdays",children:p.map((t,m)=>r.jsx("div",{className:"ndp-wday",children:t},m))}),r.jsx("div",{className:`ndp-grid${T?` ndp-slide-${T}`:""}`,children:o.map(({day:t,overflow:m},ge)=>{const Oe=ge%7===6,H=m!==null,Pe=!H&&t===_.day&&h===_.month&&g===_.year,Ce=!H&&n&&t===n.day&&h===n.month&&g===n.year;let $="ndp-cell";return H?$+=" overflow":Oe&&($+=" wknd"),Pe&&($+=" today"),Ce&&($+=" picked"),r.jsx("button",{className:$,disabled:H,onClick:()=>!H&&te(t),children:f?I(t):t},ge)})})]}),r.jsxs("div",{className:"ndp-ft",children:[r.jsx("span",{className:"ndp-ad",children:be?r.jsxs(r.Fragment,{children:[r.jsx("b",{children:"AD:"})," ",Ee(be)]}):r.jsx("span",{style:{color:"var(--ndp-text-muted)",fontSize:12},children:f?"मिति छानिएको छैन":"No date selected"})}),r.jsx("button",{className:"ndp-today-btn",onClick:ae,children:f?"आज":"Today"})]})]})]})}y.NepaliDatePicker=Re,y.adToBs=ue,y.bsToAd=A,y.getDaysInBSMonth=ne,y.getFirstDayOfWeekBS=fe,y.getTodayBS=z,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
209
+ `;let be=!1;function Re(){if(!be&&typeof document<"u"){const t=document.createElement("style");t.textContent=Te,document.head.appendChild(t),be=!0}}function De({value:t,onChange:c,language:v="np",placeholder:l,minYear:d=2060,maxYear:i=2090,className:b="",styles:a={}}){Re();const f=v!=="en",E=I(),[N,T]=x.useState(!1),[R,k]=x.useState(null),[V,D]=x.useState(!1),[S,A]=x.useState(!1),[g,O]=x.useState(()=>t?.year??I().year),[h,j]=x.useState(()=>t?.month??I().month),G=x.useRef(null),U=x.useRef(null);x.useEffect(()=>{const n=m=>{G.current&&!G.current.contains(m.target)&&(D(!1),A(!1))};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]),x.useEffect(()=>{t&&(O(t.year),j(t.month))},[t]),x.useEffect(()=>{if(S&&U.current){const n=U.current.querySelector(".sel");n&&n.scrollIntoView({block:"center"})}},[S]);const oe=x.useCallback(n=>{if(!n)return;c?.({year:g,month:h,day:n},C(g,h,n)),T(!1)},[g,h,c]),X=()=>{k("right"),setTimeout(()=>k(null),200),h===1?(j(12),O(n=>n-1)):j(n=>n-1)},ae=()=>{k("left"),setTimeout(()=>k(null),200),h===12?(j(1),O(n=>n+1)):j(n=>n+1)},se=()=>{const n=I();O(n.year),j(n.month),c?.(n,C(n.year,n.month,n.day)),T(!1)},M=te(g,h),Y=me(g,h),de=h===1?12:h-1,J=h===1?g-1:g,q=te(J,de),ee=Array.from({length:Y},(n,m)=>({day:q-Y+1+m,overflow:"prev"})),re=Array.from({length:M},(n,m)=>({day:m+1,overflow:null})),ne=42-(Y+M),e=Array.from({length:ne},(n,m)=>({day:m+1,overflow:"next"})),o=[...ee,...re,...e],s=f?he:xe,p=f?Se:_e,P=s[h-1],B=f?W(g):String(g),_=C(g,h,1).toLocaleDateString("en-GB",{month:"short",year:"numeric"}),H=t?f?`${W(t.year)} ${he[t.month-1]} ${W(t.day)}`:`${t.year} ${xe[t.month-1]} ${t.day}`:"",ce=f?"मिति छान्नुहोस्":"Select BS date",ge=t?C(t.year,t.month,t.day):null,Ae=Array.from({length:i-d+1},(n,m)=>d+m),Oe={...a.primary&&{"--ndp-primary":a.primary},...a.primarySoft&&{"--ndp-primary-soft":a.primarySoft},...a.background&&{"--ndp-background":a.background},...a.text&&{"--ndp-text":a.text},...a.textMuted&&{"--ndp-text-muted":a.textMuted},...a.border&&{"--ndp-border":a.border},...a.todayBg&&{"--ndp-today-bg":a.todayBg},...a.controlsBg&&{"--ndp-controls-bg":a.controlsBg},...a.radius&&{"--ndp-radius":a.radius},...a.shadow&&{"--ndp-shadow":a.shadow}};return r.jsxs("div",{className:`ndp${b?` ${b}`:""}`,ref:G,style:Oe,children:[r.jsxs("div",{className:"ndp-wrap",onClick:()=>T(n=>!n),children:[r.jsx("input",{readOnly:!0,className:`ndp-input${N?" open":""}`,value:H,placeholder:l??ce}),r.jsx("span",{className:"ndp-icon",children:r.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),r.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),r.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),r.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})})]}),N&&r.jsx("div",{className:"ndp-overlay",onMouseDown:n=>{n.target===n.currentTarget&&(T(!1),D(!1),A(!1))},children:r.jsxs("div",{className:"ndp-popup",children:[r.jsx("div",{className:"ndp-hd",children:r.jsxs("div",{className:"ndp-hd-row",children:[r.jsx("button",{type:"button",className:"ndp-nav",onClick:X,children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m15 18-6-6 6-6"})})}),r.jsxs("div",{className:`ndp-hd-center${R?` ndp-slide-${R}`:""}`,children:[r.jsx("div",{className:"ndp-hd-month",children:P}),r.jsxs("div",{className:"ndp-hd-sub",children:[B," BS · ",_]})]}),r.jsx("button",{type:"button",className:"ndp-nav",onClick:ae,children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m9 18 6-6-6-6"})})})]})}),r.jsxs("div",{className:"ndp-controls",children:[r.jsxs("div",{className:"ndp-dd",children:[r.jsxs("button",{type:"button",className:`ndp-dd-trigger${V?" active":""}`,onClick:()=>{D(n=>!n),A(!1)},children:[r.jsx("span",{children:P}),r.jsx("span",{className:"ndp-dd-arrow",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),V&&r.jsx("div",{className:"ndp-dd-panel",children:r.jsx("div",{className:"ndp-dd-months",children:s.map((n,m)=>r.jsx("button",{className:`ndp-dd-month-item${h===m+1?" sel":""}`,onClick:()=>{k(m+1<h?"right":"left"),setTimeout(()=>k(null),200),j(m+1),D(!1)},children:n},m))})})]}),r.jsxs("div",{className:"ndp-dd",children:[r.jsxs("button",{type:"button",className:`ndp-dd-trigger${S?" active":""}`,onClick:()=>{A(n=>!n),D(!1)},children:[r.jsx("span",{children:B}),r.jsx("span",{className:"ndp-dd-arrow",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),S&&r.jsx("div",{className:"ndp-dd-panel",children:r.jsx("div",{className:"ndp-dd-years",ref:U,children:Ae.map(n=>r.jsx("button",{className:`ndp-dd-year-item${g===n?" sel":""}`,onClick:()=>{O(n),A(!1)},children:f?W(n):n},n))})})]})]}),r.jsxs("div",{className:"ndp-body",children:[r.jsx("div",{className:"ndp-wdays",children:p.map((n,m)=>r.jsx("div",{className:"ndp-wday",children:n},m))}),r.jsx("div",{className:`ndp-grid${R?` ndp-slide-${R}`:""}`,children:o.map(({day:n,overflow:m},ye)=>{const Pe=ye%7===6,$=m!==null,Ce=!$&&n===E.day&&h===E.month&&g===E.year,Me=!$&&t&&n===t.day&&h===t.month&&g===t.year;let Z="ndp-cell";return $?Z+=" overflow":Pe&&(Z+=" wknd"),Ce&&(Z+=" today"),Me&&(Z+=" picked"),r.jsx("button",{type:"button",className:Z,disabled:$,onClick:()=>!$&&oe(n),children:f?W(n):n},ye)})})]}),r.jsxs("div",{className:"ndp-ft",children:[r.jsx("span",{className:"ndp-ad",children:ge?r.jsxs(r.Fragment,{children:[r.jsx("b",{children:"AD:"})," ",Ne(ge)]}):r.jsx("span",{style:{color:"var(--ndp-text-muted)",fontSize:12},children:f?"मिति छानिएको छैन":"No date selected"})}),r.jsx("button",{type:"button",className:"ndp-today-btn",onClick:se,children:f?"आज":"Today"})]})]})})]})}w.NepaliDatePicker=De,w.adToBs=fe,w.bsToAd=C,w.getDaysInBSMonth=te,w.getFirstDayOfWeekBS=me,w.getTodayBS=I,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@himal_bhattarai/nepali-datepicker",
3
- "version": "1.1.3",
3
+ "version": "1.2.1",
4
4
  "description": "Nepali Bikram Sambat (BS) date picker React component with BS↔AD conversion",
5
5
  "main": "./dist/nepali-datepicker.umd.js",
6
6
  "module": "./dist/nepali-datepicker.es.js",