@starasia/date 1.0.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.
@@ -0,0 +1,1943 @@
1
+ import Ke, { useState as B, useRef as Q, useEffect as I, forwardRef as be } from "react";
2
+ var ve = { exports: {} }, X = {};
3
+ /**
4
+ * @license React
5
+ * react-jsx-runtime.production.min.js
6
+ *
7
+ * Copyright (c) Facebook, Inc. and its affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+ var Ue;
13
+ function Sr() {
14
+ if (Ue)
15
+ return X;
16
+ Ue = 1;
17
+ var t = Ke, n = Symbol.for("react.element"), l = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, u = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function b(j, f, a) {
19
+ var E, w = {}, _ = null, S = null;
20
+ a !== void 0 && (_ = "" + a), f.key !== void 0 && (_ = "" + f.key), f.ref !== void 0 && (S = f.ref);
21
+ for (E in f)
22
+ i.call(f, E) && !m.hasOwnProperty(E) && (w[E] = f[E]);
23
+ if (j && j.defaultProps)
24
+ for (E in f = j.defaultProps, f)
25
+ w[E] === void 0 && (w[E] = f[E]);
26
+ return { $$typeof: n, type: j, key: _, ref: S, props: w, _owner: u.current };
27
+ }
28
+ return X.Fragment = l, X.jsx = b, X.jsxs = b, X;
29
+ }
30
+ var Z = {};
31
+ /**
32
+ * @license React
33
+ * react-jsx-runtime.development.js
34
+ *
35
+ * Copyright (c) Facebook, Inc. and its affiliates.
36
+ *
37
+ * This source code is licensed under the MIT license found in the
38
+ * LICENSE file in the root directory of this source tree.
39
+ */
40
+ var ze;
41
+ function Mr() {
42
+ return ze || (ze = 1, process.env.NODE_ENV !== "production" && function() {
43
+ var t = Ke, n = Symbol.for("react.element"), l = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), b = Symbol.for("react.provider"), j = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), a = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), v = Symbol.iterator, c = "@@iterator";
44
+ function g(e) {
45
+ if (e === null || typeof e != "object")
46
+ return null;
47
+ var r = v && e[v] || e[c];
48
+ return typeof r == "function" ? r : null;
49
+ }
50
+ var d = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ function p(e) {
52
+ {
53
+ for (var r = arguments.length, s = new Array(r > 1 ? r - 1 : 0), y = 1; y < r; y++)
54
+ s[y - 1] = arguments[y];
55
+ h("error", e, s);
56
+ }
57
+ }
58
+ function h(e, r, s) {
59
+ {
60
+ var y = d.ReactDebugCurrentFrame, T = y.getStackAddendum();
61
+ T !== "" && (r += "%s", s = s.concat([T]));
62
+ var D = s.map(function(R) {
63
+ return String(R);
64
+ });
65
+ D.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, D);
66
+ }
67
+ }
68
+ var x = !1, Y = !1, $ = !1, C = !1, P = !1, we;
69
+ we = Symbol.for("react.module.reference");
70
+ function rr(e) {
71
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === m || P || e === u || e === a || e === E || C || e === S || x || Y || $ || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === w || e.$$typeof === b || e.$$typeof === j || e.$$typeof === f || // This needs to include all possible module reference object
72
+ // types supported by any Flight configuration anywhere since
73
+ // we don't know which Flight build this will end up being used
74
+ // with.
75
+ e.$$typeof === we || e.getModuleId !== void 0));
76
+ }
77
+ function ar(e, r, s) {
78
+ var y = e.displayName;
79
+ if (y)
80
+ return y;
81
+ var T = r.displayName || r.name || "";
82
+ return T !== "" ? s + "(" + T + ")" : s;
83
+ }
84
+ function xe(e) {
85
+ return e.displayName || "Context";
86
+ }
87
+ function A(e) {
88
+ if (e == null)
89
+ return null;
90
+ if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
91
+ return e.displayName || e.name || null;
92
+ if (typeof e == "string")
93
+ return e;
94
+ switch (e) {
95
+ case i:
96
+ return "Fragment";
97
+ case l:
98
+ return "Portal";
99
+ case m:
100
+ return "Profiler";
101
+ case u:
102
+ return "StrictMode";
103
+ case a:
104
+ return "Suspense";
105
+ case E:
106
+ return "SuspenseList";
107
+ }
108
+ if (typeof e == "object")
109
+ switch (e.$$typeof) {
110
+ case j:
111
+ var r = e;
112
+ return xe(r) + ".Consumer";
113
+ case b:
114
+ var s = e;
115
+ return xe(s._context) + ".Provider";
116
+ case f:
117
+ return ar(e, e.render, "ForwardRef");
118
+ case w:
119
+ var y = e.displayName || null;
120
+ return y !== null ? y : A(e.type) || "Memo";
121
+ case _: {
122
+ var T = e, D = T._payload, R = T._init;
123
+ try {
124
+ return A(R(D));
125
+ } catch {
126
+ return null;
127
+ }
128
+ }
129
+ }
130
+ return null;
131
+ }
132
+ var W = Object.assign, H = 0, Ee, je, Ce, ke, Re, _e, Te;
133
+ function De() {
134
+ }
135
+ De.__reactDisabledLog = !0;
136
+ function nr() {
137
+ {
138
+ if (H === 0) {
139
+ Ee = console.log, je = console.info, Ce = console.warn, ke = console.error, Re = console.group, _e = console.groupCollapsed, Te = console.groupEnd;
140
+ var e = {
141
+ configurable: !0,
142
+ enumerable: !0,
143
+ value: De,
144
+ writable: !0
145
+ };
146
+ Object.defineProperties(console, {
147
+ info: e,
148
+ log: e,
149
+ warn: e,
150
+ error: e,
151
+ group: e,
152
+ groupCollapsed: e,
153
+ groupEnd: e
154
+ });
155
+ }
156
+ H++;
157
+ }
158
+ }
159
+ function tr() {
160
+ {
161
+ if (H--, H === 0) {
162
+ var e = {
163
+ configurable: !0,
164
+ enumerable: !0,
165
+ writable: !0
166
+ };
167
+ Object.defineProperties(console, {
168
+ log: W({}, e, {
169
+ value: Ee
170
+ }),
171
+ info: W({}, e, {
172
+ value: je
173
+ }),
174
+ warn: W({}, e, {
175
+ value: Ce
176
+ }),
177
+ error: W({}, e, {
178
+ value: ke
179
+ }),
180
+ group: W({}, e, {
181
+ value: Re
182
+ }),
183
+ groupCollapsed: W({}, e, {
184
+ value: _e
185
+ }),
186
+ groupEnd: W({}, e, {
187
+ value: Te
188
+ })
189
+ });
190
+ }
191
+ H < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
+ }
193
+ }
194
+ var oe = d.ReactCurrentDispatcher, le;
195
+ function ee(e, r, s) {
196
+ {
197
+ if (le === void 0)
198
+ try {
199
+ throw Error();
200
+ } catch (T) {
201
+ var y = T.stack.trim().match(/\n( *(at )?)/);
202
+ le = y && y[1] || "";
203
+ }
204
+ return `
205
+ ` + le + e;
206
+ }
207
+ }
208
+ var ce = !1, re;
209
+ {
210
+ var sr = typeof WeakMap == "function" ? WeakMap : Map;
211
+ re = new sr();
212
+ }
213
+ function Se(e, r) {
214
+ if (!e || ce)
215
+ return "";
216
+ {
217
+ var s = re.get(e);
218
+ if (s !== void 0)
219
+ return s;
220
+ }
221
+ var y;
222
+ ce = !0;
223
+ var T = Error.prepareStackTrace;
224
+ Error.prepareStackTrace = void 0;
225
+ var D;
226
+ D = oe.current, oe.current = null, nr();
227
+ try {
228
+ if (r) {
229
+ var R = function() {
230
+ throw Error();
231
+ };
232
+ if (Object.defineProperty(R.prototype, "props", {
233
+ set: function() {
234
+ throw Error();
235
+ }
236
+ }), typeof Reflect == "object" && Reflect.construct) {
237
+ try {
238
+ Reflect.construct(R, []);
239
+ } catch (N) {
240
+ y = N;
241
+ }
242
+ Reflect.construct(e, [], R);
243
+ } else {
244
+ try {
245
+ R.call();
246
+ } catch (N) {
247
+ y = N;
248
+ }
249
+ e.call(R.prototype);
250
+ }
251
+ } else {
252
+ try {
253
+ throw Error();
254
+ } catch (N) {
255
+ y = N;
256
+ }
257
+ e();
258
+ }
259
+ } catch (N) {
260
+ if (N && y && typeof N.stack == "string") {
261
+ for (var k = N.stack.split(`
262
+ `), O = y.stack.split(`
263
+ `), M = k.length - 1, F = O.length - 1; M >= 1 && F >= 0 && k[M] !== O[F]; )
264
+ F--;
265
+ for (; M >= 1 && F >= 0; M--, F--)
266
+ if (k[M] !== O[F]) {
267
+ if (M !== 1 || F !== 1)
268
+ do
269
+ if (M--, F--, F < 0 || k[M] !== O[F]) {
270
+ var L = `
271
+ ` + k[M].replace(" at new ", " at ");
272
+ return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" && re.set(e, L), L;
273
+ }
274
+ while (M >= 1 && F >= 0);
275
+ break;
276
+ }
277
+ }
278
+ } finally {
279
+ ce = !1, oe.current = D, tr(), Error.prepareStackTrace = T;
280
+ }
281
+ var J = e ? e.displayName || e.name : "", V = J ? ee(J) : "";
282
+ return typeof e == "function" && re.set(e, V), V;
283
+ }
284
+ function ir(e, r, s) {
285
+ return Se(e, !1);
286
+ }
287
+ function or(e) {
288
+ var r = e.prototype;
289
+ return !!(r && r.isReactComponent);
290
+ }
291
+ function ae(e, r, s) {
292
+ if (e == null)
293
+ return "";
294
+ if (typeof e == "function")
295
+ return Se(e, or(e));
296
+ if (typeof e == "string")
297
+ return ee(e);
298
+ switch (e) {
299
+ case a:
300
+ return ee("Suspense");
301
+ case E:
302
+ return ee("SuspenseList");
303
+ }
304
+ if (typeof e == "object")
305
+ switch (e.$$typeof) {
306
+ case f:
307
+ return ir(e.render);
308
+ case w:
309
+ return ae(e.type, r, s);
310
+ case _: {
311
+ var y = e, T = y._payload, D = y._init;
312
+ try {
313
+ return ae(D(T), r, s);
314
+ } catch {
315
+ }
316
+ }
317
+ }
318
+ return "";
319
+ }
320
+ var G = Object.prototype.hasOwnProperty, Me = {}, Fe = d.ReactDebugCurrentFrame;
321
+ function ne(e) {
322
+ if (e) {
323
+ var r = e._owner, s = ae(e.type, e._source, r ? r.type : null);
324
+ Fe.setExtraStackFrame(s);
325
+ } else
326
+ Fe.setExtraStackFrame(null);
327
+ }
328
+ function lr(e, r, s, y, T) {
329
+ {
330
+ var D = Function.call.bind(G);
331
+ for (var R in e)
332
+ if (D(e, R)) {
333
+ var k = void 0;
334
+ try {
335
+ if (typeof e[R] != "function") {
336
+ var O = Error((y || "React class") + ": " + s + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
+ throw O.name = "Invariant Violation", O;
338
+ }
339
+ k = e[R](r, R, y, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (M) {
341
+ k = M;
342
+ }
343
+ k && !(k instanceof Error) && (ne(T), p("%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).", y || "React class", s, R, typeof k), ne(null)), k instanceof Error && !(k.message in Me) && (Me[k.message] = !0, ne(T), p("Failed %s type: %s", s, k.message), ne(null));
344
+ }
345
+ }
346
+ }
347
+ var cr = Array.isArray;
348
+ function ue(e) {
349
+ return cr(e);
350
+ }
351
+ function ur(e) {
352
+ {
353
+ var r = typeof Symbol == "function" && Symbol.toStringTag, s = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
+ return s;
355
+ }
356
+ }
357
+ function dr(e) {
358
+ try {
359
+ return $e(e), !1;
360
+ } catch {
361
+ return !0;
362
+ }
363
+ }
364
+ function $e(e) {
365
+ return "" + e;
366
+ }
367
+ function Ye(e) {
368
+ if (dr(e))
369
+ return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ur(e)), $e(e);
370
+ }
371
+ var K = d.ReactCurrentOwner, fr = {
372
+ key: !0,
373
+ ref: !0,
374
+ __self: !0,
375
+ __source: !0
376
+ }, Oe, Pe, de;
377
+ de = {};
378
+ function hr(e) {
379
+ if (G.call(e, "ref")) {
380
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
381
+ if (r && r.isReactWarning)
382
+ return !1;
383
+ }
384
+ return e.ref !== void 0;
385
+ }
386
+ function gr(e) {
387
+ if (G.call(e, "key")) {
388
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
389
+ if (r && r.isReactWarning)
390
+ return !1;
391
+ }
392
+ return e.key !== void 0;
393
+ }
394
+ function pr(e, r) {
395
+ if (typeof e.ref == "string" && K.current && r && K.current.stateNode !== r) {
396
+ var s = A(K.current.type);
397
+ de[s] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', A(K.current.type), e.ref), de[s] = !0);
398
+ }
399
+ }
400
+ function vr(e, r) {
401
+ {
402
+ var s = function() {
403
+ Oe || (Oe = !0, p("%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)", r));
404
+ };
405
+ s.isReactWarning = !0, Object.defineProperty(e, "key", {
406
+ get: s,
407
+ configurable: !0
408
+ });
409
+ }
410
+ }
411
+ function yr(e, r) {
412
+ {
413
+ var s = function() {
414
+ Pe || (Pe = !0, p("%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)", r));
415
+ };
416
+ s.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
+ get: s,
418
+ configurable: !0
419
+ });
420
+ }
421
+ }
422
+ var mr = function(e, r, s, y, T, D, R) {
423
+ var k = {
424
+ // This tag allows us to uniquely identify this as a React Element
425
+ $$typeof: n,
426
+ // Built-in properties that belong on the element
427
+ type: e,
428
+ key: r,
429
+ ref: s,
430
+ props: R,
431
+ // Record the component responsible for creating this element.
432
+ _owner: D
433
+ };
434
+ return k._store = {}, Object.defineProperty(k._store, "validated", {
435
+ configurable: !1,
436
+ enumerable: !1,
437
+ writable: !0,
438
+ value: !1
439
+ }), Object.defineProperty(k, "_self", {
440
+ configurable: !1,
441
+ enumerable: !1,
442
+ writable: !1,
443
+ value: y
444
+ }), Object.defineProperty(k, "_source", {
445
+ configurable: !1,
446
+ enumerable: !1,
447
+ writable: !1,
448
+ value: T
449
+ }), Object.freeze && (Object.freeze(k.props), Object.freeze(k)), k;
450
+ };
451
+ function br(e, r, s, y, T) {
452
+ {
453
+ var D, R = {}, k = null, O = null;
454
+ s !== void 0 && (Ye(s), k = "" + s), gr(r) && (Ye(r.key), k = "" + r.key), hr(r) && (O = r.ref, pr(r, T));
455
+ for (D in r)
456
+ G.call(r, D) && !fr.hasOwnProperty(D) && (R[D] = r[D]);
457
+ if (e && e.defaultProps) {
458
+ var M = e.defaultProps;
459
+ for (D in M)
460
+ R[D] === void 0 && (R[D] = M[D]);
461
+ }
462
+ if (k || O) {
463
+ var F = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
+ k && vr(R, F), O && yr(R, F);
465
+ }
466
+ return mr(e, k, O, T, y, K.current, R);
467
+ }
468
+ }
469
+ var fe = d.ReactCurrentOwner, Ne = d.ReactDebugCurrentFrame;
470
+ function z(e) {
471
+ if (e) {
472
+ var r = e._owner, s = ae(e.type, e._source, r ? r.type : null);
473
+ Ne.setExtraStackFrame(s);
474
+ } else
475
+ Ne.setExtraStackFrame(null);
476
+ }
477
+ var he;
478
+ he = !1;
479
+ function ge(e) {
480
+ return typeof e == "object" && e !== null && e.$$typeof === n;
481
+ }
482
+ function Ie() {
483
+ {
484
+ if (fe.current) {
485
+ var e = A(fe.current.type);
486
+ if (e)
487
+ return `
488
+
489
+ Check the render method of \`` + e + "`.";
490
+ }
491
+ return "";
492
+ }
493
+ }
494
+ function wr(e) {
495
+ {
496
+ if (e !== void 0) {
497
+ var r = e.fileName.replace(/^.*[\\\/]/, ""), s = e.lineNumber;
498
+ return `
499
+
500
+ Check your code at ` + r + ":" + s + ".";
501
+ }
502
+ return "";
503
+ }
504
+ }
505
+ var Le = {};
506
+ function xr(e) {
507
+ {
508
+ var r = Ie();
509
+ if (!r) {
510
+ var s = typeof e == "string" ? e : e.displayName || e.name;
511
+ s && (r = `
512
+
513
+ Check the top-level render call using <` + s + ">.");
514
+ }
515
+ return r;
516
+ }
517
+ }
518
+ function Ae(e, r) {
519
+ {
520
+ if (!e._store || e._store.validated || e.key != null)
521
+ return;
522
+ e._store.validated = !0;
523
+ var s = xr(r);
524
+ if (Le[s])
525
+ return;
526
+ Le[s] = !0;
527
+ var y = "";
528
+ e && e._owner && e._owner !== fe.current && (y = " It was passed a child from " + A(e._owner.type) + "."), z(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, y), z(null);
529
+ }
530
+ }
531
+ function We(e, r) {
532
+ {
533
+ if (typeof e != "object")
534
+ return;
535
+ if (ue(e))
536
+ for (var s = 0; s < e.length; s++) {
537
+ var y = e[s];
538
+ ge(y) && Ae(y, r);
539
+ }
540
+ else if (ge(e))
541
+ e._store && (e._store.validated = !0);
542
+ else if (e) {
543
+ var T = g(e);
544
+ if (typeof T == "function" && T !== e.entries)
545
+ for (var D = T.call(e), R; !(R = D.next()).done; )
546
+ ge(R.value) && Ae(R.value, r);
547
+ }
548
+ }
549
+ }
550
+ function Er(e) {
551
+ {
552
+ var r = e.type;
553
+ if (r == null || typeof r == "string")
554
+ return;
555
+ var s;
556
+ if (typeof r == "function")
557
+ s = r.propTypes;
558
+ else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
559
+ // Inner props are checked in the reconciler.
560
+ r.$$typeof === w))
561
+ s = r.propTypes;
562
+ else
563
+ return;
564
+ if (s) {
565
+ var y = A(r);
566
+ lr(s, e.props, "prop", y, e);
567
+ } else if (r.PropTypes !== void 0 && !he) {
568
+ he = !0;
569
+ var T = A(r);
570
+ p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
571
+ }
572
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
573
+ }
574
+ }
575
+ function jr(e) {
576
+ {
577
+ for (var r = Object.keys(e.props), s = 0; s < r.length; s++) {
578
+ var y = r[s];
579
+ if (y !== "children" && y !== "key") {
580
+ z(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", y), z(null);
581
+ break;
582
+ }
583
+ }
584
+ e.ref !== null && (z(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), z(null));
585
+ }
586
+ }
587
+ var Ve = {};
588
+ function Be(e, r, s, y, T, D) {
589
+ {
590
+ var R = rr(e);
591
+ if (!R) {
592
+ var k = "";
593
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
594
+ var O = wr(T);
595
+ O ? k += O : k += Ie();
596
+ var M;
597
+ e === null ? M = "null" : ue(e) ? M = "array" : e !== void 0 && e.$$typeof === n ? (M = "<" + (A(e.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : M = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", M, k);
598
+ }
599
+ var F = br(e, r, s, T, D);
600
+ if (F == null)
601
+ return F;
602
+ if (R) {
603
+ var L = r.children;
604
+ if (L !== void 0)
605
+ if (y)
606
+ if (ue(L)) {
607
+ for (var J = 0; J < L.length; J++)
608
+ We(L[J], e);
609
+ Object.freeze && Object.freeze(L);
610
+ } else
611
+ p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
612
+ else
613
+ We(L, e);
614
+ }
615
+ if (G.call(r, "key")) {
616
+ var V = A(e), N = Object.keys(r).filter(function(Dr) {
617
+ return Dr !== "key";
618
+ }), pe = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
619
+ if (!Ve[V + pe]) {
620
+ var Tr = N.length > 0 ? "{" + N.join(": ..., ") + ": ...}" : "{}";
621
+ p(`A props object containing a "key" prop is being spread into JSX:
622
+ let props = %s;
623
+ <%s {...props} />
624
+ React keys must be passed directly to JSX without using spread:
625
+ let props = %s;
626
+ <%s key={someKey} {...props} />`, pe, V, Tr, V), Ve[V + pe] = !0;
627
+ }
628
+ }
629
+ return e === i ? jr(F) : Er(F), F;
630
+ }
631
+ }
632
+ function Cr(e, r, s) {
633
+ return Be(e, r, s, !0);
634
+ }
635
+ function kr(e, r, s) {
636
+ return Be(e, r, s, !1);
637
+ }
638
+ var Rr = kr, _r = Cr;
639
+ Z.Fragment = i, Z.jsx = Rr, Z.jsxs = _r;
640
+ }()), Z;
641
+ }
642
+ process.env.NODE_ENV === "production" ? ve.exports = Sr() : ve.exports = Mr();
643
+ var o = ve.exports;
644
+ const ie = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
645
+
646
+ * {
647
+ margin: 0;
648
+ padding: 0;
649
+ font-family: "Poppins", sans-serif;
650
+ font-style: normal;
651
+ /* box-sizing: border-box; */
652
+ }
653
+ :root {
654
+ /* border radius */
655
+ --starasia-ui-date-border-radius: var(--starasia-ui-radii-md, 8px);
656
+ --starasia-ui-date-border-radius-sm: var(--starasia-ui-radii-md, 8px);
657
+ --starasia-ui-date-border-radius-md: var(--starasia-ui-radii-md, 8px);
658
+ --starasia-ui-date-border-radius-lg: var(--starasia-ui-radii-lg, 12px);
659
+
660
+ /* color */
661
+ --starasia-ui-date-color-black-secondary: var(
662
+ --starasia-ui-color-gray-50,
663
+ #f9fafb
664
+ );
665
+
666
+ /* box shadow */
667
+ --starasia-ui-date-box-shadow: var(
668
+ --starasia-ui-shadow-md,
669
+ 0 4px 6px -1px rgb(0 0 0 / 0.1),
670
+ 0 2px 4px -2px rgb(0 0 0 / 0.1)
671
+ );
672
+
673
+ /* color */
674
+ /* gray / black */
675
+ --starasia-ui-date-color-primary-black: var(
676
+ --starasia-ui-color-gray-700,
677
+ #374151
678
+ );
679
+ --starasia-ui-date-color-secondary-black: var(
680
+ --starasia-ui-color-gray-500,
681
+ #6b7280
682
+ );
683
+ --starasia-ui-date-color-tertiary-black: var(
684
+ --starasia-ui-color-gray-300,
685
+ #d1d5db
686
+ );
687
+ --starasia-ui-date-color-quaternary-black: var(
688
+ --starasia-ui-color-gray-50,
689
+ #f9fafb
690
+ );
691
+
692
+ /* gray / blue */
693
+ --starasia-ui-date-color-primary-blue: var(
694
+ --starasia-ui-color-blue-500,
695
+ #3b82f6
696
+ );
697
+ --starasia-ui-date-color-secondary-blue: var(
698
+ --starasia-ui-color-blue-500,
699
+ #3b82f6
700
+ );
701
+ --starasia-ui-date-color-tertiary-blue: var(
702
+ --starasia-ui-color-blue-300,
703
+ #93c5fd
704
+ );
705
+ --starasia-ui-date-color-quaternary-blue: var(
706
+ --starasia-ui-color-blue-50,
707
+ #eff6ff
708
+ );
709
+
710
+ /* spacing */
711
+ --starasia-ui-date-spacing-xs: var(--starasia-ui-spacing-xs, 4px);
712
+ --starasia-ui-date-spacing-sm: var(--starasia-ui-spacing-sm, 8px);
713
+ --starasia-ui-date-spacing-ms: var(--starasia-ui-spacing-3, 12px);
714
+ --starasia-ui-date-spacing-md: var(--starasia-ui-spacing-md, 16);
715
+ --starasia-ui-date-spacing-lg: var(--starasia-ui-spacing-lg, 24px);
716
+
717
+ /* height */
718
+ --starasia-ui-date-input-height: var(--starasia-ui-h-10, 40px);
719
+ --starasia-ui-date-height-sm: var(--starasia-ui-h-8, 32px);
720
+ --starasia-ui-date-height-md: 38px;
721
+ --starasia-ui-date-height-lg: var(--starasia-ui-h-12, 48px);
722
+
723
+ /* color */
724
+ --starasia-ui-input-color-tertiary-gray: var(
725
+ --starasia-ui-color-gray-300,
726
+ #d1d5db
727
+ );
728
+
729
+ --starasia-ui-date-placholder-color: var(
730
+ --starasia-ui-color-gray-200,
731
+ #c9cecc
732
+ );
733
+ --starasia-ui-date-placholder-fontWeight: var(
734
+ --starasia-ui-fontWeights-normal,
735
+ 300
736
+ );
737
+
738
+ --starasia-ui-input-color-secondary-red: var(
739
+ --starasia-ui-color-red-500,
740
+ #ef4444
741
+ );
742
+ --starasia-ui-input-color-secondary-yellow: var(
743
+ --starasia-ui-color-yellow-500,
744
+ #eab308
745
+ );
746
+ }
747
+ .starasia-calendar-wrapper {
748
+ position: relative;
749
+ }
750
+
751
+ .starasia-calendar {
752
+ border-radius: var(--starasia-ui-date-border-radius);
753
+ border: var(--starasia-ui-border, 1px) solid
754
+ var(--starasia-ui-date-color-black-secondary);
755
+ background: var(--starasia-ui-date-color-black-secondary);
756
+ box-shadow: var(--starasia-ui-date-box-shadow);
757
+ padding: var(--starasia-ui-date-spacing-lg) var(--starasia-ui-date-spacing-md);
758
+ width: max-content;
759
+ display: flex;
760
+ gap: var(--starasia-ui-date-spacing-ms);
761
+ flex-direction: column;
762
+ position: fixed;
763
+ z-index: 999;
764
+ }
765
+
766
+ .starasia-calendar.starasia-calendar-no-input {
767
+ position: relative !important;
768
+ margin-top: 0px;
769
+
770
+ /* bellow is for input no input */
771
+ width: 100%;
772
+ box-shadow: unset;
773
+ border: none;
774
+ background-color: white;
775
+ /* background-color: white; */
776
+ height: 100%;
777
+ border-radius: 0;
778
+ }
779
+
780
+ .starasia-calendar-header {
781
+ display: flex;
782
+ flex-direction: row;
783
+ align-items: center;
784
+ justify-content: space-between;
785
+ gap: var(--starasia-ui-date-spacing-xs);
786
+ }
787
+
788
+ .starasia-calendar-days-name-preivew {
789
+ display: flex;
790
+ gap: var(--starasia-ui-date-spacing-sm);
791
+ }
792
+
793
+ .starasia-calendar-days-name-preivew p {
794
+ color: var(--starasia-ui-date-color-secondary-black);
795
+ font-size: var(--starasia-ui-fontSizes-md, 14px);
796
+ flex: 1;
797
+ display: grid;
798
+ place-content: center;
799
+ }
800
+ .starasia-calendar-days-number-preivew {
801
+ display: grid;
802
+ grid-template-columns: repeat(7, 1fr);
803
+ gap: var(--starasia-ui-date-spacing-sm);
804
+ }
805
+
806
+ .starasia-calendar-days-number-preivew p {
807
+ font-size: var(--starasia-ui-fontSizes-md, 14px);
808
+ text-align: center;
809
+ width: 35px;
810
+ height: 32px;
811
+ flex: 1;
812
+ display: grid;
813
+ place-content: center;
814
+ cursor: pointer;
815
+ font-weight: 500;
816
+ border-radius: var(--starasia-ui-date-border-radius);
817
+ }
818
+
819
+ .starasia-calendar-days {
820
+ color: var(--starasia-ui-date-color-tertiary-black);
821
+ }
822
+ .starasia-calendar-days-current {
823
+ color: var(--starasia-ui-date-color-primary-black);
824
+ }
825
+
826
+ .starasia-calendar-days-number-preivew p:hover {
827
+ background: var(--starasia-ui-date-color-quaternary-blue);
828
+ color: var(--starasia-ui-date-color-tertiary-blue);
829
+ }
830
+
831
+ .starasia-calendar-days-active {
832
+ background: var(--starasia-ui-date-color-tertiary-blue);
833
+ color: var(--starasia-ui-date-color-primary-blue);
834
+ }
835
+
836
+ /* MONTH STYLING */
837
+ .starasia-calendar-months-preview {
838
+ display: grid;
839
+ grid-template-columns: repeat(3, 1fr);
840
+ row-gap: var(--starasia-ui-date-spacing-xs);
841
+ }
842
+
843
+ .starasia-calendar-months-preview p {
844
+ width: 98px;
845
+ height: 48px;
846
+ display: grid;
847
+ place-content: center;
848
+ cursor: pointer;
849
+ border-radius: var(--starasia-ui-date-border-radius);
850
+ }
851
+
852
+ .starasia-calendar-months-preview p:hover {
853
+ background: var(--starasia-ui-date-color-quaternary-blue);
854
+ color: var(--starasia-ui-date-color-tertiary-blue);
855
+ }
856
+
857
+ .starasia-calendar-months-active {
858
+ background: var(--starasia-ui-date-color-tertiary-blue);
859
+ color: var(--starasia-ui-date-color-primary-blue);
860
+ }
861
+ /* Year STYLING */
862
+ .starasia-calendar-years-preview {
863
+ display: grid;
864
+ grid-template-columns: repeat(3, 1fr);
865
+ row-gap: var(--starasia-ui-date-spacing-xs);
866
+ }
867
+
868
+ .starasia-calendar-years-preview p {
869
+ width: 98px;
870
+ height: 48px;
871
+ display: grid;
872
+ place-content: center;
873
+ cursor: pointer;
874
+ border-radius: var(--starasia-ui-date-border-radius);
875
+ }
876
+
877
+ .starasia-calendar-years-preview p:hover {
878
+ background: var(--starasia-ui-date-color-quaternary-blue);
879
+ color: var(--starasia-ui-date-color-tertiary-blue);
880
+ }
881
+
882
+ .starasia-calendar-years-active {
883
+ background: var(--starasia-ui-date-color-tertiary-blue);
884
+ color: var(--starasia-ui-date-color-primary-blue);
885
+ }
886
+
887
+ /* INPUT */
888
+
889
+ .starasia-calendar-input-container {
890
+ box-sizing: border-box;
891
+ overflow: hidden;
892
+ display: flex;
893
+ align-items: center;
894
+ gap: var(--starasia-ui-date-spacing-sm);
895
+ cursor: pointer;
896
+ }
897
+
898
+ .starasia-calendar-input-container:has(input:focus) {
899
+ border-color: var(--starasia-ui-date-color-primary-blue);
900
+ box-shadow: 0px 0px 0px 2px rgba(100, 181, 246, 0.2);
901
+ }
902
+ .starasia-calendar-input-container:has(input:disabled) {
903
+ /* border-color: var(--starasia-ui-input-color-tertiary-gray); */
904
+ /* background-color: var(--starasia-ui-input-color-tertiary-gray); */
905
+ border-color: rgba(120, 134, 127, 0.2);
906
+ background-color: rgba(120, 134, 127, 0.1);
907
+ pointer-events: none;
908
+ }
909
+
910
+ .starasia-calendar-input-outline {
911
+ border-color: rgba(120, 134, 127, 0.2);
912
+ /* border-color: var(--starasia-ui-date-color-tertiary-black); */
913
+ background-color: transparent;
914
+ border-width: var(--starasia-ui-border, 1px);
915
+ border-style: solid;
916
+ /* height: var(--starasia-ui-date-input-height); */
917
+ /* border-radius: var(--starasia-ui-date-border-radius); */
918
+ /* padding-inline: var(--starasia-ui-date-spacing-ms); */
919
+ }
920
+
921
+ .starasia-calendar-input-container.sm {
922
+ height: var(--starasia-ui-date-height-sm);
923
+ border-radius: var(--starasia-ui-date-border-radius-sm);
924
+ font-size: var(--starasia-ui-fontSizes-sm, 12px);
925
+ padding-inline: var(--starasia-ui-date-spacing-sm);
926
+ }
927
+ .starasia-calendar-input-container.md {
928
+ height: var(--starasia-ui-date-height-md);
929
+ border-radius: var(--starasia-ui-date-border-radius-md);
930
+ font-size: var(--starasia-ui-fontSizes-md, 14px);
931
+ padding-inline: var(--starasia-ui-date-spacing-ms);
932
+ }
933
+ .starasia-calendar-input-container.lg {
934
+ height: var(--starasia-ui-date-height-lg);
935
+ border-radius: var(--starasia-ui-date-border-radius-lg);
936
+ font-size: var(--starasia-ui-fontSizes-lg, 16px);
937
+ padding-inline: var(--starasia-ui-date-spacing-ms);
938
+ }
939
+
940
+ .starasia-calendar-input-preview-container {
941
+ width: 100%;
942
+ position: relative;
943
+ }
944
+
945
+ .starasia-calendar-input {
946
+ width: 100%;
947
+ box-sizing: border-box;
948
+ height: 100%;
949
+ border: none;
950
+ outline: none;
951
+ font-size: inherit;
952
+ font-weight: 500;
953
+ background: transparent;
954
+ cursor: pointer;
955
+ }
956
+
957
+ .starasia-calendar-input::placeholder {
958
+ color: var(--starasia-ui-date-placholder-color);
959
+ font-weight: var(--starasia-ui-date-placholder-fontWeight);
960
+ }
961
+
962
+ /* INPUT ICON */
963
+ .starasia-calendar-input-container-icon-left {
964
+ display: flex;
965
+ }
966
+ .starasia-calendar-input-container-icon-right {
967
+ display: flex;
968
+ }
969
+
970
+ .starasia-calendar-input-container-error {
971
+ border-color: var(--starasia-ui-input-color-secondary-red) !important;
972
+ }
973
+
974
+ .starasia-calendar-input-container-warning {
975
+ border-color: var(--starasia-ui-input-color-secondary-yellow) !important;
976
+ }
977
+ `, Xe = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], U = [
978
+ "January",
979
+ "February",
980
+ "March",
981
+ "April",
982
+ "May",
983
+ "June",
984
+ "July",
985
+ "August",
986
+ "September",
987
+ "October",
988
+ "November",
989
+ "December"
990
+ ], Fr = [
991
+ "Jan",
992
+ "Feb",
993
+ "Mar",
994
+ "Apr",
995
+ "May",
996
+ "Jun",
997
+ "Jul",
998
+ "Aug",
999
+ "Sep",
1000
+ "Oct",
1001
+ "Nov",
1002
+ "Dec"
1003
+ ];
1004
+ function Ze(t) {
1005
+ const [n, l] = B(t), i = Q(null), u = (m) => {
1006
+ i.current && !i.current.contains(m.target) && l(!1);
1007
+ };
1008
+ return I(() => (document.addEventListener("click", u, !0), () => {
1009
+ document.removeEventListener("click", u, !0);
1010
+ }), []), { ref: i, isComponentVisible: n, setIsComponentVisible: l };
1011
+ }
1012
+ const Je = "starasia-calendar-input-styles", $r = (t) => {
1013
+ if (!document.getElementById(Je)) {
1014
+ const n = document.createElement("style");
1015
+ n.id = Je, n.textContent = t, document.head.appendChild(n);
1016
+ }
1017
+ };
1018
+ $r(ie);
1019
+ const te = (t) => {
1020
+ if (t === "sm")
1021
+ return 16;
1022
+ if (t === "md")
1023
+ return 16;
1024
+ if (t === "lg")
1025
+ return 20;
1026
+ }, Yr = (t) => {
1027
+ const { size: n = "md", status: l = "default", variant: i = "outline", ...u } = t, m = Q(null), b = () => {
1028
+ m.current && u.onClick && (m.current.focus(), u.onClick(""));
1029
+ };
1030
+ return /* @__PURE__ */ o.jsxs(
1031
+ "div",
1032
+ {
1033
+ className: `starasia-calendar-input-container starasia-calendar-input-${i} starasia-calendar-input-container-${l} ${n} `,
1034
+ onClick: b,
1035
+ children: [
1036
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-input-container-icon-left", children: /* @__PURE__ */ o.jsx(
1037
+ "svg",
1038
+ {
1039
+ xmlns: "http://www.w3.org/2000/svg",
1040
+ width: te(n),
1041
+ height: te(n),
1042
+ viewBox: "0 0 20 20",
1043
+ fill: "none",
1044
+ children: /* @__PURE__ */ o.jsx(
1045
+ "path",
1046
+ {
1047
+ d: "M12.5 2.08301V5.41634M7.50002 2.08301V5.41634M17.0688 9.58301H2.93113M17.0688 9.58301C16.8953 4.82698 15.1284 3.33301 10 3.33301C4.87165 3.33301 3.10469 4.82698 2.93113 9.58301M17.0688 9.58301C17.0786 9.85037 17.0834 10.128 17.0834 10.4163C17.0834 15.833 15.4167 17.4997 10 17.4997C4.58335 17.4997 2.91669 15.833 2.91669 10.4163C2.91669 10.128 2.92138 9.85037 2.93113 9.58301",
1048
+ stroke: "#939E99",
1049
+ strokeWidth: "1.5",
1050
+ strokeLinecap: "round",
1051
+ strokeLinejoin: "round"
1052
+ }
1053
+ )
1054
+ }
1055
+ ) }),
1056
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-input-preview-container", children: /* @__PURE__ */ o.jsx(
1057
+ "input",
1058
+ {
1059
+ className: "starasia-calendar-input",
1060
+ ...u,
1061
+ disabled: l === "disable" ? !0 : u.disabled,
1062
+ value: u.value,
1063
+ ref: m
1064
+ }
1065
+ ) }),
1066
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-input-container-icon-right", children: /* @__PURE__ */ o.jsx(
1067
+ "svg",
1068
+ {
1069
+ xmlns: "http://www.w3.org/2000/svg",
1070
+ width: te(n),
1071
+ height: te(n),
1072
+ viewBox: "0 0 20 20",
1073
+ fill: "none",
1074
+ children: /* @__PURE__ */ o.jsx(
1075
+ "path",
1076
+ {
1077
+ d: "M3.33331 7.5L9.99998 14.1667L16.6666 7.5",
1078
+ stroke: "#939E99",
1079
+ strokeWidth: "1.5",
1080
+ strokeLinecap: "round",
1081
+ strokeLinejoin: "round"
1082
+ }
1083
+ )
1084
+ }
1085
+ ) })
1086
+ ]
1087
+ }
1088
+ );
1089
+ }, Or = ({
1090
+ date: t,
1091
+ setDate: n,
1092
+ dateRange: l,
1093
+ setDateRange: i,
1094
+ onChange: u,
1095
+ minDate: m,
1096
+ maxDate: b,
1097
+ input: j
1098
+ }) => {
1099
+ var v, c, g;
1100
+ let f = new Date(t.getFullYear(), t.getMonth(), 1), a = f.getDay(), E = [];
1101
+ const w = t.getMonth();
1102
+ for (let d = 0; d < 42; d++) {
1103
+ d === 0 && a === 0 ? f.setDate(f.getDate() - 7) : d === 0 ? f.setDate(
1104
+ f.getDate() + (d - a)
1105
+ ) : f.setDate(f.getDate() + 1);
1106
+ let p = {
1107
+ currentMonth: f.getMonth() === w,
1108
+ date: new Date(f),
1109
+ month: f.getMonth(),
1110
+ number: f.getDate(),
1111
+ selected: f.toDateString() === ((v = l.from) == null ? void 0 : v.toDateString()) || f.toDateString() === (((c = l.to) == null ? void 0 : c.toDateString()) || ((g = l.from) == null ? void 0 : g.toDateString())),
1112
+ year: f.getFullYear(),
1113
+ isDisabled: m && f < m || b && f > b
1114
+ };
1115
+ E.push(p);
1116
+ }
1117
+ const _ = (d) => {
1118
+ n(d);
1119
+ }, S = (d) => {
1120
+ var h;
1121
+ let p = { ...l };
1122
+ if (p.from && p.to)
1123
+ p = { from: d, to: null };
1124
+ else {
1125
+ const x = ((h = p.from) == null ? void 0 : h.getTime()) || 0;
1126
+ d.getTime() > x ? p = { from: p.from, to: d } : p = { from: d, to: p.from };
1127
+ }
1128
+ i(p), u(p);
1129
+ };
1130
+ return /* @__PURE__ */ o.jsxs("div", { className: "starasia-calendar-days-preivew", children: [
1131
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-days-name-preivew", children: Xe.map((d, p) => /* @__PURE__ */ o.jsx("p", { children: d }, p)) }),
1132
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-days-number-preivew", children: E.map((d, p) => {
1133
+ var Y;
1134
+ const h = d.date.getTime() > l.from.getTime() && d.date.getTime() < (((Y = l.to) == null ? void 0 : Y.getTime()) || l.from.getTime()), x = d.isDisabled;
1135
+ return /* @__PURE__ */ o.jsx(
1136
+ "p",
1137
+ {
1138
+ className: `${d.currentMonth ? "starasia-calendar-days-current" : "starasia-calendar-days"} ${d.selected ? "starasia-calendar-days-active" : ""}`,
1139
+ style: {
1140
+ backgroundColor: h ? "rgba(100, 181, 246, 0.1)" : "",
1141
+ pointerEvents: x ? "none" : void 0,
1142
+ cursor: x ? "not-allowed" : "pointer",
1143
+ color: x ? "#ccc" : h ? "#b0b0b0" : "",
1144
+ ...j ? {} : { width: "100%" }
1145
+ },
1146
+ onClick: () => {
1147
+ x || (_(d.date), S(d.date));
1148
+ },
1149
+ children: d.number
1150
+ },
1151
+ p
1152
+ );
1153
+ }) })
1154
+ ] });
1155
+ }, Pr = ({
1156
+ date: t,
1157
+ setDate: n,
1158
+ filter: l,
1159
+ setViews: i,
1160
+ dateRange: u,
1161
+ setDateRange: m,
1162
+ onChange: b,
1163
+ minDate: j,
1164
+ maxDate: f,
1165
+ input: a
1166
+ }) => {
1167
+ const E = u.from.getFullYear(), w = t.getFullYear(), _ = (v) => {
1168
+ l ? (S(v), n(v)) : (i("days"), n(v));
1169
+ }, S = (v) => {
1170
+ var g;
1171
+ let c = { ...u };
1172
+ if (c.from && c.to)
1173
+ c = { from: v, to: null };
1174
+ else {
1175
+ const d = ((g = c.from) == null ? void 0 : g.getTime()) || 0;
1176
+ v.getTime() > d ? c = { from: c.from, to: v } : c = { from: v, to: c.from };
1177
+ }
1178
+ m(c), b(c);
1179
+ };
1180
+ return /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-months-preview", children: U.map((v, c) => {
1181
+ var p, h, x;
1182
+ const g = new Date(w, c).getTime() > u.from.getTime() && new Date(w, c).getTime() < (((p = u.to) == null ? void 0 : p.getTime()) || u.from.getTime()), d = j && new Date(w, c) < j || f && new Date(w, c) > f;
1183
+ return /* @__PURE__ */ o.jsx(
1184
+ "p",
1185
+ {
1186
+ className: E === w && (c === ((h = u.from) == null ? void 0 : h.getMonth()) || c === ((x = u.to) == null ? void 0 : x.getMonth())) ? "starasia-calendar-months-active" : "",
1187
+ style: {
1188
+ backgroundColor: g ? "rgba(100, 181, 246, 0.1)" : "",
1189
+ pointerEvents: d ? "none" : void 0,
1190
+ cursor: d ? "not-allowed" : "pointer",
1191
+ color: d ? "#ccc" : g ? "#b0b0b0" : "",
1192
+ ...a ? {} : { width: "100%" }
1193
+ },
1194
+ onClick: () => {
1195
+ d || _(new Date(w, c));
1196
+ },
1197
+ children: v.slice(0, 3)
1198
+ },
1199
+ c
1200
+ );
1201
+ }) });
1202
+ }, ye = (t) => {
1203
+ const n = Math.floor(t / 10) * 10, l = n + 10;
1204
+ return { start: n, end: l };
1205
+ }, Nr = ({
1206
+ date: t,
1207
+ filter: n,
1208
+ setViews: l,
1209
+ setDate: i,
1210
+ dateRange: u,
1211
+ setDateRange: m,
1212
+ onChange: b,
1213
+ minDate: j,
1214
+ maxDate: f,
1215
+ input: a
1216
+ }) => {
1217
+ var p;
1218
+ let E = [];
1219
+ const w = t.getFullYear(), { start: _, end: S } = ye(w), v = u.from.getFullYear(), c = (p = u.to) == null ? void 0 : p.getFullYear();
1220
+ for (let h = _; h < S; h++) {
1221
+ const x = new Date(h, 0), Y = (!j || x >= j) && (!f || x <= f), $ = h === v || h === c, C = x > u.from && x < u.to;
1222
+ E.push({
1223
+ year: h,
1224
+ active: $ && Y,
1225
+ highlight: C && Y,
1226
+ disabled: !Y
1227
+ });
1228
+ }
1229
+ const g = (h) => {
1230
+ n ? (d(h), i(h)) : (i(h), l("months"));
1231
+ }, d = (h) => {
1232
+ var Y;
1233
+ let x = { ...u };
1234
+ if (x.from && x.to)
1235
+ x = { from: h, to: null };
1236
+ else {
1237
+ const $ = ((Y = x.from) == null ? void 0 : Y.getTime()) || 0;
1238
+ h.getTime() > $ ? x = { from: x.from, to: h } : x = { from: h, to: x.from };
1239
+ }
1240
+ m(x), b(x);
1241
+ };
1242
+ return /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-years-preview", children: E.map((h, x) => /* @__PURE__ */ o.jsx(
1243
+ "p",
1244
+ {
1245
+ className: `${h.active ? "starasia-calendar-months-active" : ""} ${h.highlight ? "starasia-calendar-months-highlight" : ""} ${h.disabled ? "starasia-calendar-disabled" : ""}`,
1246
+ onClick: () => {
1247
+ h.disabled || g(new Date(h.year, 0));
1248
+ },
1249
+ style: {
1250
+ backgroundColor: h.highlight ? "rgba(100, 181, 246, 0.1)" : "",
1251
+ color: h.highlight ? "#b0b0b0" : h.active ? "" : h.disabled ? "#ccc" : "",
1252
+ cursor: h.disabled ? "not-allowed" : "pointer",
1253
+ pointerEvents: h.disbled ? "none" : "all",
1254
+ ...a ? {} : { width: "100%" }
1255
+ },
1256
+ children: h.year
1257
+ },
1258
+ x
1259
+ )) });
1260
+ }, Qe = ({ ...t }) => /* @__PURE__ */ o.jsx(
1261
+ "svg",
1262
+ {
1263
+ xmlns: "http://www.w3.org/2000/svg",
1264
+ width: "20",
1265
+ height: "20",
1266
+ viewBox: "0 0 20 20",
1267
+ fill: "none",
1268
+ ...t,
1269
+ children: /* @__PURE__ */ o.jsx(
1270
+ "path",
1271
+ {
1272
+ d: "M12.5 3.33334L5.83337 10L12.5 16.6667",
1273
+ stroke: "#001A72",
1274
+ strokeWidth: "1.5",
1275
+ strokeLinecap: "round",
1276
+ strokeLinejoin: "round"
1277
+ }
1278
+ )
1279
+ }
1280
+ ), er = ({ ...t }) => /* @__PURE__ */ o.jsx(
1281
+ "svg",
1282
+ {
1283
+ xmlns: "http://www.w3.org/2000/svg",
1284
+ width: "20",
1285
+ height: "20",
1286
+ viewBox: "0 0 20 20",
1287
+ fill: "none",
1288
+ ...t,
1289
+ children: /* @__PURE__ */ o.jsx(
1290
+ "path",
1291
+ {
1292
+ d: "M7.5 16.6667L14.1667 10L7.5 3.33334",
1293
+ stroke: "#001A72",
1294
+ strokeWidth: "1.5",
1295
+ strokeLinecap: "round",
1296
+ strokeLinejoin: "round"
1297
+ }
1298
+ )
1299
+ }
1300
+ ), Ir = ({
1301
+ setViews: t,
1302
+ views: n,
1303
+ filter: l,
1304
+ date: i,
1305
+ setDate: u
1306
+ }) => {
1307
+ const m = () => {
1308
+ l || t((a) => a === "days" ? "months" : a === "months" ? "years" : "days");
1309
+ }, b = () => {
1310
+ if (n === "years") {
1311
+ u((a) => new Date(a.getFullYear() + 10, 0));
1312
+ return;
1313
+ }
1314
+ if (n === "months") {
1315
+ u((a) => new Date(a.getFullYear() + 1, a.getMonth()));
1316
+ return;
1317
+ }
1318
+ u((a) => new Date(a.getFullYear(), a.getMonth() + 1));
1319
+ }, j = () => {
1320
+ if (n === "years") {
1321
+ u((a) => new Date(a.getFullYear() - 10, 0));
1322
+ return;
1323
+ }
1324
+ if (n === "months") {
1325
+ u((a) => new Date(a.getFullYear() - 1, a.getMonth()));
1326
+ return;
1327
+ }
1328
+ u(
1329
+ (a) => new Date(
1330
+ a.getMonth() === 0 ? a.getFullYear() - 1 : a.getFullYear(),
1331
+ a.getMonth() === 0 ? 11 : a.getMonth() - 1
1332
+ )
1333
+ );
1334
+ }, f = () => {
1335
+ if (n === "days")
1336
+ return `${U[i.getMonth()]} ${i.getFullYear()}`;
1337
+ if (n === "months")
1338
+ return `${i.getFullYear()}`;
1339
+ if (n === "years")
1340
+ return `${ye(i.getFullYear()).start} ~ ${ye(i.getFullYear()).end}`;
1341
+ };
1342
+ return /* @__PURE__ */ o.jsxs("div", { className: "starasia-calendar-header", children: [
1343
+ /* @__PURE__ */ o.jsx(Qe, { onClick: () => j() }),
1344
+ /* @__PURE__ */ o.jsx("div", { style: { cursor: "pointer" }, onClick: m, children: f() }),
1345
+ /* @__PURE__ */ o.jsx(er, { onClick: () => b() })
1346
+ ] });
1347
+ };
1348
+ function q(t) {
1349
+ const n = new Date(t), l = n.getFullYear(), i = n.getMonth();
1350
+ return `${n.getDate().toString().padStart(2, "0")} ${Fr[i]} ${l}`;
1351
+ }
1352
+ const qe = "starasia-calendar-styles", Lr = (t) => {
1353
+ if (!document.getElementById(qe)) {
1354
+ const n = document.createElement("style");
1355
+ n.id = qe, n.textContent = t, document.head.appendChild(n);
1356
+ }
1357
+ };
1358
+ Lr(ie);
1359
+ const Ar = be(
1360
+ ({
1361
+ value: t,
1362
+ onChange: n,
1363
+ filter: l,
1364
+ input: i = !0,
1365
+ disabled: u,
1366
+ minDate: m,
1367
+ maxDate: b,
1368
+ placeholder: j,
1369
+ size: f,
1370
+ status: a
1371
+ }, E) => {
1372
+ const { ref: w, isComponentVisible: _, setIsComponentVisible: S } = Ze(!1), v = Q(null), [c, g] = B("days"), [d, p] = B(/* @__PURE__ */ new Date()), [h, x] = B({
1373
+ from: (t == null ? void 0 : t.from) || /* @__PURE__ */ new Date(),
1374
+ to: (t == null ? void 0 : t.to) || /* @__PURE__ */ new Date()
1375
+ });
1376
+ I(() => {
1377
+ t ? (p(t.from), x(t)) : (p(/* @__PURE__ */ new Date()), x({
1378
+ from: /* @__PURE__ */ new Date(),
1379
+ to: /* @__PURE__ */ new Date()
1380
+ }));
1381
+ }, [t]), I(() => {
1382
+ l && g(l);
1383
+ }, [l]), I(() => {
1384
+ l || g("days");
1385
+ }, [_]), I(() => {
1386
+ i || S(!0);
1387
+ }, [i]);
1388
+ const Y = () => {
1389
+ var C, P;
1390
+ if (!t)
1391
+ return "";
1392
+ if (l) {
1393
+ if (c === "days")
1394
+ return `${q(h.from)} ~ ${q(h.to || h.from) || "-"}`;
1395
+ if (c === "months")
1396
+ return `${U[h.from.getMonth()]} ~ ${h.to ? U[h.to.getMonth()] : "-"}`;
1397
+ if (c === "years")
1398
+ return `${(C = h.from) == null ? void 0 : C.getFullYear()} ~ ${((P = h.to) == null ? void 0 : P.getFullYear()) || "-"}`;
1399
+ } else
1400
+ return `${q(h.from)} ~ ${q(h.to || h.from) || "-"}`;
1401
+ }, $ = () => {
1402
+ if (v.current && w.current && i) {
1403
+ const C = w.current.getBoundingClientRect(), P = v.current.getBoundingClientRect();
1404
+ window.innerWidth < C.left + P.width ? v.current.style.left = `${C.left - P.width + C.width}px` : v.current.style.left = `${C.left}px`, C.top + P.height > window.innerHeight ? v.current.style.top = `${C.y - (C.height + P.height - 28)}px` : v.current.style.top = `${C.y + C.height}px`;
1405
+ }
1406
+ };
1407
+ return I(() => {
1408
+ v.current && w.current && i && $();
1409
+ }, [v, w, _]), I(() => {
1410
+ const C = E == null ? void 0 : E.current;
1411
+ return C && C.addEventListener("scroll", $), window.addEventListener("scroll", $), () => {
1412
+ C && C.removeEventListener("scroll", $), window.removeEventListener("scroll", $);
1413
+ };
1414
+ }, []), /* @__PURE__ */ o.jsxs(
1415
+ "div",
1416
+ {
1417
+ className: "starasia-calendar-wrapper",
1418
+ style: { height: i ? "auto" : "100%" },
1419
+ ref: i ? w : null,
1420
+ children: [
1421
+ i ? /* @__PURE__ */ o.jsx(
1422
+ Yr,
1423
+ {
1424
+ value: Y(),
1425
+ inputMode: "none",
1426
+ onClick: () => {
1427
+ S(!0);
1428
+ },
1429
+ onChange: () => {
1430
+ },
1431
+ disabled: u,
1432
+ placeholder: j,
1433
+ size: f,
1434
+ status: a
1435
+ }
1436
+ ) : null,
1437
+ _ ? /* @__PURE__ */ o.jsxs(
1438
+ "div",
1439
+ {
1440
+ className: `starasia-calendar ${i ? "" : "starasia-calendar-no-input"}`,
1441
+ ref: v,
1442
+ children: [
1443
+ /* @__PURE__ */ o.jsx(
1444
+ Ir,
1445
+ {
1446
+ setViews: g,
1447
+ views: c,
1448
+ filter: l,
1449
+ date: d,
1450
+ setDate: p
1451
+ }
1452
+ ),
1453
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-body", children: c === "days" ? /* @__PURE__ */ o.jsx(
1454
+ Or,
1455
+ {
1456
+ date: d,
1457
+ setDate: p,
1458
+ setIsComponentVisible: S,
1459
+ dateRange: h,
1460
+ setDateRange: x,
1461
+ input: i,
1462
+ onChange: n,
1463
+ minDate: m,
1464
+ maxDate: b
1465
+ }
1466
+ ) : c === "months" ? /* @__PURE__ */ o.jsx(
1467
+ Pr,
1468
+ {
1469
+ date: d,
1470
+ setDate: p,
1471
+ filter: l,
1472
+ setViews: g,
1473
+ dateRange: h,
1474
+ setDateRange: x,
1475
+ setIsComponentVisible: S,
1476
+ input: i,
1477
+ onChange: n,
1478
+ minDate: m,
1479
+ maxDate: b
1480
+ }
1481
+ ) : /* @__PURE__ */ o.jsx(
1482
+ Nr,
1483
+ {
1484
+ date: d,
1485
+ setDate: p,
1486
+ filter: l,
1487
+ setViews: g,
1488
+ dateRange: h,
1489
+ setDateRange: x,
1490
+ setIsComponentVisible: S,
1491
+ input: i,
1492
+ onChange: n,
1493
+ minDate: m,
1494
+ maxDate: b
1495
+ }
1496
+ ) })
1497
+ ]
1498
+ }
1499
+ ) : null
1500
+ ]
1501
+ }
1502
+ );
1503
+ }
1504
+ ), He = "starasia-calendar-input-styles", Wr = (t) => {
1505
+ if (!document.getElementById(He)) {
1506
+ const n = document.createElement("style");
1507
+ n.id = He, n.textContent = t, document.head.appendChild(n);
1508
+ }
1509
+ };
1510
+ Wr(ie);
1511
+ const se = (t) => {
1512
+ if (t === "sm")
1513
+ return 16;
1514
+ if (t === "md")
1515
+ return 16;
1516
+ if (t === "lg")
1517
+ return 20;
1518
+ }, Vr = (t) => {
1519
+ const { size: n = "md", status: l = "default", variant: i = "outline", ...u } = t, m = Q(null), b = () => {
1520
+ m.current && u.onClick && (m.current.focus(), u.onClick(""));
1521
+ };
1522
+ return /* @__PURE__ */ o.jsxs(
1523
+ "div",
1524
+ {
1525
+ className: `starasia-calendar-input-container starasia-calendar-input-${i} starasia-calendar-input-container-${l} ${n} `,
1526
+ onClick: b,
1527
+ children: [
1528
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-input-container-icon-left", children: /* @__PURE__ */ o.jsx(
1529
+ "svg",
1530
+ {
1531
+ xmlns: "http://www.w3.org/2000/svg",
1532
+ width: se(n),
1533
+ height: se(n),
1534
+ viewBox: "0 0 20 20",
1535
+ fill: "none",
1536
+ children: /* @__PURE__ */ o.jsx(
1537
+ "path",
1538
+ {
1539
+ d: "M12.5 2.08301V5.41634M7.50002 2.08301V5.41634M17.0688 9.58301H2.93113M17.0688 9.58301C16.8953 4.82698 15.1284 3.33301 10 3.33301C4.87165 3.33301 3.10469 4.82698 2.93113 9.58301M17.0688 9.58301C17.0786 9.85037 17.0834 10.128 17.0834 10.4163C17.0834 15.833 15.4167 17.4997 10 17.4997C4.58335 17.4997 2.91669 15.833 2.91669 10.4163C2.91669 10.128 2.92138 9.85037 2.93113 9.58301",
1540
+ stroke: "#939E99",
1541
+ strokeWidth: "1.5",
1542
+ strokeLinecap: "round",
1543
+ strokeLinejoin: "round"
1544
+ }
1545
+ )
1546
+ }
1547
+ ) }),
1548
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-input-preview-container", children: /* @__PURE__ */ o.jsx(
1549
+ "input",
1550
+ {
1551
+ className: "starasia-calendar-input",
1552
+ ...u,
1553
+ disabled: l === "disable" ? !0 : u.disabled,
1554
+ value: u.value,
1555
+ ref: m
1556
+ }
1557
+ ) }),
1558
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-input-container-icon-right", children: /* @__PURE__ */ o.jsx(
1559
+ "svg",
1560
+ {
1561
+ xmlns: "http://www.w3.org/2000/svg",
1562
+ width: se(n),
1563
+ height: se(n),
1564
+ viewBox: "0 0 20 20",
1565
+ fill: "none",
1566
+ children: /* @__PURE__ */ o.jsx(
1567
+ "path",
1568
+ {
1569
+ d: "M3.33331 7.5L9.99998 14.1667L16.6666 7.5",
1570
+ stroke: "#939E99",
1571
+ strokeWidth: "1.5",
1572
+ strokeLinecap: "round",
1573
+ strokeLinejoin: "round"
1574
+ }
1575
+ )
1576
+ }
1577
+ ) })
1578
+ ]
1579
+ }
1580
+ );
1581
+ }, Br = ({
1582
+ date: t,
1583
+ setDate: n,
1584
+ previewDate: l,
1585
+ setPreviewDate: i,
1586
+ setIsComponentVisible: u,
1587
+ minDate: m,
1588
+ maxDate: b,
1589
+ input: j,
1590
+ onChange: f
1591
+ }) => {
1592
+ let a = new Date(
1593
+ l.getFullYear(),
1594
+ l.getMonth(),
1595
+ 1
1596
+ ), E = a.getDay(), w = [];
1597
+ const _ = t.toDateString(), S = l.getMonth();
1598
+ for (let c = 0; c < 42; c++) {
1599
+ c === 0 && E === 0 ? a.setDate(a.getDate() - 7) : c === 0 ? a.setDate(
1600
+ a.getDate() + (c - E)
1601
+ ) : a.setDate(a.getDate() + 1);
1602
+ let g = {
1603
+ currentMonth: a.getMonth() === S,
1604
+ date: new Date(a),
1605
+ month: a.getMonth(),
1606
+ number: a.getDate(),
1607
+ selected: a.toDateString() === _,
1608
+ year: a.getFullYear(),
1609
+ isDisabled: m && a < m || b && a > b
1610
+ };
1611
+ w.push(g);
1612
+ }
1613
+ const v = (c) => {
1614
+ (!m || c >= m) && (!b || c <= b) && (n(c), f(c), i(c), j && u(!1));
1615
+ };
1616
+ return /* @__PURE__ */ o.jsxs("div", { className: "starasia-calendar-days-preivew", children: [
1617
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-days-name-preivew", children: Xe.map((c, g) => /* @__PURE__ */ o.jsx("p", { children: c }, g)) }),
1618
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-days-number-preivew", children: w.map((c, g) => {
1619
+ const d = c.isDisabled;
1620
+ return /* @__PURE__ */ o.jsx(
1621
+ "p",
1622
+ {
1623
+ className: `${c.currentMonth ? "starasia-calendar-days-current" : "starasia-calendar-days"} ${c.selected ? "starasia-calendar-days-active" : ""}`,
1624
+ style: {
1625
+ color: d ? "#ccc" : void 0,
1626
+ pointerEvents: d ? "none" : void 0,
1627
+ cursor: d ? "not-allowed" : "pointer",
1628
+ ...j ? {} : { width: "100%" }
1629
+ },
1630
+ onClick: () => {
1631
+ d || v(c.date);
1632
+ },
1633
+ children: c.number
1634
+ },
1635
+ g
1636
+ );
1637
+ }) })
1638
+ ] });
1639
+ }, Ur = ({
1640
+ date: t,
1641
+ setDate: n,
1642
+ filter: l,
1643
+ setViews: i,
1644
+ onChange: u,
1645
+ previewDate: m,
1646
+ setPreviewDate: b,
1647
+ minDate: j,
1648
+ maxDate: f,
1649
+ input: a
1650
+ }) => {
1651
+ const E = t.getMonth(), w = t.getFullYear(), _ = m.getFullYear(), S = (v) => {
1652
+ (!j || v >= j) && (!f || v <= f) && (l ? (u(v), n(v), b(v)) : (i("days"), b(v)));
1653
+ };
1654
+ return /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-months-preview", children: U.map((v, c) => {
1655
+ const g = j && new Date(_, c, 1) < j || f && new Date(_, c + 1, 0) > f;
1656
+ return /* @__PURE__ */ o.jsx(
1657
+ "p",
1658
+ {
1659
+ className: c === E && _ === w ? "starasia-calendar-months-active" : "",
1660
+ style: {
1661
+ color: g ? "#ccc" : void 0,
1662
+ pointerEvents: g ? "none" : void 0,
1663
+ cursor: g ? "not-allowed" : "pointer",
1664
+ ...a ? {} : { width: "100%" }
1665
+ },
1666
+ onClick: () => {
1667
+ g || S(new Date(_, c));
1668
+ },
1669
+ children: v.slice(0, 3)
1670
+ },
1671
+ c
1672
+ );
1673
+ }) });
1674
+ }, me = (t) => {
1675
+ const n = Math.floor(t / 10) * 10, l = n + 10;
1676
+ return { start: n, end: l };
1677
+ }, zr = ({
1678
+ date: t,
1679
+ filter: n,
1680
+ setViews: l,
1681
+ setDate: i,
1682
+ onChange: u,
1683
+ previewDate: m,
1684
+ setPreviewDate: b,
1685
+ minDate: j,
1686
+ maxDate: f,
1687
+ input: a
1688
+ }) => {
1689
+ let E = [];
1690
+ const w = m.getFullYear(), { start: _, end: S } = me(w), v = t.getFullYear();
1691
+ for (let g = _; g < S; g++) {
1692
+ let d = j && new Date(g, 0, 1) < j || f && new Date(g, 11, 31) > f;
1693
+ E.push({ year: g, active: g === v, isDisabled: d });
1694
+ }
1695
+ const c = (g) => {
1696
+ (!j || g >= j) && (!f || g <= f) && (n ? (u(g), i(g), b(g)) : (l("months"), b(g)));
1697
+ };
1698
+ return /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-years-preview", children: E.map((g, d) => /* @__PURE__ */ o.jsx(
1699
+ "p",
1700
+ {
1701
+ className: g.active ? "starasia-calendar-months-active" : "",
1702
+ style: {
1703
+ color: g.isDisabled ? "#ccc" : void 0,
1704
+ pointerEvents: g.isDisabled ? "none" : void 0,
1705
+ cursor: g.isDisabled ? "not-allowed" : "pointer",
1706
+ ...a ? {} : { width: "100%" }
1707
+ },
1708
+ onClick: () => {
1709
+ g.isDisabled || c(new Date(g.year, 0));
1710
+ },
1711
+ children: g.year
1712
+ },
1713
+ d
1714
+ )) });
1715
+ }, Jr = ({
1716
+ setViews: t,
1717
+ views: n,
1718
+ filter: l,
1719
+ previewDate: i,
1720
+ setPreviewDate: u
1721
+ }) => {
1722
+ const m = () => {
1723
+ l || t((a) => a === "days" ? "months" : a === "months" ? "years" : "days");
1724
+ }, b = () => {
1725
+ if (n === "years") {
1726
+ u((a) => new Date(a.getFullYear() + 10, 0));
1727
+ return;
1728
+ }
1729
+ if (n === "months") {
1730
+ u(
1731
+ (a) => new Date(a.getFullYear() + 1, a.getMonth())
1732
+ );
1733
+ return;
1734
+ }
1735
+ u((a) => new Date(a.getFullYear(), a.getMonth() + 1));
1736
+ }, j = () => {
1737
+ if (n === "years") {
1738
+ u((a) => new Date(a.getFullYear() - 10, 0));
1739
+ return;
1740
+ }
1741
+ if (n === "months") {
1742
+ u(
1743
+ (a) => new Date(a.getFullYear() - 1, a.getMonth())
1744
+ );
1745
+ return;
1746
+ }
1747
+ u(
1748
+ (a) => new Date(
1749
+ a.getMonth() === 0 ? a.getFullYear() - 1 : a.getFullYear(),
1750
+ a.getMonth() === 0 ? 11 : a.getMonth() - 1
1751
+ )
1752
+ );
1753
+ }, f = () => {
1754
+ if (n === "days")
1755
+ return `${U[i.getMonth()]} ${i.getFullYear()}`;
1756
+ if (n === "months")
1757
+ return `${i.getFullYear()}`;
1758
+ if (n === "years")
1759
+ return `${me(i.getFullYear()).start} ~ ${me(i.getFullYear()).end}`;
1760
+ };
1761
+ return /* @__PURE__ */ o.jsxs("div", { className: "starasia-calendar-header", children: [
1762
+ /* @__PURE__ */ o.jsx(Qe, { onClick: () => j() }),
1763
+ /* @__PURE__ */ o.jsx("div", { style: { cursor: "pointer" }, onClick: m, children: f() }),
1764
+ /* @__PURE__ */ o.jsx(er, { onClick: () => b() })
1765
+ ] });
1766
+ }, Ge = "starasia-calendar-styles", qr = (t) => {
1767
+ if (!document.getElementById(Ge)) {
1768
+ const n = document.createElement("style");
1769
+ n.id = Ge, n.textContent = t, document.head.appendChild(n);
1770
+ }
1771
+ };
1772
+ qr(ie);
1773
+ const Hr = be(
1774
+ ({
1775
+ value: t,
1776
+ onChange: n,
1777
+ filter: l,
1778
+ input: i = !0,
1779
+ disabled: u,
1780
+ minDate: m,
1781
+ maxDate: b,
1782
+ placeholder: j,
1783
+ size: f,
1784
+ status: a
1785
+ }, E) => {
1786
+ const { ref: w, isComponentVisible: _, setIsComponentVisible: S } = Ze(!1), v = Q(null), [c, g] = B("days"), [d, p] = B(/* @__PURE__ */ new Date()), [h, x] = B(/* @__PURE__ */ new Date());
1787
+ I(() => {
1788
+ t ? (p(t), x(t)) : (p(/* @__PURE__ */ new Date()), x(/* @__PURE__ */ new Date()));
1789
+ }, [t]), I(() => {
1790
+ l && g(l);
1791
+ }, [l]), I(() => {
1792
+ l || g("days");
1793
+ }, [_]), I(() => {
1794
+ i || S(!0);
1795
+ }, [i]);
1796
+ const Y = () => t ? l === "days" ? q(d) : l === "months" ? `${U[d.getMonth()]} ${d.getFullYear()}` : l === "years" ? d.getFullYear() : q(d) : "", $ = () => {
1797
+ if (v.current && w.current && i) {
1798
+ const C = w.current.getBoundingClientRect(), P = v.current.getBoundingClientRect();
1799
+ window.innerWidth < C.left + P.width ? v.current.style.left = `${C.left - P.width + C.width}px` : v.current.style.left = `${C.left}px`, C.top + P.height > window.innerHeight ? v.current.style.top = `${C.y - (C.height + P.height - 28)}px` : v.current.style.top = `${C.y + C.height}px`;
1800
+ }
1801
+ };
1802
+ return I(() => {
1803
+ v.current && w.current && i && $();
1804
+ }, [v, w, _]), I(() => {
1805
+ const C = E == null ? void 0 : E.current;
1806
+ return C && C.addEventListener("scroll", $), window.addEventListener("scroll", $), () => {
1807
+ C && C.removeEventListener("scroll", $), window.removeEventListener("scroll", $);
1808
+ };
1809
+ }, []), /* @__PURE__ */ o.jsxs(
1810
+ "div",
1811
+ {
1812
+ className: "starasia-calendar-wrapper",
1813
+ style: { height: i ? "auto" : "100%" },
1814
+ ref: i ? w : null,
1815
+ children: [
1816
+ i ? /* @__PURE__ */ o.jsx(
1817
+ Vr,
1818
+ {
1819
+ value: Y(),
1820
+ onClick: () => S(!0),
1821
+ onChange: () => {
1822
+ },
1823
+ placeholder: j,
1824
+ disabled: u,
1825
+ size: f,
1826
+ status: a,
1827
+ inputMode: "none"
1828
+ }
1829
+ ) : null,
1830
+ _ ? /* @__PURE__ */ o.jsxs(
1831
+ "div",
1832
+ {
1833
+ className: `starasia-calendar ${i ? "" : "starasia-calendar-no-input"}`,
1834
+ ref: v,
1835
+ children: [
1836
+ /* @__PURE__ */ o.jsx(
1837
+ Jr,
1838
+ {
1839
+ setViews: g,
1840
+ views: c,
1841
+ filter: l,
1842
+ previewDate: h,
1843
+ setPreviewDate: x,
1844
+ isComponentVisible: _
1845
+ }
1846
+ ),
1847
+ /* @__PURE__ */ o.jsx("div", { className: "starasia-calendar-body", children: c === "days" ? /* @__PURE__ */ o.jsx(
1848
+ Br,
1849
+ {
1850
+ date: d,
1851
+ setDate: p,
1852
+ previewDate: h,
1853
+ setPreviewDate: x,
1854
+ setIsComponentVisible: S,
1855
+ input: i,
1856
+ minDate: m,
1857
+ maxDate: b,
1858
+ onChange: n
1859
+ }
1860
+ ) : c === "months" ? /* @__PURE__ */ o.jsx(
1861
+ Ur,
1862
+ {
1863
+ date: d,
1864
+ setDate: p,
1865
+ previewDate: h,
1866
+ setPreviewDate: x,
1867
+ filter: l,
1868
+ setViews: g,
1869
+ onChange: n,
1870
+ minDate: m,
1871
+ maxDate: b,
1872
+ input: i
1873
+ }
1874
+ ) : /* @__PURE__ */ o.jsx(
1875
+ zr,
1876
+ {
1877
+ date: d,
1878
+ setDate: p,
1879
+ previewDate: h,
1880
+ setPreviewDate: x,
1881
+ filter: l,
1882
+ setViews: g,
1883
+ onChange: n,
1884
+ minDate: m,
1885
+ maxDate: b,
1886
+ input: i
1887
+ }
1888
+ ) })
1889
+ ]
1890
+ }
1891
+ ) : null
1892
+ ]
1893
+ }
1894
+ );
1895
+ }
1896
+ ), Kr = be(
1897
+ ({
1898
+ value: t,
1899
+ onChange: n,
1900
+ filter: l,
1901
+ input: i = !0,
1902
+ rangedDate: u,
1903
+ disabled: m,
1904
+ minDate: b,
1905
+ maxDate: j,
1906
+ placeholder: f,
1907
+ size: a,
1908
+ status: E
1909
+ }, w) => /* @__PURE__ */ o.jsx(o.Fragment, { children: u ? /* @__PURE__ */ o.jsx(
1910
+ Ar,
1911
+ {
1912
+ onChange: n,
1913
+ value: t,
1914
+ input: i,
1915
+ filter: l,
1916
+ disabled: m,
1917
+ ref: w,
1918
+ minDate: b,
1919
+ maxDate: j,
1920
+ placeholder: f,
1921
+ size: a,
1922
+ status: E
1923
+ }
1924
+ ) : /* @__PURE__ */ o.jsx(
1925
+ Hr,
1926
+ {
1927
+ onChange: n,
1928
+ value: t,
1929
+ input: i,
1930
+ filter: l,
1931
+ disabled: m,
1932
+ ref: w,
1933
+ minDate: b,
1934
+ maxDate: j,
1935
+ placeholder: f,
1936
+ size: a,
1937
+ status: E
1938
+ }
1939
+ ) })
1940
+ );
1941
+ export {
1942
+ Kr as StarasiaDate
1943
+ };