@neutron.co.id/operasional-interfaces 1.3.0-beta.1 → 1.3.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.cjs CHANGED
@@ -5,15 +5,14 @@ const vue = require("vue");
5
5
  const interfaces = require("@neon.id/interfaces");
6
6
  const tempatModels = require("@neutron.co.id/tempat-models");
7
7
  const context = require("@neon.id/context");
8
+ const core = require("@vueuse/core");
8
9
  const office = require("@neon.id/office");
9
10
  const query = require("@neon.id/query");
10
- const sentralInterfaces = require("@neutron.co.id/sentral-interfaces");
11
- const identitasInterfaces = require("@neon.id/identitas-interfaces");
12
11
  const pinia = require("pinia");
13
12
  const component = require("@neon.id/utils/component");
14
- const core = require("@vueuse/core");
15
13
  const form = require("@neon.id/form");
16
14
  const personaliaModels = require("@neutron.co.id/personalia-models");
15
+ const identitasInterfaces = require("@neon.id/identitas-interfaces");
17
16
  const _hoisted_1$8 = { class: "xxx-button" };
18
17
  const __default__$8 = vue.defineComponent({ name: "XxxButton" });
19
18
  const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
@@ -3547,250 +3546,7 @@ function useClientHandle() {
3547
3546
  }
3548
3547
  return r2;
3549
3548
  }
