@wix/form-public 0.580.0 → 0.581.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.
package/dist/index.cjs CHANGED
@@ -8437,8 +8437,8 @@ var init_metadata = __esm({
8437
8437
  // Deprecated.
8438
8438
  }, {
8439
8439
  key: "type",
8440
- value: function type(_type4) {
8441
- return this.numberingPlan.type(_type4);
8440
+ value: function type(_type5) {
8441
+ return this.numberingPlan.type(_type5);
8442
8442
  }
8443
8443
  // Deprecated.
8444
8444
  }, {
@@ -52453,2176 +52453,2174 @@ var SortOrder2;
52453
52453
  SortOrder3["DESC"] = "DESC";
52454
52454
  })(SortOrder2 || (SortOrder2 = {}));
52455
52455
 
52456
- // ../form-fields/dist/esm/date-localization/get-first-day-of-the-week.js
52457
- var DEFAULT_FIRST_DAY = 1;
52458
- function getFirstDayOfTheWeek(locale) {
52459
- try {
52460
- const intlLocale = new Intl.Locale(locale);
52461
- if (typeof intlLocale.getWeekInfo === "function") {
52462
- const firstDay = intlLocale.getWeekInfo().firstDay;
52463
- if (firstDay !== void 0) {
52464
- return firstDay === 7 ? 0 : firstDay;
52465
- }
52456
+ // ../../node_modules/@internationalized/date/dist/private/utils.mjs
52457
+ function $09ec6a572d60460f$export$842a2cf37af977e1(amount, numerator) {
52458
+ return amount - numerator * Math.floor(amount / numerator);
52459
+ }
52460
+
52461
+ // ../../node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.mjs
52462
+ var $93635573935797de$var$EPOCH = 1721426;
52463
+ function $93635573935797de$export$f297eb839006d339(era, year, month, day) {
52464
+ year = $93635573935797de$export$c36e0ecb2d4fa69d(era, year);
52465
+ let y1 = year - 1;
52466
+ let monthOffset = -2;
52467
+ if (month <= 2) monthOffset = 0;
52468
+ else if ($93635573935797de$export$553d7fa8e3805fc0(year)) monthOffset = -1;
52469
+ return $93635573935797de$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
52470
+ }
52471
+ function $93635573935797de$export$553d7fa8e3805fc0(year) {
52472
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
52473
+ }
52474
+ function $93635573935797de$export$c36e0ecb2d4fa69d(era, year) {
52475
+ return era === "BC" ? 1 - year : year;
52476
+ }
52477
+ function $93635573935797de$export$4475b7e617eb123c(year) {
52478
+ let era = "AD";
52479
+ if (year <= 0) {
52480
+ era = "BC";
52481
+ year = 1 - year;
52482
+ }
52483
+ return [
52484
+ era,
52485
+ year
52486
+ ];
52487
+ }
52488
+ var $93635573935797de$var$daysInMonth = {
52489
+ standard: [
52490
+ 31,
52491
+ 28,
52492
+ 31,
52493
+ 30,
52494
+ 31,
52495
+ 30,
52496
+ 31,
52497
+ 31,
52498
+ 30,
52499
+ 31,
52500
+ 30,
52501
+ 31
52502
+ ],
52503
+ leapyear: [
52504
+ 31,
52505
+ 29,
52506
+ 31,
52507
+ 30,
52508
+ 31,
52509
+ 30,
52510
+ 31,
52511
+ 31,
52512
+ 30,
52513
+ 31,
52514
+ 30,
52515
+ 31
52516
+ ]
52517
+ };
52518
+ var $93635573935797de$export$80ee6245ec4f29ec = class {
52519
+ fromJulianDay(jd) {
52520
+ let jd0 = jd;
52521
+ let depoch = jd0 - $93635573935797de$var$EPOCH;
52522
+ let quadricent = Math.floor(depoch / 146097);
52523
+ let dqc = ($09ec6a572d60460f$export$842a2cf37af977e1)(depoch, 146097);
52524
+ let cent = Math.floor(dqc / 36524);
52525
+ let dcent = ($09ec6a572d60460f$export$842a2cf37af977e1)(dqc, 36524);
52526
+ let quad = Math.floor(dcent / 1461);
52527
+ let dquad = ($09ec6a572d60460f$export$842a2cf37af977e1)(dcent, 1461);
52528
+ let yindex = Math.floor(dquad / 365);
52529
+ let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
52530
+ let [era, year] = $93635573935797de$export$4475b7e617eb123c(extendedYear);
52531
+ let yearDay = jd0 - $93635573935797de$export$f297eb839006d339(era, year, 1, 1);
52532
+ let leapAdj = 2;
52533
+ if (jd0 < $93635573935797de$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
52534
+ else if ($93635573935797de$export$553d7fa8e3805fc0(year)) leapAdj = 1;
52535
+ let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
52536
+ let day = jd0 - $93635573935797de$export$f297eb839006d339(era, year, month, 1) + 1;
52537
+ return new ($2aaf608024c21ca1$export$99faa760c7908e4f)(era, year, month, day);
52538
+ }
52539
+ toJulianDay(date) {
52540
+ return $93635573935797de$export$f297eb839006d339(date.era, date.year, date.month, date.day);
52541
+ }
52542
+ getDaysInMonth(date) {
52543
+ return $93635573935797de$var$daysInMonth[$93635573935797de$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
52544
+ }
52545
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
52546
+ getMonthsInYear(date) {
52547
+ return 12;
52548
+ }
52549
+ getDaysInYear(date) {
52550
+ return $93635573935797de$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
52551
+ }
52552
+ getMaximumMonthsInYear() {
52553
+ return 12;
52554
+ }
52555
+ getMaximumDaysInMonth() {
52556
+ return 31;
52557
+ }
52558
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
52559
+ getYearsInEra(date) {
52560
+ return 9999;
52561
+ }
52562
+ getEras() {
52563
+ return [
52564
+ "BC",
52565
+ "AD"
52566
+ ];
52567
+ }
52568
+ isInverseEra(date) {
52569
+ return date.era === "BC";
52570
+ }
52571
+ balanceDate(date) {
52572
+ if (date.year <= 0) {
52573
+ date.era = date.era === "BC" ? "AD" : "BC";
52574
+ date.year = 1 - date.year;
52466
52575
  }
52467
- return getFirstDayManual(locale);
52468
- } catch {
52469
- return getFirstDayManual(locale);
52470
52576
  }
52577
+ constructor() {
52578
+ this.identifier = "gregory";
52579
+ }
52580
+ };
52581
+
52582
+ // ../../node_modules/@internationalized/date/dist/private/queries.mjs
52583
+ function $ad063034c8620db8$export$dbc69fd56b53d5e(a2, b) {
52584
+ return a2.isEqual?.(b) ?? b.isEqual?.(a2) ?? a2.identifier === b.identifier;
52471
52585
  }
52472
- var REGIONS_STARTING_SATURDAY = [
52473
- "AF",
52474
- "BH",
52475
- "DJ",
52476
- "DZ",
52477
- "EG",
52478
- "IQ",
52479
- "IR",
52480
- "JO",
52481
- "KW",
52482
- "LY",
52483
- "OM",
52484
- "QA",
52485
- "SD",
52486
- "SY"
52487
- ];
52488
- var REGIONS_STARTING_SUNDAY = [
52489
- "AG",
52490
- "AS",
52491
- "BD",
52492
- "BR",
52493
- "BS",
52494
- "BT",
52495
- "BW",
52496
- "BZ",
52497
- "CA",
52498
- "CO",
52499
- "DM",
52500
- "DO",
52501
- "ET",
52502
- "GT",
52503
- "GU",
52504
- "HK",
52505
- "HN",
52506
- "ID",
52507
- "IL",
52508
- "IN",
52509
- "IS",
52510
- "JM",
52511
- "JP",
52512
- "KE",
52513
- "KH",
52514
- "KR",
52515
- "LA",
52516
- "MH",
52517
- "MM",
52518
- "MO",
52519
- "MT",
52520
- "MX",
52521
- "MZ",
52522
- "NI",
52523
- "NP",
52524
- "PA",
52525
- "PE",
52526
- "PH",
52527
- "PK",
52528
- "PR",
52529
- "PT",
52530
- "PY",
52531
- "SA",
52532
- "SG",
52533
- "SV",
52534
- "TH",
52535
- "TT",
52536
- "TW",
52537
- "UM",
52538
- "US",
52539
- "VE",
52540
- "VI",
52541
- "WS",
52542
- "YE",
52543
- "ZA",
52544
- "ZW"
52545
- ];
52546
- var LANGUAGES_STARTING_SATURDAY = [
52547
- "ar"
52548
- ];
52549
- var LANGUAGES_STARTING_SUNDAY = [
52550
- "en",
52551
- "he",
52552
- "hi",
52553
- "id",
52554
- "ja",
52555
- "ko",
52556
- "pt",
52557
- "tl",
52558
- "th"
52559
- ];
52560
- function getFirstDayManual(locale) {
52561
- try {
52562
- const intlLocale = new Intl.Locale(locale);
52563
- const language = intlLocale.language?.toLowerCase();
52564
- const region = intlLocale.region?.toUpperCase();
52565
- if (region) {
52566
- if (REGIONS_STARTING_SUNDAY.includes(region)) {
52567
- return 0;
52568
- }
52569
- if (REGIONS_STARTING_SATURDAY.includes(region)) {
52570
- return 6;
52571
- }
52572
- return DEFAULT_FIRST_DAY;
52586
+ function $ad063034c8620db8$export$68781ddf31c0090f(a2, b) {
52587
+ return a2.calendar.toJulianDay(a2) - b.calendar.toJulianDay(b);
52588
+ }
52589
+ function $ad063034c8620db8$export$c19a80a9721b80f6(a2, b) {
52590
+ return $ad063034c8620db8$var$timeToMs(a2) - $ad063034c8620db8$var$timeToMs(b);
52591
+ }
52592
+ function $ad063034c8620db8$var$timeToMs(a2) {
52593
+ return a2.hour * 36e5 + a2.minute * 6e4 + a2.second * 1e3 + a2.millisecond;
52594
+ }
52595
+ var $ad063034c8620db8$var$localTimeZone = null;
52596
+ var $ad063034c8620db8$var$localTimeZoneOverride = false;
52597
+ function $ad063034c8620db8$export$aa8b41735afcabd2() {
52598
+ if ($ad063034c8620db8$var$localTimeZone == null) $ad063034c8620db8$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
52599
+ return $ad063034c8620db8$var$localTimeZone;
52600
+ }
52601
+ function $ad063034c8620db8$export$6ab69b273755230b() {
52602
+ return $ad063034c8620db8$var$localTimeZoneOverride;
52603
+ }
52604
+
52605
+ // ../../node_modules/@internationalized/date/dist/private/conversion.mjs
52606
+ function $d07e34cce18680fd$export$bd4fb2bc8bb06fb(date) {
52607
+ date = $d07e34cce18680fd$export$b4a036af3fc0b032(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
52608
+ let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(date.era, date.year);
52609
+ return $d07e34cce18680fd$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
52610
+ }
52611
+ function $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
52612
+ let date = /* @__PURE__ */ new Date();
52613
+ date.setUTCHours(hour, minute, second, millisecond);
52614
+ date.setUTCFullYear(year, month - 1, day);
52615
+ return date.getTime();
52616
+ }
52617
+ function $d07e34cce18680fd$export$59c99f3515d3493f(ms, timeZone) {
52618
+ if (timeZone === "UTC") return 0;
52619
+ if (ms > 0 && timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && !($ad063034c8620db8$export$6ab69b273755230b)()) return new Date(ms).getTimezoneOffset() * -6e4;
52620
+ let { year, month, day, hour, minute, second } = $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone);
52621
+ let utc2 = $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, 0);
52622
+ return utc2 - Math.floor(ms / 1e3) * 1e3;
52623
+ }
52624
+ var $d07e34cce18680fd$var$formattersByTimeZone = /* @__PURE__ */ new Map();
52625
+ function $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone) {
52626
+ let formatter = $d07e34cce18680fd$var$formattersByTimeZone.get(timeZone);
52627
+ if (!formatter) {
52628
+ formatter = new Intl.DateTimeFormat("en-US", {
52629
+ timeZone,
52630
+ hour12: false,
52631
+ era: "short",
52632
+ year: "numeric",
52633
+ month: "numeric",
52634
+ day: "numeric",
52635
+ hour: "numeric",
52636
+ minute: "numeric",
52637
+ second: "numeric"
52638
+ });
52639
+ $d07e34cce18680fd$var$formattersByTimeZone.set(timeZone, formatter);
52640
+ }
52641
+ let parts = formatter.formatToParts(new Date(ms));
52642
+ let namedParts = {};
52643
+ for (let part of parts) if (part.type !== "literal") namedParts[part.type] = part.value;
52644
+ return {
52645
+ // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
52646
+ year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
52647
+ month: +namedParts.month,
52648
+ day: +namedParts.day,
52649
+ hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
52650
+ minute: +namedParts.minute,
52651
+ second: +namedParts.second
52652
+ };
52653
+ }
52654
+ var $d07e34cce18680fd$var$DAYMILLIS = 864e5;
52655
+ function $d07e34cce18680fd$var$getValidWallTimes(date, timeZone, earlier, later) {
52656
+ let found = earlier === later ? [
52657
+ earlier
52658
+ ] : [
52659
+ earlier,
52660
+ later
52661
+ ];
52662
+ return found.filter((absolute) => $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute));
52663
+ }
52664
+ function $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute) {
52665
+ let parts = $d07e34cce18680fd$var$getTimeZoneParts(absolute, timeZone);
52666
+ return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
52667
+ }
52668
+ function $d07e34cce18680fd$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
52669
+ let dateTime = $d07e34cce18680fd$export$b21e0b124e224484(date);
52670
+ if (timeZone === "UTC") return $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
52671
+ if (timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && disambiguation === "compatible" && !($ad063034c8620db8$export$6ab69b273755230b)()) {
52672
+ dateTime = $d07e34cce18680fd$export$b4a036af3fc0b032(dateTime, new ($93635573935797de$export$80ee6245ec4f29ec)());
52673
+ let date2 = /* @__PURE__ */ new Date();
52674
+ let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
52675
+ date2.setFullYear(year, dateTime.month - 1, dateTime.day);
52676
+ date2.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
52677
+ return date2.getTime();
52678
+ }
52679
+ let ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
52680
+ let offsetBefore = $d07e34cce18680fd$export$59c99f3515d3493f(ms - $d07e34cce18680fd$var$DAYMILLIS, timeZone);
52681
+ let offsetAfter = $d07e34cce18680fd$export$59c99f3515d3493f(ms + $d07e34cce18680fd$var$DAYMILLIS, timeZone);
52682
+ let valid = $d07e34cce18680fd$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
52683
+ if (valid.length === 1) return valid[0];
52684
+ if (valid.length > 1) switch (disambiguation) {
52685
+ // 'compatible' means 'earlier' for "fall back" transitions
52686
+ case "compatible":
52687
+ case "earlier":
52688
+ return valid[0];
52689
+ case "later":
52690
+ return valid[valid.length - 1];
52691
+ case "reject":
52692
+ throw new RangeError("Multiple possible absolute times found");
52693
+ }
52694
+ switch (disambiguation) {
52695
+ case "earlier":
52696
+ return Math.min(ms - offsetBefore, ms - offsetAfter);
52697
+ // 'compatible' means 'later' for "spring forward" transitions
52698
+ case "compatible":
52699
+ case "later":
52700
+ return Math.max(ms - offsetBefore, ms - offsetAfter);
52701
+ case "reject":
52702
+ throw new RangeError("No such absolute time found");
52703
+ }
52704
+ }
52705
+ function $d07e34cce18680fd$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
52706
+ return new Date($d07e34cce18680fd$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
52707
+ }
52708
+ function $d07e34cce18680fd$export$b21e0b124e224484(date, time) {
52709
+ let hour = 0, minute = 0, second = 0, millisecond = 0;
52710
+ if ("timeZone" in date) ({ hour, minute, second, millisecond } = date);
52711
+ else if ("hour" in date && !time) return date;
52712
+ if (time) ({ hour, minute, second, millisecond } = time);
52713
+ return new ($2aaf608024c21ca1$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
52714
+ }
52715
+ function $d07e34cce18680fd$export$b4a036af3fc0b032(date, calendar) {
52716
+ if (($ad063034c8620db8$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;
52717
+ let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
52718
+ let copy = date.copy();
52719
+ copy.calendar = calendar;
52720
+ copy.era = calendarDate.era;
52721
+ copy.year = calendarDate.year;
52722
+ copy.month = calendarDate.month;
52723
+ copy.day = calendarDate.day;
52724
+ ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(copy);
52725
+ return copy;
52726
+ }
52727
+ function $435a2ceaa8778ed8$export$e16d8520af44a096(date, duration) {
52728
+ let mutableDate = date.copy();
52729
+ let days = "hour" in mutableDate ? $435a2ceaa8778ed8$var$addTimeFields(mutableDate, duration) : 0;
52730
+ $435a2ceaa8778ed8$var$addYears(mutableDate, duration.years || 0);
52731
+ if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
52732
+ mutableDate.month += duration.months || 0;
52733
+ $435a2ceaa8778ed8$var$balanceYearMonth(mutableDate);
52734
+ $435a2ceaa8778ed8$var$constrainMonthDay(mutableDate);
52735
+ mutableDate.day += (duration.weeks || 0) * 7;
52736
+ mutableDate.day += duration.days || 0;
52737
+ mutableDate.day += days;
52738
+ $435a2ceaa8778ed8$var$balanceDay(mutableDate);
52739
+ if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
52740
+ if (mutableDate.year < 1) {
52741
+ mutableDate.year = 1;
52742
+ mutableDate.month = 1;
52743
+ mutableDate.day = 1;
52744
+ }
52745
+ let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
52746
+ if (mutableDate.year > maxYear) {
52747
+ let isInverseEra = mutableDate.calendar.isInverseEra?.(mutableDate);
52748
+ mutableDate.year = maxYear;
52749
+ mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
52750
+ mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
52751
+ }
52752
+ if (mutableDate.month < 1) {
52753
+ mutableDate.month = 1;
52754
+ mutableDate.day = 1;
52755
+ }
52756
+ let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
52757
+ if (mutableDate.month > maxMonth) {
52758
+ mutableDate.month = maxMonth;
52759
+ mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
52760
+ }
52761
+ mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
52762
+ return mutableDate;
52763
+ }
52764
+ function $435a2ceaa8778ed8$var$addYears(date, years) {
52765
+ if (date.calendar.isInverseEra?.(date)) years = -years;
52766
+ date.year += years;
52767
+ }
52768
+ function $435a2ceaa8778ed8$var$balanceYearMonth(date) {
52769
+ while (date.month < 1) {
52770
+ $435a2ceaa8778ed8$var$addYears(date, -1);
52771
+ date.month += date.calendar.getMonthsInYear(date);
52772
+ }
52773
+ let monthsInYear = 0;
52774
+ while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) {
52775
+ date.month -= monthsInYear;
52776
+ $435a2ceaa8778ed8$var$addYears(date, 1);
52777
+ }
52778
+ }
52779
+ function $435a2ceaa8778ed8$var$balanceDay(date) {
52780
+ while (date.day < 1) {
52781
+ date.month--;
52782
+ $435a2ceaa8778ed8$var$balanceYearMonth(date);
52783
+ date.day += date.calendar.getDaysInMonth(date);
52784
+ }
52785
+ while (date.day > date.calendar.getDaysInMonth(date)) {
52786
+ date.day -= date.calendar.getDaysInMonth(date);
52787
+ date.month++;
52788
+ $435a2ceaa8778ed8$var$balanceYearMonth(date);
52789
+ }
52790
+ }
52791
+ function $435a2ceaa8778ed8$var$constrainMonthDay(date) {
52792
+ date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
52793
+ date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
52794
+ }
52795
+ function $435a2ceaa8778ed8$export$c4e2ecac49351ef2(date) {
52796
+ if (date.calendar.constrainDate) date.calendar.constrainDate(date);
52797
+ date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
52798
+ $435a2ceaa8778ed8$var$constrainMonthDay(date);
52799
+ }
52800
+ function $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration) {
52801
+ let inverseDuration = {};
52802
+ for (let key in duration) if (typeof duration[key] === "number") inverseDuration[key] = -duration[key];
52803
+ return inverseDuration;
52804
+ }
52805
+ function $435a2ceaa8778ed8$export$4e2d2ead65e5f7e3(date, duration) {
52806
+ return $435a2ceaa8778ed8$export$e16d8520af44a096(date, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
52807
+ }
52808
+ function $435a2ceaa8778ed8$export$adaa4cf7ef1b65be(date, fields) {
52809
+ let mutableDate = date.copy();
52810
+ if (fields.era != null) mutableDate.era = fields.era;
52811
+ if (fields.year != null) mutableDate.year = fields.year;
52812
+ if (fields.month != null) mutableDate.month = fields.month;
52813
+ if (fields.day != null) mutableDate.day = fields.day;
52814
+ $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutableDate);
52815
+ return mutableDate;
52816
+ }
52817
+ function $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(value, fields) {
52818
+ let mutableValue = value.copy();
52819
+ if (fields.hour != null) mutableValue.hour = fields.hour;
52820
+ if (fields.minute != null) mutableValue.minute = fields.minute;
52821
+ if (fields.second != null) mutableValue.second = fields.second;
52822
+ if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
52823
+ $435a2ceaa8778ed8$export$7555de1e070510cb(mutableValue);
52824
+ return mutableValue;
52825
+ }
52826
+ function $435a2ceaa8778ed8$var$balanceTime(time) {
52827
+ time.second += Math.floor(time.millisecond / 1e3);
52828
+ time.millisecond = $435a2ceaa8778ed8$var$nonNegativeMod(time.millisecond, 1e3);
52829
+ time.minute += Math.floor(time.second / 60);
52830
+ time.second = $435a2ceaa8778ed8$var$nonNegativeMod(time.second, 60);
52831
+ time.hour += Math.floor(time.minute / 60);
52832
+ time.minute = $435a2ceaa8778ed8$var$nonNegativeMod(time.minute, 60);
52833
+ let days = Math.floor(time.hour / 24);
52834
+ time.hour = $435a2ceaa8778ed8$var$nonNegativeMod(time.hour, 24);
52835
+ return days;
52836
+ }
52837
+ function $435a2ceaa8778ed8$export$7555de1e070510cb(time) {
52838
+ time.millisecond = Math.max(0, Math.min(time.millisecond, 999));
52839
+ time.second = Math.max(0, Math.min(time.second, 59));
52840
+ time.minute = Math.max(0, Math.min(time.minute, 59));
52841
+ time.hour = Math.max(0, Math.min(time.hour, 23));
52842
+ }
52843
+ function $435a2ceaa8778ed8$var$nonNegativeMod(a2, b) {
52844
+ let result2 = a2 % b;
52845
+ if (result2 < 0) result2 += b;
52846
+ return result2;
52847
+ }
52848
+ function $435a2ceaa8778ed8$var$addTimeFields(time, duration) {
52849
+ time.hour += duration.hours || 0;
52850
+ time.minute += duration.minutes || 0;
52851
+ time.second += duration.seconds || 0;
52852
+ time.millisecond += duration.milliseconds || 0;
52853
+ return $435a2ceaa8778ed8$var$balanceTime(time);
52854
+ }
52855
+ function $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, duration) {
52856
+ let res = time.copy();
52857
+ $435a2ceaa8778ed8$var$addTimeFields(res, duration);
52858
+ return res;
52859
+ }
52860
+ function $435a2ceaa8778ed8$export$fe34d3a381cd7501(time, duration) {
52861
+ return $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
52862
+ }
52863
+ function $435a2ceaa8778ed8$export$d52ced6badfb9a4c(value, field, amount, options) {
52864
+ let mutable = value.copy();
52865
+ switch (field) {
52866
+ case "era": {
52867
+ let eras = value.calendar.getEras();
52868
+ let eraIndex = eras.indexOf(value.era);
52869
+ if (eraIndex < 0) throw new Error("Invalid era: " + value.era);
52870
+ eraIndex = $435a2ceaa8778ed8$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options?.round);
52871
+ mutable.era = eras[eraIndex];
52872
+ $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
52873
+ break;
52573
52874
  }
52574
- if (language) {
52575
- if (LANGUAGES_STARTING_SUNDAY.includes(language)) {
52576
- return 0;
52577
- }
52578
- if (LANGUAGES_STARTING_SATURDAY.includes(language)) {
52579
- return 6;
52875
+ case "year":
52876
+ if (mutable.calendar.isInverseEra?.(mutable)) amount = -amount;
52877
+ mutable.year = $435a2ceaa8778ed8$var$cycleValue(value.year, amount, -Infinity, 9999, options?.round);
52878
+ if (mutable.year === -Infinity) mutable.year = 1;
52879
+ if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
52880
+ break;
52881
+ case "month":
52882
+ mutable.month = $435a2ceaa8778ed8$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options?.round);
52883
+ break;
52884
+ case "day":
52885
+ mutable.day = $435a2ceaa8778ed8$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options?.round);
52886
+ break;
52887
+ default:
52888
+ throw new Error("Unsupported field " + field);
52889
+ }
52890
+ if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
52891
+ $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
52892
+ return mutable;
52893
+ }
52894
+ function $435a2ceaa8778ed8$export$dd02b3e0007dfe28(value, field, amount, options) {
52895
+ let mutable = value.copy();
52896
+ switch (field) {
52897
+ case "hour": {
52898
+ let hours = value.hour;
52899
+ let min4 = 0;
52900
+ let max4 = 23;
52901
+ if (options?.hourCycle === 12) {
52902
+ let isPM = hours >= 12;
52903
+ min4 = isPM ? 12 : 0;
52904
+ max4 = isPM ? 23 : 11;
52580
52905
  }
52906
+ mutable.hour = $435a2ceaa8778ed8$var$cycleValue(hours, amount, min4, max4, options?.round);
52907
+ break;
52581
52908
  }
52582
- return DEFAULT_FIRST_DAY;
52583
- } catch {
52584
- return DEFAULT_FIRST_DAY;
52909
+ case "minute":
52910
+ mutable.minute = $435a2ceaa8778ed8$var$cycleValue(value.minute, amount, 0, 59, options?.round);
52911
+ break;
52912
+ case "second":
52913
+ mutable.second = $435a2ceaa8778ed8$var$cycleValue(value.second, amount, 0, 59, options?.round);
52914
+ break;
52915
+ case "millisecond":
52916
+ mutable.millisecond = $435a2ceaa8778ed8$var$cycleValue(value.millisecond, amount, 0, 999, options?.round);
52917
+ break;
52918
+ default:
52919
+ throw new Error("Unsupported field " + field);
52920
+ }
52921
+ return mutable;
52922
+ }
52923
+ function $435a2ceaa8778ed8$var$cycleValue(value, amount, min4, max4, round = false) {
52924
+ if (round) {
52925
+ value += Math.sign(amount);
52926
+ if (value < min4) value = max4;
52927
+ let div = Math.abs(amount);
52928
+ if (amount > 0) value = Math.ceil(value / div) * div;
52929
+ else value = Math.floor(value / div) * div;
52930
+ if (value > max4) value = min4;
52931
+ } else {
52932
+ value += amount;
52933
+ if (value < min4) value = max4 - (min4 - value - 1);
52934
+ else if (value > max4) value = min4 + (value - max4 - 1);
52585
52935
  }
52936
+ return value;
52586
52937
  }
52587
52938
 
52588
- // ../form-fields/dist/esm/ui/shared/headless-styles.js
52589
- var VISUALLY_HIDDEN_STYLE = {
52590
- position: "absolute",
52591
- width: 1,
52592
- height: 1,
52593
- margin: -1,
52594
- padding: 0,
52595
- border: 0,
52596
- clipPath: "inset(50%)",
52597
- overflow: "hidden",
52598
- whiteSpace: "nowrap"
52599
- };
52600
- var FIELDSET_RESET_STYLE = {
52601
- border: "none",
52602
- padding: 0,
52603
- margin: 0,
52604
- minWidth: 0
52605
- };
52606
- var AppointmentSlotPickerContext = React178.createContext(void 0);
52607
- var getTimezoneNoteId = (inputId) => `${inputId}-timezone-note`;
52608
- var getDateTitleId = (inputId) => `${inputId}-date-title`;
52609
- var useAppointmentSlotPickerContext = () => {
52610
- const context = React178.useContext(AppointmentSlotPickerContext);
52611
- if (typeof context === "undefined") {
52612
- throw new Error("Appointment parts must be used inside an <Appointment> component");
52939
+ // ../../node_modules/@internationalized/date/dist/private/string.mjs
52940
+ var $58246871e4652552$var$TIME_RE = /^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
52941
+ var $58246871e4652552$var$DATE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
52942
+ var $58246871e4652552$var$ABSOLUTE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
52943
+ function $58246871e4652552$export$c9698ec7f05a07e1(value) {
52944
+ let m = value.match($58246871e4652552$var$TIME_RE);
52945
+ if (!m) throw new Error("Invalid ISO 8601 time string: " + value);
52946
+ return new ($2aaf608024c21ca1$export$680ea196effce5f)($58246871e4652552$var$parseNumber(m[1], 0, 23), m[2] ? $58246871e4652552$var$parseNumber(m[2], 0, 59) : 0, m[3] ? $58246871e4652552$var$parseNumber(m[3], 0, 59) : 0, m[4] ? $58246871e4652552$var$parseNumber(m[4], 0, Infinity) * 1e3 : 0);
52947
+ }
52948
+ function $58246871e4652552$export$6b862160d295c8e(value) {
52949
+ let m = value.match($58246871e4652552$var$DATE_RE);
52950
+ if (!m) {
52951
+ if ($58246871e4652552$var$ABSOLUTE_RE.test(value)) throw new Error(`Invalid ISO 8601 date string: ${value}. Use parseAbsolute() instead.`);
52952
+ throw new Error("Invalid ISO 8601 date string: " + value);
52613
52953
  }
52614
- return context;
52615
- };
52954
+ let date = new ($2aaf608024c21ca1$export$99faa760c7908e4f)($58246871e4652552$var$parseNumber(m[1], 0, 9999), $58246871e4652552$var$parseNumber(m[2], 1, 12), 1);
52955
+ date.day = $58246871e4652552$var$parseNumber(m[3], 1, date.calendar.getDaysInMonth(date));
52956
+ return date;
52957
+ }
52958
+ function $58246871e4652552$var$parseNumber(value, min4, max4) {
52959
+ let val = Number(value);
52960
+ if (val < min4 || val > max4) throw new RangeError(`Value out of range: ${min4} <= ${val} <= ${max4}`);
52961
+ return val;
52962
+ }
52963
+ function $58246871e4652552$export$f59dee82248f5ad4(time) {
52964
+ return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`;
52965
+ }
52966
+ function $58246871e4652552$export$60dfd74aa96791bd(date) {
52967
+ let gregorianDate = ($d07e34cce18680fd$export$b4a036af3fc0b032)(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
52968
+ let year;
52969
+ if (gregorianDate.era === "BC") year = gregorianDate.year === 1 ? "0000" : "-" + String(Math.abs(1 - gregorianDate.year)).padStart(6, "00");
52970
+ else year = String(gregorianDate.year).padStart(4, "0");
52971
+ return `${year}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
52972
+ }
52973
+ function $58246871e4652552$export$4223de14708adc63(date) {
52974
+ return `${$58246871e4652552$export$60dfd74aa96791bd(date)}T${$58246871e4652552$export$f59dee82248f5ad4(date)}`;
52975
+ }
52616
52976
 
52617
- // ../form-fields/dist/esm/ui/appointment-field/appointment-headless/appointment-dates-headless.js
52618
- var useIsLocked = () => {
52619
- const { disabled, readOnly } = useFieldPropsV2();
52620
- return !!disabled || !!readOnly;
52621
- };
52622
- var Dates = ({ children, className }) => {
52623
- const { days, selectDate, weekRangeLabel } = useAppointmentSlotPickerContext();
52624
- const previousWeekElement = findChildOfType(children, Dates.PreviousWeek);
52625
- const headingElement = findChildOfType(children, Dates.Heading);
52626
- const nextWeekElement = findChildOfType(children, Dates.NextWeek);
52627
- const dayElement = findChildOfType(children, Dates.Day) ?? /* @__PURE__ */ React178__default.default.createElement(Dates.Day, null);
52628
- const selectedKeys = React178.useMemo(() => days.filter((day) => day.isSelected).map((day) => day.key), [
52629
- days
52630
- ]);
52631
- const isLocked = useIsLocked();
52632
- const disabledKeys = React178.useMemo(() => days.filter((day) => isLocked || day.isDisabled).map((day) => day.key), [
52633
- days,
52634
- isLocked
52635
- ]);
52636
- const handleSelectionChange = (keys3) => {
52637
- if (keys3 === "all") {
52638
- return;
52639
- }
52640
- const [selectedKey] = [
52641
- ...keys3
52642
- ];
52643
- const day = days.find(({ key }) => key === selectedKey);
52644
- if (day) {
52645
- selectDate(day.date);
52646
- }
52647
- };
52648
- return /* @__PURE__ */ React178__default.default.createElement("div", {
52649
- className
52650
- }, previousWeekElement, headingElement, nextWeekElement, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.ListBox, {
52651
- "aria-label": weekRangeLabel,
52652
- orientation: "horizontal",
52653
- selectionMode: "single",
52654
- selectedKeys,
52655
- disabledKeys,
52656
- onSelectionChange: handleSelectionChange
52657
- }, days.map((day) => applyInternalProps(dayElement, {
52658
- key: day.key,
52977
+ // ../../node_modules/@internationalized/date/dist/private/CalendarDate.mjs
52978
+ function $2aaf608024c21ca1$var$shiftArgs(args) {
52979
+ let calendar = typeof args[0] === "object" ? args.shift() : new ($93635573935797de$export$80ee6245ec4f29ec)();
52980
+ let era;
52981
+ if (typeof args[0] === "string") era = args.shift();
52982
+ else {
52983
+ let eras = calendar.getEras();
52984
+ era = eras[eras.length - 1];
52985
+ }
52986
+ let year = args.shift();
52987
+ let month = args.shift();
52988
+ let day = args.shift();
52989
+ return [
52990
+ calendar,
52991
+ era,
52992
+ year,
52993
+ month,
52659
52994
  day
52660
- }))));
52661
- };
52662
- var PreviousWeek = ({ children, className }) => {
52663
- const { changeWeek, canGoToPreviousWeek, previousWeekLabel, nextWeekLabel } = useAppointmentSlotPickerContext();
52664
- const isLocked = useIsLocked();
52665
- const buttonRef = React178.useRef(null);
52666
- const wasPressedRef = React178.useRef(false);
52667
- React178.useEffect(() => {
52668
- if (canGoToPreviousWeek || !wasPressedRef.current) {
52669
- return;
52670
- }
52671
- wasPressedRef.current = false;
52672
- const activeElement = document.activeElement;
52673
- if (activeElement !== document.body && activeElement !== buttonRef.current) {
52674
- return;
52675
- }
52676
- const buttons = buttonRef.current?.closest("fieldset")?.querySelectorAll("button") ?? [];
52677
- Array.from(buttons).find((button) => button.getAttribute("aria-label") === nextWeekLabel)?.focus();
52678
- }, [
52679
- canGoToPreviousWeek,
52680
- nextWeekLabel
52681
- ]);
52682
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Button, {
52683
- ref: buttonRef,
52684
- className,
52685
- "aria-label": previousWeekLabel,
52686
- isDisabled: !canGoToPreviousWeek || isLocked,
52687
- onPress: () => {
52688
- wasPressedRef.current = true;
52689
- changeWeek(-1);
52690
- }
52691
- }, children ?? "\u2039");
52692
- };
52693
- var NextWeek = ({ children, className }) => {
52694
- const { changeWeek, nextWeekLabel } = useAppointmentSlotPickerContext();
52695
- const isLocked = useIsLocked();
52696
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Button, {
52697
- className,
52698
- "aria-label": nextWeekLabel,
52699
- isDisabled: isLocked,
52700
- onPress: () => changeWeek(1)
52701
- }, children ?? "\u203A");
52702
- };
52703
- var Heading2 = ({ children, className }) => {
52704
- const { weekCaptionLabel, weekRangeLabel } = useAppointmentSlotPickerContext();
52705
- return /* @__PURE__ */ React178__default.default.createElement("span", {
52706
- className,
52707
- "aria-live": "polite"
52708
- }, children ? children({
52709
- label: weekCaptionLabel,
52710
- weekRange: weekRangeLabel
52711
- }) : /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("span", {
52712
- "aria-hidden": "true"
52713
- }, weekCaptionLabel), /* @__PURE__ */ React178__default.default.createElement("span", {
52714
- style: VISUALLY_HIDDEN_STYLE
52715
- }, weekRangeLabel)));
52716
- };
52717
- var Day = ({ children, className, ...internal }) => {
52718
- const { day } = internal;
52719
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.ListBoxItem, {
52720
- id: day.key,
52721
- className,
52722
- textValue: day.label,
52723
- "aria-label": day.isAvailable ? `${day.label}, ${day.availabilityLabel}` : day.label,
52724
- "data-available": day.isAvailable || void 0,
52725
- "data-today": day.isToday || void 0
52726
- }, children ? children({
52727
- ...day,
52728
- date: new Date(day.date)
52729
- }) : /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("span", null, day.weekdayLabel), /* @__PURE__ */ React178__default.default.createElement("span", null, day.dayOfMonthLabel)));
52730
- };
52731
- Dates.PreviousWeek = PreviousWeek;
52732
- Dates.Heading = Heading2;
52733
- Dates.NextWeek = NextWeek;
52734
- Dates.Day = Day;
52735
- var RADIO_INPUT_SELECTOR = 'input[type="radio"]';
52736
- var Slots = ({ children, className, ...internal }) => {
52737
- const { hasTimezoneNote, hasDateTitle } = internal;
52738
- const { slots, selectedSlotKey, selectSlot, selectedDateLabel, isReloadingSlots, timezoneLabel, pendingFocusIndex, consumePendingFocusIndex } = useAppointmentSlotPickerContext();
52739
- const { id: fieldId, disabled, readOnly, required, hasError } = useFieldPropsV2();
52740
- const { inputId, labelId: fieldLabelId, ariaDescribedBy } = useFieldAttributes();
52741
- const groupRef = React178.useRef(null);
52742
- const slotElement = findChildOfType(children, Slots.Slot) ?? /* @__PURE__ */ React178__default.default.createElement(Slots.Slot, null);
52743
- const isLabelledByDateTitle = !!hasDateTitle && !!selectedDateLabel;
52744
- const describedBy = [
52745
- ariaDescribedBy,
52746
- hasTimezoneNote && timezoneLabel ? getTimezoneNoteId(inputId) : void 0
52747
- ].filter(Boolean).join(" ") || void 0;
52748
- const focusSlotAt = (index2, options) => {
52749
- groupRef.current?.querySelectorAll(RADIO_INPUT_SELECTOR)?.[index2]?.focus(options);
52750
- };
52751
- useFocusFieldEvent(() => {
52752
- const hasSlots = !!groupRef.current?.querySelector(RADIO_INPUT_SELECTOR);
52753
- if (hasSlots) {
52754
- focusSlotAt(0, {
52755
- preventScroll: true
52756
- });
52757
- return;
52758
- }
52759
- const options = Array.from(document.getElementById(inputId)?.querySelectorAll('[role="option"]') ?? []);
52760
- const fallback = options.find((option2) => option2.getAttribute("aria-selected") === "true") ?? options.find((option2) => option2.getAttribute("aria-disabled") !== "true");
52761
- fallback?.focus({
52762
- preventScroll: true
52763
- });
52764
- }, fieldId);
52765
- React178.useEffect(() => {
52766
- if (pendingFocusIndex === void 0) {
52767
- return;
52768
- }
52769
- focusSlotAt(pendingFocusIndex);
52770
- consumePendingFocusIndex();
52771
- }, [
52772
- pendingFocusIndex,
52773
- slots.length
52774
- ]);
52775
- return /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("div", {
52776
- role: "status",
52777
- style: VISUALLY_HIDDEN_STYLE
52778
- }, slots.length > 0 ? selectedDateLabel : void 0), /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioGroup, {
52779
- ref: groupRef,
52780
- className,
52781
- value: selectedSlotKey ?? null,
52782
- onChange: selectSlot,
52783
- isDisabled: disabled,
52784
- isReadOnly: readOnly,
52785
- isRequired: required,
52786
- isInvalid: hasError,
52787
- "aria-labelledby": isLabelledByDateTitle ? getDateTitleId(inputId) : fieldLabelId,
52788
- "aria-describedby": describedBy,
52789
- "data-refetch": isReloadingSlots || void 0
52790
- }, slots.map((slot) => applyInternalProps(slotElement, {
52791
- key: slot.key,
52792
- slot
52793
- }))));
52794
- };
52795
- var Slot = ({ children, className, ...internal }) => {
52796
- const { slot } = internal;
52797
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioField, {
52798
- value: slot.key,
52799
- "aria-label": slot.timeRange
52800
- }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioButton, {
52801
- className
52802
- }, children ? children(slot) : slot.timeRange));
52995
+ ];
52996
+ }
52997
+ var _type;
52998
+ var _$2aaf608024c21ca1$export$99faa760c7908e4f = class _$2aaf608024c21ca1$export$99faa760c7908e4f {
52999
+ constructor(...args) {
53000
+ // This prevents TypeScript from allowing other types with the same fields to match.
53001
+ // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
53002
+ // If that behavior is desired, use the AnyCalendarDate interface instead.
53003
+ // @ts-ignore
53004
+ __privateAdd(this, _type);
53005
+ let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
53006
+ this.calendar = calendar;
53007
+ this.era = era;
53008
+ this.year = year;
53009
+ this.month = month;
53010
+ this.day = day;
53011
+ ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
53012
+ }
53013
+ /** Returns a copy of this date. */
53014
+ copy() {
53015
+ if (this.era) return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
53016
+ else return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
53017
+ }
53018
+ /** Returns a new `CalendarDate` with the given duration added to it. */
53019
+ add(duration) {
53020
+ return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
53021
+ }
53022
+ /** Returns a new `CalendarDate` with the given duration subtracted from it. */
53023
+ subtract(duration) {
53024
+ return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
53025
+ }
53026
+ /**
53027
+ * Returns a new `CalendarDate` with the given fields set to the provided values. Other fields
53028
+ * will be constrained accordingly.
53029
+ */
53030
+ set(fields) {
53031
+ return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(this, fields);
53032
+ }
53033
+ /**
53034
+ * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
53035
+ * When the resulting value reaches the limits of the field, it wraps around.
53036
+ */
53037
+ cycle(field, amount, options) {
53038
+ return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
53039
+ }
53040
+ /**
53041
+ * Converts the date to a native JavaScript Date object, with the time set to midnight in the
53042
+ * given time zone.
53043
+ */
53044
+ toDate(timeZone) {
53045
+ return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone);
53046
+ }
53047
+ /** Converts the date to an ISO 8601 formatted string. */
53048
+ toString() {
53049
+ return ($58246871e4652552$export$60dfd74aa96791bd)(this);
53050
+ }
53051
+ /**
53052
+ * Compares this date with another. A negative result indicates that this date is before the given
53053
+ * one, and a positive date indicates that it is after.
53054
+ */
53055
+ compare(b) {
53056
+ return ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
53057
+ }
52803
53058
  };
