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