3550
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
3551
- function getDefaultExportFromCjs(x) {
3552
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
3553
- }
3554
- var dayjs_minExports = {};
3555
- var dayjs_min = {
3556
- get exports() {
3557
- return dayjs_minExports;
3558
- },
3559
- set exports(v2) {
3560
- dayjs_minExports = v2;
3561
- }
3562
- };
3563
- (function(module2, exports2) {
3564
- !function(t2, e2) {
3565
- module2.exports = e2();
3566
- }(commonjsGlobal, function() {
3567
- var t2 = 1e3, e2 = 6e4, n = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u = "hour", a = "day", o2 = "week", f2 = "month", h = "quarter", c = "year", d2 = "date", l2 = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) {
3568
- var e3 = ["th", "st", "nd", "rd"], n2 = t3 % 100;
3569
- return "[" + t3 + (e3[(n2 - 20) % 10] || e3[n2] || e3[0]) + "]";
3570
- } }, m = function(t3, e3, n2) {
3571
- var r3 = String(t3);
3572
- return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n2) + t3;
3573
- }, v2 = { s: m, z: function(t3) {
3574
- var e3 = -t3.utcOffset(), n2 = Math.abs(e3), r3 = Math.floor(n2 / 60), i3 = n2 % 60;
3575
- return (e3 <= 0 ? "+" : "-") + m(r3, 2, "0") + ":" + m(i3, 2, "0");
3576
- }, m: function t3(e3, n2) {
3577
- if (e3.date() < n2.date())
3578
- return -t3(n2, e3);
3579
- var r3 = 12 * (n2.year() - e3.year()) + (n2.month() - e3.month()), i3 = e3.clone().add(r3, f2), s3 = n2 - i3 < 0, u2 = e3.clone().add(r3 + (s3 ? -1 : 1), f2);
3580
- return +(-(r3 + (n2 - i3) / (s3 ? i3 - u2 : u2 - i3)) || 0);
3581
- }, a: function(t3) {
3582
- return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
3583
- }, p: function(t3) {
3584
- return { M: f2, y: c, w: o2, d: a, D: d2, h: u, m: s2, s: i2, ms: r2, Q: h }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
3585
- }, u: function(t3) {
3586
- return void 0 === t3;
3587
- } }, g = "en", D = {};
3588
- D[g] = M;
3589
- var p = function(t3) {
3590
- return t3 instanceof _;
3591
- }, S = function t3(e3, n2, r3) {
3592
- var i3;
3593
- if (!e3)
3594
- return g;
3595
- if ("string" == typeof e3) {
3596
- var s3 = e3.toLowerCase();
3597
- D[s3] && (i3 = s3), n2 && (D[s3] = n2, i3 = s3);
3598
- var u2 = e3.split("-");
3599
- if (!i3 && u2.length > 1)
3600
- return t3(u2[0]);
3601
- } else {
3602
- var a2 = e3.name;
3603
- D[a2] = e3, i3 = a2;
3604
- }
3605
- return !r3 && i3 && (g = i3), i3 || !r3 && g;
3606
- }, w = function(t3, e3) {
3607
- if (p(t3))
3608
- return t3.clone();
3609
- var n2 = "object" == typeof e3 ? e3 : {};
3610
- return n2.date = t3, n2.args = arguments, new _(n2);
3611
- }, O = v2;
3612
- O.l = S, O.i = p, O.w = function(t3, e3) {
3613
- return w(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
3614
- };
3615
- var _ = function() {
3616
- function M2(t3) {
3617
- this.$L = S(t3.locale, null, true), this.parse(t3);
3618
- }
3619
- var m2 = M2.prototype;
3620
- return m2.parse = function(t3) {
3621
- this.$d = function(t4) {
3622
- var e3 = t4.date, n2 = t4.utc;
3623
- if (null === e3)
3624
- return new Date(NaN);
3625
- if (O.u(e3))
3626
- return new Date();
3627
- if (e3 instanceof Date)
3628
- return new Date(e3);
3629
- if ("string" == typeof e3 && !/Z$/i.test(e3)) {
3630
- var r3 = e3.match($);
3631
- if (r3) {
3632
- var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
3633
- return n2 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3);
3634
- }
3635
- }
3636
- return new Date(e3);
3637
- }(t3), this.$x = t3.x || {}, this.init();
3638
- }, m2.init = function() {
3639
- var t3 = this.$d;
3640
- this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
3641
- }, m2.$utils = function() {
3642
- return O;
3643
- }, m2.isValid = function() {
3644
- return !(this.$d.toString() === l2);
3645
- }, m2.isSame = function(t3, e3) {
3646
- var n2 = w(t3);
3647
- return this.startOf(e3) <= n2 && n2 <= this.endOf(e3);
3648
- }, m2.isAfter = function(t3, e3) {
3649
- return w(t3) < this.startOf(e3);
3650
- }, m2.isBefore = function(t3, e3) {
3651
- return this.endOf(e3) < w(t3);
3652
- }, m2.$g = function(t3, e3, n2) {
3653
- return O.u(t3) ? this[e3] : this.set(n2, t3);
3654
- }, m2.unix = function() {
3655
- return Math.floor(this.valueOf() / 1e3);
3656
- }, m2.valueOf = function() {
3657
- return this.$d.getTime();
3658
- }, m2.startOf = function(t3, e3) {
3659
- var n2 = this, r3 = !!O.u(e3) || e3, h2 = O.p(t3), l3 = function(t4, e4) {
3660
- var i3 = O.w(n2.$u ? Date.UTC(n2.$y, e4, t4) : new Date(n2.$y, e4, t4), n2);
3661
- return r3 ? i3 : i3.endOf(a);
3662
- }, $2 = function(t4, e4) {
3663
- return O.w(n2.toDate()[t4].apply(n2.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n2);
3664
- }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
3665
- switch (h2) {
3666
- case c:
3667
- return r3 ? l3(1, 0) : l3(31, 11);
3668
- case f2:
3669
- return r3 ? l3(1, M3) : l3(0, M3 + 1);
3670
- case o2:
3671
- var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
3672
- return l3(r3 ? m3 - D2 : m3 + (6 - D2), M3);
3673
- case a:
3674
- case d2:
3675
- return $2(v3 + "Hours", 0);
3676
- case u:
3677
- return $2(v3 + "Minutes", 1);
3678
- case s2:
3679
- return $2(v3 + "Seconds", 2);
3680
- case i2:
3681
- return $2(v3 + "Milliseconds", 3);
3682
- default:
3683
- return this.clone();
3684
- }
3685
- }, m2.endOf = function(t3) {
3686
- return this.startOf(t3, false);
3687
- }, m2.$set = function(t3, e3) {
3688
- var n2, o3 = O.p(t3), h2 = "set" + (this.$u ? "UTC" : ""), l3 = (n2 = {}, n2[a] = h2 + "Date", n2[d2] = h2 + "Date", n2[f2] = h2 + "Month", n2[c] = h2 + "FullYear", n2[u] = h2 + "Hours", n2[s2] = h2 + "Minutes", n2[i2] = h2 + "Seconds", n2[r2] = h2 + "Milliseconds", n2)[o3], $2 = o3 === a ? this.$D + (e3 - this.$W) : e3;
3689
- if (o3 === f2 || o3 === c) {
3690
- var y2 = this.clone().set(d2, 1);
3691
- y2.$d[l3]($2), y2.init(), this.$d = y2.set(d2, Math.min(this.$D, y2.daysInMonth())).$d;
3692
- } else
3693
- l3 && this.$d[l3]($2);
3694
- return this.init(), this;
3695
- }, m2.set = function(t3, e3) {
3696
- return this.clone().$set(t3, e3);
3697
- }, m2.get = function(t3) {
3698
- return this[O.p(t3)]();
3699
- }, m2.add = function(r3, h2) {
3700
- var d3, l3 = this;
3701
- r3 = Number(r3);
3702
- var $2 = O.p(h2), y2 = function(t3) {
3703
- var e3 = w(l3);
3704
- return O.w(e3.date(e3.date() + Math.round(t3 * r3)), l3);
3705
- };
3706
- if ($2 === f2)
3707
- return this.set(f2, this.$M + r3);
3708
- if ($2 === c)
3709
- return this.set(c, this.$y + r3);
3710
- if ($2 === a)
3711
- return y2(1);
3712
- if ($2 === o2)
3713
- return y2(7);
3714
- var M3 = (d3 = {}, d3[s2] = e2, d3[u] = n, d3[i2] = t2, d3)[$2] || 1, m3 = this.$d.getTime() + r3 * M3;
3715
- return O.w(m3, this);
3716
- }, m2.subtract = function(t3, e3) {
3717
- return this.add(-1 * t3, e3);
3718
- }, m2.format = function(t3) {
3719
- var e3 = this, n2 = this.$locale();
3720
- if (!this.isValid())
3721
- return n2.invalidDate || l2;
3722
- var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = O.z(this), s3 = this.$H, u2 = this.$m, a2 = this.$M, o3 = n2.weekdays, f3 = n2.months, h2 = function(t4, n3, i4, s4) {
3723
- return t4 && (t4[n3] || t4(e3, r3)) || i4[n3].slice(0, s4);
3724
- }, c2 = function(t4) {
3725
- return O.s(s3 % 12 || 12, t4, "0");
3726
- }, d3 = n2.meridiem || function(t4, e4, n3) {
3727
- var r4 = t4 < 12 ? "AM" : "PM";
3728
- return n3 ? r4.toLowerCase() : r4;
3729
- }, $2 = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h2(n2.monthsShort, a2, f3, 3), MMMM: h2(f3, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n2.weekdaysMin, this.$W, o3, 2), ddd: h2(n2.weekdaysShort, this.$W, o3, 3), dddd: o3[this.$W], H: String(s3), HH: O.s(s3, 2, "0"), h: c2(1), hh: c2(2), a: d3(s3, u2, true), A: d3(s3, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i3 };
3730
- return r3.replace(y, function(t4, e4) {
3731
- return e4 || $2[t4] || i3.replace(":", "");
3732
- });
3733
- }, m2.utcOffset = function() {
3734
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
3735
- }, m2.diff = function(r3, d3, l3) {
3736
- var $2, y2 = O.p(d3), M3 = w(r3), m3 = (M3.utcOffset() - this.utcOffset()) * e2, v3 = this - M3, g2 = O.m(this, M3);
3737
- return g2 = ($2 = {}, $2[c] = g2 / 12, $2[f2] = g2, $2[h] = g2 / 3, $2[o2] = (v3 - m3) / 6048e5, $2[a] = (v3 - m3) / 864e5, $2[u] = v3 / n, $2[s2] = v3 / e2, $2[i2] = v3 / t2, $2)[y2] || v3, l3 ? g2 : O.a(g2);
3738
- }, m2.daysInMonth = function() {
3739
- return this.endOf(f2).$D;
3740
- }, m2.$locale = function() {
3741
- return D[this.$L];
3742
- }, m2.locale = function(t3, e3) {
3743
- if (!t3)
3744
- return this.$L;
3745
- var n2 = this.clone(), r3 = S(t3, e3, true);
3746
- return r3 && (n2.$L = r3), n2;
3747
- }, m2.clone = function() {
3748
- return O.w(this.$d, this);
3749
- }, m2.toDate = function() {
3750
- return new Date(this.valueOf());
3751
- }, m2.toJSON = function() {
3752
- return this.isValid() ? this.toISOString() : null;
3753
- }, m2.toISOString = function() {
3754
- return this.$d.toISOString();
3755
- }, m2.toString = function() {
3756
- return this.$d.toUTCString();
3757
- }, M2;
3758
- }(), T = _.prototype;
3759
- return w.prototype = T, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u], ["$W", a], ["$M", f2], ["$y", c], ["$D", d2]].forEach(function(t3) {
3760
- T[t3[1]] = function(e3) {
3761
- return this.$g(e3, t3[0], t3[1]);
3762
- };
3763
- }), w.extend = function(t3, e3) {
3764
- return t3.$i || (t3(e3, _, w), t3.$i = true), w;
3765
- }, w.locale = S, w.isDayjs = p, w.unix = function(t3) {
3766
- return w(1e3 * t3);
3767
- }, w.en = D[g], w.Ls = D, w.p = {}, w;
3768
- });
3769
- })(dayjs_min);
3770
- const dayjs = dayjs_minExports;
3771
- var idExports = {};
3772
- var id = {
3773
- get exports() {
3774
- return idExports;
3775
- },
3776
- set exports(v2) {
3777
- idExports = v2;
3778
- }
3779
- };
3780
- (function(module2, exports2) {
3781
- !function(e2, a) {
3782
- module2.exports = a(dayjs_minExports);
3783
- }(commonjsGlobal, function(e2) {
3784
- function a(e3) {
3785
- return e3 && "object" == typeof e3 && "default" in e3 ? e3 : { default: e3 };
3786
- }
3787
- var t2 = a(e2), _ = { name: "id", weekdays: "Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"), months: "Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"), weekdaysShort: "Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"), monthsShort: "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"), weekdaysMin: "Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"), weekStart: 1, formats: { LT: "HH.mm", LTS: "HH.mm.ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY [pukul] HH.mm", LLLL: "dddd, D MMMM YYYY [pukul] HH.mm" }, relativeTime: { future: "dalam %s", past: "%s yang lalu", s: "beberapa detik", m: "semenit", mm: "%d menit", h: "sejam", hh: "%d jam", d: "sehari", dd: "%d hari", M: "sebulan", MM: "%d bulan", y: "setahun", yy: "%d tahun" }, ordinal: function(e3) {
3788
- return e3 + ".";
3789
- } };
3790
- return t2.default.locale(_, null, true), _;
3791
- });
3792
- })(id);
3793
- function toInteger$2(dirtyNumber) {
3549
+ function toInteger(dirtyNumber) {
3794
3550
  if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
3795
3551
  return NaN;
3796
3552
  }
@@ -3818,7 +3574,7 @@ function _typeof(obj) {
3818
3574
  }
3819
3575
  return _typeof(obj);
3820
3576
  }