52804
- Slots.Slot = Slot;
52805
- var import_cloneDeep = __toESM(require_cloneDeep());
52806
- var createIndicatorNode = (requiredIndicatorType, t, className) => {
52807
- const indicator = requiredIndicatorType === types$1.RequiredIndicator.TEXT ? t("settings.required-indicator-text") : "*";
52808
- const str = (v) => ({
52809
- stringValue: v
52810
- });
52811
- const fields = {
52812
- "aria-hidden": str("true")
52813
- };
52814
- if (className) {
52815
- fields.className = str(className);
53059
+ _type = new WeakMap();
53060
+ var $2aaf608024c21ca1$export$99faa760c7908e4f = _$2aaf608024c21ca1$export$99faa760c7908e4f;
53061
+ var _type2;
53062
+ var _$2aaf608024c21ca1$export$680ea196effce5f = class _$2aaf608024c21ca1$export$680ea196effce5f {
53063
+ constructor(hour = 0, minute = 0, second = 0, millisecond = 0) {
53064
+ // This prevents TypeScript from allowing other types with the same fields to match.
53065
+ // @ts-ignore
53066
+ __privateAdd(this, _type2);
53067
+ this.hour = hour;
53068
+ this.minute = minute;
53069
+ this.second = second;
53070
+ this.millisecond = millisecond;
53071
+ ($435a2ceaa8778ed8$export$7555de1e070510cb)(this);
53072
+ }
53073
+ /** Returns a copy of this time. */
53074
+ copy() {
53075
+ return new _$2aaf608024c21ca1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
53076
+ }
53077
+ /** Returns a new `Time` with the given duration added to it. */
53078
+ add(duration) {
53079
+ return ($435a2ceaa8778ed8$export$7ed87b6bc2506470)(this, duration);
53080
+ }
53081
+ /** Returns a new `Time` with the given duration subtracted from it. */
53082
+ subtract(duration) {
53083
+ return ($435a2ceaa8778ed8$export$fe34d3a381cd7501)(this, duration);
53084
+ }
53085
+ /**
53086
+ * Returns a new `Time` with the given fields set to the provided values. Other fields will be
53087
+ * constrained accordingly.
53088
+ */
53089
+ set(fields) {
53090
+ return ($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields);
53091
+ }
53092
+ /**
53093
+ * Returns a new `Time` with the given field adjusted by a specified amount.
53094
+ * When the resulting value reaches the limits of the field, it wraps around.
53095
+ */
53096
+ cycle(field, amount, options) {
53097
+ return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
53098
+ }
53099
+ /** Converts the time to an ISO 8601 formatted string. */
53100
+ toString() {
53101
+ return ($58246871e4652552$export$f59dee82248f5ad4)(this);
53102
+ }
53103
+ /**
53104
+ * Compares this time with another. A negative result indicates that this time is before the given
53105
+ * one, and a positive time indicates that it is after.
53106
+ */
53107
+ compare(b) {
53108
+ return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, b);
52816
53109
  }
52817
- return {
52818
- type: Node_Type.EXTERNAL,
52819
- id: "",
52820
- nodes: [],
52821
- externalData: {
52822
- fields
52823
- },
52824
- textData: {
52825
- text: indicator,
52826
- decorations: []
52827
- }
52828
- };
52829
53110
  };
52830
- var injectRequiredIndicator = (label, placement, indicatorNode) => {
52831
- const result2 = (0, import_cloneDeep.default)(label);
52832
- switch (placement) {
52833
- case types$1.RequiredIndicatorPlacement.BEFORE_FIELD_TITLE:
52834
- const firstNode = result2?.nodes.find(Boolean);
52835
- if (firstNode) {
52836
- firstNode.nodes ?? (firstNode.nodes = []);
52837
- firstNode.nodes.unshift(indicatorNode);
52838
- }
52839
- break;
52840
- case types$1.RequiredIndicatorPlacement.AFTER_FIELD_TITLE:
52841
- const lastNode = result2?.nodes?.findLast(Boolean);
52842
- if (lastNode) {
52843
- lastNode.nodes ?? (lastNode.nodes = []);
52844
- lastNode.nodes.push(indicatorNode);
52845
- }
52846
- break;
53111
+ _type2 = new WeakMap();
53112
+ var $2aaf608024c21ca1$export$680ea196effce5f = _$2aaf608024c21ca1$export$680ea196effce5f;
53113
+ var _type3;
53114
+ var _$2aaf608024c21ca1$export$ca871e8dbb80966f = class _$2aaf608024c21ca1$export$ca871e8dbb80966f {
53115
+ constructor(...args) {
53116
+ // This prevents TypeScript from allowing other types with the same fields to match.
53117
+ // @ts-ignore
53118
+ __privateAdd(this, _type3);
53119
+ let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
53120
+ this.calendar = calendar;
53121
+ this.era = era;
53122
+ this.year = year;
53123
+ this.month = month;
53124
+ this.day = day;
53125
+ this.hour = args.shift() || 0;
53126
+ this.minute = args.shift() || 0;
53127
+ this.second = args.shift() || 0;
53128
+ this.millisecond = args.shift() || 0;
53129
+ ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
52847
53130
  }
52848
- return result2;
52849
- };
52850
- var stopLinkEventPropagation = (event) => {
52851
- if (event.target instanceof Element && event.target.closest("a")) {
52852
- event.stopPropagation();
53131
+ /** Returns a copy of this date. */
53132
+ copy() {
53133
+ if (this.era) return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
53134
+ else return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
52853
53135
  }
52854
- };
52855
- var LINK_EVENT_HANDLERS = {
52856
- onPointerDown: stopLinkEventPropagation,
52857
- onMouseDown: stopLinkEventPropagation,
52858
- onClick: stopLinkEventPropagation
52859
- };
52860
- var RichTextLabel = ({ className, requiredClassName, theme, children, ...internal }) => {
52861
- const { requiredIndicatorHidden = false, leadingElement } = internal;
52862
- const fieldProps = useFieldPropsV2();
52863
- const { label, required = false, disabled = false, requiredIndicatorType = types$1.RequiredIndicator.ASTERISK, requiredIndicatorPlacement = types$1.RequiredIndicatorPlacement.AFTER_FIELD_TITLE } = fieldProps;
52864
- const { t } = useTranslation2();
52865
- const { language } = useConfig();
52866
- const labelWithIndicator = React178.useMemo(() => {
52867
- if (!required || requiredIndicatorHidden || !label) {
52868
- return label;
53136
+ /** Returns a new `CalendarDateTime` with the given duration added to it. */
53137
+ add(duration) {
53138
+ return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
53139
+ }
53140
+ /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
53141
+ subtract(duration) {
53142
+ return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
53143
+ }
53144
+ /**
53145
+ * Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields
53146
+ * will be constrained accordingly.
53147
+ */
53148
+ set(fields) {
53149
+ return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields), fields);
53150
+ }
53151
+ /**
53152
+ * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
53153
+ * When the resulting value reaches the limits of the field, it wraps around.
53154
+ */
53155
+ cycle(field, amount, options) {
53156
+ switch (field) {
53157
+ case "era":
53158
+ case "year":
53159
+ case "month":
53160
+ case "day":
53161
+ return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
53162
+ default:
53163
+ return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
52869
53164
  }
52870
- const indicatorNode = createIndicatorNode(requiredIndicatorType, t, requiredClassName);
52871
- return injectRequiredIndicator(label, requiredIndicatorPlacement, indicatorNode);
52872
- }, [
52873
- required,
52874
- requiredIndicatorHidden,
52875
- label,
52876
- requiredIndicatorType,
52877
- requiredIndicatorPlacement,
52878
- t,
52879
- requiredClassName
52880
- ]);
52881
- return /* @__PURE__ */ React178__default.default.createElement("div", {
52882
- className,
52883
- ...disabled ? {} : LINK_EVENT_HANDLERS
52884
- }, leadingElement, children({
52885
- content: labelWithIndicator,
52886
- locale: language,
52887
- htmlAttributesPlugin
52888
- }));
52889
- };
52890
- var SelectionIndicator = ({ className, ...internal }) => {
52891
- const state = internal;
52892
- return /* @__PURE__ */ React178__default.default.createElement("div", {
52893
- "aria-hidden": "true",
52894
- className: typeof className === "function" ? className(state) : className
52895
- });
52896
- };
52897
-
52898
- // ../form-fields/dist/esm/ui/checkbox-field/checkbox-field-headless.js
52899
- var Checkbox = ({ children }) => {
52900
- const { id: id6, FieldLayout } = useFieldPropsV2();
52901
- const checkboxElement = findChildOfType(children, Checkbox.Checkbox);
52902
- const descriptionElement = findChildOfType(children, Checkbox.Description);
52903
- const errorElement = findChildOfType(children, Checkbox.Error);
52904
- return /* @__PURE__ */ React178__default.default.createElement(FieldLayout, {
52905
- fieldId: id6,
52906
- renderLabel: () => null,
52907
- renderInput: () => checkboxElement,
52908
- renderDescription: () => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, errorElement, descriptionElement)
52909
- });
52910
- };
52911
- var CheckboxContainer = ({ children, className }) => {
52912
- const { id: id6, value, onChange, disabled, required, readOnly, onBlur, onFocus, hasError } = useFieldPropsV2();
52913
- const { inputId, ariaDescribedBy } = useFieldAttributes();
52914
- const ref = React178.useRef(null);
52915
- useFocusFieldEvent(() => {
52916
- ref.current?.focus({
52917
- preventScroll: true
52918
- });
52919
- }, id6);
52920
- useKeepPrehydrationValue(ref);
52921
- const labelElement = findChildOfType(children, CheckboxContainer.RichTextLabel);
52922
- const inputElement = findChildOfType(children, CheckboxContainer.Input);
52923
- const handleChange = React178.useCallback((isSelected) => {
52924
- onChange(isSelected);
52925
- }, [
52926
- onChange
52927
- ]);
52928
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxField, {
52929
- id: inputId,
52930
- "aria-describedby": ariaDescribedBy,
52931
- isSelected: Boolean(value),
52932
- onChange: handleChange,
52933
- isDisabled: disabled,
52934
- isReadOnly: readOnly,
52935
- isRequired: required,
52936
- isInvalid: hasError,
52937
- onBlur,
52938
- onFocus
52939
- }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxButton, {
52940
- ref,
52941
- className
52942
- }, ({ isSelected, isHovered, isFocused }) => {
52943
- const input = applyInternalProps(inputElement, {
52944
- isSelected,
52945
- isHovered,
52946
- isFocused
52947
- });
52948
- return labelElement ? applyInternalProps(labelElement, {
52949
- leadingElement: input
52950
- }) : input;
52951
- }));
53165
+ }
53166
+ /** Converts the date to a native JavaScript Date object in the given time zone. */
53167
+ toDate(timeZone, disambiguation) {
53168
+ return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone, disambiguation);
53169
+ }
53170
+ /** Converts the date to an ISO 8601 formatted string. */
53171
+ toString() {
53172
+ return ($58246871e4652552$export$4223de14708adc63)(this);
53173
+ }
53174
+ /**
53175
+ * Compares this date with another. A negative result indicates that this date is before the given
53176
+ * one, and a positive date indicates that it is after.
53177
+ */
53178
+ compare(b) {
53179
+ let res = ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
53180
+ if (res === 0) return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, ($d07e34cce18680fd$export$b21e0b124e224484)(b));
53181
+ return res;
53182
+ }
52952
53183
  };
