@wix/form-public 0.579.0 → 0.581.0

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