3821
- function toDate$1(argument) {
3577
+ function toDate(argument) {
3822
3578
  requiredArgs(1, arguments);
3823
3579
  var argStr = Object.prototype.toString.call(argument);
3824
3580
  if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
@@ -3833,843 +3589,36 @@ function toDate$1(argument) {
3833
3589
  return new Date(NaN);
3834
3590
  }
3835
3591
  }
3592
+ function addDays(dirtyDate, dirtyAmount) {
3593
+ requiredArgs(2, arguments);
3594
+ var date = toDate(dirtyDate);
3595
+ var amount = toInteger(dirtyAmount);
3596
+ if (isNaN(amount)) {
3597
+ return new Date(NaN);
3598
+ }
3599
+ if (!amount) {
3600
+ return date;
3601
+ }
3602
+ date.setDate(date.getDate() + amount);
3603
+ return date;
3604
+ }
3836
3605
  function startOfDay(dirtyDate) {
3837
3606
  requiredArgs(1, arguments);
3838
- var date = toDate$1(dirtyDate);
3607
+ var date = toDate(dirtyDate);
3839
3608
  date.setHours(0, 0, 0, 0);
3840
3609
  return date;
3841
3610
  }
3842
- var millisecondsInMinute = 6e4;
3843
- var millisecondsInHour = 36e5;
3844
3611
  function endOfDay(dirtyDate) {
3845
3612
  requiredArgs(1, arguments);
3846
- var date = toDate$1(dirtyDate);
3613
+ var date = toDate(dirtyDate);
3847
3614
  date.setHours(23, 59, 59, 999);
3848
3615
  return date;
3849
3616
  }
3850
- function parseISO(argument, options) {
3851
- var _options$additionalDi;
3852
- requiredArgs(1, arguments);
3853
- var additionalDigits = toInteger$2((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);
3854
- if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
3855
- throw new RangeError("additionalDigits must be 0, 1 or 2");
3856
- }
3857
- if (!(typeof argument === "string" || Object.prototype.toString.call(argument) === "[object String]")) {
3858
- return new Date(NaN);
3859
- }
3860
- var dateStrings = splitDateString$1(argument);
3861
- var date;
3862
- if (dateStrings.date) {
3863
- var parseYearResult = parseYear$1(dateStrings.date, additionalDigits);
3864
- date = parseDate$1(parseYearResult.restDateString, parseYearResult.year);
3865
- }
3866
- if (!date || isNaN(date.getTime())) {
3867
- return new Date(NaN);
3868
- }
3869
- var timestamp = date.getTime();
3870
- var time = 0;
3871
- var offset;
3872
- if (dateStrings.time) {
3873
- time = parseTime$1(dateStrings.time);
3874
- if (isNaN(time)) {
3875
- return new Date(NaN);
3876
- }
3877
- }
3878
- if (dateStrings.timezone) {
3879
- offset = parseTimezone(dateStrings.timezone);
3880
- if (isNaN(offset)) {
3881
- return new Date(NaN);
3882
- }
3883
- } else {
3884
- var dirtyDate = new Date(timestamp + time);
3885
- var result = new Date(0);
3886
- result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
3887
- result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
3888
- return result;
3889
- }
3890
- return new Date(timestamp + time + offset);
3891
- }
3892
- var patterns$2 = {
3893
- dateTimeDelimiter: /[T ]/,
3894
- timeZoneDelimiter: /[Z ]/i,
3895
- timezone: /([Z+-].*)$/
3896
- };
3897
- var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
3898
- var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
3899
- var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
3900
- function splitDateString$1(dateString) {
3901
- var dateStrings = {};
3902
- var array = dateString.split(patterns$2.dateTimeDelimiter);
3903
- var timeString;
3904
- if (array.length > 2) {
3905
- return dateStrings;
3906
- }
3907
- if (/:/.test(array[0])) {
3908
- timeString = array[0];
3909
- } else {
3910
- dateStrings.date = array[0];
3911
- timeString = array[1];
3912
- if (patterns$2.timeZoneDelimiter.test(dateStrings.date)) {
3913
- dateStrings.date = dateString.split(patterns$2.timeZoneDelimiter)[0];
3914
- timeString = dateString.substr(dateStrings.date.length, dateString.length);
3915
- }
3916
- }
3917
- if (timeString) {
3918
- var token = patterns$2.timezone.exec(timeString);
3919
- if (token) {
3920
- dateStrings.time = timeString.replace(token[1], "");
3921
- dateStrings.timezone = token[1];
3922
- } else {
3923
- dateStrings.time = timeString;
3924
- }
3925
- }
3926
- return dateStrings;
3927
- }
3928
- function parseYear$1(dateString, additionalDigits) {
3929
- var regex = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)");
3930
- var captures = dateString.match(regex);
3931
- if (!captures)
3932
- return {
3933
- year: NaN,
3934
- restDateString: ""
3935
- };
3936
- var year = captures[1] ? parseInt(captures[1]) : null;
3937
- var century = captures[2] ? parseInt(captures[2]) : null;
3938
- return {
3939
- year: century === null ? year : century * 100,
3940
- restDateString: dateString.slice((captures[1] || captures[2]).length)
3941
- };
3942
- }
3943
- function parseDate$1(dateString, year) {
3944
- if (year === null)
3945
- return new Date(NaN);
3946
- var captures = dateString.match(dateRegex);
3947
- if (!captures)
3948
- return new Date(NaN);
3949
- var isWeekDate = !!captures[4];
3950
- var dayOfYear = parseDateUnit(captures[1]);
3951
- var month = parseDateUnit(captures[2]) - 1;
3952
- var day = parseDateUnit(captures[3]);
3953
- var week = parseDateUnit(captures[4]);
3954
- var dayOfWeek = parseDateUnit(captures[5]) - 1;
3955
- if (isWeekDate) {
3956
- if (!validateWeekDate$1(year, week, dayOfWeek)) {
3957
- return new Date(NaN);
3958
- }
3959
- return dayOfISOWeekYear$1(year, week, dayOfWeek);
3960
- } else {
3961
- var date = new Date(0);
3962
- if (!validateDate$1(year, month, day) || !validateDayOfYearDate$1(year, dayOfYear)) {
3963
- return new Date(NaN);
3964
- }
3965
- date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
3966
- return date;
3967
- }
3968
- }
3969
- function parseDateUnit(value) {
3970
- return value ? parseInt(value) : 1;
3971
- }
3972
- function parseTime$1(timeString) {
3973
- var captures = timeString.match(timeRegex);
3974
- if (!captures)
3975
- return NaN;
3976
- var hours = parseTimeUnit(captures[1]);
3977
- var minutes = parseTimeUnit(captures[2]);
3978
- var seconds = parseTimeUnit(captures[3]);
3979
- if (!validateTime$1(hours, minutes, seconds)) {
3980
- return NaN;
3981
- }
3982
- return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1e3;
3983
- }
3984
- function parseTimeUnit(value) {
3985
- return value && parseFloat(value.replace(",", ".")) || 0;
3986
- }
3987
- function parseTimezone(timezoneString) {
3988
- if (timezoneString === "Z")
3989
- return 0;
3990
- var captures = timezoneString.match(timezoneRegex);
3991
- if (!captures)
3992
- return 0;
3993
- var sign = captures[1] === "+" ? -1 : 1;
3994
- var hours = parseInt(captures[2]);
3995
- var minutes = captures[3] && parseInt(captures[3]) || 0;
3996
- if (!validateTimezone$1(hours, minutes)) {
3997
- return NaN;
3998
- }
3999
- return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
4000
- }
4001
- function dayOfISOWeekYear$1(isoWeekYear, week, day) {
4002
- var date = new Date(0);
4003
- date.setUTCFullYear(isoWeekYear, 0, 4);
4004
- var fourthOfJanuaryDay = date.getUTCDay() || 7;
4005
- var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
4006
- date.setUTCDate(date.getUTCDate() + diff);
4007
- return date;
4008
- }
4009
- var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
4010
- function isLeapYearIndex$1(year) {
4011
- return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
4012
- }
4013
- function validateDate$1(year, month, date) {
4014
- return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex$1(year) ? 29 : 28));
4015
- }
4016
- function validateDayOfYearDate$1(year, dayOfYear) {
4017
- return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex$1(year) ? 366 : 365);
4018
- }
4019
- function validateWeekDate$1(_year, week, day) {
4020
- return week >= 1 && week <= 53 && day >= 0 && day <= 6;
4021
- }
4022
- function validateTime$1(hours, minutes, seconds) {
4023
- if (hours === 24) {
4024
- return minutes === 0 && seconds === 0;
4025
- }
4026
- return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
4027
- }
4028
- function validateTimezone$1(_hours, minutes) {
4029
- return minutes >= 0 && minutes <= 59;
4030
- }
4031
- var toIntegerExports = {};
4032
- var toInteger$1 = {
4033
- get exports() {
4034
- return toIntegerExports;
4035
- },
4036
- set exports(v2) {
4037
- toIntegerExports = v2;
4038
- }
4039
- };
4040
- (function(module2, exports2) {
4041
- Object.defineProperty(exports2, "__esModule", {
4042
- value: true
4043
- });
4044
- exports2.default = toInteger2;
4045
- function toInteger2(dirtyNumber) {
4046
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
4047
- return NaN;
4048
- }
4049
- var number = Number(dirtyNumber);
4050
- if (isNaN(number)) {
4051
- return number;
4052
- }
4053
- return number < 0 ? Math.ceil(number) : Math.floor(number);
4054
- }
4055
- module2.exports = exports2.default;
4056
- })(toInteger$1, toIntegerExports);
4057
- const toInteger = /* @__PURE__ */ getDefaultExportFromCjs(toIntegerExports);
4058
- var getTimezoneOffsetInMillisecondsExports = {};
4059
- var getTimezoneOffsetInMilliseconds$1 = {
4060
- get exports() {
4061
- return getTimezoneOffsetInMillisecondsExports;
4062
- },
4063
- set exports(v2) {
4064
- getTimezoneOffsetInMillisecondsExports = v2;
4065
- }
4066
- };
4067
- (function(module2, exports2) {
4068
- Object.defineProperty(exports2, "__esModule", {
4069
- value: true
4070
- });
4071
- exports2.default = getTimezoneOffsetInMilliseconds2;
4072
- function getTimezoneOffsetInMilliseconds2(date) {
4073
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
4074
- utcDate.setUTCFullYear(date.getFullYear());
4075
- return date.getTime() - utcDate.getTime();
4076
- }
4077
- module2.exports = exports2.default;
4078
- })(getTimezoneOffsetInMilliseconds$1, getTimezoneOffsetInMillisecondsExports);
4079
- const getTimezoneOffsetInMilliseconds = /* @__PURE__ */ getDefaultExportFromCjs(getTimezoneOffsetInMillisecondsExports);
4080
- function tzTokenizeDate(date, timeZone) {
4081
- var dtf = getDateTimeFormat(timeZone);
4082
- return dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);
4083
- }
4084
- var typeToPos = {
4085
- year: 0,
4086
- month: 1,
4087
- day: 2,
4088
- hour: 3,
4089
- minute: 4,
4090
- second: 5
4091
- };
4092
- function partsOffset(dtf, date) {
4093
- try {
4094
- var formatted = dtf.formatToParts(date);
4095
- var filled = [];
4096
- for (var i2 = 0; i2 < formatted.length; i2++) {
4097
- var pos = typeToPos[formatted[i2].type];
4098
- if (pos >= 0) {
4099
- filled[pos] = parseInt(formatted[i2].value, 10);
4100
- }
4101
- }
4102
- return filled;
4103
- } catch (error) {
4104
- if (error instanceof RangeError) {
4105
- return [NaN];
4106
- }
4107
- throw error;
4108
- }
4109
- }
4110
- function hackyOffset(dtf, date) {
4111
- var formatted = dtf.format(date).replace(/\u200E/g, "");
4112
- var parsed = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(formatted);
4113
- return [parsed[3], parsed[1], parsed[2], parsed[4], parsed[5], parsed[6]];
4114
- }
4115
- var dtfCache = {};
4116
- function getDateTimeFormat(timeZone) {
4117
- if (!dtfCache[timeZone]) {
4118
- var testDateFormatted = new Intl.DateTimeFormat("en-US", {
4119
- hour12: false,
4120
- timeZone: "America/New_York",
4121
- year: "numeric",
4122
- month: "numeric",
4123
- day: "2-digit",
4124
- hour: "2-digit",
4125
- minute: "2-digit",
4126
- second: "2-digit"
4127
- }).format(new Date("2014-06-25T04:00:00.123Z"));
4128
- var hourCycleSupported = testDateFormatted === "06/25/2014, 00:00:00" || testDateFormatted === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
4129
- dtfCache[timeZone] = hourCycleSupported ? new Intl.DateTimeFormat("en-US", {
4130
- hour12: false,
4131
- timeZone,
4132
- year: "numeric",
4133
- month: "numeric",
4134
- day: "2-digit",
4135
- hour: "2-digit",
4136
- minute: "2-digit",
4137
- second: "2-digit"
4138
- }) : new Intl.DateTimeFormat("en-US", {
4139
- hourCycle: "h23",
4140
- timeZone,
4141
- year: "numeric",
4142
- month: "numeric",
4143
- day: "2-digit",
4144
- hour: "2-digit",
4145
- minute: "2-digit",
4146
- second: "2-digit"
4147
- });
4148
- }
4149
- return dtfCache[timeZone];
4150
- }
4151
- function newDateUTC(fullYear, month, day, hour, minute, second, millisecond) {
4152
- var utcDate = new Date(0);
4153
- utcDate.setUTCFullYear(fullYear, month, day);
4154
- utcDate.setUTCHours(hour, minute, second, millisecond);
4155
- return utcDate;
4156
- }
4157
- var MILLISECONDS_IN_HOUR$1 = 36e5;
4158
- var MILLISECONDS_IN_MINUTE$1 = 6e4;
4159
- var patterns$1 = {
4160
- timezone: /([Z+-].*)$/,
4161
- timezoneZ: /^(Z)$/,
4162
- timezoneHH: /^([+-]\d{2})$/,
4163
- timezoneHHMM: /^([+-]\d{2}):?(\d{2})$/
4164
- };
4165
- function tzParseTimezone(timezoneString, date, isUtcDate) {
4166
- var token;
4167
- var absoluteOffset;
4168
- if (!timezoneString) {
4169
- return 0;
4170
- }
4171
- token = patterns$1.timezoneZ.exec(timezoneString);
4172
- if (token) {
4173
- return 0;
4174
- }
4175
- var hours;
4176
- token = patterns$1.timezoneHH.exec(timezoneString);
4177
- if (token) {
4178
- hours = parseInt(token[1], 10);
4179
- if (!validateTimezone(hours)) {
4180
- return NaN;
4181
- }
4182
- return -(hours * MILLISECONDS_IN_HOUR$1);
4183
- }
4184
- token = patterns$1.timezoneHHMM.exec(timezoneString);
4185
- if (token) {
4186
- hours = parseInt(token[1], 10);
4187
- var minutes = parseInt(token[2], 10);
4188
- if (!validateTimezone(hours, minutes)) {
4189
- return NaN;
4190
- }
4191
- absoluteOffset = Math.abs(hours) * MILLISECONDS_IN_HOUR$1 + minutes * MILLISECONDS_IN_MINUTE$1;
4192
- return hours > 0 ? -absoluteOffset : absoluteOffset;
4193
- }
4194
- if (isValidTimezoneIANAString(timezoneString)) {
4195
- date = new Date(date || Date.now());
4196
- var utcDate = isUtcDate ? date : toUtcDate(date);
4197
- var offset = calcOffset(utcDate, timezoneString);
4198
- var fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString);
4199
- return -fixedOffset;
4200
- }
4201
- return NaN;
4202
- }
4203
- function toUtcDate(date) {
4204
- return newDateUTC(
4205
- date.getFullYear(),
4206
- date.getMonth(),
4207
- date.getDate(),
4208
- date.getHours(),
4209
- date.getMinutes(),
4210
- date.getSeconds(),
4211
- date.getMilliseconds()
4212
- );
4213
- }
4214
- function calcOffset(date, timezoneString) {
4215
- var tokens = tzTokenizeDate(date, timezoneString);
4216
- var asUTC = newDateUTC(
4217
- tokens[0],
4218
- tokens[1] - 1,
4219
- tokens[2],
4220
- tokens[3] % 24,
4221
- tokens[4],
4222
- tokens[5],
4223
- 0
4224
- ).getTime();
4225
- var asTS = date.getTime();
4226
- var over = asTS % 1e3;
4227
- asTS -= over >= 0 ? over : 1e3 + over;
4228
- return asUTC - asTS;
4229
- }
4230
- function fixOffset(date, offset, timezoneString) {
4231
- var localTS = date.getTime();
4232
- var utcGuess = localTS - offset;
4233
- var o2 = calcOffset(new Date(utcGuess), timezoneString);
4234
- if (offset === o2) {
4235
- return offset;
4236
- }
4237
- utcGuess -= o2 - offset;
4238
- var o3 = calcOffset(new Date(utcGuess), timezoneString);
4239
- if (o2 === o3) {
4240
- return o2;
4241
- }
4242
- return Math.max(o2, o3);
4243
- }
4244
- function validateTimezone(hours, minutes) {
4245
- return -23 <= hours && hours <= 23 && (minutes == null || 0 <= minutes && minutes <= 59);
4246
- }
4247
- var validIANATimezoneCache = {};
4248
- function isValidTimezoneIANAString(timeZoneString) {
4249
- if (validIANATimezoneCache[timeZoneString])
4250
- return true;
4251
- try {
4252
- new Intl.DateTimeFormat(void 0, { timeZone: timeZoneString });
4253
- validIANATimezoneCache[timeZoneString] = true;
4254
- return true;
4255
- } catch (error) {
4256
- return false;
4257
- }
4258
- }
4259
- var tzPattern = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;
4260
- const tzPattern$1 = tzPattern;
4261
- var MILLISECONDS_IN_HOUR = 36e5;
4262
- var MILLISECONDS_IN_MINUTE = 6e4;
4263
- var DEFAULT_ADDITIONAL_DIGITS = 2;
4264
- var patterns = {
4265
- dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
4266
- datePattern: /^([0-9W+-]+)(.*)/,
4267
- plainTime: /:/,
4268
- // year tokens
4269
- YY: /^(\d{2})$/,
4270
- YYY: [
4271
- /^([+-]\d{2})$/,
4272
- // 0 additional digits
4273
- /^([+-]\d{3})$/,
4274
- // 1 additional digit
4275
- /^([+-]\d{4})$/
4276
- // 2 additional digits
4277
- ],
4278
- YYYY: /^(\d{4})/,
4279
- YYYYY: [
4280
- /^([+-]\d{4})/,
4281
- // 0 additional digits
4282
- /^([+-]\d{5})/,
4283
- // 1 additional digit
4284
- /^([+-]\d{6})/
4285
- // 2 additional digits
4286
- ],
4287
- // date tokens
4288
- MM: /^-(\d{2})$/,
4289
- DDD: /^-?(\d{3})$/,
4290
- MMDD: /^-?(\d{2})-?(\d{2})$/,
4291
- Www: /^-?W(\d{2})$/,
4292
- WwwD: /^-?W(\d{2})-?(\d{1})$/,
4293
- HH: /^(\d{2}([.,]\d*)?)$/,
4294
- HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
4295
- HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
4296
- // time zone tokens (to identify the presence of a tz)
4297
- timeZone: tzPattern$1
4298
- };
4299
- function toDate(argument, dirtyOptions) {
4300
- if (arguments.length < 1) {
4301
- throw new TypeError("1 argument required, but only " + arguments.length + " present");
4302
- }
4303
- if (argument === null) {
4304
- return new Date(NaN);
4305
- }
4306
- var options = dirtyOptions || {};
4307
- var additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : toInteger(options.additionalDigits);
4308
- if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
4309
- throw new RangeError("additionalDigits must be 0, 1 or 2");
4310
- }
4311
- if (argument instanceof Date || typeof argument === "object" && Object.prototype.toString.call(argument) === "[object Date]") {
4312
- return new Date(argument.getTime());
4313
- } else if (typeof argument === "number" || Object.prototype.toString.call(argument) === "[object Number]") {
4314
- return new Date(argument);
4315
- } else if (!(typeof argument === "string" || Object.prototype.toString.call(argument) === "[object String]")) {
4316
- return new Date(NaN);
4317
- }
4318
- var dateStrings = splitDateString(argument);
4319
- var parseYearResult = parseYear(dateStrings.date, additionalDigits);
4320
- var year = parseYearResult.year;
4321
- var restDateString = parseYearResult.restDateString;
4322
- var date = parseDate(restDateString, year);
4323
- if (isNaN(date)) {
4324
- return new Date(NaN);
4325
- }
4326
- if (date) {
4327
- var timestamp = date.getTime();
4328
- var time = 0;
4329
- var offset;
4330
- if (dateStrings.time) {
4331
- time = parseTime(dateStrings.time);
4332
- if (isNaN(time)) {
4333
- return new Date(NaN);
4334
- }
4335
- }
4336
- if (dateStrings.timeZone || options.timeZone) {
4337
- offset = tzParseTimezone(dateStrings.timeZone || options.timeZone, new Date(timestamp + time));
4338
- if (isNaN(offset)) {
4339
- return new Date(NaN);
4340
- }
4341
- } else {
4342
- offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time));
4343
- offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time + offset));
4344
- }
4345
- return new Date(timestamp + time + offset);
4346
- } else {
4347
- return new Date(NaN);
4348
- }
4349
- }
4350
- function splitDateString(dateString) {
4351
- var dateStrings = {};
4352
- var parts = patterns.dateTimePattern.exec(dateString);
4353
- var timeString;
4354
- if (!parts) {
4355
- parts = patterns.datePattern.exec(dateString);
4356
- if (parts) {
4357
- dateStrings.date = parts[1];
4358
- timeString = parts[2];
4359
- } else {
4360
- dateStrings.date = null;
4361
- timeString = dateString;
4362
- }
4363
- } else {
4364
- dateStrings.date = parts[1];
4365
- timeString = parts[3];
4366
- }
4367
- if (timeString) {
4368
- var token = patterns.timeZone.exec(timeString);
4369
- if (token) {
4370
- dateStrings.time = timeString.replace(token[1], "");
4371
- dateStrings.timeZone = token[1].trim();
4372
- } else {
4373
- dateStrings.time = timeString;
4374
- }
4375
- }
4376
- return dateStrings;
4377
- }
4378
- function parseYear(dateString, additionalDigits) {
4379
- var patternYYY = patterns.YYY[additionalDigits];
4380
- var patternYYYYY = patterns.YYYYY[additionalDigits];
4381
- var token;
4382
- token = patterns.YYYY.exec(dateString) || patternYYYYY.exec(dateString);
4383
- if (token) {
4384
- var yearString = token[1];
4385
- return {
4386
- year: parseInt(yearString, 10),
4387
- restDateString: dateString.slice(yearString.length)
4388
- };
4389
- }
4390
- token = patterns.YY.exec(dateString) || patternYYY.exec(dateString);
4391
- if (token) {
4392
- var centuryString = token[1];
4393
- return {
4394
- year: parseInt(centuryString, 10) * 100,
4395
- restDateString: dateString.slice(centuryString.length)
4396
- };
4397
- }
4398
- return {
4399
- year: null
4400
- };
4401
- }
4402
- function parseDate(dateString, year) {
4403
- if (year === null) {
4404
- return null;
4405
- }
4406
- var token;
4407
- var date;
4408
- var month;
4409
- var week;
4410
- if (dateString.length === 0) {
4411
- date = new Date(0);
4412
- date.setUTCFullYear(year);
4413
- return date;
4414
- }
4415
- token = patterns.MM.exec(dateString);
4416
- if (token) {
4417
- date = new Date(0);
4418
- month = parseInt(token[1], 10) - 1;
4419
- if (!validateDate(year, month)) {
4420
- return new Date(NaN);
4421
- }
4422
- date.setUTCFullYear(year, month);
4423
- return date;
4424
- }
4425
- token = patterns.DDD.exec(dateString);
4426
- if (token) {
4427
- date = new Date(0);
4428
- var dayOfYear = parseInt(token[1], 10);
4429
- if (!validateDayOfYearDate(year, dayOfYear)) {
4430
- return new Date(NaN);
4431
- }
4432
- date.setUTCFullYear(year, 0, dayOfYear);
4433
- return date;
4434
- }
4435
- token = patterns.MMDD.exec(dateString);
4436
- if (token) {
4437
- date = new Date(0);
4438
- month = parseInt(token[1], 10) - 1;
4439
- var day = parseInt(token[2], 10);
4440
- if (!validateDate(year, month, day)) {
4441
- return new Date(NaN);
4442
- }
4443
- date.setUTCFullYear(year, month, day);
4444
- return date;
4445
- }
4446
- token = patterns.Www.exec(dateString);
4447
- if (token) {
4448
- week = parseInt(token[1], 10) - 1;
4449
- if (!validateWeekDate(year, week)) {
4450
- return new Date(NaN);
4451
- }
4452
- return dayOfISOWeekYear(year, week);
4453
- }
4454
- token = patterns.WwwD.exec(dateString);
4455
- if (token) {
4456
- week = parseInt(token[1], 10) - 1;
4457
- var dayOfWeek = parseInt(token[2], 10) - 1;
4458
- if (!validateWeekDate(year, week, dayOfWeek)) {
4459
- return new Date(NaN);
4460
- }
4461
- return dayOfISOWeekYear(year, week, dayOfWeek);
4462
- }
4463
- return null;
4464
- }
4465
- function parseTime(timeString) {
4466
- var token;
4467
- var hours;
4468
- var minutes;
4469
- token = patterns.HH.exec(timeString);
4470
- if (token) {
4471
- hours = parseFloat(token[1].replace(",", "."));
4472
- if (!validateTime(hours)) {
4473
- return NaN;
4474
- }
4475
- return hours % 24 * MILLISECONDS_IN_HOUR;
4476
- }
4477
- token = patterns.HHMM.exec(timeString);
4478
- if (token) {
4479
- hours = parseInt(token[1], 10);
4480
- minutes = parseFloat(token[2].replace(",", "."));
4481
- if (!validateTime(hours, minutes)) {
4482
- return NaN;
4483
- }
4484
- return hours % 24 * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;
4485
- }
4486
- token = patterns.HHMMSS.exec(timeString);
4487
- if (token) {
4488
- hours = parseInt(token[1], 10);
4489
- minutes = parseInt(token[2], 10);
4490
- var seconds = parseFloat(token[3].replace(",", "."));
4491
- if (!validateTime(hours, minutes, seconds)) {
4492
- return NaN;
4493
- }
4494
- return hours % 24 * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1e3;
4495
- }
4496
- return null;
4497
- }
4498
- function dayOfISOWeekYear(isoWeekYear, week, day) {
4499
- week = week || 0;
4500
- day = day || 0;
4501
- var date = new Date(0);
4502
- date.setUTCFullYear(isoWeekYear, 0, 4);
4503
- var fourthOfJanuaryDay = date.getUTCDay() || 7;
4504
- var diff = week * 7 + day + 1 - fourthOfJanuaryDay;
4505
- date.setUTCDate(date.getUTCDate() + diff);
4506
- return date;
4507
- }
4508
- var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
4509
- var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
4510
- function isLeapYearIndex(year) {
4511
- return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
3617
+ function endOfToday() {
3618
+ return endOfDay(Date.now());
4512
3619
  }
4513
- function validateDate(year, month, date) {
4514
- if (month < 0 || month > 11) {
4515
- return false;
4516
- }
4517
- if (date != null) {
4518
- if (date < 1) {
4519
- return false;
4520
- }
4521
- var isLeapYear = isLeapYearIndex(year);
4522
- if (isLeapYear && date > DAYS_IN_MONTH_LEAP_YEAR[month]) {
4523
- return false;
4524
- }
4525
- if (!isLeapYear && date > DAYS_IN_MONTH[month]) {
4526
- return false;
4527
- }
4528
- }
4529
- return true;
4530
- }
4531
- function validateDayOfYearDate(year, dayOfYear) {
4532
- if (dayOfYear < 1) {
4533
- return false;
4534
- }
4535
- var isLeapYear = isLeapYearIndex(year);
4536
- if (isLeapYear && dayOfYear > 366) {
4537
- return false;
4538
- }
4539
- if (!isLeapYear && dayOfYear > 365) {
4540
- return false;
4541
- }
4542
- return true;
4543
- }
4544
- function validateWeekDate(year, week, day) {
4545
- if (week < 0 || week > 52) {
4546
- return false;
4547
- }
4548
- if (day != null && (day < 0 || day > 6)) {
4549
- return false;
4550
- }
4551
- return true;
4552
- }
4553
- function validateTime(hours, minutes, seconds) {
4554
- if (hours != null && (hours < 0 || hours >= 25)) {
4555
- return false;
4556
- }
4557
- if (minutes != null && (minutes < 0 || minutes >= 60)) {
4558
- return false;
4559
- }
4560
- if (seconds != null && (seconds < 0 || seconds >= 60)) {
4561
- return false;
4562
- }
4563
- return true;
4564
- }
4565
- var cloneObjectExports = {};
4566
- var cloneObject$1 = {
4567
- get exports() {
4568
- return cloneObjectExports;
4569
- },
4570
- set exports(v2) {
4571
- cloneObjectExports = v2;
4572
- }
4573
- };
4574
- var assignExports = {};
4575
- var assign = {
4576
- get exports() {
4577
- return assignExports;
4578
- },
4579
- set exports(v2) {
4580
- assignExports = v2;
4581
- }
4582
- };
4583
- (function(module2, exports2) {
4584
- Object.defineProperty(exports2, "__esModule", {
4585
- value: true
4586
- });
4587
- exports2.default = assign2;
4588
- function assign2(target, object) {
4589
- if (target == null) {
4590
- throw new TypeError("assign requires that input parameter not be null or undefined");
4591
- }
4592
- for (var property in object) {
4593
- if (Object.prototype.hasOwnProperty.call(object, property)) {
4594
- target[property] = object[property];
4595
- }
4596
- }
4597
- return target;
4598
- }
4599
- module2.exports = exports2.default;
4600
- })(assign, assignExports);
4601
- (function(module2, exports2) {
4602
- Object.defineProperty(exports2, "__esModule", {
4603
- value: true
4604
- });
4605
- exports2.default = cloneObject2;
4606
- var _index = _interopRequireDefault(assignExports);
4607
- function _interopRequireDefault(obj) {
4608
- return obj && obj.__esModule ? obj : { default: obj };
4609
- }
4610
- function cloneObject2(object) {
4611
- return (0, _index.default)({}, object);
4612
- }
4613
- module2.exports = exports2.default;
4614
- })(cloneObject$1, cloneObjectExports);
4615
- const cloneObject = /* @__PURE__ */ getDefaultExportFromCjs(cloneObjectExports);
4616
- function utcToZonedTime(dirtyDate, timeZone, options) {
4617
- var date = toDate(dirtyDate, options);
4618
- var offsetMilliseconds = tzParseTimezone(timeZone, date, true);
4619
- var d2 = new Date(date.getTime() - offsetMilliseconds);
4620
- var resultDate = new Date(0);
4621
- resultDate.setFullYear(d2.getUTCFullYear(), d2.getUTCMonth(), d2.getUTCDate());
4622
- resultDate.setHours(d2.getUTCHours(), d2.getUTCMinutes(), d2.getUTCSeconds(), d2.getUTCMilliseconds());
4623
- return resultDate;
4624
- }
4625
- function zonedTimeToUtc(date, timeZone, options) {
4626
- if (typeof date === "string" && !date.match(tzPattern$1)) {
4627
- var extendedOptions = cloneObject(options);
4628
- extendedOptions.timeZone = timeZone;
4629
- return toDate(date, extendedOptions);
4630
- }
4631
- var d2 = toDate(date, options);
4632
- var utc = newDateUTC(
4633
- d2.getFullYear(),
4634
- d2.getMonth(),
4635
- d2.getDate(),
4636
- d2.getHours(),
4637
- d2.getMinutes(),
4638
- d2.getSeconds(),
4639
- d2.getMilliseconds()
4640
- ).getTime();
4641
- var offsetMilliseconds = tzParseTimezone(timeZone, new Date(utc));
4642
- return new Date(utc + offsetMilliseconds);
4643
- }
4644
- const zone = "Asia/Jakarta";
4645
- dayjs.locale("id");
4646
- class PeriodUtil {
4647
- static getStartOfDay(date) {
4648
- const _date = parseISO(date);
4649
- const _dateZoned = utcToZonedTime(_date, zone);
4650
- const _dateResult = startOfDay(_dateZoned);
4651
- return zonedTimeToUtc(_dateResult, zone);
4652
- }
4653
- static getEndOfDay(date) {
4654
- const _date = parseISO(date);
4655
- const _dateZoned = utcToZonedTime(_date, zone);
4656
- const _dateResult = endOfDay(_dateZoned);
4657
- return zonedTimeToUtc(_dateResult, zone);
4658
- }
4659
- static getPeriodFilter(keyStart, startedAt, keyEnd, endedAt) {
4660
- const start2 = this.getStartOfDay(startedAt);
4661
- const end = this.getEndOfDay(endedAt || startedAt);
4662
- const filter = [
4663
- { [keyStart]: { $gte: start2 } },
4664
- { [keyEnd || keyStart]: { $lte: end } }
4665
- ];
4666
- return filter;
4667
- }
4668
- static getPastPeriodFilter(key, startedAt) {
4669
- const start2 = this.getStartOfDay(startedAt);
4670
- const filter = [{ [key]: { $lt: start2 } }];
4671
- return filter;
4672
- }
3620
+ function startOfToday() {
3621
+ return startOfDay(Date.now());
4673
3622
  }
4674
3623
  const useOperasionalStore = pinia.defineStore("neu:operasional", () => {
4675
3624
  const isLoading = vue.ref(false);
@@ -4809,7 +3758,7 @@ function mitt(n) {
4809
3758
  } };
4810
3759
  }
4811
3760
  const bus = mitt();
4812
- const _withScopeId$2 = (n) => (vue.pushScopeId("data-v-e0b216d6"), n = n(), vue.popScopeId(), n);
3761
+ const _withScopeId$2 = (n) => (vue.pushScopeId("data-v-3ba48e60"), n = n(), vue.popScopeId(), n);
4813
3762
  const _hoisted_1$7 = { id: "view-checkIns" };
4814
3763
  const _hoisted_2$4 = { class: "summary" };
4815
3764
  const _hoisted_3$1 = { class: "wrapper" };
@@ -4826,18 +3775,32 @@ const _hoisted_5 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.crea
4826
3775
  ));