52953
- CheckboxContainer.RichTextLabel = RichTextLabel;
52954
- CheckboxContainer.Input = SelectionIndicator;
52955
- Checkbox.Checkbox = CheckboxContainer;
52956
- Checkbox.Description = Description;
52957
- Checkbox.Error = Error2;
53184
+ _type3 = new WeakMap();
53185
+ var $2aaf608024c21ca1$export$ca871e8dbb80966f = _$2aaf608024c21ca1$export$ca871e8dbb80966f;
52958
53186
 
52959
- // ../../node_modules/ts-debounce/dist/src/index.esm.js
52960
- function r(r3, e, n) {
52961
- var i, t, o;
52962
- void 0 === n && (n = {});
52963
- var a2 = null != (i = n.isImmediate) && i, u = null != (t = n.callback) && t, c = n.maxWait, v = Date.now(), l = [];
52964
- function f() {
52965
- if (void 0 !== c) {
52966
- var r4 = Date.now() - v;
52967
- if (r4 + e >= c) return c - r4;
53187
+ // ../form-fields/dist/esm/date-localization/get-first-day-of-the-week.js
53188
+ var DEFAULT_FIRST_DAY = 1;
53189
+ function getFirstDayOfTheWeek(locale) {
53190
+ try {
53191
+ const intlLocale = new Intl.Locale(locale);
53192
+ if (typeof intlLocale.getWeekInfo === "function") {
53193
+ const firstDay = intlLocale.getWeekInfo().firstDay;
53194
+ if (firstDay !== void 0) {
53195
+ return firstDay === 7 ? 0 : firstDay;
53196
+ }
52968
53197
  }
52969
- return e;
53198
+ return getFirstDayManual(locale);
53199
+ } catch {
53200
+ return getFirstDayManual(locale);
52970
53201
  }
52971
- var d = function() {
52972
- var e2 = [].slice.call(arguments), n2 = this;
52973
- return new Promise(function(i2, t2) {
52974
- var c2 = a2 && void 0 === o;
52975
- if (void 0 !== o && clearTimeout(o), o = setTimeout(function() {
52976
- if (o = void 0, v = Date.now(), !a2) {
52977
- var i3 = r3.apply(n2, e2);
52978
- u && u(i3), l.forEach(function(r4) {
52979
- return (0, r4.resolve)(i3);
52980
- }), l = [];
52981
- }
52982
- }, f()), c2) {
52983
- var d2 = r3.apply(n2, e2);
52984
- return u && u(d2), i2(d2);
53202
+ }
53203
+ var REGIONS_STARTING_SATURDAY = [
53204
+ "AF",
53205
+ "BH",
53206
+ "DJ",
53207
+ "DZ",
53208
+ "EG",
53209
+ "IQ",
53210
+ "IR",
53211
+ "JO",
53212
+ "KW",
53213
+ "LY",
53214
+ "OM",
53215
+ "QA",
53216
+ "SD",
53217
+ "SY"
53218
+ ];
53219
+ var REGIONS_STARTING_SUNDAY = [
53220
+ "AG",
53221
+ "AS",
53222
+ "BD",
53223
+ "BR",
53224
+ "BS",
53225
+ "BT",
53226
+ "BW",
53227
+ "BZ",
53228
+ "CA",
53229
+ "CO",
53230
+ "DM",
53231
+ "DO",
53232
+ "ET",
53233
+ "GT",
53234
+ "GU",
53235
+ "HK",
53236
+ "HN",
53237
+ "ID",
53238
+ "IL",
53239
+ "IN",
53240
+ "IS",
53241
+ "JM",
53242
+ "JP",
53243
+ "KE",
53244
+ "KH",
53245
+ "KR",
53246
+ "LA",
53247
+ "MH",
53248
+ "MM",
53249
+ "MO",
53250
+ "MT",
53251
+ "MX",
53252
+ "MZ",
53253
+ "NI",
53254
+ "NP",
53255
+ "PA",
53256
+ "PE",
53257
+ "PH",
53258
+ "PK",
53259
+ "PR",
53260
+ "PT",
53261
+ "PY",
53262
+ "SA",
53263
+ "SG",
53264
+ "SV",
53265
+ "TH",
53266
+ "TT",
53267
+ "TW",
53268
+ "UM",
53269
+ "US",
53270
+ "VE",
53271
+ "VI",
53272
+ "WS",
53273
+ "YE",
53274
+ "ZA",
53275
+ "ZW"
53276
+ ];
53277
+ var LANGUAGES_STARTING_SATURDAY = [
53278
+ "ar"
53279
+ ];
53280
+ var LANGUAGES_STARTING_SUNDAY = [
53281
+ "en",
53282
+ "he",
53283
+ "hi",
53284
+ "id",
53285
+ "ja",
53286
+ "ko",
53287
+ "pt",
53288
+ "tl",
53289
+ "th"
53290
+ ];
53291
+ function getFirstDayManual(locale) {
53292
+ try {
53293
+ const intlLocale = new Intl.Locale(locale);
53294
+ const language = intlLocale.language?.toLowerCase();
53295
+ const region = intlLocale.region?.toUpperCase();
53296
+ if (region) {
53297
+ if (REGIONS_STARTING_SUNDAY.includes(region)) {
53298
+ return 0;
52985
53299
  }
52986
- l.push({ resolve: i2, reject: t2 });
52987
- });
52988
- };
52989
- return d.cancel = function(r4) {
52990
- void 0 !== o && clearTimeout(o), l.forEach(function(e2) {
52991
- return (0, e2.reject)(r4);
52992
- }), l = [];
52993
- }, d;
53300
+ if (REGIONS_STARTING_SATURDAY.includes(region)) {
53301
+ return 6;
53302
+ }
53303
+ return DEFAULT_FIRST_DAY;
53304
+ }
53305
+ if (language) {
53306
+ if (LANGUAGES_STARTING_SUNDAY.includes(language)) {
53307
+ return 0;
53308
+ }
53309
+ if (LANGUAGES_STARTING_SATURDAY.includes(language)) {
53310
+ return 6;
53311
+ }
53312
+ }
53313
+ return DEFAULT_FIRST_DAY;
53314
+ } catch {
53315
+ return DEFAULT_FIRST_DAY;
53316
+ }
52994
53317
  }
52995
53318
 
52996
- // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-utils.js
52997
- var OTHER_ID = "Other";
52998
- var getValueIncludesOther = (value, optionsNames) => value.some((_value) => !optionsNames.includes(_value));
52999
- var getIsOtherOptionSelected = (value, optionsNames) => value.length > 0 && getValueIncludesOther(value, optionsNames);
53000
- var getOtherLabel = (addOtherLabel, t) => {
53001
- const otherLabelDefault = t?.("add-other.default-other-option-label");
53002
- return addOtherLabel || otherLabelDefault || OTHER_ID;
53003
- };
53004
- var getOtherValue = (value, addOtherLabel) => {
53005
- const addedSymbolsLength = 2;
53006
- const otherLabelLength = addOtherLabel ? addOtherLabel.length + addedSymbolsLength : 0;
53007
- const otherItem = value.find((item) => item.startsWith(`${addOtherLabel}: `)) || "";
53008
- return otherItem.slice(otherLabelLength);
53009
- };
53010
- var getOptionsValues = (options) => options.map((option2) => option2.value ?? option2.label);
53011
-
53012
- // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-headless.js
53013
- var CheckboxGroup = ({ children, className }) => {
53014
- const props2 = useFieldPropsV2();
53015
- const { id: id6, value, onChange, disabled, required, onBlur, onFocus, hasError, FieldLayout } = props2;
53016
- const { inputId, labelId, ariaDescribedBy } = useFieldAttributes();
53017
- const groupRef = React178.useRef(null);
53018
- useKeepPrehydrationValue(groupRef);
53019
- const labelElement = findChildOfType(children, CheckboxGroup.Label);
53020
- const optionsElement = findChildOfType(children, CheckboxGroup.Options);
53021
- const descriptionElement = findChildOfType(children, CheckboxGroup.Description);
53022
- const errorElement = findChildOfType(children, CheckboxGroup.Error);
53023
- const _value = React178.useMemo(() => value || [], [
53024
- value
53025
- ]);
53026
- const handleChange = React178.useCallback((newValue) => {
53027
- onChange?.(newValue);
53028
- }, [
53029
- onChange
53030
- ]);
53031
- return /* @__PURE__ */ React178__default.default.createElement(FieldLayout, {
53032
- fieldId: id6,
53033
- renderLabel: () => labelElement,
53034
- renderInput: () => /* @__PURE__ */ React178__default.default.createElement(FieldsetHeadless, {
53035
- id: inputId,
53036
- ariaLabelledBy: labelId,
53037
- ariaDescribedBy,
53038
- required,
53039
- onBlur,
53040
- onFocus
53041
- }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxGroup, {
53042
- ref: groupRef,
53043
- className,
53044
- "aria-labelledby": labelId,
53045
- value: _value,
53046
- onChange: handleChange,
53047
- isDisabled: disabled,
53048
- isRequired: required,
53049
- isInvalid: hasError
53050
- }, optionsElement)),
53051
- renderDescription: () => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, errorElement, descriptionElement)
53052
- });
53319
+ // ../form-fields/dist/esm/ui/shared/headless-styles.js
53320
+ var VISUALLY_HIDDEN_STYLE = {
53321
+ position: "absolute",
53322
+ width: 1,
53323
+ height: 1,
53324
+ margin: -1,
53325
+ padding: 0,
53326
+ border: 0,
53327
+ clipPath: "inset(50%)",
53328
+ overflow: "hidden",
53329
+ whiteSpace: "nowrap"
53053
53330
  };
53054
- var Options = ({ children, className }) => {
53055
- const props2 = useFieldPropsV2();
53056
- const { id: id6, options, addOther, addOtherLabel, numberOfColumns } = props2;
53057
- const { t } = useTranslation2();
53058
- const optionElement = findChildOfType(children, Options.Option);
53059
- const otherLabel = getOtherLabel(addOtherLabel, t);
53060
- return /* @__PURE__ */ React178__default.default.createElement("div", {
53061
- className,
53062
- "data-columns": numberOfColumns
53063
- }, options?.map((option2, index2) => {
53064
- const checkboxValue = option2.value ?? option2.label;
53065
- return applyInternalProps(optionElement, {
53066
- key: option2.id || option2.label,
53067
- value: checkboxValue,
53068
- label: option2.label,
53069
- isFirst: index2 === 0,
53070
- fieldId: id6
53071
- });
53072
- }), addOther && applyInternalProps(optionElement, {
53073
- key: OTHER_ID,
53074
- value: OTHER_ID,
53075
- label: otherLabel,
53076
- isOther: true
53077
- }));
53331
+ var FIELDSET_RESET_STYLE = {
53332
+ border: "none",
53333
+ padding: 0,
53334
+ margin: 0,
53335
+ minWidth: 0
53078
53336
  };
53079
- var OptionLabel = ({ className, ...internal }) => {
53080
- const { label } = internal;
53081
- return /* @__PURE__ */ React178__default.default.createElement("span", {
53082
- className
53083
- }, label);
53337
+ var AppointmentSlotPickerContext = React178.createContext(void 0);
53338
+ var getTimezoneNoteId = (inputId) => `${inputId}-timezone-note`;
53339
+ var getDateTitleId = (inputId) => `${inputId}-date-title`;
53340
+ var useAppointmentSlotPickerContext = () => {
53341
+ const context = React178.useContext(AppointmentSlotPickerContext);
53342
+ if (typeof context === "undefined") {
53343
+ throw new Error("Appointment parts must be used inside an <Appointment> component");
53344
+ }
53345
+ return context;
53084
53346
  };
53085
- var Checkbox2 = ({ children, className, ...internal }) => {
53086
- const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53087
- const props2 = useFieldPropsV2();
53088
- const { value: fieldValue, onChange, disabled, readOnly, hasError, options } = props2;
53089
- const checkboxRef = React178.useRef(null);
53090
- useFocusFieldEvent(() => {
53091
- if (isFirst) {
53092
- checkboxRef.current?.focus({
53093
- preventScroll: true
53094
- });
53095
- }
53096
- }, fieldId);
53097
- const labelElement = findChildOfType(children, Checkbox2.Label);
53098
- const inputElement = findChildOfType(children, Checkbox2.Input);
53099
- const _value = React178.useMemo(() => fieldValue || [], [
53100
- fieldValue
53101
- ]);
53102
- const actualValue = React178.useMemo(() => {
53103
- if (isOther) {
53104
- return _value.find((val) => val === label || val.startsWith(`${label}: `)) || label;
53105
- }
53106
- return value;
53107
- }, [
53108
- isOther,
53109
- _value,
53110
- label,
53111
- value
53112
- ]);
53113
- const handleOtherCheckboxChange = React178.useCallback((isSelected) => {
53114
- if (!isOther) {
53115
- return;
53116
- }
53117
- const optionsValues = getOptionsValues(options || []);
53118
- const removedOther = _value.filter((val) => optionsValues.includes(val));
53119
- const newValue = isSelected ? [
53120
- ...removedOther,
53121
- label
53122
- ] : removedOther;
53123
- onChange?.(newValue);
53124
- }, [
53125
- isOther,
53126
- label,
53127
- onChange,
53128
- options,
53129
- _value
53130
- ]);
53131
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxField, {
53132
- value: actualValue,
53133
- onChange: isOther ? handleOtherCheckboxChange : void 0,
53134
- isDisabled: disabled,
53135
- isReadOnly: readOnly,
53136
- isInvalid: hasError
53137
- }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxButton, {
53138
- ref: checkboxRef,
53139
- className,
53140
- "data-hook": `checkbox-${label}`
53141
- }, ({ isSelected, isHovered, isFocused }) => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, applyInternalProps(inputElement, {
53142
- isSelected,
53143
- isHovered,
53144
- isFocused
53145
- }), applyInternalProps(labelElement, {
53146
- label
53147
- }))));
53347
+
53348
+ // ../form-fields/dist/esm/ui/appointment-field/appointment-headless/appointment-dates-headless.js
53349
+ var useIsLocked = () => {
53350
+ const { disabled, readOnly } = useFieldPropsV2();
53351
+ return !!disabled || !!readOnly;
53148
53352
  };
53149
- Checkbox2.Label = OptionLabel;
53150
- Checkbox2.Input = SelectionIndicator;
53151
- var Option = ({ children, ...internal }) => {
53152
- const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53153
- const props2 = useFieldPropsV2();
53154
- const { value: fieldValue, onChange, options, addOtherPlaceholder, otherInputCharacterLimit, disabled, readOnly, hasError } = props2;
53155
- const checkboxElement = findChildOfType(children, Checkbox2);
53156
- const otherInputElement = findChildOfType(children, OtherInput);
53157
- const _value = React178.useMemo(() => fieldValue || [], [
53158
- fieldValue
53353
+ var Dates = ({ children, className }) => {
53354
+ const { days, selectDate, weekRangeLabel } = useAppointmentSlotPickerContext();
53355
+ const previousWeekElement = findChildOfType(children, Dates.PreviousWeek);
53356
+ const headingElement = findChildOfType(children, Dates.Heading);
53357
+ const nextWeekElement = findChildOfType(children, Dates.NextWeek);
53358
+ const dayElement = findChildOfType(children, Dates.Day) ?? /* @__PURE__ */ React178__default.default.createElement(Dates.Day, null);
53359
+ const selectedKeys = React178.useMemo(() => days.filter((day) => day.isSelected).map((day) => day.key), [
53360
+ days
53159
53361
  ]);
53160
- const isOtherSelected = React178.useMemo(() => {
53161
- if (!isOther) {
53162
- return false;
53163
- }
53164
- const optionsValues = getOptionsValues(options || []);
53165
- return getIsOtherOptionSelected(_value, optionsValues);
53166
- }, [
53167
- isOther,
53168
- _value,
53169
- options
53362
+ const isLocked = useIsLocked();
53363
+ const disabledKeys = React178.useMemo(() => days.filter((day) => isLocked || day.isDisabled).map((day) => day.key), [
53364
+ days,
53365
+ isLocked
53170
53366
  ]);
53171
- return /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, applyInternalProps(checkboxElement, {
53172
- value,
53173
- label,
53174
- isFirst,
53175
- isOther,
53176
- fieldId
53177
- }), isOther && isOtherSelected && applyInternalProps(otherInputElement, {
53178
- fieldValue: _value,
53179
- onChange,
53180
- label,
53181
- placeholder: addOtherPlaceholder,
53182
- maxLength: otherInputCharacterLimit,
53183
- disabled,
53184
- readOnly,
53185
- hasError,
53186
- ariaLabel: label,
53187
- addOtherLabel: label,
53188
- options
53189
- }));
53367
+ const handleSelectionChange = (keys3) => {
53368
+ if (keys3 === "all") {
53369
+ return;
53370
+ }
53371
+ const [selectedKey] = [
53372
+ ...keys3
53373
+ ];
53374
+ const day = days.find(({ key }) => key === selectedKey);
53375
+ if (day) {
53376
+ selectDate(day.date);
53377
+ }
53378
+ };
53379
+ return /* @__PURE__ */ React178__default.default.createElement("div", {
53380
+ className
53381
+ }, previousWeekElement, headingElement, nextWeekElement, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.ListBox, {
53382
+ "aria-label": weekRangeLabel,
53383
+ orientation: "horizontal",
53384
+ selectionMode: "single",
53385
+ selectedKeys,
53386
+ disabledKeys,
53387
+ onSelectionChange: handleSelectionChange
53388
+ }, days.map((day) => applyInternalProps(dayElement, {
53389
+ key: day.key,
53390
+ day
53391
+ }))));
53190
53392
  };
53191
- var OtherInput = ({ className, inputClassName, ...internal }) => {
53192
- const { fieldValue, onChange, label, placeholder, maxLength, disabled, readOnly, hasError, ariaLabel, addOtherLabel, options } = internal;
53193
- const [otherValue, setOtherValue] = React178.useState(() => {
53194
- const optionsValues = getOptionsValues(options || []);
53195
- const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53196
- return isSelected ? getOtherValue(fieldValue, addOtherLabel) : "";
53197
- });
53393
+ var PreviousWeek = ({ children, className }) => {
53394
+ const { changeWeek, canGoToPreviousWeek, previousWeekLabel, nextWeekLabel } = useAppointmentSlotPickerContext();
53395
+ const isLocked = useIsLocked();
53396
+ const buttonRef = React178.useRef(null);
53397
+ const wasPressedRef = React178.useRef(false);
53198
53398
  React178.useEffect(() => {
53199
- const optionsValues = getOptionsValues(options || []);
53200
- const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53201
- setOtherValue(isSelected ? getOtherValue(fieldValue, addOtherLabel) : "");
53202
- }, [
53203
- fieldValue,
53204
- options,
53205
- addOtherLabel
53206
- ]);
53207
- const debouncedHandleChange = React178.useMemo(() => {
53208
- return r((input) => {
53209
- const optionsValues = getOptionsValues(options || []);
53210
- const removedOther = fieldValue.filter((val) => optionsValues.includes(val));
53211
- const _otherValue = input ? `${addOtherLabel}: ${input}` : label;
53212
- const newValue = [
53213
- ...removedOther,
53214
- _otherValue
53215
- ];
53216
- onChange(newValue);
53217
- }, 500);
53218
- }, [
53219
- onChange,
53220
- options,
53221
- fieldValue,
53222
- addOtherLabel,
53223
- label
53224
- ]);
53225
- const handleInputChange = React178.useCallback((input) => {
53226
- setOtherValue(input);
53227
- debouncedHandleChange(input);
53399
+ if (canGoToPreviousWeek || !wasPressedRef.current) {
53400
+ return;
53401
+ }
53402
+ wasPressedRef.current = false;
53403
+ const activeElement = document.activeElement;
53404
+ if (activeElement !== document.body && activeElement !== buttonRef.current) {
53405
+ return;
53406
+ }
53407
+ const buttons = buttonRef.current?.closest("fieldset")?.querySelectorAll("button") ?? [];
53408
+ Array.from(buttons).find((button) => button.getAttribute("aria-label") === nextWeekLabel)?.focus();
53228
53409
  }, [
53229
- debouncedHandleChange
53410
+ canGoToPreviousWeek,
53411
+ nextWeekLabel
53230
53412
  ]);
53231
- return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.TextField, {
53232
- "aria-label": ariaLabel,
53233
- value: otherValue,
53234
- onChange: handleInputChange,
53235
- isDisabled: disabled,
53236
- isReadOnly: readOnly,
53237
- isInvalid: hasError,
53238
- className
53239
- }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Input, {
53240
- className: inputClassName,
53241
- placeholder,
53242
- maxLength,
53243
- "aria-label": ariaLabel
53244
- }));
53245
- };
53246
- CheckboxGroup.Label = Label;
53247
- CheckboxGroup.Options = Options;
53248
- Options.Option = Option;
53249
- Option.Checkbox = Checkbox2;
53250
- Option.OtherInput = OtherInput;
53251
- CheckboxGroup.Description = Description;
53252
- CheckboxGroup.Error = Error2;
53253
-
53254
- // ../../node_modules/react-aria/dist/private/utils/focusWithoutScrolling.mjs
53255
- function $1969ac565cfec8d0$export$de79e2c695e052f3(element) {
53256
- if ($1969ac565cfec8d0$var$supportsPreventScroll()) element.focus({
53257
- preventScroll: true
53258
- });
53259
- else {
53260
- let scrollableElements = $1969ac565cfec8d0$var$getScrollableElements(element);
53261
- element.focus();
53262
- $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements);
53263
- }
53264
- }
53265
- var $1969ac565cfec8d0$var$supportsPreventScrollCached = null;
53266
- function $1969ac565cfec8d0$var$supportsPreventScroll() {
53267
- if ($1969ac565cfec8d0$var$supportsPreventScrollCached == null) {
53268
- $1969ac565cfec8d0$var$supportsPreventScrollCached = false;
53269
- try {
53270
- let focusElem = document.createElement("div");
53271
- focusElem.focus({
53272
- get preventScroll() {
53273
- $1969ac565cfec8d0$var$supportsPreventScrollCached = true;
53274
- return true;
53275
- }
53276
- });
53277
- } catch {
53413
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Button, {
53414
+ ref: buttonRef,
53415
+ className,
53416
+ "aria-label": previousWeekLabel,
53417
+ isDisabled: !canGoToPreviousWeek || isLocked,
53418
+ onPress: () => {
53419
+ wasPressedRef.current = true;
53420
+ changeWeek(-1);
53278
53421
  }
53279
- }
53280
- return $1969ac565cfec8d0$var$supportsPreventScrollCached;
53281
- }
53282
- function $1969ac565cfec8d0$var$getScrollableElements(element) {
53283
- let parent = element.parentNode;
53284
- let scrollableElements = [];
53285
- let rootScrollingElement = document.scrollingElement || document.documentElement;
53286
- while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
53287
- if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
53288
- element: parent,
53289
- scrollTop: parent.scrollTop,
53290
- scrollLeft: parent.scrollLeft
53291
- });
53292
- parent = parent.parentNode;
53293
- }
53294
- if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
53295
- element: rootScrollingElement,
53296
- scrollTop: rootScrollingElement.scrollTop,
53297
- scrollLeft: rootScrollingElement.scrollLeft
53298
- });
53299
- return scrollableElements;
53300
- }
53301
- function $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements) {
53302
- for (let { element, scrollTop, scrollLeft } of scrollableElements) {
53303
- element.scrollTop = scrollTop;
53304
- element.scrollLeft = scrollLeft;
53305
- }
53306
- }
53307
-
53308
- // ../../node_modules/react-aria/dist/private/utils/domHelpers.mjs
53309
- var $d447af545b77c9f1$export$b204af158042fbac = (target) => {
53310
- if ($d447af545b77c9f1$var$isWindow(target)) return target.document;
53311
- if ($d447af545b77c9f1$export$62858bae88b53fd0(target)) return target;
53312
- return target?.ownerDocument ?? (typeof document !== "undefined" ? document : void 0);
53422
+ }, children ?? "\u2039");
53313
53423
  };
53314
- var $d447af545b77c9f1$export$f21a1ffae260145a = (target) => {
53315
- let ownerDocument = $d447af545b77c9f1$export$b204af158042fbac(target);
53316
- return ownerDocument?.defaultView ?? (typeof window !== "undefined" ? window : void 0);
53424
+ var NextWeek = ({ children, className }) => {
53425
+ const { changeWeek, nextWeekLabel } = useAppointmentSlotPickerContext();
53426
+ const isLocked = useIsLocked();
53427
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Button, {
53428
+ className,
53429
+ "aria-label": nextWeekLabel,
53430
+ isDisabled: isLocked,
53431
+ onPress: () => changeWeek(1)
53432
+ }, children ?? "\u203A");
53317
53433
  };
53318
- function $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) {
53319
- return value !== null && typeof value === "object" && "nodeType" in value && typeof value.nodeType === "number";
53320
- }
53321
- function $d447af545b77c9f1$var$isWindow(value) {
53322
- return typeof value === "object" && value != null && "window" in value && value.window === value;
53323
- }
53324
- function $d447af545b77c9f1$export$62858bae88b53fd0(value) {
53325
- return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 9;
53326
- }
53327
- function $d447af545b77c9f1$export$af51f0f06c0f328a(value) {
53328
- return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 11 && "host" in value;
53329
- }
53330
-
53331
- // ../../node_modules/react-stately/dist/private/flags/flags.mjs
53332
- var $6a20a7989e6c817a$var$_shadowDOM = false;
53333
- function $6a20a7989e6c817a$export$98658e8c59125e6a() {
53334
- return $6a20a7989e6c817a$var$_shadowDOM;
53335
- }
53336
-
53337
- // ../../node_modules/react-aria/dist/private/utils/shadowdom/DOMFunctions.mjs
53338
- function $23f2114a1b82827e$export$4282f70798064fe0(node, otherNode) {
53339
- if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return otherNode && node ? node.contains(otherNode) : false;
53340
- if (!node || !otherNode) return false;
53341
- let currentNode = otherNode;
53342
- while (currentNode !== null) {
53343
- if (currentNode === node) return true;
53344
- if (typeof currentNode.assignedElements !== "function" && currentNode.assignedSlot?.parentNode)
53345
- currentNode = currentNode.assignedSlot.parentNode;
53346
- else if (($d447af545b77c9f1$export$af51f0f06c0f328a)(currentNode))
53347
- currentNode = currentNode.host;
53348
- else currentNode = currentNode.parentNode;
53349
- }
53350
- return false;
53351
- }
53352
- var $23f2114a1b82827e$export$cd4e5573fbe2b576 = (doc = document) => {
53353
- if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return doc.activeElement;
53354
- let activeElement = doc.activeElement;
53355
- while (activeElement && "shadowRoot" in activeElement && activeElement.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot.activeElement;
53356
- return activeElement;
53434
+ var Heading2 = ({ children, className }) => {
53435
+ const { weekCaptionLabel, weekRangeLabel } = useAppointmentSlotPickerContext();
53436
+ return /* @__PURE__ */ React178__default.default.createElement("span", {
53437
+ className,
53438
+ "aria-live": "polite"
53439
+ }, children ? children({
53440
+ label: weekCaptionLabel,
53441
+ weekRange: weekRangeLabel
53442
+ }) : /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("span", {
53443
+ "aria-hidden": "true"
53444
+ }, weekCaptionLabel), /* @__PURE__ */ React178__default.default.createElement("span", {
53445
+ style: VISUALLY_HIDDEN_STYLE
53446
+ }, weekRangeLabel)));
53357
53447
  };
53358
- function $23f2114a1b82827e$export$e58f029f0fbfdb29(event) {
53359
- if (($6a20a7989e6c817a$export$98658e8c59125e6a)() && event.target instanceof Element && event.target.shadowRoot) {
53360
- if ("composedPath" in event) return event.composedPath()[0] ?? null;
53361
- else if ("composedPath" in event.nativeEvent) return event.nativeEvent.composedPath()[0] ?? null;
53362
- }
53363
- return event.target;
53364
- }
53365
- var $c4867b2f328c2698$export$e5c5a5f917a5871c = typeof document !== "undefined" ? (React178__default.default).useLayoutEffect : () => {
53448
+ var Day = ({ children, className, ...internal }) => {
53449
+ const { day } = internal;
53450
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.ListBoxItem, {
53451
+ id: day.key,
53452
+ className,
53453
+ textValue: day.label,
53454
+ "aria-label": day.isAvailable ? `${day.label}, ${day.availabilityLabel}` : day.label,
53455
+ "data-available": day.isAvailable || void 0,
53456
+ "data-today": day.isToday || void 0
53457
+ }, children ? children({
53458
+ ...day,
53459
+ date: new Date(day.date)
53460
+ }) : /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("span", null, day.weekdayLabel), /* @__PURE__ */ React178__default.default.createElement("span", null, day.dayOfMonthLabel)));
53366
53461
  };
53367
- function $a92dc41f639950be$export$525bc4921d56d4a(nativeEvent) {
53368
- let event = nativeEvent;
53369
- event.nativeEvent = nativeEvent;
53370
- event.isDefaultPrevented = () => event.defaultPrevented;
53371
- event.isPropagationStopped = () => event.cancelBubble;
53372
- event.persist = () => {
53462
+ Dates.PreviousWeek = PreviousWeek;
53463
+ Dates.Heading = Heading2;
53464
+ Dates.NextWeek = NextWeek;
53465
+ Dates.Day = Day;
53466
+ var RADIO_INPUT_SELECTOR = 'input[type="radio"]';
53467
+ var Slots = ({ children, className, ...internal }) => {
53468
+ const { hasTimezoneNote, hasDateTitle } = internal;
53469
+ const { slots, selectedSlotKey, selectSlot, selectedDateLabel, isReloadingSlots, timezoneLabel, pendingFocusIndex, consumePendingFocusIndex } = useAppointmentSlotPickerContext();
53470
+ const { id: fieldId, disabled, readOnly, required, hasError } = useFieldPropsV2();
53471
+ const { inputId, labelId: fieldLabelId, ariaDescribedBy } = useFieldAttributes();
53472
+ const groupRef = React178.useRef(null);
53473
+ const slotElement = findChildOfType(children, Slots.Slot) ?? /* @__PURE__ */ React178__default.default.createElement(Slots.Slot, null);
53474
+ const isLabelledByDateTitle = !!hasDateTitle && !!selectedDateLabel;
53475
+ const describedBy = [
53476
+ ariaDescribedBy,
53477
+ hasTimezoneNote && timezoneLabel ? getTimezoneNoteId(inputId) : void 0
53478
+ ].filter(Boolean).join(" ") || void 0;
53479
+ const focusSlotAt = (index2, options) => {
53480
+ groupRef.current?.querySelectorAll(RADIO_INPUT_SELECTOR)?.[index2]?.focus(options);
53373
53481
  };
53374
- return event;
53375
- }
53376
- function $a92dc41f639950be$export$c2b7abe5d61ec696(event, target) {
53377
- Object.defineProperty(event, "target", {
53378
- value: target
53379
- });
53380
- Object.defineProperty(event, "currentTarget", {
53381
- value: target
53382
- });
53383
- }
53384
- function $a92dc41f639950be$export$715c682d09d639cc(onBlur) {
53385
- let stateRef = (React178.useRef)({
53386
- isFocused: false,
53387
- observer: null
53388
- });
53389
- ($c4867b2f328c2698$export$e5c5a5f917a5871c)(() => {
53390
- const state = stateRef.current;
53391
- return () => {
53392
- if (state.observer) {
53393
- state.observer.disconnect();
53394
- state.observer = null;
53395
- }
53396
- };
53397
- }, []);
53398
- return (React178.useCallback)((e) => {
53399
- let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
53400
- if (eventTarget instanceof HTMLButtonElement || eventTarget instanceof HTMLInputElement || eventTarget instanceof HTMLTextAreaElement || eventTarget instanceof HTMLSelectElement) {
53401
- stateRef.current.isFocused = true;
53402
- let target = eventTarget;
53403
- let onBlurHandler = (e2) => {
53404
- stateRef.current.isFocused = false;
53405
- if (target.disabled) {
53406
- let event = $a92dc41f639950be$export$525bc4921d56d4a(e2);
53407
- onBlur?.(event);
53408
- }
53409
- if (stateRef.current.observer) {
53410
- stateRef.current.observer.disconnect();
53411
- stateRef.current.observer = null;
53412
- }
53413
- };
53414
- target.addEventListener("focusout", onBlurHandler, {
53415
- once: true
53416
- });
53417
- stateRef.current.observer = new MutationObserver(() => {
53418
- if (stateRef.current.isFocused && target.disabled) {
53419
- stateRef.current.observer?.disconnect();
53420
- let relatedTargetEl = target === ($23f2114a1b82827e$export$cd4e5573fbe2b576)() ? null : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
53421
- target.dispatchEvent(new FocusEvent("blur", {
53422
- relatedTarget: relatedTargetEl
53423
- }));
53424
- target.dispatchEvent(new FocusEvent("focusout", {
53425
- bubbles: true,
53426
- relatedTarget: relatedTargetEl
53427
- }));
53428
- }
53429
- });
53430
- stateRef.current.observer.observe(target, {
53431
- attributes: true,
53432
- attributeFilter: [
53433
- "disabled"
53434
- ]
53482
+ useFocusFieldEvent(() => {
53483
+ const hasSlots = !!groupRef.current?.querySelector(RADIO_INPUT_SELECTOR);
53484
+ if (hasSlots) {
53485
+ focusSlotAt(0, {
53486
+ preventScroll: true
53435
53487
  });
53488
+ return;
53436
53489
  }
53490
+ const options = Array.from(document.getElementById(inputId)?.querySelectorAll('[role="option"]') ?? []);
53491
+ const fallback = options.find((option2) => option2.getAttribute("aria-selected") === "true") ?? options.find((option2) => option2.getAttribute("aria-disabled") !== "true");
53492
+ fallback?.focus({
53493
+ preventScroll: true
53494
+ });
53495
+ }, fieldId);
53496
+ React178.useEffect(() => {
53497
+ if (pendingFocusIndex === void 0) {
53498
+ return;
53499
+ }
53500
+ focusSlotAt(pendingFocusIndex);
53501
+ consumePendingFocusIndex();
53437
53502
  }, [
53438
- onBlur
53503
+ pendingFocusIndex,
53504
+ slots.length
53439
53505
  ]);
53440
- }
53441
-
53442
- // ../../node_modules/react-aria/dist/private/utils/platform.mjs
53443
- function $2add3ce32c6007eb$var$testUserAgent(re) {
53444
- if (typeof window === "undefined" || window.navigator == null) return false;
53445
- let brands = window.navigator["userAgentData"]?.brands;
53446
- return Array.isArray(brands) && brands.some((brand) => re.test(brand.brand)) || re.test(window.navigator.userAgent);
53447
- }
53448
- function $2add3ce32c6007eb$var$testPlatform(re) {
53449
- return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator["userAgentData"]?.platform || window.navigator.platform) : false;
53450
- }
53451
- function $2add3ce32c6007eb$var$cached(fn) {
53452
- let res = null;
53453
- return () => {
53454
- if (res == null) res = fn();
53455
- return res;
53456
- };
53457
- }
53458
- var $2add3ce32c6007eb$export$9ac100e40613ea10 = $2add3ce32c6007eb$var$cached(function() {
53459
- return $2add3ce32c6007eb$var$testPlatform(/^Mac/i);
53460
- });
53461
- var $2add3ce32c6007eb$export$186c6964ca17d99 = $2add3ce32c6007eb$var$cached(function() {
53462
- return $2add3ce32c6007eb$var$testPlatform(/^iPhone/i);
53463
- });
53464
- var $2add3ce32c6007eb$export$7bef049ce92e4224 = $2add3ce32c6007eb$var$cached(function() {
53465
- return $2add3ce32c6007eb$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
53466
- $2add3ce32c6007eb$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
53467
- });
53468
- var $2add3ce32c6007eb$export$fedb369cb70207f1 = $2add3ce32c6007eb$var$cached(function() {
53469
- return $2add3ce32c6007eb$export$186c6964ca17d99() || $2add3ce32c6007eb$export$7bef049ce92e4224();
53470
- });
53471
- var $2add3ce32c6007eb$export$78551043582a6a98 = $2add3ce32c6007eb$var$cached(function() {
53472
- return $2add3ce32c6007eb$var$testUserAgent(/AppleWebKit/i) && ($2add3ce32c6007eb$export$fedb369cb70207f1() || !$2add3ce32c6007eb$export$6446a186d09e379e());
53473
- });
53474
- var $2add3ce32c6007eb$export$6446a186d09e379e = $2add3ce32c6007eb$var$cached(function() {
53475
- return $2add3ce32c6007eb$var$testUserAgent(/Chrome|CriOS|CrMo/i);
53476
- });
53477
- var $2add3ce32c6007eb$export$a11b0059900ceec8 = $2add3ce32c6007eb$var$cached(function() {
53478
- return $2add3ce32c6007eb$var$testUserAgent(/Android/i);
53479
- });
53480
- var $2add3ce32c6007eb$export$b7d78993b74f766d = $2add3ce32c6007eb$var$cached(function() {
53481
- return $2add3ce32c6007eb$var$testUserAgent(/(Firefox|FxiOS)/i);
53482
- });
53483
-
53484
- // ../../node_modules/react-aria/dist/private/utils/isVirtualEvent.mjs
53485
- function $b5c62b033c25b96d$export$60278871457622de(event) {
53486
- if (event.pointerType === "" && event.isTrusted) return true;
53487
- if (($2add3ce32c6007eb$export$a11b0059900ceec8)() && event.pointerType) return event.type === "click" && event.buttons === 1;
53488
- return event.detail === 0 && !event.pointerType;
53489
- }
53490
- function $caaf0dd3060ed57c$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
53491
- let { metaKey, ctrlKey, altKey, shiftKey } = modifiers;
53492
- if (!($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$b7d78993b74f766d)() && window.event?.type?.startsWith("key") && target.target === "_blank") {
53493
- if (($2add3ce32c6007eb$export$9ac100e40613ea10)()) metaKey = true;
53494
- else ctrlKey = true;
53495
- }
53496
- let event = ($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$9ac100e40613ea10)() && !($2add3ce32c6007eb$export$7bef049ce92e4224)() && true ? new KeyboardEvent("keydown", {
53497
- keyIdentifier: "Enter",
53498
- metaKey,
53499
- ctrlKey,
53500
- altKey,
53501
- shiftKey
53502
- }) : new MouseEvent("click", {
53503
- metaKey,
53504
- ctrlKey,
53505
- altKey,
53506
- shiftKey,
53507
- detail: 1,
53508
- bubbles: true,
53509
- cancelable: true
53510
- });
53511
- $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = setOpening;
53512
- ($1969ac565cfec8d0$export$de79e2c695e052f3)(target);
53513
- target.dispatchEvent(event);
53514
- $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
53515
- }
53516
- $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
53517
- var $8f5a2122b0992be3$var$currentModality = null;
53518
- var $8f5a2122b0992be3$export$901e90a13c50a14e = /* @__PURE__ */ new Set();
53519
- var $8f5a2122b0992be3$export$d90243b58daecda7 = /* @__PURE__ */ new Map();
53520
- var $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
53521
- var $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
53522
- var $8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS = {
53523
- Tab: true,
53524
- Escape: true
53506
+ return /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, /* @__PURE__ */ React178__default.default.createElement("div", {
53507
+ role: "status",
53508
+ style: VISUALLY_HIDDEN_STYLE
53509
+ }, slots.length > 0 ? selectedDateLabel : void 0), /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioGroup, {
53510
+ ref: groupRef,
53511
+ className,
53512
+ value: selectedSlotKey ?? null,
53513
+ onChange: selectSlot,
53514
+ isDisabled: disabled,
53515
+ isReadOnly: readOnly,
53516
+ isRequired: required,
53517
+ isInvalid: hasError,
53518
+ "aria-labelledby": isLabelledByDateTitle ? getDateTitleId(inputId) : fieldLabelId,
53519
+ "aria-describedby": describedBy,
53520
+ "data-refetch": isReloadingSlots || void 0
53521
+ }, slots.map((slot) => applyInternalProps(slotElement, {
53522
+ key: slot.key,
53523
+ slot
53524
+ }))));
53525
+ };
53526
+ var Slot = ({ children, className, ...internal }) => {
53527
+ const { slot } = internal;
53528
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioField, {
53529
+ value: slot.key,
53530
+ "aria-label": slot.timeRange
53531
+ }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.RadioButton, {
53532
+ className
53533
+ }, children ? children(slot) : slot.timeRange));
53525
53534
  };
53526
- function $8f5a2122b0992be3$var$triggerChangeHandlers(modality, e) {
53527
- for (let handler of $8f5a2122b0992be3$export$901e90a13c50a14e) handler(modality, e);
53528
- }
53529
- function $8f5a2122b0992be3$var$isValidKey(e) {
53530
- return !(e.metaKey || !($2add3ce32c6007eb$export$9ac100e40613ea10)() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
53531
- }
53532
- function $8f5a2122b0992be3$var$handleKeyboardEvent(e) {
53533
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53534
- if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && $8f5a2122b0992be3$var$isValidKey(e)) {
53535
- $8f5a2122b0992be3$var$currentModality = "keyboard";
53536
- $8f5a2122b0992be3$var$triggerChangeHandlers("keyboard", e);
53537
- }
53538
- }
53539
- function $8f5a2122b0992be3$var$handlePointerEvent(e) {
53540
- $8f5a2122b0992be3$var$currentModality = "pointer";
53541
- "pointerType" in e ? e.pointerType : "mouse";
53542
- if (e.type === "mousedown" || e.type === "pointerdown") {
53543
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53544
- $8f5a2122b0992be3$var$triggerChangeHandlers("pointer", e);
53545
- }
53546
- }
53547
- function $8f5a2122b0992be3$var$handleClickEvent(e) {
53548
- if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && ($b5c62b033c25b96d$export$60278871457622de)(e)) {
53549
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53550
- $8f5a2122b0992be3$var$currentModality = "virtual";
53535
+ Slots.Slot = Slot;
53536
+ var import_cloneDeep = __toESM(require_cloneDeep());
53537
+ var createIndicatorNode = (requiredIndicatorType, t, className) => {
53538
+ const indicator = requiredIndicatorType === types$1.RequiredIndicator.TEXT ? t("settings.required-indicator-text") : "*";
53539
+ const str = (v) => ({
53540
+ stringValue: v
53541
+ });
53542
+ const fields = {
53543
+ "aria-hidden": str("true")
53544
+ };
53545
+ if (className) {
53546
+ fields.className = str(className);
53551
53547
  }
53552
- }
53553
- function $8f5a2122b0992be3$var$handleFocusEvent(e) {
53554
- let target = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
53555
- let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(target);
53556
- let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(target);
53557
- if (target === ownerWindow) {
53558
- $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
53559
- return;
53548
+ return {
53549
+ type: Node_Type.EXTERNAL,
53550
+ id: "",
53551
+ nodes: [],
53552
+ externalData: {
53553
+ fields
53554
+ },
53555
+ textData: {
53556
+ text: indicator,
53557
+ decorations: []
53558
+ }
53559
+ };
53560
+ };
53561
+ var injectRequiredIndicator = (label, placement, indicatorNode) => {
53562
+ const result2 = (0, import_cloneDeep.default)(label);
53563
+ switch (placement) {
53564
+ case types$1.RequiredIndicatorPlacement.BEFORE_FIELD_TITLE:
53565
+ const firstNode = result2?.nodes.find(Boolean);
53566
+ if (firstNode) {
53567
+ firstNode.nodes ?? (firstNode.nodes = []);
53568
+ firstNode.nodes.unshift(indicatorNode);
53569
+ }
53570
+ break;
53571
+ case types$1.RequiredIndicatorPlacement.AFTER_FIELD_TITLE:
53572
+ const lastNode = result2?.nodes?.findLast(Boolean);
53573
+ if (lastNode) {
53574
+ lastNode.nodes ?? (lastNode.nodes = []);
53575
+ lastNode.nodes.push(indicatorNode);
53576
+ }
53577
+ break;
53560
53578
  }
53561
- if (target === ownerDocument || !e.isTrusted) return;
53562
- if (!$8f5a2122b0992be3$var$hasEventBeforeFocus && !$8f5a2122b0992be3$var$hasBlurredWindowRecently) {
53563
- $8f5a2122b0992be3$var$currentModality = "virtual";
53564
- $8f5a2122b0992be3$var$triggerChangeHandlers("virtual", e);
53579
+ return result2;
53580
+ };
53581
+ var stopLinkEventPropagation = (event) => {
53582
+ if (event.target instanceof Element && event.target.closest("a")) {
53583
+ event.stopPropagation();
53565
53584
  }
53566
- $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
53567
- $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
53568
- }
53569
- function $8f5a2122b0992be3$var$handleWindowBlur() {
53570
- $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
53571
- $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
53572
- }
53573
- function $8f5a2122b0992be3$var$setupGlobalFocusEvents(element) {
53574
- if (typeof window === "undefined" || typeof document === "undefined") return;
53575
- const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
53576
- const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
53577
- if ($8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject)) return;
53578
- let focus = windowObject.HTMLElement.prototype.focus;
53579
- Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
53580
- configurable: true,
53581
- writable: true,
53582
- value: function() {
53583
- $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
53584
- focus.apply(this, arguments);
53585
+ };
53586
+ var LINK_EVENT_HANDLERS = {
53587
+ onPointerDown: stopLinkEventPropagation,
53588
+ onMouseDown: stopLinkEventPropagation,
53589
+ onClick: stopLinkEventPropagation
53590
+ };
53591
+ var RichTextLabel = ({ className, requiredClassName, theme, children, ...internal }) => {
53592
+ const { requiredIndicatorHidden = false, leadingElement } = internal;
53593
+ const fieldProps = useFieldPropsV2();
53594
+ const { label, required = false, disabled = false, requiredIndicatorType = types$1.RequiredIndicator.ASTERISK, requiredIndicatorPlacement = types$1.RequiredIndicatorPlacement.AFTER_FIELD_TITLE } = fieldProps;
53595
+ const { t } = useTranslation2();
53596
+ const { language } = useConfig();
53597
+ const labelWithIndicator = React178.useMemo(() => {
53598
+ if (!required || requiredIndicatorHidden || !label) {
53599
+ return label;
53585
53600
  }
53601
+ const indicatorNode = createIndicatorNode(requiredIndicatorType, t, requiredClassName);
53602
+ return injectRequiredIndicator(label, requiredIndicatorPlacement, indicatorNode);
53603
+ }, [
53604
+ required,
53605
+ requiredIndicatorHidden,
53606
+ label,
53607
+ requiredIndicatorType,
53608
+ requiredIndicatorPlacement,
53609
+ t,
53610
+ requiredClassName
53611
+ ]);
53612
+ return /* @__PURE__ */ React178__default.default.createElement("div", {
53613
+ className,
53614
+ ...disabled ? {} : LINK_EVENT_HANDLERS
53615
+ }, leadingElement, children({
53616
+ content: labelWithIndicator,
53617
+ locale: language,
53618
+ htmlAttributesPlugin
53619
+ }));
53620
+ };
53621
+ var SelectionIndicator = ({ className, ...internal }) => {
53622
+ const state = internal;
53623
+ return /* @__PURE__ */ React178__default.default.createElement("div", {
53624
+ "aria-hidden": "true",
53625
+ className: typeof className === "function" ? className(state) : className
53586
53626
  });
53587
- documentObject.addEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53588
- documentObject.addEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53589
- documentObject.addEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
53590
- windowObject.addEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
53591
- windowObject.addEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
53592
- if (typeof PointerEvent !== "undefined") {
53593
- documentObject.addEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
53594
- documentObject.addEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
53595
- documentObject.addEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
53596
- }
53597
- windowObject.addEventListener("beforeunload", () => {
53598
- $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element);
53599
- }, {
53600
- once: true
53601
- });
53602
- $8f5a2122b0992be3$export$d90243b58daecda7.set(windowObject, {
53603
- focus
53604
- });
53605
- }
53606
- var $8f5a2122b0992be3$var$tearDownWindowFocusTracking = (element, loadListener) => {
53607
- const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
53608
- const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
53609
- if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
53610
- if (!$8f5a2122b0992be3$export$d90243b58daecda7.has(windowObject)) return;
53611
- Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
53612
- configurable: true,
53613
- writable: true,
53614
- value: $8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject).focus
53627
+ };
53628
+
53629
+ // ../form-fields/dist/esm/ui/checkbox-field/checkbox-field-headless.js
53630
+ var Checkbox = ({ children }) => {
53631
+ const { id: id6, FieldLayout } = useFieldPropsV2();
53632
+ const checkboxElement = findChildOfType(children, Checkbox.Checkbox);
53633
+ const descriptionElement = findChildOfType(children, Checkbox.Description);
53634
+ const errorElement = findChildOfType(children, Checkbox.Error);
53635
+ return /* @__PURE__ */ React178__default.default.createElement(FieldLayout, {
53636
+ fieldId: id6,
53637
+ renderLabel: () => null,
53638
+ renderInput: () => checkboxElement,
53639
+ renderDescription: () => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, errorElement, descriptionElement)
53615
53640
  });
53616
- documentObject.removeEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53617
- documentObject.removeEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
53618
- documentObject.removeEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
53619
- windowObject.removeEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
53620
- windowObject.removeEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
53621
- if (typeof PointerEvent !== "undefined") {
53622
- documentObject.removeEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
53623
- documentObject.removeEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
53624
- documentObject.removeEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
53625
- }
53626
- $8f5a2122b0992be3$export$d90243b58daecda7.delete(windowObject);
53627
53641
  };
53628
- function $8f5a2122b0992be3$export$2f1888112f558a7d(element) {
53629
- const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
53630
- let loadListener;
53631
- if (documentObject.readyState !== "loading") $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
53632
- else {
53633
- loadListener = () => {
53634
- $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
53635
- };
53636
- documentObject.addEventListener("DOMContentLoaded", loadListener);
53637
- }
53638
- return () => $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element, loadListener);
53639
- }
53640
- if (typeof document !== "undefined") $8f5a2122b0992be3$export$2f1888112f558a7d();
53641
- function $8f5a2122b0992be3$export$b9b3dfddab17db27() {
53642
- return $8f5a2122b0992be3$var$currentModality !== "pointer";
53643
- }
53644
- var $8f5a2122b0992be3$var$nonTextInputTypes = /* @__PURE__ */ new Set([
53645
- "checkbox",
53646
- "radio",
53647
- "range",
53648
- "color",
53649
- "file",
53650
- "image",
53651
- "button",
53652
- "submit",
53653
- "reset"
53654
- ]);
53655
- function $8f5a2122b0992be3$var$isKeyboardFocusEvent(isTextInput, modality, e) {
53656
- let eventTarget = e ? ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) : void 0;
53657
- let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
53658
- let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(eventTarget);
53659
- const IHTMLInputElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLInputElement : HTMLInputElement;
53660
- const IHTMLTextAreaElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLTextAreaElement : HTMLTextAreaElement;
53661
- const IHTMLElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLElement : HTMLElement;
53662
- const IKeyboardEvent = typeof ownerWindow !== "undefined" ? ownerWindow.KeyboardEvent : KeyboardEvent;
53663
- let activeElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument);
53664
- isTextInput = isTextInput || activeElement instanceof IHTMLInputElement && !$8f5a2122b0992be3$var$nonTextInputTypes.has(activeElement.type) || activeElement instanceof IHTMLTextAreaElement || activeElement instanceof IHTMLElement && activeElement.isContentEditable;
53665
- return !(isTextInput && modality === "keyboard" && e instanceof IKeyboardEvent && !$8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
53666
- }
53667
- function $8f5a2122b0992be3$export$ec71b4b83ac08ec3(fn, deps, opts) {
53668
- $8f5a2122b0992be3$var$setupGlobalFocusEvents();
53669
- (React178.useEffect)(() => {
53670
- if (opts?.enabled === false) return;
53671
- let handler = (modality, e) => {
53672
- if (!$8f5a2122b0992be3$var$isKeyboardFocusEvent(!!opts?.isTextInput, modality, e)) return;
53673
- fn($8f5a2122b0992be3$export$b9b3dfddab17db27());
53674
- };
53675
- $8f5a2122b0992be3$export$901e90a13c50a14e.add(handler);
53676
- return () => {
53677
- $8f5a2122b0992be3$export$901e90a13c50a14e.delete(handler);
53678
- };
53679
- }, deps);
53680
- }
53642
+ var CheckboxContainer = ({ children, className }) => {
53643
+ const { id: id6, value, onChange, disabled, required, readOnly, onBlur, onFocus, hasError } = useFieldPropsV2();
53644
+ const { inputId, ariaDescribedBy } = useFieldAttributes();
53645
+ const ref = React178.useRef(null);
53646
+ useFocusFieldEvent(() => {
53647
+ ref.current?.focus({
53648
+ preventScroll: true
53649
+ });
53650
+ }, id6);
53651
+ useKeepPrehydrationValue(ref);
53652
+ const labelElement = findChildOfType(children, CheckboxContainer.RichTextLabel);
53653
+ const inputElement = findChildOfType(children, CheckboxContainer.Input);
53654
+ const handleChange = React178.useCallback((isSelected) => {
53655
+ onChange(isSelected);
53656
+ }, [
53657
+ onChange
53658
+ ]);
53659
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxField, {
53660
+ id: inputId,
53661
+ "aria-describedby": ariaDescribedBy,
53662
+ isSelected: Boolean(value),
53663
+ onChange: handleChange,
53664
+ isDisabled: disabled,
53665
+ isReadOnly: readOnly,
53666
+ isRequired: required,
53667
+ isInvalid: hasError,
53668
+ onBlur,
53669
+ onFocus
53670
+ }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxButton, {
53671
+ ref,
53672
+ className
53673
+ }, ({ isSelected, isHovered, isFocused }) => {
53674
+ const input = applyInternalProps(inputElement, {
53675
+ isSelected,
53676
+ isHovered,
53677
+ isFocused
53678
+ });
53679
+ return labelElement ? applyInternalProps(labelElement, {
53680
+ leadingElement: input
53681
+ }) : input;
53682
+ }));
53683
+ };
53684
+ CheckboxContainer.RichTextLabel = RichTextLabel;
53685
+ CheckboxContainer.Input = SelectionIndicator;
53686
+ Checkbox.Checkbox = CheckboxContainer;
53687
+ Checkbox.Description = Description;
53688
+ Checkbox.Error = Error2;
53681
53689
 