4827
3776
  const _hoisted_6 = { class: "end" };
4828
3777
  const __default__$7 = vue.defineComponent({
4829
- name: "CheckInCollection"
3778
+ name: "CheckInPresenceCollection"
4830
3779
  });
4831
3780
  const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
4832
3781
  ...__default__$7,
4833
3782
  setup(__props) {
3783
+ const collectionBus = core.useEventBus("neu:tempat:checkIn");
4834
3784
  const { client: client2 } = useClientHandle();
4835
- identitasInterfaces.useAuthStore();
4836
3785
  const { staff } = useOperasional();
4837
3786
  const attendanceStore = useAttendanceStore();
4838
3787
  const { isAsking, isScanning, isEntering, isScanError, isScanned, type } = pinia.storeToRefs(attendanceStore);
4839
3788
  const toast = interfaces.useToastStore();
4840
3789
  const isCheckpoint = vue.ref(false);
3790
+ collectionBus.on((event, payload) => {
3791
+ if (isCheckpoint.value === true) {
3792
+ if (event === "createOne:ok") {
3793
+ const toastId = "neu:personalia:staff:checkIn";
3794
+ toast.push({
3795
+ id: toastId,
3796
+ icon: "check",
3797
+ content: "Presensi berhasil.",
3798
+ color: "success"
3799
+ });
3800
+ isCheckpoint.value = false;
3801
+ }
3802
+ }
3803
+ });
4841
3804
  const query$1 = vue.computed(() => {
4842
3805
  var _a;
4843
3806
  return query.Query.define({
@@ -4845,8 +3808,13 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
4845
3808
  handle: "",
4846
3809
  operator: "mongo",
4847
3810
  value: {
4848
- staffId: (_a = staff.value) == null ? void 0 : _a.id,
4849
- $and: PeriodUtil.getPeriodFilter("checkInAt", new Date().toISOString())
3811
+ // staffId: staff.value?.id,
3812
+ // $and: PeriodUtil.getPeriodFilter('checkInAt', new Date().toISOString()),
3813
+ $and: [
3814
+ { staffId: (_a = staff.value) == null ? void 0 : _a.id },
3815
+ { checkInAt: { $gte: addDays(startOfToday(), 1) } },
3816
+ { checkInAt: { $lte: endOfToday() } }
3817
+ ]
4850
3818
  }
4851
3819
  }
4852
3820
  });
@@ -4904,6 +3872,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
4904
3872
  }
4905
3873
  return (_ctx, _cache) => {
4906
3874
  const _component_CheckInSingleView = vue.resolveComponent("CheckInSingleView");
3875
+ const _component_CheckInCollection = vue.resolveComponent("CheckInCollection");
4907
3876
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
4908
3877
  vue.createVNode(vue.unref(office.OfficeContent), {
4909
3878
  icon: "barcode-read",
@@ -5000,7 +3969,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
5000
3969
  isCheckpoint.value ? (vue.openBlock(), vue.createBlock(vue.unref(interfaces.NeonModal), {
5001
3970
  key: 0,
5002
3971
  "is-active": "",
5003
- size: "md",
3972
+ size: "lg",
5004
3973
  onClose: _cache[2] || (_cache[2] = ($event) => isCheckpoint.value = false)
5005
3974
  }, {
5006
3975
  default: vue.withCtx(() => [
@@ -5033,6 +4002,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
5033
4002
  query: vue.unref(query$1),
5034
4003
  peeks: ["modal"],
5035
4004
  excludes: ["create"],
4005
+ columns: ["type", "checkInAt", "staff", "building"],
5036
4006
  "is-ready": "",
5037
4007
  "is-main": ""
5038
4008
  }, {
@@ -5049,7 +4019,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
5049
4019
  })
5050
4020
  ])
5051
4021
  ]),
5052
- vue.createVNode(vue.unref(sentralInterfaces.CheckInCollection))
4022
+ vue.createVNode(_component_CheckInCollection)
5053
4023
  ]),
5054
4024
  _: 1
5055
4025
  /* STABLE */
@@ -5063,7 +4033,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
5063
4033
  };