53682
- // ../../node_modules/react-aria/dist/private/utils/chain.mjs
53683
- function $a4e76a5424781910$export$e08e3b67e392101e(...callbacks) {
53684
- return (...args) => {
53685
- for (let callback of callbacks) if (typeof callback === "function") callback(...args);
53686
- };
53687
- }
53688
- var $390e54f620492c70$export$d41a04c74483c6ef = /* @__PURE__ */ new Map();
53689
- if (typeof FinalizationRegistry !== "undefined") new FinalizationRegistry((heldValue) => {
53690
- $390e54f620492c70$export$d41a04c74483c6ef.delete(heldValue);
53691
- });
53692
- function $390e54f620492c70$export$cd8c9cb68f842629(idA, idB) {
53693
- if (idA === idB) return idA;
53694
- let setIdsA = $390e54f620492c70$export$d41a04c74483c6ef.get(idA);
53695
- if (setIdsA) {
53696
- setIdsA.forEach((ref) => ref.current = idB);
53697
- return idB;
53698
- }
53699
- let setIdsB = $390e54f620492c70$export$d41a04c74483c6ef.get(idB);
53700
- if (setIdsB) {
53701
- setIdsB.forEach((ref) => ref.current = idA);
53702
- return idA;
53690
+ // ../../node_modules/ts-debounce/dist/src/index.esm.js
53691
+ function r(r3, e, n) {
53692
+ var i, t, o;
53693
+ void 0 === n && (n = {});
53694
+ var a2 = null != (i = n.isImmediate) && i, u = null != (t = n.callback) && t, c = n.maxWait, v = Date.now(), l = [];
53695
+ function f() {
53696
+ if (void 0 !== c) {
53697
+ var r4 = Date.now() - v;
53698
+ if (r4 + e >= c) return c - r4;
53699
+ }
53700
+ return e;
53703
53701
  }
53704
- return idB;
53705
- }
53706
-
53707
- // ../../node_modules/react-aria/dist/private/utils/mergeRefs.mjs
53708
- function $4064df0d6f9620e1$export$c9058316764c140e(...refs) {
53709
- if (refs.length === 1 && refs[0]) return refs[0];
53710
- return (value) => {
53711
- let hasCleanup = false;
53712
- const cleanups = refs.map((ref) => {
53713
- const cleanup = $4064df0d6f9620e1$var$setRef(ref, value);
53714
- hasCleanup || (hasCleanup = typeof cleanup == "function");
53715
- return cleanup;
53702
+ var d = function() {
53703
+ var e2 = [].slice.call(arguments), n2 = this;
53704
+ return new Promise(function(i2, t2) {
53705
+ var c2 = a2 && void 0 === o;
53706
+ if (void 0 !== o && clearTimeout(o), o = setTimeout(function() {
53707
+ if (o = void 0, v = Date.now(), !a2) {
53708
+ var i3 = r3.apply(n2, e2);
53709
+ u && u(i3), l.forEach(function(r4) {
53710
+ return (0, r4.resolve)(i3);
53711
+ }), l = [];
53712
+ }
53713
+ }, f()), c2) {
53714
+ var d2 = r3.apply(n2, e2);
53715
+ return u && u(d2), i2(d2);
53716
+ }
53717
+ l.push({ resolve: i2, reject: t2 });
53716
53718
  });
53717
- if (hasCleanup) return () => {
53718
- cleanups.forEach((cleanup, i) => {
53719
- if (typeof cleanup === "function") cleanup();
53720
- else $4064df0d6f9620e1$var$setRef(refs[i], null);
53721
- });
53722
- };
53723
53719
  };
53724
- }
53725
- function $4064df0d6f9620e1$var$setRef(ref, value) {
53726
- if (typeof ref === "function") return ref(value);
53727
- else if (ref != null) ref.current = value;
53720
+ return d.cancel = function(r4) {
53721
+ void 0 !== o && clearTimeout(o), l.forEach(function(e2) {
53722
+ return (0, e2.reject)(r4);
53723
+ }), l = [];
53724
+ }, d;
53728
53725
  }
53729
53726
 
53730
- // ../../node_modules/clsx/dist/clsx.mjs
53731
- function r2(e) {
53732
- var t, f, n = "";
53733
- if ("string" == typeof e || "number" == typeof e) n += e;
53734
- else if ("object" == typeof e) if (Array.isArray(e)) {
53735
- var o = e.length;
53736
- for (t = 0; t < o; t++) e[t] && (f = r2(e[t])) && (n && (n += " "), n += f);
53737
- } else for (f in e) e[f] && (n && (n += " "), n += f);
53738
- return n;
53739
- }
53740
- function clsx() {
53741
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r2(e)) && (n && (n += " "), n += t);
53742
- return n;
53743
- }
53744
- var clsx_default = clsx;
53727
+ // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-utils.js
53728
+ var OTHER_ID = "Other";
53729
+ var getValueIncludesOther = (value, optionsNames) => value.some((_value) => !optionsNames.includes(_value));
53730
+ var getIsOtherOptionSelected = (value, optionsNames) => value.length > 0 && getValueIncludesOther(value, optionsNames);
53731
+ var getOtherLabel = (addOtherLabel, t) => {
53732
+ const otherLabelDefault = t?.("add-other.default-other-option-label");
53733
+ return addOtherLabel || otherLabelDefault || OTHER_ID;
53734
+ };
53735
+ var getOtherValue = (value, addOtherLabel) => {
53736
+ const addedSymbolsLength = 2;
53737
+ const otherLabelLength = addOtherLabel ? addOtherLabel.length + addedSymbolsLength : 0;
53738
+ const otherItem = value.find((item) => item.startsWith(`${addOtherLabel}: `)) || "";
53739
+ return otherItem.slice(otherLabelLength);
53740
+ };
53741
+ var getOptionsValues = (options) => options.map((option2) => option2.value ?? option2.label);
53745
53742
 
53746
- // ../../node_modules/react-aria/dist/private/utils/mergeProps.mjs
53747
- function $bbaa08b3cd72f041$export$9d1611c77c2fe928(...args) {
53748
- let result2 = {
53749
- ...args[0]
53750
- };
53751
- for (let i = 1; i < args.length; i++) {
53752
- let props2 = args[i];
53753
- for (let key in props2) {
53754
- let a2 = result2[key];
53755
- let b = props2[key];
53756
- if (typeof a2 === "function" && typeof b === "function" && // This is a lot faster than a regex.
53757
- key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
53758
- 65 && key.charCodeAt(2) <= /* 'Z' */
53759
- 90) result2[key] = ($a4e76a5424781910$export$e08e3b67e392101e)(a2, b);
53760
- else if ((key === "className" || key === "UNSAFE_className") && typeof a2 === "string" && typeof b === "string") result2[key] = (clsx_default)(a2, b);
53761
- else if (key === "id" && a2 && b) result2.id = ($390e54f620492c70$export$cd8c9cb68f842629)(a2, b);
53762
- else if (key === "ref" && a2 && b) result2.ref = ($4064df0d6f9620e1$export$c9058316764c140e)(a2, b);
53763
- else result2[key] = b !== void 0 ? b : a2;
53743
+ // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-headless.js
53744
+ var CheckboxGroup = ({ children, className }) => {
53745
+ const props2 = useFieldPropsV2();
53746
+ const { id: id6, value, onChange, disabled, required, onBlur, onFocus, hasError, FieldLayout } = props2;
53747
+ const { inputId, labelId, ariaDescribedBy } = useFieldAttributes();
53748
+ const groupRef = React178.useRef(null);
53749
+ useKeepPrehydrationValue(groupRef);
53750
+ const labelElement = findChildOfType(children, CheckboxGroup.Label);
53751
+ const optionsElement = findChildOfType(children, CheckboxGroup.Options);
53752
+ const descriptionElement = findChildOfType(children, CheckboxGroup.Description);
53753
+ const errorElement = findChildOfType(children, CheckboxGroup.Error);
53754
+ const _value = React178.useMemo(() => value || [], [
53755
+ value
53756
+ ]);
53757
+ const handleChange = React178.useCallback((newValue) => {
53758
+ onChange?.(newValue);
53759
+ }, [
53760
+ onChange
53761
+ ]);
53762
+ return /* @__PURE__ */ React178__default.default.createElement(FieldLayout, {
53763
+ fieldId: id6,
53764
+ renderLabel: () => labelElement,
53765
+ renderInput: () => /* @__PURE__ */ React178__default.default.createElement(FieldsetHeadless, {
53766
+ id: inputId,
53767
+ ariaLabelledBy: labelId,
53768
+ ariaDescribedBy,
53769
+ required,
53770
+ onBlur,
53771
+ onFocus
53772
+ }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxGroup, {
53773
+ ref: groupRef,
53774
+ className,
53775
+ "aria-labelledby": labelId,
53776
+ value: _value,
53777
+ onChange: handleChange,
53778
+ isDisabled: disabled,
53779
+ isRequired: required,
53780
+ isInvalid: hasError
53781
+ }, optionsElement)),
53782
+ renderDescription: () => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, errorElement, descriptionElement)
53783
+ });
53784
+ };
53785
+ var Options = ({ children, className }) => {
53786
+ const props2 = useFieldPropsV2();
53787
+ const { id: id6, options, addOther, addOtherLabel, numberOfColumns } = props2;
53788
+ const { t } = useTranslation2();
53789
+ const optionElement = findChildOfType(children, Options.Option);
53790
+ const otherLabel = getOtherLabel(addOtherLabel, t);
53791
+ return /* @__PURE__ */ React178__default.default.createElement("div", {
53792
+ className,
53793
+ "data-columns": numberOfColumns
53794
+ }, options?.map((option2, index2) => {
53795
+ const checkboxValue = option2.value ?? option2.label;
53796
+ return applyInternalProps(optionElement, {
53797
+ key: option2.id || option2.label,
53798
+ value: checkboxValue,
53799
+ label: option2.label,
53800
+ isFirst: index2 === 0,
53801
+ fieldId: id6
53802
+ });
53803
+ }), addOther && applyInternalProps(optionElement, {
53804
+ key: OTHER_ID,
53805
+ value: OTHER_ID,
53806
+ label: otherLabel,
53807
+ isOther: true
53808
+ }));
53809
+ };
53810
+ var OptionLabel = ({ className, ...internal }) => {
53811
+ const { label } = internal;
53812
+ return /* @__PURE__ */ React178__default.default.createElement("span", {
53813
+ className
53814
+ }, label);
53815
+ };
53816
+ var Checkbox2 = ({ children, className, ...internal }) => {
53817
+ const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53818
+ const props2 = useFieldPropsV2();
53819
+ const { value: fieldValue, onChange, disabled, readOnly, hasError, options } = props2;
53820
+ const checkboxRef = React178.useRef(null);
53821
+ useFocusFieldEvent(() => {
53822
+ if (isFirst) {
53823
+ checkboxRef.current?.focus({
53824
+ preventScroll: true
53825
+ });
53764
53826
  }
53765
- }
53766
- return result2;
53767
- }
53768
- function $1e74c67db218ce67$export$f8168d8dd8fd66e6(props2) {
53769
- let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props2;
53770
- const onBlur = (React178.useCallback)((e) => {
53771
- if (($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) === e.currentTarget) {
53772
- if (onBlurProp) onBlurProp(e);
53773
- if (onFocusChange) onFocusChange(false);
53774
- return true;
53827
+ }, fieldId);
53828
+ const labelElement = findChildOfType(children, Checkbox2.Label);
53829
+ const inputElement = findChildOfType(children, Checkbox2.Input);
53830
+ const _value = React178.useMemo(() => fieldValue || [], [
53831
+ fieldValue
53832
+ ]);
53833
+ const actualValue = React178.useMemo(() => {
53834
+ if (isOther) {
53835
+ return _value.find((val) => val === label || val.startsWith(`${label}: `)) || label;
53775
53836
  }
53837
+ return value;
53776
53838
  }, [
53777
- onBlurProp,
53778
- onFocusChange
53839
+ isOther,
53840
+ _value,
53841
+ label,
53842
+ value
53779
53843
  ]);
53780
- const onSyntheticFocus = ($a92dc41f639950be$export$715c682d09d639cc)(onBlur);
53781
- const onFocus = (React178.useCallback)((e) => {
53782
- let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
53783
- const ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
53784
- const activeElement = ownerDocument ? ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument) : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
53785
- if (eventTarget === e.currentTarget && eventTarget === activeElement) {
53786
- if (onFocusProp) onFocusProp(e);
53787
- if (onFocusChange) onFocusChange(true);
53788
- onSyntheticFocus(e);
53844
+ const handleOtherCheckboxChange = React178.useCallback((isSelected) => {
53845
+ if (!isOther) {
53846
+ return;
53789
53847
  }
53848
+ const optionsValues = getOptionsValues(options || []);
53849
+ const removedOther = _value.filter((val) => optionsValues.includes(val));
53850
+ const newValue = isSelected ? [
53851
+ ...removedOther,
53852
+ label
53853
+ ] : removedOther;
53854
+ onChange?.(newValue);
53790
53855
  }, [
53791
- onFocusChange,
53792
- onFocusProp,
53793
- onSyntheticFocus
53856
+ isOther,
53857
+ label,
53858
+ onChange,
53859
+ options,
53860
+ _value
53794
53861
  ]);
53795
- return {
53796
- focusProps: {
53797
- onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0,
53798
- onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0
53799
- }
53800
- };
53801
- }
53802
- function $03e8ab2d84d7657a$export$4338b53315abf666(ref) {
53803
- const objRef = (React178.useRef)(null);
53804
- const cleanupRef = (React178.useRef)(void 0);
53805
- const refEffect = (React178.useCallback)((instance) => {
53806
- if (typeof ref === "function") {
53807
- const refCallback = ref;
53808
- const refCleanup = refCallback(instance);
53809
- return () => {
53810
- if (typeof refCleanup === "function") refCleanup();
53811
- else refCallback(null);
53812
- };
53813
- } else if (ref) {
53814
- ref.current = instance;
53815
- return () => {
53816
- ref.current = null;
53817
- };
53862
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxField, {
53863
+ value: actualValue,
53864
+ onChange: isOther ? handleOtherCheckboxChange : void 0,
53865
+ isDisabled: disabled,
53866
+ isReadOnly: readOnly,
53867
+ isInvalid: hasError
53868
+ }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.CheckboxButton, {
53869
+ ref: checkboxRef,
53870
+ className,
53871
+ "data-hook": `checkbox-${label}`
53872
+ }, ({ isSelected, isHovered, isFocused }) => /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, applyInternalProps(inputElement, {
53873
+ isSelected,
53874
+ isHovered,
53875
+ isFocused
53876
+ }), applyInternalProps(labelElement, {
53877
+ label
53878
+ }))));
53879
+ };
53880
+ Checkbox2.Label = OptionLabel;
53881
+ Checkbox2.Input = SelectionIndicator;
53882
+ var Option = ({ children, ...internal }) => {
53883
+ const { value, label, isFirst = false, isOther = false, fieldId } = internal;
53884
+ const props2 = useFieldPropsV2();
53885
+ const { value: fieldValue, onChange, options, addOtherPlaceholder, otherInputCharacterLimit, disabled, readOnly, hasError } = props2;
53886
+ const checkboxElement = findChildOfType(children, Checkbox2);
53887
+ const otherInputElement = findChildOfType(children, OtherInput);
53888
+ const _value = React178.useMemo(() => fieldValue || [], [
53889
+ fieldValue
53890
+ ]);
53891
+ const isOtherSelected = React178.useMemo(() => {
53892
+ if (!isOther) {
53893
+ return false;
53818
53894
  }
53895
+ const optionsValues = getOptionsValues(options || []);
53896
+ return getIsOtherOptionSelected(_value, optionsValues);
53819
53897
  }, [
53820
- ref
53898
+ isOther,
53899
+ _value,
53900
+ options
53821
53901
  ]);
53822
- return (React178.useMemo)(
53823
- () => ({
53824
- get current() {
53825
- return objRef.current;
53826
- },
53827
- set current(value) {
53828
- objRef.current = value;
53829
- if (cleanupRef.current) {
53830
- cleanupRef.current();
53831
- cleanupRef.current = void 0;
53832
- }
53833
- if (value != null) cleanupRef.current = refEffect(value);
53834
- }
53835
- }),
53836
- // oxlint-disable-next-line react/react-compiler
53837
- [
53838
- refEffect
53839
- ]
53840
- );
53841
- }
53842
- var $fe16bffc7a557bf0$var$useEarlyEffect = (React178__default.default)["useInsertionEffect"] ?? ($c4867b2f328c2698$export$e5c5a5f917a5871c);
53843
- function $fe16bffc7a557bf0$export$7f54fc3180508a52(fn) {
53844
- const ref = (React178.useRef)(null);
53845
- $fe16bffc7a557bf0$var$useEarlyEffect(() => {
53846
- ref.current = fn;
53902
+ return /* @__PURE__ */ React178__default.default.createElement(React178__default.default.Fragment, null, applyInternalProps(checkboxElement, {
53903
+ value,
53904
+ label,
53905
+ isFirst,
53906
+ isOther,
53907
+ fieldId
53908
+ }), isOther && isOtherSelected && applyInternalProps(otherInputElement, {
53909
+ fieldValue: _value,
53910
+ onChange,
53911
+ label,
53912
+ placeholder: addOtherPlaceholder,
53913
+ maxLength: otherInputCharacterLimit,
53914
+ disabled,
53915
+ readOnly,
53916
+ hasError,
53917
+ ariaLabel: label,
53918
+ addOtherLabel: label,
53919
+ options
53920
+ }));
53921
+ };
53922
+ var OtherInput = ({ className, inputClassName, ...internal }) => {
53923
+ const { fieldValue, onChange, label, placeholder, maxLength, disabled, readOnly, hasError, ariaLabel, addOtherLabel, options } = internal;
53924
+ const [otherValue, setOtherValue] = React178.useState(() => {
53925
+ const optionsValues = getOptionsValues(options || []);
53926
+ const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53927
+ return isSelected ? getOtherValue(fieldValue, addOtherLabel) : "";
53928
+ });
53929
+ React178.useEffect(() => {
53930
+ const optionsValues = getOptionsValues(options || []);
53931
+ const isSelected = getIsOtherOptionSelected(fieldValue, optionsValues);
53932
+ setOtherValue(isSelected ? getOtherValue(fieldValue, addOtherLabel) : "");
53847
53933
  }, [
53848
- fn
53934
+ fieldValue,
53935
+ options,
53936
+ addOtherLabel
53849
53937
  ]);
53850
- return (React178.useCallback)((...args) => {
53851
- const f = ref.current;
53852
- return f?.(...args);
53853
- }, []);
53854
- }
53855
- function $48a7d519b337145d$export$4eaf04e54aa8eed6() {
53856
- let globalListeners = (React178.useRef)(/* @__PURE__ */ new Map());
53857
- let addGlobalListener = (React178.useCallback)((eventTarget, type, listener, options) => {
53858
- let fn = options?.once ? (...args) => {
53859
- globalListeners.current.delete(listener);
53860
- listener(...args);
53861
- } : listener;
53862
- globalListeners.current.set(listener, {
53863
- type,
53864
- eventTarget,
53865
- fn,
53866
- options
53867
- });
53868
- eventTarget.addEventListener(type, fn, options);
53869
- }, []);
53870
- let removeGlobalListener = (React178.useCallback)((eventTarget, type, listener, options) => {
53871
- let fn = globalListeners.current.get(listener)?.fn || listener;
53872
- eventTarget.removeEventListener(type, fn, options);
53873
- globalListeners.current.delete(listener);
53874
- }, []);
53875
- let removeAllGlobalListeners = (React178.useCallback)(() => {
53876
- globalListeners.current.forEach((value, key) => {
53877
- removeGlobalListener(value.eventTarget, value.type, key, value.options);
53878
- });
53938
+ const debouncedHandleChange = React178.useMemo(() => {
53939
+ return r((input) => {
53940
+ const optionsValues = getOptionsValues(options || []);
53941
+ const removedOther = fieldValue.filter((val) => optionsValues.includes(val));
53942
+ const _otherValue = input ? `${addOtherLabel}: ${input}` : label;
53943
+ const newValue = [
53944
+ ...removedOther,
53945
+ _otherValue
53946
+ ];
53947
+ onChange(newValue);
53948
+ }, 500);
53879
53949
  }, [
53880
- removeGlobalListener
53950
+ onChange,
53951
+ options,
53952
+ fieldValue,
53953
+ addOtherLabel,
53954
+ label
53881
53955
  ]);
53882
- (React178.useEffect)(() => {
53883
- return removeAllGlobalListeners;
53956
+ const handleInputChange = React178.useCallback((input) => {
53957
+ setOtherValue(input);
53958
+ debouncedHandleChange(input);
53884
53959
  }, [
53885
- removeAllGlobalListeners
53960
+ debouncedHandleChange
53886
53961
  ]);
53887
- return {
53888
- addGlobalListener,
53889
- removeGlobalListener,
53890
- removeAllGlobalListeners
53891
- };
53892
- }
53893
-
53894
- // ../../node_modules/@internationalized/date/dist/private/utils.mjs
53895
- function $09ec6a572d60460f$export$842a2cf37af977e1(amount, numerator) {
53896
- return amount - numerator * Math.floor(amount / numerator);
53897
- }
53898
-
53899
- // ../../node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.mjs
53900
- var $93635573935797de$var$EPOCH = 1721426;
53901
- function $93635573935797de$export$f297eb839006d339(era, year, month, day) {
53902
- year = $93635573935797de$export$c36e0ecb2d4fa69d(era, year);
53903
- let y1 = year - 1;
53904
- let monthOffset = -2;
53905
- if (month <= 2) monthOffset = 0;
53906
- else if ($93635573935797de$export$553d7fa8e3805fc0(year)) monthOffset = -1;
53907
- return $93635573935797de$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
53908
- }
53909
- function $93635573935797de$export$553d7fa8e3805fc0(year) {
53910
- return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
53911
- }
53912
- function $93635573935797de$export$c36e0ecb2d4fa69d(era, year) {
53913
- return era === "BC" ? 1 - year : year;
53914
- }
53915
- function $93635573935797de$export$4475b7e617eb123c(year) {
53916
- let era = "AD";
53917
- if (year <= 0) {
53918
- era = "BC";
53919
- year = 1 - year;
53920
- }
53921
- return [
53922
- era,
53923
- year
53924
- ];
53925
- }
53926
- var $93635573935797de$var$daysInMonth = {
53927
- standard: [
53928
- 31,
53929
- 28,
53930
- 31,
53931
- 30,
53932
- 31,
53933
- 30,
53934
- 31,
53935
- 31,
53936
- 30,
53937
- 31,
53938
- 30,
53939
- 31
53940
- ],
53941
- leapyear: [
53942
- 31,
53943
- 29,
53944
- 31,
53945
- 30,
53946
- 31,
53947
- 30,
53948
- 31,
53949
- 31,
53950
- 30,
53951
- 31,
53952
- 30,
53953
- 31
53954
- ]
53955
- };
53956
- var $93635573935797de$export$80ee6245ec4f29ec = class {
53957
- fromJulianDay(jd) {
53958
- let jd0 = jd;
53959
- let depoch = jd0 - $93635573935797de$var$EPOCH;
53960
- let quadricent = Math.floor(depoch / 146097);
53961
- let dqc = ($09ec6a572d60460f$export$842a2cf37af977e1)(depoch, 146097);
53962
- let cent = Math.floor(dqc / 36524);
53963
- let dcent = ($09ec6a572d60460f$export$842a2cf37af977e1)(dqc, 36524);
53964
- let quad = Math.floor(dcent / 1461);
53965
- let dquad = ($09ec6a572d60460f$export$842a2cf37af977e1)(dcent, 1461);
53966
- let yindex = Math.floor(dquad / 365);
53967
- let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
53968
- let [era, year] = $93635573935797de$export$4475b7e617eb123c(extendedYear);
53969
- let yearDay = jd0 - $93635573935797de$export$f297eb839006d339(era, year, 1, 1);
53970
- let leapAdj = 2;
53971
- if (jd0 < $93635573935797de$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
53972
- else if ($93635573935797de$export$553d7fa8e3805fc0(year)) leapAdj = 1;
53973
- let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
53974
- let day = jd0 - $93635573935797de$export$f297eb839006d339(era, year, month, 1) + 1;
53975
- return new ($2aaf608024c21ca1$export$99faa760c7908e4f)(era, year, month, day);
53976
- }
53977
- toJulianDay(date) {
53978
- return $93635573935797de$export$f297eb839006d339(date.era, date.year, date.month, date.day);
53979
- }
53980
- getDaysInMonth(date) {
53981
- return $93635573935797de$var$daysInMonth[$93635573935797de$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
53982
- }
53983
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
53984
- getMonthsInYear(date) {
53985
- return 12;
53986
- }
53987
- getDaysInYear(date) {
53988
- return $93635573935797de$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
53989
- }
53990
- getMaximumMonthsInYear() {
53991
- return 12;
53992
- }
53993
- getMaximumDaysInMonth() {
53994
- return 31;
53995
- }
53996
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
53997
- getYearsInEra(date) {
53998
- return 9999;
53999
- }
54000
- getEras() {
54001
- return [
54002
- "BC",
54003
- "AD"
54004
- ];
54005
- }
54006
- isInverseEra(date) {
54007
- return date.era === "BC";
54008
- }
54009
- balanceDate(date) {
54010
- if (date.year <= 0) {
54011
- date.era = date.era === "BC" ? "AD" : "BC";
54012
- date.year = 1 - date.year;
54013
- }
54014
- }
54015
- constructor() {
54016
- this.identifier = "gregory";
54017
- }
53962
+ return /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.TextField, {
53963
+ "aria-label": ariaLabel,
53964
+ value: otherValue,
53965
+ onChange: handleInputChange,
53966
+ isDisabled: disabled,
53967
+ isReadOnly: readOnly,
53968
+ isInvalid: hasError,
53969
+ className
53970
+ }, /* @__PURE__ */ React178__default.default.createElement(reactAriaComponents.Input, {
53971
+ className: inputClassName,
53972
+ placeholder,
53973
+ maxLength,
53974
+ "aria-label": ariaLabel
53975
+ }));
54018
53976
  };
53977
+ CheckboxGroup.Label = Label;
53978
+ CheckboxGroup.Options = Options;
53979
+ Options.Option = Option;
53980
+ Option.Checkbox = Checkbox2;
53981
+ Option.OtherInput = OtherInput;
53982
+ CheckboxGroup.Description = Description;
53983
+ CheckboxGroup.Error = Error2;
54019
53984
 
54020
- // ../../node_modules/@internationalized/date/dist/private/queries.mjs
54021
- function $ad063034c8620db8$export$dbc69fd56b53d5e(a2, b) {
54022
- return a2.isEqual?.(b) ?? b.isEqual?.(a2) ?? a2.identifier === b.identifier;
54023
- }
54024
- function $ad063034c8620db8$export$68781ddf31c0090f(a2, b) {
54025
- return a2.calendar.toJulianDay(a2) - b.calendar.toJulianDay(b);
54026
- }
54027
- function $ad063034c8620db8$export$c19a80a9721b80f6(a2, b) {
54028
- return $ad063034c8620db8$var$timeToMs(a2) - $ad063034c8620db8$var$timeToMs(b);
54029
- }
54030
- function $ad063034c8620db8$var$timeToMs(a2) {
54031
- return a2.hour * 36e5 + a2.minute * 6e4 + a2.second * 1e3 + a2.millisecond;
54032
- }
54033
- var $ad063034c8620db8$var$localTimeZone = null;
54034
- var $ad063034c8620db8$var$localTimeZoneOverride = false;
54035
- function $ad063034c8620db8$export$aa8b41735afcabd2() {
54036
- if ($ad063034c8620db8$var$localTimeZone == null) $ad063034c8620db8$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
54037
- return $ad063034c8620db8$var$localTimeZone;
54038
- }
54039
- function $ad063034c8620db8$export$6ab69b273755230b() {
54040
- return $ad063034c8620db8$var$localTimeZoneOverride;
54041
- }
54042
-
54043
- // ../../node_modules/@internationalized/date/dist/private/conversion.mjs
54044
- function $d07e34cce18680fd$export$bd4fb2bc8bb06fb(date) {
54045
- date = $d07e34cce18680fd$export$b4a036af3fc0b032(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
54046
- let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(date.era, date.year);
54047
- return $d07e34cce18680fd$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
54048
- }
54049
- function $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
54050
- let date = /* @__PURE__ */ new Date();
54051
- date.setUTCHours(hour, minute, second, millisecond);
54052
- date.setUTCFullYear(year, month - 1, day);
54053
- return date.getTime();
54054
- }
54055
- function $d07e34cce18680fd$export$59c99f3515d3493f(ms, timeZone) {
54056
- if (timeZone === "UTC") return 0;
54057
- if (ms > 0 && timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && !($ad063034c8620db8$export$6ab69b273755230b)()) return new Date(ms).getTimezoneOffset() * -6e4;
54058
- let { year, month, day, hour, minute, second } = $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone);
54059
- let utc2 = $d07e34cce18680fd$var$epochFromParts(year, month, day, hour, minute, second, 0);
54060
- return utc2 - Math.floor(ms / 1e3) * 1e3;
54061
- }
54062
- var $d07e34cce18680fd$var$formattersByTimeZone = /* @__PURE__ */ new Map();
54063
- function $d07e34cce18680fd$var$getTimeZoneParts(ms, timeZone) {
54064
- let formatter = $d07e34cce18680fd$var$formattersByTimeZone.get(timeZone);
54065
- if (!formatter) {
54066
- formatter = new Intl.DateTimeFormat("en-US", {
54067
- timeZone,
54068
- hour12: false,
54069
- era: "short",
54070
- year: "numeric",
54071
- month: "numeric",
54072
- day: "numeric",
54073
- hour: "numeric",
54074
- minute: "numeric",
54075
- second: "numeric"
54076
- });
54077
- $d07e34cce18680fd$var$formattersByTimeZone.set(timeZone, formatter);
54078
- }
54079
- let parts = formatter.formatToParts(new Date(ms));
54080
- let namedParts = {};
54081
- for (let part of parts) if (part.type !== "literal") namedParts[part.type] = part.value;
54082
- return {
54083
- // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
54084
- year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
54085
- month: +namedParts.month,
54086
- day: +namedParts.day,
54087
- hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
54088
- minute: +namedParts.minute,
54089
- second: +namedParts.second
54090
- };
54091
- }
54092
- var $d07e34cce18680fd$var$DAYMILLIS = 864e5;
54093
- function $d07e34cce18680fd$var$getValidWallTimes(date, timeZone, earlier, later) {
54094
- let found = earlier === later ? [
54095
- earlier
54096
- ] : [
54097
- earlier,
54098
- later
54099
- ];
54100
- return found.filter((absolute) => $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute));
54101
- }
54102
- function $d07e34cce18680fd$var$isValidWallTime(date, timeZone, absolute) {
54103
- let parts = $d07e34cce18680fd$var$getTimeZoneParts(absolute, timeZone);
54104
- return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
54105
- }
54106
- function $d07e34cce18680fd$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
54107
- let dateTime = $d07e34cce18680fd$export$b21e0b124e224484(date);
54108
- if (timeZone === "UTC") return $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
54109
- if (timeZone === ($ad063034c8620db8$export$aa8b41735afcabd2)() && disambiguation === "compatible" && !($ad063034c8620db8$export$6ab69b273755230b)()) {
54110
- dateTime = $d07e34cce18680fd$export$b4a036af3fc0b032(dateTime, new ($93635573935797de$export$80ee6245ec4f29ec)());
54111
- let date2 = /* @__PURE__ */ new Date();
54112
- let year = ($93635573935797de$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
54113
- date2.setFullYear(year, dateTime.month - 1, dateTime.day);
54114
- date2.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
54115
- return date2.getTime();
54116
- }
54117
- let ms = $d07e34cce18680fd$export$bd4fb2bc8bb06fb(dateTime);
54118
- let offsetBefore = $d07e34cce18680fd$export$59c99f3515d3493f(ms - $d07e34cce18680fd$var$DAYMILLIS, timeZone);
54119
- let offsetAfter = $d07e34cce18680fd$export$59c99f3515d3493f(ms + $d07e34cce18680fd$var$DAYMILLIS, timeZone);
54120
- let valid = $d07e34cce18680fd$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
54121
- if (valid.length === 1) return valid[0];
54122
- if (valid.length > 1) switch (disambiguation) {
54123
- // 'compatible' means 'earlier' for "fall back" transitions
54124
- case "compatible":
54125
- case "earlier":
54126
- return valid[0];
54127
- case "later":
54128
- return valid[valid.length - 1];
54129
- case "reject":
54130
- throw new RangeError("Multiple possible absolute times found");
54131
- }
54132
- switch (disambiguation) {
54133
- case "earlier":
54134
- return Math.min(ms - offsetBefore, ms - offsetAfter);
54135
- // 'compatible' means 'later' for "spring forward" transitions
54136
- case "compatible":
54137
- case "later":
54138
- return Math.max(ms - offsetBefore, ms - offsetAfter);
54139
- case "reject":
54140
- throw new RangeError("No such absolute time found");
54141
- }
54142
- }
54143
- function $d07e34cce18680fd$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
54144
- return new Date($d07e34cce18680fd$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
54145
- }
54146
- function $d07e34cce18680fd$export$b21e0b124e224484(date, time) {
54147
- let hour = 0, minute = 0, second = 0, millisecond = 0;
54148
- if ("timeZone" in date) ({ hour, minute, second, millisecond } = date);
54149
- else if ("hour" in date && !time) return date;
54150
- if (time) ({ hour, minute, second, millisecond } = time);
54151
- return new ($2aaf608024c21ca1$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
54152
- }
54153
- function $d07e34cce18680fd$export$b4a036af3fc0b032(date, calendar) {
54154
- if (($ad063034c8620db8$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;
54155
- let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
54156
- let copy = date.copy();
54157
- copy.calendar = calendar;
54158
- copy.era = calendarDate.era;
54159
- copy.year = calendarDate.year;
54160
- copy.month = calendarDate.month;
54161
- copy.day = calendarDate.day;
54162
- ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(copy);
54163
- return copy;
54164
- }
54165
-
54166
- // ../../node_modules/@internationalized/date/dist/private/manipulation.mjs
54167
- function $435a2ceaa8778ed8$export$e16d8520af44a096(date, duration) {
54168
- let mutableDate = date.copy();
54169
- let days = "hour" in mutableDate ? $435a2ceaa8778ed8$var$addTimeFields(mutableDate, duration) : 0;
54170
- $435a2ceaa8778ed8$var$addYears(mutableDate, duration.years || 0);
54171
- if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
54172
- mutableDate.month += duration.months || 0;
54173
- $435a2ceaa8778ed8$var$balanceYearMonth(mutableDate);
54174
- $435a2ceaa8778ed8$var$constrainMonthDay(mutableDate);
54175
- mutableDate.day += (duration.weeks || 0) * 7;
54176
- mutableDate.day += duration.days || 0;
54177
- mutableDate.day += days;
54178
- $435a2ceaa8778ed8$var$balanceDay(mutableDate);
54179
- if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
54180
- if (mutableDate.year < 1) {
54181
- mutableDate.year = 1;
54182
- mutableDate.month = 1;
54183
- mutableDate.day = 1;
54184
- }
54185
- let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
54186
- if (mutableDate.year > maxYear) {
54187
- let isInverseEra = mutableDate.calendar.isInverseEra?.(mutableDate);
54188
- mutableDate.year = maxYear;
54189
- mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
54190
- mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
54191
- }
54192
- if (mutableDate.month < 1) {
54193
- mutableDate.month = 1;
54194
- mutableDate.day = 1;
54195
- }
54196
- let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
54197
- if (mutableDate.month > maxMonth) {
54198
- mutableDate.month = maxMonth;
54199
- mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
53985
+ // ../../node_modules/react-aria/dist/private/utils/focusWithoutScrolling.mjs
53986
+ function $1969ac565cfec8d0$export$de79e2c695e052f3(element) {
53987
+ if ($1969ac565cfec8d0$var$supportsPreventScroll()) element.focus({
53988
+ preventScroll: true
53989
+ });
53990
+ else {
53991
+ let scrollableElements = $1969ac565cfec8d0$var$getScrollableElements(element);
53992
+ element.focus();
53993
+ $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements);
54200
53994
  }
54201
- mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
54202
- return mutableDate;
54203
- }
54204
- function $435a2ceaa8778ed8$var$addYears(date, years) {
54205
- if (date.calendar.isInverseEra?.(date)) years = -years;
54206
- date.year += years;
54207
53995
  }
54208
- function $435a2ceaa8778ed8$var$balanceYearMonth(date) {
54209
- while (date.month < 1) {
54210
- $435a2ceaa8778ed8$var$addYears(date, -1);
54211
- date.month += date.calendar.getMonthsInYear(date);
54212
- }
54213
- let monthsInYear = 0;
54214
- while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) {
54215
- date.month -= monthsInYear;
54216
- $435a2ceaa8778ed8$var$addYears(date, 1);
53996
+ var $1969ac565cfec8d0$var$supportsPreventScrollCached = null;
53997
+ function $1969ac565cfec8d0$var$supportsPreventScroll() {
53998
+ if ($1969ac565cfec8d0$var$supportsPreventScrollCached == null) {
53999
+ $1969ac565cfec8d0$var$supportsPreventScrollCached = false;
54000
+ try {
54001
+ let focusElem = document.createElement("div");
54002
+ focusElem.focus({
54003
+ get preventScroll() {
54004
+ $1969ac565cfec8d0$var$supportsPreventScrollCached = true;
54005
+ return true;
54006
+ }
54007
+ });
54008
+ } catch {
54009
+ }
54217
54010
  }
54011
+ return $1969ac565cfec8d0$var$supportsPreventScrollCached;
54218
54012
  }
54219
- function $435a2ceaa8778ed8$var$balanceDay(date) {
54220
- while (date.day < 1) {
54221
- date.month--;
54222
- $435a2ceaa8778ed8$var$balanceYearMonth(date);
54223
- date.day += date.calendar.getDaysInMonth(date);
54224
- }
54225
- while (date.day > date.calendar.getDaysInMonth(date)) {
54226
- date.day -= date.calendar.getDaysInMonth(date);
54227
- date.month++;
54228
- $435a2ceaa8778ed8$var$balanceYearMonth(date);
54013
+ function $1969ac565cfec8d0$var$getScrollableElements(element) {
54014
+ let parent = element.parentNode;
54015
+ let scrollableElements = [];
54016
+ let rootScrollingElement = document.scrollingElement || document.documentElement;
54017
+ while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
54018
+ if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
54019
+ element: parent,
54020
+ scrollTop: parent.scrollTop,
54021
+ scrollLeft: parent.scrollLeft
54022
+ });
54023
+ parent = parent.parentNode;
54229
54024
  }
54025
+ if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
54026
+ element: rootScrollingElement,
54027
+ scrollTop: rootScrollingElement.scrollTop,
54028
+ scrollLeft: rootScrollingElement.scrollLeft
54029
+ });
54030
+ return scrollableElements;
54230
54031
  }
54231
- function $435a2ceaa8778ed8$var$constrainMonthDay(date) {
54232
- date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
54233
- date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
54234
- }
54235
- function $435a2ceaa8778ed8$export$c4e2ecac49351ef2(date) {
54236
- if (date.calendar.constrainDate) date.calendar.constrainDate(date);
54237
- date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
54238
- $435a2ceaa8778ed8$var$constrainMonthDay(date);
54239
- }
54240
- function $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration) {
54241
- let inverseDuration = {};
54242
- for (let key in duration) if (typeof duration[key] === "number") inverseDuration[key] = -duration[key];
54243
- return inverseDuration;
54244
- }
54245
- function $435a2ceaa8778ed8$export$4e2d2ead65e5f7e3(date, duration) {
54246
- return $435a2ceaa8778ed8$export$e16d8520af44a096(date, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
54032
+ function $1969ac565cfec8d0$var$restoreScrollPosition(scrollableElements) {
54033
+ for (let { element, scrollTop, scrollLeft } of scrollableElements) {
54034
+ element.scrollTop = scrollTop;
54035
+ element.scrollLeft = scrollLeft;
54036
+ }
54247
54037
  }
54248
- function $435a2ceaa8778ed8$export$adaa4cf7ef1b65be(date, fields) {
54249
- let mutableDate = date.copy();
54250
- if (fields.era != null) mutableDate.era = fields.era;
54251
- if (fields.year != null) mutableDate.year = fields.year;
54252
- if (fields.month != null) mutableDate.month = fields.month;
54253
- if (fields.day != null) mutableDate.day = fields.day;
54254
- $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutableDate);
54255
- return mutableDate;
54038
+
54039
+ // ../../node_modules/react-aria/dist/private/utils/domHelpers.mjs
54040
+ var $d447af545b77c9f1$export$b204af158042fbac = (target) => {
54041
+ if ($d447af545b77c9f1$var$isWindow(target)) return target.document;
54042
+ if ($d447af545b77c9f1$export$62858bae88b53fd0(target)) return target;
54043
+ return target?.ownerDocument ?? (typeof document !== "undefined" ? document : void 0);
54044
+ };
54045
+ var $d447af545b77c9f1$export$f21a1ffae260145a = (target) => {
54046
+ let ownerDocument = $d447af545b77c9f1$export$b204af158042fbac(target);
54047
+ return ownerDocument?.defaultView ?? (typeof window !== "undefined" ? window : void 0);
54048
+ };
54049
+ function $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) {
54050
+ return value !== null && typeof value === "object" && "nodeType" in value && typeof value.nodeType === "number";
54256
54051
  }
54257
- function $435a2ceaa8778ed8$export$e5d5e1c1822b6e56(value, fields) {
54258
- let mutableValue = value.copy();
54259
- if (fields.hour != null) mutableValue.hour = fields.hour;
54260
- if (fields.minute != null) mutableValue.minute = fields.minute;
54261
- if (fields.second != null) mutableValue.second = fields.second;
54262
- if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
54263
- $435a2ceaa8778ed8$export$7555de1e070510cb(mutableValue);
54264
- return mutableValue;
54052
+ function $d447af545b77c9f1$var$isWindow(value) {
54053
+ return typeof value === "object" && value != null && "window" in value && value.window === value;
54265
54054
  }
54266
- function $435a2ceaa8778ed8$var$balanceTime(time) {
54267
- time.second += Math.floor(time.millisecond / 1e3);
54268
- time.millisecond = $435a2ceaa8778ed8$var$nonNegativeMod(time.millisecond, 1e3);
54269
- time.minute += Math.floor(time.second / 60);
54270
- time.second = $435a2ceaa8778ed8$var$nonNegativeMod(time.second, 60);
54271
- time.hour += Math.floor(time.minute / 60);
54272
- time.minute = $435a2ceaa8778ed8$var$nonNegativeMod(time.minute, 60);
54273
- let days = Math.floor(time.hour / 24);
54274
- time.hour = $435a2ceaa8778ed8$var$nonNegativeMod(time.hour, 24);
54275
- return days;
54055
+ function $d447af545b77c9f1$export$62858bae88b53fd0(value) {
54056
+ return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 9;
54276
54057
  }
54277
- function $435a2ceaa8778ed8$export$7555de1e070510cb(time) {
54278
- time.millisecond = Math.max(0, Math.min(time.millisecond, 999));
54279
- time.second = Math.max(0, Math.min(time.second, 59));
54280
- time.minute = Math.max(0, Math.min(time.minute, 59));
54281
- time.hour = Math.max(0, Math.min(time.hour, 23));
54058
+ function $d447af545b77c9f1$export$af51f0f06c0f328a(value) {
54059
+ return $d447af545b77c9f1$export$8ee0fc9ee280b4ee(value) && value.nodeType === 11 && "host" in value;
54282
54060
  }
54283
- function $435a2ceaa8778ed8$var$nonNegativeMod(a2, b) {
54284
- let result2 = a2 % b;
54285
- if (result2 < 0) result2 += b;
54286
- return result2;
54061
+
54062
+ // ../../node_modules/react-stately/dist/private/flags/flags.mjs
54063
+ var $6a20a7989e6c817a$var$_shadowDOM = false;
54064
+ function $6a20a7989e6c817a$export$98658e8c59125e6a() {
54065
+ return $6a20a7989e6c817a$var$_shadowDOM;
54287
54066
  }
54288
- function $435a2ceaa8778ed8$var$addTimeFields(time, duration) {
54289
- time.hour += duration.hours || 0;
54290
- time.minute += duration.minutes || 0;
54291
- time.second += duration.seconds || 0;
54292
- time.millisecond += duration.milliseconds || 0;
54293
- return $435a2ceaa8778ed8$var$balanceTime(time);
54067
+
54068
+ // ../../node_modules/react-aria/dist/private/utils/shadowdom/DOMFunctions.mjs
54069
+ function $23f2114a1b82827e$export$4282f70798064fe0(node, otherNode) {
54070
+ if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return otherNode && node ? node.contains(otherNode) : false;
54071
+ if (!node || !otherNode) return false;
54072
+ let currentNode = otherNode;
54073
+ while (currentNode !== null) {
54074
+ if (currentNode === node) return true;
54075
+ if (typeof currentNode.assignedElements !== "function" && currentNode.assignedSlot?.parentNode)
54076
+ currentNode = currentNode.assignedSlot.parentNode;
54077
+ else if (($d447af545b77c9f1$export$af51f0f06c0f328a)(currentNode))
54078
+ currentNode = currentNode.host;
54079
+ else currentNode = currentNode.parentNode;
54080
+ }
54081
+ return false;
54294
54082
  }
54295
- function $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, duration) {
54296
- let res = time.copy();
54297
- $435a2ceaa8778ed8$var$addTimeFields(res, duration);
54298
- return res;
54083
+ var $23f2114a1b82827e$export$cd4e5573fbe2b576 = (doc = document) => {
54084
+ if (!($6a20a7989e6c817a$export$98658e8c59125e6a)()) return doc.activeElement;
54085
+ let activeElement = doc.activeElement;
54086
+ while (activeElement && "shadowRoot" in activeElement && activeElement.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot.activeElement;
54087
+ return activeElement;
54088
+ };
54089
+ function $23f2114a1b82827e$export$e58f029f0fbfdb29(event) {
54090
+ if (($6a20a7989e6c817a$export$98658e8c59125e6a)() && event.target instanceof Element && event.target.shadowRoot) {
54091
+ if ("composedPath" in event) return event.composedPath()[0] ?? null;
54092
+ else if ("composedPath" in event.nativeEvent) return event.nativeEvent.composedPath()[0] ?? null;
54093
+ }
54094
+ return event.target;
54299
54095
  }
54300
- function $435a2ceaa8778ed8$export$fe34d3a381cd7501(time, duration) {
54301
- return $435a2ceaa8778ed8$export$7ed87b6bc2506470(time, $435a2ceaa8778ed8$export$3e2544e88a25bff8(duration));
54096
+ var $c4867b2f328c2698$export$e5c5a5f917a5871c = typeof document !== "undefined" ? (React178__default.default).useLayoutEffect : () => {
54097
+ };
54098
+ function $a92dc41f639950be$export$525bc4921d56d4a(nativeEvent) {
54099
+ let event = nativeEvent;
54100
+ event.nativeEvent = nativeEvent;
54101
+ event.isDefaultPrevented = () => event.defaultPrevented;
54102
+ event.isPropagationStopped = () => event.cancelBubble;
54103
+ event.persist = () => {
54104
+ };
54105
+ return event;
54302
54106
  }
54303
- function $435a2ceaa8778ed8$export$d52ced6badfb9a4c(value, field, amount, options) {
54304
- let mutable = value.copy();
54305
- switch (field) {
54306
- case "era": {
54307
- let eras = value.calendar.getEras();
54308
- let eraIndex = eras.indexOf(value.era);
54309
- if (eraIndex < 0) throw new Error("Invalid era: " + value.era);
54310
- eraIndex = $435a2ceaa8778ed8$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options?.round);
54311
- mutable.era = eras[eraIndex];
54312
- $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
54313
- break;
54314
- }
54315
- case "year":
54316
- if (mutable.calendar.isInverseEra?.(mutable)) amount = -amount;
54317
- mutable.year = $435a2ceaa8778ed8$var$cycleValue(value.year, amount, -Infinity, 9999, options?.round);
54318
- if (mutable.year === -Infinity) mutable.year = 1;
54319
- if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
54320
- break;
54321
- case "month":
54322
- mutable.month = $435a2ceaa8778ed8$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options?.round);
54323
- break;
54324
- case "day":
54325
- mutable.day = $435a2ceaa8778ed8$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options?.round);
54326
- break;
54327
- default:
54328
- throw new Error("Unsupported field " + field);
54329
- }
54330
- if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
54331
- $435a2ceaa8778ed8$export$c4e2ecac49351ef2(mutable);
54332
- return mutable;
54107
+ function $a92dc41f639950be$export$c2b7abe5d61ec696(event, target) {
54108
+ Object.defineProperty(event, "target", {
54109
+ value: target
54110
+ });
54111
+ Object.defineProperty(event, "currentTarget", {
54112
+ value: target
54113
+ });
54333
54114
  }
54334
- function $435a2ceaa8778ed8$export$dd02b3e0007dfe28(value, field, amount, options) {
54335
- let mutable = value.copy();
54336
- switch (field) {
54337
- case "hour": {
54338
- let hours = value.hour;
54339
- let min4 = 0;
54340
- let max4 = 23;
54341
- if (options?.hourCycle === 12) {
54342
- let isPM = hours >= 12;
54343
- min4 = isPM ? 12 : 0;
54344
- max4 = isPM ? 23 : 11;
54115
+ function $a92dc41f639950be$export$715c682d09d639cc(onBlur) {
54116
+ let stateRef = (React178.useRef)({
54117
+ isFocused: false,
54118
+ observer: null
54119
+ });
54120
+ ($c4867b2f328c2698$export$e5c5a5f917a5871c)(() => {
54121
+ const state = stateRef.current;
54122
+ return () => {
54123
+ if (state.observer) {
54124
+ state.observer.disconnect();
54125
+ state.observer = null;
54345
54126
  }
54346
- mutable.hour = $435a2ceaa8778ed8$var$cycleValue(hours, amount, min4, max4, options?.round);
54347
- break;
54127
+ };
54128
+ }, []);
54129
+ return (React178.useCallback)((e) => {
54130
+ let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
54131
+ if (eventTarget instanceof HTMLButtonElement || eventTarget instanceof HTMLInputElement || eventTarget instanceof HTMLTextAreaElement || eventTarget instanceof HTMLSelectElement) {
54132
+ stateRef.current.isFocused = true;
54133
+ let target = eventTarget;
54134
+ let onBlurHandler = (e2) => {
54135
+ stateRef.current.isFocused = false;
54136
+ if (target.disabled) {
54137
+ let event = $a92dc41f639950be$export$525bc4921d56d4a(e2);
54138
+ onBlur?.(event);
54139
+ }
54140
+ if (stateRef.current.observer) {
54141
+ stateRef.current.observer.disconnect();
54142
+ stateRef.current.observer = null;
54143
+ }
54144
+ };
54145
+ target.addEventListener("focusout", onBlurHandler, {
54146
+ once: true
54147
+ });
54148
+ stateRef.current.observer = new MutationObserver(() => {
54149
+ if (stateRef.current.isFocused && target.disabled) {
54150
+ stateRef.current.observer?.disconnect();
54151
+ let relatedTargetEl = target === ($23f2114a1b82827e$export$cd4e5573fbe2b576)() ? null : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
54152
+ target.dispatchEvent(new FocusEvent("blur", {
54153
+ relatedTarget: relatedTargetEl
54154
+ }));
54155
+ target.dispatchEvent(new FocusEvent("focusout", {
54156
+ bubbles: true,
54157
+ relatedTarget: relatedTargetEl
54158
+ }));
54159
+ }
54160
+ });
54161
+ stateRef.current.observer.observe(target, {
54162
+ attributes: true,
54163
+ attributeFilter: [
54164
+ "disabled"
54165
+ ]
54166
+ });
54348
54167
  }
54349
- case "minute":
54350
- mutable.minute = $435a2ceaa8778ed8$var$cycleValue(value.minute, amount, 0, 59, options?.round);
54351
- break;
54352
- case "second":
54353
- mutable.second = $435a2ceaa8778ed8$var$cycleValue(value.second, amount, 0, 59, options?.round);
54354
- break;
54355
- case "millisecond":
54356
- mutable.millisecond = $435a2ceaa8778ed8$var$cycleValue(value.millisecond, amount, 0, 999, options?.round);
54357
- break;
54358
- default:
54359
- throw new Error("Unsupported field " + field);
54360
- }
54361
- return mutable;
54362
- }
54363
- function $435a2ceaa8778ed8$var$cycleValue(value, amount, min4, max4, round = false) {
54364
- if (round) {
54365
- value += Math.sign(amount);
54366
- if (value < min4) value = max4;
54367
- let div = Math.abs(amount);
54368
- if (amount > 0) value = Math.ceil(value / div) * div;
54369
- else value = Math.floor(value / div) * div;
54370
- if (value > max4) value = min4;
54371
- } else {
54372
- value += amount;
54373
- if (value < min4) value = max4 - (min4 - value - 1);
54374
- else if (value > max4) value = min4 + (value - max4 - 1);
54375
- }
54376
- return value;
54168
+ }, [
54169
+ onBlur
54170
+ ]);
54377
54171
  }
54378
54172
 
54379
- // ../../node_modules/@internationalized/date/dist/private/string.mjs
54380
- var $58246871e4652552$var$TIME_RE = /^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/;
54381
- var $58246871e4652552$var$DATE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
54382
- var $58246871e4652552$var$ABSOLUTE_RE = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
54383
- function $58246871e4652552$export$c9698ec7f05a07e1(value) {
54384
- let m = value.match($58246871e4652552$var$TIME_RE);
54385
- if (!m) throw new Error("Invalid ISO 8601 time string: " + value);
54386
- return new ($2aaf608024c21ca1$export$680ea196effce5f)($58246871e4652552$var$parseNumber(m[1], 0, 23), m[2] ? $58246871e4652552$var$parseNumber(m[2], 0, 59) : 0, m[3] ? $58246871e4652552$var$parseNumber(m[3], 0, 59) : 0, m[4] ? $58246871e4652552$var$parseNumber(m[4], 0, Infinity) * 1e3 : 0);
54387
- }
54388
- function $58246871e4652552$export$6b862160d295c8e(value) {
54389
- let m = value.match($58246871e4652552$var$DATE_RE);
54390
- if (!m) {
54391
- if ($58246871e4652552$var$ABSOLUTE_RE.test(value)) throw new Error(`Invalid ISO 8601 date string: ${value}. Use parseAbsolute() instead.`);
54392
- throw new Error("Invalid ISO 8601 date string: " + value);
54393
- }
54394
- let date = new ($2aaf608024c21ca1$export$99faa760c7908e4f)($58246871e4652552$var$parseNumber(m[1], 0, 9999), $58246871e4652552$var$parseNumber(m[2], 1, 12), 1);
54395
- date.day = $58246871e4652552$var$parseNumber(m[3], 1, date.calendar.getDaysInMonth(date));
54396
- return date;
54397
- }
54398
- function $58246871e4652552$var$parseNumber(value, min4, max4) {
54399
- let val = Number(value);
54400
- if (val < min4 || val > max4) throw new RangeError(`Value out of range: ${min4} <= ${val} <= ${max4}`);
54401
- return val;
54402
- }
54403
- function $58246871e4652552$export$f59dee82248f5ad4(time) {
54404
- return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`;
54405
- }
54406
- function $58246871e4652552$export$60dfd74aa96791bd(date) {
54407
- let gregorianDate = ($d07e34cce18680fd$export$b4a036af3fc0b032)(date, new ($93635573935797de$export$80ee6245ec4f29ec)());
54408
- let year;
54409
- if (gregorianDate.era === "BC") year = gregorianDate.year === 1 ? "0000" : "-" + String(Math.abs(1 - gregorianDate.year)).padStart(6, "00");
54410
- else year = String(gregorianDate.year).padStart(4, "0");
54411
- return `${year}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
54173
+ // ../../node_modules/react-aria/dist/private/utils/platform.mjs
54174
+ function $2add3ce32c6007eb$var$testUserAgent(re) {
54175
+ if (typeof window === "undefined" || window.navigator == null) return false;
54176
+ let brands = window.navigator["userAgentData"]?.brands;
54177
+ return Array.isArray(brands) && brands.some((brand) => re.test(brand.brand)) || re.test(window.navigator.userAgent);
54412
54178
  }
54413
- function $58246871e4652552$export$4223de14708adc63(date) {
54414
- return `${$58246871e4652552$export$60dfd74aa96791bd(date)}T${$58246871e4652552$export$f59dee82248f5ad4(date)}`;
54179
+ function $2add3ce32c6007eb$var$testPlatform(re) {
54180
+ return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator["userAgentData"]?.platform || window.navigator.platform) : false;
54415
54181
  }
54416
-
54417
- // ../../node_modules/@internationalized/date/dist/private/CalendarDate.mjs
54418
- function $2aaf608024c21ca1$var$shiftArgs(args) {
54419
- let calendar = typeof args[0] === "object" ? args.shift() : new ($93635573935797de$export$80ee6245ec4f29ec)();
54420
- let era;
54421
- if (typeof args[0] === "string") era = args.shift();
54422
- else {
54423
- let eras = calendar.getEras();
54424
- era = eras[eras.length - 1];
54425
- }
54426
- let year = args.shift();
54427
- let month = args.shift();
54428
- let day = args.shift();
54429
- return [
54430
- calendar,
54431
- era,
54432
- year,
54433
- month,
54434
- day
54435
- ];
54182
+ function $2add3ce32c6007eb$var$cached(fn) {
54183
+ let res = null;
54184
+ return () => {
54185
+ if (res == null) res = fn();
54186
+ return res;
54187
+ };
54436
54188
  }
54437
- var _type;
54438
- var _$2aaf608024c21ca1$export$99faa760c7908e4f = class _$2aaf608024c21ca1$export$99faa760c7908e4f {
54439
- constructor(...args) {
54440
- // This prevents TypeScript from allowing other types with the same fields to match.
54441
- // i.e. a ZonedDateTime should not be be passable to a parameter that expects CalendarDate.
54442
- // If that behavior is desired, use the AnyCalendarDate interface instead.
54443
- // @ts-ignore
54444
- __privateAdd(this, _type);
54445
- let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
54446
- this.calendar = calendar;
54447
- this.era = era;
54448
- this.year = year;
54449
- this.month = month;
54450
- this.day = day;
54451
- ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
54452
- }
54453
- /** Returns a copy of this date. */
54454
- copy() {
54455
- if (this.era) return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
54456
- else return new _$2aaf608024c21ca1$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
54457
- }
54458
- /** Returns a new `CalendarDate` with the given duration added to it. */
54459
- add(duration) {
54460
- return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
54461
- }
54462
- /** Returns a new `CalendarDate` with the given duration subtracted from it. */
54463
- subtract(duration) {
54464
- return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
54465
- }
54466
- /**
54467
- * Returns a new `CalendarDate` with the given fields set to the provided values. Other fields
54468
- * will be constrained accordingly.
54469
- */
54470
- set(fields) {
54471
- return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(this, fields);
54472
- }
54473
- /**
54474
- * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
54475
- * When the resulting value reaches the limits of the field, it wraps around.
54476
- */
54477
- cycle(field, amount, options) {
54478
- return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
54479
- }
54480
- /**
54481
- * Converts the date to a native JavaScript Date object, with the time set to midnight in the
54482
- * given time zone.
54483
- */
54484
- toDate(timeZone) {
54485
- return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone);
54486
- }
54487
- /** Converts the date to an ISO 8601 formatted string. */
54488
- toString() {
54489
- return ($58246871e4652552$export$60dfd74aa96791bd)(this);
54490
- }
54491
- /**
54492
- * Compares this date with another. A negative result indicates that this date is before the given
54493
- * one, and a positive date indicates that it is after.
54494
- */
54495
- compare(b) {
54496
- return ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
54189
+ var $2add3ce32c6007eb$export$9ac100e40613ea10 = $2add3ce32c6007eb$var$cached(function() {
54190
+ return $2add3ce32c6007eb$var$testPlatform(/^Mac/i);
54191
+ });
54192
+ var $2add3ce32c6007eb$export$186c6964ca17d99 = $2add3ce32c6007eb$var$cached(function() {
54193
+ return $2add3ce32c6007eb$var$testPlatform(/^iPhone/i);
54194
+ });
54195
+ var $2add3ce32c6007eb$export$7bef049ce92e4224 = $2add3ce32c6007eb$var$cached(function() {
54196
+ return $2add3ce32c6007eb$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
54197
+ $2add3ce32c6007eb$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
54198
+ });
54199
+ var $2add3ce32c6007eb$export$fedb369cb70207f1 = $2add3ce32c6007eb$var$cached(function() {
54200
+ return $2add3ce32c6007eb$export$186c6964ca17d99() || $2add3ce32c6007eb$export$7bef049ce92e4224();
54201
+ });
54202
+ var $2add3ce32c6007eb$export$78551043582a6a98 = $2add3ce32c6007eb$var$cached(function() {
54203
+ return $2add3ce32c6007eb$var$testUserAgent(/AppleWebKit/i) && ($2add3ce32c6007eb$export$fedb369cb70207f1() || !$2add3ce32c6007eb$export$6446a186d09e379e());
54204
+ });
54205
+ var $2add3ce32c6007eb$export$6446a186d09e379e = $2add3ce32c6007eb$var$cached(function() {
54206
+ return $2add3ce32c6007eb$var$testUserAgent(/Chrome|CriOS|CrMo/i);
54207
+ });
54208
+ var $2add3ce32c6007eb$export$a11b0059900ceec8 = $2add3ce32c6007eb$var$cached(function() {
54209
+ return $2add3ce32c6007eb$var$testUserAgent(/Android/i);
54210
+ });
54211
+ var $2add3ce32c6007eb$export$b7d78993b74f766d = $2add3ce32c6007eb$var$cached(function() {
54212
+ return $2add3ce32c6007eb$var$testUserAgent(/(Firefox|FxiOS)/i);
54213
+ });
54214
+
54215
+ // ../../node_modules/react-aria/dist/private/utils/isVirtualEvent.mjs
54216
+ function $b5c62b033c25b96d$export$60278871457622de(event) {
54217
+ if (event.pointerType === "" && event.isTrusted) return true;
54218
+ if (($2add3ce32c6007eb$export$a11b0059900ceec8)() && event.pointerType) return event.type === "click" && event.buttons === 1;
54219
+ return event.detail === 0 && !event.pointerType;
54220
+ }
54221
+ function $caaf0dd3060ed57c$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
54222
+ let { metaKey, ctrlKey, altKey, shiftKey } = modifiers;
54223
+ if (!($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$b7d78993b74f766d)() && window.event?.type?.startsWith("key") && target.target === "_blank") {
54224
+ if (($2add3ce32c6007eb$export$9ac100e40613ea10)()) metaKey = true;
54225
+ else ctrlKey = true;
54497
54226
  }
54227
+ let event = ($2add3ce32c6007eb$export$78551043582a6a98)() && ($2add3ce32c6007eb$export$9ac100e40613ea10)() && !($2add3ce32c6007eb$export$7bef049ce92e4224)() && true ? new KeyboardEvent("keydown", {
54228
+ keyIdentifier: "Enter",
54229
+ metaKey,
54230
+ ctrlKey,
54231
+ altKey,
54232
+ shiftKey
54233
+ }) : new MouseEvent("click", {
54234
+ metaKey,
54235
+ ctrlKey,
54236
+ altKey,
54237
+ shiftKey,
54238
+ detail: 1,
54239
+ bubbles: true,
54240
+ cancelable: true
54241
+ });
54242
+ $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = setOpening;
54243
+ ($1969ac565cfec8d0$export$de79e2c695e052f3)(target);
54244
+ target.dispatchEvent(event);
54245
+ $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
54246
+ }
54247
+ $caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening = false;
54248
+ var $8f5a2122b0992be3$var$currentModality = null;
54249
+ var $8f5a2122b0992be3$export$901e90a13c50a14e = /* @__PURE__ */ new Set();
54250
+ var $8f5a2122b0992be3$export$d90243b58daecda7 = /* @__PURE__ */ new Map();
54251
+ var $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
54252
+ var $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
54253
+ var $8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS = {
54254
+ Tab: true,
54255
+ Escape: true
54498
54256
  };
54499
- _type = new WeakMap();
54500
- var $2aaf608024c21ca1$export$99faa760c7908e4f = _$2aaf608024c21ca1$export$99faa760c7908e4f;
54501
- var _type2;
54502
- var _$2aaf608024c21ca1$export$680ea196effce5f = class _$2aaf608024c21ca1$export$680ea196effce5f {
54503
- constructor(hour = 0, minute = 0, second = 0, millisecond = 0) {
54504
- // This prevents TypeScript from allowing other types with the same fields to match.
54505
- // @ts-ignore
54506
- __privateAdd(this, _type2);
54507
- this.hour = hour;
54508
- this.minute = minute;
54509
- this.second = second;
54510
- this.millisecond = millisecond;
54511
- ($435a2ceaa8778ed8$export$7555de1e070510cb)(this);
54512
- }
54513
- /** Returns a copy of this time. */
54514
- copy() {
54515
- return new _$2aaf608024c21ca1$export$680ea196effce5f(this.hour, this.minute, this.second, this.millisecond);
54257
+ function $8f5a2122b0992be3$var$triggerChangeHandlers(modality, e) {
54258
+ for (let handler of $8f5a2122b0992be3$export$901e90a13c50a14e) handler(modality, e);
54259
+ }
54260
+ function $8f5a2122b0992be3$var$isValidKey(e) {
54261
+ return !(e.metaKey || !($2add3ce32c6007eb$export$9ac100e40613ea10)() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
54262
+ }
54263
+ function $8f5a2122b0992be3$var$handleKeyboardEvent(e) {
54264
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54265
+ if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && $8f5a2122b0992be3$var$isValidKey(e)) {
54266
+ $8f5a2122b0992be3$var$currentModality = "keyboard";
54267
+ $8f5a2122b0992be3$var$triggerChangeHandlers("keyboard", e);
54516
54268
  }
54517
- /** Returns a new `Time` with the given duration added to it. */
54518
- add(duration) {
54519
- return ($435a2ceaa8778ed8$export$7ed87b6bc2506470)(this, duration);
54269
+ }
54270
+ function $8f5a2122b0992be3$var$handlePointerEvent(e) {
54271
+ $8f5a2122b0992be3$var$currentModality = "pointer";
54272
+ "pointerType" in e ? e.pointerType : "mouse";
54273
+ if (e.type === "mousedown" || e.type === "pointerdown") {
54274
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54275
+ $8f5a2122b0992be3$var$triggerChangeHandlers("pointer", e);
54520
54276
  }
54521
- /** Returns a new `Time` with the given duration subtracted from it. */
54522
- subtract(duration) {
54523
- return ($435a2ceaa8778ed8$export$fe34d3a381cd7501)(this, duration);
54277
+ }
54278
+ function $8f5a2122b0992be3$var$handleClickEvent(e) {
54279
+ if (!($caaf0dd3060ed57c$export$95185d699e05d4d7).isOpening && ($b5c62b033c25b96d$export$60278871457622de)(e)) {
54280
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54281
+ $8f5a2122b0992be3$var$currentModality = "virtual";
54524
54282
  }
54525
- /**
54526
- * Returns a new `Time` with the given fields set to the provided values. Other fields will be
54527
- * constrained accordingly.
54528
- */
54529
- set(fields) {
54530
- return ($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields);
54283
+ }
54284
+ function $8f5a2122b0992be3$var$handleFocusEvent(e) {
54285
+ let target = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
54286
+ let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(target);
54287
+ let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(target);
54288
+ if (target === ownerWindow) {
54289
+ $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
54290
+ return;
54531
54291
  }
54532
- /**
54533
- * Returns a new `Time` with the given field adjusted by a specified amount.
54534
- * When the resulting value reaches the limits of the field, it wraps around.
54535
- */
54536
- cycle(field, amount, options) {
54537
- return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
54292
+ if (target === ownerDocument || !e.isTrusted) return;
54293
+ if (!$8f5a2122b0992be3$var$hasEventBeforeFocus && !$8f5a2122b0992be3$var$hasBlurredWindowRecently) {
54294
+ $8f5a2122b0992be3$var$currentModality = "virtual";
54295
+ $8f5a2122b0992be3$var$triggerChangeHandlers("virtual", e);
54538
54296
  }
54539
- /** Converts the time to an ISO 8601 formatted string. */
54540
- toString() {
54541
- return ($58246871e4652552$export$f59dee82248f5ad4)(this);
54297
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
54298
+ $8f5a2122b0992be3$var$hasBlurredWindowRecently = false;
54299
+ }
54300
+ function $8f5a2122b0992be3$var$handleWindowBlur() {
54301
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = false;
54302
+ $8f5a2122b0992be3$var$hasBlurredWindowRecently = true;
54303
+ }
54304
+ function $8f5a2122b0992be3$var$setupGlobalFocusEvents(element) {
54305
+ if (typeof window === "undefined" || typeof document === "undefined") return;
54306
+ const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
54307
+ const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
54308
+ if ($8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject)) return;
54309
+ let focus = windowObject.HTMLElement.prototype.focus;
54310
+ Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
54311
+ configurable: true,
54312
+ writable: true,
54313
+ value: function() {
54314
+ $8f5a2122b0992be3$var$hasEventBeforeFocus = true;
54315
+ focus.apply(this, arguments);
54316
+ }
54317
+ });
54318
+ documentObject.addEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54319
+ documentObject.addEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54320
+ documentObject.addEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
54321
+ windowObject.addEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
54322
+ windowObject.addEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
54323
+ if (typeof PointerEvent !== "undefined") {
54324
+ documentObject.addEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
54325
+ documentObject.addEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
54326
+ documentObject.addEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
54542
54327
  }
54543
- /**
54544
- * Compares this time with another. A negative result indicates that this time is before the given
54545
- * one, and a positive time indicates that it is after.
54546
- */
54547
- compare(b) {
54548
- return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, b);
54328
+ windowObject.addEventListener("beforeunload", () => {
54329
+ $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element);
54330
+ }, {
54331
+ once: true
54332
+ });
54333
+ $8f5a2122b0992be3$export$d90243b58daecda7.set(windowObject, {
54334
+ focus
54335
+ });
54336
+ }
54337
+ var $8f5a2122b0992be3$var$tearDownWindowFocusTracking = (element, loadListener) => {
54338
+ const windowObject = ($d447af545b77c9f1$export$f21a1ffae260145a)(element);
54339
+ const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
54340
+ if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
54341
+ if (!$8f5a2122b0992be3$export$d90243b58daecda7.has(windowObject)) return;
54342
+ Reflect.defineProperty(windowObject.HTMLElement.prototype, "focus", {
54343
+ configurable: true,
54344
+ writable: true,
54345
+ value: $8f5a2122b0992be3$export$d90243b58daecda7.get(windowObject).focus
54346
+ });
54347
+ documentObject.removeEventListener("keydown", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54348
+ documentObject.removeEventListener("keyup", $8f5a2122b0992be3$var$handleKeyboardEvent, true);
54349
+ documentObject.removeEventListener("click", $8f5a2122b0992be3$var$handleClickEvent, true);
54350
+ windowObject.removeEventListener("focus", $8f5a2122b0992be3$var$handleFocusEvent, true);
54351
+ windowObject.removeEventListener("blur", $8f5a2122b0992be3$var$handleWindowBlur, false);
54352
+ if (typeof PointerEvent !== "undefined") {
54353
+ documentObject.removeEventListener("pointerdown", $8f5a2122b0992be3$var$handlePointerEvent, true);
54354
+ documentObject.removeEventListener("pointermove", $8f5a2122b0992be3$var$handlePointerEvent, true);
54355
+ documentObject.removeEventListener("pointerup", $8f5a2122b0992be3$var$handlePointerEvent, true);
54549
54356
  }
54357
+ $8f5a2122b0992be3$export$d90243b58daecda7.delete(windowObject);
54550
54358
  };
54551
- _type2 = new WeakMap();
54552
- var $2aaf608024c21ca1$export$680ea196effce5f = _$2aaf608024c21ca1$export$680ea196effce5f;
54553
- var _type3;
54554
- var _$2aaf608024c21ca1$export$ca871e8dbb80966f = class _$2aaf608024c21ca1$export$ca871e8dbb80966f {
54555
- constructor(...args) {
54556
- // This prevents TypeScript from allowing other types with the same fields to match.
54557
- // @ts-ignore
54558
- __privateAdd(this, _type3);
54559
- let [calendar, era, year, month, day] = $2aaf608024c21ca1$var$shiftArgs(args);
54560
- this.calendar = calendar;
54561
- this.era = era;
54562
- this.year = year;
54563
- this.month = month;
54564
- this.day = day;
54565
- this.hour = args.shift() || 0;
54566
- this.minute = args.shift() || 0;
54567
- this.second = args.shift() || 0;
54568
- this.millisecond = args.shift() || 0;
54569
- ($435a2ceaa8778ed8$export$c4e2ecac49351ef2)(this);
54570
- }
54571
- /** Returns a copy of this date. */
54572
- copy() {
54573
- if (this.era) return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
54574
- else return new _$2aaf608024c21ca1$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
54575
- }
54576
- /** Returns a new `CalendarDateTime` with the given duration added to it. */
54577
- add(duration) {
54578
- return ($435a2ceaa8778ed8$export$e16d8520af44a096)(this, duration);
54359
+ function $8f5a2122b0992be3$export$2f1888112f558a7d(element) {
54360
+ const documentObject = ($d447af545b77c9f1$export$b204af158042fbac)(element);
54361
+ let loadListener;
54362
+ if (documentObject.readyState !== "loading") $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
54363
+ else {
54364
+ loadListener = () => {
54365
+ $8f5a2122b0992be3$var$setupGlobalFocusEvents(element);
54366
+ };
54367
+ documentObject.addEventListener("DOMContentLoaded", loadListener);
54579
54368
  }
54580
- /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
54581
- subtract(duration) {
54582
- return ($435a2ceaa8778ed8$export$4e2d2ead65e5f7e3)(this, duration);
54369
+ return () => $8f5a2122b0992be3$var$tearDownWindowFocusTracking(element, loadListener);
54370
+ }
54371
+ if (typeof document !== "undefined") $8f5a2122b0992be3$export$2f1888112f558a7d();
54372
+ function $8f5a2122b0992be3$export$b9b3dfddab17db27() {
54373
+ return $8f5a2122b0992be3$var$currentModality !== "pointer";
54374
+ }
54375
+ var $8f5a2122b0992be3$var$nonTextInputTypes = /* @__PURE__ */ new Set([
54376
+ "checkbox",
54377
+ "radio",
54378
+ "range",
54379
+ "color",
54380
+ "file",
54381
+ "image",
54382
+ "button",
54383
+ "submit",
54384
+ "reset"
54385
+ ]);
54386
+ function $8f5a2122b0992be3$var$isKeyboardFocusEvent(isTextInput, modality, e) {
54387
+ let eventTarget = e ? ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) : void 0;
54388
+ let ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
54389
+ let ownerWindow = ($d447af545b77c9f1$export$f21a1ffae260145a)(eventTarget);
54390
+ const IHTMLInputElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLInputElement : HTMLInputElement;
54391
+ const IHTMLTextAreaElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLTextAreaElement : HTMLTextAreaElement;
54392
+ const IHTMLElement = typeof ownerWindow !== "undefined" ? ownerWindow.HTMLElement : HTMLElement;
54393
+ const IKeyboardEvent = typeof ownerWindow !== "undefined" ? ownerWindow.KeyboardEvent : KeyboardEvent;
54394
+ let activeElement = ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument);
54395
+ isTextInput = isTextInput || activeElement instanceof IHTMLInputElement && !$8f5a2122b0992be3$var$nonTextInputTypes.has(activeElement.type) || activeElement instanceof IHTMLTextAreaElement || activeElement instanceof IHTMLElement && activeElement.isContentEditable;
54396
+ return !(isTextInput && modality === "keyboard" && e instanceof IKeyboardEvent && !$8f5a2122b0992be3$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
54397
+ }
54398
+ function $8f5a2122b0992be3$export$ec71b4b83ac08ec3(fn, deps, opts) {
54399
+ $8f5a2122b0992be3$var$setupGlobalFocusEvents();
54400
+ (React178.useEffect)(() => {
54401
+ if (opts?.enabled === false) return;
54402
+ let handler = (modality, e) => {
54403
+ if (!$8f5a2122b0992be3$var$isKeyboardFocusEvent(!!opts?.isTextInput, modality, e)) return;
54404
+ fn($8f5a2122b0992be3$export$b9b3dfddab17db27());
54405
+ };
54406
+ $8f5a2122b0992be3$export$901e90a13c50a14e.add(handler);
54407
+ return () => {
54408
+ $8f5a2122b0992be3$export$901e90a13c50a14e.delete(handler);
54409
+ };
54410
+ }, deps);
54411
+ }
54412
+
54413
+ // ../../node_modules/react-aria/dist/private/utils/chain.mjs
54414
+ function $a4e76a5424781910$export$e08e3b67e392101e(...callbacks) {
54415
+ return (...args) => {
54416
+ for (let callback of callbacks) if (typeof callback === "function") callback(...args);
54417
+ };
54418
+ }
54419
+ var $390e54f620492c70$export$d41a04c74483c6ef = /* @__PURE__ */ new Map();
54420
+ if (typeof FinalizationRegistry !== "undefined") new FinalizationRegistry((heldValue) => {
54421
+ $390e54f620492c70$export$d41a04c74483c6ef.delete(heldValue);
54422
+ });
54423
+ function $390e54f620492c70$export$cd8c9cb68f842629(idA, idB) {
54424
+ if (idA === idB) return idA;
54425
+ let setIdsA = $390e54f620492c70$export$d41a04c74483c6ef.get(idA);
54426
+ if (setIdsA) {
54427
+ setIdsA.forEach((ref) => ref.current = idB);
54428
+ return idB;
54583
54429
  }
54584
- /**
54585
- * Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields
54586
- * will be constrained accordingly.
54587
- */
54588
- set(fields) {
54589
- return ($435a2ceaa8778ed8$export$adaa4cf7ef1b65be)(($435a2ceaa8778ed8$export$e5d5e1c1822b6e56)(this, fields), fields);
54430
+ let setIdsB = $390e54f620492c70$export$d41a04c74483c6ef.get(idB);
54431
+ if (setIdsB) {
54432
+ setIdsB.forEach((ref) => ref.current = idA);
54433
+ return idA;
54590
54434
  }
54591
- /**
54592
- * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
54593
- * When the resulting value reaches the limits of the field, it wraps around.
54594
- */
54595
- cycle(field, amount, options) {
54596
- switch (field) {
54597
- case "era":
54598
- case "year":
54599
- case "month":
54600
- case "day":
54601
- return ($435a2ceaa8778ed8$export$d52ced6badfb9a4c)(this, field, amount, options);
54602
- default:
54603
- return ($435a2ceaa8778ed8$export$dd02b3e0007dfe28)(this, field, amount, options);
54435
+ return idB;
54436
+ }
54437
+
54438
+ // ../../node_modules/react-aria/dist/private/utils/mergeRefs.mjs
54439
+ function $4064df0d6f9620e1$export$c9058316764c140e(...refs) {
54440
+ if (refs.length === 1 && refs[0]) return refs[0];
54441
+ return (value) => {
54442
+ let hasCleanup = false;
54443
+ const cleanups = refs.map((ref) => {
54444
+ const cleanup = $4064df0d6f9620e1$var$setRef(ref, value);
54445
+ hasCleanup || (hasCleanup = typeof cleanup == "function");
54446
+ return cleanup;
54447
+ });
54448
+ if (hasCleanup) return () => {
54449
+ cleanups.forEach((cleanup, i) => {
54450
+ if (typeof cleanup === "function") cleanup();
54451
+ else $4064df0d6f9620e1$var$setRef(refs[i], null);
54452
+ });
54453
+ };
54454
+ };
54455
+ }
54456
+ function $4064df0d6f9620e1$var$setRef(ref, value) {
54457
+ if (typeof ref === "function") return ref(value);
54458
+ else if (ref != null) ref.current = value;
54459
+ }
54460
+
54461
+ // ../../node_modules/clsx/dist/clsx.mjs
54462
+ function r2(e) {
54463
+ var t, f, n = "";
54464
+ if ("string" == typeof e || "number" == typeof e) n += e;
54465
+ else if ("object" == typeof e) if (Array.isArray(e)) {
54466
+ var o = e.length;
54467
+ for (t = 0; t < o; t++) e[t] && (f = r2(e[t])) && (n && (n += " "), n += f);
54468
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
54469
+ return n;
54470
+ }
54471
+ function clsx() {
54472
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r2(e)) && (n && (n += " "), n += t);
54473
+ return n;
54474
+ }
54475
+ var clsx_default = clsx;
54476
+
54477
+ // ../../node_modules/react-aria/dist/private/utils/mergeProps.mjs
54478
+ function $bbaa08b3cd72f041$export$9d1611c77c2fe928(...args) {
54479
+ let result2 = {
54480
+ ...args[0]
54481
+ };
54482
+ for (let i = 1; i < args.length; i++) {
54483
+ let props2 = args[i];
54484
+ for (let key in props2) {
54485
+ let a2 = result2[key];
54486
+ let b = props2[key];
54487
+ if (typeof a2 === "function" && typeof b === "function" && // This is a lot faster than a regex.
54488
+ key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
54489
+ 65 && key.charCodeAt(2) <= /* 'Z' */
54490
+ 90) result2[key] = ($a4e76a5424781910$export$e08e3b67e392101e)(a2, b);
54491
+ else if ((key === "className" || key === "UNSAFE_className") && typeof a2 === "string" && typeof b === "string") result2[key] = (clsx_default)(a2, b);
54492
+ else if (key === "id" && a2 && b) result2.id = ($390e54f620492c70$export$cd8c9cb68f842629)(a2, b);
54493
+ else if (key === "ref" && a2 && b) result2.ref = ($4064df0d6f9620e1$export$c9058316764c140e)(a2, b);
54494
+ else result2[key] = b !== void 0 ? b : a2;
54604
54495
  }
54605
54496
  }
54606
- /** Converts the date to a native JavaScript Date object in the given time zone. */
54607
- toDate(timeZone, disambiguation) {
54608
- return ($d07e34cce18680fd$export$e67a095c620b86fe)(this, timeZone, disambiguation);
54609
- }
54610
- /** Converts the date to an ISO 8601 formatted string. */
54611
- toString() {
54612
- return ($58246871e4652552$export$4223de14708adc63)(this);
54613
- }
54614
- /**
54615
- * Compares this date with another. A negative result indicates that this date is before the given
54616
- * one, and a positive date indicates that it is after.
54617
- */
54618
- compare(b) {
54619
- let res = ($ad063034c8620db8$export$68781ddf31c0090f)(this, b);
54620
- if (res === 0) return ($ad063034c8620db8$export$c19a80a9721b80f6)(this, ($d07e34cce18680fd$export$b21e0b124e224484)(b));
54621
- return res;
54622
- }
54623
- };
54624
- _type3 = new WeakMap();
54625
- var $2aaf608024c21ca1$export$ca871e8dbb80966f = _$2aaf608024c21ca1$export$ca871e8dbb80966f;
54497
+ return result2;
54498
+ }
54499
+ function $1e74c67db218ce67$export$f8168d8dd8fd66e6(props2) {
54500
+ let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props2;
54501
+ const onBlur = (React178.useCallback)((e) => {
54502
+ if (($23f2114a1b82827e$export$e58f029f0fbfdb29)(e) === e.currentTarget) {
54503
+ if (onBlurProp) onBlurProp(e);
54504
+ if (onFocusChange) onFocusChange(false);
54505
+ return true;
54506
+ }
54507
+ }, [
54508
+ onBlurProp,
54509
+ onFocusChange
54510
+ ]);
54511
+ const onSyntheticFocus = ($a92dc41f639950be$export$715c682d09d639cc)(onBlur);
54512
+ const onFocus = (React178.useCallback)((e) => {
54513
+ let eventTarget = ($23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
54514
+ const ownerDocument = ($d447af545b77c9f1$export$b204af158042fbac)(eventTarget);
54515
+ const activeElement = ownerDocument ? ($23f2114a1b82827e$export$cd4e5573fbe2b576)(ownerDocument) : ($23f2114a1b82827e$export$cd4e5573fbe2b576)();
54516
+ if (eventTarget === e.currentTarget && eventTarget === activeElement) {
54517
+ if (onFocusProp) onFocusProp(e);
54518
+ if (onFocusChange) onFocusChange(true);
54519
+ onSyntheticFocus(e);
54520
+ }
54521
+ }, [
54522
+ onFocusChange,
54523
+ onFocusProp,
54524
+ onSyntheticFocus
54525
+ ]);
54526
+ return {
54527
+ focusProps: {
54528
+ onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0,
54529
+ onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0
54530
+ }
54531
+ };
54532
+ }
54533
+ function $03e8ab2d84d7657a$export$4338b53315abf666(ref) {
54534
+ const objRef = (React178.useRef)(null);
54535
+ const cleanupRef = (React178.useRef)(void 0);
54536
+ const refEffect = (React178.useCallback)((instance) => {
54537
+ if (typeof ref === "function") {
54538
+ const refCallback = ref;
54539
+ const refCleanup = refCallback(instance);
54540
+ return () => {
54541
+ if (typeof refCleanup === "function") refCleanup();
54542
+ else refCallback(null);
54543
+ };
54544
+ } else if (ref) {
54545
+ ref.current = instance;
54546
+ return () => {
54547
+ ref.current = null;
54548
+ };
54549
+ }
54550
+ }, [
54551
+ ref
54552
+ ]);
54553
+ return (React178.useMemo)(
54554
+ () => ({
54555
+ get current() {
54556
+ return objRef.current;
54557
+ },
54558
+ set current(value) {
54559
+ objRef.current = value;
54560
+ if (cleanupRef.current) {
54561
+ cleanupRef.current();
54562
+ cleanupRef.current = void 0;
54563
+ }
54564
+ if (value != null) cleanupRef.current = refEffect(value);
54565
+ }
54566
+ }),
54567
+ // oxlint-disable-next-line react/react-compiler
54568
+ [
54569
+ refEffect
54570
+ ]
54571
+ );
54572
+ }
54573
+ var $fe16bffc7a557bf0$var$useEarlyEffect = (React178__default.default)["useInsertionEffect"] ?? ($c4867b2f328c2698$export$e5c5a5f917a5871c);
54574
+ function $fe16bffc7a557bf0$export$7f54fc3180508a52(fn) {
54575
+ const ref = (React178.useRef)(null);
54576
+ $fe16bffc7a557bf0$var$useEarlyEffect(() => {
54577
+ ref.current = fn;
54578
+ }, [
54579
+ fn
54580
+ ]);
54581
+ return (React178.useCallback)((...args) => {
54582
+ const f = ref.current;
54583
+ return f?.(...args);
54584
+ }, []);
54585
+ }
54586
+ function $48a7d519b337145d$export$4eaf04e54aa8eed6() {
54587
+ let globalListeners = (React178.useRef)(/* @__PURE__ */ new Map());
54588
+ let addGlobalListener = (React178.useCallback)((eventTarget, type, listener, options) => {
54589
+ let fn = options?.once ? (...args) => {
54590
+ globalListeners.current.delete(listener);
54591
+ listener(...args);
54592
+ } : listener;
54593
+ globalListeners.current.set(listener, {
54594
+ type,
54595
+ eventTarget,
54596
+ fn,
54597
+ options
54598
+ });
54599
+ eventTarget.addEventListener(type, fn, options);
54600
+ }, []);
54601
+ let removeGlobalListener = (React178.useCallback)((eventTarget, type, listener, options) => {
54602
+ let fn = globalListeners.current.get(listener)?.fn || listener;
54603
+ eventTarget.removeEventListener(type, fn, options);
54604
+ globalListeners.current.delete(listener);
54605
+ }, []);
54606
+ let removeAllGlobalListeners = (React178.useCallback)(() => {
54607
+ globalListeners.current.forEach((value, key) => {
54608
+ removeGlobalListener(value.eventTarget, value.type, key, value.options);
54609
+ });
54610
+ }, [
54611
+ removeGlobalListener
54612
+ ]);
54613
+ (React178.useEffect)(() => {
54614
+ return removeAllGlobalListeners;
54615
+ }, [
54616
+ removeAllGlobalListeners
54617
+ ]);
54618
+ return {
54619
+ addGlobalListener,
54620
+ removeGlobalListener,
54621
+ removeAllGlobalListeners
54622
+ };
54623
+ }
54626
54624
  function $2c9edc598a03d523$export$420e68273165f4ec(props2) {
54627
54625
  let { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props2;
54628
54626
  let state = (React178.useRef)({