5064
4034
  }
5065
4035
  });
5066
- const CheckInPresenceCollection_vue_vue_type_style_index_0_scoped_e0b216d6_lang = "";
4036
+ const CheckInPresenceCollection_vue_vue_type_style_index_0_scoped_3ba48e60_lang = "";
5067
4037
  const _export_sfc = (sfc, props) => {
5068
4038
  const target = sfc.__vccOpts || sfc;
5069
4039
  for (const [key, val] of props) {
@@ -5071,14 +4041,14 @@ const _export_sfc = (sfc, props) => {
5071
4041
  }
5072
4042
  return target;
5073
4043
  };
5074
- const CheckInPresenceCollection = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-e0b216d6"]]);
4044
+ const CheckInPresenceCollection = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-3ba48e60"]]);
5075
4045
  const _hoisted_1$6 = { class: "grid gap-4 sm:grid-cols-2" };
5076
4046
  const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
5077
4047
  __name: "CheckInSingle",
5078
4048
  setup(__props) {
5079
4049
  const {
5080
4050
  fields,
5081
- id: id2,
4051
+ id,
5082
4052
  initialValues,
5083
4053
  values,
5084
4054
  isLoading,
@@ -5087,9 +4057,23 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
5087
4057
  isMain,
5088
4058
  isNew,
5089
4059
  saveOne,
5090
- discardChanges
4060
+ discardChanges,
4061
+ getOne
5091
4062
  } = context.useSingle();
5092
- useOperasional();
4063
+ const { staff } = useOperasional();
4064
+ vue.onMounted(() => {
4065
+ var _a, _b, _c;
4066
+ console.log("idnya?", id.value);
4067
+ if (id.value === "new") {
4068
+ values.value.staffId = (_a = staff.value) == null ? void 0 : _a.id;
4069
+ values.value.staff = {
4070
+ id: (_b = staff.value) == null ? void 0 : _b.id,
4071
+ display: (_c = staff.value) == null ? void 0 : _c.display
4072
+ };
4073
+ values.value.checkInAt = new Date().toISOString();
4074
+ values.value.type = "checkpoint";
4075
+ }
4076
+ });
5093
4077
  return (_ctx, _cache) => {
5094
4078
  return vue.openBlock(), vue.createBlock(vue.unref(context.NeonSingle), { class: "neu-checkIn-single" }, {
5095
4079
  default: vue.withCtx(() => [
@@ -5121,7 +4105,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
5121
4105
  vue.createVNode(vue.unref(form.NeonField), vue.mergeProps({
5122
4106
  modelValue: vue.unref(values).type,
5123
4107
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.unref(values).type = $event)
5124
- }, vue.unref(fields).type, { "is-disabled": true }), null, 16, ["modelValue"]),
4108
+ }, vue.unref(fields).type, { "is-disabled": "" }), null, 16, ["modelValue"]),
5125
4109
  vue.createVNode(vue.unref(form.NeonField), vue.mergeProps({
5126
4110
  modelValue: vue.unref(values).checkInAt,
5127
4111
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.unref(values).checkInAt = $event)
@@ -5156,8 +4140,8 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
5156
4140
  };
5157
4141
  }
5158
4142
  });
5159
- const CheckInSingle_vue_vue_type_style_index_0_scoped_bc128a25_lang = "";
5160
- const CheckInSingle = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-bc128a25"]]);
4143
+ const CheckInSingle_vue_vue_type_style_index_0_scoped_2e2803fb_lang = "";
4144
+ const CheckInSingle = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-2e2803fb"]]);
5161
4145
  const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-d23b6de5"), n = n(), vue.popScopeId(), n);
5162
4146
  const _hoisted_1$5 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode(
5163
4147
  "h4",
@@ -5979,7 +4963,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
5979
4963
  setup(__props) {
5980
4964
  const {
5981
4965
  fields,
5982
- id: id2,
4966
+ id,
5983
4967
  initialValues,
5984
4968
  values,
5985
4969
  isLoading,
@@ -6143,7 +5127,7 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
6143
5127
  setup(__props) {
6144
5128
  const {
6145
5129
  fields,
6146
- id: id2,
5130
+ id,
6147
5131
  initialValues,
6148
5132
  values,
6149
5133
  isNew,
@@ -6280,7 +5264,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
6280
5264
  setup(__props) {
6281
5265
  const {
6282
5266
  fields,
6283
- id: id2,
5267
+ id,
6284
5268
  initialValues,
6285
5269
  values,
6286
5270
  isNew,
@@ -6419,7 +5403,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
6419
5403
  setup(__props) {
6420
5404
  const {
6421
5405
  fields,
6422
- id: id2,
5406
+ id,
6423
5407
  initialValues,
6424
5408
  values,
6425
5409
  isNew,
@@ -6567,7 +5551,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
6567
5551
  setup(__props) {
6568
5552
  const {
6569
5553
  fields,
6570
- id: id2,
5554
+ id,
6571
5555
  initialValues,
6572
5556
  values,
6573
5557
  isNew,
@@ -6643,7 +5627,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
6643
5627
  const { client: client2 } = useClientHandle();
6644
5628
  const {
6645
5629
  fields,
6646
- id: id2,
5630
+ id,
6647
5631
  initialValues,
6648
5632
  values,
6649
5633
  isNew,
@@ -6771,7 +5755,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
6771
5755
  setup(__props) {
6772
5756
  const {
6773
5757
  fields,
6774
- id: id2,
5758
+ id,
6775
5759
  initialValues,
6776
5760
  values,
6777
5761
  isNew,
@@ -6999,7 +5983,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
6999
5983
  setup(__props) {
7000
5984
  const {
7001
5985
  fields,
7002
- id: id2,
5986
+ id,
7003
5987
  initialValues,
7004
5988
  values,
7005
5989
  isNew,